Skip to content

Commit

Permalink
Stun+Knockdown combo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 30, 2023
1 parent d931172 commit 3efb737
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 67 deletions.
3 changes: 2 additions & 1 deletion code/datums/ammo/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
/datum/ammo/proc/knockback_effects(mob/living/living_mob, obj/projectile/fired_projectile)
if(iscarbonsizexeno(living_mob))
var/mob/living/carbon/xenomorph/target = living_mob
target.apply_effect(0.7, WEAKEN) // 0.9 seconds of stun, per agreement from Balance Team when switched from MC stuns to exact stuns
target.Stun(0.7) // Previous comment said they believed 0.7 was 0.9s and that the balance team approved this. Geez...
target.KnockDown(0.7)
target.apply_effect(1, SUPERSLOW)
target.apply_effect(2, SLOW)
to_chat(target, SPAN_XENODANGER("You are shaken by the sudden impact!"))
Expand Down
3 changes: 2 additions & 1 deletion code/datums/ammo/bullet/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
if(iscarbonsizexeno(living_mob))
var/mob/living/carbon/xenomorph/target = living_mob
to_chat(target, SPAN_XENODANGER("You are shaken and slowed by the sudden impact!"))
target.apply_effect(0.5, WEAKEN)
target.KnockDown(0.5) // purely for visual effect, noone actually cares
target.Stun(0.5)
target.apply_effect(2, SUPERSLOW)
target.apply_effect(5, SLOW)
else
Expand Down
12 changes: 8 additions & 4 deletions code/datums/ammo/bullet/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
if(iscarbonsizexeno(living_mob))
var/mob/living/carbon/xenomorph/target = living_mob
to_chat(target, SPAN_XENODANGER("You are shaken and slowed by the sudden impact!"))
target.apply_effect(0.5, WEAKEN)
target.KnockDown(0.5) // If you ask me the KD should be left out, but players like their visual cues
target.Stun(0.5)
target.apply_effect(1, SUPERSLOW)
target.apply_effect(3, SLOW)
else
Expand Down Expand Up @@ -249,7 +250,8 @@
if(iscarbonsizexeno(living_mob))
var/mob/living/carbon/xenomorph/target = living_mob
to_chat(target, SPAN_XENODANGER("You are shaken and slowed by the sudden impact!"))
target.apply_effect(0.5, WEAKEN)
target.KnockDown(0.5) // If you ask me the KD should be left out, but players like their visual cues
target.Stun(0.5)
target.apply_effect(2, SUPERSLOW)
target.apply_effect(5, SLOW)
else
Expand Down Expand Up @@ -338,7 +340,8 @@
return

shake_camera(M, 3, 4)
M.apply_effect(2, WEAKEN)
M.KnockDown(2) // If you ask me the KD should be left out, but players like their visual cues
M.Stun(2)
M.apply_effect(4, SLOW)
if(iscarbonsizexeno(M))
to_chat(M, SPAN_XENODANGER("The impact knocks you off your feet!"))
Expand All @@ -351,7 +354,8 @@
if(iscarbonsizexeno(living_mob))
var/mob/living/carbon/xenomorph/target = living_mob
to_chat(target, SPAN_XENODANGER("You are shaken and slowed by the sudden impact!"))
target.apply_effect(0.5, WEAKEN)
target.KnockDown(0.5) // If you ask me the KD should be left out, but players like their visual cues
target.Stun(0.5)
target.apply_effect(2, SUPERSLOW)
target.apply_effect(5, SLOW)
else
Expand Down
17 changes: 4 additions & 13 deletions code/datums/ammo/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
icon_state = "shrapnel_plasma"
damage_type = BURN

/datum/ammo/bullet/shrapnel/plasma/on_hit_mob(mob/hit_mob, obj/projectile/hit_projectile)
hit_mob.apply_effect(2, WEAKEN)
/datum/ammo/bullet/shrapnel/plasma/on_hit_mob(mob/living/hit_mob, obj/projectile/hit_projectile)
hit_mob.Stun(2)

/datum/ammo/energy/yautja/caster
name = "root caster bolt"
Expand Down Expand Up @@ -141,12 +141,8 @@
log_attack("[key_name(C)] was stunned by a high power stun bolt from [key_name(P.firer)] at [get_area(P)]")

