mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-15 12:42:50 +00:00
Semi-final stage of Xenobio2 Initial Implementation
Adds UIs to Core Extractor, Slime Replicator Adds Slimified Monkey Cubes as separate item type Adds Docility Toxin Replaces amutationtoxin references with docilitytoxin references Adds resistances to simple_mob damage handling, to allow for simple mobs to have resistances to different kinds of damage Moves a return to it's proper position to allow for hostile mobs to properly handle targets.
This commit is contained in:
@@ -52,8 +52,7 @@ var/global/list/xenoChemList = list("mutationtoxin",
|
||||
"psilocybin",
|
||||
"mindbreaker",
|
||||
"impedrezene",
|
||||
"cryptobiolin",
|
||||
"serotronium",
|
||||
"cryptobiolin",
|
||||
"space_drugs",
|
||||
"chloralhydrate",
|
||||
"stoxin",
|
||||
@@ -76,12 +75,14 @@ var/global/list/xenoChemList = list("mutationtoxin",
|
||||
"alkysine",
|
||||
"imidazoline",
|
||||
"peridaxon",
|
||||
"rezadone")
|
||||
"rezadone",
|
||||
"mutationtoxin",
|
||||
"docilitytoxin")
|
||||
|
||||
/datum/xeno/traits
|
||||
var/list/traits = list()
|
||||
var/list/chemlist = list()
|
||||
var/obj/chems
|
||||
var/list/chems = list()
|
||||
var/source = "unknown"
|
||||
|
||||
/datum/xeno/traits/proc/set_trait(var/trait, var/newval)
|
||||
@@ -115,8 +116,6 @@ var/global/list/xenoChemList = list("mutationtoxin",
|
||||
set_trait(TRAIT_XENO_CANSPEAK, 1)
|
||||
set_trait(TRAIT_XENO_STRENGTH, 0)
|
||||
set_trait(TRAIT_XENO_STR_RANGE, 0)
|
||||
chems = new()
|
||||
chems.create_reagents(traits[TRAIT_XENO_CHEMVOL])
|
||||
|
||||
/datum/xeno/traits/proc/get_gene(var/genetype)
|
||||
|
||||
@@ -167,10 +166,8 @@ var/global/list/xenoChemList = list("mutationtoxin",
|
||||
switch(genes.genetype)
|
||||
if(GENE_XENO_BIOCHEMISTRY)
|
||||
set_trait(TRAIT_XENO_CHEMVOL, genes.values["[TRAIT_XENO_CHEMVOL]"])
|
||||
chems.reagents.maximum_volume = genes.values["[TRAIT_XENO_CHEMVOL]"]
|
||||
for(var/reagent in genes.chems.reagents)
|
||||
var/amount = genes.chems.reagents[reagent]
|
||||
chems.reagents.add_reagent(reagent, amount)
|
||||
for(var/reagent in genes.chems)
|
||||
chems[reagent] = genes[reagent]
|
||||
|
||||
if(GENE_XENO_HEALTH)
|
||||
set_trait(TRAIT_XENO_HEALTH, genes.values["[TRAIT_XENO_HEALTH]"])
|
||||
@@ -206,10 +203,7 @@ var/global/list/xenoChemList = list("mutationtoxin",
|
||||
/datum/xeno/genes
|
||||
var/genetype //Label for specifying what gene is used.
|
||||
var/list/values //What's going to be put into specific traits
|
||||
var/obj/chems
|
||||
var/list/chems
|
||||
|
||||
/datum/xeno/genes/New()
|
||||
..()
|
||||
chems = new()
|
||||
chems.create_reagents(20)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
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.
|
||||
To create more of these slimes, stick the slime core in the extractor.
|
||||
*/
|
||||
/obj/machinery/slime/extractor
|
||||
name = "Slime extractor"
|
||||
@@ -60,7 +60,7 @@
|
||||
user << "<span class='danger'>The core extractor is full, empty it first!</span>"
|
||||
return
|
||||
|
||||
if(in_use)
|
||||
if(inuse)
|
||||
user << "<span class='danger'>The core extractor is locked and running, wait for it to finish.</span>"
|
||||
return
|
||||
|
||||
@@ -81,11 +81,11 @@
|
||||
|
||||
/obj/machinery/slime/extractor/proc/update_light_color()
|
||||
if(src.occupant && !(inuse))
|
||||
set_light(4, 4, occupiedcolor)
|
||||
set_light(1, 1, occupiedcolor)
|
||||
else if(src.occupant)
|
||||
set_light(4, 4, operatingcolor)
|
||||
set_light(1, 1, operatingcolor)
|
||||
else
|
||||
set_light(4, 4, emptycolor)
|
||||
set_light(1, 1, emptycolor)
|
||||
|
||||
/obj/machinery/slime/extractor/proc/extract_cores()
|
||||
if(!src.occupant)
|
||||
@@ -102,11 +102,12 @@
|
||||
C.traits = occupant.traitdat
|
||||
|
||||
C.create_reagents(C.traits.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)
|
||||
for(var/reagent in occupant.traitdat.chems)
|
||||
C.reagents.add_reagent(reagent, occupant.traitdat.chems[reagent])
|
||||
|
||||
C.color = C.traits.traits[TRAIT_XENO_COLOR]
|
||||
if(occupant.traitdat.get_trait(TRAIT_XENO_BIOLUMESCENT))
|
||||
C.set_light(occupant.traitdat.get_trait(TRAIT_XENO_GLOW_STRENGTH),occupant.traitdat.get_trait(TRAIT_XENO_GLOW_RANGE), occupant.traitdat.get_trait(TRAIT_XENO_BIO_COLOR))
|
||||
|
||||
spawn(30)
|
||||
icon_state = "scanner_0old"
|
||||
@@ -115,13 +116,55 @@
|
||||
eject_contents()
|
||||
update_light_color()
|
||||
|
||||
/obj/machinery/slime/extractor/proc/eject_contents()
|
||||
for(var/obj/thing in (contents - component_parts - circuit))
|
||||
thing.forceMove(loc)
|
||||
/obj/machinery/slime/extractor/proc/eject_slime()
|
||||
if(occupant)
|
||||
occupant.forceMove(loc)
|
||||
occupant = null
|
||||
|
||||
/obj/machinery/slime/extractor/proc/eject_core()
|
||||
for(var/obj/thing in (contents - component_parts - circuit))
|
||||
thing.forceMove(loc)
|
||||
|
||||
/obj/machinery/slime/extractor/proc/eject_contents()
|
||||
eject_core()
|
||||
eject_slime()
|
||||
|
||||
//Here lies the UI
|
||||
/obj/machinery/slime/extractor/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/slime/extractor/interact(mob/user as mob)
|
||||
var/dat = ""
|
||||
if(!inuse)
|
||||
dat = {"
|
||||
<b>Slime held:</b><br>
|
||||
[occupant]<br>
|
||||
"}
|
||||
if (occupant && !(stat & (NOPOWER|BROKEN)))
|
||||
dat += "<A href='?src=\ref[src];action=extract'>Start the core extraction.</a><BR>"
|
||||
if(occupant)
|
||||
dat += "<A href='?src=\ref[src];action=eject'>Eject the slime</a><BR>"
|
||||
else
|
||||
dat += "Please wait..."
|
||||
var/datum/browser/popup = new(user, "Slime Extractor", "Slime Extractor", src)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/slime/extractor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
switch(href_list["action"])
|
||||
if ("extract")
|
||||
extract_cores()
|
||||
if("eject")
|
||||
eject_slime()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
//Circuit board below,
|
||||
/obj/item/weapon/circuitboard/slimeextractor
|
||||
name = T_BOARD("Slime extractor")
|
||||
|
||||
@@ -56,9 +56,11 @@
|
||||
|
||||
data["activity"] = active
|
||||
data["beaker"] = injector.beaker
|
||||
if(injector.occupant)
|
||||
data["occupied"] = 1
|
||||
if(isxeno(injector.occupant))
|
||||
var/mob/living/simple_animal/xeno/X = injector.occupant
|
||||
data["instability"] = (X.mut_level / X.mut_max)
|
||||
data["instability"] = (X.mut_level / X.mut_max) * 100
|
||||
else
|
||||
data["instability"] = null
|
||||
|
||||
|
||||
@@ -39,21 +39,22 @@
|
||||
return ..()
|
||||
|
||||
if(core)
|
||||
user << "<span class='warning'>The [src] is already filled!</span>"
|
||||
user << "<span class='warning'>[src] is already filled!</span>"
|
||||
return
|
||||
if(panel_open)
|
||||
user << "<span class='warning'>Close the panel first!</span>"
|
||||
core = G
|
||||
user.drop_from_inventory(G)
|
||||
G.forceMove(src)
|
||||
update_light_color()
|
||||
|
||||
/obj/machinery/slime/replicator/proc/update_light_color()
|
||||
if(src.core && !(inuse))
|
||||
set_light(4, 4, occupiedcolor)
|
||||
set_light(1, 1, occupiedcolor)
|
||||
else if(src.core)
|
||||
set_light(4, 4, operatingcolor)
|
||||
set_light(1, 1, operatingcolor)
|
||||
else
|
||||
set_light(4, 4, emptycolor)
|
||||
set_light(1, 1, emptycolor)
|
||||
|
||||
/obj/machinery/slime/replicator/proc/replicate_slime()
|
||||
if(!src.core)
|
||||
@@ -67,22 +68,63 @@
|
||||
spawn(30)
|
||||
var/mob/living/simple_animal/xeno/slime/S = new(src)
|
||||
S.traitdat = core.traits
|
||||
S.ProcessTraits()
|
||||
qdel(core)
|
||||
spawn(30)
|
||||
inuse = 0
|
||||
eject_contents()
|
||||
eject_slime()
|
||||
icon_state = "restruct_0"
|
||||
update_light_color()
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/slime/replicator/proc/eject_contents()
|
||||
/obj/machinery/slime/replicator/proc/eject_slime()
|
||||
for(var/mob/thing in contents)
|
||||
thing.forceMove(loc)
|
||||
|
||||
/obj/machinery/slime/replicator/proc/eject_core()
|
||||
if(core)
|
||||
core.forceMove(loc)
|
||||
core = null
|
||||
|
||||
/obj/machinery/slime/replicator/proc/eject_contents()
|
||||
eject_slime()
|
||||
eject_core()
|
||||
|
||||
//Here lies the UI
|
||||
/obj/machinery/slime/replicator/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/slime/replicator/interact(mob/user as mob)
|
||||
var/dat = ""
|
||||
if(!inuse)
|
||||
dat = {"
|
||||
<b>Slime core container holds:</b><br>
|
||||
[core]<br>
|
||||
"}
|
||||
if (core && !(stat & (NOPOWER|BROKEN)))
|
||||
dat += "<A href='?src=\ref[src];action=replicate'>Start the replication process</a><BR>"
|
||||
if(core)
|
||||
dat += "<A href='?src=\ref[src];action=eject'>Eject the core</a><BR>"
|
||||
else
|
||||
dat += "Please wait..."
|
||||
var/datum/browser/popup = new(user, "Slime Replicator", "Slime Replicator", src)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/slime/replicator/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
switch(href_list["action"])
|
||||
if ("replicate")
|
||||
replicate_slime()
|
||||
if("eject")
|
||||
eject_core()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
//Circuit board below,
|
||||
/obj/item/weapon/circuitboard/slimereplicator
|
||||
|
||||
@@ -50,6 +50,6 @@ Slime specific life events go here.
|
||||
icon_state = "slime adult dead"
|
||||
color = traitdat.traits[TRAIT_XENO_COLOR]
|
||||
|
||||
return 1 //Everything worked okay
|
||||
return 0 //Everything worked okay
|
||||
|
||||
return 0 //xeno/Life() returned 0.
|
||||
return //xeno/Life() returned 0.
|
||||
@@ -18,14 +18,13 @@ Slime specific procs go here.
|
||||
traitdat.traits[TRAIT_XENO_HOSTILE] = 0
|
||||
else
|
||||
traitdat.traits[TRAIT_XENO_HOSTILE] = prob(30)
|
||||
traitdat.traits[TRAIT_XENO_GLOW_STRENGTH] = round(rand(1,6))
|
||||
traitdat.traits[TRAIT_XENO_GLOW_RANGE] = round(rand(1,6))
|
||||
traitdat.traits[TRAIT_XENO_GLOW_STRENGTH] = round(rand(1,3))
|
||||
traitdat.traits[TRAIT_XENO_GLOW_RANGE] = round(rand(1,3))
|
||||
traitdat.traits[TRAIT_XENO_STRENGTH] = round(rand(4,9))
|
||||
traitdat.traits[TRAIT_XENO_STR_RANGE] =round(rand(0,2))
|
||||
traitdat.traits[TRAIT_XENO_CANLEARN] = prob(68)
|
||||
traitdat.traits[TRAIT_XENO_SPEED] = round(rand(-10,10))
|
||||
|
||||
//RandomChemicals()
|
||||
|
||||
|
||||
/mob/living/simple_animal/xeno/slime/proc/GrowUp()
|
||||
@@ -101,7 +100,7 @@ Slime specific procs go here.
|
||||
return
|
||||
if(reagents.total_volume <= 0)
|
||||
return
|
||||
/*if(reagents.has_reagent("docilitytoxin")) //Toxin that makes them docile? Good for quelling angry mobs.
|
||||
if(reagents.has_reagent("docilitytoxin")) //Toxin that makes them docile? Good for quelling angry mobs.
|
||||
hostile = 0
|
||||
traitdat.traits[TRAIT_XENO_HOSTILE] = 0*/
|
||||
traitdat.traits[TRAIT_XENO_HOSTILE] = 0
|
||||
..()
|
||||
@@ -22,6 +22,9 @@ Slime definitions, Life and New live here.
|
||||
move_to_delay = 17 //Slimes shouldn't be able to go faster than humans.
|
||||
default_chems = list("slimejelly" = 5)
|
||||
attacktext = "absorbed some of"
|
||||
response_help = "pats"
|
||||
response_disarm = "tries to stop"
|
||||
response_harm = "hits"
|
||||
|
||||
var/emote_on = null
|
||||
|
||||
@@ -80,6 +83,9 @@ Slime definitions, Life and New live here.
|
||||
for(var/datum/language/L in (typesof(/datum/language) - /datum/language))
|
||||
languages += L
|
||||
speak += "[station_name()]?"
|
||||
resistances[BURN] = 4
|
||||
resistances[BRUTE] = 0.2
|
||||
resistances[TOX] = 1.5
|
||||
GenerateChild()
|
||||
return 1
|
||||
|
||||
@@ -8,10 +8,5 @@ Slime core lives here.
|
||||
icon_state = "slime extract"
|
||||
source = "Slime"
|
||||
product = "core"
|
||||
|
||||
/obj/item/xenoproduct/slime/core/New()
|
||||
..()
|
||||
color = traits.get_trait(TRAIT_XENO_COLOR)
|
||||
if(traits.get_trait(TRAIT_XENO_BIOLUMESCENT))
|
||||
set_light(traits.get_trait(TRAIT_XENO_GLOW_STRENGTH),traits.get_trait(TRAIT_XENO_GLOW_RANGE),traits.get_trait(TRAIT_XENO_BIO_COLOR))
|
||||
|
||||
|
||||
65
code/modules/xenobio2/mob/slime/slime_monkey.dm
Normal file
65
code/modules/xenobio2/mob/slime/slime_monkey.dm
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
Slime cube lives here.
|
||||
*/
|
||||
/obj/item/slime_cube
|
||||
name = "slimy monkey cube"
|
||||
desc = "Wonder what might come out of this."
|
||||
icon = 'icons/mob/slime2.dmi'
|
||||
icon_state = "slime cube"
|
||||
var/searching = 0
|
||||
|
||||
/obj/item/slime_cube/attack_self(mob/user as mob)
|
||||
if(!searching)
|
||||
user << "<span class='warning'>You stare at the slimy cube, watching as some activity occurs.</span>"
|
||||
icon_state = "slime cube active"
|
||||
searching = 1
|
||||
request_player()
|
||||
spawn(600) reset_search()
|
||||
|
||||
/obj/item/slime_cube/proc/request_player()
|
||||
for(var/mob/observer/dead/O in player_list)
|
||||
if(!O.MayRespawn())
|
||||
continue
|
||||
if(O.client)
|
||||
if(O.client.prefs.be_special & BE_ALIEN)
|
||||
question(O.client)
|
||||
|
||||
/obj/item/slime_cube/proc/question(var/client/C)
|
||||
spawn(0)
|
||||
if(!C) return
|
||||
var/response = alert(C, "Someone is requesting a soul for a promethean. Would you like to play as one?", "Promethean request", "Yes", "No", "Never for this round")
|
||||
if(response == "Yes")
|
||||
response = alert(C, "Are you sure you want to play as a promethean?", "Promethean request", "Yes", "No")
|
||||
if(!C || 2 == searching) return //handle logouts that happen whilst the alert is waiting for a response, and responses issued after a brain has been located.
|
||||
if(response == "Yes")
|
||||
transfer_personality(C.mob)
|
||||
else if (response == "Never for this round")
|
||||
C.prefs.be_special ^= BE_ALIEN
|
||||
|
||||
/obj/item/slime_cube/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer.
|
||||
icon_state = "slime cube"
|
||||
if(searching == 1)
|
||||
searching = 0
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("<span class='warning'>The activity in the cube dies down. Maybe it will spark another time.</span>")
|
||||
|
||||
/obj/item/slime_cube/proc/transfer_personality(var/mob/candidate)
|
||||
announce_ghost_joinleave(candidate, 0, "They are a promethean now.")
|
||||
src.searching = 2
|
||||
var/mob/living/carbon/human/S = new(get_turf(src))
|
||||
S. << "<b>You are a promethean, brought into existence on [station_name()].</b>"
|
||||
S.mind.assigned_role = "Promethean"
|
||||
S.set_species("Promethean")
|
||||
S.shapeshifter_set_colour("#05FF9B")
|
||||
var/newname = sanitize(input(S, "You are a Promethean. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN)
|
||||
if (newname)
|
||||
S.real_name = newname
|
||||
S.name = S.real_name
|
||||
S.dna.real_name = newname
|
||||
if(S.mind) S.mind.name = S.name
|
||||
|
||||
for(var/mob/M in viewers(get_turf_or_move(loc)))
|
||||
M.show_message("<span class='warning'>The monkey cube suddenly takes the shape of a man!</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -93,13 +93,7 @@ Procs for targeting
|
||||
for(var/i=0, i<6, i++)
|
||||
traitdat.traits[TRAIT_XENO_COLOR] += pick(hexNums)
|
||||
|
||||
traitdat.chems.reagents.clear_reagents()
|
||||
for(var/R in default_chems)
|
||||
traitdat.chems.reagents.add_reagent("[R]", default_chems[R])
|
||||
var/amount_of_chems = rand(1,6)
|
||||
for(var/i = 0,i <= amount_of_chems, i++)
|
||||
var/datum/reagent/R = pick(xenoChemList)
|
||||
traitdat.chems.reagents.add_reagent(R, round(rand(1,10)))
|
||||
RandomChemicals()
|
||||
//if(SPECIESMUT & mutable)
|
||||
//Placeholder, currently no xenos that have species mutations.
|
||||
RandomizeTraits()
|
||||
@@ -132,8 +126,9 @@ Procs for targeting
|
||||
if(prob(traitdat.get_trait(TRAIT_XENO_LEARNCHANCE)) && traitdat.get_trait(TRAIT_XENO_CANLEARN))
|
||||
var/chosen = pick(speech_buffer)
|
||||
speak.Add(chosen)
|
||||
/* Uncoment for logging of speech list.
|
||||
log_debug("Added [chosen] to speak list.")
|
||||
log_debug("Speechlist cut.")
|
||||
log_debug("Speechlist cut.") */
|
||||
speech_buffer.Cut()
|
||||
//
|
||||
/mob/living/simple_animal/xeno/proc/BuildReagentLists()
|
||||
@@ -156,7 +151,7 @@ Procs for targeting
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/xeno/proc/RandomChemicals()
|
||||
traitdat.chemlist.Cut() //Clear the amount first.
|
||||
traitdat.chems.Cut() //Clear the amount first.
|
||||
|
||||
var/num_chems = round(rand(1,4))
|
||||
var/list/chemchoices = xenoChemList
|
||||
@@ -165,6 +160,6 @@ Procs for targeting
|
||||
var/chemtype = pick(chemchoices)
|
||||
chemchoices -= chemtype
|
||||
var/chemamount = rand(1,5)
|
||||
traitdat.chemlist[chemtype] = chemamount
|
||||
traitdat.chems[chemtype] = chemamount
|
||||
|
||||
traitdat.chemlist += default_chems
|
||||
traitdat.chems += default_chems
|
||||
|
||||
@@ -58,6 +58,7 @@ Also includes Life and New
|
||||
handle_reagents()
|
||||
if((mut_level >= mut_max) && !(mutable & NOMUT))
|
||||
Mutate()
|
||||
mut_level -= mut_max
|
||||
|
||||
ProcessSpeechBuffer()
|
||||
|
||||
@@ -87,7 +88,7 @@ Also includes Life and New
|
||||
temp_chem_holder.create_reagents(20)
|
||||
nutrition = 350
|
||||
for(var/R in default_chems)
|
||||
traitdat.chems.reagents.add_reagent("[R]", default_chems[R])
|
||||
traitdat.chems[R] = default_chems[R]
|
||||
|
||||
traitdat.source = name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user