From 3862c9eadc20ef56103b0bfa135e69ebc85e9d0e Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Sun, 5 Dec 2010 05:05:22 +0000 Subject: [PATCH] Gave Malf modules an initial picking over. RCD disabler, Machine Overload, Blackout, and ReCam modules now properly stack uses when purchased multiple times. It is no longer possible to buy multiple uses of one-time modules like Fireproofing, Turret upgrade, and CentComm Report Hack. Fixed an inaccuracy in the purchasing list (large modules were listed as needing 55 cycles, they only remove 50) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@536 316c924e-a436-60f5-8080-3fe189b3f50e --- .../gamemodes/malfunction/Malf_Modules.dm | 129 +++++++++++++----- 1 file changed, 94 insertions(+), 35 deletions(-) diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 7f1753a73a..328264c673 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -34,7 +34,7 @@ rcd light flash thingy on matter drain mod_pick_name = "coreup" /client/proc/fireproof_core() - set category = "AI Modules" + set category = "Malfunction" set name = "Fireproof Core" for(var/mob/living/silicon/ai/ai in world) ai.fire_res_on_core = 1 @@ -46,7 +46,7 @@ rcd light flash thingy on matter drain mod_pick_name = "turret" /client/proc/upgrade_turrets() - set category = "AI Modules" + set category = "Malfunction" set name = "Upgrade Turrets" usr.verbs -= /client/proc/upgrade_turrets for(var/obj/machinery/turret/turret in world) @@ -58,10 +58,14 @@ rcd light flash thingy on matter drain mod_pick_name = "rcd" /client/proc/disable_rcd() - set category = "AI Modules" + set category = "Malfunction" set name = "Disable RCDs" - for(var/obj/item/weapon/rcd/rcd in world) - rcd = new /obj/item/weapon/rcd_fake(rcd) + for(var/datum/game_mode/malfunction/AI_Module/large/disable_rcd/rcdmod in usr:current_modules) + if(rcdmod.uses > 0) + rcdmod.uses -- + for(var/obj/item/weapon/rcd/rcd in world) + rcd = new /obj/item/weapon/rcd_fake(rcd) + else usr << "Out of uses." /datum/game_mode/malfunction/AI_Module/small/overload_machine module_name = "Machine overload" @@ -70,6 +74,7 @@ rcd light flash thingy on matter drain /client/proc/overload_machine(obj/machinery/M as obj in world) set name = "Overload Machine" + set category = "Malfunction" for(var/datum/game_mode/malfunction/AI_Module/small/overload_machine/overload in usr:current_modules) if(overload.uses > 0) overload.uses -- @@ -77,8 +82,7 @@ rcd light flash thingy on matter drain V.show_message(text("\blue You hear a loud electrical buzzing sound!")) spawn(50) explosion(get_turf(M), 0,1,1,0) - if(overload.uses == 0) - usr.verbs -= /client/proc/overload_machine + else usr << "Out of uses." /datum/game_mode/malfunction/AI_Module/small/blackout module_name = "Blackout" @@ -86,7 +90,7 @@ rcd light flash thingy on matter drain uses = 3 /client/proc/blackout() - set category = "AI Modules" + set category = "Malfunction" set name = "Blackout" for(var/datum/game_mode/malfunction/AI_Module/small/blackout/blackout in usr:current_modules) if(blackout.uses > 0) @@ -94,15 +98,14 @@ rcd light flash thingy on matter drain for(var/obj/machinery/power/apc/apc in world) if(prob(30)) apc.overload_lighting() - if(blackout.uses == 0) - usr.verbs -= /client/proc/blackout + else usr << "Out of uses." /datum/game_mode/malfunction/AI_Module/small/interhack module_name = "Hack intercept" mod_pick_name = "interhack" /client/proc/interhack() - set category = "AI Modules" + set category = "Malfunction" set name = "Hack intercept" usr.verbs -= /client/proc/interhack ticker.mode:hack_intercept() @@ -114,6 +117,7 @@ rcd light flash thingy on matter drain /client/proc/reactivate_camera(obj/machinery/camera/C as obj in world) set name = "Reactivate Camera" + set category = "Malfunction" for(var/datum/game_mode/malfunction/AI_Module/small/reactivate_camera/camera in usr:current_modules) if(camera.uses > 0) if(!C.status) @@ -123,8 +127,7 @@ rcd light flash thingy on matter drain V.show_message(text("\blue You hear a quiet click.")) else usr << "This camera is either active, or not repairable." - if(camera.uses == 0) - usr.verbs -= /client/proc/reactivate_camera + else usr << "Out of uses." /datum/game_mode/malfunction/AI_Module/module_picker @@ -153,7 +156,7 @@ rcd light flash thingy on matter drain dat += "Install Module:
" dat += "The number afterwards is the amount of processing time it consumes.
" for(var/datum/game_mode/malfunction/AI_Module/large/module in src.possible_modules) - dat += "[module.module_name] (55)
" + dat += "[module.module_name] (50)
" for(var/datum/game_mode/malfunction/AI_Module/small/module in src.possible_modules) dat += "[module.module_name] (15)
" dat += "
" @@ -165,37 +168,93 @@ rcd light flash thingy on matter drain /datum/game_mode/malfunction/AI_Module/module_picker/Topic(href, href_list) ..() if (href_list["coreup"]) - usr.verbs += /client/proc/fireproof_core - src.temp = "An upgrade to improve core resistance, making it immune to fire and heat. This effect is permanent. One use." - src.processing_time -= 50 + var/already + for (var/datum/game_mode/malfunction/AI_Module/mod in usr:current_modules) + if(istype(mod, /datum/game_mode/malfunction/AI_Module/large/fireproof_core)) + already = 1 + if (!already) + usr.verbs += /client/proc/fireproof_core + usr:current_modules += new /datum/game_mode/malfunction/AI_Module/large/fireproof_core + src.temp = "An upgrade to improve core resistance, making it immune to fire and heat. This effect is permanent." + src.processing_time -= 50 + else src.temp = "This module is only needed once." + else if (href_list["turret"]) - usr.verbs += /client/proc/upgrade_turrets - src.temp = "Improves the firing speed and health of all AI turrets. This effect is permanent. One use." - src.processing_time -= 50 + var/already + for (var/datum/game_mode/malfunction/AI_Module/mod in usr:current_modules) + if(istype(mod, /datum/game_mode/malfunction/AI_Module/large/upgrade_turrets)) + already = 1 + if (!already) + usr.verbs += /client/proc/upgrade_turrets + usr:current_modules += new /datum/game_mode/malfunction/AI_Module/large/upgrade_turrets + src.temp = "Improves the firing speed and health of all AI turrets. This effect is permanent." + src.processing_time -= 50 + else src.temp = "This module is only needed once." + else if (href_list["rcd"]) - usr.verbs += /client/proc/disable_rcd - src.temp = "Send a specialised pulse to break all RCD devices on the station. One use." + var/already + for (var/datum/game_mode/malfunction/AI_Module/mod in usr:current_modules) + if(istype(mod, /datum/game_mode/malfunction/AI_Module/large/disable_rcd)) + mod:uses += 1 + already = 1 + if (!already) + usr:current_modules += new /datum/game_mode/malfunction/AI_Module/large/disable_rcd + usr.verbs += /client/proc/disable_rcd + src.temp = "Send a specialised pulse to break all RCD devices on the station." + else src.temp = "Additional use added to RCD disabler." src.processing_time -= 50 + else if (href_list["overload"]) - usr.verbs += /client/proc/overload_machine - usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/overload_machine - src.temp = "Overloads an electrical machine, causing a small explosion. 2 uses." + var/already + for (var/datum/game_mode/malfunction/AI_Module/mod in usr:current_modules) + if(istype(mod, /datum/game_mode/malfunction/AI_Module/small/overload_machine)) + mod:uses += 2 + already = 1 + if (!already) + usr.verbs += /client/proc/overload_machine + usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/overload_machine + src.temp = "Overloads an electrical machine, causing a small explosion. 2 uses." + else src.temp = "Two additional uses added to Overload module." src.processing_time -= 15 + else if (href_list["blackout"]) - usr.verbs += /client/proc/blackout - src.temp = "Attempts to overload the lighting circuits on the station, destroying some bulbs. 3 uses." - usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/blackout + var/already + for (var/datum/game_mode/malfunction/AI_Module/mod in usr:current_modules) + if(istype(mod, /datum/game_mode/malfunction/AI_Module/small/blackout)) + mod:uses += 3 + already = 1 + if (!already) + usr.verbs += /client/proc/blackout + src.temp = "Attempts to overload the lighting circuits on the station, destroying some bulbs. 3 uses." + usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/blackout + else src.temp = "Three additional uses added to Blackout module." src.processing_time -= 15 + else if (href_list["interhack"]) - usr.verbs += /client/proc/interhack - src.temp = "Hacks the status upgrade from Cent. Com, removing any information about malfunctioning electrical systems. One use." - usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/interhack - src.processing_time -= 15 + var/already + for (var/datum/game_mode/malfunction/AI_Module/mod in usr:current_modules) + if(istype(mod, /datum/game_mode/malfunction/AI_Module/small/interhack)) + already = 1 + if (!already) + usr.verbs += /client/proc/interhack + src.temp = "Hacks the status upgrade from Cent. Com, removing any information about malfunctioning electrical systems." + usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/interhack + src.processing_time -= 15 + else src.temp = "This module is only needed once." + else if (href_list["recam"]) - usr.verbs += /client/proc/reactivate_camera - src.temp = "Reactivates a currently disabled camera. 10 uses." - usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/reactivate_camera + var/already + for (var/datum/game_mode/malfunction/AI_Module/mod in usr:current_modules) + if(istype(mod, /datum/game_mode/malfunction/AI_Module/small/reactivate_camera)) + mod:uses += 10 + already = 1 + if (!already) + usr.verbs += /client/proc/reactivate_camera + src.temp = "Reactivates a currently disabled camera. 10 uses." + usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/reactivate_camera + else src.temp = "Ten additional uses added to ReCam module." src.processing_time -= 15 + else if (href_list["temp"]) src.temp = null