if(ishuman(C))
var/mob/living/carbon/human/H = C
stun_time++
H.apply_effect(stun_time, WEAKEN)
else
M.apply_effect(stun_time, WEAKEN)

C.apply_effect(stun_time, WEAKEN)
C.apply_effect(stun_time, STUN)
..()

Expand Down Expand Up @@ -217,12 +213,7 @@
continue
to_chat(M, SPAN_DANGER("A powerful electric shock ripples through your body, freezing you in place!"))
M.apply_effect(stun_time, STUN)

if (ishuman(M))
var/mob/living/carbon/human/H = M
H.apply_effect(stun_time, WEAKEN)
else
M.apply_effect(stun_time, WEAKEN)
M.apply_effect(stun_time, WEAKEN)

/datum/ammo/energy/yautja/rifle/bolt
name = "plasma rifle bolt"
Expand Down
2 changes: 0 additions & 2 deletions code/datums/ammo/rocket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
/datum/ammo/rocket/ap/on_hit_mob(mob/M, obj/projectile/P)
var/turf/T = get_turf(M)
M.ex_act(150, P.dir, P.weapon_cause_data, 100)
M.apply_effect(2, WEAKEN)
M.apply_effect(2, PARALYZE)
if(ishuman_strict(M)) // No yautya or synths. Makes humans gib on direct hit.
M.ex_act(300, P.dir, P.weapon_cause_data, 100)
Expand All @@ -84,7 +83,6 @@
var/hit_something = 0
for(var/mob/M in T)
M.ex_act(150, P.dir, P.weapon_cause_data, 100)
M.apply_effect(4, WEAKEN)
M.apply_effect(4, PARALYZE)
hit_something = 1
continue
Expand Down
12 changes: 7 additions & 5 deletions code/datums/ammo/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
if(!isxeno(M))
if(insta_neuro)
if(M.GetKnockDownDuration() < 3) // Why are you not using KnockDown(3) ? Do you even know 3 is SIX seconds ? So many questions left unanswered.
M.adjust_effect(1 * power, WEAKEN)
M.KnockDown(power)
M.Stun(power)
return

if(ishuman(M))
Expand All @@ -66,7 +67,8 @@

if(no_clothes_neuro)
if(M.GetKnockDownDuration() < 5) // Nobody actually knows what this means. Supposedly it means less than 10 seconds. Frankly if you get locked into 10s of knockdown to begin with there are bigger issues.
M.adjust_effect(1 * power, WEAKEN) // KD them a bit more
M.KnockDown(power)
M.Stun(power)
M.visible_message(SPAN_DANGER("[M] falls prone."))

/proc/apply_scatter_neuro(mob/living/M)
Expand All @@ -79,9 +81,9 @@
H.visible_message(SPAN_DANGER("[M] shrugs off the neurotoxin!"))
return

if(M.GetKnockDownDuration() < 0.7) // Worth noting that the value has 0.25~0.5 resolution so this is completely stupid. Stop microdosing balance and get real
M.apply_effect(0.7, WEAKEN)
M.visible_message(SPAN_DANGER("[M] falls prone."))
M.KnockDown(0.7) // Completely arbitrary values from another time where stun timers incorrectly stacked. Kill as needed.
M.Stun(0.7)
M.visible_message(SPAN_DANGER("[M] falls prone."))

/datum/ammo/xeno/toxin/on_hit_mob(mob/M,obj/projectile/P)
if(ishuman(M))
Expand Down
3 changes: 2 additions & 1 deletion code/game/gamemodes/colonialmarines/huntergames.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@

H.skills = null //no restriction on what the contestants can do

H.apply_effect(15, WEAKEN)
H.KnockDown(15)
H.Stun(15)
H.nutrition = NUTRITION_NORMAL

