Adds slime cores, replicator, extractor.

Replicator and extractor circuits currently need to be adjusted, as they require origin tech and components. This commit is being added simply to save any headaches that may occur do to data loss.
This commit is contained in:
Datraen
2016-05-13 13:28:57 -04:00
parent ad90c24965
commit a92d860aef
8 changed files with 244 additions and 22 deletions

View File

@@ -0,0 +1,128 @@
/*
Here lives the slime core extractor
This machine extracts slime cores at the cost of the slime itself.
To create more of these slimes, stick the slime core in the replicator.
*/
/obj/machinery/slime/extractor
name = "Slime extractor"
desc = "A machine for cutting up slimes to get to their cores."
density = 1
anchored = 1
circuit = /obj/item/weapon/circuitboard/slimeextractor
var/inuse
var/mob/living/simple_animal/xeno/slime/occupant = null
var/occupiedcolor = "#22FF22"
var/emptycolor = "#FF2222"
var/operatingcolor = "#FFFF22"
/obj/machinery/slime/extractor/map/New()
..()
circuit = new circuit(src)
component_parts = list()
//Component parts go here,
/obj/machinery/slime/extractor/attackby(var/obj/item/W, var/mob/user)
//Let's try to deconstruct first.
if(istype(W, /obj/item/weapon/screwdriver) && !inuse)
default_deconstruction_screwdriver(user, W)
return
if(istype(W, /obj/item/weapon/crowbar))
default_deconstruction_crowbar(user, W)
return
if(panel_open)
user << "<span class='warning'>Close the panel first!</span>"
var/obj/item/weapon/grab/G = W
if(!istype(G))
return ..()
if(G.state < 2)
user << "<span class='danger'>You need a better grip to do that!</span>"
return
move_into_extractor(user,G.affecting)
/obj/machinery/slime/extractor/MouseDrop_T(mob/target, mob/user)
if(user.stat || user.restrained())
return
move_into_extractor(user,target)
/obj/machinery/slime/extractor/proc/move_into_extractor(var/mob/user,var/mob/living/victim)
if(src.occupant)
user << "<span class='danger'>The core extractor is full, empty it first!</span>"
return
if(in_use)
user << "<span class='danger'>The core extractor is locked and running, wait for it to finish.</span>"
return
if(!(istype(victim, /mob/living/simple_animal/xeno/slime)) )
user << "<span class='danger'>This is not a suitable subject for the core extractor!</span>"
return
user.visible_message("<span class='danger'>[user] starts to put [victim] into the core extractor!</span>")
src.add_fingerprint(user)
if(do_after(user, 30) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
user.visible_message("<span class='danger'>[user] stuffs [victim] into the core extractor!</span>")
if(victim.client)
victim.client.perspective = EYE_PERSPECTIVE
victim.client.eye = src
victim.forceMove(src)
src.occupant = victim
update_light_color()
/obj/machinery/slime/extractor/proc/update_light_color()
if(src.occupant && !(inuse))
set_light(4, 4, occupiedcolor)
else if(src.occupant)
set_light(4, 4, operatingcolor)
else
set_light(4, 4, emptycolor)
/obj/machinery/slime/extractor/proc/extract_cores()
if(!src.occupant)
src.visible_message("\icon[src] [src] pings unhappily.")
else if(inuse)
return
inuse = 1
update_light_color()
spawn(30)
for(var/i=1 to occupant.cores)
var/obj/item/slime/core/C = new(src)
C.slimetraits = occupant.traitdat
C.create_reagents(C.slimetraits.traits[TRAIT_XENO_CHEMVOL])
for(var/reagent in occupant.traitdat.chems.reagents)
var/amount = occupant.traitdat.chems.reagents[reagent]
C.reagents.add_reagent(reagent, amount)
C.color = C.slimetraits.traits[TRAIT_XENO_COLOR]
spawn(30)
qdel(occupant)
inuse = 0
eject_contents()
update_light_color()
/obj/machinery/slime/extractor/proc/eject_contents()
for(var/obj/thing in (contents - component_parts - circuit))
thing.forceMove(loc)
if(occupant)
occupant.forceMove(loc)
occupant = null
//Circuit board below,
/obj/item/weapon/circuitboard/slimeextractor
name = T_BOARD("Slime extractor")
build_path = "/obj/machinery/slime/extractor"
board_type = "machine"
origin_tech = list() //To be filled,
req_components = list() //To be filled,

View File

@@ -0,0 +1,88 @@
/*
Here lives the slime replicator
This machine consumes cores to create a slime.
To create more of these cores, stick the slime core in the extractor.
*/
/obj/machinery/slime/replicator
name = "Slime replicator"
desc = "A machine for creating slimes from cores. Amazing!"
density = 1
anchored = 1
circuit = /obj/item/weapon/circuitboard/slimereplicator
var/obj/item/slime/core/core = null
var/inuse
var/occupiedcolor = "#22FF22"
var/emptycolor = "#FF2222"
var/operatingcolor = "#FFFF22"
/obj/machinery/slime/replicator/map/New()
..()
circuit = new circuit(src)
component_parts = list()
//Component parts go here,
/obj/machinery/slime/replicator/attackby(var/obj/item/W, var/mob/user)
//Let's try to deconstruct first.
if(istype(W, /obj/item/weapon/screwdriver) && !inuse)
default_deconstruction_screwdriver(user, W)
return
if(istype(W, /obj/item/weapon/crowbar))
default_deconstruction_crowbar(user, W)
return
var/obj/item/slime/core/G = W
if(!istype(G))
return ..()
if(core)
user << "<span class='warning'>The [src] is already filled!</span>"
return
if(panel_open)
user << "<span class='warning'>Close the panel first!</span>"
core = G
G.forceMove(src)
update_light_color()
/obj/machinery/slime/replicator/proc/update_light_color()
if(src.core && !(inuse))
set_light(4, 4, occupiedcolor)
else if(src.core)
set_light(4, 4, operatingcolor)
else
set_light(4, 4, emptycolor)
/obj/machinery/slime/replicator/proc/extract_cores()
if(!src.core)
src.visible_message("\icon[src] [src] pings unhappily.")
else if(inuse)
return
inuse = 1
update_light_color()
spawn(30)
var/mob/living/simple_animal/xeno/slime/S = new()
S.traitdat = core.slimetraits
S.forceMove(src)
spawn(30)
qdel(core)
inuse = 0
eject_contents()
update_light_color()
/obj/machinery/slime/replicator/proc/eject_contents()
for(var/mob/thing in contents)
thing.forceMove(loc)
if(core)
core.forceMove(loc)
core = null
//Circuit board below,
/obj/item/weapon/circuitboard/slimereplicator
name = T_BOARD("Slime replicator")
build_path = "/obj/machinery/slime/replicator"
board_type = "machine"
origin_tech = list() //To be filled,
req_components = list() //To be filled,

View File

@@ -31,9 +31,9 @@ Slime definitions, Life and New live here.
universal_speak = 1 universal_speak = 1
speak_chance = 1 speak_chance = 1
speak = list("Hello?", speak = list("Hello?",
"Where's this going?", "Where is this going?",
"What's that?", "What is that?",
"What's in the box?", "What is in the box?",
"Cargo.", "Cargo.",
"Transport?", "Transport?",
"Special?", "Special?",
@@ -81,4 +81,5 @@ Slime definitions, Life and New live here.
languages += L languages += L
speak += "[station_name()]?" speak += "[station_name()]?"
GenerateChild() GenerateChild()
return 1 return 1

View File

@@ -0,0 +1,10 @@
/*
Slime core lives here, and related procs.
*/
/obj/item/slime/core
name = "slime core"
desc = "Gooey."
icon = 'icons/mob/slime2.dmi'
icon_state = "slime extract"
var/datum/xeno/traits/slimetraits

View File

@@ -118,11 +118,13 @@ Procs for targeting
return return
if(learned_message) //Is it understood? if(learned_message) //Is it understood?
var/complete_message = ",[language.key] [message]" var/complete_message = ",[language.key] [message]"
speech_buffer.Add(complete_message) if(!(complete_message in speak))
log_debug("Added '[complete_message]'.") speech_buffer.Add(complete_message)
log_debug("Added '[complete_message]'.")
else else
*/ */
speech_buffer.Add(message) if(!(message in speak))
speech_buffer.Add(message)
..(message,verb,language,alt_name,italics,speaker) ..(message,verb,language,alt_name,italics,speaker)
/mob/living/simple_animal/xeno/proc/ProcessSpeechBuffer() /mob/living/simple_animal/xeno/proc/ProcessSpeechBuffer()

View File

@@ -73,19 +73,8 @@ Also includes Life and New
return 1 //Everything worked okay. return 1 //Everything worked okay.
/mob/living/simple_animal/xeno/New() /mob/living/simple_animal/xeno/New()
var/traits
if(istype(loc, /mob/living/simple_animal/xeno)) traitdat = new()
var/mob/living/simple_animal/xeno/X = loc
traits = X.traitdat
/*
if(istype(loc, /obj/machinery/xenobio/replicator))
var/obj/machinery/xenobio/replicator/R = loc
traits = R.connected.traitdat
*/
if(!traits)
traitdat = new()
else
traitdat = traits
ProcessTraits() ProcessTraits()
@@ -99,4 +88,5 @@ Also includes Life and New
for(var/R in default_chems) for(var/R in default_chems)
traitdat.chems.reagents.add_reagent("[R]", default_chems[R]) traitdat.chems.reagents.add_reagent("[R]", default_chems[R])
if(!health) if(!health)
stat = DEAD stat = DEAD

View File

@@ -1873,12 +1873,15 @@
#include "code\modules\virus2\helpers.dm" #include "code\modules\virus2\helpers.dm"
#include "code\modules\virus2\isolator.dm" #include "code\modules\virus2\isolator.dm"
#include "code\modules\virus2\items_devices.dm" #include "code\modules\virus2\items_devices.dm"
#include "code\modules\xenobio2\mob\_xeno_setup.dm" #include "code\modules\xenobio2\_xeno_setup.dm"
#include "code\modules\xenobio2\machinery\core_extractor.dm"
#include "code\modules\xenobio2\machinery\slime_replicator.dm"
#include "code\modules\xenobio2\mob\xeno procs.dm" #include "code\modules\xenobio2\mob\xeno procs.dm"
#include "code\modules\xenobio2\mob\xeno.dm" #include "code\modules\xenobio2\mob\xeno.dm"
#include "code\modules\xenobio2\mob\slime\slime life.dm" #include "code\modules\xenobio2\mob\slime\slime life.dm"
#include "code\modules\xenobio2\mob\slime\slime procs.dm" #include "code\modules\xenobio2\mob\slime\slime procs.dm"
#include "code\modules\xenobio2\mob\slime\slime.dm" #include "code\modules\xenobio2\mob\slime\slime.dm"
#include "code\modules\xenobio2\mob\slime\slime_core.dm"
#include "code\modules\xenobio2\tools\slime_handling_tools.dm" #include "code\modules\xenobio2\tools\slime_handling_tools.dm"
#include "code\modules\xgm\xgm_gas_data.dm" #include "code\modules\xgm\xgm_gas_data.dm"
#include "code\modules\xgm\xgm_gas_mixture.dm" #include "code\modules\xgm\xgm_gas_mixture.dm"