From 089d548825b5e5f9daf25918cfcc337f2f99ac12 Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Mon, 19 Sep 2011 04:56:49 +0000 Subject: [PATCH] - 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 --- code/game/atom_procs.dm | 3 +- code/game/gamemodes/events/kudzu.dm | 176 ++++++++++++++++++++++++++++ code/modules/power/lighting.dm | 4 +- icons/changelog.html | 1 + icons/effects/kudzu.dmi | Bin 0 -> 4210 bytes tgstation.dme | 2 + 6 files changed, 183 insertions(+), 3 deletions(-) create mode 100644 code/game/gamemodes/events/kudzu.dm create mode 100644 icons/effects/kudzu.dmi diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index 4b54cf898bb..de23cf3099f 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -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 \ No newline at end of file + return 0 diff --git a/code/game/gamemodes/events/kudzu.dm b/code/game/gamemodes/events/kudzu.dm new file mode 100644 index 00000000000..ded78ba503a --- /dev/null +++ b/code/game/gamemodes/events/kudzu.dm @@ -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 \ No newline at end of file diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index ccb7827d4cd..81f1aadf063 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -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() diff --git a/icons/changelog.html b/icons/changelog.html index ec446abd47f..36e239d3f41 100644 --- a/icons/changelog.html +++ b/icons/changelog.html @@ -63,6 +63,7 @@ should be listed in the changelog upon commit tho. Thanks. -->
  • Some religions (currently Islam, Scientology and Atheism) set your chapel's symbols to the symbols of that religion.
  • A new old-style cabinet's been added to the detective's office. (Sprite by Hempuli)
  • Runtime the cat ran away!! And it gets even worse! Mr. Deempisi met a premature end during an excursion to the kitchen's freezer! -- I was ORDERED to do this... don't kill me! :(
  • +
  • Kudzu can now be spawned (Currently admin-only. Will test a bit, balance it properly and add it as a random event) (Original code and sprites donated by I Said No)
  • Kor updated: diff --git a/icons/effects/kudzu.dmi b/icons/effects/kudzu.dmi new file mode 100644 index 0000000000000000000000000000000000000000..5d00a913f38d818d299fb8d9674617cfea57763b GIT binary patch literal 4210 zcmV-&5RLDNP)ljdyi>!hhle%Wn6GddyZ*xg z%=xbX0004WQchCV=-0C=2JR&a84_w-Y6@%7{? zOD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+(=$pSoZ^zil2jm5$)l{&P>G8(C9|j) z$Tj5ROe;#vO@*>^^79M8EM(Wd&D17jWzX05hb4->YiS`~UzB;7LS5RA_;Pn&+b9Hj;&lSqu^><{U(k;tXeZ zJhOiPXWOa*KuYTCHhx?IAP#akU)#`Yx?z}>W!cWf^*rAX%hjDc3JoLK2nyy3TKE~Xr^ug8&U7w#$ z3q=sb@nVIUQEJ-It=Pbn1{r`>+xBntzD^Bvb@h5}@uLadUV9XUH96LL?TcGBz(3ro zC>-dwm*33KVXI)#hv8vczI};OQV;sO9&m7|2dN)CDq?8&?si*loAxL%`Ok8>Ig_<* zx?b1Y?iFPL*CkE+o703?+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