Skip to content

Commit

Permalink
TOTALLY CURSED
Browse files Browse the repository at this point in the history
  • Loading branch information
timchigaming committed Oct 8, 2024
1 parent f9b3d39 commit 5e72d1e
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions code/datums/diseases/viruses/babylon_feve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
var/list/datum/language/stored_languages = list()

/datum/disease/virus/babylonian_fever/Contract(mob/living/M, act_type, is_carrier, need_protection_check, zone)
var/datum/disease/disease = ..()
var/datum/disease/virus/babylonian_fever/disease = ..()

if(!disease)
return FALSE
RegisterSignal(disease.affected_mob, COMSIG_LIVING_RECEIVED_LANGUAGE, PROC_REF(store_and_remove_languages))
// Store languages on first stage activation
if(M.languages)
stored_languages += M.languages.Copy()
// Remove existing languages
if(M.languages)
for(var/datum/language/lan in M.languages)
M.remove_language(lan.name)
disease.RegisterSignal(disease.affected_mob, COMSIG_LIVING_RECEIVED_LANGUAGE, PROC_REF(store_and_remove_languages))

affected_mob = disease.affected_mob
store_and_remove_languages()

/datum/disease/virus/babylonian_fever/stage_act()
if(!..())
Expand All @@ -34,7 +31,6 @@
if(2, 3)
if(prob(stage))
affected_mob.adjustBrainLoss(0.5)
if(prob(stage))
affected_mob.say(pick(
"Ммм... гхм...",
"А-а-а... эээ...",
Expand All @@ -52,20 +48,30 @@
"Двести... двадцать..."\
)
)

return TRUE

/datum/disease/virus/babylonian_fever/has_cure()
if(..())
// Restore previously known languages
if(stored_languages.len)
for(var/datum/language/lan in stored_languages)
affected_mob.add_language(lan.name)
stored_languages.Cut() // Clear the stored languages
return TRUE
/datum/disease/virus/babylonian_fever/cure()
if(!affected_mob)
qdel(src)

UnregisterSignal(affected_mob, COMSIG_LIVING_RECEIVED_LANGUAGE)

// Restore previously known languages
if(LAZYLEN(stored_languages))
for(var/datum/language/lan in stored_languages)
affected_mob.add_language(lan.name)
..()

/datum/disease/virus/babylonian_fever/Destroy()
LAZYCLEARLIST(stored_languages)

return ..()

/datum/disease/virus/babylonian_fever/proc/store_and_remove_languages()
// Remove existing languages
if(affected_mob.languages)
stored_languages += affected_mob.languages.Copy()

for(var/datum/language/lan in affected_mob.languages)
affected_mob.remove_language(lan.name)

0 comments on commit 5e72d1e

Please sign in to comment.