From 06fc24e9539e5b3228106b9e2da297ae62ab8f04 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Sun, 6 May 2018 09:22:49 +0000 Subject: [PATCH] Makes it plausible for the lone operative event to roll if the nuclear disk stays still for long enough (#37468) * makes it possible for the lone operative event to roll if the nuclear disk stays still for long enough * makes the event weight increase chance reset if the disk moves * slows this shit *WAY* down, adds a minimum time for the weight to start rolling for an increase (approximately 10 minutes) * . * this was an absolute pain in the ass to test - addresses reviews * addresses ninjanomnom's review, makes it possible for the loneop event weight to decrease if the disk moves --- .../nukeop/equipment/nuclearbomb.dm | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm index 0e588c4380..a9c6a112bd 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm @@ -501,16 +501,37 @@ This is here to make the tiles around the station mininuke change when it's arme armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100) resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF var/fake = FALSE + var/turf/lastlocation + var/last_disk_move /obj/item/disk/nuclear/Initialize() . = ..() if(!fake) GLOB.poi_list |= src + last_disk_move = world.time + START_PROCESSING(SSobj, src) /obj/item/disk/nuclear/ComponentInitialize() . = ..() AddComponent(/datum/component/stationloving, !fake) +/obj/item/disk/nuclear/process() + if(fake) + STOP_PROCESSING(SSobj, src) + CRASH("A fake nuke disk tried to call process(). Who the fuck and how the fuck") + var/turf/newturf = get_turf(src) + if(newturf && lastlocation == newturf) + if(last_disk_move < world.time - 5000 && prob((world.time - 5000 - last_disk_move)*0.00001)) + var/datum/round_event_control/operative/loneop = locate(/datum/round_event_control/operative) in SSevents.control + if(istype(loneop)) + loneop.weight += 1 + else + lastlocation = newturf + last_disk_move = world.time + var/datum/round_event_control/operative/loneop = locate(/datum/round_event_control/operative) in SSevents.control + if(istype(loneop) && prob(loneop.weight)) + loneop.weight = max(loneop.weight - 1, 0) + /obj/item/disk/nuclear/examine(mob/user) . = ..() if(!fake)