mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
Gives Revenant the ability to orbit adjacent things with secondary attack (#60200)
Leverages right click to give Revenant something I felt it should have had when first implemented, but I can understand now it's not a low effort undertaking with the snowflakeness of incorporeal jaunt code that only runs on Move() 🤮
I put a lot of care into making sure this won't break or bypass jaunting counters like holy water and salt.
This commit is contained in:
@@ -262,6 +262,7 @@
|
||||
to_chat(src, span_revenwarning("You have been revealed!"))
|
||||
unreveal_time = unreveal_time + time
|
||||
update_spooky_icon()
|
||||
orbiting?.end_orbit(src)
|
||||
|
||||
/mob/living/simple_animal/revenant/proc/stun(time)
|
||||
if(!src)
|
||||
@@ -276,6 +277,7 @@
|
||||
to_chat(src, span_revenwarning("You cannot move!"))
|
||||
unstun_time = unstun_time + time
|
||||
update_spooky_icon()
|
||||
orbiting?.end_orbit(src)
|
||||
|
||||
/mob/living/simple_animal/revenant/proc/update_spooky_icon()
|
||||
if(revealed)
|
||||
@@ -345,6 +347,43 @@
|
||||
alpha=255
|
||||
stasis = FALSE
|
||||
|
||||
/mob/living/simple_animal/revenant/orbit(atom/target)
|
||||
setDir(SOUTH) // reset dir so the right directional sprites show up
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/revenant/Moved(atom/OldLoc)
|
||||
if(!orbiting) // only needed when orbiting
|
||||
return ..()
|
||||
if(incorporeal_move_check(src))
|
||||
return ..()
|
||||
|
||||
// back back back it up, the orbitee went somewhere revenant cannot
|
||||
orbiting?.end_orbit(src)
|
||||
abstract_move(OldLoc) // gross but maybe orbit component will be able to check pre move in the future
|
||||
|
||||
/mob/living/simple_animal/revenant/stop_orbit(datum/component/orbiter/orbits)
|
||||
// reset the simple_flying animation
|
||||
animate(src, pixel_y = 2, time = 1 SECONDS, loop = -1, flags = ANIMATION_RELATIVE)
|
||||
animate(pixel_y = -2, time = 1 SECONDS, flags = ANIMATION_RELATIVE)
|
||||
return ..()
|
||||
|
||||
/// Incorporeal move check: blocked by holy-watered tiles and salt piles.
|
||||
/mob/living/simple_animal/revenant/proc/incorporeal_move_check(atom/destination)
|
||||
var/turf/open/floor/stepTurf = get_turf(destination)
|
||||
if(stepTurf)
|
||||
var/obj/effect/decal/cleanable/food/salt/salt = locate() in stepTurf
|
||||
if(salt)
|
||||
to_chat(src, span_warning("[salt] bars your passage!"))
|
||||
reveal(20)
|
||||
stun(20)
|
||||
return
|
||||
if(stepTurf.turf_flags & NOJAUNT)
|
||||
to_chat(src, span_warning("Some strange aura is blocking the way."))
|
||||
return
|
||||
if(locate(/obj/effect/blessing) in stepTurf)
|
||||
to_chat(src, span_warning("Holy energies block your path!"))
|
||||
return
|
||||
return TRUE
|
||||
|
||||
//reforming
|
||||
/obj/item/ectoplasm/revenant
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
if(LAZYACCESS(modifiers, ALT_CLICK))
|
||||
AltClickNoInteract(src, A)
|
||||
return
|
||||
if(LAZYACCESS(modifiers, RIGHT_CLICK))
|
||||
ranged_secondary_attack(A, modifiers)
|
||||
return
|
||||
|
||||
if(ishuman(A))
|
||||
if(A in drained_mobs)
|
||||
@@ -14,6 +17,13 @@
|
||||
else if(in_range(src, A))
|
||||
Harvest(A)
|
||||
|
||||
/mob/living/simple_animal/revenant/ranged_secondary_attack(atom/target, modifiers)
|
||||
if(revealed || notransform || inhibited || !Adjacent(target) || !incorporeal_move_check(target))
|
||||
return
|
||||
var/icon/I = icon(target.icon,target.icon_state,target.dir)
|
||||
var/orbitsize = (I.Width()+I.Height())*0.5
|
||||
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
|
||||
orbit(target, orbitsize)
|
||||
|
||||
//Harvest; activated by clicking the target, will try to drain their essence.
|
||||
/mob/living/simple_animal/revenant/proc/Harvest(mob/living/carbon/human/target)
|
||||
|
||||
@@ -248,8 +248,9 @@
|
||||
if(INCORPOREAL_MOVE_JAUNT) //Incorporeal move, but blocked by holy-watered tiles and salt piles.
|
||||
var/turf/open/floor/stepTurf = get_step(L, direct)
|
||||
if(stepTurf)
|
||||
for(var/obj/effect/decal/cleanable/food/salt/S in stepTurf)
|
||||
to_chat(L, span_warning("[S] bars your passage!"))
|
||||
var/obj/effect/decal/cleanable/food/salt/salt = locate() in stepTurf
|
||||
if(salt)
|
||||
to_chat(L, span_warning("[salt] bars your passage!"))
|
||||
if(isrevenant(L))
|
||||
var/mob/living/simple_animal/revenant/R = L
|
||||
R.reveal(20)
|
||||
@@ -258,7 +259,7 @@
|
||||
if(stepTurf.turf_flags & NOJAUNT)
|
||||
to_chat(L, span_warning("Some strange aura is blocking the way."))
|
||||
return
|
||||
if (locate(/obj/effect/blessing, stepTurf))
|
||||
if(locate(/obj/effect/blessing) in stepTurf)
|
||||
to_chat(L, span_warning("Holy energies block your path!"))
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user