more traits

This commit is contained in:
Timothy Teakettle
2020-09-30 02:58:58 +01:00
parent f9cf7429e1
commit d783eb58bd
3 changed files with 18 additions and 14 deletions

View File

@@ -218,6 +218,8 @@
#define TRAIT_MOBILITY_NOPICKUP "mobility_nopickup"
/// Disallow item use
#define TRAIT_MOBILITY_NOUSE "mobility_nouse"
///Disallow resting/unresting
#define TRAIT_REST_LOCKED "mobility_notogglerest"
#define TRAIT_SWIMMING "swimming" //only applied by /datum/element/swimming, for checking

View File

@@ -671,18 +671,18 @@
var/mob/living/carbon/human/H = owner
var/mutcolor = "#" + H.dna.features["mcolor"]
if(!is_puddle)
//traits used here to disable their arms
ADD_TRAIT(H, TRAIT_PARALYSIS_L_ARM, "SLIME_PUDDLE_PARALYSIS_L_ARM")
ADD_TRAIT(H, TRAIT_PARALYSIS_R_ARM, "SLIME_PUDDLE_PARALYSIS_R_ARM")
ADD_TRAIT(H, TRAIT_PASSTABLE, "SLIME_PUDDLE_TABLE_PASS")
ADD_TRAIT(H, TRAIT_SPRINT_LOCKED, "SLIME_PUDDLE_SPRINT_LOCK")
ADD_TRAIT(H, TRAIT_COMBAT_MODE_LOCKED, "SLIME_PUDDLE_COMBAT_LOCK")
is_puddle = TRUE
owner.cut_overlays()
var/obj/effect/puddle_effect = new puddle_into_effect(get_turf(owner), owner.dir)
puddle_effect.color = mutcolor
H.Stun(in_transformation_duration, ignore_canstun = TRUE)
H.KnockToFloor(TRUE, TRUE, TRUE)
H.KnockToFloor(TRUE, TRUE, TRUE) //disarms and you cant pickup after
ADD_TRAIT(H, TRAIT_MOBILITY_NOPICKUP, "SLIME_PUDDLE_NO_PICKUP")
ADD_TRAIT(H, TRAIT_MOBILITY_NOUSE, "SLIME_PUDDLE_NO_ITEMUSE")
ADD_TRAIT(H, TRAIT_PASSTABLE, "SLIME_PUDDLE_TABLE_PASS")
ADD_TRAIT(H, TRAIT_SPRINT_LOCKED, "SLIME_PUDDLE_SPRINT_LOCK")
ADD_TRAIT(H, TRAIT_COMBAT_MODE_LOCKED, "SLIME_PUDDLE_COMBAT_LOCK")
ADD_TRAIT(H, TRAIT_REST_LOCKED, "SLIME_PUDDLE_CANNOT_STAND")
sleep(in_transformation_duration)
var/mutable_appearance/puddle_overlay = mutable_appearance(icon = puddle_icon, icon_state = puddle_state)
puddle_overlay.color = mutcolor
@@ -694,11 +694,12 @@
puddle_effect.color = mutcolor
H.Stun(out_transformation_duration, ignore_canstun = TRUE)
sleep(out_transformation_duration)
REMOVE_TRAIT(H, TRAIT_PARALYSIS_L_ARM, "SLIME_PUDDLE_PARALYSIS_L_ARM")
REMOVE_TRAIT(H, TRAIT_PARALYSIS_R_ARM, "SLIME_PUDDLE_PARALYSIS_R_ARM")
REMOVE_TRAIT(H, TRAIT_MOBILITY_NOPICKUP, "SLIME_PUDDLE_NO_PICKUP")
REMOVE_TRAIT(H, TRAIT_MOBILITY_NOUSE, "SLIME_PUDDLE_NO_ITEMUSE")
REMOVE_TRAIT(H, TRAIT_PASSTABLE, "SLIME_PUDDLE_TABLE_PASS")
REMOVE_TRAIT(H, TRAIT_SPRINT_LOCKED, "SLIME_PUDDLE_SPRINT_LOCK")
REMOVE_TRAIT(H, TRAIT_COMBAT_MODE_LOCKED, "SLIME_PUDDLE_COMBAT_LOCK")
REMOVE_TRAIT(H, TRAIT_REST_LOCKED, "SLIME_PUDDLE_CANNOT_STAND")
is_puddle = FALSE
owner.regenerate_icons()

View File

@@ -10,11 +10,12 @@
//Force-set resting variable, without needing to resist/etc.
/mob/living/proc/set_resting(new_resting, silent = FALSE, updating = TRUE)
if(new_resting != resting)
resting = new_resting
if(!silent)
to_chat(src, "<span class='notice'>You are now [resting? "resting" : "getting up"].</span>")
update_resting(updating)
if(!HAS_TRAIT(src, TRAIT_REST_LOCKED))
if(new_resting != resting)
resting = new_resting
if(!silent)
to_chat(src, "<span class='notice'>You are now [resting? "resting" : "getting up"].</span>")
update_resting(updating)
/mob/living/proc/update_resting(update_mobility = TRUE)
if(update_mobility)