var/randjob = rand(0,10)
Expand Down
3 changes: 2 additions & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list(
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(5, 1, src)
sparks.start()
xeno.apply_effect(1, WEAKEN)
xeno.KnockDown(1)
xeno.Stun(1)

playsound(src, 'sound/effects/metalhit.ogg', 50, TRUE)
xeno.visible_message(SPAN_XENOWARNING("\The [xeno] strikes \the [src] with its tail!"), SPAN_XENOWARNING("You strike \the [src] with your tail!"))
Expand Down
6 changes: 4 additions & 2 deletions code/game/machinery/flasher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
src.last_flash = world.time
use_power(1500)

for (var/mob/O in viewers(src, null))
for (var/mob/living/O in viewers(src, null))
if (get_dist(src, O) > src.range)
continue

Expand All @@ -72,7 +72,9 @@
if (istype(O, /mob/living/carbon/xenomorph))//So aliens don't get flashed (they have no external eyes)/N
continue

O.apply_effect(strength, WEAKEN)
O.KnockDown(strength)
O.Stun(strength)

if (istype(O, /mob/living/carbon/human))
var/mob/living/carbon/human/H = O
var/datum/internal_organ/eyes/E = H.internal_organs_by_name["eyes"]
Expand Down
5 changes: 3 additions & 2 deletions code/modules/cm_marines/NonLethalRestraints.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
to_chat(user, SPAN_WARNING("\The [src] is out of charge."))
add_fingerprint(user)

/obj/item/weapon/stunprod/attack(mob/M, mob/user)
/obj/item/weapon/stunprod/attack(mob/living/M, mob/user)
if(isrobot(M))
..()
return
Expand All @@ -43,7 +43,8 @@
return

if(status)
M.apply_effect(6, WEAKEN)
M.KnockDown(6)
M.Stun(6)
charges -= 2
M.visible_message(SPAN_DANGER("[M] has been prodded with the [src] by [user]!"))

Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@
#undef NEURO_TOUCH_DELAY

/datum/behavior_delegate/sentinel_base/proc/paralyzing_slash(mob/living/carbon/human/human_target)
human_target.apply_effect(2, WEAKEN)
human_target.KnockDown(2)
human_target.Stun(2)
to_chat(human_target, SPAN_XENOHIGHDANGER("You fall over, paralyzed by the toxin!"))
3 changes: 2 additions & 1 deletion code/modules/projectiles/guns/specialist/sniper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@
if(PMC_sniper.body_position == STANDING_UP && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/smartgunner/veteran/pmc) && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/veteran))
PMC_sniper.visible_message(SPAN_WARNING("[PMC_sniper] is blown backwards from the recoil of the [src.name]!"),SPAN_HIGHDANGER("You are knocked prone by the blowback!"))
step(PMC_sniper,turn(PMC_sniper.dir,180))
PMC_sniper.apply_effect(5, WEAKEN)
PMC_sniper.KnockDown(5)
PMC_sniper.Stun(5)

//Type 88 //Based on the actual Dragunov DMR rifle.

Expand Down
3 changes: 1 addition & 2 deletions code/modules/reagents/chemistry_reagents/drink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@
/datum/reagent/neurotoxin/on_mob_life(mob/living/carbon/M)
. = ..()
if(!.) return
if(!HAS_TRAIT(src, TRAIT_FLOORED))
M.apply_effect(5, WEAKEN)
M.KnockDown(5)
if(!data) data = 1
data++
M.dizziness +=6
Expand Down
3 changes: 2 additions & 1 deletion code/modules/reagents/chemistry_reagents/toxin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
M.status_flags |= FAKEDEATH
ADD_TRAIT(M, TRAIT_IMMOBILIZED, FAKEDEATH_TRAIT)
M.apply_damage(0.5*REM, OXY)
M.apply_effect(2, WEAKEN)
M.KnockDown(2)
M.Stun(2)
M.silent = max(M.silent, 10)

/datum/reagent/toxin/zombiepowder/on_delete()
Expand Down
15 changes: 7 additions & 8 deletions code/modules/shuttle/helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,13 @@
lockdown_door(air)

/datum/door_controller/single/proc/bump_at_turf(turf/door_turf)
for(var/mob/blocking_mob in door_turf)
if(isliving(blocking_mob))
to_chat(blocking_mob, SPAN_HIGHDANGER("You get thrown back as the [label] doors slam shut!"))
blocking_mob.apply_effect(4, WEAKEN)
for(var/turf/target_turf in orange(1, door_turf)) // Forcemove to a non shuttle turf
if(!istype(target_turf, /turf/open/shuttle) && !istype(target_turf, /turf/closed/shuttle))
blocking_mob.forceMove(target_turf)
break
for(var/mob/living/blocking_mob in door_turf)
to_chat(blocking_mob, SPAN_HIGHDANGER("You get thrown back as the [label] doors slam shut!"))
blocking_mob.KnockDown(4)
for(var/turf/target_turf in orange(1, door_turf)) // Forcemove to a non shuttle turf
if(!istype(target_turf, /turf/open/shuttle) && !istype(target_turf, /turf/closed/shuttle))
blocking_mob.forceMove(target_turf)
break

