Merge branch 'master' of https://github.com/Baystation12/Baystation12 into bleeding-edge-freeze

Conflicts:
	code/modules/events/infestation.dm
This commit is contained in:
Chinsky
2013-02-21 12:00:33 +04:00
8 changed files with 79 additions and 59 deletions

View File

@@ -95,15 +95,16 @@
anchored = 0 anchored = 0
layer = 2.7 layer = 2.7
health = 3 health = 3
var/amount_grown = 0 var/amount_grown = -1
var/obj/machinery/atmospherics/unary/vent_pump/entry_vent var/obj/machinery/atmospherics/unary/vent_pump/entry_vent
var/travelling_in_vent = 0 var/travelling_in_vent = 0
New() New()
pixel_x = rand(6,-6) pixel_x = rand(6,-6)
pixel_y = rand(6,-6) pixel_y = rand(6,-6)
processing_objects.Add(src)
//50% chance to grow up //50% chance to grow up
if(prob(50)) if(prob(50))
processing_objects.Add(src) amount_grown = 1
/obj/effect/spider/spiderling/Bump(atom/user) /obj/effect/spider/spiderling/Bump(atom/user)
if(istype(user, /obj/structure/table)) if(istype(user, /obj/structure/table))
@@ -134,8 +135,8 @@
entry_vent = null entry_vent = null
return return
var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = pick(vents) var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = pick(vents)
if(prob(50)) /*if(prob(50))
src.visible_message("<B>[src] scrambles into the ventillation ducts!</B>") src.visible_message("<B>[src] scrambles into the ventillation ducts!</B>")*/
spawn(rand(20,60)) spawn(rand(20,60))
loc = exit_vent loc = exit_vent
@@ -164,21 +165,24 @@
entry_vent = null entry_vent = null
//================= //=================
else if(prob(33)) else if(prob(25))
var/list/nearby = oview(10, src) var/list/nearby = oview(5, src)
if(nearby.len) if(nearby.len)
var/target_atom = pick(nearby) var/target_atom = pick(nearby)
walk_to(src, target_atom) walk_to(src, target_atom, 5)
if(prob(40)) if(prob(25))
src.visible_message("\blue \the [src] skitters[pick(" away"," around","")].") src.visible_message("\blue \the [src] skitters[pick(" away"," around","")].")
else if(prob(10)) else if(prob(5))
//ventcrawl! //ventcrawl!
for(var/obj/machinery/atmospherics/unary/vent_pump/v in view(7,src)) for(var/obj/machinery/atmospherics/unary/vent_pump/v in view(7,src))
if(!v.welded) if(!v.welded)
entry_vent = v entry_vent = v
walk_to(src, entry_vent, 1) walk_to(src, entry_vent, 5)
break break
if(isturf(loc))
if(prob(1))
src.visible_message("\blue \the [src] chitters.")
if(isturf(loc) && amount_grown > 0)
amount_grown += rand(0,2) amount_grown += rand(0,2)
if(amount_grown >= 100) if(amount_grown >= 100)
var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider))

View File

