Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revenant widzi duchy i się teleportuje #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions code/modules/antagonists/revenant/revenant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
var/stasis = FALSE
mob_biotypes = list(MOB_SPIRIT)
incorporeal_move = INCORPOREAL_MOVE_JAUNT
see_invisible = SEE_INVISIBLE_OBSERVER
invisibility = INVISIBILITY_REVENANT
health = INFINITY //Revenants don't use health, they use essence instead
maxHealth = INFINITY
Expand Down Expand Up @@ -70,16 +71,29 @@

/mob/living/simple_animal/revenant/Initialize(mapload)
. = ..()
// more rev abilities are in 'revenant_abilities.dm'
AddSpell(new /obj/effect/proc_holder/spell/targeted/night_vision/revenant(null))
AddSpell(new /obj/effect/proc_holder/spell/self/revenant_phase_shift(null))
AddSpell(new /obj/effect/proc_holder/spell/targeted/telepathy/revenant(null))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/defile(null))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/overload(null))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/blight(null))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/malfunction(null))
check_rev_teleport() // they're spawned in non-station for some reason...
random_revenant_name()
AddComponent(/datum/component/tracking_beacon, "ghost", null, null, TRUE, "#9e4d91", TRUE, TRUE)

/mob/living/simple_animal/revenant/onTransitZ(old_z, new_z)
. = ..()
check_rev_teleport()

/mob/living/simple_animal/revenant/proc/check_rev_teleport()
var/obj/effect/proc_holder/spell/self/rev_teleport/revtele = locate() in mob_spell_list
if(!is_station_level(src.z) && !revtele) // give them an ability to back to the station
AddSpell(new /obj/effect/proc_holder/spell/self/rev_teleport(null))
else if(is_station_level(src.z) && revtele) // you're back to the station. Remove tele spell.
RemoveSpell(revtele)

/mob/living/simple_animal/revenant/Destroy()
. = ..()

Expand Down
77 changes: 75 additions & 2 deletions code/modules/antagonists/revenant/revenant_abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
if(modifiers["alt"])
AltClickNoInteract(src, A)
return

if(modifiers["ctrl"])
CtrlClickOn(A)
return

if(ishuman(A))
if(A in drained_mobs)
to_chat(src, "<span class='revenwarning'>[A]'s soul is dead and empty.</span>" )
Expand All @@ -26,6 +26,42 @@
if(T == get_turf(src))
T.check_z_travel(src)

// double-click or ctrl-click for two abilities
/mob/living/simple_animal/revenant/CtrlClickOn(atom/A)
if(incorporeal_move == INCORPOREAL_MOVE_JAUNT)
check_orbitable(A)
return
..() // pull the thing

/mob/living/simple_animal/revenant/DblClickOn(atom/A, params)
if(get_dist(src, A) < 5) // message spam when you spam phase shift is annoying
check_orbitable(A)
..()

// Orbit: literally obrits people like how ghosts do
/mob/living/simple_animal/revenant/proc/check_orbitable(atom/A)
if(revealed)
to_chat(src, "<span class='revenwarning'>You can't orbit while you're revealed!</span>")
return
if(!Adjacent(A))
to_chat(src, "<span class='revenwarning'>You can only orbit things that are next to you!</span>")
return
if(isobserver(A) || isrevenant(A))
to_chat(src, "<span class='revenwarning'>You can't orbit a ghost!</span>")
return
if(notransform || inhibited || !incorporeal_move_check(A))
return
var/icon/I = icon(A.icon, A.icon_state, A.dir)
var/orbitsize = (I.Width()+I.Height())*0.5
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
orbit(A, orbitsize)

/mob/living/simple_animal/revenant/orbit(atom/target)
setDir(SOUTH) // reset dir so the right directional sprites show up
return ..()




//Harvest; activated by clicking the target, will try to drain their essence.
/mob/living/simple_animal/revenant/proc/Harvest(mob/living/carbon/human/target)
Expand Down Expand Up @@ -108,6 +144,10 @@
draining = FALSE
essence_drained = 0

// -------------------------------------------
// ------------- action skills ---------------
// -------------------------------------------

//Toggle night vision: lets the revenant toggle its night vision
/obj/effect/proc_holder/spell/targeted/night_vision/revenant
charge_max = 0
Expand All @@ -117,6 +157,39 @@
action_icon_state = "r_nightvision"
action_background_icon_state = "bg_revenant"

// Recall to Station: teleport & recall to the station
/obj/effect/proc_holder/spell/self/rev_teleport
name = "Recall to Station"
desc = "Teleport to the station."
charge_max = 0
panel = "Revenant Abilities"
action_icon = 'icons/mob/actions/actions_revenant.dmi'
action_icon_state = "r_teleport"
action_background_icon_state = "bg_revenant"
clothes_req = FALSE

/obj/effect/proc_holder/spell/self/rev_teleport/cast(mob/living/simple_animal/revenant/user = usr)
if(!isrevenant(user))
return
if(is_station_level(user.z))
to_chat(user, "<span class='revenwarning'>Recalling yourself to the station is only available when you're not in the station.</span>")
return
else
if(user.revealed)
to_chat(user, "<span class='revenwarning'>Recalling yourself to the station is only available when you're invisible.</span>")
return

to_chat(user, "<span class='revennotice'>You start to concentrate recalling yourself to the station.</span>")
if(do_after(user, 30) && !user.revealed)
if(QDELETED(src)) // it's bad when someone spams this...
return
var/turf/targetturf = get_random_station_turf()
if(!do_teleport(user, targetturf, channel = TELEPORT_CHANNEL_CULT, forced=TRUE))
to_chat(user, "<span class='revenwarning'>You have failed to recall yourself to the station... You should try again.</span>")
else
user.reveal(80)
user.stun(40)

//Transmit: the revemant's only direct way to communicate. Sends a single message silently to a single mob
/obj/effect/proc_holder/spell/targeted/telepathy/revenant
name = "Revenant Transmit"
Expand Down
Binary file modified icons/mob/actions/actions_revenant.dmi
Binary file not shown.
Loading