/datum/door_controller/proc/lockdown_door(obj/structure/machinery/door/target)
if(istype(target, /obj/structure/machinery/door/airlock))
Expand Down
15 changes: 7 additions & 8 deletions code/modules/shuttle/shuttles/ert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@
INVOKE_ASYNC(src, PROC_REF(lockdown_door_launch), door)

/obj/docking_port/mobile/emergency_response/proc/lockdown_door_launch(obj/structure/machinery/door/airlock/air)
for(var/mob/blocking_mob in air.loc) // Bump all mobs outta the way for outside airlocks of shuttles
if(isliving(blocking_mob))
to_chat(blocking_mob, SPAN_HIGHDANGER("You get thrown back as the dropship doors slam shut!"))
blocking_mob.apply_effect(4, WEAKEN)
for(var/turf/target_turf in orange(1, air)) // Forcemove to a non shuttle turf
if(!istype(target_turf, /turf/open/shuttle) && !istype(target_turf, /turf/closed/shuttle))
blocking_mob.forceMove(target_turf)
break
for(var/mob/living/blocking_mob in air.loc) // Bump all mobs outta the way for outside airlocks of shuttles
to_chat(blocking_mob, SPAN_HIGHDANGER("You get thrown back as the dropship doors slam shut!"))
blocking_mob.KnockDown(4)
for(var/turf/target_turf in orange(1, air)) // Forcemove to a non shuttle turf
if(!istype(target_turf, /turf/open/shuttle) && !istype(target_turf, /turf/closed/shuttle))
blocking_mob.forceMove(target_turf)
break
lockdown_door(air)

/obj/docking_port/mobile/emergency_response/proc/lockdown_door(obj/structure/machinery/door/airlock/air)
Expand Down
15 changes: 7 additions & 8 deletions code/modules/shuttles/marine_ferry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,13 @@

/datum/shuttle/ferry/marine/force_close_launch(obj/structure/machinery/door/AL)
if(!iselevator)
for(var/mob/M in AL.loc) // Bump all mobs outta the way for outside airlocks of shuttles
if(isliving(M))
to_chat(M, SPAN_HIGHDANGER("You get thrown back as the dropship doors slam shut!"))
M.apply_effect(4, WEAKEN)
for(var/turf/T in orange(1, AL)) // Forcemove to a non shuttle turf
if(!istype(T, /turf/open/shuttle) && !istype(T, /turf/closed/shuttle))
M.forceMove(T)
break
for(var/mob/living/M in AL.loc) // Bump all mobs outta the way for outside airlocks of shuttles
to_chat(M, SPAN_HIGHDANGER("You get thrown back as the dropship doors slam shut!"))
M.KnockDown(4)
for(var/turf/T in orange(1, AL)) // Forcemove to a non shuttle turf
if(!istype(T, /turf/open/shuttle) && !istype(T, /turf/closed/shuttle))
M.forceMove(T)
break
return ..() // Sleeps

/datum/shuttle/ferry/marine/open_doors(list/L)
Expand Down
9 changes: 3 additions & 6 deletions code/modules/shuttles/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
var/iselevator = 0 //Used to remove some shuttle related procs and texts to make it compatible with elevators
var/almayerelevator = 0 //elevators on the almayer without limitations

var/list/last_passangers = list() //list of living creatures that were our last passengers

var/require_link = FALSE
var/linked = FALSE
var/ambience_muffle = MUFFLE_HIGH
Expand Down Expand Up @@ -202,9 +200,7 @@

origin.move_contents_to(destination, direction=direction)

last_passangers.Cut()
for(var/mob/M in destination)
last_passangers += M
for(var/mob/living/M in destination)
if(M.client)
spawn(0)
if(M.buckled && !iselevator)
Expand All @@ -215,7 +211,8 @@
shake_camera(M, iselevator? 2 : 10, 1)
if(istype(M, /mob/living/carbon) && !iselevator)
if(!M.buckled)
M.apply_effect(3, WEAKEN)
M.Stun(3)
M.KnockDown(3)

for(var/turf/T in origin) // WOW so hacky - who cares. Abby
if(iselevator)
Expand Down

0 comments on commit 3efb737

Please sign in to comment.