mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
You can now crash into things with leap (#25345)
* I'm happy with this * Lewc review * Adds varedit safeties * Update code/game/dna/mutations/mutation_powers.dm Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --------- Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
@@ -478,6 +478,7 @@
|
||||
invocation_type = "none"
|
||||
|
||||
action_icon_state = "genetic_jump"
|
||||
var/leap_distance = 10
|
||||
|
||||
/datum/spell/leap/create_new_targeting()
|
||||
return new /datum/spell_targeting/self
|
||||
@@ -510,15 +511,25 @@
|
||||
user.layer = 9
|
||||
|
||||
user.flying = TRUE
|
||||
for(var/i=0, i<10, i++)
|
||||
for(var/i in 1 to leap_distance)
|
||||
var/turf/hit_turf = get_step(user, user.dir)
|
||||
var/atom/hit_atom = get_blocking_atom(hit_turf)
|
||||
if(hit_atom)
|
||||
hit_atom.hit_by_thrown_mob(user, damage = 10)
|
||||
break
|
||||
|
||||
step(user, user.dir)
|
||||
if(i < 5) user.pixel_y += 8
|
||||
else user.pixel_y -= 8
|
||||
if(i < 6)
|
||||
user.pixel_y += 8
|
||||
else
|
||||
user.pixel_y -= 8
|
||||
sleep(1)
|
||||
|
||||
user.flying = prevFlying
|
||||
user.pixel_y = 0 // In case leap was varedited to be longer or shorter
|
||||
|
||||
if(HAS_TRAIT(user, TRAIT_FAT) && prob(66))
|
||||
user.visible_message("<span class='danger'>[user.name]</b> crashes due to [user.p_their()] heavy weight!</span>")
|
||||
user.visible_message("<span class='danger'><b>[user.name]</b> crashes due to [user.p_their()] heavy weight!</span>")
|
||||
//playsound(user.loc, 'zhit.wav', 50, 1)
|
||||
user.AdjustWeakened(20 SECONDS)
|
||||
user.AdjustStunned(10 SECONDS)
|
||||
@@ -541,6 +552,24 @@
|
||||
container.pixel_x = 0
|
||||
container.pixel_y = 0
|
||||
|
||||
/datum/spell/leap/proc/get_blocking_atom(turf/turf_to_check)
|
||||
if(!turf_to_check)
|
||||
return FALSE
|
||||
|
||||
if(turf_to_check.density)
|
||||
return turf_to_check
|
||||
|
||||
for(var/atom/movable/hit_thing in turf_to_check)
|
||||
if(isliving(hit_thing))
|
||||
var/mob/living/hit_mob = hit_thing
|
||||
return hit_mob.density
|
||||
|
||||
if(isobj(hit_thing))
|
||||
var/obj/hit_obj = hit_thing
|
||||
return hit_obj.density
|
||||
|
||||
return FALSE
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// WAS: /datum/bioEffect/polymorphism
|
||||
|
||||
Reference in New Issue
Block a user