-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
280 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.