Skip to content

Commit

Permalink
daze component + some touch ups
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveloopers committed May 26, 2024
1 parent f54ce55 commit ece7e03
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 8 deletions.
2 changes: 1 addition & 1 deletion code/datums/components/hivemind_interference.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
src.interference = interference
src.max_buildup = max_buildup
src.dissipation = dissipation
to_chat(parent, SPAN_XENOHIGHDANGER("Your awareness dims to a small area!"))
to_chat(parent, SPAN_XENOHIGHDANGER("Our awareness dims to a small area!"))

/datum/component/status_effect/interference/InheritComponent(datum/component/status_effect/interference/inter, i_am_original, amount, max_buildup)
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/datums/components/toxin_buildup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
src.toxic_buildup = toxic_buildup
src.toxic_buildup_dissipation = toxic_buildup_dissipation
src.max_buildup = max_buildup
to_chat(parent, SPAN_XENOHIGHDANGER("The toxic substance damages our armor!"))

/datum/component/status_effect/toxic_buildup/InheritComponent(datum/component/status_effect/toxic_buildup/C, i_am_original, toxic_buildup)
. = ..()
Expand Down
58 changes: 58 additions & 0 deletions code/datums/components/xeno/xeno_daze.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//snowflake used only for warcrime's effects

/datum/component/status_effect/daze
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/daze = 0
var/max_buildup = 20
var/dissipation = AMOUNT_PER_TIME(2, 2 SECONDS)

/datum/component/status_effect/daze/Initialize(daze, max_buildup = 30, dissipation = AMOUNT_PER_TIME(2, 2 SECONDS))
. = ..()
if(!isxeno(parent))
return COMPONENT_INCOMPATIBLE
ADD_TRAIT(parent, TRAIT_DAZED, TRAIT_STATUS_EFFECT("daze_warcrimes"))
src.daze = daze
src.max_buildup = max_buildup
src.dissipation = dissipation
to_chat(parent, SPAN_XENOHIGHDANGER("We feel weak and dazed!"))

/datum/component/status_effect/daze/InheritComponent(datum/component/status_effect/daze/daze_new, i_am_original, amount, max_buildup)
. = ..()

src.max_buildup = max(max_buildup, src.max_buildup) //if the new component's cap is higher, use that

if(!daze_new)
daze += amount
else
daze += daze_new.daze

daze = min(daze, max_buildup)

/datum/component/status_effect/daze/process(delta_time)
if(has_immunity)
return ..()

daze = clamp(daze - dissipation * delta_time, 0, max_buildup)

if(daze <= 0)
REMOVE_TRAIT(parent, TRAIT_DAZED, TRAIT_STATUS_EFFECT("daze_warcrimes"))
qdel(src)

/datum/component/status_effect/daze/RegisterWithParent()
START_PROCESSING(SSdcs, src)
RegisterSignal(parent, COMSIG_XENO_APPEND_TO_STAT, PROC_REF(stat_append))

/datum/component/status_effect/daze/UnregisterFromParent()
STOP_PROCESSING(SSdcs, src)
UnregisterSignal(parent, COMSIG_XENO_APPEND_TO_STAT)

/datum/component/status_effect/daze/proc/stat_append(mob/M, list/L)
SIGNAL_HANDLER
if(has_immunity)
L += "Daze immunity [grace_period]/[initial(grace_period)]"
return
L += "Daze: [daze]/[max_buildup]"

/datum/component/status_effect/daze/cleanse()
REMOVE_TRAIT(parent, TRAIT_DAZED, TRAIT_STATUS_EFFECT("daze_warcrimes"))
return ..()
4 changes: 0 additions & 4 deletions code/modules/mob/living/carbon/xenomorph/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
if(stat == UNCONSCIOUS)
return //Unconscious? Nope.

if(HAS_TRAIT(src, TRAIT_DAZED))
to_chat(src, SPAN_WARNING("You are too dazed to talk."))
return

if(copytext(message, 1, 2) == "*")
if(!findtext(message, "*", 2)) //Second asterisk means it is markup for *bold*, not an *emote.
return emote(lowertext(copytext(message, 2)), intentional = TRUE)
Expand Down
10 changes: 7 additions & 3 deletions code/modules/reagents/chemistry_properties/prop_negative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
var/mob/living/carbon/xenomorph/xeno = M
if(potency > POTENCY_MAX_TIER_1) //Needs level 7+ to have any effect
xeno.AddComponent(/datum/component/status_effect/toxic_buildup, potency * volume * 0.25)
to_chat(xeno, SPAN_XENODANGER("The corrosive substance damages your carapace!"))

/datum/chem_property/negative/corrosive/reaction_obj(obj/O, volume, potency)
if((istype(O,/obj/item) || istype(O,/obj/effect/glowshroom)) && prob(potency * 10))
Expand Down Expand Up @@ -431,8 +430,13 @@
apply_neuro(M, POTENCY_MULTIPLIER_MEDIUM * potency, FALSE)

/datum/chem_property/negative/neurotoxic/reaction_mob(mob/M, method = TOUCH, volume, potency)
to_chat(M, SPAN_WARNING("You start to go numb."))
M.apply_effect(potency * volume * POTENCY_MULTIPLIER_LOW, DAZE)
if(ishuman(M))
var/mob/living/carbon/human/human = M
human.Daze(potency * volume * POTENCY_MULTIPLIER_VLOW)
to_chat(human, SPAN_WARNING("You start to go numb."))
if(isxeno(M))
var/mob/living/carbon/xenomorph/xeno = M
xeno.AddComponent(/datum/component/status_effect/daze, volume * potency * POTENCY_MULTIPLIER_LOW, 30)

/datum/chem_property/negative/hypermetabolic
name = PROPERTY_HYPERMETABOLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@
if(isxeno(L))
var/mob/living/carbon/xenomorph/xeno = M
xeno.plasma_stored = max(xeno.plasma_stored - POTENCY_MULTIPLIER_HIGH * volume * potency, 0)
to_chat(xeno, SPAN_WARNING("You feel your plasma reserves being drained!"))

/datum/chem_property/positive/neutralizing/reaction_turf(turf/T, volume, potency)
if(!istype(T))
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
#include "code\datums\components\autofire\_automated_fire.dm"
#include "code\datums\components\autofire\autofire.dm"
#include "code\datums\components\xeno\shield_slash.dm"
#include "code\datums\components\xeno\xeno_daze.dm"
#include "code\datums\construction\construction_template.dm"
#include "code\datums\construction\xenomorph\construction_template_xenomorph.dm"
#include "code\datums\decorators\decorator.dm"
Expand Down

0 comments on commit ece7e03

Please sign in to comment.