Added wallrot event.

Also some updates to changelog.
This commit is contained in:
cib
2013-05-18 21:55:02 +02:00
parent 38cdb4d4f5
commit d7cc42e588
9 changed files with 148 additions and 9 deletions
+5
View File
@@ -61,6 +61,7 @@
possibleEvents[/datum/event/ionstorm] = 25 + active_with_role["AI"] * 25 + active_with_role["Cyborg"] * 25 + active_with_role["Engineer"] * 10 + active_with_role["Scientist"] * 5
possibleEvents[/datum/event/grid_check] = 25 + 10 * active_with_role["Engineer"]
possibleEvents[/datum/event/electrical_storm] = 75 + 25 * active_with_role["Janitor"] + 5 * active_with_role["Engineer"]
possibleEvents[/datum/event/wallrot] = 50 * active_with_role["Engineer"] + 100 * active_with_role["Botanist"]
if(!spacevines_spawned)
possibleEvents[/datum/event/spacevine] = 5 + 10 * active_with_role["Engineer"]
@@ -180,6 +181,7 @@
active_with_role["AI"] = 0
active_with_role["Cyborg"] = 0
active_with_role["Janitor"] = 0
active_with_role["Botanist"] = 0
for(var/mob/M in player_list)
if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
@@ -212,4 +214,7 @@
if(M.mind.assigned_role == "Janitor")
active_with_role["Janitor"]++
if(M.mind.assigned_role == "Botanist")
active_with_role["Botanist"]++
return active_with_role
+37
View File
@@ -0,0 +1,37 @@
/turf/simulated/wall
datum/event/wallrot
var/severity = 1
datum/event/wallrot/setup()
announceWhen = rand(0, 3000)
endWhen = announceWhen + 1
severity = rand(5, 10)
datum/event/wallrot/announce()
command_alert("Harmful fungi detected on station. Station structures may be contaminated.", "Biohazard Alert")
datum/event/wallrot/start()
spawn()
var/turf/center = null
// 100 attempts
for(var/i=0, i<100, i++)
var/turf/candidate = locate(rand(1, world.maxx), rand(1, world.maxy), 1)
if(istype(candidate, /turf/simulated/wall))
center = candidate
if(center)
// Make sure at least one piece of wall rots!
center:rot()
// Have a chance to rot lots of other walls.
var/rotcount = 0
for(var/turf/simulated/wall/W in range(5, center)) if(prob(50))
W:rot()
rotcount++
// Only rot up to severity walls
if(rotcount >= severity)
break
@@ -1214,6 +1214,17 @@ datum
..()
return
// Clear off wallrot fungi
reaction_turf(var/turf/T, var/volume)
if(istype(T, /turf/simulated/wall))
var/turf/simulated/wall/W = T
if(W.rotting)
W.rotting = 0
for(var/obj/effect/E in W) if(E.name == "Wallrot") del E
for(var/mob/O in viewers(W, null))
O.show_message(text("\blue The fungi are completely dissolved by the solution!"), 1)
reaction_obj(var/obj/O, var/volume)
if(istype(O,/obj/effect/alien/weeds/))
var/obj/effect/alien/weeds/alien_weeds = O
@@ -49,12 +49,20 @@
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
var/A_turf = get_turf(A)
spawn(0)
for(var/i=0, i<3, i++)
step_towards(D,A)
D.reagents.reaction(get_turf(D))
for(var/atom/T in get_turf(D))
D.reagents.reaction(T)
// When spraying against the wall, also react with the wall, but
// not its contents.
if(get_dist(D, A_turf) == 1 && A_turf.density)
D.reagents.reaction(A_turf)
sleep(2)
sleep(3)
del(D)