Files
Paradise/code/game/gamemodes/malfunction/Malf_Modules.dm
rastaf.zero@gmail.com d6e0f1cf22 Freaking big GAMEMODES UPDATE.
I have done lots of work to make selecting players for special roles be fair.
- New options preferences: "be traitor", "be changeling" and so on for all special roles.
- Now you can have job of AI/cyborg in preferences and do not lower your chances to become wizard/changeling/etc. And vice-versa: you do not have to select AI in your preferences to have non zero chance to play malf.
- Jobban from syndicate bans player from any special role (including malf AI, cult, etc).
- Fixed bug with changeling round not ending sometimes.
- All special roles were tuned to work better as admin-driven event.
-- All adminmade special characters will be listed at the end of round of any type.
-- All adminmade special characters are fully functional with following exceptions:
--- The ending conditions are determined at round start, i.e. you cannot end revolution by killing wizards and malf AIs (however, with nuke you can end anything).
--- The cultists cannot get their special objectives.
--- The malf AI can hack the APCs but without any profit.
--- The syndicate operatives must obtain the nuke/working code from admins.
--- As before, nuclear explosion ends round. Even if nuke was used in wrong place.
- Fixed thingy like "Not enough players for revolution game mode. Restarting world in 5 seconds."
- Changeling wont get objective "absorb X genomes" when there are less that X players in game.
- proc/equip_if_possible now has return value, procs like equip_revolutionary (giving a flash) should be more reliable.
- There are no fake wizards anymore. The research staff have to kill ALL wizards on order to win, even adminspawned ones. ("give spell" verb works as before, not making a spellcaster to actually be wizard).
- The semi-new game mode: traitor+changeling. Just like regular traitor mode plus one changeling. Round ends when the shuttle reaches centcom. Option for config.txt: "PROBABILITY TRAITORCHAN".
- Successful malf AI now have 60 seconds to choose to explode the station or not (some players still have to rejoin game to have their new verbs shown in Malfunction tab).
- Monkeys mode fixed, monkeys wouldn't randomly cure anymore.

For admins:
- New powerful mind editor oriented to mixed rounds.
-- Setting someone as special character (like wizard) does not equip him/her automatically. You have to do it it next step. Note, that in case of wizards and nuke operatives their old dress will be deleted! If you do not want it you shall use "undress" link.
-- Only operatives, head revs and cultists have their objectives set immediately.
-- You can unemad borgs!
-- You cannot unemag borgs because calling mind editor for nonhumans is blocked atm.
-- many other useful features.
-- you can fix burned out flashes from mind editor.
-- first assign the new malf AI/wizard then demalf/dewizard old one or round will immediately end.
- if delete the nuke bomb during its downcounting round will stuck. Using "edit ticker variables" set ticker.mode.explosion_in_progress = 0.

For coders:
- /datum/game_mode/malfunction/AI_Module renamed to /datum/AI_Module. Reason: What. The. Fuck.

Unrelated fixes:
- Blueprints can create areas up to 300 tiles (was 100).
- Cyborgs wont leave backpacks at spawn point anymore.
- Fixed bug in preferences causing preferences files to be huge.
- Diseases can infect again.
- The option "SQL_ENABLED 0" now works in config.txt.
- fixed critical bug on assassinate objective.

Bugs:
- We have a bug with job distribution for people who haven't any available jobs in their preferences. Players tends to group by jobs.
- For example, if we have 3 players they with hight chances will got same jobs. And probability of having one engineer and one medic _exactly_ equals _zero_.
- I am not sure if my changes made that bug worse. Anyway I MUST do this commit. Bug will be fixed eventually. Maybe.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1703 316c924e-a436-60f5-8080-3fe189b3f50e
2011-06-21 21:22:23 +00:00

272 lines
8.8 KiB
Plaintext

