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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hit the Deck! Dropping to the ground to avoid shots. #61768

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Expand Up @@ -144,6 +144,8 @@

#define STATUS_EFFECT_STONED /datum/status_effect/stoned

#define STATUS_EFFECT_CRAWLING /datum/status_effect/crawling

/////////////
// SLIME //
/////////////
Expand Down
11 changes: 11 additions & 0 deletions code/datums/status_effects/neutral.dm
Expand Up @@ -460,6 +460,17 @@
QDEL_NULL(alt_clone)
return ..()

// A status effect that represents a character crawling
/datum/status_effect/crawling
id = "crawling"
duration = 6 SECONDS
status_type = STATUS_EFFECT_REFRESH
alert_type = null

/datum/status_effect/crawling/on_remove()
if(owner.body_position == LYING_DOWN)
owner.balloon_alert(owner, "You assume a prone position.")
itseasytosee marked this conversation as resolved.
Show resolved Hide resolved

#undef EIGENSTASIUM_MAX_BUFFER
#undef EIGENSTASIUM_STABILISATION_RATE
#undef EIGENSTASIUM_PHASE_1_END
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/shrapnel.dm
Expand Up @@ -30,7 +30,7 @@
ricochet_chance = 70
shrapnel_type = /obj/item/shrapnel
ricochet_incidence_leeway = 60
hit_prone_targets = TRUE
hit_crawling_targets = TRUE
sharpness = SHARP_EDGED
wound_bonus = 30
embedding = list(embed_chance=70, ignore_throwspeed_threshold=TRUE, fall_chance=1)
Expand Down Expand Up @@ -60,7 +60,7 @@
embedding = list(embed_chance=55, fall_chance=2, jostle_chance=7, ignore_throwspeed_threshold=TRUE, pain_stam_pct=0.7, pain_mult=3, jostle_pain_mult=3, rip_time=15)

/obj/projectile/bullet/pellet/stingball/on_ricochet(atom/A)
hit_prone_targets = TRUE // ducking will save you from the first wave, but not the rebounds
hit_crawling_targets = TRUE // ducking will save you from the first wave, but not the rebounds

/obj/projectile/bullet/pellet/stingball/mega
name = "megastingball pellet"
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/carbon_movement.dm
Expand Up @@ -31,6 +31,8 @@
adjust_nutrition(-(HUNGER_FACTOR/10))
if(m_intent == MOVE_INTENT_RUN)
adjust_nutrition(-(HUNGER_FACTOR/10))
if(body_position == LYING_DOWN)
itseasytosee marked this conversation as resolved.
Show resolved Hide resolved
apply_status_effect(STATUS_EFFECT_CRAWLING)


/mob/living/carbon/set_usable_legs(new_value)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/ammunition/_firing.dm
Expand Up @@ -30,7 +30,7 @@
loaded_projectile.original = target
loaded_projectile.firer = user
loaded_projectile.fired_from = fired_from
loaded_projectile.hit_prone_targets = user.combat_mode
loaded_projectile.hit_crawling_targets = TRUE
if (zone_override)
loaded_projectile.def_zone = zone_override
else
Expand Down
8 changes: 4 additions & 4 deletions code/modules/projectiles/projectile.dm
Expand Up @@ -159,7 +159,7 @@
///If we have a shrapnel_type defined, these embedding stats will be passed to the spawned shrapnel type, which will roll for embedding on the target
var/list/embedding
///If TRUE, hit mobs even if they're on the floor and not our target
var/hit_prone_targets = FALSE
var/hit_crawling_targets = FALSE
///For what kind of brute wounds we're rolling for, if we're doing such a thing. Lasers obviously don't care since they do burn instead.
var/sharpness = NONE
///How much we want to drop both wound_bonus and bare_wound_bonus (to a minimum of 0 for the latter) per tile, for falloff purposes
Expand Down Expand Up @@ -506,11 +506,11 @@
return FALSE
if(HAS_TRAIT(L, TRAIT_IMMOBILIZED) && HAS_TRAIT(L, TRAIT_FLOORED) && HAS_TRAIT(L, TRAIT_HANDS_BLOCKED))
return FALSE
if(!hit_prone_targets)
if(L.body_position == LYING_DOWN && !L.has_status_effect(STATUS_EFFECT_CRAWLING))
return FALSE
if(!hit_crawling_targets)
if(!L.density)
return FALSE
if(L.body_position != LYING_DOWN)
return TRUE
return TRUE

/**
Expand Down
2 changes: 1 addition & 1 deletion code/modules/vehicles/mecha/equipment/weapons/weapons.dm
Expand Up @@ -42,7 +42,7 @@
projectile_obj.preparePixelProjectile(target, source, modifiers, spread)
if(source.client && isliving(source)) //dont want it to happen from syndie mecha npc mobs, they do direct fire anyways
var/mob/living/shooter = source
projectile_obj.hit_prone_targets = shooter.combat_mode
projectile_obj.hit_crawling_targets = shooter.combat_mode
projectile_obj.fire()
if(!projectile_obj.suppressed && firing_effect_type)
new firing_effect_type(get_turf(src), chassis.dir)
Expand Down