mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[MIRROR] Adds Ants, Decomposition, and some extras. (#6944)
* Adds Ants, Decomposition, and some extras. (#59634) Co-authored-by: Kylerace <kylerlumpkin1@ gmail.com> * Adds Ants, Decomposition, and some extras. Co-authored-by: Wallemations <66052067+Wallemations@users.noreply.github.com> Co-authored-by: Kylerace <kylerlumpkin1@ gmail.com>
This commit is contained in:
co-authored by
Kylerace
Wallemations
parent
88b3b30c2d
commit
114347972a
@@ -19,12 +19,15 @@
|
||||
///Miscelanous caltrop flags; shoe bypassing, walking interaction, silence
|
||||
var/flags
|
||||
|
||||
///The sound that plays when a caltrop is triggered.
|
||||
var/soundfile
|
||||
|
||||
///given to connect_loc to listen for something moving over target
|
||||
var/static/list/crossed_connections = list(
|
||||
COMSIG_ATOM_ENTERED = .proc/on_entered,
|
||||
)
|
||||
|
||||
/datum/element/caltrop/Attach(datum/target, min_damage = 0, max_damage = 0, probability = 100, flags = NONE)
|
||||
/datum/element/caltrop/Attach(datum/target, min_damage = 0, max_damage = 0, probability = 100, flags = NONE, soundfile = null)
|
||||
. = ..()
|
||||
if(!isatom(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
@@ -33,6 +36,7 @@
|
||||
src.max_damage = max(min_damage, max_damage)
|
||||
src.probability = probability
|
||||
src.flags = flags
|
||||
src.soundfile = soundfile
|
||||
|
||||
if(ismovable(target))
|
||||
AddElement(/datum/element/connect_loc_behalf, target, crossed_connections)
|
||||
@@ -62,7 +66,7 @@
|
||||
if(H.buckled) //if they're buckled to something, that something should be checked instead.
|
||||
return
|
||||
|
||||
if(H.body_position == LYING_DOWN) //if we're not standing we cant step on the caltrop
|
||||
if(H.body_position == LYING_DOWN && !(flags & CALTROP_NOCRAWL)) //if we're not standing we cant step on the caltrop
|
||||
return
|
||||
|
||||
var/picked_def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
|
||||
@@ -94,7 +98,13 @@
|
||||
)
|
||||
|
||||
H.apply_damage(damage, BRUTE, picked_def_zone, wound_bonus = CANT_WOUND)
|
||||
H.Paralyze(60)
|
||||
|
||||
if(!(flags & CALTROP_NOSTUN)) // Won't set off the paralysis.
|
||||
H.Paralyze(60)
|
||||
|
||||
if(!soundfile)
|
||||
return
|
||||
playsound(H, soundfile, 15, TRUE, -3)
|
||||
|
||||
/datum/element/caltrop/Detach(datum/target)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user