From 17ae62bc9913761996c80cf54e3844732060631f Mon Sep 17 00:00:00 2001 From: Markolie Date: Sat, 20 Dec 2014 20:45:31 +0100 Subject: [PATCH] Karma refund option, IPC radiation checks --- .../powerarmor/powerarmorcomponents.dm | 8 +- code/__HELPERS/type2type.dm | 135 +++++++--------- .../objects/items/weapons/dna_injector.dm | 4 +- code/global.dm | 2 +- code/modules/client/client procs.dm | 9 +- code/modules/karma/karma.dm | 144 +++++++++++++----- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/reagents/Chemistry-Reagents.dm | 8 +- .../artifact/effects/unknown_effect_heal.dm | 3 +- .../artifact/effects/unknown_effect_hurt.dm | 2 +- code/modules/virus2/effect.dm | 2 +- 11 files changed, 192 insertions(+), 127 deletions(-) diff --git a/code/WorkInProgress/ZomgPonies/powerarmor/powerarmorcomponents.dm b/code/WorkInProgress/ZomgPonies/powerarmor/powerarmorcomponents.dm index 4ba3c9ddb65..42cc7b4c444 100644 --- a/code/WorkInProgress/ZomgPonies/powerarmor/powerarmorcomponents.dm +++ b/code/WorkInProgress/ZomgPonies/powerarmor/powerarmorcomponents.dm @@ -74,18 +74,18 @@ if(!crit_fail) if(prob(src.reliability)) return 1 //No failure if(prob(src.reliability)) - for (var/mob/M in range(0,src.parent)) //Only a minor failure, enjoy your radiation. + for (var/mob/living/M in range(0,src.parent)) //Only a minor failure, enjoy your radiation. if(src.parent in M.contents) M << "Your armor feels pleasantly warm for a moment." else M << "You feel a warm sensation." - M.radiation += rand(1,40) + M.apply_effect(-rand(1,40),IRRADIATE,0) else - for (var/mob/M in range(rand(1,4),src.parent)) //Big failure, TIME FOR RADIATION BITCHES + for (var/mob/living/M in range(rand(1,4),src.parent)) //Big failure, TIME FOR RADIATION BITCHES if (src.parent in M.contents) M << "Your armor's reactor overloads!" M << "You feel a wave of heat wash over you." - M.radiation += 100 + M.apply_effect(100,IRRADIATE,0) crit_fail = 1 //broken~ parent.powerdown(1) spawn(50) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 76598fc6ec9..18a6601ed8e 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -85,44 +85,49 @@ // Concatenates a list of strings into a single string. A seperator may optionally be provided. /proc/list2text(list/ls, sep) - if(ls.len <= 1) return ls.len ? ls[1] : "" - . = "" - var/l = ls.len - var/i = 0 + if(ls.len <= 1) // Early-out code for empty or singleton lists. + return ls.len ? ls[1] : "" - if(sep) - #define S1 ls[++i] - #define S4 S1, sep, S1, sep, S1, sep, S1 - #define S16 S4, sep, S4, sep, S4, sep, S4 - #define S64 S16, sep, S16, sep, S16, sep, S16 + var/l = ls.len // Made local for sanic speed. + var/i = 0 // Incremented every time a list index is accessed. - while(l-i >= 128) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, sep, S64) - if(l-i >= 64) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + if(sep != null) + // Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc... + #define S1 sep, ls[++i] + #define S4 S1, S1, S1, S1 + #define S16 S4, S4, S4, S4 + #define S64 S16, S16, S16, S16 + + . = "[ls[++i]]" // Make sure the initial element is converted to text. + + // Having the small concatenations come before the large ones boosted speed by an average of at least 5%. + if(l-1 & 0x01) // 'i' will always be 1 here. + . = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2. + if(l-i & 0x02) + . = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. + if(l-i & 0x04) + . = text("[][][][][][][][][]", ., S4) // And so on.... + if(l-i & 0x08) + . = text("[][][][][][][][][][][][][][][][][]", ., S4, S4) + if(l-i & 0x10) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16) + if(l-i & 0x20) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) + if(l-i & 0x40) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) - if(l-i >= 32) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, sep, S16) - if(l-i >= 16) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16) - if(l-i >= 8) - . = text("[][][][][][][][][][][][][][][][]", ., S4, sep, S4) - if(l-i >= 4) - . = text("[][][][][][][][]", ., S4) - if(l-i >= 2) - . = text("[][][][]", ., S1, sep, S1) - if(l > i) - . = text("[][][]", ., sep, S1) + while(l > i) // Chomp through the rest of the list, 128 elements at a time. + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) #undef S64 #undef S16 @@ -130,71 +135,49 @@ #undef S1 else + // Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc... #define S1 ls[++i] #define S4 S1, S1, S1, S1 #define S16 S4, S4, S4, S4 #define S64 S16, S16, S16, S16 - while(l-i >= 128) + . = "[ls[++i]]" // Make sure the initial element is converted to text. + + if(l-1 & 0x01) // 'i' will always be 1 here. + . += S1 // Append 1 element if the remaining elements are not a multiple of 2. + if(l-i & 0x02) + . = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. + if(l-i & 0x04) + . = text("[][][][][]", ., S4) // And so on... + if(l-i & 0x08) + . = text("[][][][][][][][][]", ., S4, S4) + if(l-i & 0x10) + . = text("[][][][][][][][][][][][][][][][][]", ., S16) + if(l-i & 0x20) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) + if(l-i & 0x40) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) + while(l > i) // Chomp through the rest of the list, 128 elements at a time. . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) - if(l-i >= 64) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) - if(l-i >= 32) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) - if(l-i >= 16) - . = text("[][][][][][][][][][][][][][][][][]", ., S16) - if(l-i >= 8) - . = text("[][][][][][][][][]", ., S4, S4) - if(l-i >= 4) - . = text("[][][][][]", ., S4) - if(l-i >= 2) - . = text("[][][]", ., S1, S1) - if(l > i) - . += S1 #undef S64 #undef S16 #undef S4 #undef S1 - //slower then list2text, but correctly processes associative lists. -proc/tg_list2text(list/list, glue=",", assocglue=";") +proc/tg_list2text(list/list, glue=",") if(!istype(list) || !list.len) return var/output for(var/i=1 to list.len) - if(!isnull(list["[list[i]]"])) - output += (i!=1? glue : null)+ "[list[i]]"+(i!=1? assocglue : null)+"[list["[list[i]]"]]" - else - output += (i!=1? glue : null)+ "[list[i]]" + output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]") return output -proc/tg_text2list(text, glue=",", assocglue=";") - var/length = length(glue) - if(length < 1) return list(text) - . = list() - var/lastglue_found = 1 - var/foundglue - var/foundassocglue - var/searchtext - do - foundglue = findtext(text, glue, lastglue_found, 0) - searchtext = copytext(text, lastglue_found, foundglue) - foundassocglue = findtext(searchtext, assocglue, 1, 0) - if(foundassocglue) - var/sublist = copytext(searchtext, 1, foundassocglue) - sublist[1] = copytext(searchtext, foundassocglue, 0) - . += sublist - else - . += copytext(text, lastglue_found, foundglue) - lastglue_found = foundglue + length - while(foundglue) - //Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator) /proc/text2list(text, delimiter="\n") diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 11e3d7d7f18..ff224067b11 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -63,9 +63,9 @@ else return buf.dna.SetUIValue(real_block,val) -/obj/item/weapon/dnainjector/proc/inject(mob/M as mob, mob/user as mob) +/obj/item/weapon/dnainjector/proc/inject(mob/living/M as mob, mob/user as mob) if(istype(M,/mob/living)) - M.radiation += rand(5,20) + M.apply_effect(rand(5,20),IRRADIATE,0) if (!(M_NOCLONE in M.mutations)) // prevents drained people from having their DNA changed // UI in syringe. diff --git a/code/global.dm b/code/global.dm index 3818db51cc1..f40c843e6b9 100644 --- a/code/global.dm +++ b/code/global.dm @@ -252,7 +252,7 @@ var/sqlfdbkdb = "test" var/sqlfdbklogin = "root" var/sqlfdbkpass = "bleh" -var/sqllogging = 0 // Should we log deaths, population stats, etc? +var/sqllogging = 1 // Should we log deaths, population stats, etc? diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 220f70ac6e5..9bdd68f039a 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -171,8 +171,13 @@ else src.DB_species_unlock("Slime People",45) return - - + if(href_list["KarmaRefund"]) + var/type = href_list["KarmaRefundType"] + var/job = href_list["KarmaRefund"] + var/cost = href_list["KarmaRefundCost"] + src.karmarefund(type,job,cost) + return + switch(href_list["_src_"]) if("holder") hsrc = holder if("usr") hsrc = mob diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm index 0f0c97f05c6..1fb2ec53999 100644 --- a/code/modules/karma/karma.dm +++ b/code/modules/karma/karma.dm @@ -52,6 +52,14 @@ var/list/karma_spenders = list() set name = "Award Karma" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." set category = "Special Verbs" + + if(!ticker || !player_list.len) + usr << "\red You can't award karma until the game has started." + return + + if(ticker.current_state == GAME_STATE_PREGAME) + usr << "\red You can't award karma until the game has started." + return var/list/karma_list = list() for(var/mob/M in player_list) if(M.client && M.mind) @@ -65,16 +73,24 @@ var/list/karma_spenders = list() return var/pickedmob = input("Who would you like to award Karma to?", "Award Karma", null) as mob in karma_list + + if(!istype(pickedmob, /mob)) + usr << "\red That's not a mob." + return + spend_karma(pickedmob) /mob/verb/spend_karma(var/mob/M) set name = "Award Karma to Player" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." + set category = "Special Verbs" - if(!istype(M, /mob)) - usr << "\red That's not a mob. You shouldn't have even been able to specify that. Please inform TLE post haste." + if(!M) + usr << "Please right click a mob to award karma directly, or use the 'Award Karma' verb to select a player from the player listing." + return + if(!istype(M, /mob)) + usr << "\red That's not a mob." return - if(!M.client) usr << "\red That mob has no client connected at the moment." return @@ -85,9 +101,9 @@ var/list/karma_spenders = list() if(a == src.key) usr << "\red You've already spent your karma for the round." return - if(M.key == src.key) - usr << "\red You can't spend karma on yourself!" - return + //if(M.key == src.key) + //usr << "\red You can't spend karma on yourself!" + //return if(M.client.address == src.client.address) message_admins("\red Illegal karma spending detected from [src.key] to [M.key]. Using the same IP!") log_game("\red Illegal karma spending detected from [src.key] to [M.key]. Using the same IP!") @@ -113,13 +129,10 @@ var/list/karma_spenders = list() sql_report_karma(src, M) - - - /client/verb/check_karma() set name = "Check Karma" set category = "Special Verbs" - set desc = "Reports how much karma you have accrued" + set desc = "Reports how much karma you have accrued." var/currentkarma=verify_karma() usr << {"
You have [currentkarma] available."} @@ -147,7 +160,6 @@ You've gained [totalkarma] total karma in your time here.
"} usr << "Your total karma is: 0
"*/ return currentkarma - /client/verb/karmashop() set name = "karmashop" set desc = "Spend your hard-earned karma here" @@ -156,12 +168,11 @@ You've gained [totalkarma] total karma in your time here.
"} karmashopmenu() return - /client/proc/karmashopmenu() - var/dat = "
" dat += "Job Unlocks" dat += "Species Unlocks" + dat += "Karma Refunds" dat += "
" dat += "
" @@ -187,8 +198,17 @@ You've gained [totalkarma] total karma in your time here.
"} Unlock Vox -- 45KP
Unlock Slime People -- 45KP
"} + + if (2) // Karma Refunds + var/list/refundable = list() + /*if(checkpurchased("Barber")) + refundable += "Barber" + dat += "Refund Barber -- 5KP
"*/ - dat += "PLEASE NOTE THAT PEOPLE WHO TRY TO GAME THE KARMA SYSTEM WILL END UP ON THE WALL OF SHAME. THIS INCLUDES BUT IS NOT LIMITED TO TRADES, OOC KARMA BEGGING, CODE EXPLOITS, ETC." + if(!refundable.len) + dat += "You do not have any refundable karma purchases.
" + + dat += "
PLEASE NOTE THAT PEOPLE WHO TRY TO GAME THE KARMA SYSTEM WILL END UP ON THE WALL OF SHAME. THIS INCLUDES BUT IS NOT LIMITED TO TRADES, OOC KARMA BEGGING, CODE EXPLOITS, ETC." dat += "" var/datum/browser/popup = new(usr, "karmashop", "
Karma Shop
", 400, 400) @@ -196,25 +216,21 @@ You've gained [totalkarma] total karma in your time here.
"} popup.open(0) return - - /client/proc/DB_job_unlock(var/job,var/cost) - var/DBQuery/query = dbcon.NewQuery("SELECT * FROM whitelist WHERE ckey='[usr.key]'") query.Execute() var/dbjob var/dbckey while(query.NextRow()) - dbckey = query.item[2] dbjob = query.item[3] if(!dbckey) query = dbcon.NewQuery("INSERT INTO whitelist (ckey, job) VALUES ('[usr.key]','[job]')") if(!query.Execute()) var/err = query.ErrorMsg() - log_game("SQL ERROR during whitelist logging (adding new key). Error : \[[err]\]\n") - message_admins("SQL ERROR during whitelist logging (adding new key). Error : \[[err]\]\n") + log_game("SQL ERROR during whitelist logging (adding new key). Error: \[[err]\]\n") + message_admins("SQL ERROR during whitelist logging (adding new key). Error: \[[err]\]\n") return else usr << "You have unlocked [job]." @@ -240,19 +256,13 @@ You've gained [totalkarma] total karma in your time here.
"} usr << "You already have this job unlocked!" return - - - - /client/proc/DB_species_unlock(var/species,var/cost) - var/DBQuery/query = dbcon.NewQuery("SELECT * FROM whitelist WHERE ckey='[usr.key]'") query.Execute() var/dbspecies var/dbckey while(query.NextRow()) - dbckey = query.item[2] dbspecies = query.item[4] if(!dbckey) @@ -275,8 +285,8 @@ You've gained [totalkarma] total karma in your time here.
"} query = dbcon.NewQuery("UPDATE whitelist SET species='[newspecieslist]' WHERE ckey='[dbckey]'") if(!query.Execute()) var/err = query.ErrorMsg() - log_game("SQL ERROR during whitelist logging (updating existing entry). Error : \[[err]\]\n") - message_admins("SQL ERROR during whitelist logging (updating existing entry). Error : \[[err]\]\n") + log_game("SQL ERROR during whitelist logging (updating existing entry). Error: \[[err]\]\n") + message_admins("SQL ERROR during whitelist logging (updating existing entry). Error: \[[err]\]\n") return else usr << "You have unlocked [species]." @@ -286,20 +296,86 @@ You've gained [totalkarma] total karma in your time here.
"} usr << "You already have this species unlocked!" return -/client/proc/karmacharge(var/cost) +/client/proc/karmacharge(var/cost,var/refund = 0) var/DBQuery/query = dbcon.NewQuery("SELECT * FROM karmatotals WHERE byondkey='[usr.key]'") query.Execute() while(query.NextRow()) var/spent = text2num(query.item[4]) - spent += cost + if(refund) + spent += cost + else + spent -= cost query = dbcon.NewQuery("UPDATE karmatotals SET karmaspent=[spent] WHERE byondkey='[usr.key]'") if(!query.Execute()) var/err = query.ErrorMsg() - log_game("SQL ERROR during karmaspent updating (updating existing entry). Error : \[[err]\]\n") - message_admins("SQL ERROR during karmaspent updating (updating existing entry). Error : \[[err]\]\n") + log_game("SQL ERROR during karmaspent updating (updating existing entry). Error: \[[err]\]\n") + message_admins("SQL ERROR during karmaspent updating (updating existing entry). Error: \[[err]\]\n") return else - usr << "You have been charged [cost]." - message_admins("[key_name(usr)] has been charged [cost].") + usr << "You have been charged [cost] karma." + message_admins("[key_name(usr)] has been charged [cost] karma.") return + +/client/proc/karmarefund(var/type,var/name,var/cost) + var/DBQuery/query = dbcon.NewQuery("SELECT * FROM whitelist WHERE ckey='[usr.key]'") + query.Execute() + + var/dbjob + var/dbspecies + var/dbckey + while(query.NextRow()) + dbckey = query.item[2] + dbjob = query.item[3] + dbspecies = query.item[4] + + if(dbckey) + var/list/typelist = list() + if(type == "job") + typelist = text2list(dbjob,",") + else if(type == "species") + typelist = text2list(dbspecies,",") + else + usr << "\red Type [type] is not a valid column." + + if(name in typelist) + typelist -= name + var/newtypelist = list2text(typelist,",") + query = dbcon.NewQuery("UPDATE whitelist SET [type]='[newtypelist]' WHERE ckey='[dbckey]'") + if(!query.Execute()) + var/err = query.ErrorMsg() + log_game("SQL ERROR during whitelist logging (updating existing entry). Error: \[[err]\]\n") + message_admins("SQL ERROR during whitelist logging (updating existing entry). Error: \[[err]\]\n") + return + else + usr << "You have been refunded [cost] karma for [type] [name]." + message_admins("[key_name(usr)] has been refunded [cost] karma for [type] [name].") + karmacharge(text2num(cost),1) + else + usr << "\red You have not bought [name]." + + else + usr << "\red Your ckey ([dbckey]) was not found." + +/client/proc/checkpurchased(var/name) + var/DBQuery/query = dbcon.NewQuery("SELECT * FROM whitelist WHERE ckey='[usr.key]'") + query.Execute() + + var/dbjob + var/dbspecies + var/dbckey + while(query.NextRow()) + dbckey = query.item[2] + dbjob = query.item[3] + dbspecies = query.item[4] + + if(dbckey) + var/list/joblist = text2list(dbjob,",") + var/list/specieslist = text2list(dbspecies,",") + var/list/combinedlist = joblist + specieslist + if(name in combinedlist) + return 1 + else + return 0 + else + return 0 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 175da10bf00..4a5b0ad21bd 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1017,7 +1017,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(!reagents.has_reagent("inaprovaline")) adjustOxyLoss(1)*/ - if(hallucination) + if(hallucination && !(species.flags & IS_SYNTHETIC)) if(hallucination >= 20) if(prob(3)) fake_attack(src) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index b0886e4bb9c..4c6c95129a5 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -1096,7 +1096,7 @@ datum var/datum/disease2/disease/V = C.virus2[ID] if(prob(5)) if(prob(50)) - M.radiation += 50 // curing it that way may kill you instead + M.apply_effect(50,IRRADIATE,0) // curing it that way may kill you instead M.adjustToxLoss(100) M:antibodies |= V.antigen ..() @@ -1299,7 +1299,7 @@ datum return on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom - M.radiation += 3 + M.apply_effect(3,IRRADIATE,0) ..() return */ @@ -1857,7 +1857,7 @@ datum on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom - M.radiation = max(M.radiation-3*REM,0) + M.apply_effect(max(M.radiation-3*REM,0),IRRADIATE,0) ..() return @@ -1873,7 +1873,7 @@ datum if(M.stat == 2.0) return //See above, down and around. --Agouri if(!M) M = holder.my_atom - M.radiation = max(M.radiation-7*REM,0) + M.radiation = M.apply_effect(max(M.radiation-7*REM,0),IRRADIATE,0) M.adjustToxLoss(-1*REM) if(prob(15)) M.take_organ_damage(1, 0) diff --git a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm index d1d3937c972..c492bf59907 100644 --- a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm +++ b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm @@ -20,7 +20,8 @@ H.vessel.add_reagent("blood",5) H.nutrition += 50 * weakness H.adjustBrainLoss(-25 * weakness) - H.radiation -= min(H.radiation, 25 * weakness) + var/radiation = min(H.radiation, 25 * weakness) + H.apply_effect(-radiation,IRRADIATE,0) H.bodytemperature = initial(H.bodytemperature) spawn(1) H.fixblood() diff --git a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm index b1a22b6bd11..17ed53282db 100644 --- a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm +++ b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm @@ -14,7 +14,7 @@ C.adjustBruteLoss(rand(5,25) * weakness) C.adjustFireLoss(rand(5,25) * weakness) C.adjustBrainLoss(rand(5,25) * weakness) - C.radiation += 25 * weakness + C.apply_effect(25 * weakness,IRRADIATE,0) C.nutrition -= min(50 * weakness, C.nutrition) C.Dizzy(6 * weakness) C.weakened += 6 * weakness diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index f8f917bd0e1..6669e2c15dc 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -136,7 +136,7 @@ stage = 4 maxm = 3 activate(var/mob/living/carbon/mob,var/multiplier) - mob.radiation += (2*multiplier) + mob.apply_effect(2*multiplier,IRRADIATE,0) /datum/disease2/effect/deaf name = "Dead Ear Syndrome"