Fixed a few runtimes

Blob mode updated slightly
Wizard smoke from his smoke spell will partly block lasers that go through it.
Going to try and test a diff way for the singularity to "del" items, might cause less lag, it will also eat absorb other singularities.
RD lost tech storage access, see http://nanotrasen.com/phpBB3/viewtopic.php?f=9&t=5991 for details


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2192 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2011-09-13 07:30:07 +00:00
parent 9b7afeb978
commit 81c68898ae
17 changed files with 595 additions and 88 deletions
+12 -19
View File
@@ -27,11 +27,15 @@
message_admins("Blob spawned and expanding, report created")
blobs = list()
active_blobs = list()
for (var/i = 1 to 4)
for(var/i = 1 to 3)
var/turf/location = pick(blobstart)
if(location)
if(!locate(/obj/blob in location))
new/obj/blob(location)
var/obj/blob/blob = new/obj/blob(location)
spawn(100)
if(blob)
if(blob.blobtype == "Blob")
blob.blobdebug = 1
spawn(40)
modestart = 1
..()
@@ -47,7 +51,7 @@
/datum/game_mode/blob/proc/life()
if (blobs.len > 0)
for (var/i = 1 to 25)
for (var/i = 1 to 20)
sleep(-1)
if (blobs.len == 0)
break
@@ -63,12 +67,12 @@
/datum/game_mode/blob/proc/stage()
send_intercept()
if (world.timeofday < next_stage)
return
switch(stage)
if (0)
send_intercept()
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 laws 1-3 if necessary to prevent, by any means necessary, anyone from leaving."
@@ -76,7 +80,7 @@
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)
next_stage = world.timeofday + 600*rand(2,8)
if (1)
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
@@ -86,29 +90,18 @@
next_stage = world.timeofday + 600
if (2)
if (blobs.len > 500)
if (blobs.len > 800)//Dono if this should be more or less yet
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(!modestart)
return 0
if(stage >= 4)
if(stage >= 3)
return 1
for(var/obj/blob/B in blobs)
if(B.z == 1)
@@ -119,7 +112,7 @@
/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>"
world << "<B>The station was destroyed by NanoTrasen</B>"
var/numDead = 0
var/numAlive = 0
var/numSpace = 0
+79 -45
View File
@@ -3,11 +3,20 @@
name = "blob"
icon = 'blob.dmi'
icon_state = "blob"
density = 1
density = 0//Whoooo this could end badly
opacity = 0
anchored = 1
var/active = 1
var/health = 40
var
active = 1
health = 40
blobtype = "Blob"
blobdebug = 0
/*Types
Blob
Node
Factory
Shield
*/
New(loc, var/h = 40)
@@ -23,60 +32,84 @@
blobs -= src
if(active)
active_blobs -= src
if(blobtype == "Node")
processing_items.Remove(src)
..()
/*
proc/poisoned(iteration)
src.health -= 20
src.update()
for(var/obj/blob/B in orange(1,src))
if(prob(100/(iteration/2)))
spawn(rand(10,100))
if(B)
B.poisoned(iteration+1)
*/
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if( (air_group && blobtype != "Shield") || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
return 0
proc/Life()
set background = 1
if(!active) return
var/turf/U = src.loc
/* if (locate(/obj/movable, U))
U = locate(/obj/movable, U)
if(U.density == 1)
del(src)
if(U.poison> 200000)
src.health -= round(U.poison/200000)
src.update()
return
*/
//Spaceblobs will harden and become inactive
if(istype(U, /turf/space))
src.active = 0
src.health += 40
src.name = "strong blob"
src.icon_state = "blob_idle"//needs a new sprite
proc/check_mutations()
if(blobtype != "Blob") return
//Spaceeeeeeblobbb
if(istype(src.loc, /turf/space))
active = 0
health += 40
name = "strong blob"
icon_state = "blob_idle"//needs a new sprite
blobtype = "Shield"
active_blobs -= src
return 1
//Commandblob
if((blobdebug == 1))
active = 0
health += 80
name = "odd blob"
icon_state = "blob_node"//needs a new sprite
blobtype = "Node"
active_blobs -= src
processing_items.Add(src)
return 1
if((blobdebug == 2))
//active = 0
health += 20
name = "very odd blob"
icon_state = "blob_factory"//needs a new sprite
blobtype = "Factory"
//active_blobs -= src
//processing_items.Add(src)
return 1
return 0
proc/process()
spawn(-1)
Life()
return
proc/Life(var/pulse = 0)
set background = 1
if(blobtype == "Factory")
for(var/i = 1 to 2)
new/obj/critter/blob(src.loc)
return
if(check_mutations())
return
var/p = health //TODO: DEFERRED * (U.n2/11376000 + U.oxygen/1008000 + U.co2/200)
if(!prob(p)) return
if(!prob(health)) return//Does not do much unless its healthy it seems, might want to change this later
for(var/dirn in cardinal)
sleep(3)
// sleep(3) Due to the background we might not need this dono though
var/turf/T = get_step(src, dirn)
if(istype(T.loc, /area/arrival))
continue
if((locate(/obj/blob) in T))
if((src.blobtype == "Node") || (pulse > 0))
var/obj/blob/E = (locate(/obj/blob) in T)
if(pulse < 12)//No inf loops here
var/npulse = pulse + 1
E.Life(npulse)
return//Pass it along and end
continue
var/obj/blob/B = new /obj/blob(U, src.health)
var/obj/blob/B = new /obj/blob(src.loc, src.health)
if(T.Enter(B,src) && !(locate(/obj/blob) in T))
B.loc = T // open cell, so expand
else
@@ -93,7 +126,7 @@
ex_act(severity)
switch(severity)
if(1)
del(src)
src.health -= rand(90,150)
if(2)
src.health -= rand(60,90)
src.update()
@@ -102,11 +135,12 @@
src.update()
proc/update()
proc/update()//Needs to be updated with the types
if(health <= 0)
playsound(src.loc, 'splat.ogg', 50, 1)
del(src)
return
if(blobtype != "Blob") return
if(health<10)
icon_state = "blob_damaged"
return
@@ -123,7 +157,7 @@
attackby(var/obj/item/weapon/W, var/mob/user)
playsound(src.loc, 'attackblob.ogg', 50, 1)
src.visible_message("\red <B>The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
src.visible_message("\red <B>The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]")
var/damage = W.force / 4.0
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W