Files
vgstation13/code/game/gamemodes/blob/blob.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

186 lines
6.0 KiB
Plaintext

/datum/game_mode/blob
name = "blob"
config_tag = "blob"
var/stage = 0
var/next_stage = 0
/datum/game_mode/blob/announce()
world << "<B>The current game mode is - <font color='green'>Blob</font>!</B>"
world << "<B>A dangerous alien organism is rapidly spreading throughout the station!</B>"
world << "You must kill it all while minimizing the damage to the station."
/datum/game_mode/blob/post_setup()
spawn(10)
start_state = new /datum/station_state()
start_state.count()
spawn (20)
var/turf/location = pick(blobstart)
blobs = list()
new /obj/blob(location)
..()
/datum/game_mode/blob/process()
if (prob(2))
spawn_meteors()
life()
stage()
/datum/game_mode/blob/proc/life()
if (blobs.len > 0)
for (var/i = 1 to 25)
if (blobs.len == 0)
break
var/obj/blob/B = pick(blobs)
if(B.z != 1)
continue
for (var/atom/A in B.loc)
A.blob_act()
B.Life()
/datum/game_mode/blob/proc/stage()
// initial stage timing
if (!next_stage)
// sometime between 20s to 1m30s after round start
next_stage = world.timeofday + rand(200, 900)
if (world.timeofday < next_stage)
return
switch (stage)
if (0)
var/dat = ""
dat += "<FONT size = 3><B>Cent. Com. Update</B>: Biohazard Alert.</FONT><HR>"
dat += "Reports indicate the probable transfer of a biohazardous agent onto [station_name()] during the last crew deployment cycle.<BR>"
dat += "Preliminary analysis of the organism classifies it as a level 5 biohazard. Its origin is unknown.<BR>"
dat += "Cent. Com. has issued a directive 7-10 for [station_name()]. The station is to be considered quarantined.<BR>"
dat += "Orders for all [station_name()] personnel follows:<BR>"
dat += " 1. Do not leave the quarantine area.<BR>"
dat += " 2. Locate any outbreaks of the organism on the station.<BR>"
dat += " 3. If found, use any neccesary means to contain the organism.<BR>"
dat += " 4. Avoid damage to the capital infrastructure of the station.<BR>"
dat += "<BR>Note in the event of a quarantine breach or uncontrolled spread of the biohazard, the directive 7-10 may be upgraded to a directive 7-12 without further notice.<BR>"
dat += "Message ends."
for (var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "paper- 'Cent. Com. Biohazard Alert.'"
P.info = dat
C.messagetitle.Add("Cent. Com. Biohazard Alert")
C.messagetext.Add(P.info)
world << "<FONT size = 3><B>Cent. Com. Update</B>: Biohazard Alert.</FONT>"
world << "\red Summary downloaded and printed out at all communications consoles."
for (var/mob/living/silicon/ai/aiPlayer in world)
if (aiPlayer.client)
var/law = "The station is under a quarantine. Do not permit anyone to leave. Disregard rules 1-3 if necessary to prevent, by any means necessary, anyone from leaving."
aiPlayer.add_supplied_law(8, law)
aiPlayer << "An additional law has been added by CentCom: [law]"
stage = 1
// next stage 5-10 minutes later
next_stage = world.timeofday + 600*rand(5,10)
if (1)
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
stage = 2
// now check every minute
next_stage = world.timeofday + 600
if (2)
if (blobs.len > 500)
command_alert("Uncontrolled spread of the biohazard onboard the station. We have issued directive 7-12 for [station_name()]. Estimated time until directive implementation: 60 seconds.", "Biohazard Alert")
stage = 3
next_stage = world.timeofday + 600
else
next_stage = world.timeofday + 600
if (3)
stage = 4
var/turf/ground_zero = locate("landmark*blob-directive")
if (ground_zero)
ground_zero = get_turf(ground_zero)
else
ground_zero = locate(45,45,1)
explosion(ground_zero, 100, 250, 500, 750)
/datum/game_mode/blob/check_finished()
if(stage >= 4)
return 1
for(var/obj/blob/B in blobs)
if(B.z == 1)
return 0
return 1
/datum/game_mode/blob/declare_completion()
if (stage == 4)
world << "<FONT size = 3><B>The staff has lost!</B></FONT>"
world << "<B>The station was destroyed by Cent. Com.</B>"
var/numDead = 0
var/numAlive = 0
var/numSpace = 0
var/numPod = 0
var/numOffStation = 0
for (var/mob/living/silicon/ai/aiPlayer in world)
for(var/mob/M in world)
if ((M != aiPlayer && M.client))
if (M.stat == 2)
numDead += 1
else
var/T = M.loc
if (istype(T, /turf/space))
numSpace += 1
else
if (istype(T, /obj/machinery/vehicle/pod))
numPod += 1
else if (istype(T, /turf))
if (M.z!=1)
numOffStation += 1
else
numAlive += 1
else
numAlive += 1
if (numSpace==0 && numPod==0 && numOffStation==0)
world << "<FONT size = 3><B>The AI has won!</B></FONT>"
world << "<B>The AI successfully maintained the quarantine - no players escaped in pods, were in space, or were off-station (as far as we can tell).</B>"
log_game("AI won at Blob mode despite overall loss.")
else
world << "<FONT size = 3><B>The AI has lost!</B></FONT>"
world << text("<B>The AI failed to maintain the quarantine - [] players escaped in pods, [] were in space, and [] were off-station (as far as we can tell).</B>", numPod, numSpace, numOffStation)
log_game("AI lost at Blob mode.")
log_game("Blob mode was lost.")
return 1
else
world << "<FONT size = 3><B>The staff has won!</B></FONT>"
world << "<B>The alien organism has been eradicated from the station</B>"
var/datum/station_state/end_state = new /datum/station_state()
end_state.count()
var/percent = round( 100.0 * start_state.score(end_state), 0.1)
world << "<B>The station is [percent]% intact.</B>"
log_game("Blob mode was won with station [percent]% intact.")
world << "\blue Rebooting in 30s"
..()
return 1