mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-06 15:32:25 +00:00
Merge pull request #1567 from caelaislinn/master
ghosts can become mice at will
This commit is contained in:
@@ -37,7 +37,8 @@ var/datum/roundinfo/roundinfo = new()
|
||||
var/vermin_min_spawntime = 3000 //between 5 (3000) and 15 (9000) minutes interval
|
||||
var/vermin_max_spawntime = 9000
|
||||
var/spawning_vermin = 0
|
||||
var/list/vermin_spawn_areas
|
||||
var/max_vermin = 30
|
||||
var/list/vermin_spawn_turfs
|
||||
|
||||
/datum/controller/gameticker/proc/pregame()
|
||||
login_music = pick('title1.ogg', 'title2.ogg') // choose title music!
|
||||
@@ -57,7 +58,16 @@ var/datum/roundinfo/roundinfo = new()
|
||||
while (!setup())
|
||||
|
||||
spawn(10)
|
||||
vermin_spawn_areas = list("/area/maintenance","/area/mine/maintenance")
|
||||
var/list/vermin_spawn_areas = list("/area/maintenance","/area/mine/maintenance","/area/crew_quarters/locker/locker_toilet","/area/crew_quarters/toilet")
|
||||
vermin_spawn_turfs = new/list()
|
||||
for(var/area_text in vermin_spawn_areas)
|
||||
var/area_base_type = text2path(area_text)
|
||||
for(var/area in typesof(area_base_type))
|
||||
var/list/area_turfs = get_area_turfs(area)
|
||||
for(var/turf/T in area_turfs)
|
||||
if(T.density)
|
||||
area_turfs -= T
|
||||
vermin_spawn_turfs.Add(area_turfs)
|
||||
|
||||
/datum/controller/gameticker/proc/setup()
|
||||
//Create and announce mode
|
||||
@@ -314,35 +324,30 @@ var/datum/roundinfo/roundinfo = new()
|
||||
world.Reboot()
|
||||
|
||||
//randomly spawn vermin in maintenance and other areas
|
||||
if(spawn_vermin && vermin_spawn_areas && vermin_spawn_areas.len)
|
||||
if(spawn_vermin && vermin_spawn_turfs && vermin_spawn_turfs.len)
|
||||
if(!spawning_vermin)
|
||||
spawning_vermin = 1
|
||||
spawn(rand(vermin_min_spawntime, vermin_max_spawntime))
|
||||
var/area_text = pick(vermin_spawn_areas)
|
||||
area_text = text2path(area_text)
|
||||
var/random_area = pick( typesof(area_text) )
|
||||
var/list/turfs = get_area_turfs(random_area)
|
||||
if(!turfs.len)
|
||||
turfs = get_area_turfs(pick(typesof(pick(vermin_spawn_areas))))
|
||||
//
|
||||
while(turfs.len > 0)
|
||||
var/turf/T = pick(turfs)
|
||||
turfs -= T
|
||||
if(T.density)
|
||||
continue
|
||||
var/bad = 0
|
||||
for(var/obj/I in T)
|
||||
if(I.density)
|
||||
bad = 1
|
||||
break
|
||||
if(bad)
|
||||
continue
|
||||
spawning_vermin = 0
|
||||
var/cur_alive_vermin = 0
|
||||
//check to see if there are too many already
|
||||
for(var/obj/effect/critter/roach/R in world)
|
||||
cur_alive_vermin++
|
||||
for(var/mob/living/simple_animal/mouse/M in world)
|
||||
if(!M.stat)
|
||||
cur_alive_vermin++
|
||||
if(cur_alive_vermin <= max_vermin)
|
||||
return
|
||||
|
||||
var/turf/T = pick(vermin_spawn_turfs)
|
||||
if(T)
|
||||
if(prob(50))
|
||||
new /mob/living/simple_animal/mouse(T)
|
||||
else
|
||||
new /obj/effect/critter/roach(T)
|
||||
break
|
||||
spawning_vermin = 0
|
||||
else
|
||||
//no turf, skip this time
|
||||
vermin_spawn_turfs.Remove(T)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@
|
||||
atkcarbon = 1
|
||||
atksilicon = 0
|
||||
attacktext = "bites"
|
||||
layer = 2.1 //so they can hide under objects
|
||||
|
||||
Bump(var/mob/M)
|
||||
if(ishuman(M))
|
||||
|
||||
@@ -153,6 +153,38 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
verbs += /mob/proc/ghost
|
||||
del(src)
|
||||
|
||||
/mob/dead/observer/proc/become_mouse()
|
||||
set category = "Ghost"
|
||||
set name = "Become mouse"
|
||||
//locate an empty mouse
|
||||
if(client && client.holder && client.holder.state == 2)
|
||||
var/rank = client.holder.rank
|
||||
client.clear_admin_verbs()
|
||||
client.holder.state = 1
|
||||
client.update_admins(rank)
|
||||
|
||||
var/list/eligible_targets = new()
|
||||
for(var/mob/living/simple_animal/mouse/M in world)
|
||||
if(!M.ckey)
|
||||
eligible_targets.Add(M)
|
||||
|
||||
var/mob/living/simple_animal/mouse/target_mouse
|
||||
if(ticker.spawn_vermin)
|
||||
if(eligible_targets.len)
|
||||
//grab a random existing one
|
||||
target_mouse = pick(eligible_targets)
|
||||
else
|
||||
//make a new mouse
|
||||
target_mouse = new(pick(ticker.vermin_spawn_turfs))
|
||||
|
||||
if(target_mouse)
|
||||
client.mob = target_mouse
|
||||
verbs += /mob/proc/ghost
|
||||
target_mouse.real_name = src.name + " (as mouse)"
|
||||
else
|
||||
client << "\red Unable to become a mouse!"
|
||||
del(src)
|
||||
|
||||
/mob/dead/observer/proc/dead_tele()
|
||||
set category = "Ghost"
|
||||
set name = "Teleport"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
response_harm = "splats the"
|
||||
density = 0
|
||||
var/color //brown, gray and white
|
||||
layer = 2.1 //so they can hide under objects
|
||||
|
||||
/mob/living/simple_animal/mouse/Life()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user