@@ -47,13 +47,13 @@
possibleEvents[/datum/event/infestation] = 50 + 25 * active_with_role["Janitor"] possibleEvents[/datum/event/infestation] = 50 + 25 * active_with_role["Janitor"]
possibleEvents[/datum/event/communications_blackout] = 50 + 25 * active_with_role["AI"] + active_with_role["Scientist"] * 25 possibleEvents[/datum/event/communications_blackout] = 50 + 25 * active_with_role["AI"] + active_with_role["Scientist"] * 25
possibleEvents[/datum/event/ionstorm] = active_with_role["AI"] * 25 + active_with_role["Cyborg"] * 25 + active_with_role["Engineer"] * 10 + active_with_role["Scientist"] * 5 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] = 10 * active_with_role["Engineer"] 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/electrical_storm] = 75 + 25 * active_with_role["Janitor"] + 5 * active_with_role["Engineer"]
if(!spacevines_spawned) if(!spacevines_spawned)
possibleEvents[/datum/event/spacevine] = 5 + 10 * active_with_role["Engineer"] possibleEvents[/datum/event/spacevine] = 5 + 10 * active_with_role["Engineer"]
if(active_with_role["Engineer"] > 0 && minutes_passed >= 30) // Give engineers time to set up engine if(minutes_passed >= 30) // Give engineers time to set up engine
possibleEvents[/datum/event/meteor_wave] = 20 * active_with_role["Engineer"] possibleEvents[/datum/event/meteor_wave] = 20 * active_with_role["Engineer"]
possibleEvents[/datum/event/meteor_shower] = 80 * active_with_role["Engineer"] possibleEvents[/datum/event/meteor_shower] = 80 * active_with_role["Engineer"]
possibleEvents[/datum/event/blob] = 30 * active_with_role["Engineer"] possibleEvents[/datum/event/blob] = 30 * active_with_role["Engineer"]
@@ -64,8 +64,8 @@
possibleEvents[/datum/event/spontaneous_appendicitis] = active_with_role["Medical"] * 75 possibleEvents[/datum/event/spontaneous_appendicitis] = active_with_role["Medical"] * 75
possibleEvents[/datum/event/viral_outbreak] = active_with_role["Medical"] * 5 possibleEvents[/datum/event/viral_outbreak] = active_with_role["Medical"] * 5
if(active_with_role["Security"] > 0)
possibleEvents[/datum/event/prison_break] = active_with_role["Security"] * 50 possibleEvents[/datum/event/prison_break] = active_with_role["Security"] * 50
if(active_with_role["Security"] > 0)
if(!sent_spiders_to_station) if(!sent_spiders_to_station)
possibleEvents[/datum/event/spider_infestation] = max(active_with_role["Security"], 5) + 5 possibleEvents[/datum/event/spider_infestation] = max(active_with_role["Security"], 5) + 5
if(aliens_allowed && !sent_aliens_to_station) if(aliens_allowed && !sent_aliens_to_station)
@@ -73,6 +73,15 @@
if(!sent_ninja_to_station && toggle_space_ninja) if(!sent_ninja_to_station && toggle_space_ninja)
possibleEvents[/datum/event/space_ninja] = max(active_with_role["Security"], 5) possibleEvents[/datum/event/space_ninja] = max(active_with_role["Security"], 5)
// Debug code below here, very useful for testing so don't delete please.
/*var/debug_message = "Firing random event. "
for(var/V in active_with_role)
debug_message += "#[V]:[active_with_role[V]] "
debug_message += "||| "
for(var/V in possibleEvents)
debug_message += "[V]:[possibleEvents[V]]"
message_admins(debug_message)*/
var/picked_event = pickweight(possibleEvents) var/picked_event = pickweight(possibleEvents)
if(!picked_event) if(!picked_event)
return return
@@ -160,32 +169,32 @@
for(var/mob/M in player_list) for(var/mob/M in player_list)
if(!M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive if(!M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
continue continue
switch(role)
if("Engineer")
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module") if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
active_with_role["Engineer"]++ active_with_role["Engineer"]++
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer")) if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
active_with_role["Engineer"]++ active_with_role["Engineer"]++
if("Medical")
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module") if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
active_with_role["Medical"]++ active_with_role["Medical"]++
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor")) if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
active_with_role["Medical"]++ active_with_role["Medical"]++
if("Security")
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module") if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
active_with_role["Security"]++ active_with_role["Security"]++
if(M.mind.assigned_role in security_positions) if(M.mind.assigned_role in security_positions)
active_with_role["Security"]++ active_with_role["Security"]++
if("Scientist")
if(M.mind.assigned_role in list("Research Director", "Scientist")) if(M.mind.assigned_role in list("Research Director", "Scientist"))
active_with_role["Scientist"]++ active_with_role["Scientist"]++
if("AI")
if(M.mind.assigned_role == "AI") if(M.mind.assigned_role == "AI")
active_with_role["AI"]++ active_with_role["AI"]++
if("Cyborg")
if(M.mind.assigned_role == "Cyborg") if(M.mind.assigned_role == "Cyborg")
active_with_role["Cyborg"]++ active_with_role["Cyborg"]++
if("Janitor")
if(M.mind.assigned_role == "Janitor") if(M.mind.assigned_role == "Janitor")
active_with_role["Janitor"]++ active_with_role["Janitor"]++
return active_with_role return active_with_role

View File

@@ -3,7 +3,7 @@ var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event
//var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event - /datum/event/spider_infestation - /datum/event/alien_infestation //var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event - /datum/event/spider_infestation - /datum/event/alien_infestation
var/eventTimeLower = 15000 //15 minutes var/eventTimeLower = 15000 //15 minutes
var/eventTimeUpper = 30000 //45 minutes var/eventTimeUpper = 30000 //30 minutes
var/scheduledEvent = null var/scheduledEvent = null
@@ -25,11 +25,11 @@ var/scheduledEvent = null
playercount_modifier = 1.2 playercount_modifier = 1.2
if(11 to 15) if(11 to 15)
playercount_modifier = 1.1 playercount_modifier = 1.1
if(16 to 20) if(16 to 25)
playercount_modifier = 1 playercount_modifier = 1
if(21 to 25) if(26 to 35)
playercount_modifier = 0.9 playercount_modifier = 0.9
if(26 to 100000) if(36 to 100000)
playercount_modifier = 0.8 playercount_modifier = 0.8
scheduledEvent = world.timeofday + rand(eventTimeLower, eventTimeUpper) * playercount_modifier scheduledEvent = world.timeofday + rand(eventTimeLower, eventTimeUpper) * playercount_modifier

View File

@@ -11,7 +11,7 @@
#define VERM_MICE 0 #define VERM_MICE 0
#define VERM_LIZARDS 1 #define VERM_LIZARDS 1
#define VERM_SLIMES 2 #define VERM_SPIDERS 2
/datum/event/infestation /datum/event/infestation
announceWhen = 10 announceWhen = 10
@@ -81,20 +81,24 @@
spawn_types = list(/mob/living/simple_animal/lizard) spawn_types = list(/mob/living/simple_animal/lizard)
max_number = 6 max_number = 6
vermstring = "lizards" vermstring = "lizards"
if(VERM_SLIMES) if(VERM_SPIDERS)
spawn_types = list(/mob/living/carbon/slime) spawn_types = list(/obj/effect/spider/spiderling)
max_number = 3 max_number = 6
vermstring = "slimes" vermstring = "spiders"
spawn(0) spawn(0)
var/num = rand(2,max_number) var/num = rand(2,max_number)
while(turfs.len > 0 && num > 0) while(turfs.len > 0 && num > 0)
var/turf/simulated/floor/T = pick(turfs) var/turf/simulated/floor/T = pick(turfs)
turfs.Remove(T) turfs.Remove(T)
num--
if(vermin == VERM_SPIDERS)
var/obj/effect/spider/spiderling/S = new(T)
S.amount_grown = -1
else
var/spawn_type = pick(spawn_types) var/spawn_type = pick(spawn_types)
new spawn_type(T) new spawn_type(T)
num--
//world << "[vermstring] spawned in [spawn_area_type]"
/datum/event/infestation/announce() /datum/event/infestation/announce()
command_alert("Bioscans indicate that [vermstring] have been breeding in [locstring]. Clear them out, before this starts to affect productivity.", "Vermin infestation") command_alert("Bioscans indicate that [vermstring] have been breeding in [locstring]. Clear them out, before this starts to affect productivity.", "Vermin infestation")
@@ -111,4 +115,4 @@
#undef VERM_MICE #undef VERM_MICE
#undef VERM_LIZARDS #undef VERM_LIZARDS
#undef VERM_SLIMES #undef VERM_SPIDERS

View File

@@ -8,7 +8,7 @@ datum/event/viral_infection/setup()
severity = rand(1, 3) severity = rand(1, 3)
datum/event/viral_infection/announce() datum/event/viral_infection/announce()
command_alert("Confirmed outbreak of level [severity + rand(2,3)] biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") command_alert("Confirmed outbreak of level five biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
world << sound('sound/AI/outbreak5.ogg') world << sound('sound/AI/outbreak5.ogg')
datum/event/viral_infection/start() datum/event/viral_infection/start()

View File

@@ -8,7 +8,7 @@ datum/event/viral_outbreak/setup()
severity = rand(2, 4) severity = rand(2, 4)
datum/event/viral_outbreak/announce() datum/event/viral_outbreak/announce()
command_alert("Confirmed outbreak of level [severity + rand(3,5)] biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") command_alert("Confirmed outbreak of level 7 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
world << sound('sound/AI/outbreak7.ogg') world << sound('sound/AI/outbreak7.ogg')
datum/event/viral_outbreak/start() datum/event/viral_outbreak/start()

View File

@@ -186,6 +186,9 @@
M.powernet = PN M.powernet = PN
P = M.get_connections() P = M.get_connections()
else
return
if(P.len == 0) return if(P.len == 0) return
O = P[1] O = P[1]