From 737c0c77009e0146d5d67b1576dc779f8a5cf39f Mon Sep 17 00:00:00 2001 From: MediHound <47318585+MediHound@users.noreply.github.com> Date: Fri, 8 Feb 2019 11:13:14 +0100 Subject: [PATCH] Update ion_storm.dm (#7980) * Update ion_storm.dm * Update ion_storm.dm --- code/modules/events/ion_storm.dm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index ba57643339..3ae71f99d8 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -12,7 +12,7 @@ var/removeDontImproveChance = 10 //chance the randomly created law replaces a random law instead of simply being added var/shuffleLawsChance = 10 //chance the AI's laws are shuffled afterwards var/botEmagChance = 10 - var/announceEvent = ION_RANDOM // -1 means don't announce, 0 means have it randomly announce, 1 means + var/announceEvent = ION_RANDOM // -1 means don't announce, 0 means have it randomly announce, 1 means it is announced var/ionMessage = null var/ionAnnounceChance = 33 announceWhen = 1 @@ -30,7 +30,7 @@ /datum/round_event/ion_storm/start() - //AI laws + //Generate AI law change for(var/mob/living/silicon/ai/M in GLOB.alive_mob_list) M.laws_sanity_check() if(M.stat != DEAD && M.see_in_dark != 0) @@ -53,6 +53,31 @@ log_game("Ion storm changed laws of [key_name(M)] to [english_list(M.laws.get_law_list(TRUE, TRUE))]") M.post_lawchange() + //Generate Cyborg law change + for(var/mob/living/silicon/robot/M in GLOB.alive_mob_list) + M.laws_sanity_check() + if(M.stat != DEAD && M.see_in_dark != 0) + if(prob(replaceLawsetChance)) + M.laws.pick_weighted_lawset() + + if(prob(removeRandomLawChance)) + M.remove_law(rand(1, M.laws.get_law_amount(list(LAW_INHERENT, LAW_SUPPLIED)))) + + var/message = ionMessage || generate_ion_law() + if(message) + if(prob(removeDontImproveChance)) + M.replace_random_law(message, list(LAW_INHERENT, LAW_SUPPLIED, LAW_ION)) + else + M.add_ion_law(message) + + if(prob(shuffleLawsChance)) + M.shuffle_laws(list(LAW_INHERENT, LAW_SUPPLIED, LAW_ION)) + + log_game("Ion storm changed laws of [key_name(M)] to [english_list(M.laws.get_law_list(TRUE, TRUE))]") + M.post_lawchange() + + + //Chance to emag a Bot if(botEmagChance) for(var/mob/living/simple_animal/bot/bot in GLOB.alive_mob_list) if(prob(botEmagChance))