Skip to content

Commit

Permalink
TGS Test Merge (#6225)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed May 25, 2024
2 parents 372267e + 2294031 commit 13c6040
Show file tree
Hide file tree
Showing 37 changed files with 280 additions and 144 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@
/// From /mob/living/carbon/xenomorph/proc/hivemind_talk(): (message)
#define COMSIG_XENO_TRY_HIVEMIND_TALK "xeno_try_hivemind_talk"
#define COMPONENT_OVERRIDE_HIVEMIND_TALK (1<<0)

/// used in /datum/component/status_effect/cleanse()
#define COMSIG_XENO_DEBUFF_CLEANSE "xeno_debuff_cleanse"
5 changes: 5 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
// HIVE TRAITS
/// If the Hive is a Xenonid Hive
#define TRAIT_XENONID "t_xenonid"
/// if the xeno's connection to the hivemind is cut
#define TRAIT_HIVEMIND_INTERFERENCE "t_interference"
/// If the hive or xeno can use objects.
#define TRAIT_OPPOSABLE_THUMBS "t_thumbs"
/// If the Hive delays round end (this is overridden for some hives). Does not occur naturally. Must be applied in events.
Expand Down Expand Up @@ -355,6 +357,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_ABILITY_NO_PLASMA_TRANSFER" = TRAIT_ABILITY_NO_PLASMA_TRANSFER,
"TRAIT_ABILITY_OVIPOSITOR" = TRAIT_ABILITY_OVIPOSITOR,
"TRAIT_OPPOSABLE_THUMBS" = TRAIT_OPPOSABLE_THUMBS,
"TRAIT_INTERFERENCE" = TRAIT_HIVEMIND_INTERFERENCE,
),
/datum/hive_status = list(
"TRAIT_XENONID" = TRAIT_XENONID,
Expand Down Expand Up @@ -434,6 +437,8 @@ GLOBAL_LIST(trait_name_map)
#define TRAIT_SOURCE_TEMPORARY_MUTE "t_s_temporary_mute"
///Status trait forced by the xeno action charge
#define TRAIT_SOURCE_XENO_ACTION_CHARGE "t_s_xeno_action_charge"
///Status trait coming from hivemind interference
#define TRAIT_SOURCE_HIVEMIND_INTERFERENCE "t_s_hivemind_interference"
///Status trait coming from a xeno nest
#define XENO_NEST_TRAIT "xeno_nest"
///Status trait from a generic throw by xeno abilities
Expand Down
4 changes: 2 additions & 2 deletions code/datums/ammo/bullet/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

/datum/ammo/bullet/pistol/ap/toxin/on_hit_mob(mob/M, obj/projectile/P)
. = ..()
M.AddComponent(/datum/component/toxic_buildup, acid_per_hit)
M.AddComponent(/datum/component/status_effect/toxic_buildup, acid_per_hit)

/datum/ammo/bullet/pistol/ap/toxin/on_hit_turf(turf/T, obj/projectile/P)
. = ..()
Expand Down Expand Up @@ -194,7 +194,7 @@

/datum/ammo/bullet/pistol/squash/toxin/on_hit_mob(mob/M, obj/projectile/P)
. = ..()
M.AddComponent(/datum/component/toxic_buildup, acid_per_hit)
M.AddComponent(/datum/component/status_effect/toxic_buildup, acid_per_hit)

/datum/ammo/bullet/pistol/squash/toxin/on_hit_turf(turf/T, obj/projectile/P)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ammo/bullet/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/datum/ammo/bullet/revolver/marksman/toxin/on_hit_mob(mob/M, obj/projectile/P)
. = ..()
M.AddComponent(/datum/component/toxic_buildup, acid_per_hit)
M.AddComponent(/datum/component/status_effect/toxic_buildup, acid_per_hit)

/datum/ammo/bullet/revolver/marksman/toxin/on_hit_turf(turf/T, obj/projectile/P)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ammo/bullet/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

/datum/ammo/bullet/rifle/ap/toxin/on_hit_mob(mob/M, obj/projectile/P)
. = ..()
M.AddComponent(/datum/component/toxic_buildup, acid_per_hit)
M.AddComponent(/datum/component/status_effect/toxic_buildup, acid_per_hit)

/datum/ammo/bullet/rifle/ap/toxin/on_hit_turf(turf/T, obj/projectile/P)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ammo/bullet/smg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/datum/ammo/bullet/smg/ap/toxin/on_hit_mob(mob/M, obj/projectile/P)
. = ..()
M.AddComponent(/datum/component/toxic_buildup, acid_per_hit)
M.AddComponent(/datum/component/status_effect/toxic_buildup, acid_per_hit)

/datum/ammo/bullet/smg/ap/toxin/on_hit_turf(turf/T, obj/projectile/P)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ammo/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
if(isxeno(hit_mob))
var/mob/living/carbon/xenomorph/xeno = hit_mob
xeno.apply_damage(damage * 0.75, BURN)
xeno.interference = 30
xeno.AddComponent(/datum/component/status_effect/interference, 30, 30)

/datum/ammo/energy/yautja/rifle/bolt/set_bullet_traits()
. = ..()
Expand Down
27 changes: 18 additions & 9 deletions code/datums/components/healing_reduction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ Healing above this strength will be reduced by the strength of the buildup.
Humans will take continuous damage instead.
*/

/datum/component/healing_reduction
/datum/component/status_effect/healing_reduction
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/healing_reduction = 0
var/healing_reduction_dissipation = AMOUNT_PER_TIME(1, 5 SECONDS)
var/max_buildup = 50 //up to 50 damage off of healing max by default

/datum/component/healing_reduction/Initialize(healing_reduction, healing_reduction_dissipation = AMOUNT_PER_TIME(1, 2.5 SECONDS), max_buildup = 50)
/datum/component/status_effect/healing_reduction/Initialize(healing_reduction, healing_reduction_dissipation = AMOUNT_PER_TIME(1, 2.5 SECONDS), max_buildup = 50)
if(!isxeno_human(parent))
return COMPONENT_INCOMPATIBLE
. = ..()
src.healing_reduction = healing_reduction
src.healing_reduction_dissipation = healing_reduction_dissipation
src.max_buildup = max_buildup

/datum/component/healing_reduction/InheritComponent(datum/component/healing_reduction/inherit_component, i_am_original, healing_reduction)
/datum/component/status_effect/healing_reduction/InheritComponent(datum/component/status_effect/healing_reduction/inherit_component, i_am_original, healing_reduction)
. = ..()
if(!inherit_component)
src.healing_reduction += healing_reduction
Expand All @@ -30,7 +30,12 @@ Humans will take continuous damage instead.

src.healing_reduction = min(src.healing_reduction, max_buildup)

/datum/component/healing_reduction/process(delta_time)
/datum/component/status_effect/healing_reduction/process(delta_time)
var/atom/parent_atom = parent
if(has_immunity)
parent_atom.remove_filter("healing_reduction")
return ..()

if(!parent)
qdel(src)
return
Expand All @@ -49,18 +54,17 @@ Humans will take continuous damage instead.
var/intensity = healing_reduction/max_buildup
color += num2text(MAX_ALPHA*intensity, 2, 16)

var/atom/parent_atom = parent
parent_atom.add_filter("healing_reduction", 2, list("type" = "outline", "color" = color, "size" = 1))

/datum/component/healing_reduction/RegisterWithParent()
/datum/component/status_effect/healing_reduction/RegisterWithParent()
START_PROCESSING(SSdcs, src)
RegisterSignal(parent, list(
COMSIG_XENO_ON_HEAL,
COMSIG_XENO_ON_HEAL_WOUNDS
), PROC_REF(apply_healing_reduction))
RegisterSignal(parent, COMSIG_XENO_APPEND_TO_STAT, PROC_REF(stat_append))

/datum/component/healing_reduction/UnregisterFromParent()
/datum/component/status_effect/healing_reduction/UnregisterFromParent()
STOP_PROCESSING(SSdcs, src)
UnregisterSignal(parent, list(
COMSIG_XENO_ON_HEAL,
Expand All @@ -70,12 +74,17 @@ Humans will take continuous damage instead.
var/atom/parent_atom = parent
parent_atom.remove_filter("healing_reduction")

/datum/component/healing_reduction/proc/stat_append(mob/target_mob, list/stat_list)
/datum/component/status_effect/healing_reduction/proc/stat_append(mob/target_mob, list/stat_list)
SIGNAL_HANDLER
if(has_immunity)
stat_list += "Healing Reduction Immunity: [grace_period]/[initial(grace_period)]"
return
stat_list += "Healing Reduction: [healing_reduction]/[max_buildup]"

/datum/component/healing_reduction/proc/apply_healing_reduction(mob/living/carbon/xenomorph/xeno, list/healing)
/datum/component/status_effect/healing_reduction/proc/apply_healing_reduction(mob/living/carbon/xenomorph/xeno, list/healing)
SIGNAL_HANDLER
if(has_immunity)
return
healing["healing"] -= healing_reduction

#undef MAX_ALPHA
Expand Down
56 changes: 56 additions & 0 deletions code/datums/components/hivemind_interference.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/datum/component/status_effect/interference
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/interference = 0
var/max_buildup = 100
var/dissipation = AMOUNT_PER_TIME(2, 2 SECONDS)

/datum/component/status_effect/interference/Initialize(interference, max_buildup = 100, dissipation = AMOUNT_PER_TIME(2, 2 SECONDS))
. = ..()
if(!isxeno(parent))
return COMPONENT_INCOMPATIBLE
ADD_TRAIT(parent, TRAIT_HIVEMIND_INTERFERENCE, TRAIT_SOURCE_HIVEMIND_INTERFERENCE)
src.interference = interference
src.max_buildup = max_buildup
src.dissipation = dissipation
to_chat(parent, SPAN_XENOHIGHDANGER("Your awareness dims to a small area!"))

/datum/component/status_effect/interference/InheritComponent(datum/component/status_effect/interference/inter, 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(!inter)
interference += amount
else
interference += inter.interference

interference = min(interference, max_buildup)

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

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

if(interference <= 0)
REMOVE_TRAIT(parent, TRAIT_HIVEMIND_INTERFERENCE, TRAIT_SOURCE_HIVEMIND_INTERFERENCE)
qdel(src)

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

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

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

/datum/component/status_effect/interference/cleanse()
REMOVE_TRAIT(parent, TRAIT_HIVEMIND_INTERFERENCE, TRAIT_SOURCE_HIVEMIND_INTERFERENCE)
return ..()
29 changes: 19 additions & 10 deletions code/datums/components/speed_modifier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

//Adjusts the speed of a xenomorph the component is on. Humans will take or heal stamina damage.

/datum/component/speed_modifier
/datum/component/status_effect/speed_modifier
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/speed_modifier = 0
var/speed_modifier_dissipation = AMOUNT_PER_TIME(1, 2.5 SECONDS)
var/max_buildup = 10
var/increase_speed = FALSE

/datum/component/speed_modifier/Initialize(speed_modifier, increase_speed = FALSE, speed_modifier_dissipation = AMOUNT_PER_TIME(1, 2.5 SECONDS), max_buildup = 10)
/datum/component/status_effect/speed_modifier/Initialize(speed_modifier, increase_speed = FALSE, speed_modifier_dissipation = AMOUNT_PER_TIME(1, 2.5 SECONDS), max_buildup = 10)
if(!isxeno_human(parent))
return COMPONENT_INCOMPATIBLE
. = ..()
Expand All @@ -19,7 +19,7 @@
src.max_buildup = max_buildup
src.increase_speed = increase_speed

/datum/component/speed_modifier/InheritComponent(datum/component/speed_modifier/C, i_am_original, speed_modifier)
/datum/component/status_effect/speed_modifier/InheritComponent(datum/component/status_effect/speed_modifier/C, i_am_original, speed_modifier)
. = ..()
if(!C)
src.speed_modifier += speed_modifier
Expand All @@ -28,7 +28,12 @@

src.speed_modifier = min(src.speed_modifier, max_buildup)

/datum/component/speed_modifier/process(delta_time)
/datum/component/status_effect/speed_modifier/process(delta_time)
var/atom/parent_atom = parent
if(has_immunity)
parent_atom.remove_filter("speed_modifier")
return ..()

if(!parent)
qdel(src)
speed_modifier = max(speed_modifier - speed_modifier_dissipation * delta_time, 0)
Expand All @@ -47,15 +52,14 @@
var/intensity = speed_modifier/max_buildup
color += num2text(MAX_ALPHA*intensity, 2, 16)

var/atom/A = parent
A.add_filter("speed_modifier", 2, list("type" = "outline", "color" = color, "size" = 1))
parent_atom.add_filter("speed_modifier", 2, list("type" = "outline", "color" = color, "size" = 1))

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

/datum/component/speed_modifier/UnregisterFromParent()
/datum/component/status_effect/speed_modifier/UnregisterFromParent()
STOP_PROCESSING(SSdcs, src)
UnregisterSignal(parent, list(
COMSIG_XENO_MOVEMENT_DELAY,
Expand All @@ -64,15 +68,20 @@
var/atom/A = parent
A.remove_filter("speed_modifier")

/datum/component/speed_modifier/proc/stat_append(mob/M, list/L)
/datum/component/status_effect/speed_modifier/proc/stat_append(mob/M, list/L)
SIGNAL_HANDLER
if(has_immunity)
L += "Slow immunity: [grace_period]/[initial(grace_period)]"
return
if(!increase_speed)
L += "Slow: [speed_modifier]/[max_buildup]"
else
L += "Speed Boost: [speed_modifier]/[max_buildup]"

/datum/component/speed_modifier/proc/apply_speed_modifier(mob/living/carbon/xenomorph/X, list/speeds)
/datum/component/status_effect/speed_modifier/proc/apply_speed_modifier(mob/living/carbon/xenomorph/X, list/speeds)
SIGNAL_HANDLER
if(has_immunity)
return
if(!increase_speed)
speeds["speed"] += speed_modifier * 0.075
else //increasing speed is more effective than decreasing speed
Expand Down
19 changes: 19 additions & 0 deletions code/datums/components/status_effect_component.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//exists only to handle immunities for now

/datum/component/status_effect
var/has_immunity = FALSE
var/grace_period = 20

/datum/component/status_effect/Initialize()
. = ..()
RegisterSignal(parent, list(COMSIG_XENO_DEBUFF_CLEANSE, COMSIG_LIVING_REJUVENATED), PROC_REF(cleanse))

/datum/component/status_effect/proc/cleanse()
SIGNAL_HANDLER
has_immunity = TRUE

/datum/component/status_effect/process(delta_time)
if(has_immunity)
grace_period -= 1 * delta_time
if(grace_period <= 0)
qdel(src)
Loading

0 comments on commit 13c6040

Please sign in to comment.