mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
- Small lights (Bulbs) now emit a constant 3 units of luminosity instead of the rand(3,6). Tube's luminosity is still random: rand(6,9).
Screenshot: http://www.kamletos.si/ss13-dim%20lights.PNG (Note that in this screenshot, tubes were set to a flat 6, this is not the case in the commit tho. So only look at lights with bulbs, most of which are in maintenance shafts) - Space kudzu added (Original code and sprites donated by I Said No). Currently admin-only. Spawn the spacevine_controller to start the spreading of kudzu Screenshot: http://www.kamletos.si/kudzu2.png (This was after 15 minutes of unattended growth.) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2226 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -550,6 +550,7 @@
|
||||
|
||||
|
||||
//Could not find object proc defines and this could almost be an atom level one.
|
||||
|
||||
/obj/proc/process()
|
||||
processing_objects.Remove(src)
|
||||
return 0
|
||||
return 0
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
// SPACE VINE OR KUDZU
|
||||
|
||||
/obj/spacevine
|
||||
name = "Space Kudzu"
|
||||
desc = "An extremely expansionistic species of vine."
|
||||
icon = 'kudzu.dmi'
|
||||
icon_state = "Light1"
|
||||
anchored = 1
|
||||
density = 0
|
||||
var/energy = 0 //Energy sounds like an arbitrary-enough variable name.
|
||||
var/obj/spacevine_controller/master = null
|
||||
|
||||
New()
|
||||
if(istype(src.loc, /turf/space))
|
||||
del(src)
|
||||
return
|
||||
|
||||
Del()
|
||||
if(master)
|
||||
master.vines -= src
|
||||
master.growth_queue -= src
|
||||
..()
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (!W) return
|
||||
if (!user) return
|
||||
if (istype(W, /obj/item/weapon/circular_saw)) del src
|
||||
if (istype(W, /obj/item/weapon/kitchen/utensil/knife)) del src
|
||||
if (istype(W, /obj/item/weapon/scalpel)) del src
|
||||
if (istype(W, /obj/item/weapon/screwdriver)) del src
|
||||
if (istype(W, /obj/item/weapon/shard)) del src
|
||||
if (istype(W, /obj/item/weapon/weldingtool)) del src
|
||||
if (istype(W, /obj/item/weapon/wirecutters)) del src
|
||||
..()
|
||||
|
||||
/obj/spacevine_controller
|
||||
var/list/obj/spacevine/vines = list()
|
||||
var/list/growth_queue = list()
|
||||
var/reached_collapse_size
|
||||
var/reached_slowdown_size
|
||||
//What this does is that instead of having the grow minimum of 1, required to start growing, the minimum will be 0,
|
||||
//meaning if you get the kudzu's size to something less than 20 plots, it won't grow anymore.
|
||||
|
||||
New()
|
||||
if(!istype(src.loc,/turf/simulated/floor))
|
||||
del(src)
|
||||
|
||||
spawn_kudzu_piece(src.loc)
|
||||
processing_objects.Add(src)
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
proc/spawn_kudzu_piece(var/turf/location)
|
||||
var/obj/spacevine/SV = new(location)
|
||||
growth_queue += SV
|
||||
vines += SV
|
||||
SV.master = src
|
||||
|
||||
process()
|
||||
if(!vines)
|
||||
del(src) //Kudzu exterminated
|
||||
return
|
||||
if(!growth_queue)
|
||||
del(src) //Sanity check
|
||||
return
|
||||
if(vines.len >= 250 && !reached_collapse_size)
|
||||
reached_collapse_size = 1
|
||||
if(vines.len >= 30 && !reached_slowdown_size )
|
||||
reached_slowdown_size = 1
|
||||
|
||||
var/length = 0
|
||||
if(reached_collapse_size)
|
||||
length = 0
|
||||
else if(reached_slowdown_size)
|
||||
if(prob(25))
|
||||
length = 1
|
||||
else
|
||||
length = 0
|
||||
else
|
||||
length = 1
|
||||
length = min( 30 , max( length , vines.len / 5 ) )
|
||||
var/i = 0
|
||||
var/list/obj/spacevine/queue_end = list()
|
||||
|
||||
for( var/obj/spacevine/SV in growth_queue )
|
||||
i++
|
||||
queue_end += SV
|
||||
growth_queue -= SV
|
||||
if(SV.energy < 2)
|
||||
if(prob(10))
|
||||
SV.grow()
|
||||
//if(prob(25))
|
||||
SV.spread()
|
||||
if(i >= length)
|
||||
break
|
||||
|
||||
growth_queue = growth_queue + queue_end
|
||||
|
||||
//sleep(5)
|
||||
//src.process()
|
||||
|
||||
/obj/spacevine/proc/grow()
|
||||
switch(energy)
|
||||
if (0)
|
||||
src.icon_state = pick("Med1", "Med2", "Med3")
|
||||
energy = 1
|
||||
src.opacity = 1
|
||||
if (1)
|
||||
src.icon_state = pick("Hvy1", "Hvy2", "Hvy3")
|
||||
energy = 2
|
||||
src.density = 1
|
||||
|
||||
/obj/spacevine/proc/spread()
|
||||
var/direction = pick(cardinal)
|
||||
if(istype(get_step(src,direction),/turf/simulated/floor))
|
||||
var/turf/simulated/floor/F = get_step(src,direction)
|
||||
if(!locate(/obj/spacevine,F))
|
||||
if(F.Enter(src))
|
||||
if(master)
|
||||
master.spawn_kudzu_piece( F )
|
||||
|
||||
|
||||
/*
|
||||
/obj/spacevine/proc/Life()
|
||||
if (!src) return
|
||||
var/Vspread
|
||||
if (prob(50)) Vspread = locate(src.x + rand(-1,1),src.y,src.z)
|
||||
else Vspread = locate(src.x,src.y + rand(-1, 1),src.z)
|
||||
var/dogrowth = 1
|
||||
if (!istype(Vspread, /turf/simulated/floor)) dogrowth = 0
|
||||
for(var/obj/O in Vspread)
|
||||
if (istype(O, /obj/window) || istype(O, /obj/forcefield) || istype(O, /obj/blob) || istype(O, /obj/alien/weeds) || istype(O, /obj/spacevine)) dogrowth = 0
|
||||
if (istype(O, /obj/machinery/door/))
|
||||
if(O:p_open == 0 && prob(50)) O:open()
|
||||
else dogrowth = 0
|
||||
if (dogrowth == 1)
|
||||
var/obj/spacevine/B = new /obj/spacevine(Vspread)
|
||||
B.icon_state = pick("vine-light1", "vine-light2", "vine-light3")
|
||||
spawn(20)
|
||||
if(B)
|
||||
B.Life()
|
||||
src.growth += 1
|
||||
if (src.growth == 10)
|
||||
src.name = "Thick Space Kudzu"
|
||||
src.icon_state = pick("vine-med1", "vine-med2", "vine-med3")
|
||||
src.opacity = 1
|
||||
src.waittime = 80
|
||||
if (src.growth == 20)
|
||||
src.name = "Dense Space Kudzu"
|
||||
src.icon_state = pick("vine-hvy1", "vine-hvy2", "vine-hvy3")
|
||||
src.density = 1
|
||||
spawn(src.waittime)
|
||||
if (src.growth < 20) src.Life()
|
||||
|
||||
*/
|
||||
|
||||
/obj/spacevine/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(90))
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/spacevine/temperature_expose(null, temp, volume)
|
||||
del src
|
||||
@@ -41,7 +41,7 @@
|
||||
icon_state = "bulb1"
|
||||
base_state = "bulb"
|
||||
fitting = "bulb"
|
||||
brightness = 5
|
||||
brightness = 3
|
||||
desc = "A small lighting fixture."
|
||||
light_type = /obj/item/weapon/light/bulb
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
if("tube")
|
||||
brightness = rand(6,9)
|
||||
if("bulb")
|
||||
brightness = rand(3,6)
|
||||
brightness = 3
|
||||
spawn(1)
|
||||
update()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user