// TO DO:
/*
epilepsy flash on lights
delay round message
microwave makes robots
dampen radios
reactivate cameras - done
eject engine
core sheild
cable stun
rcd light flash thingy on matter drain
*/
/datum/AI_Module
var/uses = 0
var/module_name
var/mod_pick_name
var/description = ""
var/engaged = 0
/datum/AI_Module/large/
uses = 1
/datum/AI_Module/small/
uses = 5
/datum/AI_Module/large/fireproof_core
module_name = "Core upgrade"
mod_pick_name = "coreup"
/client/proc/fireproof_core()
set category = "Malfunction"
set name = "Fireproof Core"
for(var/mob/living/silicon/ai/ai in world)
ai.fire_res_on_core = 1
usr.verbs -= /client/proc/fireproof_core
usr << "\red Core fireproofed."
/datum/AI_Module/large/upgrade_turrets
module_name = "AI Turret upgrade"
mod_pick_name = "turret"
/client/proc/upgrade_turrets()
set category = "Malfunction"
set name = "Upgrade Turrets"
usr.verbs -= /client/proc/upgrade_turrets
for(var/obj/machinery/turret/turret in world)
turret.health += 30
turret.shot_delay = 20
/datum/AI_Module/large/disable_rcd
module_name = "RCD disable"
mod_pick_name = "rcd"
/client/proc/disable_rcd()
set category = "Malfunction"
set name = "Disable RCDs"
for(var/datum/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.disabled = 1
for(var/obj/item/mecha_parts/mecha_equipment/tool/rcd/rcd in world)
rcd.disabled = 1
usr << "RCD-disabling pulse emitted."
else usr << "Out of uses."
/datum/AI_Module/small/overload_machine
module_name = "Machine overload"
mod_pick_name = "overload"
uses = 2
/client/proc/overload_machine(obj/machinery/M as obj in world)
set name = "Overload Machine"
set category = "Malfunction"
if (istype(M, /obj/machinery))
for(var/datum/AI_Module/small/overload_machine/overload in usr:current_modules)
if(overload.uses > 0)
overload.uses --
for(var/mob/V in hearers(M, null))
V.show_message("\blue You hear a loud electrical buzzing sound!", 2)
spawn(50)
explosion(get_turf(M), 0,1,1,0)
del(M)
else usr << "Out of uses."
else usr << "That's not a machine."
/datum/AI_Module/small/blackout
module_name = "Blackout"
mod_pick_name = "blackout"
uses = 3
/client/proc/blackout()
set category = "Malfunction"
set name = "Blackout"
for(var/datum/AI_Module/small/blackout/blackout in usr:current_modules)
if(blackout.uses > 0)
blackout.uses --
for(var/obj/machinery/power/apc/apc in world)
if(prob(30*apc.overload))
apc.overload_lighting()
else apc.overload++
else usr << "Out of uses."
/datum/AI_Module/small/interhack
module_name = "Hack intercept"
mod_pick_name = "interhack"
/client/proc/interhack()
set category = "Malfunction"
set name = "Hack intercept"
usr.verbs -= /client/proc/interhack
ticker.mode:hack_intercept()
/datum/AI_Module/small/reactivate_camera
module_name = "Reactivate camera"
mod_pick_name = "recam"
uses = 10
/client/proc/reactivate_camera(obj/machinery/camera/C as obj in world)
set name = "Reactivate Camera"
set category = "Malfunction"
if (istype (C, /obj/machinery/camera))
for(var/datum/AI_Module/small/reactivate_camera/camera in usr:current_modules)
if(camera.uses > 0)
if(!C.status)
C.status = !C.status
camera.uses --
for(var/mob/V in viewers(src, null))
V.show_message(text("\blue You hear a quiet click."))
else
usr << "This camera is either active, or not repairable."
else usr << "Out of uses."
else usr << "That's not a camera."
/datum/AI_Module/module_picker
var/temp = null
var/processing_time = 100
var/list/possible_modules = list()
/datum/AI_Module/module_picker/New()
src.possible_modules += new /datum/AI_Module/large/fireproof_core
src.possible_modules += new /datum/AI_Module/large/upgrade_turrets
src.possible_modules += new /datum/AI_Module/large/disable_rcd
src.possible_modules += new /datum/AI_Module/small/overload_machine
src.possible_modules += new /datum/AI_Module/small/interhack
src.possible_modules += new /datum/AI_Module/small/blackout
src.possible_modules += new /datum/AI_Module/small/reactivate_camera
/datum/AI_Module/module_picker/proc/use(user as mob)
var/dat
if (src.temp)
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
else if(src.processing_time <= 0)
dat = "<B> No processing time is left available. No more modules are able to be chosen at this time."
else
dat = "<B>Select use of processing time: (currently [src.processing_time] left.)</B><BR>"
dat += "<HR>"
dat += "<B>Install Module:</B><BR>"
dat += "<I>The number afterwards is the amount of processing time it consumes.</I><BR>"
for(var/datum/AI_Module/large/module in src.possible_modules)
dat += "<A href='byond://?src=\ref[src];[module.mod_pick_name]=1'>[module.module_name]</A> (50)<BR>"
for(var/datum/AI_Module/small/module in src.possible_modules)
dat += "<A href='byond://?src=\ref[src];[module.mod_pick_name]=1'>[module.module_name]</A> (15)<BR>"
dat += "<HR>"
user << browse(dat, "window=modpicker")
onclose(user, "modpicker")
return
/datum/AI_Module/module_picker/Topic(href, href_list)
..()
if (href_list["coreup"])
var/already
for (var/datum/AI_Module/mod in usr:current_modules)
if(istype(mod, /datum/AI_Module/large/fireproof_core))
already = 1
if (!already)
usr.verbs += /client/proc/fireproof_core
usr:current_modules += new /datum/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"])
var/already
for (var/datum/AI_Module/mod in usr:current_modules)
if(istype(mod, /datum/AI_Module/large/upgrade_turrets))
already = 1
if (!already)
usr.verbs += /client/proc/upgrade_turrets
usr:current_modules += new /datum/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"])
var/already
for (var/datum/AI_Module/mod in usr:current_modules)
if(istype(mod, /datum/AI_Module/large/disable_rcd))
mod:uses += 1
already = 1
if (!already)
usr:current_modules += new /datum/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"])
var/already
for (var/datum/AI_Module/mod in usr:current_modules)
if(istype(mod, /datum/AI_Module/small/overload_machine))
mod:uses += 2
already = 1
if (!already)
usr.verbs += /client/proc/overload_machine
usr:current_modules += new /datum/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"])
var/already
for (var/datum/AI_Module/mod in usr:current_modules)
if(istype(mod, /datum/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/AI_Module/small/blackout
else src.temp = "Three additional uses added to Blackout module."
src.processing_time -= 15
else if (href_list["interhack"])
var/already
for (var/datum/AI_Module/mod in usr:current_modules)
if(istype(mod, /datum/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/AI_Module/small/interhack
src.processing_time -= 15
else src.temp = "This module is only needed once."
else if (href_list["recam"])
var/already
for (var/datum/AI_Module/mod in usr:current_modules)
if(istype(mod, /datum/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/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
src.use(usr)
return