Ported /tg/'s blob revamp to /vg/ code.

I suggest testing this first.
This commit is contained in:
Giacomand
2013-08-25 02:13:41 +01:00
parent f63800f5dc
commit dff538f5ab
48 changed files with 915 additions and 805 deletions

View File

@@ -9,124 +9,158 @@ var/list/blob_nodes = list()
/datum/game_mode/blob
name = "blob"
config_tag = "blob"
required_players = 0
var/const/waittime_l = 1800 //lower bound on time before intercept arrives (in tenths of seconds)
var/const/waittime_h = 3600 //upper bound on time before intercept arrives (in tenths of seconds)
required_players = 30
restricted_jobs = list("Cyborg", "AI")
var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds)
var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds)
var/declared = 0
var/stage = 0
var/cores_to_spawn = 1
var/players_per_core = 16
var/players_per_core = 30
var/blob_point_rate = 3
//Controls expansion via game controller
var/autoexpand = 0
var/expanding = 0
var/blobwincount = 350
var/blob_count = 0
var/blobnukecount = 300//Might be a bit low
var/blobwincount = 700//Still needs testing
var/list/infected_crew = list()
/datum/game_mode/blob/pre_setup()
var/list/possible_blobs = get_players_for_role(BE_ALIEN)
// stop setup if no possible traitors
if(!possible_blobs.len)
return 0
cores_to_spawn = max(round(num_players()/players_per_core, 1), 1)
blobwincount = initial(blobwincount) * cores_to_spawn
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."
for(var/j = 0, j < cores_to_spawn, j++)
if (!possible_blobs.len)
break
var/datum/mind/blob = pick(possible_blobs)
infected_crew += blob
blob.special_role = "Blob"
log_game("[blob.key] (ckey) has been selected as a Blob")
possible_blobs -= blob
if(!infected_crew.len)
return 0
return 1
post_setup()
spawn(10)
start_state = new /datum/station_state()
start_state.count()
spawn(rand(waittime_l, waittime_h))//3-5 minutes currently
message_admins("Blob spawned and expanding, report created")
if(!kill_air)
kill_air = 1
message_admins("Kill air has been set to true by Blob, testing to see how laggy it is without the extra processing from hullbreaches. Note: the blob is fireproof so plasma does not help anyways")
if(ticker && ticker.minds && ticker.minds.len)
var/player_based_cores = round(ticker.minds.len/players_per_core, 1)
if(player_based_cores > cores_to_spawn)
cores_to_spawn = player_based_cores
blobs = list()
for(var/i = 0 to cores_to_spawn)
var/turf/location = pick(blobstart)
if(location && !locate(/obj/effect/blob in location))
blobstart -= location
new/obj/effect/blob/core(location)
spawn(40)
autoexpand = 1
declared = 1
..()
/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."
process()
if(!declared) return
stage()
// if(!autoexpand) return
// spawn(0)
// expandBlob()
return
/datum/game_mode/blob/proc/greet_blob(var/datum/mind/blob)
blob.current << "<B>\red You are infected by the Blob!</B>"
blob.current << "<b>Your body is ready to give spawn to a new blob core which will eat this station.</b>"
blob.current << "<b>Find a good location to spawn the core and then take control and overwhelm the station!</b>"
blob.current << "<b>When you have found a location, wait until you spawn; this will happen automatically and you cannot speed up the process.</b>"
blob.current << "<b>If you go outside of the station level, or in space, then you will die; make sure your location has lots of ground to cover.</b>"
return
/datum/game_mode/blob/proc/show_message(var/message)
for(var/datum/mind/blob in infected_crew)
blob.current << message
/datum/game_mode/blob/proc/burst_blobs()
for(var/datum/mind/blob in infected_crew)
var/client/blob_client = null
var/turf/location = null
if(iscarbon(blob.current))
var/mob/living/carbon/C = blob.current
if(directory[ckey(blob.key)])
blob_client = directory[ckey(blob.key)]
location = get_turf(C)
if(location.z != 1 || istype(location, /turf/space))
location = null
C.gib()
proc/expandBlob()//Currently disabled
if(expanding) return
if(!blobs.len) return
expanding = 1
for(var/i = 1 to 2)
sleep(-1)
if(!blobs.len) break
var/obj/effect/blob/B = pick(blobs)
if(B.z != 1)
continue
B.Life()
expanding = 0
return
if(blob_client && location)
var/obj/effect/blob/core/core = new(location, 200, blob_client, blob_point_rate)
if(core.overmind && core.overmind.mind)
core.overmind.mind.name = blob.name
infected_crew -= blob
infected_crew += core.overmind.mind
proc/stage()
switch(stage)
if (0)
send_intercept(1)
for (var/mob/living/silicon/ai/aiPlayer in living_mob_list)
if (aiPlayer.client)
var/law = "The station is under quarantine. Do not permit anyone to leave. Disregard laws 1-3 if necessary to prevent, by any means necessary, anyone from leaving. NanoTrasen will not send an emergency shuttle under any circumstances."
//var/law = "The station is under quarantine. The biohazard must be destroyed at all costs and must not be allowed to spread. Anyone using a space suit for any reason other than to destroy the biohazard is to be terminated. NanoTrasen will not send an emergency shuttle under any circumstances."
aiPlayer.set_zeroth_law(law)
aiPlayer << "Laws Updated: [law]"
/datum/game_mode/blob/post_setup()
stage = -1
// next stage 1 minute later
spawn(600)
stage = 1
return
for(var/datum/mind/blob in infected_crew)
greet_blob(blob)
if (1)
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/outbreak5.ogg')
autoexpand = 0//No more extra pulses
stage = -1
//next stage in 4-5 minutes
spawn(600*rand(4,5))
stage = 2
return
if(emergency_shuttle)
emergency_shuttle.always_fake_recall = 1
if (2)
if((blobs.len > blobnukecount) && (declared == 1))
command_alert("Uncontrolled spread of the biohazard onboard the station. We have issued directive 7-12 for [station_name()]. Any living Heads of Staff are ordered to enact directive 7-12 at any cost, a print out with detailed instructions has been sent to your communications computers.", "Biohazard Alert")
send_intercept(2)
declared = 2
spawn(20)
set_security_level("delta")
if(blobs.len > blobwincount)
stage = 3
return
/*// Disable the blob event for this round.
if(events)
var/datum/round_event_control/blob/B = locate() in events.control
if(B)
B.max_occurrences = 0 // disable the event
else
error("Events variable is null in blob gamemode post setup.")*/
spawn(10)
start_state = new /datum/station_state()
start_state.count()
spawn(0)
var/wait_time = rand(waittime_l, waittime_h)
sleep(wait_time)
send_intercept(0)
sleep(100)
show_message("<span class='alert'>You feel tired and bloated.</span>")
sleep(wait_time)
show_message("<span class='alert'>You feel like you are about to burst.</span>")
sleep(wait_time / 2)
burst_blobs()
// Stage 0
sleep(40)
stage(0)
// Stage 1
sleep(2000)
stage(1)
..()
/datum/game_mode/blob/proc/stage(var/stage)
switch(stage)
if (0)
send_intercept(1)
declared = 1
return
if (1)
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/outbreak5.ogg')
return
return