-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cognitohazard Component and Graffiti [Atomized]
add: visual cognito hazard graffiti add: cognitohazard component Kikimora
- Loading branch information
1 parent
feec2bd
commit 2c284a9
Showing
8 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,46 @@ | ||
/datum/component/cognitohazard_visual | ||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS | ||
var/last_blink = 0 | ||
var/check_every = 20 SECONDS | ||
/// The name of the cognitohazard_visual the player is applying to the parent. | ||
var/datum/status_effect/cognitohazard_visual_effect | ||
|
||
/datum/component/cognitohazard_visual/Initialize(_cognitohazard_visual_effect, obvious = FALSE) | ||
if(!isatom(parent) || !_cognitohazard_visual_effect) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
cognitohazard_visual_effect = _cognitohazard_visual_effect | ||
|
||
if(obvious) | ||
START_PROCESSING(SSdcs, src) | ||
|
||
/datum/component/cognitohazard_visual/RegisterWithParent() | ||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(Examine)) | ||
|
||
/** | ||
This proc will trigger when someone examines the parent. | ||
It will attach the text found in the body of the proc to the `examine_list` and display it to the player examining the parent. | ||
Arguments: | ||
* source: The parent. | ||
* user: The mob exmaining the parent. | ||
* examine_list: The current list of text getting passed from the parent's normal examine() proc. | ||
*/ | ||
/datum/component/cognitohazard_visual/proc/Examine(datum/source, mob/user, list/examine_list) | ||
SIGNAL_HANDLER | ||
|
||
if(user) | ||
var/mob/living/L = user | ||
L.apply_status_effect(cognitohazard_visual_effect) | ||
|
||
/datum/component/cognitohazard_visual/process() | ||
if(world.time > (last_blink + check_every)) | ||
for(var/mob/living/L in oviewers(4, get_turf(parent))) | ||
if(!L.client) | ||
continue | ||
if(L.stat != CONSCIOUS) | ||
continue | ||
if(L.has_status_effect(cognitohazard_visual_effect)) | ||
continue | ||
L.apply_status_effect(cognitohazard_visual_effect) | ||
to_chat(L, span_smallnotice("Your eye catches some weird detail about [parent].")) |
113 changes: 113 additions & 0 deletions
113
code/modules/mob/living/simple_animal/abnormality/teth/kikimora.dm
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,113 @@ | ||
/mob/living/simple_animal/hostile/abnormality/kikimora | ||
name = "Kikimora" | ||
desc = "A beaked woman with one leg idly sweeping the floor with a broom." | ||
icon = 'ModularTegustation/Teguicons/32x48.dmi' | ||
icon_state = "kikimora" | ||
icon_living = "kikimora" | ||
icon_dead = "kikimora" | ||
maxHealth = 1300 | ||
health = 1300 | ||
rapid_melee = 1 | ||
melee_queue_distance = 2 | ||
move_to_delay = 3 | ||
damage_coeff = list(BRUTE = 1, RED_DAMAGE = 1, WHITE_DAMAGE = 1, BLACK_DAMAGE = 1.5, PALE_DAMAGE = 2) | ||
threat_level = TETH_LEVEL | ||
start_qliphoth = 2 | ||
work_chances = list( | ||
ABNORMALITY_WORK_INSTINCT = list(60, 60, 50, 50, 50), | ||
ABNORMALITY_WORK_INSIGHT = 50, | ||
ABNORMALITY_WORK_ATTACHMENT = list(50, 50, 40, 40, 40), | ||
ABNORMALITY_WORK_REPRESSION = list(30, 20, 0, -80, -80), | ||
) | ||
work_damage_amount = 6 | ||
work_damage_type = WHITE_DAMAGE | ||
death_message = "falls over." | ||
ego_list = list( | ||
) | ||
gift_type = null | ||
|
||
/mob/living/simple_animal/hostile/abnormality/kikimora/ZeroQliphoth(mob/living/carbon/human/user) | ||
. = ..() | ||
if(GLOB.department_centers.len) | ||
var/turf/W = pick(GLOB.department_centers) | ||
W = locate(W.x + rand(1,3), W.y + rand(1,3), W.z) | ||
var/obj/effect/decal/cleanable/crayon/cognito/kikimora/K = new (get_turf(W)) | ||
K.dir = pick(WEST, EAST) | ||
datum_reference.qliphoth_change(2) | ||
|
||
/mob/living/simple_animal/hostile/abnormality/kikimora/examine(mob/user) | ||
. = ..() | ||
if(ishuman(user)) | ||
var/mob/living/carbon/human/H = user | ||
H.apply_status_effect(/datum/status_effect/kikimora) | ||
to_chat(H, span_mind_control("Kikimora.")) | ||
|
||
//Graffiti | ||
/obj/effect/decal/cleanable/crayon/cognito/kikimora | ||
name = "graffiti" | ||
desc = "Kikimora?" | ||
icon_state = "kikimora" | ||
mergeable_decal = TRUE | ||
inflicted_effect = /datum/status_effect/kikimora | ||
|
||
//Status Effect | ||
/datum/status_effect/kikimora | ||
id = "kikimora" | ||
status_type = STATUS_EFFECT_UNIQUE | ||
duration = -1 | ||
alert_type = null | ||
on_remove_on_mob_delete = TRUE | ||
var/words_per_say = 1 | ||
var/static/spread_cooldown = 0 | ||
var/spread_cooldown_delay = 5 SECONDS | ||
var/static/words_taken = list() | ||
|
||
/datum/status_effect/kikimora/on_apply() | ||
. = ..() | ||
RegisterSignal(owner, COMSIG_MOB_SAY, PROC_REF(CorruptWords)) | ||
RegisterSignal(owner, COMSIG_LIVING_STATUS_SLEEP, PROC_REF(Bedtime)) | ||
|
||
/datum/status_effect/kikimora/proc/Bedtime() | ||
SIGNAL_HANDLER | ||
var/turf/T = get_turf(owner) | ||
var/obj/item/food/offering = locate(/obj/item/food) in T | ||
if(offering) | ||
if(!(offering.foodtypes & JUNKFOOD) && !(offering.foodtypes & RAW) && !(offering.foodtypes & GROSS) && !(offering.foodtypes & TOXIC)) | ||
playsound(get_turf(owner),'sound/items/eatfood.ogg', 50, TRUE) | ||
qdel(offering) | ||
qdel(src) | ||
else | ||
to_chat(owner, span_notice("You sense something examined your offering of food.")) | ||
|
||
/datum/status_effect/kikimora/proc/CorruptWords(datum/source, list/speech_args) | ||
SIGNAL_HANDLER | ||
var/words_to_take = words_per_say | ||
var/words_said = 0 | ||
|
||
var/message = speech_args[SPEECH_MESSAGE] | ||
var/list/split_message = splittext(message, " ") //List each word in the message | ||
for (var/i in 1 to length(split_message)) | ||
if(findtext(split_message[i], "*") || findtext(split_message[i], ";") || findtext(split_message[i], ":") || findtext(split_message[i], "kiki") || findtext(split_message[i], "mora")) | ||
continue | ||
var/standardize_text = uppertext(split_message[i]) | ||
if(standardize_text in words_taken) | ||
split_message[i] = pick("kiki", "mora") | ||
//Higher chance of spreading if the user said kiki or mora alot. | ||
words_said++ | ||
continue | ||
//Unsure if this is processor intensive. | ||
if(prob(25) && words_to_take > 0) | ||
words_taken += standardize_text | ||
words_to_take-- | ||
|
||
message = jointext(split_message, " ") | ||
speech_args[SPEECH_MESSAGE] = message | ||
|
||
//Infection Mechanic | ||
if(ishuman(owner)) | ||
var/mob/living/carbon/human/L = owner | ||
if(spread_cooldown <= world.time) | ||
for(var/mob/living/carbon/human/H in hearers(7, L)) | ||
if(prob(5 * words_said)) | ||
H.apply_status_effect(/datum/status_effect/kikimora) | ||
spread_cooldown = world.time + spread_cooldown_delay |
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