mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
Hydroponics
Fixed a horrible bug with the replica pods grabbing non-dead players. Wizard Fixed a potential exploit with the teleport spell (object, of course). AIs Fixed another horrible bug of mine, where the death() proc doesn't process past a certain point. Glowshrooms Now drop to the floor when the walls nearby are destroyed. Biomass WIP added. Do NOT spawn them on live servers unless you want colors everywhere. Also my code is horrible and I should feel horrible. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1521 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -750,6 +750,14 @@ proc/move_mining_shuttle()
|
||||
var/turf/simulated/floor/airless/asteroid/W
|
||||
var/old_dir = dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/glowshroom/shroom in get_step(src,direction))
|
||||
if(!shroom.floor) //shrooms drop to the floor
|
||||
shroom.floor = 1
|
||||
shroom.icon_state = "glowshroomf"
|
||||
shroom.pixel_x = 0
|
||||
shroom.pixel_y = 0
|
||||
|
||||
W = new /turf/simulated/floor/airless/asteroid( locate(src.x, src.y, src.z) )
|
||||
W.dir = old_dir
|
||||
W.fullUpdateMineralOverlays()
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
var/se = null
|
||||
var/ckey = null
|
||||
var/realName = null
|
||||
var/mind = null
|
||||
var/datum/mind/mind = null
|
||||
gender = "male"
|
||||
|
||||
/obj/item/seeds/berryseed
|
||||
|
||||
@@ -661,7 +661,7 @@
|
||||
M.mind.special_verbs -= /client/proc/blink
|
||||
else if(spell_type == "object")
|
||||
for(var/obj/spell/spell_to_remove in src.spell_list)
|
||||
src.spell_list -= spell_to_remove
|
||||
del(spell_to_remove)
|
||||
|
||||
/*Checks if the wizard can cast spells.
|
||||
Made a proc so this is not repeated 14 (or more) times.*/
|
||||
|
||||
@@ -793,7 +793,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
else
|
||||
podman.real_name = "pod person" //No null names!!
|
||||
|
||||
if(mind && istype(mind,/datum/mind)) //let's try that
|
||||
if(mind && istype(mind,/datum/mind) && mind.current.stat == 2) //only transfer dead people's minds
|
||||
mind:transfer_to(podman)
|
||||
mind:original = podman
|
||||
else //welp
|
||||
@@ -841,14 +841,18 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(!prob(potency)) //if it fails, plantman!
|
||||
podman.mutantrace = "plant"
|
||||
|
||||
else //else, one packet of seeds. ONE.
|
||||
var/obj/item/seeds/replicapod/harvestseeds = new /obj/item/seeds/replicapod(user.loc)
|
||||
harvestseeds.lifespan = lifespan
|
||||
harvestseeds.endurance = endurance
|
||||
harvestseeds.maturation = maturation
|
||||
harvestseeds.production = production
|
||||
harvestseeds.yield = yield
|
||||
harvestseeds.potency = potency
|
||||
else //else, one packet of seeds. maybe two
|
||||
var/seed_count = 1
|
||||
if(prob(yield * parent.yieldmod * 20))
|
||||
seed_count++
|
||||
for(var/i=0,i<seed_count,i++)
|
||||
var/obj/item/seeds/replicapod/harvestseeds = new /obj/item/seeds/replicapod(user.loc)
|
||||
harvestseeds.lifespan = lifespan
|
||||
harvestseeds.endurance = endurance
|
||||
harvestseeds.maturation = maturation
|
||||
harvestseeds.production = production
|
||||
harvestseeds.yield = yield
|
||||
harvestseeds.potency = potency
|
||||
|
||||
parent.update_tray()
|
||||
|
||||
|
||||
117
code/game/objects/biomass.dm
Normal file
117
code/game/objects/biomass.dm
Normal file
@@ -0,0 +1,117 @@
|
||||
/obj/biomass
|
||||
icon = 'biomass.dmi'
|
||||
icon_state = "stage1"
|
||||
opacity = 0
|
||||
density = 0
|
||||
anchored = 1
|
||||
layer = 20 //DEBUG
|
||||
var/health = 10
|
||||
var/stage = 1
|
||||
var/obj/rift/originalRift = null //the originating rift of that biomass
|
||||
var/maxDistance = 15 //the maximum length of a thread
|
||||
var/newSpreadDistance = 10 //the length of a thread at which new ones are created
|
||||
var/curDistance = 1 //the current length of a thread
|
||||
var/continueChance = 3 //weighed chance of continuing in the same direction. turning left or right has 1 weight both
|
||||
var/spreadDelay = 1 //will change to something bigger later, but right now I want it to spread as fast as possible for testing
|
||||
|
||||
/obj/rift
|
||||
icon = 'biomass.dmi'
|
||||
icon_state = "rift"
|
||||
var/list/obj/biomass/linkedBiomass = list() //all the biomass patches that have spread from it
|
||||
var/newicon = 1 //DEBUG
|
||||
|
||||
/obj/rift/New()
|
||||
..()
|
||||
|
||||
for(var/turf/T in orange(1,src))
|
||||
if(!IsValidBiomassLoc(T))
|
||||
continue
|
||||
var/obj/biomass/starting = new /obj/biomass(T)
|
||||
starting.dir = get_dir(src,starting)
|
||||
starting.originalRift = src
|
||||
linkedBiomass += starting
|
||||
spawn(1) //DEBUG
|
||||
starting.icon_state = "[newicon]"
|
||||
|
||||
/obj/rift/Del()
|
||||
for(var/obj/biomass/biomass in linkedBiomass)
|
||||
del(biomass)
|
||||
..()
|
||||
|
||||
/obj/biomass/New()
|
||||
..()
|
||||
if(!IsValidBiomassLoc(loc,src))
|
||||
del(src)
|
||||
return
|
||||
spawn(1) //so that the dir and stuff can be set by the source first
|
||||
if(curDistance >= maxDistance)
|
||||
return
|
||||
switch(dir)
|
||||
if(NORTHWEST)
|
||||
dir = NORTH
|
||||
if(NORTHEAST)
|
||||
dir = EAST
|
||||
if(SOUTHWEST)
|
||||
dir = WEST
|
||||
if(SOUTHEAST)
|
||||
dir = SOUTH
|
||||
sleep(spreadDelay)
|
||||
Spread()
|
||||
|
||||
/obj/biomass/proc/Spread(var/direction = dir)
|
||||
var/possibleDirsInt = 0
|
||||
|
||||
for(var/newDirection in cardinal)
|
||||
if(newDirection == turn(direction,180)) //can't go backwards
|
||||
continue
|
||||
var/turf/T = get_step(loc,newDirection)
|
||||
if(!IsValidBiomassLoc(T,src))
|
||||
continue
|
||||
possibleDirsInt |= newDirection
|
||||
|
||||
var/list/possibleDirs = list()
|
||||
|
||||
if(possibleDirsInt & direction)
|
||||
for(var/i=0 , i<continueChance , i++)
|
||||
possibleDirs += direction
|
||||
if(possibleDirsInt & turn(direction,90))
|
||||
possibleDirs += turn(direction,90)
|
||||
if(possibleDirsInt & turn(direction,-90))
|
||||
possibleDirs += turn(direction,-90)
|
||||
|
||||
if(!possibleDirs.len)
|
||||
return
|
||||
|
||||
direction = pick(possibleDirs)
|
||||
|
||||
var/obj/biomass/newBiomass = new /obj/biomass(get_step(src,direction))
|
||||
newBiomass.curDistance = curDistance + 1
|
||||
newBiomass.maxDistance = maxDistance
|
||||
newBiomass.dir = direction
|
||||
newBiomass.originalRift = originalRift
|
||||
newBiomass.icon_state = "[originalRift.newicon]" //DEBUG
|
||||
originalRift.linkedBiomass += newBiomass
|
||||
|
||||
if(!(curDistance%newSpreadDistance))
|
||||
var/obj/rift/newrift = new /obj/rift(loc)
|
||||
if(originalRift.newicon <= 3)
|
||||
newrift.newicon = originalRift.newicon + 1
|
||||
// NewSpread()
|
||||
|
||||
/obj/biomass/proc/NewSpread(maxDistance = 15)
|
||||
for(var/turf/T in orange(1,src))
|
||||
if(!IsValidBiomassLoc(T,src))
|
||||
continue
|
||||
var/obj/biomass/starting = new /obj/biomass(T)
|
||||
starting.dir = get_dir(src,starting)
|
||||
starting.maxDistance = maxDistance
|
||||
|
||||
/proc/IsValidBiomassLoc(turf/location,obj/biomass/source = null)
|
||||
for(var/obj/biomass/biomass in location)
|
||||
if(biomass != source)
|
||||
return 0
|
||||
if(istype(location,/turf/space))
|
||||
return 0
|
||||
if(location.density)
|
||||
return 0
|
||||
return 1
|
||||
@@ -1,6 +1,8 @@
|
||||
//separate dm since hydro is getting bloated already
|
||||
|
||||
/obj/glowshroom
|
||||
name = "glowshroom"
|
||||
anchored = 1
|
||||
opacity = 0
|
||||
density = 0
|
||||
icon = 'lighting.dmi'
|
||||
@@ -60,11 +62,7 @@
|
||||
|
||||
for(var/turf/turf in view(3,src))
|
||||
if(!turf.density && !istype(turf,/turf/space))
|
||||
var/isAdjacent = 0
|
||||
if(!spreadsIntoAdjacent)
|
||||
for(var/obj/glowshroom in view(1,turf))
|
||||
isAdjacent = 1
|
||||
if(!isAdjacent)
|
||||
if(spreadsIntoAdjacent || !locate(/obj/glowshroom) in view(1,turf))
|
||||
possibleLocs += turf
|
||||
|
||||
if(!possibleLocs.len)
|
||||
|
||||
@@ -102,6 +102,14 @@
|
||||
for(var/obj/falsewall/W in range(temploc,1))
|
||||
W.relativewall()
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/glowshroom/shroom in get_step(src,direction))
|
||||
if(!shroom.floor) //shrooms drop to the floor
|
||||
shroom.floor = 1
|
||||
shroom.icon_state = "glowshroomf"
|
||||
shroom.pixel_x = 0
|
||||
shroom.pixel_y = 0
|
||||
|
||||
..()
|
||||
|
||||
/obj/falsewall/Del()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
if(corpse)
|
||||
src.corpse = corpse
|
||||
src.loc = get_turf(corpse.loc)
|
||||
src.loc = get_turf(corpse)
|
||||
src.real_name = corpse.real_name
|
||||
src.name = corpse.real_name
|
||||
src.verbs += /mob/dead/observer/proc/reenter_corpse
|
||||
@@ -16,6 +16,7 @@
|
||||
set category = "Special Verbs"
|
||||
set name = "Ghost"
|
||||
set desc = "You cannot be revived as a ghost"
|
||||
|
||||
/*if(src.stat != 2) //this check causes nothing but troubles. Commented out for Nar-Sie's sake. --rastaf0
|
||||
src << "Only dead people and admins get to ghost, and admins don't use this verb to ghost while alive."
|
||||
return*/
|
||||
|
||||
@@ -12,26 +12,32 @@
|
||||
src.lying = 1
|
||||
src.icon_state = "ai-crash"
|
||||
|
||||
var/callshuttle = 0
|
||||
|
||||
for(var/obj/machinery/computer/communications/commconsole in world)
|
||||
if(istype(commconsole.loc,/turf))
|
||||
return
|
||||
break
|
||||
callshuttle++
|
||||
|
||||
for(var/obj/item/weapon/circuitboard/communications/commboard in world)
|
||||
if(istype(commboard.loc,/turf) || istype(commboard.loc,/obj/item/weapon/storage))
|
||||
return
|
||||
break
|
||||
callshuttle++
|
||||
|
||||
for(var/mob/living/silicon/ai/shuttlecaller in world)
|
||||
if(!shuttlecaller.stat && shuttlecaller.client && istype(shuttlecaller.loc,/turf))
|
||||
return
|
||||
break
|
||||
callshuttle++
|
||||
|
||||
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
|
||||
return
|
||||
callshuttle = 0
|
||||
|
||||
emergency_shuttle.incall(2)
|
||||
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
||||
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
||||
world << "\blue <B>Alert: The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.</B>"
|
||||
world << sound('shuttlecalled.ogg')
|
||||
if(callshuttle == 3) //if all three conditions are met
|
||||
emergency_shuttle.incall(2)
|
||||
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
||||
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
||||
world << "\blue <B>Alert: The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.</B>"
|
||||
world << sound('shuttlecalled.ogg')
|
||||
|
||||
for(var/obj/machinery/ai_status_display/O in world) //change status
|
||||
spawn( 0 )
|
||||
|
||||
BIN
icons/obj/biomass.dmi
Normal file
BIN
icons/obj/biomass.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
@@ -450,6 +450,7 @@
|
||||
#include "code\game\mecha\working\ripley.dm"
|
||||
#include "code\game\mecha\working\working.dm"
|
||||
#include "code\game\objects\assemblies.dm"
|
||||
#include "code\game\objects\biomass.dm"
|
||||
#include "code\game\objects\blood.dm"
|
||||
#include "code\game\objects\bomb.dm"
|
||||
#include "code\game\objects\cleaner.dm"
|
||||
|
||||
Reference in New Issue
Block a user