mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Just some general cleanup
Moved the spacecraft folder into the unused section, moved syndiebeacon into machinery. Research moved into Modules. Virus2 moved into WIP - is anyone even working on this, it looks almost done? Computer2,optics,pda2,experimental moved unto unused. WIP Chemistry things moved into Chemical Module Cameras.dm moved into weapons GameKit.dm moved into unused BrokenInHands.dm moved into unused Removed Grillify.dm Moved all of the files listed as unused in the mining module to unused Removed several empty folders in modules Moved cloning.dm into machinery Moved NewBan.dm into admin Changed humanoid aliens new_life.dm into life.dm Moved beast mob into unused Moved hivebot into unused Moved carpedexplosion.dm into unused Moved ai_lockdown.dm verb into unused and removed it from the AIs verb list as it didn't actually do anything. Removed mastercontroler2.dm Moved savefile.dm from human to new_player Bugfix People spawning on the starting screen on rev/cult should be fixed. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1964 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -0,0 +1,194 @@
|
||||
var/CMinutes = null
|
||||
var/savefile/Banlist
|
||||
|
||||
|
||||
/proc/CheckBan(var/client/clientvar)
|
||||
|
||||
var/id = clientvar.computer_id
|
||||
var/key = clientvar.ckey
|
||||
|
||||
Banlist.cd = "/base"
|
||||
if (Banlist.dir.Find("[key][id]"))
|
||||
Banlist.cd = "[key][id]"
|
||||
if (Banlist["temp"])
|
||||
if (!GetExp(Banlist["minutes"]))
|
||||
ClearTempbans()
|
||||
return 0
|
||||
else
|
||||
return "[Banlist["reason"]]\n(This ban will be automatically removed in [GetExp(Banlist["minutes"])].)"
|
||||
else
|
||||
Banlist.cd = "/base/[key][id]"
|
||||
return "[Banlist["reason"]]\n(This is a permanent ban)"
|
||||
|
||||
Banlist.cd = "/base"
|
||||
for (var/A in Banlist.dir)
|
||||
Banlist.cd = "/base/[A]"
|
||||
if (id == Banlist["id"] || key == Banlist["key"])
|
||||
if(Banlist["temp"])
|
||||
if (!GetExp(Banlist["minutes"]))
|
||||
ClearTempbans()
|
||||
return 0
|
||||
else
|
||||
return "[Banlist["reason"]]\n(This ban will be automatically removed in [GetExp(Banlist["minutes"])].)"
|
||||
else
|
||||
return "[Banlist["reason"]]\n(This is a permanent ban)"
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
/proc/UpdateTime() //No idea why i made this a proc.
|
||||
CMinutes = (world.realtime / 10) / 60
|
||||
return 1
|
||||
|
||||
/proc/LoadBans()
|
||||
|
||||
Banlist = new("data/banlist.bdb")
|
||||
log_admin("Loading Banlist")
|
||||
|
||||
if (!length(Banlist.dir)) log_admin("Banlist is empty.")
|
||||
|
||||
if (!Banlist.dir.Find("base"))
|
||||
log_admin("Banlist missing base dir.")
|
||||
Banlist.dir.Add("base")
|
||||
Banlist.cd = "/base"
|
||||
else if (Banlist.dir.Find("base"))
|
||||
Banlist.cd = "/base"
|
||||
|
||||
ClearTempbans()
|
||||
return 1
|
||||
|
||||
/proc/ClearTempbans()
|
||||
UpdateTime()
|
||||
|
||||
Banlist.cd = "/base"
|
||||
for (var/A in Banlist.dir)
|
||||
Banlist.cd = "/base/[A]"
|
||||
if (!Banlist["key"] || !Banlist["id"])
|
||||
RemoveBan(A)
|
||||
log_admin("Invalid Ban.")
|
||||
message_admins("Invalid Ban.")
|
||||
continue
|
||||
|
||||
if (!Banlist["temp"]) continue
|
||||
if (CMinutes >= Banlist["minutes"]) RemoveBan(A)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/proc/AddBan(ckey, computerid, reason, bannedby, temp, minutes)
|
||||
|
||||
var/bantimestamp
|
||||
|
||||
if (temp)
|
||||
UpdateTime()
|
||||
bantimestamp = CMinutes + minutes
|
||||
|
||||
Banlist.cd = "/base"
|
||||
if ( Banlist.dir.Find("[ckey][computerid]") )
|
||||
usr << text("\red Ban already exists.")
|
||||
return 0
|
||||
else
|
||||
Banlist.dir.Add("[ckey][computerid]")
|
||||
Banlist.cd = "/base/[ckey][computerid]"
|
||||
Banlist["key"] << ckey
|
||||
Banlist["id"] << computerid
|
||||
Banlist["reason"] << reason
|
||||
Banlist["bannedby"] << bannedby
|
||||
Banlist["temp"] << temp
|
||||
if (temp)
|
||||
Banlist["minutes"] << bantimestamp
|
||||
|
||||
return 1
|
||||
|
||||
/proc/RemoveBan(foldername)
|
||||
var/key
|
||||
var/id
|
||||
|
||||
Banlist.cd = "/base/[foldername]"
|
||||
Banlist["key"] >> key
|
||||
Banlist["id"] >> id
|
||||
Banlist.cd = "/base"
|
||||
|
||||
if (!Banlist.dir.Remove(foldername)) return 0
|
||||
|
||||
if(!usr)
|
||||
log_admin("Ban Expired: [key]")
|
||||
message_admins("Ban Expired: [key]")
|
||||
else
|
||||
log_admin("[key_name_admin(usr)] unbanned [key]")
|
||||
message_admins("[key_name_admin(usr)] unbanned: [key]")
|
||||
|
||||
for (var/A in Banlist.dir)
|
||||
Banlist.cd = "/base/[A]"
|
||||
if (key == Banlist["key"] || id == Banlist["id"])
|
||||
Banlist.cd = "/base"
|
||||
Banlist.dir.Remove(A)
|
||||
continue
|
||||
|
||||
return 1
|
||||
|
||||
/proc/GetExp(minutes as num)
|
||||
UpdateTime()
|
||||
var/exp = minutes - CMinutes
|
||||
if (exp <= 0)
|
||||
return 0
|
||||
else
|
||||
var/timeleftstring
|
||||
if (exp >= 1440) //1440 = 1 day in minutes
|
||||
timeleftstring = "[round(exp / 1440, 0.1)] Days"
|
||||
else if (exp >= 60) //60 = 1 hour in minutes
|
||||
timeleftstring = "[round(exp / 60, 0.1)] Hours"
|
||||
else
|
||||
timeleftstring = "[exp] Minutes"
|
||||
return timeleftstring
|
||||
|
||||
/obj/admins/proc/unbanpanel()
|
||||
var/count = 0
|
||||
var/dat
|
||||
//var/dat = "<HR><B>Unban Player:</B> \blue(U) = Unban , (E) = Edit Ban\green (Total<HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >"
|
||||
Banlist.cd = "/base"
|
||||
for (var/A in Banlist.dir)
|
||||
count++
|
||||
Banlist.cd = "/base/[A]"
|
||||
dat += text("<tr><td><A href='?src=\ref[src];unbanf=[Banlist["key"]][Banlist["id"]]'>(U)</A><A href='?src=\ref[src];unbane=[Banlist["key"]][Banlist["id"]]'>(E)</A> Key: <B>[Banlist["key"]]</B></td><td> ([Banlist["temp"] ? "[GetExp(Banlist["minutes"]) ? GetExp(Banlist["minutes"]) : "Removal pending" ]" : "Permaban"])</td><td>(By: [Banlist["bannedby"]])</td><td>(Reason: [Banlist["reason"]])</td></tr>")
|
||||
|
||||
dat += "</table>"
|
||||
dat = "<HR><B>Bans:</B> <FONT COLOR=blue>(U) = Unban , (E) = Edit Ban</FONT> - <FONT COLOR=green>([count] Bans)</FONT><HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >[dat]"
|
||||
usr << browse(dat, "window=unbanp;size=875x400")
|
||||
|
||||
//////////////////////////////////// DEBUG ////////////////////////////////////
|
||||
|
||||
/proc/CreateBans()
|
||||
|
||||
UpdateTime()
|
||||
|
||||
var/i
|
||||
var/last
|
||||
|
||||
for(i=0, i<1001, i++)
|
||||
var/a = pick(1,0)
|
||||
var/b = pick(1,0)
|
||||
if(b)
|
||||
Banlist.cd = "/base"
|
||||
Banlist.dir.Add("trash[i]trashid[i]")
|
||||
Banlist.cd = "/base/trash[i]trashid[i]"
|
||||
Banlist["key"] << "trash[i]"
|
||||
else
|
||||
Banlist.cd = "/base"
|
||||
Banlist.dir.Add("[last]trashid[i]")
|
||||
Banlist.cd = "/base/[last]trashid[i]"
|
||||
Banlist["key"] << last
|
||||
Banlist["id"] << "trashid[i]"
|
||||
Banlist["reason"] << "Trashban[i]."
|
||||
Banlist["temp"] << a
|
||||
Banlist["minutes"] << CMinutes + rand(1,2000)
|
||||
Banlist["bannedby"] << "trashmin"
|
||||
last = "trash[i]"
|
||||
|
||||
Banlist.cd = "/base"
|
||||
|
||||
/proc/ClearAllBans()
|
||||
Banlist.cd = "/base"
|
||||
for (var/A in Banlist.dir)
|
||||
RemoveBan(A)
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
// Made during the internet outage caused by hurricane ike
|
||||
// fuck you ike
|
||||
// love persh
|
||||
///client/proc/grillify()
|
||||
// set category = "Debug"
|
||||
// set name = "spawn grilles"
|
||||
// set desc="it spawns grilles okay fuck if I know"
|
||||
// if(Debug2)
|
||||
// // All admins should be authenticated, but... what if?
|
||||
// if(!src.authenticated || !src.holder)
|
||||
// src << "Only administrators may use this command."
|
||||
// return
|
||||
//
|
||||
// log_admin("[src.key] used the grillify verb")
|
||||
// world << "\blue<big><B>[src.key] used the grillify verb/bitches better get yellow gloves verb!</big></B>"
|
||||
//
|
||||
// for(var/turf/T in world)
|
||||
// if(!T.density)
|
||||
// spawn(-1)
|
||||
// new /obj/grille(locate(T.x,T.y,T.z))
|
||||
// else
|
||||
// alert("Debugging is disabled")
|
||||
// return
|
||||
@@ -0,0 +1,387 @@
|
||||
#define TOUCH 1
|
||||
#define INGEST 2
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
datum
|
||||
reagents
|
||||
var/list/datum/reagent/reagent_list = new/list()
|
||||
var/total_volume = 0
|
||||
var/maximum_volume = 100
|
||||
var/atom/my_atom = null
|
||||
|
||||
New(maximum=100)
|
||||
maximum_volume = maximum
|
||||
|
||||
proc
|
||||
|
||||
remove_any(var/amount=1)
|
||||
var/total_transfered = 0
|
||||
var/current_list_element = 1
|
||||
|
||||
current_list_element = rand(1,reagent_list.len)
|
||||
|
||||
while(total_transfered != amount)
|
||||
if(total_transfered >= amount) break
|
||||
if(total_volume <= 0 || !reagent_list.len) break
|
||||
|
||||
if(current_list_element > reagent_list.len) current_list_element = 1
|
||||
var/datum/reagent/current_reagent = reagent_list[current_list_element]
|
||||
|
||||
src.remove_reagent(current_reagent.id, 1)
|
||||
|
||||
current_list_element++
|
||||
total_transfered++
|
||||
src.update_total()
|
||||
|
||||
handle_reactions()
|
||||
return total_transfered
|
||||
|
||||
get_master_reagent_name()
|
||||
var/the_name = null
|
||||
var/the_volume = 0
|
||||
for(var/datum/reagent/A in reagent_list)
|
||||
if(A.volume > the_volume)
|
||||
the_volume = A.volume
|
||||
the_name = A.name
|
||||
|
||||
return the_name
|
||||
|
||||
get_master_reagent_id()
|
||||
var/the_id = null
|
||||
var/the_volume = 0
|
||||
for(var/datum/reagent/A in reagent_list)
|
||||
if(A.volume > the_volume)
|
||||
the_volume = A.volume
|
||||
the_id = A.id
|
||||
|
||||
return the_id
|
||||
|
||||
trans_to(var/obj/target, var/amount=1, var/multiplier=1, var/preserve_data=1)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
if (!target )
|
||||
return
|
||||
if (!target.reagents || src.total_volume<=0)
|
||||
return
|
||||
var/datum/reagents/R = target.reagents
|
||||
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
|
||||
var/part = amount / src.total_volume
|
||||
var/trans_data = null
|
||||
for (var/datum/reagent/current_reagent in src.reagent_list)
|
||||
var/current_reagent_transfer = current_reagent.volume * part
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
|
||||
src.remove_reagent(current_reagent.id, current_reagent_transfer)
|
||||
|
||||
src.update_total()
|
||||
R.update_total()
|
||||
R.handle_reactions()
|
||||
src.handle_reactions()
|
||||
return amount
|
||||
|
||||
trans_id_to(var/obj/target, var/reagent, var/amount=1, var/preserve_data=1)//Not sure why this proc didn't exist before. It does now! /N
|
||||
if (!target)
|
||||
return
|
||||
if (!target.reagents || src.total_volume<=0 || !src.get_reagent_amount(reagent))
|
||||
return
|
||||
|
||||
var/datum/reagents/R = target.reagents
|
||||
if(src.get_reagent_amount(reagent)<amount)
|
||||
amount = src.get_reagent_amount(reagent)
|
||||
amount = min(amount, R.maximum_volume-R.total_volume)
|
||||
var/trans_data = null
|
||||
for (var/datum/reagent/current_reagent in src.reagent_list)
|
||||
if(current_reagent.id == reagent)
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
R.add_reagent(current_reagent.id, amount, trans_data)
|
||||
src.remove_reagent(current_reagent.id, amount, 1)
|
||||
break
|
||||
|
||||
src.update_total()
|
||||
R.update_total()
|
||||
R.handle_reactions()
|
||||
//src.handle_reactions() Don't need to handle reactions on the source since you're (presumably isolating and) transferring a specific reagent.
|
||||
return amount
|
||||
|
||||
/*
|
||||
if (!target) return
|
||||
var/total_transfered = 0
|
||||
var/current_list_element = 1
|
||||
var/datum/reagents/R = target.reagents
|
||||
var/trans_data = null
|
||||
//if(R.total_volume + amount > R.maximum_volume) return 0
|
||||
|
||||
current_list_element = rand(1,reagent_list.len) //Eh, bandaid fix.
|
||||
|
||||
while(total_transfered != amount)
|
||||
if(total_transfered >= amount) break //Better safe than sorry.
|
||||
if(total_volume <= 0 || !reagent_list.len) break
|
||||
if(R.total_volume >= R.maximum_volume) break
|
||||
|
||||
if(current_list_element > reagent_list.len) current_list_element = 1
|
||||
var/datum/reagent/current_reagent = reagent_list[current_list_element]
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
R.add_reagent(current_reagent.id, (1 * multiplier), trans_data)
|
||||
src.remove_reagent(current_reagent.id, 1)
|
||||
|
||||
current_list_element++
|
||||
total_transfered++
|
||||
src.update_total()
|
||||
R.update_total()
|
||||
R.handle_reactions()
|
||||
handle_reactions()
|
||||
|
||||
return total_transfered
|
||||
*/
|
||||
|
||||
metabolize(var/mob/M)
|
||||
for(var/A in reagent_list)
|
||||
var/datum/reagent/R = A
|
||||
if(M && R)
|
||||
R.on_mob_life(M)
|
||||
update_total()
|
||||
|
||||
conditional_update_move(var/atom/A, var/Running = 0)
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
R.on_move (A, Running)
|
||||
update_total()
|
||||
|
||||
conditional_update(var/atom/A, )
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
R.on_update (A)
|
||||
update_total()
|
||||
|
||||
handle_reactions()
|
||||
if(my_atom.flags & NOREACT) return //Yup, no reactions here. No siree.
|
||||
|
||||
var/reaction_occured = 0
|
||||
do
|
||||
reaction_occured = 0
|
||||
for(var/A in typesof(/datum/chemical_reaction) - /datum/chemical_reaction)
|
||||
var/datum/chemical_reaction/C = new A()
|
||||
var/total_required_reagents = C.required_reagents.len
|
||||
var/total_matching_reagents = 0
|
||||
var/total_required_catalysts = C.required_catalysts.len
|
||||
var/total_matching_catalysts= 0
|
||||
var/matching_container = 0
|
||||
var/matching_other = 0
|
||||
var/list/multipliers = new/list()
|
||||
|
||||
for(var/B in C.required_reagents)
|
||||
if(has_reagent(B, C.required_reagents[B]))
|
||||
total_matching_reagents++
|
||||
multipliers += round(get_reagent_amount(B) / C.required_reagents[B])
|
||||
for(var/B in C.required_catalysts)
|
||||
if(has_reagent(B, C.required_catalysts[B]))
|
||||
total_matching_catalysts++
|
||||
|
||||
if(!C.required_container)
|
||||
matching_container = 1
|
||||
|
||||
else
|
||||
if(my_atom.type == C.required_container)
|
||||
matching_container = 1
|
||||
|
||||
if(!C.required_other)
|
||||
matching_other = 1
|
||||
|
||||
else
|
||||
if(istype(my_atom, /obj/item/metroid_core))
|
||||
var/obj/item/metroid_core/M = my_atom
|
||||
|
||||
if(M.POWERFLAG == C.required_other)
|
||||
matching_other = 1
|
||||
|
||||
|
||||
|
||||
|
||||
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other)
|
||||
var/multiplier = min(multipliers)
|
||||
for(var/B in C.required_reagents)
|
||||
remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1)
|
||||
|
||||
var/created_volume = C.result_amount*multiplier
|
||||
if(C.result)
|
||||
multiplier = max(multiplier, 1) //this shouldnt happen ...
|
||||
add_reagent(C.result, C.result_amount*multiplier)
|
||||
|
||||
for(var/mob/M in viewers(4, get_turf(my_atom)) )
|
||||
M << "\blue \icon[my_atom] The solution begins to bubble."
|
||||
playsound(get_turf(my_atom), 'bubbles.ogg', 80, 1)
|
||||
|
||||
C.on_reaction(src, created_volume)
|
||||
reaction_occured = 1
|
||||
break
|
||||
|
||||
while(reaction_occured)
|
||||
update_total()
|
||||
return 0
|
||||
|
||||
isolate_reagent(var/reagent)
|
||||
for(var/A in reagent_list)
|
||||
var/datum/reagent/R = A
|
||||
if (R.id != reagent)
|
||||
del_reagent(R.id)
|
||||
update_total()
|
||||
|
||||
del_reagent(var/reagent)
|
||||
for(var/A in reagent_list)
|
||||
var/datum/reagent/R = A
|
||||
if (R.id == reagent)
|
||||
reagent_list -= A
|
||||
del(A)
|
||||
update_total()
|
||||
my_atom.on_reagent_change()
|
||||
return 0
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
update_total()
|
||||
total_volume = 0
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
if(R.volume < 0.1)
|
||||
del_reagent(R.id)
|
||||
else
|
||||
total_volume += R.volume
|
||||
|
||||
return 0
|
||||
|
||||
clear_reagents()
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
del_reagent(R.id)
|
||||
return 0
|
||||
|
||||
reaction(var/atom/A, var/method=TOUCH, var/volume_modifier=0)
|
||||
|
||||
switch(method)
|
||||
if(TOUCH)
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
if(ismob(A))
|
||||
spawn(0)
|
||||
if(!R) return
|
||||
else R.reaction_mob(A, TOUCH, R.volume+volume_modifier)
|
||||
if(isturf(A))
|
||||
spawn(0)
|
||||
if(!R) return
|
||||
else R.reaction_turf(A, R.volume+volume_modifier)
|
||||
if(isobj(A))
|
||||
spawn(0)
|
||||
if(!R) return
|
||||
else R.reaction_obj(A, R.volume+volume_modifier)
|
||||
if(INGEST)
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
if(ismob(A) && R)
|
||||
spawn(0)
|
||||
if(!R) return
|
||||
else R.reaction_mob(A, INGEST, R.volume+volume_modifier)
|
||||
if(isturf(A) && R)
|
||||
spawn(0)
|
||||
if(!R) return
|
||||
else R.reaction_turf(A, R.volume+volume_modifier)
|
||||
if(isobj(A) && R)
|
||||
spawn(0)
|
||||
if(!R) return
|
||||
else R.reaction_obj(A, R.volume+volume_modifier)
|
||||
return
|
||||
|
||||
add_reagent(var/reagent, var/amount, var/data=null)
|
||||
if(!isnum(amount)) return 1
|
||||
update_total()
|
||||
if(total_volume + amount > maximum_volume) amount = (maximum_volume - total_volume) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen.
|
||||
|
||||
for(var/A in reagent_list)
|
||||
var/datum/reagent/R = A
|
||||
if (R.id == reagent)
|
||||
R.volume += amount
|
||||
update_total()
|
||||
my_atom.on_reagent_change()
|
||||
|
||||
// mix dem viruses
|
||||
if(R.id == "blood" && reagent == "blood")
|
||||
if(R.data && data)
|
||||
if(R.data && R.data["viruses"] || data && data["viruses"])
|
||||
var/list/this = R.data["viruses"]
|
||||
var/list/that = data["viruses"]
|
||||
this += that // combine the two
|
||||
|
||||
for(var/datum/disease/D in this) // makes sure no two viruses are in the reagent at the same time
|
||||
for(var/datum/disease/d in this)
|
||||
if(d != D)
|
||||
D.cure(0)
|
||||
|
||||
return 0
|
||||
|
||||
for(var/A in typesof(/datum/reagent) - /datum/reagent)
|
||||
var/datum/reagent/R = new A()
|
||||
if (R.id == reagent)
|
||||
reagent_list += R
|
||||
R.holder = src
|
||||
R.volume = amount
|
||||
R.data = data
|
||||
//debug
|
||||
//world << "Adding data"
|
||||
//for(var/D in R.data)
|
||||
// world << "Container data: [D] = [R.data[D]]"
|
||||
//debug
|
||||
update_total()
|
||||
my_atom.on_reagent_change()
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
remove_reagent(var/reagent, var/amount, var/safety)//Added a safety check for the trans_id_to
|
||||
|
||||
if(!isnum(amount)) return 1
|
||||
|
||||
for(var/A in reagent_list)
|
||||
var/datum/reagent/R = A
|
||||
if (R.id == reagent)
|
||||
R.volume -= amount
|
||||
update_total()
|
||||
if(!safety)//So it does not handle reactions when it need not to
|
||||
handle_reactions()
|
||||
my_atom.on_reagent_change()
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
has_reagent(var/reagent, var/amount = -1)
|
||||
|
||||
for(var/A in reagent_list)
|
||||
var/datum/reagent/R = A
|
||||
if (R.id == reagent)
|
||||
if(!amount) return R
|
||||
else
|
||||
if(R.volume >= amount) return R
|
||||
else return 0
|
||||
|
||||
return 0
|
||||
|
||||
get_reagent_amount(var/reagent)
|
||||
for(var/A in reagent_list)
|
||||
var/datum/reagent/R = A
|
||||
if (R.id == reagent)
|
||||
return R.volume
|
||||
|
||||
return 0
|
||||
|
||||
get_reagents()
|
||||
var/res = ""
|
||||
for(var/datum/reagent/A in reagent_list)
|
||||
if (res != "") res += ","
|
||||
res += A.name
|
||||
|
||||
return res
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Convenience proc to create a reagents holder for an atom
|
||||
// Max vol is maximum volume of holder
|
||||
atom/proc/create_reagents(var/max_vol)
|
||||
reagents = new/datum/reagents(max_vol)
|
||||
reagents.my_atom = src
|
||||
@@ -0,0 +1,696 @@
|
||||
#define SOLID 1
|
||||
#define LIQUID 2
|
||||
#define GAS 3
|
||||
|
||||
/obj/machinery/chem_dispenser/
|
||||
name = "chem dispenser"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'chemical.dmi'
|
||||
icon_state = "dispenser"
|
||||
var/energy = 25
|
||||
var/max_energy = 25
|
||||
var/list/dispensable_reagents = list("hydrogen","lithium","carbon","nitrogen","oxygen","fluorine","sodium","aluminum","silicon","phosphorus","sulfur","chlorine","potassium","iron","copper","mercury","radium","water","ethanol","sugar","acid",)
|
||||
proc
|
||||
recharge()
|
||||
if(stat & BROKEN) return
|
||||
if(energy != max_energy)
|
||||
energy++
|
||||
use_power(50)
|
||||
spawn(600) recharge()
|
||||
|
||||
New()
|
||||
recharge()
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(50))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["dispense"])
|
||||
if(!energy)
|
||||
var/dat = "Not enough energy.<BR><A href='?src=\ref[src];ok=1'>OK</A>"
|
||||
usr << browse("<TITLE>Chemical Dispenser</TITLE>Chemical dispenser:<BR>Energy = [energy]/[max_energy]<BR><BR>[dat]", "window=chem_dispenser")
|
||||
return
|
||||
var/id = href_list["dispense"]
|
||||
var/obj/item/weapon/reagent_containers/glass/dispenser/G = new/obj/item/weapon/reagent_containers/glass/dispenser(src.loc)
|
||||
switch(text2num(href_list["state"]))
|
||||
if(LIQUID)
|
||||
G.icon_state = "liquid"
|
||||
if(GAS)
|
||||
G.icon_state = "vapour"
|
||||
if(SOLID)
|
||||
G.icon_state = "solid"
|
||||
G.pixel_x = rand(-7, 7)
|
||||
G.pixel_y = rand(-7, 7)
|
||||
G.name += " ([lowertext(href_list["name"])])"
|
||||
G.reagents.add_reagent(id,30)
|
||||
energy--
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else
|
||||
usr << browse(null, "window=chem_dispenser")
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
for(var/re in dispensable_reagents)
|
||||
for(var/da in typesof(/datum/reagent) - /datum/reagent)
|
||||
var/datum/reagent/temp = new da()
|
||||
if(temp.id == re)
|
||||
dat += "<A href='?src=\ref[src];dispense=[temp.id];state=[temp.reagent_state];name=[temp.name]'>[temp.name]</A><BR>"
|
||||
dat += "[temp.description]<BR><BR>"
|
||||
user << browse("<TITLE>Chemical Dispenser</TITLE>Chemical dispenser:<BR>Energy = [energy]/[max_energy]<BR><BR>[dat]", "window=chem_dispenser")
|
||||
|
||||
onclose(user, "chem_dispenser")
|
||||
return
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/chem_master/
|
||||
name = "ChemMaster 3000"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'chemical.dmi'
|
||||
icon_state = "mixer0"
|
||||
var/beaker = null
|
||||
var/mode = 0
|
||||
var/condi = 0
|
||||
|
||||
New()
|
||||
var/datum/reagents/R = new/datum/reagents(100)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(50))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/reagent_containers/glass/B as obj, var/mob/user as mob)
|
||||
if(!istype(B, /obj/item/weapon/reagent_containers/glass))
|
||||
return
|
||||
|
||||
if(src.beaker)
|
||||
user << "A beaker is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
user << "You add the beaker to the machine!"
|
||||
src.updateUsrDialog()
|
||||
icon_state = "mixer1"
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!beaker) return
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
|
||||
if (href_list["analyze"])
|
||||
var/dat = ""
|
||||
if(!condi)
|
||||
dat += "<TITLE>Chemmaster 3000</TITLE>Chemical infos:<BR><BR>Name:<BR>[href_list["name"]]<BR><BR>Description:<BR>[href_list["desc"]]<BR><BR><BR><A href='?src=\ref[src];main=1'>(Back)</A>"
|
||||
else
|
||||
dat += "<TITLE>Condimaster 3000</TITLE>Condiment infos:<BR><BR>Name:<BR>[href_list["name"]]<BR><BR>Description:<BR>[href_list["desc"]]<BR><BR><BR><A href='?src=\ref[src];main=1'>(Back)</A>"
|
||||
usr << browse(dat, "window=chem_master;size=575x400")
|
||||
return
|
||||
else if (href_list["add1"])
|
||||
R.remove_reagent(href_list["add1"], 1) //Remove/add used instead of trans_to since we're moving a specific reagent.
|
||||
reagents.add_reagent(href_list["add1"], 1)
|
||||
else if (href_list["add5"])
|
||||
R.remove_reagent(href_list["add5"], 5)
|
||||
reagents.add_reagent(href_list["add5"], 5)
|
||||
else if (href_list["add10"])
|
||||
R.remove_reagent(href_list["add10"], 10)
|
||||
reagents.add_reagent(href_list["add10"], 10)
|
||||
else if (href_list["addall"])
|
||||
var/temp_amt = R.get_reagent_amount(href_list["addall"])
|
||||
reagents.add_reagent(href_list["addall"], temp_amt)
|
||||
R.del_reagent(href_list["addall"])
|
||||
else if (href_list["remove1"])
|
||||
reagents.remove_reagent(href_list["remove1"], 1)
|
||||
if(mode) R.add_reagent(href_list["remove1"], 1)
|
||||
else if (href_list["remove5"])
|
||||
reagents.remove_reagent(href_list["remove5"], 5)
|
||||
if(mode) R.add_reagent(href_list["remove5"], 5)
|
||||
else if (href_list["remove10"])
|
||||
reagents.remove_reagent(href_list["remove10"], 10)
|
||||
if(mode) R.add_reagent(href_list["remove10"], 10)
|
||||
else if (href_list["removeall"])
|
||||
if(mode)
|
||||
var/temp_amt = reagents.get_reagent_amount(href_list["removeall"])
|
||||
R.add_reagent(href_list["removeall"], temp_amt)
|
||||
reagents.del_reagent(href_list["removeall"])
|
||||
else if (href_list["toggle"])
|
||||
if(mode)
|
||||
mode = 0
|
||||
else
|
||||
mode = 1
|
||||
else if (href_list["main"])
|
||||
attack_hand(usr)
|
||||
return
|
||||
else if (href_list["eject"])
|
||||
beaker:loc = src.loc
|
||||
beaker = null
|
||||
reagents.clear_reagents()
|
||||
icon_state = "mixer0"
|
||||
else if (href_list["createpill"])
|
||||
var/name = input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name())
|
||||
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
|
||||
if(!name || name == " ") name = reagents.get_master_reagent_name()
|
||||
P.name = "[name] pill"
|
||||
P.pixel_x = rand(-7, 7) //random position
|
||||
P.pixel_y = rand(-7, 7)
|
||||
reagents.trans_to(P,50)
|
||||
else if (href_list["createbottle"])
|
||||
if(!condi)
|
||||
var/name = input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name())
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
|
||||
if(!name || name == " ") name = reagents.get_master_reagent_name()
|
||||
P.name = "[name] bottle"
|
||||
P.pixel_x = rand(-7, 7) //random position
|
||||
P.pixel_y = rand(-7, 7)
|
||||
reagents.trans_to(P,30)
|
||||
else
|
||||
var/obj/item/weapon/reagent_containers/food/condiment/P = new/obj/item/weapon/reagent_containers/food/condiment(src.loc)
|
||||
reagents.trans_to(P,50)
|
||||
else
|
||||
usr << browse(null, "window=chem_master")
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!beaker)
|
||||
dat = "Please insert beaker.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
else
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
dat += "<A href='?src=\ref[src];eject=1'>Eject beaker and Clear Buffer</A><BR><BR>"
|
||||
if(!R.total_volume)
|
||||
dat += "Beaker is empty."
|
||||
else
|
||||
dat += "Add to buffer:<BR>"
|
||||
for(var/datum/reagent/G in R.reagent_list)
|
||||
dat += "[G.name] , [G.volume] Units - "
|
||||
dat += "<A href='?src=\ref[src];analyze=1;desc=[G.description];name=[G.name]'>(Analyze)</A> "
|
||||
dat += "<A href='?src=\ref[src];add1=[G.id]'>(1)</A> "
|
||||
if(G.volume >= 5) dat += "<A href='?src=\ref[src];add5=[G.id]'>(5)</A> "
|
||||
if(G.volume >= 10) dat += "<A href='?src=\ref[src];add10=[G.id]'>(10)</A> "
|
||||
dat += "<A href='?src=\ref[src];addall=[G.id]'>(All)</A><BR>"
|
||||
if(!mode)
|
||||
dat += "<HR>Transfer to <A href='?src=\ref[src];toggle=1'>disposal:</A><BR>"
|
||||
else
|
||||
dat += "<HR>Transfer to <A href='?src=\ref[src];toggle=1'>beaker:</A><BR>"
|
||||
if(reagents.total_volume)
|
||||
for(var/datum/reagent/N in reagents.reagent_list)
|
||||
dat += "[N.name] , [N.volume] Units - "
|
||||
dat += "<A href='?src=\ref[src];analyze=1;desc=[N.description];name=[N.name]'>(Analyze)</A> "
|
||||
dat += "<A href='?src=\ref[src];remove1=[N.id]'>(1)</A> "
|
||||
if(N.volume >= 5) dat += "<A href='?src=\ref[src];remove5=[N.id]'>(5)</A> "
|
||||
if(N.volume >= 10) dat += "<A href='?src=\ref[src];remove10=[N.id]'>(10)</A> "
|
||||
dat += "<A href='?src=\ref[src];removeall=[N.id]'>(All)</A><BR>"
|
||||
else
|
||||
dat += "Empty<BR>"
|
||||
if(!condi)
|
||||
dat += "<HR><BR><A href='?src=\ref[src];createpill=1'>Create pill (50 units max)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];createbottle=1'>Create bottle (30 units max)</A>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];createbottle=1'>Create bottle (50 units max)</A>"
|
||||
if(!condi)
|
||||
user << browse("<TITLE>Chemmaster 3000</TITLE>Chemmaster menu:<BR><BR>[dat]", "window=chem_master;size=575x400")
|
||||
else
|
||||
user << browse("<TITLE>Condimaster 3000</TITLE>Condimaster menu:<BR><BR>[dat]", "window=chem_master;size=575x400")
|
||||
onclose(user, "chem_master")
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/chem_master/condimaster
|
||||
name = "CondiMaster 3000"
|
||||
condi = 1
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/computer/pandemic
|
||||
name = "PanD.E.M.I.C 2200"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'chemical.dmi'
|
||||
icon_state = "mixer0"
|
||||
var/temphtml = ""
|
||||
var/wait = null
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
|
||||
|
||||
set_broken()
|
||||
icon_state = (src.beaker?"mixer1_b":"mixer0_b")
|
||||
stat |= BROKEN
|
||||
|
||||
|
||||
power_change()
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = (src.beaker?"mixer1_b":"mixer0_b")
|
||||
|
||||
else if(powered())
|
||||
icon_state = (src.beaker?"mixer1":"mixer0")
|
||||
stat &= ~NOPOWER
|
||||
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = (src.beaker?"mixer1_nopower":"mixer0_nopower")
|
||||
stat |= NOPOWER
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!beaker) return
|
||||
|
||||
if (href_list["create_vaccine"])
|
||||
if(!src.wait)
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
|
||||
var/vaccine_type = text2path(href_list["create_vaccine"])//the path is received as string - converting
|
||||
var/datum/disease/D = new vaccine_type
|
||||
var/name = input(usr,"Name:","Name the vaccine",D.name)
|
||||
if(!name || name == " ") name = D.name
|
||||
B.name = "[name] vaccine bottle"
|
||||
B.reagents.add_reagent("vaccine",15,vaccine_type)
|
||||
del(D)
|
||||
wait = 1
|
||||
spawn(1200)
|
||||
src.wait = null
|
||||
else
|
||||
src.temphtml = "The replicator is not ready yet."
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else if (href_list["create_virus_culture"])
|
||||
if(!wait)
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
|
||||
B.icon_state = "bottle3"
|
||||
var/type = text2path(href_list["create_virus_culture"])//the path is received as string - converting
|
||||
var/datum/disease/D = new type
|
||||
var/list/data = list("viruses"=list(D))
|
||||
var/name = sanitize(input(usr,"Name:","Name the culture",D.name))
|
||||
if(!name || name == " ") name = D.name
|
||||
B.name = "[name] culture bottle"
|
||||
B.desc = "A small bottle. Contains [D.agent] culture in synthblood medium."
|
||||
B.reagents.add_reagent("blood",20,data)
|
||||
src.updateUsrDialog()
|
||||
wait = 1
|
||||
spawn(3000)
|
||||
src.wait = null
|
||||
else
|
||||
src.temphtml = "The replicator is not ready yet."
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else if (href_list["empty_beaker"])
|
||||
beaker.reagents.clear_reagents()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else if (href_list["eject"])
|
||||
beaker:loc = src.loc
|
||||
beaker = null
|
||||
icon_state = "mixer0"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else if(href_list["clear"])
|
||||
src.temphtml = ""
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else
|
||||
usr << browse(null, "window=pandemic")
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(src.temphtml)
|
||||
dat = "[src.temphtml]<BR><BR><A href='?src=\ref[src];clear=1'>Main Menu</A>"
|
||||
else if(!beaker)
|
||||
dat += "Please insert beaker.<BR>"
|
||||
dat += "<A href='?src=\ref[user];mach_close=pandemic'>Close</A>"
|
||||
else
|
||||
var/datum/reagents/R = beaker.reagents
|
||||
var/datum/reagent/blood/Blood = null
|
||||
for(var/datum/reagent/blood/B in R.reagent_list)
|
||||
if(B)
|
||||
Blood = B
|
||||
break
|
||||
if(!R.total_volume||!R.reagent_list.len)
|
||||
dat += "The beaker is empty<BR>"
|
||||
else if(!Blood)
|
||||
dat += "No blood sample found in beaker"
|
||||
else
|
||||
dat += "<h3>Blood sample data:</h3>"
|
||||
dat += "<b>Blood DNA:</b> [(Blood.data["blood_DNA"]||"none")]<BR>"
|
||||
dat += "<b>Blood Type:</b> [(Blood.data["blood_type"]||"none")]<BR>"
|
||||
|
||||
|
||||
if(Blood.data["viruses"])
|
||||
var/list/vir = Blood.data["viruses"]
|
||||
if(vir.len)
|
||||
for(var/datum/disease/D in Blood.data["viruses"])
|
||||
if(!D.hidden[PANDEMIC])
|
||||
|
||||
dat += "<b>Disease Agent:</b> [D?"[D.agent] - <A href='?src=\ref[src];create_virus_culture=[D.type]'>Create virus culture bottle</A>":"none"]<BR>"
|
||||
dat += "<b>Common name:</b> [(D.name||"none")]<BR>"
|
||||
dat += "<b>Description: </b> [(D.desc||"none")]<BR>"
|
||||
dat += "<b>Possible cure:</b> [(D.cure||"none")]<BR><BR>"
|
||||
|
||||
dat += "<b>Contains antibodies to:</b> "
|
||||
if(Blood.data["resistances"])
|
||||
var/list/res = Blood.data["resistances"]
|
||||
if(res.len)
|
||||
dat += "<ul>"
|
||||
for(var/type in Blood.data["resistances"])
|
||||
var/datum/disease/DR = new type
|
||||
dat += "<li>[DR.name] - <A href='?src=\ref[src];create_vaccine=[type]'>Create vaccine bottle</A></li>"
|
||||
del(DR)
|
||||
dat += "</ul><BR>"
|
||||
else
|
||||
dat += "nothing<BR>"
|
||||
else
|
||||
dat += "nothing<BR>"
|
||||
dat += "<BR><A href='?src=\ref[src];eject=1'>Eject beaker</A>[((R.total_volume&&R.reagent_list.len) ? "-- <A href='?src=\ref[src];empty_beaker=1'>Empty beaker</A>":"")]<BR>"
|
||||
dat += "<A href='?src=\ref[user];mach_close=pandemic'>Close</A>"
|
||||
|
||||
user << browse("<TITLE>[src.name]</TITLE><BR>[dat]", "window=pandemic;size=575x400")
|
||||
onclose(user, "pandemic")
|
||||
return
|
||||
|
||||
attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe(src.loc)
|
||||
new /obj/item/weapon/shard(src.loc)
|
||||
var/obj/item/weapon/circuitboard/pandemic/M = new /obj/item/weapon/circuitboard/pandemic(A)
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/pandemic/M = new /obj/item/weapon/circuitboard/pandemic(A)
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else if(istype(I, /obj/item/weapon/reagent_containers/glass))
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
if(src.beaker)
|
||||
user << "A beaker is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = I
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
user << "You add the beaker to the machine!"
|
||||
src.updateUsrDialog()
|
||||
icon_state = "mixer1"
|
||||
|
||||
else
|
||||
..()
|
||||
return
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/obj/machinery/reagentgrinder
|
||||
name = "Reagent Grinder"
|
||||
icon = 'kitchen.dmi'
|
||||
icon_state = "juicer1"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
var/obj/item/weapon/reagent_containers/beaker = null
|
||||
var/global/list/allowed_items = list (
|
||||
/obj/item/stack/sheet/plasma = "plasma",
|
||||
/obj/item/stack/sheet/uranium = "uranium",
|
||||
/obj/item/stack/sheet/clown = "banana",
|
||||
/obj/item/stack/sheet/silver = "silver",
|
||||
/obj/item/stack/sheet/gold = "gold",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana = "banana",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot = "imidazoline",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/corn = "cornoil",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap = "psilocybin",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/chili = "capsaicin",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper = "frostoil",
|
||||
/obj/item/weapon/grown/nettle = "acid",
|
||||
/obj/item/weapon/grown/deathnettle = "pacid",
|
||||
)
|
||||
|
||||
/obj/machinery/reagentgrinder/New()
|
||||
..()
|
||||
beaker = new /obj/item/weapon/reagent_containers/glass/large(src)
|
||||
return
|
||||
|
||||
/obj/machinery/reagentgrinder/update_icon()
|
||||
icon_state = "juicer"+num2text(!isnull(beaker))
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/reagentgrinder/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/glass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass))
|
||||
if (beaker)
|
||||
return 1
|
||||
else
|
||||
user.before_take_item(O)
|
||||
O.loc = src
|
||||
beaker = O
|
||||
src.verbs += /obj/machinery/reagentgrinder/verb/detach
|
||||
update_icon()
|
||||
src.updateUsrDialog()
|
||||
return 0
|
||||
if (!is_type_in_list(O, allowed_items))
|
||||
user << "Cannot refine into a reagent."
|
||||
return 1
|
||||
user.before_take_item(O)
|
||||
O.loc = src
|
||||
src.updateUsrDialog()
|
||||
return 0
|
||||
|
||||
/obj/machinery/reagentgrinder/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/reagentgrinder/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/reagentgrinder/attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/interact(mob/user as mob) // The microwave Menu
|
||||
var/is_chamber_empty = 0
|
||||
var/is_beaker_ready = 0
|
||||
var/processing_chamber = ""
|
||||
var/beaker_contents = ""
|
||||
|
||||
for (var/i in allowed_items)
|
||||
for (var/obj/item/O in src.contents)
|
||||
if (!istype(O,i))
|
||||
continue
|
||||
processing_chamber+= "some <B>[O]</B><BR>"
|
||||
break
|
||||
if (!processing_chamber)
|
||||
is_chamber_empty = 1
|
||||
processing_chamber = "Nothing."
|
||||
if (!beaker)
|
||||
beaker_contents = "\The [src] has no beaker attached."
|
||||
else if (!beaker.reagents.total_volume)
|
||||
beaker_contents = "\The [src] has attached an empty beaker."
|
||||
is_beaker_ready = 1
|
||||
else if (beaker.reagents.total_volume < beaker.reagents.maximum_volume)
|
||||
beaker_contents = "\The [src] has attached a beaker with something."
|
||||
is_beaker_ready = 1
|
||||
else
|
||||
beaker_contents = "\The [src] has attached a beaker and the beaker is full!"
|
||||
|
||||
var/dat = {"
|
||||
<b>Processing chamber contains:</b><br>
|
||||
[processing_chamber]<br>
|
||||
[beaker_contents]<hr>
|
||||
"}
|
||||
if (is_beaker_ready && !is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
|
||||
dat += "<A href='?src=\ref[src];action=grind'>Turn on!<BR>"
|
||||
if (beaker)
|
||||
dat += "<A href='?src=\ref[src];action=detach'>Detach a beacker!<BR>"
|
||||
user << browse("<HEAD><TITLE>Reagent Grinder</TITLE></HEAD><TT>[dat]</TT>", "window=reagentgrinder")
|
||||
onclose(user, "reagentgrinder")
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/reagentgrinder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
switch(href_list["action"])
|
||||
if ("grind")
|
||||
grind()
|
||||
|
||||
if ("detach")
|
||||
detach()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/reagentgrinder/verb/detach()
|
||||
set category = "Object"
|
||||
set name = "Detach Beaker from the grinder"
|
||||
set src in oview(1)
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (!beaker)
|
||||
return
|
||||
src.verbs -= /obj/machinery/reagentgrinder/verb/detach
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_juice_id(var/obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
for (var/i in allowed_items)
|
||||
if (istype(O, i))
|
||||
return allowed_items[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_juice_amount(var/obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
if (!istype(O))
|
||||
return 5
|
||||
else if (O.potency == -1)
|
||||
return 5
|
||||
else
|
||||
return round(O.potency / 5)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_grownweapon_id(var/obj/item/weapon/grown/O)
|
||||
for (var/i in allowed_items)
|
||||
if (istype(O, i))
|
||||
return allowed_items[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_grownweapon_amount(var/obj/item/weapon/grown/O)
|
||||
if (!istype(O))
|
||||
return 5
|
||||
else if (O.potency == -1)
|
||||
return 5
|
||||
else
|
||||
return round(O.potency)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_grind_id(var/obj/item/stack/sheet/O)
|
||||
for (var/i in allowed_items)
|
||||
if (istype(O, i))
|
||||
return allowed_items[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_grind_amount(var/obj/item/stack/sheet/O)
|
||||
return 20
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/grind()
|
||||
power_change()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!beaker || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
return
|
||||
playsound(src.loc, 'juicer.ogg', 20, 1)
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/O in src.contents)
|
||||
var/r_id = get_juice_id(O)
|
||||
beaker.reagents.add_reagent(r_id,get_juice_amount(O))
|
||||
del(O)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
for (var/obj/item/stack/sheet/O in src.contents)
|
||||
var/g_id = get_grind_id(O)
|
||||
beaker.reagents.add_reagent(g_id,get_grind_amount(O))
|
||||
del(O)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
for (var/obj/item/weapon/grown/O in src.contents)
|
||||
var/g_id = get_grownweapon_id(O)
|
||||
beaker.reagents.add_reagent(g_id,get_grownweapon_amount(O))
|
||||
del(O)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
NOTE: IF YOU UPDATE THE REAGENT-SYSTEM, ALSO UPDATE THIS README.
|
||||
|
||||
Structure: /////////////////// //////////////////////////
|
||||
// Mob or object // -------> // Reagents var (datum) // Is a reference to the datum that holds the reagents.
|
||||
/////////////////// //////////////////////////
|
||||
| |
|
||||
The object that holds everything. V
|
||||
reagent_list var (list) A List of datums, each datum is a reagent.
|
||||
|
||||
| | |
|
||||
V V V
|
||||
|
||||
reagents (datums) Reagents. I.e. Water , antitoxins or mercury.
|
||||
|
||||
|
||||
Random important notes:
|
||||
|
||||
An objects on_reagent_change will be called every time the objects reagents change.
|
||||
Useful if you want to update the objects icon etc.
|
||||
|
||||
About the Holder:
|
||||
|
||||
The holder (reagents datum) is the datum that holds a list of all reagents
|
||||
currently in the object.It also has all the procs needed to manipulate reagents
|
||||
|
||||
remove_any(var/amount)
|
||||
This proc removes reagents from the holder until the passed amount
|
||||
is matched. It'll try to remove some of ALL reagents contained.
|
||||
|
||||
trans_to(var/obj/target, var/amount)
|
||||
This proc equally transfers the contents of the holder to another
|
||||
objects holder. You need to pass it the object (not the holder) you want
|
||||
to transfer to and the amount you want to transfer. Its return value is the
|
||||
actual amount transfered (if one of the objects is full/empty)
|
||||
|
||||
trans_id_to(var/obj/target, var/reagent, var/amount)
|
||||
Same as above but only for a specific reagent in the reagent list.
|
||||
If the specified amount is greater than what is available, it will use
|
||||
the amount of the reagent that is available. If no reagent exists, returns null.
|
||||
|
||||
metabolize(var/mob/M)
|
||||
This proc is called by the mobs life proc. It simply calls on_mob_life for
|
||||
all contained reagents. You shouldnt have to use this one directly.
|
||||
|
||||
handle_reactions()
|
||||
This proc check all recipes and, on a match, uses them.
|
||||
It will also call the recipe's on_reaction proc (for explosions or w/e).
|
||||
Currently, this proc is automatically called by trans_to.
|
||||
|
||||
isolate_reagent(var/reagent)
|
||||
Pass it a reagent id and it will remove all reagents but that one.
|
||||
It's that simple.
|
||||
|
||||
del_reagent(var/reagent)
|
||||
Completely remove the reagent with the matching id.
|
||||
|
||||
reaction_fire(exposed_temp)
|
||||
Simply calls the reaction_fire procs of all contained reagents.
|
||||
|
||||
update_total()
|
||||
This one simply updates the total volume of the holder.
|
||||
(the volume of all reagents added together)
|
||||
|
||||
clear_reagents()
|
||||
This proc removes ALL reagents from the holder.
|
||||
|
||||
reaction(var/atom/A, var/method=TOUCH, var/volume_modifier=0)
|
||||
This proc calls the appropriate reaction procs of the reagents.
|
||||
I.e. if A is an object, it will call the reagents reaction_obj
|
||||
proc. The method var is used for reaction on mobs. It simply tells
|
||||
us if the mob TOUCHed the reagent or if it INGESTed the reagent.
|
||||
Since the volume can be checked in a reagents proc, you might want to
|
||||
use the volume_modifier var to modifiy the passed value without actually
|
||||
changing the volume of the reagents.
|
||||
If you're not sure if you need to use this the answer is very most likely 'No'.
|
||||
You'll want to use this proc whenever an atom first comes in
|
||||
contact with the reagents of a holder. (in the 'splash' part of a beaker i.e.)
|
||||
More on the reaction in the reagent part of this readme.
|
||||
|
||||
add_reagent(var/reagent, var/amount, var/data)
|
||||
Attempts to add X of the matching reagent to the holder.
|
||||
You wont use this much. Mostly in new procs for pre-filled
|
||||
objects.
|
||||
|
||||
remove_reagent(var/reagent, var/amount)
|
||||
The exact opposite of the add_reagent proc.
|
||||
|
||||
has_reagent(var/reagent, var/amount)
|
||||
Returns 1 if the holder contains this reagent.
|
||||
Or 0 if not.
|
||||
If you pass it an amount it will additionally check
|
||||
if the amount is matched. This is optional.
|
||||
|
||||
get_reagent_amount(var/reagent)
|
||||
Returns the amount of the matching reagent inside the
|
||||
holder. Returns 0 if the reagent is missing.
|
||||
|
||||
Important variables:
|
||||
|
||||
total_volume
|
||||
This variable contains the total volume of all reagents in this holder.
|
||||
|
||||
reagent_list
|
||||
This is a list of all contained reagents. More specifically, references
|
||||
to the reagent datums.
|
||||
|
||||
maximum_volume
|
||||
This is the maximum volume of the holder.
|
||||
|
||||
my_atom
|
||||
This is the atom the holder is 'in'. Useful if you need to find the location.
|
||||
(i.e. for explosions)
|
||||
|
||||
|
||||
About Reagents:
|
||||
|
||||
Reagents are all the things you can mix and fille in bottles etc. This can be anything from
|
||||
rejuvs over water to ... iron. Each reagent also has a few procs - i'll explain those below.
|
||||
|
||||
reaction_mob(var/mob/M, var/method=TOUCH)
|
||||
This is called by the holder's reation proc.
|
||||
This version is only called when the reagent
|
||||
reacts with a mob. The method var can be either
|
||||
TOUCH or INGEST. You'll want to put stuff like
|
||||
acid-facemelting in here.
|
||||
|
||||
reaction_obj(var/obj/O)
|
||||
This is called by the holder's reation proc.
|
||||
This version is called when the reagents reacts
|
||||
with an object. You'll want to put stuff like
|
||||
object melting in here ... or something. i dunno.
|
||||
|
||||
reaction_turf(var/turf/T)
|
||||
This is called by the holder's reation proc.
|
||||
This version is called when the reagents reacts
|
||||
with a turf. You'll want to put stuff like extra
|
||||
slippery floors for lube or something in here.
|
||||
|
||||
on_mob_life(var/mob/M)
|
||||
This proc is called everytime the mobs life proc executes.
|
||||
This is the place where you put damage for toxins ,
|
||||
drowsyness for sleep toxins etc etc.
|
||||
You'll want to call the parents proc by using ..() .
|
||||
If you dont, the chemical will stay in the mob forever -
|
||||
unless you write your own piece of code to slowly remove it.
|
||||
(Should be pretty easy, 1 line of code)
|
||||
|
||||
Important variables:
|
||||
|
||||
holder
|
||||
This variable contains a reference to the holder the chemical is 'in'
|
||||
|
||||
volume
|
||||
This is the volume of the reagent.
|
||||
|
||||
id
|
||||
The id of the reagent
|
||||
|
||||
name
|
||||
The name of the reagent.
|
||||
|
||||
data
|
||||
This var can be used for whatever the fuck you want. I used it for the sleep
|
||||
toxins to make them work slowly instead of instantly. You could also use this
|
||||
for DNA in a blood reagent or ... well whatever you want.
|
||||
|
||||
color
|
||||
This is a hexadecimal color that represents the reagent outside of containers,
|
||||
you define it as "#RRGGBB", or, red green blue. You can also define it using the
|
||||
rgb() proc, which returns a hexadecimal value too. The color is black by default.
|
||||
|
||||
A good website for color calculations: http://www.psyclops.com/tools/rgb/
|
||||
|
||||
|
||||
|
||||
|
||||
About Recipes:
|
||||
|
||||
Recipes are simple datums that contain a list of required reagents and a result.
|
||||
They also have a proc that is called when the recipe is matched.
|
||||
|
||||
on_reaction(var/datum/reagents/holder, var/created_volume)
|
||||
This proc is called when the recipe is matched.
|
||||
You'll want to add explosions etc here.
|
||||
To find the location you'll have to do something
|
||||
like get_turf(holder.my_atom)
|
||||
|
||||
name & id
|
||||
Should be pretty obvious.
|
||||
|
||||
result
|
||||
This var contains the id of the resulting reagent.
|
||||
|
||||
required_reagents
|
||||
This is a list of ids of the required reagents.
|
||||
Each id also needs an associated value that gives us the minimum required amount
|
||||
of that reagent. The handle_reaction proc can detect mutiples of the same recipes
|
||||
so for most cases you want to set the required amount to 1.
|
||||
|
||||
required_catalysts (Added May 2011)
|
||||
This is a list of the ids of the required catalysts.
|
||||
Functionally similar to required_reagents, it is a list of reagents that are required
|
||||
for the reaction. However, unlike required_reagents, catalysts are NOT consumed.
|
||||
They mearly have to be present in the container.
|
||||
|
||||
result_amount
|
||||
This is the amount of the resulting reagent this recipe will produce.
|
||||
I recommend you set this to the total volume of all required reagent.
|
||||
|
||||
required_container
|
||||
The container the recipe has to take place in in order to happen. Leave this blank/null
|
||||
if you want the reaction to happen anywhere.
|
||||
|
||||
required_other
|
||||
Basically like a reagent's data variable. You can set extra requirements for a
|
||||
reaction with this.
|
||||
|
||||
|
||||
About the Tools:
|
||||
|
||||
By default, all atom have a reagents var - but its empty. if you want to use an object for the chem.
|
||||
system you'll need to add something like this in its new proc:
|
||||
|
||||
var/datum/reagents/R = new/datum/reagents(100) <<<<< create a new datum , 100 is the maximum_volume of the new holder datum.
|
||||
reagents = R <<<<< assign the new datum to the objects reagents var
|
||||
R.my_atom = src <<<<< set the holders my_atom to src so that we know where we are.
|
||||
|
||||
This can also be done by calling a convenience proc:
|
||||
atom/proc/create_reagents(var/max_volume)
|
||||
|
||||
Other important stuff:
|
||||
|
||||
amount_per_transfer_from_this var
|
||||
This var is mostly used by beakers and bottles.
|
||||
It simply tells us how much to transfer when
|
||||
'pouring' our reagents into something else.
|
||||
|
||||
atom/proc/is_open_container()
|
||||
Checks atom/var/flags & OPENCONTAINER.
|
||||
If this returns 1 , you can use syringes, beakers etc
|
||||
to manipulate the contents of this object.
|
||||
If it's 0, you'll need to write your own custom reagent
|
||||
transfer code since you will not be able to use the standard
|
||||
tools to manipulate it.
|
||||
|
||||
*/
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,235 +0,0 @@
|
||||
/*********************NEW AUTOLATHE / CRAFT LATHE***********************/
|
||||
|
||||
var/list/datum/craftlathe_item/CRAFT_ITEMS = list()
|
||||
var/CRAFT_ITEMS_SETUP = 1 //this should probably be a pre-game thing, but i'll do it so the first lathe2 that's created will set-up the recipes.
|
||||
|
||||
proc/check_craftlathe_recipe(var/list/param_recipe)
|
||||
if(param_recipe.len != 9)
|
||||
return
|
||||
var/i
|
||||
var/match = 0 //this one counts if there is at least one non-"" ingredient.
|
||||
for(var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
match = 0
|
||||
for(i = 1; i <= 9; i++)
|
||||
if(CI.recipe[i] != param_recipe[i])
|
||||
match = 0 //use this so it passes by the match > 0 check below, otherwise i'd need a new variable to tell the return CI below that the check failed
|
||||
break
|
||||
if(CI.recipe[i] != "")
|
||||
match++
|
||||
if(match > 0)
|
||||
return CI
|
||||
return 0
|
||||
|
||||
/datum/craftlathe_item
|
||||
var/id = "" //must be unique for each item type. used to create recipes
|
||||
var/name = "unknown" //what the lathe will show as it's contents
|
||||
var/list/recipe = list("","","","","","","","","") //the 9 items here represent what items need to be placed in the lathe to produce this item.
|
||||
var/item_type = null //this is used on items like sheets which are added when inserted into the lathe.
|
||||
var/amount = 1
|
||||
var/amount_attackby = 1
|
||||
|
||||
/datum/craftlathe_item/New(var/param_id,var/param_name,var/param_amount,var/param_ammount_per_attackby,var/list/param_recipe,var/param_type = null)
|
||||
..()
|
||||
id = param_id
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
item_type = param_type
|
||||
amount = param_amount;
|
||||
amount_attackby = param_ammount_per_attackby
|
||||
return
|
||||
|
||||
//this proc checks the recipe you give in it's parameter with the entire list of available items. If any match, it returns the item from CRAFT_ITEMS. the returned item should not be changed!!
|
||||
|
||||
/obj/machinery/autolathe2
|
||||
name = "Craft lathe"
|
||||
icon_state = "autolathe"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/datum/craftlathe_item/selected = null
|
||||
var/datum/craftlathe_item/make = null
|
||||
var/list/datum/craftlathe_item/craft_contents = list()
|
||||
var/list/current_recipe = list("","","","","","","","","")
|
||||
|
||||
/obj/machinery/autolathe2/New()
|
||||
..()
|
||||
if(CRAFT_ITEMS_SETUP)
|
||||
CRAFT_ITEMS_SETUP = 0
|
||||
build_recipes()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/attack_hand(mob/user as mob)
|
||||
var/dat
|
||||
dat = text("<h3>Craft Lathe</h3>")
|
||||
dat += text("<table><tr><td valign='top'>")
|
||||
|
||||
dat += text("<b>Materials</b><p>")
|
||||
var/datum/craftlathe_item/CI
|
||||
var/i
|
||||
for(i = 1; i <= craft_contents.len; i++)
|
||||
CI = craft_contents[i]
|
||||
if (CI == selected)
|
||||
dat += text("[CI.name] ([CI.amount])<br>")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];select=[i]'>[CI.name]</a> ([CI.amount])<br>")
|
||||
|
||||
dat += text("</td><td valign='top'>")
|
||||
|
||||
dat += text("<b>Crafting Table</b><p>")
|
||||
|
||||
dat += text(" <table bgcolor='#cccccc' cellpadding='4' cellspacing='0'>")
|
||||
|
||||
var/j = 0
|
||||
var/k = 0
|
||||
for (i = 0; i < 3; i++)
|
||||
dat += text(" <tr>")
|
||||
for (j = 1; j <= 3; j++)
|
||||
k = i * 3 + j
|
||||
if (current_recipe[k])
|
||||
dat += text(" <td><A href='?src=\ref[src];remove=[k]'>[current_recipe[k]]</a></td>")
|
||||
else
|
||||
dat += text(" <td><A href='?src=\ref[src];add=[k]'>----</a></td>")
|
||||
dat += text(" </tr>")
|
||||
dat += text(" </table>")
|
||||
|
||||
dat += text("<br><br>")
|
||||
dat += text("<b>Will make: </b>")
|
||||
if (make)
|
||||
dat += text("<A href='?src=\ref[src];make=[1]'>[make.name]</a>")
|
||||
else
|
||||
dat += text("nothing useful")
|
||||
|
||||
dat += text("</td></tr></table>")
|
||||
user << browse("[dat]", "window=craft")
|
||||
|
||||
/obj/machinery/autolathe2/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/n = text2num(href_list["remove"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
current_recipe[n] = ""
|
||||
if(href_list["select"])
|
||||
var/n = text2num(href_list["select"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
selected = craft_contents[n]
|
||||
if(href_list["add"])
|
||||
var/n = text2num(href_list["add"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
if(selected)
|
||||
current_recipe[n] = selected.id
|
||||
if(href_list["make"])
|
||||
var/datum/craftlathe_item/MAKE = check_craftlathe_recipe(src.current_recipe)
|
||||
if(MAKE)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.id == MAKE.id)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(MAKE.id,MAKE.name,MAKE.amount,MAKE.amount_attackby,MAKE.recipe,MAKE.item_type)
|
||||
var/datum/craftlathe_item/CI = check_craftlathe_recipe(src.current_recipe)
|
||||
if(CI)
|
||||
make = CI
|
||||
else
|
||||
make = null
|
||||
src.updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/autolathe2/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
for (var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
if(W.type == CI.item_type)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.item_type == W.type)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
rmv_item(W)
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(CI.id,CI.name,CI.amount,CI.amount_attackby,CI.recipe,CI.item_type)
|
||||
rmv_item(W)
|
||||
return
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/proc/rmv_item(obj/item/W as obj)
|
||||
if(istype(W,/obj/item/stack))
|
||||
var/obj/item/stack/S = W
|
||||
S.amount--
|
||||
if (S.amount <= 0)
|
||||
del(S)
|
||||
else
|
||||
del(W)
|
||||
|
||||
/obj/machinery/autolathe2/proc/build_recipes()
|
||||
//Parameters: ID, Name, Amount, Amount_added_per_attackby, Recipe, Object type
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("METAL","Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R METAL","Reinforced Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/r_metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASS","Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/glass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R GLASS","Reinforced Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/rglass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GOLD","Gold",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/gold)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SILVER","Silver",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/silver)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("DIAMOND","Diamond",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/diamond)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PLASMA","Plasma",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/plasma)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("URANIUM","Uranium",1,1,list("","","","","","","","",""),/obj/item/weapon/ore/uranium)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CLOWN","Bananium",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/clown)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ADMAMANTINE","Adamantine",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/adamantine)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREWS","Screws",9,9,list("","","","","METAL","","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("COGS","Cogs",9,9,list("","METAL","","METAL","METAL","METAL","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWITCH","Switch",12,12,list("METAL","","METAL","METAL","METAL","","METAL","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("KEYBOARD","Keyboard",1,1,list("","","","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("M PANEL","Metal Panel",10,10,list("","","","","METAL","METAL","","METAL","METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CASE","Equipment Case",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("G PANEL","Glass Panel",10,10,list("","","","","GLASS","GLASS","","GLASS","GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREEN","Screen",1,1,list("","GLASS","","GLASS","PLASMA","GLASS","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL SILVER","Electronics Silver",30,30,list("","","","","SILVER","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL GOLD","Electronics Gold",6,6,list("","","","","GOLD","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TINTED GL","Tinted Glass",2,2,list("","METAL","","","GLASS","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TANK VALVE","Tank Transfer Valuve",1,1,list("","PIPE","","","PIPE","SWITCH","","PIPE",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PIPE","Pipe",1,1,list("","M PANEL","","","M PANEL","","","M PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CB FRAME","Circuitboard Frame",1,1,list("","","","M PANEL","G PANEL","M PANEL","G PANEL","M PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ROM","ROM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RAM","RAM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PROCESSOR","Processor",1,1,list("EL GOLD","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ANTENNA","Antenna",1,1,list("","","EL SILVER","","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("OP RECEPTOR","Optic Receptor",1,1,list("G PANEL","G PANEL","G PANEL","","EL GOLD","","G PANEL","G PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMAL OP R","Thermal Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","DIAMOND","DIAMOND","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASON OP R","Mason Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","EL SILVER","EL SILVER","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EAR FRAME","Earpiece Frame",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RADIO M","Radio Module",1,1,list("","ANTENNA","","","ROM","","CB FRAME","CB FRAME","CB FRAME"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARPIECE","Radio Earpiece",1,1,list("","","","","RADIO M","","","EAR FRAME",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARMUFFS","Earmuffs",1,1,list("","M PANEL","","EAR FRAME","","EAR FRAME","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASSES FRAME","Glasses Frame",1,1,list("M PANEL","","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASONS","Mason Scanners",1,1,list("","","","MASON OP R","GLASSES FRAME","MASON OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMALS","Thermal Scanners",1,1,list("","","","THERMAL OP R","GLASSES FRAME","THERMAL OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SUNGLASSES","Sunglasses",1,1,list("","","","TINTED GL","GLASSES FRAME","TINTED GL","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET FR","Helmet Frame",1,1,list("METAL","METAL","METAL","METAL","","METAL","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET","Security Helmet",1,1,list("R METAL","R METAL","R METAL","R METAL","HELMET FR","R METAL","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS HELMET","HoS Helmet",1,1,list("SILVER","GOLD","SILVER","SILVER","HELMET","SILVER","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HARDHAT","Hardhat",1,1,list("","FLASHLIGHT","","","HELMET FR","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWAT HELMET","SWAT Helmet",1,1,list("","","","","HELMET","","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("WELDING HELM","Welding Helmet",1,1,list("","","","","HELMET FR","","TINTED GL","TINTED GL","TINTED GL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE HELMET","Space Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","HELMET FR","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG HELMET","RIG Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","SPACE HELMET","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GAS MASK","Gas Mask",1,1,list("","","","","HELMET FR","TANK VALVE","","G PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR FRAME","Armor Frame",1,1,list("R METAL","","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR","Armored Vest",1,1,list("R METAL","","R METAL","R METAL","ARMOR FRAME","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS ARMOR","HoS Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CAP ARMOR","Captain Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","HOS ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE S FR","Space Suit Frame",1,1,list("SILVER","","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE SUIT","Space Suit",1,1,list("SILVER","","SILVER","RAM","SPACE S FR","RADIO M","SILVER","SILVEr","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG SUIT","RIG Suit",1,1,list("SILVER","","SILVER","SILVER","SPACE SUIT","SILVER","SILVER","SILVER","SILVER"))
|
||||
//TODO: Flashlight, type paths
|
||||
return
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -1,78 +0,0 @@
|
||||
/**********************Gas extractor**************************/
|
||||
|
||||
/obj/machinery/mineral/gasextractor
|
||||
name = "Gas extractor"
|
||||
desc = "A machine which extracts gasses from ores"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/message = "";
|
||||
var/processing = 0
|
||||
var/newtoxins = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/gasextractor/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/gasextractor/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];extract=[input]'>Extract gas</A>")
|
||||
|
||||
dat += text("<br><br>Message: [message]")
|
||||
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/gasextractor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["extract"])
|
||||
if (src.output)
|
||||
if (locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
newtoxins = 0
|
||||
processing = 1
|
||||
var/obj/item/weapon/ore/O
|
||||
while(locate(/obj/item/weapon/ore/plasma, input.loc) && locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
O = locate(/obj/item/weapon/ore/plasma, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
var/obj/machinery/portable_atmospherics/canister/C
|
||||
C = locate(/obj/machinery/portable_atmospherics/canister,output.loc)
|
||||
C.air_contents.toxins += 100
|
||||
newtoxins += 100
|
||||
del(O)
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
message = "Canister filled with [newtoxins] units of toxins"
|
||||
else
|
||||
message = "No canister found"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -1,88 +0,0 @@
|
||||
/**********************Mineral purifier (not used, replaced with mineral processing unit)**************************/
|
||||
|
||||
/obj/machinery/mineral/purifier
|
||||
name = "Ore Purifier"
|
||||
desc = "A machine which makes building material out of ores"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/processed = 0
|
||||
var/processing = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/purifier/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];purify=[input]'>Purify</A>")
|
||||
|
||||
dat += text("<br><br>found: <font color='green'><b>[processed]</b></font>")
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/purifier/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["purify"])
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
var/obj/item/weapon/ore/O
|
||||
processed = 0;
|
||||
while(locate(/obj/item/weapon/ore, input.loc))
|
||||
O = locate(/obj/item/weapon/ore, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/iron))
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
new /obj/item/stack/sheet/diamond(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
new /obj/item/stack/sheet/plasma(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
new /obj/item/stack/sheet/gold(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
new /obj/item/stack/sheet/silver(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
new /obj/item/weapon/ore/uranium(output.loc)
|
||||
del(O)
|
||||
/*if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
new /obj/item/weapon/ore/adamantine(output.loc)
|
||||
del(O)*/ //Dunno what this area does so I'll keep it commented out for now -Durandan
|
||||
processed++
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/purifier/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
@@ -1,174 +0,0 @@
|
||||
/**********************Random mine generator************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/mine_generator
|
||||
name = "Random mine generator"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
var/turf/last_loc
|
||||
var/turf/target_loc
|
||||
var/turf/start_loc
|
||||
var/randXParam //the value of these two parameters are generated by the code itself and used to
|
||||
var/randYParam //determine the random XY parameters
|
||||
var/mineDirection = 3
|
||||
/*
|
||||
0 = none
|
||||
1 = N
|
||||
2 = NNW
|
||||
3 = NW
|
||||
4 = WNW
|
||||
5 = W
|
||||
6 = WSW
|
||||
7 = SW
|
||||
8 = SSW
|
||||
9 = S
|
||||
10 = SSE
|
||||
11 = SE
|
||||
12 = ESE
|
||||
13 = E
|
||||
14 = ENE
|
||||
15 = NE
|
||||
16 = NNE
|
||||
*/
|
||||
|
||||
/obj/mine_generator/New()
|
||||
last_loc = src.loc
|
||||
var/i
|
||||
for(i = 0; i < 50; i++)
|
||||
gererateTargetLoc()
|
||||
//target_loc = locate(last_loc.x + rand(5), last_loc.y + rand(5), src.z)
|
||||
fillWithAsteroids()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/mine_generator/proc/gererateTargetLoc() //this proc determines where the next square-room will end.
|
||||
switch(mineDirection)
|
||||
if(1)
|
||||
randXParam = 0
|
||||
randYParam = 4
|
||||
if(2)
|
||||
randXParam = 1
|
||||
randYParam = 3
|
||||
if(3)
|
||||
randXParam = 2
|
||||
randYParam = 2
|
||||
if(4)
|
||||
randXParam = 3
|
||||
randYParam = 1
|
||||
if(5)
|
||||
randXParam = 4
|
||||
randYParam = 0
|
||||
if(6)
|
||||
randXParam = 3
|
||||
randYParam = -1
|
||||
if(7)
|
||||
randXParam = 2
|
||||
randYParam = -2
|
||||
if(8)
|
||||
randXParam = 1
|
||||
randYParam = -3
|
||||
if(9)
|
||||
randXParam = 0
|
||||
randYParam = -4
|
||||
if(10)
|
||||
randXParam = -1
|
||||
randYParam = -3
|
||||
if(11)
|
||||
randXParam = -2
|
||||
randYParam = -2
|
||||
if(12)
|
||||
randXParam = -3
|
||||
randYParam = -1
|
||||
if(13)
|
||||
randXParam = -4
|
||||
randYParam = 0
|
||||
if(14)
|
||||
randXParam = -3
|
||||
randYParam = 1
|
||||
if(15)
|
||||
randXParam = -2
|
||||
randYParam = 2
|
||||
if(16)
|
||||
randXParam = -1
|
||||
randYParam = 3
|
||||
target_loc = last_loc
|
||||
if (randXParam > 0)
|
||||
target_loc = locate(target_loc.x+rand(randXParam),target_loc.y,src.z)
|
||||
if (randYParam > 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y+rand(randYParam),src.z)
|
||||
if (randXParam < 0)
|
||||
target_loc = locate(target_loc.x-rand(-randXParam),target_loc.y,src.z)
|
||||
if (randYParam < 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y-rand(-randXParam),src.z)
|
||||
if (mineDirection == 1 || mineDirection == 5 || mineDirection == 9 || mineDirection == 13) //if N,S,E,W, turn quickly
|
||||
if(prob(50))
|
||||
mineDirection += 2
|
||||
else
|
||||
mineDirection -= 2
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
else
|
||||
if(prob(50))
|
||||
if(prob(50))
|
||||
mineDirection += 1
|
||||
else
|
||||
mineDirection -= 1
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
return
|
||||
|
||||
|
||||
/obj/mine_generator/proc/fillWithAsteroids()
|
||||
|
||||
if(last_loc)
|
||||
start_loc = last_loc
|
||||
|
||||
if(start_loc && target_loc)
|
||||
var/x1
|
||||
var/y1
|
||||
|
||||
var/turf/line_start = start_loc
|
||||
var/turf/column = line_start
|
||||
|
||||
if(start_loc.x <= target_loc.x)
|
||||
if(start_loc.y <= target_loc.y) //GOING NORTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING NORTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else
|
||||
if(start_loc.y <= target_loc.y) //GOING SOUTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING SOUTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
|
||||
|
||||
return
|
||||
@@ -1,338 +0,0 @@
|
||||
/**********************Rail track**************************/
|
||||
|
||||
/obj/machinery/rail_track
|
||||
name = "Rail track"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
var/id = null //this is needed for switches to work Set to the same on the whole length of the track
|
||||
anchored = 1
|
||||
|
||||
/**********************Rail intersection**************************/
|
||||
|
||||
/obj/machinery/rail_track/intersections
|
||||
name = "Rail track intersection"
|
||||
icon_state = "rail_intersection"
|
||||
|
||||
/obj/machinery/rail_track/intersections/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (5) dir = 4
|
||||
if (4) dir = 9
|
||||
if (9) dir = 2
|
||||
if (2) dir = 10
|
||||
if (10) dir = 8
|
||||
if (8) dir = 6
|
||||
if (6) dir = 1
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSE"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (2) dir = 5
|
||||
if (5) dir = 9
|
||||
if (9) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_SEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (8) dir = 6
|
||||
if (4) dir = 6
|
||||
if (6) dir = 5
|
||||
if (5) dir = 8
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSW"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 10
|
||||
if (2) dir = 10
|
||||
if (10) dir = 6
|
||||
if (6) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (4) dir = 9
|
||||
if (8) dir = 9
|
||||
if (9) dir = 10
|
||||
if (10) dir = 8
|
||||
return
|
||||
|
||||
/**********************Rail switch**************************/
|
||||
|
||||
/obj/machinery/rail_switch
|
||||
name = "Rail switch"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
icon = 'recycling.dmi'
|
||||
icon_state = "switch-off"
|
||||
var/obj/machinery/rail_track/track = null
|
||||
var/id //used for to change the track pieces
|
||||
|
||||
/obj/machinery/rail_switch/New()
|
||||
spawn(10)
|
||||
src.track = locate(/obj/machinery/rail_track, get_step(src, NORTH))
|
||||
if(track)
|
||||
id = track.id
|
||||
return
|
||||
|
||||
/obj/machinery/rail_switch/attack_hand(user as mob)
|
||||
user << "You switch the rail track's direction"
|
||||
for (var/obj/machinery/rail_track/T in world)
|
||||
if (T.id == src.id)
|
||||
var/obj/machinery/rail_car/C = locate(/obj/machinery/rail_car, T.loc)
|
||||
if (C)
|
||||
switch (T.dir)
|
||||
if(1)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(2)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(4)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(8)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(5)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(6)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(9)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "N"
|
||||
if("W") C.direction = "E"
|
||||
if(10)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "W"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "N"
|
||||
return
|
||||
|
||||
/**********************Rail car**************************/
|
||||
|
||||
/obj/machinery/rail_car
|
||||
name = "Rail car"
|
||||
icon = 'Storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
var/direction = "S" //S = south, N = north, E = east, W = west. Determines whichw ay it'll look first
|
||||
var/moving = 0;
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/speed = 0
|
||||
var/slowing = 0
|
||||
var/atom/movable/load = null //what it's carrying
|
||||
|
||||
/obj/machinery/rail_car/attack_hand(user as mob)
|
||||
if (moving == 0)
|
||||
processing_items.Add(src)
|
||||
moving = 1
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
return
|
||||
|
||||
/*
|
||||
for (var/client/C)
|
||||
C << "Dela."
|
||||
*/
|
||||
|
||||
/obj/machinery/rail_car/MouseDrop_T(var/atom/movable/C, mob/user)
|
||||
|
||||
if(user.stat)
|
||||
return
|
||||
|
||||
if (!istype(C) || C.anchored || get_dist(user, src) > 1 || get_dist(src,C) > 1 )
|
||||
return
|
||||
|
||||
if(ismob(C))
|
||||
load(C)
|
||||
|
||||
|
||||
/obj/machinery/rail_car/proc/load(var/atom/movable/C)
|
||||
|
||||
if(get_dist(C, src) > 1)
|
||||
return
|
||||
//mode = 1
|
||||
|
||||
C.loc = src.loc
|
||||
sleep(2)
|
||||
C.loc = src
|
||||
load = C
|
||||
|
||||
C.pixel_y += 9
|
||||
if(C.layer < layer)
|
||||
C.layer = layer + 0.1
|
||||
overlays += C
|
||||
|
||||
if(ismob(C))
|
||||
var/mob/M = C
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
//mode = 0
|
||||
//send_status()
|
||||
|
||||
/obj/machinery/rail_car/proc/unload(var/dirn = 0)
|
||||
if(!load)
|
||||
return
|
||||
|
||||
overlays = null
|
||||
|
||||
load.loc = src.loc
|
||||
load.pixel_y -= 9
|
||||
load.layer = initial(load.layer)
|
||||
if(ismob(load))
|
||||
var/mob/M = load
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
|
||||
if(dirn)
|
||||
step(load, dirn)
|
||||
|
||||
load = null
|
||||
|
||||
// in case non-load items end up in contents, dump every else too
|
||||
// this seems to happen sometimes due to race conditions
|
||||
// with items dropping as mobs are loaded
|
||||
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.loc = src.loc
|
||||
AM.layer = initial(AM.layer)
|
||||
AM.pixel_y = initial(AM.pixel_y)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
/obj/machinery/rail_car/relaymove(var/mob/user)
|
||||
if(user.stat)
|
||||
return
|
||||
if(load == user)
|
||||
unload(0)
|
||||
return
|
||||
|
||||
/obj/machinery/rail_car/process()
|
||||
if (moving == 1)
|
||||
if (slowing == 1)
|
||||
if (speed > 0)
|
||||
speed--;
|
||||
if (speed == 0)
|
||||
slowing = 0
|
||||
else
|
||||
if (speed < 10)
|
||||
speed++;
|
||||
var/i = 0
|
||||
for (i = 0; i < speed; i++)
|
||||
if (moving == 1)
|
||||
switch (direction)
|
||||
if ("S")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y-1,src.z))
|
||||
if (R.dir == 10)
|
||||
direction = "W"
|
||||
if (R.dir == 9)
|
||||
direction = "E"
|
||||
if (R.dir == 2 || R.dir == 1 || R.dir == 10 || R.dir == 9)
|
||||
for (var/mob/living/M in locate(src.x,src.y-1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("N")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y+1,src.z))
|
||||
if (R.dir == 5)
|
||||
direction = "E"
|
||||
if (R.dir == 6)
|
||||
direction = "W"
|
||||
if (R.dir == 5 || R.dir == 1 || R.dir == 6 || R.dir == 2)
|
||||
for (var/mob/living/M in locate(src.x,src.y+1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("E")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x+1,src.y,src.z))
|
||||
if (R.dir == 6)
|
||||
direction = "S"
|
||||
if (R.dir == 10)
|
||||
direction = "N"
|
||||
if (R.dir == 4 || R.dir == 8 || R.dir == 10 || R.dir == 6)
|
||||
for (var/mob/living/M in locate(src.x+1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("W")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x-1,src.y,src.z))
|
||||
if (R.dir == 9)
|
||||
direction = "N"
|
||||
if (R.dir == 5)
|
||||
direction = "S"
|
||||
if (R.dir == 8 || R.dir == 9 || R.dir == 5 || R.dir == 4)
|
||||
for (var/mob/living/M in locate(src.x-1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
sleep(1)
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
return
|
||||
@@ -1,173 +0,0 @@
|
||||
/**********************Spaceship builder area definitions**************************/
|
||||
|
||||
/area/shipbuilder
|
||||
requires_power = 0
|
||||
luminosity = 1
|
||||
sd_lighting = 0
|
||||
|
||||
/area/shipbuilder/station
|
||||
name = "shipbuilder station"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship1
|
||||
name = "shipbuilder ship1"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship2
|
||||
name = "shipbuilder ship2"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship3
|
||||
name = "shipbuilder ship3"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship4
|
||||
name = "shipbuilder ship4"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship5
|
||||
name = "shipbuilder ship5"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship6
|
||||
name = "shipbuilder ship6"
|
||||
icon_state = "teleporter"
|
||||
|
||||
|
||||
/**********************Spaceship builder**************************/
|
||||
|
||||
/obj/machinery/spaceship_builder
|
||||
name = "Robotic Fabricator"
|
||||
icon = 'surgery.dmi'
|
||||
icon_state = "fab-idle"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/metal_amount = 0
|
||||
var/operating = 0
|
||||
var/area/currentShuttleArea = null
|
||||
var/currentShuttleName = null
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/buildShuttle(var/shuttle)
|
||||
|
||||
var/shuttleat = null
|
||||
var/shuttleto = "/area/shipbuilder/station"
|
||||
|
||||
var/req_metal = 0
|
||||
switch(shuttle)
|
||||
if("hopper")
|
||||
shuttleat = "/area/shipbuilder/ship1"
|
||||
currentShuttleName = "Planet hopper"
|
||||
req_metal = 25000
|
||||
if("bus")
|
||||
shuttleat = "/area/shipbuilder/ship2"
|
||||
currentShuttleName = "Blnder Bus"
|
||||
req_metal = 60000
|
||||
if("dinghy")
|
||||
shuttleat = "/area/shipbuilder/ship3"
|
||||
currentShuttleName = "Space dinghy"
|
||||
req_metal = 100000
|
||||
if("van")
|
||||
shuttleat = "/area/shipbuilder/ship4"
|
||||
currentShuttleName = "Boxvan MMDLVI"
|
||||
req_metal = 120000
|
||||
if("secvan")
|
||||
shuttleat = "/area/shipbuilder/ship5"
|
||||
currentShuttleName = "Boxvan MMDLVI - Security edition"
|
||||
req_metal = 125000
|
||||
if("station4")
|
||||
shuttleat = "/area/shipbuilder/ship6"
|
||||
currentShuttleName = "Space station 4"
|
||||
req_metal = 250000
|
||||
|
||||
if (metal_amount - req_metal < 0)
|
||||
return
|
||||
|
||||
if (!shuttleat)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = shuttleat
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/scrapShuttle()
|
||||
|
||||
var/shuttleat = "/area/shipbuilder/station"
|
||||
var/shuttleto = currentShuttleArea
|
||||
|
||||
if (!shuttleto)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = null
|
||||
currentShuttleName = null
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/stack/sheet/metal))
|
||||
|
||||
var/obj/item/stack/sheet/metal/M = W
|
||||
user << "\blue You insert all the metal into the machine."
|
||||
metal_amount += M.amount * 100
|
||||
del(M)
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attack_hand(user as mob)
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("<b>Ship fabricator</b><br><br>")
|
||||
dat += text("Current ammount of <font color='gray'>Metal: <b>[metal_amount]</b></font><br><hr>")
|
||||
|
||||
if (currentShuttleArea)
|
||||
dat += text("<b>Currently building</b><br><br>[currentShuttleName]<br><br>")
|
||||
dat += text("<b>Build the shuttle to your liking.</b><br>This shuttle will be sent to the station in the event of an emergency along with a centcom emergency shuttle.")
|
||||
dat += text("<br><br><br><A href='?src=\ref[src];scrap=1'>Scrap current shuttle</A>")
|
||||
else
|
||||
dat += text("<b>Available ships to build:</b><br><br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=hopper'>Planet hopper</A> - Tiny, Slow, 25000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=bus'>Blunder Bus</A> - Small, Decent speed, 60000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=dinghy'>Space dinghy</A> - Medium size, Decent speed, 100000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=van'>Boxvan MMDLVIr</A> - Medium size, Decent speed, 120000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=secvan'>Boxvan MMDLVI - Security eidition</A> - Large, Rather slow, 125000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=station4'>Space station 4</A> - Huge, Slow, 250000 metal<br>")
|
||||
|
||||
user << browse("[dat]", "window=shipbuilder")
|
||||
|
||||
|
||||
/obj/machinery/spaceship_builder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["ship"])
|
||||
buildShuttle(href_list["ship"])
|
||||
if(href_list["scrap"])
|
||||
scrapShuttle(href_list["ship"])
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
temperature_alert = 0
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
@@ -13,245 +14,84 @@
|
||||
if (src.monkeyizing)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
if (src.stat != 2) //still breathing
|
||||
|
||||
//First, resolve location and get a breath
|
||||
|
||||
if(air_master.current_cycle%4==2)
|
||||
//Only try to take a breath every 4 seconds, unless suffocating
|
||||
|
||||
var/datum/air_group/breath
|
||||
|
||||
|
||||
//No breath from internal atmosphere so get breath from location
|
||||
if(!breath)
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
|
||||
else if(istype(loc, /turf/))
|
||||
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
handle_breath(breath)
|
||||
|
||||
if(breath)
|
||||
loc.assume_air(breath)
|
||||
spawn(0) breathe()
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
//Apparently, the person who wrote this code designed it so that
|
||||
//blinded get reset each cycle and then get activated later in the
|
||||
//code. Very ugly. I dont care. Moving this stuff here so its easy
|
||||
//to find it.
|
||||
src.blinded = null
|
||||
|
||||
//Disease Check
|
||||
handle_virus_updates()
|
||||
|
||||
handle_environment(environment)
|
||||
//Handle temperature/pressure differences between body and environment also handles alien weeds!
|
||||
//Update mind
|
||||
update_mind()
|
||||
|
||||
//Handle temperature/pressure differences between body and environment
|
||||
handle_environment()
|
||||
|
||||
//Mutations and radiation
|
||||
handle_mutations_and_radiation()
|
||||
|
||||
//Chemicals in the body
|
||||
handle_chemicals_in_body()
|
||||
|
||||
//stuff in the stomach
|
||||
handle_stomach()
|
||||
|
||||
//Disabilities
|
||||
handle_disabilities()
|
||||
|
||||
//Status updates, death etc.
|
||||
handle_regular_status_updates()
|
||||
|
||||
// Update clothing
|
||||
update_clothing()
|
||||
|
||||
if(client)
|
||||
handle_regular_hud_updates()
|
||||
|
||||
//Being buckled to a chair or bed
|
||||
check_if_buckled()
|
||||
|
||||
// Yup.
|
||||
update_canmove()
|
||||
|
||||
clamp_values()
|
||||
|
||||
// Grabbing
|
||||
for(var/obj/item/weapon/grab/G in src)
|
||||
G.process()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid
|
||||
proc
|
||||
clamp_values()
|
||||
|
||||
handle_breath(datum/gas_mixture/breath)
|
||||
//Aliens can breathe in any atmosphere
|
||||
var/toxins_used = 0
|
||||
stunned = max(min(stunned, 20),0)
|
||||
paralysis = max(min(paralysis, 20), 0)
|
||||
weakened = max(min(weakened, 20), 0)
|
||||
sleeping = max(min(sleeping, 20), 0)
|
||||
bruteloss = max(bruteloss, 0)
|
||||
toxloss = max(toxloss, 0)
|
||||
oxyloss = max(oxyloss, 0)
|
||||
fireloss = max(fireloss, 0)
|
||||
|
||||
if(breath.toxins > ((ONE_ATMOSPHERE*BREATH_VOLUME*0.15)/(T20C*R_IDEAL_GAS_EQUATION)))
|
||||
var/available_ratio = breath.toxins/((ONE_ATMOSPHERE*BREATH_VOLUME*0.15)/(T20C*R_IDEAL_GAS_EQUATION))
|
||||
toxins_used = breath.toxins*available_ratio/6
|
||||
toxloss += 7*(1-available_ratio)
|
||||
else
|
||||
toxloss = max(toxloss-5, 0)
|
||||
toxins_used = breath.oxygen/6
|
||||
|
||||
breath.toxins -= toxins_used
|
||||
breath.oxygen += toxins_used
|
||||
handle_disabilities()
|
||||
|
||||
if(breath.temperature > (T0C+66))
|
||||
fire_alert = max(fire_alert, 1)
|
||||
|
||||
return 1
|
||||
|
||||
handle_environment(datum/gas_mixture/environment)
|
||||
if(!environment)
|
||||
return
|
||||
var/environment_heat_capacity = environment.heat_capacity()
|
||||
if(istype(loc, /turf/space))
|
||||
environment_heat_capacity = loc:heat_capacity
|
||||
|
||||
//If there are alien weeds on the ground then heal if needed or give some toxins
|
||||
if(locate(/obj/alien/weeds) in loc)
|
||||
if(health >= 100)
|
||||
toxloss += 2
|
||||
else
|
||||
health += 5
|
||||
|
||||
if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
|
||||
var/transfer_coefficient
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(head && (head.body_parts_covered & HEAD) && (environment.temperature < head.protective_temperature))
|
||||
transfer_coefficient *= head.heat_transfer_coefficient
|
||||
if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature))
|
||||
transfer_coefficient *= wear_mask.heat_transfer_coefficient
|
||||
if(wear_suit && (wear_suit.body_parts_covered & HEAD) && (environment.temperature < wear_suit.protective_temperature))
|
||||
transfer_coefficient *= wear_suit.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_suit && (wear_suit.body_parts_covered & UPPER_TORSO) && (environment.temperature < wear_suit.protective_temperature))
|
||||
transfer_coefficient *= wear_suit.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(UPPER_TORSO, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_suit && (wear_suit.body_parts_covered & LOWER_TORSO) && (environment.temperature < wear_suit.protective_temperature))
|
||||
transfer_coefficient *= wear_suit.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(LOWER_TORSO, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_suit && (wear_suit.body_parts_covered & LEGS) && (environment.temperature < wear_suit.protective_temperature))
|
||||
transfer_coefficient *= wear_suit.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(LEGS, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_suit && (wear_suit.body_parts_covered & ARMS) && (environment.temperature < wear_suit.protective_temperature))
|
||||
transfer_coefficient *= wear_suit.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(ARMS, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_suit && (wear_suit.body_parts_covered & HANDS) && (environment.temperature < wear_suit.protective_temperature))
|
||||
transfer_coefficient *= wear_suit.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(HANDS, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_suit && (wear_suit.body_parts_covered & FEET) && (environment.temperature < wear_suit.protective_temperature))
|
||||
transfer_coefficient *= wear_suit.heat_transfer_coefficient
|
||||
|
||||
handle_temperature_damage(FEET, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
|
||||
if(stat==2)
|
||||
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
|
||||
|
||||
//Account for massive pressure differences
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
|
||||
var/discomfort = abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000
|
||||
|
||||
switch(body_part)
|
||||
if(HEAD)
|
||||
TakeDamage("head", 0, 2.5*discomfort)
|
||||
if(UPPER_TORSO)
|
||||
TakeDamage("chest", 0, 2.5*discomfort)
|
||||
if(LOWER_TORSO)
|
||||
TakeDamage("groin", 0, 2.0*discomfort)
|
||||
if(LEGS)
|
||||
TakeDamage("l_leg", 0, 0.6*discomfort)
|
||||
TakeDamage("r_leg", 0, 0.6*discomfort)
|
||||
if(ARMS)
|
||||
TakeDamage("l_arm", 0, 0.4*discomfort)
|
||||
TakeDamage("r_arm", 0, 0.4*discomfort)
|
||||
if(FEET)
|
||||
TakeDamage("l_foot", 0, 0.25*discomfort)
|
||||
TakeDamage("r_foot", 0, 0.25*discomfort)
|
||||
if(HANDS)
|
||||
TakeDamage("l_hand", 0, 0.25*discomfort)
|
||||
TakeDamage("r_hand", 0, 0.25*discomfort)
|
||||
|
||||
handle_chemicals_in_body()
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_regular_status_updates()
|
||||
//No toxloss because aliens breathe in toxins
|
||||
health = 100 - (oxyloss + fireloss + bruteloss)
|
||||
|
||||
if(oxyloss > 25)
|
||||
paralysis = max(paralysis, 3)
|
||||
|
||||
if(health < -100)
|
||||
death()
|
||||
|
||||
return 1
|
||||
|
||||
handle_regular_hud_updates()
|
||||
//Aliens can't have internals
|
||||
if(internal)
|
||||
internals.icon_state = "internal1"
|
||||
else
|
||||
internals.icon_state = "internal0"
|
||||
//Aliens can breathe any atmosphere
|
||||
if(oxygen_alert > 0)
|
||||
oxygen_alert -= 1
|
||||
oxygen.icon_state = "oxy1"
|
||||
else
|
||||
oxygen.icon_state = "oxy0"
|
||||
//Aliens like toxins :)
|
||||
if(toxins_alert > 0)
|
||||
toxins_alert -= 1
|
||||
toxin.icon_state = "tox1"
|
||||
else
|
||||
toxin.icon_state = "tox0"
|
||||
//This makes sense, aliens hate fire
|
||||
if(fire_alert > 0)
|
||||
fire_alert -= 1
|
||||
fire.icon_state = "fire1"
|
||||
else
|
||||
fire.icon_state = "fire0"
|
||||
|
||||
return 1
|
||||
|
||||
//Should aliens have DNA?
|
||||
//Figure it out and come back here.
|
||||
//Nannek
|
||||
//As a note, the toxloss for radiation should be changed as the alien uses toxloss as a fuel
|
||||
|
||||
handle_random_events()
|
||||
return
|
||||
|
||||
/*
|
||||
if (src.radiation > 100)
|
||||
src.radiation = 100
|
||||
if ((prob(1) && (src.radiation >= 75)))
|
||||
randmutb(src)
|
||||
src << "\red High levels of Radiation cause you to spontaneously mutate."
|
||||
domutcheck(src,null)
|
||||
if ((prob(7) && (src.radiation >= 75)))
|
||||
if (src.paralysis < 3)
|
||||
src.paralysis = 3
|
||||
src << "\red You feel weak!"
|
||||
emote("collapse")
|
||||
src.updatehealth()
|
||||
src.radiation -= 5
|
||||
else if ((prob(7) && ((src.radiation > 50)&&(src.radiation < 75))))
|
||||
src.updatehealth()
|
||||
src.radiation -= 5
|
||||
emote("gasp")
|
||||
else
|
||||
if (prob(7) && (src.radiation > 1))
|
||||
if (src.radiation >= 10)
|
||||
src.radiation -= 10
|
||||
src.toxloss += 5
|
||||
src.updatehealth()
|
||||
else
|
||||
src.radiation = 0
|
||||
if (src.disabilities & 2)
|
||||
if ((prob(1) && src.paralysis < 10 && src.r_epil < 1))
|
||||
src << "\red You have a seizure!"
|
||||
@@ -271,87 +111,465 @@
|
||||
if (src.disabilities & 16)
|
||||
if (prob(10))
|
||||
src.stuttering = max(10, src.stuttering)
|
||||
if (prob(1) && prob(2))
|
||||
spawn(0)
|
||||
emote("sneeze")
|
||||
return
|
||||
*/
|
||||
|
||||
//This is fine for the alien
|
||||
update_mind()
|
||||
if(!mind && client)
|
||||
mind = new
|
||||
mind.current = src
|
||||
mind.assigned_role = "Hunter"
|
||||
mind.key = key
|
||||
|
||||
handle_mutations_and_radiation()
|
||||
|
||||
if(src.fireloss)
|
||||
if(src.mutations & COLD_RESISTANCE || prob(50))
|
||||
switch(src.fireloss)
|
||||
if(1 to 50)
|
||||
src.fireloss--
|
||||
if(51 to 100)
|
||||
src.fireloss -= 5
|
||||
|
||||
if (src.mutations & HULK && src.health <= 25)
|
||||
src.mutations &= ~HULK
|
||||
src << "\red You suddenly feel very weak."
|
||||
src.weakened = 3
|
||||
emote("collapse")
|
||||
|
||||
if (src.radiation)
|
||||
if (src.radiation > 100)
|
||||
src.radiation = 100
|
||||
src.weakened = 10
|
||||
src << "\red You feel weak."
|
||||
emote("collapse")
|
||||
|
||||
if (src.radiation < 0)
|
||||
src.radiation = 0
|
||||
|
||||
switch(src.radiation)
|
||||
if(1 to 49)
|
||||
src.radiation--
|
||||
if(prob(25))
|
||||
src.toxloss++
|
||||
src.updatehealth()
|
||||
|
||||
if(50 to 74)
|
||||
src.radiation -= 2
|
||||
src.toxloss++
|
||||
if(prob(5))
|
||||
src.radiation -= 5
|
||||
src.weakened = 3
|
||||
src << "\red You feel weak."
|
||||
emote("collapse")
|
||||
src.updatehealth()
|
||||
|
||||
if(75 to 100)
|
||||
src.radiation -= 3
|
||||
src.toxloss += 3
|
||||
if(prob(1))
|
||||
src << "\red You mutate!"
|
||||
randmutb(src)
|
||||
domutcheck(src,null)
|
||||
emote("gasp")
|
||||
src.updatehealth()
|
||||
|
||||
|
||||
breathe()
|
||||
if(src.reagents)
|
||||
if(src.reagents.has_reagent("lexorin")) return
|
||||
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/datum/air_group/breath
|
||||
// HACK NEED CHANGING LATER
|
||||
if(src.health < 0)
|
||||
src.losebreath++
|
||||
|
||||
if(losebreath>0) //Suffocating so do not take a breath
|
||||
src.losebreath--
|
||||
if (prob(75)) //High chance of gasping for air
|
||||
spawn emote("gasp")
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
else
|
||||
//First, check for air from internal atmosphere (using an air tank and mask generally)
|
||||
breath = get_breath_from_internal(BREATH_VOLUME)
|
||||
|
||||
//No breath from internal atmosphere so get breath from location
|
||||
if(!breath)
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
|
||||
else if(istype(loc, /turf/))
|
||||
var/breath_moles = 0
|
||||
/*if(environment.return_pressure() > ONE_ATMOSPHERE)
|
||||
// Loads of air around (pressure effects will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT)
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
handle_breath(breath)
|
||||
|
||||
if(breath)
|
||||
loc.assume_air(breath)
|
||||
|
||||
|
||||
get_breath_from_internal(volume_needed)
|
||||
if(internal)
|
||||
if (!contents.Find(src.internal))
|
||||
internal = null
|
||||
if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) )
|
||||
internal = null
|
||||
if(internal)
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal1"
|
||||
return internal.remove_air_volume(volume_needed)
|
||||
else
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal0"
|
||||
return null
|
||||
|
||||
update_canmove()
|
||||
if(paralysis || stunned || weakened || buckled) canmove = 0
|
||||
else canmove = 1
|
||||
|
||||
handle_breath(datum/gas_mixture/breath)
|
||||
if(src.nodamage)
|
||||
return
|
||||
|
||||
if(!breath || (breath.total_moles() == 0))
|
||||
//Aliens breathe in vaccuum
|
||||
return 0
|
||||
|
||||
var/toxins_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the toxins in our breath
|
||||
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect toxins in air
|
||||
|
||||
toxloss += breath.toxins*250
|
||||
toxins_alert = max(toxins_alert, 1)
|
||||
|
||||
toxins_used = breath.toxins
|
||||
|
||||
else
|
||||
toxins_alert = 0
|
||||
|
||||
//Breathe in toxins and out oxygen
|
||||
breath.toxins -= toxins_used
|
||||
breath.oxygen += toxins_used
|
||||
|
||||
if(breath.temperature > (T0C+66) && !(src.mutations & COLD_RESISTANCE)) // Hot air hurts :(
|
||||
if(prob(20))
|
||||
src << "\red You feel a searing heat in your lungs!"
|
||||
fire_alert = max(fire_alert, 1)
|
||||
else
|
||||
fire_alert = 0
|
||||
|
||||
//Temporary fixes to the alerts.
|
||||
|
||||
return 1
|
||||
|
||||
handle_environment()
|
||||
|
||||
//If there are alien weeds on the ground then heal if needed or give some toxins
|
||||
if(locate(/obj/alien/weeds) in loc)
|
||||
if(health >= 100)
|
||||
toxloss += 15
|
||||
if(toxloss > max_plasma)
|
||||
toxloss = max_plasma
|
||||
|
||||
else
|
||||
bruteloss -= 15
|
||||
fireloss -= 15
|
||||
|
||||
|
||||
|
||||
adjust_body_temperature(current, loc_temp, boost)
|
||||
var/temperature = current
|
||||
var/difference = abs(current-loc_temp) //get difference
|
||||
var/increments// = difference/10 //find how many increments apart they are
|
||||
if(difference > 50)
|
||||
increments = difference/5
|
||||
else
|
||||
increments = difference/10
|
||||
var/change = increments*boost // Get the amount to change by (x per increment)
|
||||
var/temp_change
|
||||
if(current < loc_temp)
|
||||
temperature = min(loc_temp, temperature+change)
|
||||
else if(current > loc_temp)
|
||||
temperature = max(loc_temp, temperature-change)
|
||||
temp_change = (temperature - current)
|
||||
return temp_change
|
||||
|
||||
get_thermal_protection()
|
||||
var/thermal_protection = 1.0
|
||||
//Handle normal clothing
|
||||
if(head && (head.body_parts_covered & HEAD))
|
||||
thermal_protection += 0.5
|
||||
if(wear_suit && (wear_suit.body_parts_covered & UPPER_TORSO))
|
||||
thermal_protection += 0.5
|
||||
if(wear_suit && (wear_suit.body_parts_covered & LEGS))
|
||||
thermal_protection += 0.2
|
||||
if(wear_suit && (wear_suit.body_parts_covered & ARMS))
|
||||
thermal_protection += 0.2
|
||||
if(wear_suit && (wear_suit.body_parts_covered & HANDS))
|
||||
thermal_protection += 0.2
|
||||
if(wear_suit && (wear_suit.flags & SUITSPACE))
|
||||
thermal_protection += 3
|
||||
if(src.mutations & COLD_RESISTANCE)
|
||||
thermal_protection += 5
|
||||
|
||||
return thermal_protection
|
||||
|
||||
add_fire_protection(var/temp)
|
||||
var/fire_prot = 0
|
||||
if(head)
|
||||
if(head.protective_temperature > temp)
|
||||
fire_prot += (head.protective_temperature/10)
|
||||
if(wear_mask)
|
||||
if(wear_mask.protective_temperature > temp)
|
||||
fire_prot += (wear_mask.protective_temperature/10)
|
||||
if(wear_suit)
|
||||
if(wear_suit.protective_temperature > temp)
|
||||
fire_prot += (wear_suit.protective_temperature/10)
|
||||
|
||||
|
||||
return fire_prot
|
||||
|
||||
handle_chemicals_in_body()
|
||||
|
||||
if(reagents) reagents.metabolize(src)
|
||||
|
||||
if(src.nutrition > 500 && !(src.mutations & FAT))
|
||||
if(prob(5 + round((src.nutrition - 200) / 2)))
|
||||
src << "\red You suddenly feel blubbery!"
|
||||
src.mutations |= FAT
|
||||
// update_body()
|
||||
if (src.nutrition < 100 && src.mutations & FAT)
|
||||
if(prob(round((50 - src.nutrition) / 100)))
|
||||
src << "\blue You feel fit again!"
|
||||
src.mutations &= ~FAT
|
||||
// update_body()
|
||||
if (src.nutrition > 0)
|
||||
src.nutrition -= HUNGER_FACTOR
|
||||
|
||||
if (src.drowsyness)
|
||||
src.drowsyness--
|
||||
src.eye_blurry = max(2, src.eye_blurry)
|
||||
if (prob(5))
|
||||
src.sleeping = 1
|
||||
src.paralysis = 5
|
||||
|
||||
confused = max(0, confused - 1)
|
||||
// decrement dizziness counter, clamped to 0
|
||||
if(resting)
|
||||
dizziness = max(0, dizziness - 5)
|
||||
jitteriness = max(0, jitteriness - 5)
|
||||
else
|
||||
dizziness = max(0, dizziness - 1)
|
||||
jitteriness = max(0, jitteriness - 1)
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
health = 100 - (oxyloss + fireloss + bruteloss + cloneloss)
|
||||
|
||||
if(oxyloss > 50) paralysis = max(paralysis, 3)
|
||||
|
||||
if(src.sleeping)
|
||||
src.paralysis = max(src.paralysis, 3)
|
||||
if (prob(10) && health) spawn(0) emote("snore")
|
||||
src.sleeping--
|
||||
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < -100 || src.brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(src.health < 0)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
if(!src.reagents.has_reagent("inaprovaline")) src.oxyloss++
|
||||
|
||||
if(src.stat != 2) src.stat = 1
|
||||
src.paralysis = max(src.paralysis, 5)
|
||||
|
||||
if (src.stat != 2) //Alive.
|
||||
|
||||
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
|
||||
if (src.stunned > 0)
|
||||
src.stunned--
|
||||
src.stat = 0
|
||||
if (src.weakened > 0)
|
||||
src.weakened--
|
||||
src.lying = 1
|
||||
src.stat = 0
|
||||
if (src.paralysis > 0)
|
||||
src.paralysis--
|
||||
src.blinded = 1
|
||||
src.lying = 1
|
||||
src.stat = 1
|
||||
var/h = src.hand
|
||||
src.hand = 0
|
||||
drop_item()
|
||||
src.hand = 1
|
||||
drop_item()
|
||||
src.hand = h
|
||||
|
||||
else //Not stunned.
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
|
||||
else //Dead.
|
||||
src.lying = 1
|
||||
src.blinded = 1
|
||||
src.stat = 2
|
||||
|
||||
if (src.stuttering) src.stuttering--
|
||||
|
||||
if (src.eye_blind)
|
||||
src.eye_blind--
|
||||
src.blinded = 1
|
||||
|
||||
if (src.ear_deaf > 0) src.ear_deaf--
|
||||
if (src.ear_damage < 25)
|
||||
src.ear_damage -= 0.05
|
||||
src.ear_damage = max(src.ear_damage, 0)
|
||||
|
||||
src.density = !( src.lying )
|
||||
|
||||
if ((src.sdisabilities & 1))
|
||||
src.blinded = 1
|
||||
if ((src.sdisabilities & 4))
|
||||
src.ear_deaf = 1
|
||||
|
||||
if (src.eye_blurry > 0)
|
||||
src.eye_blurry--
|
||||
src.eye_blurry = max(0, src.eye_blurry)
|
||||
|
||||
if (src.druggy > 0)
|
||||
src.druggy--
|
||||
src.druggy = max(0, src.druggy)
|
||||
|
||||
return 1
|
||||
|
||||
handle_regular_hud_updates()
|
||||
|
||||
if (src.stat == 2 || src.mutations & XRAY)
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
else if (src.stat != 2)
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight &= ~SEE_TURFS
|
||||
src.sight &= ~SEE_OBJS
|
||||
src.see_in_dark = 4
|
||||
src.see_invisible = 2
|
||||
|
||||
if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping)
|
||||
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
switch(health)
|
||||
if(100 to INFINITY)
|
||||
src.healths.icon_state = "health0"
|
||||
if(75 to 100)
|
||||
src.healths.icon_state = "health1"
|
||||
if(50 to 75)
|
||||
src.healths.icon_state = "health2"
|
||||
if(25 to 50)
|
||||
src.healths.icon_state = "health3"
|
||||
if(0 to 25)
|
||||
src.healths.icon_state = "health4"
|
||||
else
|
||||
src.healths.icon_state = "health5"
|
||||
else
|
||||
src.healths.icon_state = "health6"
|
||||
|
||||
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
|
||||
|
||||
|
||||
if (src.toxin) src.toxin.icon_state = "tox[src.toxins_alert ? 1 : 0]"
|
||||
if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
|
||||
if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
|
||||
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
|
||||
//blame the person who coded them. Temporary fix added.
|
||||
|
||||
src.client.screen -= src.hud_used.blurry
|
||||
src.client.screen -= src.hud_used.druggy
|
||||
src.client.screen -= src.hud_used.vimpaired
|
||||
|
||||
if ((src.blind && src.stat != 2))
|
||||
if ((src.blinded))
|
||||
src.blind.layer = 18
|
||||
else
|
||||
src.blind.layer = 0
|
||||
|
||||
if (src.disabilities & 1)
|
||||
src.client.screen += src.hud_used.vimpaired
|
||||
|
||||
if (src.eye_blurry)
|
||||
src.client.screen += src.hud_used.blurry
|
||||
|
||||
if (src.druggy)
|
||||
src.client.screen += src.hud_used.druggy
|
||||
|
||||
if (src.stat != 2)
|
||||
if (src.machine)
|
||||
if (!( src.machine.check_eye(src) ))
|
||||
src.reset_view(null)
|
||||
else
|
||||
if(!client.adminobs)
|
||||
reset_view(null)
|
||||
|
||||
return 1
|
||||
|
||||
handle_virus_updates()
|
||||
if(src.bodytemperature > 406)
|
||||
src.virus.cure()
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure()
|
||||
return
|
||||
|
||||
if(!src.virus)
|
||||
if(prob(40))
|
||||
for(var/mob/living/carbon/M in range(4, src))
|
||||
if(M.virus && M.virus.spread == "Airborne")
|
||||
if(M.virus.affected_species.Find("Alien"))
|
||||
if(M.virus.type in src.resistances)
|
||||
continue
|
||||
src.contract_disease(new M.virus.type)
|
||||
for(var/obj/decal/cleanable/blood/B in range(4, src))
|
||||
if(B.virus && B.virus.spread == "Airborne")
|
||||
if(B.virus.affected_species.Find("Alien"))
|
||||
if(B.virus.type in src.resistances)
|
||||
continue
|
||||
src.contract_disease(new B.virus.type)
|
||||
for(var/obj/decal/cleanable/xenoblood/X in range(4, src))
|
||||
if(X.virus && X.virus.spread == "Airborne")
|
||||
if(X.virus.affected_species.Find("Alien"))
|
||||
if(X.virus.type in src.resistances)
|
||||
continue
|
||||
src.contract_disease(new X.virus.type)
|
||||
check_if_buckled()
|
||||
if (src.buckled)
|
||||
src.lying = (istype(src.buckled, /obj/stool/bed) ? 1 : 0)
|
||||
if(src.lying)
|
||||
src.drop_item()
|
||||
src.density = 1
|
||||
else
|
||||
src.virus.stage_act()
|
||||
/*
|
||||
snippets
|
||||
src.density = !src.lying
|
||||
|
||||
if (src.mach)
|
||||
if (src.machine)
|
||||
src.mach.icon_state = "mach1"
|
||||
else
|
||||
src.mach.icon_state = null
|
||||
|
||||
if (!src.m_flag)
|
||||
src.moved_recently = 0
|
||||
src.m_flag = null
|
||||
|
||||
|
||||
|
||||
if ((istype(src.loc, /turf/space) && !( locate(/obj/movable, src.loc) )))
|
||||
var/layers = 20
|
||||
// ******* Check
|
||||
if (((istype(src.head, /obj/item/clothing/head) && src.head.flags & 4) || (istype(src.wear_mask, /obj/item/clothing/mask) && (!( src.wear_mask.flags & 4 ) && src.wear_mask.flags & 8))))
|
||||
layers -= 5
|
||||
if (istype(src.w_uniform, /obj/item/clothing/under))
|
||||
layers -= 5
|
||||
if ((istype(src.wear_suit, /obj/item/clothing/suit) && src.wear_suit.flags & 8))
|
||||
layers -= 10
|
||||
if (layers > oxcheck)
|
||||
oxcheck = layers
|
||||
|
||||
|
||||
if(src.bodytemperature < 282.591 && (!src.firemut))
|
||||
if(src.bodytemperature < 250)
|
||||
src.fireloss += 4
|
||||
src.updatehealth()
|
||||
if(src.paralysis <= 2) src.paralysis += 2
|
||||
else if(prob(1) && !src.paralysis)
|
||||
if(src.paralysis <= 5) src.paralysis += 5
|
||||
emote("collapse")
|
||||
src << "\red You collapse from the cold!"
|
||||
if(src.bodytemperature > 327.444 && (!src.firemut))
|
||||
if(src.bodytemperature > 345.444)
|
||||
if(!src.eye_blurry) src << "\red The heat blurs your vision!"
|
||||
src.eye_blurry = max(4, src.eye_blurry)
|
||||
if(prob(3)) src.fireloss += rand(1,2)
|
||||
else if(prob(3) && !src.paralysis)
|
||||
src.paralysis += 2
|
||||
emote("collapse")
|
||||
src << "\red You collapse from heat exaustion!"
|
||||
plcheck = src.t_plasma
|
||||
oxcheck = src.t_oxygen
|
||||
G.turf_add(T, G.total_moles())
|
||||
*/
|
||||
handle_stomach()
|
||||
spawn(0)
|
||||
for(var/mob/M in stomach_contents)
|
||||
if(M.loc != src)
|
||||
stomach_contents.Remove(M)
|
||||
continue
|
||||
if(istype(M, /mob/living/carbon) && src.stat != 2)
|
||||
if(M.stat == 2)
|
||||
M.death(1)
|
||||
stomach_contents.Remove(M)
|
||||
del(M)
|
||||
continue
|
||||
if(air_master.current_cycle%3==1)
|
||||
if(!M.nodamage)
|
||||
M.bruteloss += 5
|
||||
src.nutrition += 10
|
||||
|
||||
@@ -1,575 +0,0 @@
|
||||
/mob/living/carbon/alien/humanoid
|
||||
var
|
||||
oxygen_alert = 0
|
||||
toxins_alert = 0
|
||||
fire_alert = 0
|
||||
|
||||
temperature_alert = 0
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
|
||||
if (src.monkeyizing)
|
||||
return
|
||||
|
||||
if (src.stat != 2) //still breathing
|
||||
|
||||
//First, resolve location and get a breath
|
||||
|
||||
if(air_master.current_cycle%4==2)
|
||||
//Only try to take a breath every 4 seconds, unless suffocating
|
||||
spawn(0) breathe()
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
//Apparently, the person who wrote this code designed it so that
|
||||
//blinded get reset each cycle and then get activated later in the
|
||||
//code. Very ugly. I dont care. Moving this stuff here so its easy
|
||||
//to find it.
|
||||
src.blinded = null
|
||||
|
||||
//Disease Check
|
||||
handle_virus_updates()
|
||||
|
||||
//Update mind
|
||||
update_mind()
|
||||
|
||||
//Handle temperature/pressure differences between body and environment
|
||||
handle_environment()
|
||||
|
||||
//Mutations and radiation
|
||||
handle_mutations_and_radiation()
|
||||
|
||||
//Chemicals in the body
|
||||
handle_chemicals_in_body()
|
||||
|
||||
//stuff in the stomach
|
||||
handle_stomach()
|
||||
|
||||
//Disabilities
|
||||
handle_disabilities()
|
||||
|
||||
//Status updates, death etc.
|
||||
handle_regular_status_updates()
|
||||
|
||||
// Update clothing
|
||||
update_clothing()
|
||||
|
||||
if(client)
|
||||
handle_regular_hud_updates()
|
||||
|
||||
//Being buckled to a chair or bed
|
||||
check_if_buckled()
|
||||
|
||||
// Yup.
|
||||
update_canmove()
|
||||
|
||||
clamp_values()
|
||||
|
||||
// Grabbing
|
||||
for(var/obj/item/weapon/grab/G in src)
|
||||
G.process()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid
|
||||
proc
|
||||
clamp_values()
|
||||
|
||||
stunned = max(min(stunned, 20),0)
|
||||
paralysis = max(min(paralysis, 20), 0)
|
||||
weakened = max(min(weakened, 20), 0)
|
||||
sleeping = max(min(sleeping, 20), 0)
|
||||
bruteloss = max(bruteloss, 0)
|
||||
toxloss = max(toxloss, 0)
|
||||
oxyloss = max(oxyloss, 0)
|
||||
fireloss = max(fireloss, 0)
|
||||
|
||||
|
||||
handle_disabilities()
|
||||
|
||||
if (src.disabilities & 2)
|
||||
if ((prob(1) && src.paralysis < 10 && src.r_epil < 1))
|
||||
src << "\red You have a seizure!"
|
||||
src.paralysis = max(10, src.paralysis)
|
||||
if (src.disabilities & 4)
|
||||
if ((prob(5) && src.paralysis <= 1 && src.r_ch_cou < 1))
|
||||
src.drop_item()
|
||||
spawn( 0 )
|
||||
emote("cough")
|
||||
return
|
||||
if (src.disabilities & 8)
|
||||
if ((prob(10) && src.paralysis <= 1 && src.r_Tourette < 1))
|
||||
src.stunned = max(10, src.stunned)
|
||||
spawn( 0 )
|
||||
emote("twitch")
|
||||
return
|
||||
if (src.disabilities & 16)
|
||||
if (prob(10))
|
||||
src.stuttering = max(10, src.stuttering)
|
||||
|
||||
update_mind()
|
||||
if(!mind && client)
|
||||
mind = new
|
||||
mind.current = src
|
||||
mind.assigned_role = "Hunter"
|
||||
mind.key = key
|
||||
|
||||
handle_mutations_and_radiation()
|
||||
|
||||
if(src.fireloss)
|
||||
if(src.mutations & COLD_RESISTANCE || prob(50))
|
||||
switch(src.fireloss)
|
||||
if(1 to 50)
|
||||
src.fireloss--
|
||||
if(51 to 100)
|
||||
src.fireloss -= 5
|
||||
|
||||
if (src.mutations & HULK && src.health <= 25)
|
||||
src.mutations &= ~HULK
|
||||
src << "\red You suddenly feel very weak."
|
||||
src.weakened = 3
|
||||
emote("collapse")
|
||||
|
||||
if (src.radiation)
|
||||
if (src.radiation > 100)
|
||||
src.radiation = 100
|
||||
src.weakened = 10
|
||||
src << "\red You feel weak."
|
||||
emote("collapse")
|
||||
|
||||
if (src.radiation < 0)
|
||||
src.radiation = 0
|
||||
|
||||
switch(src.radiation)
|
||||
if(1 to 49)
|
||||
src.radiation--
|
||||
if(prob(25))
|
||||
src.toxloss++
|
||||
src.updatehealth()
|
||||
|
||||
if(50 to 74)
|
||||
src.radiation -= 2
|
||||
src.toxloss++
|
||||
if(prob(5))
|
||||
src.radiation -= 5
|
||||
src.weakened = 3
|
||||
src << "\red You feel weak."
|
||||
emote("collapse")
|
||||
src.updatehealth()
|
||||
|
||||
if(75 to 100)
|
||||
src.radiation -= 3
|
||||
src.toxloss += 3
|
||||
if(prob(1))
|
||||
src << "\red You mutate!"
|
||||
randmutb(src)
|
||||
domutcheck(src,null)
|
||||
emote("gasp")
|
||||
src.updatehealth()
|
||||
|
||||
|
||||
breathe()
|
||||
if(src.reagents)
|
||||
if(src.reagents.has_reagent("lexorin")) return
|
||||
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/datum/air_group/breath
|
||||
// HACK NEED CHANGING LATER
|
||||
if(src.health < 0)
|
||||
src.losebreath++
|
||||
|
||||
if(losebreath>0) //Suffocating so do not take a breath
|
||||
src.losebreath--
|
||||
if (prob(75)) //High chance of gasping for air
|
||||
spawn emote("gasp")
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
else
|
||||
//First, check for air from internal atmosphere (using an air tank and mask generally)
|
||||
breath = get_breath_from_internal(BREATH_VOLUME)
|
||||
|
||||
//No breath from internal atmosphere so get breath from location
|
||||
if(!breath)
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
|
||||
else if(istype(loc, /turf/))
|
||||
var/breath_moles = 0
|
||||
/*if(environment.return_pressure() > ONE_ATMOSPHERE)
|
||||
// Loads of air around (pressure effects will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT)
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
else //Still give containing object the chance to interact
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/location_as_object = loc
|
||||
location_as_object.handle_internal_lifeform(src, 0)
|
||||
|
||||
handle_breath(breath)
|
||||
|
||||
if(breath)
|
||||
loc.assume_air(breath)
|
||||
|
||||
|
||||
get_breath_from_internal(volume_needed)
|
||||
if(internal)
|
||||
if (!contents.Find(src.internal))
|
||||
internal = null
|
||||
if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) )
|
||||
internal = null
|
||||
if(internal)
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal1"
|
||||
return internal.remove_air_volume(volume_needed)
|
||||
else
|
||||
if (src.internals)
|
||||
src.internals.icon_state = "internal0"
|
||||
return null
|
||||
|
||||
update_canmove()
|
||||
if(paralysis || stunned || weakened || buckled) canmove = 0
|
||||
else canmove = 1
|
||||
|
||||
handle_breath(datum/gas_mixture/breath)
|
||||
if(src.nodamage)
|
||||
return
|
||||
|
||||
if(!breath || (breath.total_moles() == 0))
|
||||
//Aliens breathe in vaccuum
|
||||
return 0
|
||||
|
||||
var/toxins_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the toxins in our breath
|
||||
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect toxins in air
|
||||
|
||||
toxloss += breath.toxins*250
|
||||
toxins_alert = max(toxins_alert, 1)
|
||||
|
||||
toxins_used = breath.toxins
|
||||
|
||||
else
|
||||
toxins_alert = 0
|
||||
|
||||
//Breathe in toxins and out oxygen
|
||||
breath.toxins -= toxins_used
|
||||
breath.oxygen += toxins_used
|
||||
|
||||
if(breath.temperature > (T0C+66) && !(src.mutations & COLD_RESISTANCE)) // Hot air hurts :(
|
||||
if(prob(20))
|
||||
src << "\red You feel a searing heat in your lungs!"
|
||||
fire_alert = max(fire_alert, 1)
|
||||
else
|
||||
fire_alert = 0
|
||||
|
||||
//Temporary fixes to the alerts.
|
||||
|
||||
return 1
|
||||
|
||||
handle_environment()
|
||||
|
||||
//If there are alien weeds on the ground then heal if needed or give some toxins
|
||||
if(locate(/obj/alien/weeds) in loc)
|
||||
if(health >= 100)
|
||||
toxloss += 15
|
||||
if(toxloss > max_plasma)
|
||||
toxloss = max_plasma
|
||||
|
||||
else
|
||||
bruteloss -= 15
|
||||
fireloss -= 15
|
||||
|
||||
|
||||
|
||||
adjust_body_temperature(current, loc_temp, boost)
|
||||
var/temperature = current
|
||||
var/difference = abs(current-loc_temp) //get difference
|
||||
var/increments// = difference/10 //find how many increments apart they are
|
||||
if(difference > 50)
|
||||
increments = difference/5
|
||||
else
|
||||
increments = difference/10
|
||||
var/change = increments*boost // Get the amount to change by (x per increment)
|
||||
var/temp_change
|
||||
if(current < loc_temp)
|
||||
temperature = min(loc_temp, temperature+change)
|
||||
else if(current > loc_temp)
|
||||
temperature = max(loc_temp, temperature-change)
|
||||
temp_change = (temperature - current)
|
||||
return temp_change
|
||||
|
||||
get_thermal_protection()
|
||||
var/thermal_protection = 1.0
|
||||
//Handle normal clothing
|
||||
if(head && (head.body_parts_covered & HEAD))
|
||||
thermal_protection += 0.5
|
||||
if(wear_suit && (wear_suit.body_parts_covered & UPPER_TORSO))
|
||||
thermal_protection += 0.5
|
||||
if(wear_suit && (wear_suit.body_parts_covered & LEGS))
|
||||
thermal_protection += 0.2
|
||||
if(wear_suit && (wear_suit.body_parts_covered & ARMS))
|
||||
thermal_protection += 0.2
|
||||
if(wear_suit && (wear_suit.body_parts_covered & HANDS))
|
||||
thermal_protection += 0.2
|
||||
if(wear_suit && (wear_suit.flags & SUITSPACE))
|
||||
thermal_protection += 3
|
||||
if(src.mutations & COLD_RESISTANCE)
|
||||
thermal_protection += 5
|
||||
|
||||
return thermal_protection
|
||||
|
||||
add_fire_protection(var/temp)
|
||||
var/fire_prot = 0
|
||||
if(head)
|
||||
if(head.protective_temperature > temp)
|
||||
fire_prot += (head.protective_temperature/10)
|
||||
if(wear_mask)
|
||||
if(wear_mask.protective_temperature > temp)
|
||||
fire_prot += (wear_mask.protective_temperature/10)
|
||||
if(wear_suit)
|
||||
if(wear_suit.protective_temperature > temp)
|
||||
fire_prot += (wear_suit.protective_temperature/10)
|
||||
|
||||
|
||||
return fire_prot
|
||||
|
||||
handle_chemicals_in_body()
|
||||
|
||||
if(reagents) reagents.metabolize(src)
|
||||
|
||||
if(src.nutrition > 500 && !(src.mutations & FAT))
|
||||
if(prob(5 + round((src.nutrition - 200) / 2)))
|
||||
src << "\red You suddenly feel blubbery!"
|
||||
src.mutations |= FAT
|
||||
// update_body()
|
||||
if (src.nutrition < 100 && src.mutations & FAT)
|
||||
if(prob(round((50 - src.nutrition) / 100)))
|
||||
src << "\blue You feel fit again!"
|
||||
src.mutations &= ~FAT
|
||||
// update_body()
|
||||
if (src.nutrition > 0)
|
||||
src.nutrition -= HUNGER_FACTOR
|
||||
|
||||
if (src.drowsyness)
|
||||
src.drowsyness--
|
||||
src.eye_blurry = max(2, src.eye_blurry)
|
||||
if (prob(5))
|
||||
src.sleeping = 1
|
||||
src.paralysis = 5
|
||||
|
||||
confused = max(0, confused - 1)
|
||||
// decrement dizziness counter, clamped to 0
|
||||
if(resting)
|
||||
dizziness = max(0, dizziness - 5)
|
||||
jitteriness = max(0, jitteriness - 5)
|
||||
else
|
||||
dizziness = max(0, dizziness - 1)
|
||||
jitteriness = max(0, jitteriness - 1)
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
health = 100 - (oxyloss + fireloss + bruteloss + cloneloss)
|
||||
|
||||
if(oxyloss > 50) paralysis = max(paralysis, 3)
|
||||
|
||||
if(src.sleeping)
|
||||
src.paralysis = max(src.paralysis, 3)
|
||||
if (prob(10) && health) spawn(0) emote("snore")
|
||||
src.sleeping--
|
||||
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < -100 || src.brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(src.health < 0)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
if(!src.reagents.has_reagent("inaprovaline")) src.oxyloss++
|
||||
|
||||
if(src.stat != 2) src.stat = 1
|
||||
src.paralysis = max(src.paralysis, 5)
|
||||
|
||||
if (src.stat != 2) //Alive.
|
||||
|
||||
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
|
||||
if (src.stunned > 0)
|
||||
src.stunned--
|
||||
src.stat = 0
|
||||
if (src.weakened > 0)
|
||||
src.weakened--
|
||||
src.lying = 1
|
||||
src.stat = 0
|
||||
if (src.paralysis > 0)
|
||||
src.paralysis--
|
||||
src.blinded = 1
|
||||
src.lying = 1
|
||||
src.stat = 1
|
||||
var/h = src.hand
|
||||
src.hand = 0
|
||||
drop_item()
|
||||
src.hand = 1
|
||||
drop_item()
|
||||
src.hand = h
|
||||
|
||||
else //Not stunned.
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
|
||||
else //Dead.
|
||||
src.lying = 1
|
||||
src.blinded = 1
|
||||
src.stat = 2
|
||||
|
||||
if (src.stuttering) src.stuttering--
|
||||
|
||||
if (src.eye_blind)
|
||||
src.eye_blind--
|
||||
src.blinded = 1
|
||||
|
||||
if (src.ear_deaf > 0) src.ear_deaf--
|
||||
if (src.ear_damage < 25)
|
||||
src.ear_damage -= 0.05
|
||||
src.ear_damage = max(src.ear_damage, 0)
|
||||
|
||||
src.density = !( src.lying )
|
||||
|
||||
if ((src.sdisabilities & 1))
|
||||
src.blinded = 1
|
||||
if ((src.sdisabilities & 4))
|
||||
src.ear_deaf = 1
|
||||
|
||||
if (src.eye_blurry > 0)
|
||||
src.eye_blurry--
|
||||
src.eye_blurry = max(0, src.eye_blurry)
|
||||
|
||||
if (src.druggy > 0)
|
||||
src.druggy--
|
||||
src.druggy = max(0, src.druggy)
|
||||
|
||||
return 1
|
||||
|
||||
handle_regular_hud_updates()
|
||||
|
||||
if (src.stat == 2 || src.mutations & XRAY)
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
else if (src.stat != 2)
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight &= ~SEE_TURFS
|
||||
src.sight &= ~SEE_OBJS
|
||||
src.see_in_dark = 4
|
||||
src.see_invisible = 2
|
||||
|
||||
if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping)
|
||||
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
switch(health)
|
||||
if(100 to INFINITY)
|
||||
src.healths.icon_state = "health0"
|
||||
if(75 to 100)
|
||||
src.healths.icon_state = "health1"
|
||||
if(50 to 75)
|
||||
src.healths.icon_state = "health2"
|
||||
if(25 to 50)
|
||||
src.healths.icon_state = "health3"
|
||||
if(0 to 25)
|
||||
src.healths.icon_state = "health4"
|
||||
else
|
||||
src.healths.icon_state = "health5"
|
||||
else
|
||||
src.healths.icon_state = "health6"
|
||||
|
||||
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
|
||||
|
||||
|
||||
if (src.toxin) src.toxin.icon_state = "tox[src.toxins_alert ? 1 : 0]"
|
||||
if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
|
||||
if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
|
||||
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
|
||||
//blame the person who coded them. Temporary fix added.
|
||||
|
||||
src.client.screen -= src.hud_used.blurry
|
||||
src.client.screen -= src.hud_used.druggy
|
||||
src.client.screen -= src.hud_used.vimpaired
|
||||
|
||||
if ((src.blind && src.stat != 2))
|
||||
if ((src.blinded))
|
||||
src.blind.layer = 18
|
||||
else
|
||||
src.blind.layer = 0
|
||||
|
||||
if (src.disabilities & 1)
|
||||
src.client.screen += src.hud_used.vimpaired
|
||||
|
||||
if (src.eye_blurry)
|
||||
src.client.screen += src.hud_used.blurry
|
||||
|
||||
if (src.druggy)
|
||||
src.client.screen += src.hud_used.druggy
|
||||
|
||||
if (src.stat != 2)
|
||||
if (src.machine)
|
||||
if (!( src.machine.check_eye(src) ))
|
||||
src.reset_view(null)
|
||||
else
|
||||
if(!client.adminobs)
|
||||
reset_view(null)
|
||||
|
||||
return 1
|
||||
|
||||
handle_virus_updates()
|
||||
if(src.bodytemperature > 406)
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure()
|
||||
return
|
||||
|
||||
check_if_buckled()
|
||||
if (src.buckled)
|
||||
src.lying = (istype(src.buckled, /obj/stool/bed) ? 1 : 0)
|
||||
if(src.lying)
|
||||
src.drop_item()
|
||||
src.density = 1
|
||||
else
|
||||
src.density = !src.lying
|
||||
|
||||
handle_stomach()
|
||||
spawn(0)
|
||||
for(var/mob/M in stomach_contents)
|
||||
if(M.loc != src)
|
||||
stomach_contents.Remove(M)
|
||||
continue
|
||||
if(istype(M, /mob/living/carbon) && src.stat != 2)
|
||||
if(M.stat == 2)
|
||||
M.death(1)
|
||||
stomach_contents.Remove(M)
|
||||
del(M)
|
||||
continue
|
||||
if(air_master.current_cycle%3==1)
|
||||
if(!M.nodamage)
|
||||
M.bruteloss += 5
|
||||
src.nutrition += 10
|
||||
@@ -1 +0,0 @@
|
||||
mob/living/carbon/beast
|
||||
@@ -1,15 +0,0 @@
|
||||
datum/bodypart
|
||||
var
|
||||
name = "unidentified bodypart"
|
||||
health = 50
|
||||
|
||||
datum/bodypart/body
|
||||
health = 100
|
||||
|
||||
datum/bodypart/head
|
||||
health = 30
|
||||
|
||||
datum/bodypart/limb
|
||||
|
||||
datum/bodypart/tail
|
||||
health = 15
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
var/mob/dead/phantasm/P = new (src.loc)
|
||||
for(var/obj/O in src.contents) // Where src is a mob
|
||||
if(istype(O, /obj/item)) // Only remember carried items (sanity checking, mostly)
|
||||
src.u_equip(O) // Unequip the item if we're wearing it
|
||||
if (src.client)
|
||||
src.client.screen -= O // Clear out any overlays the item added, notably in the equip windows
|
||||
O.loc = src.loc // Honestly not sure if these two steps are necessary
|
||||
O.dropped(src) // but they seem to occur everywhere else in the code, so we're not taking any chances.
|
||||
O.layer = initial(O.layer)
|
||||
O.loc = P // Add the item to the phantasm's inventory
|
||||
src.Death(0)
|
||||
*/
|
||||
@@ -32,8 +32,6 @@
|
||||
verbs += /mob/living/silicon/ai/proc/ai_camera_list
|
||||
//Added ai_network_change by Mord_Sith
|
||||
verbs += /mob/living/silicon/ai/proc/ai_network_change
|
||||
verbs += /mob/living/silicon/ai/proc/lockdown
|
||||
verbs += /mob/living/silicon/ai/proc/disablelockdown
|
||||
verbs += /mob/living/silicon/ai/proc/ai_statuschange
|
||||
//Hologram verb./N
|
||||
verbs += /mob/living/silicon/ai/proc/ai_hologram_change
|
||||
@@ -188,12 +186,10 @@
|
||||
|
||||
/mob/living/silicon/ai/emp_act(severity)
|
||||
if (prob(30))
|
||||
switch(pick(1,2,3)) //Add Random laws.
|
||||
switch(pick(1,2))
|
||||
if(1)
|
||||
cancel_camera()
|
||||
if(2)
|
||||
lockdown()
|
||||
if(3)
|
||||
ai_call_shuttle()
|
||||
..()
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/mob/living/silicon/hivebot/death(gibbed)
|
||||
if(src.mainframe)
|
||||
src.mainframe.return_to(src)
|
||||
src.stat = 2
|
||||
src.canmove = 0
|
||||
|
||||
if(src.blind)
|
||||
src.blind.layer = 0
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
src.updateicon()
|
||||
|
||||
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
|
||||
store_memory("Time of death: [tod]", 0)
|
||||
|
||||
if (src.key)
|
||||
spawn(50)
|
||||
if(src.key && src.stat == 2)
|
||||
src.verbs += /mob/proc/ghost
|
||||
return ..(gibbed)
|
||||
@@ -1,140 +0,0 @@
|
||||
/mob/living/silicon/hivebot/emote(var/act)
|
||||
var/param = null
|
||||
if (findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
param = copytext(act, t1 + 1, length(act) + 1)
|
||||
act = copytext(act, 1, t1)
|
||||
var/m_type = 1
|
||||
var/message
|
||||
|
||||
switch(act)
|
||||
if ("salute")
|
||||
if (!src.buckled)
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> salutes to [param]."
|
||||
else
|
||||
message = "<B>[src]</b> salutes."
|
||||
m_type = 1
|
||||
if ("bow")
|
||||
if (!src.buckled)
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> bows to [param]."
|
||||
else
|
||||
message = "<B>[src]</B> bows."
|
||||
m_type = 1
|
||||
|
||||
if ("clap")
|
||||
if (!src.restrained())
|
||||
message = "<B>[src]</B> claps."
|
||||
m_type = 2
|
||||
if ("flap")
|
||||
if (!src.restrained())
|
||||
message = "<B>[src]</B> flaps his wings."
|
||||
m_type = 2
|
||||
|
||||
if ("aflap")
|
||||
if (!src.restrained())
|
||||
message = "<B>[src]</B> flaps his wings ANGRILY!"
|
||||
m_type = 2
|
||||
|
||||
if ("custom")
|
||||
var/input = input("Choose an emote to display.") as text|null
|
||||
if (!input)
|
||||
return
|
||||
input = sanitize(input)
|
||||
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
|
||||
if (input2 == "Visible")
|
||||
m_type = 1
|
||||
else if (input2 == "Hearable")
|
||||
m_type = 2
|
||||
else
|
||||
alert("Unable to use this emote, must be either hearable or visible.")
|
||||
return
|
||||
message = "<B>[src]</B> [input]"
|
||||
|
||||
if ("twitch")
|
||||
message = "<B>[src]</B> twitches violently."
|
||||
m_type = 1
|
||||
|
||||
if ("twitch_s")
|
||||
message = "<B>[src]</B> twitches."
|
||||
m_type = 1
|
||||
|
||||
if ("nod")
|
||||
message = "<B>[src]</B> nods."
|
||||
m_type = 1
|
||||
|
||||
if ("glare")
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> glares at [param]."
|
||||
else
|
||||
message = "<B>[src]</B> glares."
|
||||
|
||||
if ("stare")
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> stares at [param]."
|
||||
else
|
||||
message = "<B>[src]</B> stares."
|
||||
|
||||
if ("look")
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> looks at [param]."
|
||||
else
|
||||
message = "<B>[src]</B> looks."
|
||||
m_type = 1
|
||||
else
|
||||
src << text("Invalid Emote: []", act)
|
||||
if ((message && src.stat == 0))
|
||||
if (m_type & 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
else
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
return
|
||||
@@ -1,20 +0,0 @@
|
||||
/mob/living/silicon/hivebot/examine()
|
||||
set src in oview()
|
||||
|
||||
usr << "\blue *---------*"
|
||||
usr << text("\blue This is \icon[src] <B>[src.name]</B>!")
|
||||
if (src.stat == 2)
|
||||
usr << text("\red [src.name] is powered-down.")
|
||||
if (src.bruteloss)
|
||||
if (src.bruteloss < 75)
|
||||
usr << text("\red [src.name] looks slightly dented")
|
||||
else
|
||||
usr << text("\red <B>[src.name] looks severely dented!</B>")
|
||||
if (src.fireloss)
|
||||
if (src.fireloss < 75)
|
||||
usr << text("\red [src.name] looks slightly burnt!")
|
||||
else
|
||||
usr << text("\red <B>[src.name] looks severely burnt!</B>")
|
||||
if (src.stat == 1)
|
||||
usr << text("\red [src.name] doesn't seem to be responding.")
|
||||
return
|
||||
@@ -1,57 +0,0 @@
|
||||
/obj/item/weapon/hive_module
|
||||
name = "hive robot module"
|
||||
icon = 'module.dmi'
|
||||
icon_state = "std_module"
|
||||
w_class = 2.0
|
||||
item_state = "electronic"
|
||||
flags = FPRINT|TABLEPASS | CONDUCT
|
||||
var/list/modules = list()
|
||||
|
||||
/obj/item/weapon/hive_module/standard
|
||||
name = "give standard robot module"
|
||||
|
||||
/obj/item/weapon/hive_module/engineering
|
||||
name = "HiveBot engineering robot module"
|
||||
|
||||
/obj/item/weapon/hive_module/New()//Shit all the mods have
|
||||
src.modules += new /obj/item/device/flash(src)
|
||||
|
||||
|
||||
/obj/item/weapon/hive_module/standard/New()
|
||||
..()
|
||||
src.modules += new /obj/item/weapon/melee/baton(src)
|
||||
src.modules += new /obj/item/weapon/extinguisher(src)
|
||||
//var/obj/item/weapon/gun/mp5/M = new /obj/item/weapon/gun/mp5(src)
|
||||
//M.weapon_lock = 0
|
||||
//src.modules += M
|
||||
|
||||
|
||||
/obj/item/weapon/hive_module/engineering/New()
|
||||
|
||||
src.modules += new /obj/item/weapon/extinguisher(src)
|
||||
src.modules += new /obj/item/weapon/screwdriver(src)
|
||||
src.modules += new /obj/item/weapon/weldingtool(src)
|
||||
src.modules += new /obj/item/weapon/wrench(src)
|
||||
src.modules += new /obj/item/device/analyzer(src)
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
|
||||
var/obj/item/weapon/rcd/R = new /obj/item/weapon/rcd(src)
|
||||
R.matter = 30
|
||||
src.modules += R
|
||||
|
||||
src.modules += new /obj/item/device/t_scanner(src)
|
||||
src.modules += new /obj/item/weapon/crowbar(src)
|
||||
src.modules += new /obj/item/weapon/wirecutters(src)
|
||||
src.modules += new /obj/item/device/multitool(src)
|
||||
|
||||
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(src)
|
||||
M.amount = 50
|
||||
src.modules += M
|
||||
|
||||
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass(src)
|
||||
G.amount = 50
|
||||
src.modules += G
|
||||
|
||||
var/obj/item/weapon/cable_coil/W = new /obj/item/weapon/cable_coil(src)
|
||||
W.amount = 50
|
||||
src.modules += W
|
||||
@@ -1,506 +0,0 @@
|
||||
/mob/living/silicon/hivebot/New(loc,mainframe)
|
||||
src << "\blue Your icons have been generated!"
|
||||
updateicon()
|
||||
|
||||
if(mainframe)
|
||||
dependent = 1
|
||||
src.real_name = mainframe:name
|
||||
src.name = src.real_name
|
||||
else
|
||||
src.real_name = "Robot [pick(rand(1, 999))]"
|
||||
src.name = src.real_name
|
||||
|
||||
src.radio = new /obj/item/device/radio(src)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/pick_module()
|
||||
if(src.module)
|
||||
return
|
||||
var/mod = input("Please, select a module!", "Robot", null, null) in list("Combat", "Engineering")
|
||||
if(src.module)
|
||||
return
|
||||
switch(mod)
|
||||
if("Combat")
|
||||
src.module = new /obj/item/weapon/hive_module/standard(src)
|
||||
|
||||
if("Engineering")
|
||||
src.module = new /obj/item/weapon/hive_module/engineering(src)
|
||||
|
||||
|
||||
src.hands.icon_state = "malf"
|
||||
updateicon()
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/blob_act()
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 60
|
||||
src.updatehealth()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
if (src.client.statpanel == "Status")
|
||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
||||
var/timeleft = emergency_shuttle.timeleft()
|
||||
if (timeleft)
|
||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||
/*
|
||||
if(ticker.mode.name == "AI malfunction")
|
||||
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
||||
*/
|
||||
|
||||
stat(null, text("Charge Left: [src.energy]/[src.energy_max]"))
|
||||
|
||||
/mob/living/silicon/hivebot/restrained()
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/ex_act(severity)
|
||||
flick("flash", src.flash)
|
||||
|
||||
if (src.stat == 2 && src.client)
|
||||
src.gib(1)
|
||||
return
|
||||
|
||||
else if (src.stat == 2 && !src.client)
|
||||
del(src)
|
||||
return
|
||||
|
||||
var/b_loss = src.bruteloss
|
||||
var/f_loss = src.fireloss
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
if (src.stat != 2)
|
||||
b_loss += 100
|
||||
f_loss += 100
|
||||
src.gib(1)
|
||||
return
|
||||
if(2.0)
|
||||
if (src.stat != 2)
|
||||
b_loss += 60
|
||||
f_loss += 60
|
||||
if(3.0)
|
||||
if (src.stat != 2)
|
||||
b_loss += 30
|
||||
src.bruteloss = b_loss
|
||||
src.fireloss = f_loss
|
||||
src.updatehealth()
|
||||
|
||||
/mob/living/silicon/hivebot/meteorhit(obj/O as obj)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
M.show_message(text("\red [src] has been hit by [O]"), 1)
|
||||
//Foreach goto(19)
|
||||
if (src.health > 0)
|
||||
src.bruteloss += 30
|
||||
if ((O.icon_state == "flaming"))
|
||||
src.fireloss += 40
|
||||
src.updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/bullet_act(flag)
|
||||
/*
|
||||
if (flag == PROJECTILE_BULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 60
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_MEDBULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 30
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_WEAKBULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 15
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_MPBULLET)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 20
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_SLUG)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 40
|
||||
src.updatehealth()
|
||||
|
||||
else if (flag == PROJECTILE_BAG)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 2
|
||||
src.updatehealth()
|
||||
|
||||
|
||||
else if (flag == PROJECTILE_TASER)
|
||||
return
|
||||
|
||||
else if (flag == PROJECTILE_WAVE)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 25
|
||||
src.updatehealth()
|
||||
return
|
||||
|
||||
else if(flag == PROJECTILE_LASER)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 20
|
||||
src.updatehealth()
|
||||
else if(flag == PROJECTILE_PULSE)
|
||||
if (src.stat != 2)
|
||||
src.bruteloss += 40
|
||||
src.updatehealth()
|
||||
*/
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/Bump(atom/movable/AM as mob|obj, yes)
|
||||
spawn( 0 )
|
||||
if ((!( yes ) || src.now_pushing))
|
||||
return
|
||||
src.now_pushing = 1
|
||||
if(ismob(AM))
|
||||
var/mob/tmob = AM
|
||||
if(istype(tmob, /mob/living/carbon/human) && tmob.mutations & FAT)
|
||||
if(prob(20))
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(M.client)
|
||||
M << M << "\red <B>[src] fails to push [tmob]'s fat ass out of the way.</B>"
|
||||
src.now_pushing = 0
|
||||
//src.unlock_medal("That's No Moon, That's A Gourmand!", 1)
|
||||
return
|
||||
src.now_pushing = 0
|
||||
..()
|
||||
if (!istype(AM, /atom/movable))
|
||||
return
|
||||
if (!src.now_pushing)
|
||||
src.now_pushing = 1
|
||||
if (!AM.anchored)
|
||||
var/t = get_dir(src, AM)
|
||||
step(AM, t)
|
||||
src.now_pushing = null
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
|
||||
if (W:remove_fuel(0))
|
||||
src.bruteloss -= 30
|
||||
if(src.bruteloss < 0) src.bruteloss = 0
|
||||
src.updatehealth()
|
||||
src.add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [user] has fixed some of the dents on [src]!"), 1)
|
||||
else
|
||||
user << "Need more welding fuel!"
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
|
||||
if (M.a_intent == "grab")
|
||||
if (M == src)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
src.grabbed_by += G
|
||||
G.synch()
|
||||
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
else if (M.a_intent == "hurt")
|
||||
var/damage = rand(5, 10)
|
||||
if (prob(90))
|
||||
/*
|
||||
if (M.class == "combat")
|
||||
damage += 15
|
||||
if(prob(20))
|
||||
src.weakened = max(src.weakened,4)
|
||||
src.stunned = max(src.stunned,4)
|
||||
*/
|
||||
playsound(src.loc, 'slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
|
||||
if(prob(8))
|
||||
flick("noise", src.flash)
|
||||
src.bruteloss += damage
|
||||
src.updatehealth()
|
||||
else
|
||||
playsound(src.loc, 'slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] took a swipe at []!</B>", M, src), 1)
|
||||
return
|
||||
|
||||
else if (M.a_intent == "disarm")
|
||||
if(!(src.lying))
|
||||
var/randn = rand(1, 100)
|
||||
if (randn <= 40)
|
||||
src.stunned = 5
|
||||
step(src,get_dir(M,src))
|
||||
spawn(5) step(src,get_dir(M,src))
|
||||
playsound(src.loc, 'slash.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has pushed back []!</B>", M, src), 1)
|
||||
else
|
||||
playsound(src.loc, 'slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] attempted to push back []!</B>", M, src), 1)
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/attack_hand(mob/user)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
if(src.check_access(null))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/proc/check_access(obj/item/weapon/card/id/I)
|
||||
if(!istype(src.req_access, /list)) //something's very wrong
|
||||
return 1
|
||||
|
||||
var/list/L = src.req_access
|
||||
if(!L.len) //no requirements
|
||||
return 1
|
||||
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
|
||||
return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in I.access)) //doesn't have this access
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/hivebot/proc/updateicon()
|
||||
|
||||
src.overlays = null
|
||||
|
||||
if(src.stat == 0)
|
||||
src.overlays += "eyes"
|
||||
else
|
||||
src.overlays -= "eyes"
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/installed_modules()
|
||||
|
||||
if(!src.module)
|
||||
src.pick_module()
|
||||
return
|
||||
var/dat = "<HEAD><TITLE>Modules</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
|
||||
dat += {"<A HREF='?src=\ref[src];mach_close=robotmod'>Close</A>
|
||||
<BR>
|
||||
<BR>
|
||||
<B>Activated Modules</B>
|
||||
<BR>
|
||||
Module 1: [module_state_1 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_1]>[module_state_1]<A>" : "No Module"]<BR>
|
||||
Module 2: [module_state_2 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_2]>[module_state_2]<A>" : "No Module"]<BR>
|
||||
Module 3: [module_state_3 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_3]>[module_state_3]<A>" : "No Module"]<BR>
|
||||
<BR>
|
||||
<B>Installed Modules</B><BR><BR>"}
|
||||
|
||||
for (var/obj in src.module.modules)
|
||||
if(src.activated(obj))
|
||||
dat += text("[obj]: <B>Activated</B><BR>")
|
||||
else
|
||||
dat += text("[obj]: <A HREF=?src=\ref[src];act=\ref[obj]>Activate</A><BR>")
|
||||
/*
|
||||
if(src.activated(obj))
|
||||
dat += text("[obj]: \[<B>Activated</B> | <A HREF=?src=\ref[src];deact=\ref[obj]>Deactivate</A>\]<BR>")
|
||||
else
|
||||
dat += text("[obj]: \[<A HREF=?src=\ref[src];act=\ref[obj]>Activate</A> | <B>Deactivated</B>\]<BR>")
|
||||
*/
|
||||
src << browse(dat, "window=robotmod&can_close=0")
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["mach_close"])
|
||||
var/t1 = text("window=[href_list["mach_close"]]")
|
||||
src.machine = null
|
||||
src << browse(null, t1)
|
||||
return
|
||||
|
||||
if (href_list["mod"])
|
||||
var/obj/item/O = locate(href_list["mod"])
|
||||
O.attack_self(src)
|
||||
|
||||
if (href_list["act"])
|
||||
var/obj/item/O = locate(href_list["act"])
|
||||
if(activated(O))
|
||||
src << "Already activated"
|
||||
return
|
||||
if(!src.module_state_1)
|
||||
src.module_state_1 = O
|
||||
O.layer = 20
|
||||
src.contents += O
|
||||
else if(!src.module_state_2)
|
||||
src.module_state_2 = O
|
||||
O.layer = 20
|
||||
src.contents += O
|
||||
else if(!src.module_state_3)
|
||||
src.module_state_3 = O
|
||||
O.layer = 20
|
||||
src.contents += O
|
||||
else
|
||||
src << "You need to disable a module first!"
|
||||
src.installed_modules()
|
||||
|
||||
if (href_list["deact"])
|
||||
var/obj/item/O = locate(href_list["deact"])
|
||||
if(activated(O))
|
||||
if(src.module_state_1 == O)
|
||||
src.module_state_1 = null
|
||||
src.contents -= O
|
||||
else if(src.module_state_2 == O)
|
||||
src.module_state_2 = null
|
||||
src.contents -= O
|
||||
else if(src.module_state_3 == O)
|
||||
src.module_state_3 = null
|
||||
src.contents -= O
|
||||
else
|
||||
src << "Module isn't activated."
|
||||
else
|
||||
src << "Module isn't activated"
|
||||
src.installed_modules()
|
||||
return
|
||||
|
||||
/mob/living/silicon/hivebot/proc/uneq_active()
|
||||
if(isnull(src.module_active))
|
||||
return
|
||||
if(src.module_state_1 == src.module_active)
|
||||
if (src.client)
|
||||
src.client.screen -= module_state_1
|
||||
src.contents -= module_state_1
|
||||
src.module_active = null
|
||||
src.module_state_1 = null
|
||||
src.inv1.icon_state = "inv1"
|
||||
else if(src.module_state_2 == src.module_active)
|
||||
if (src.client)
|
||||
src.client.screen -= module_state_2
|
||||
src.contents -= module_state_2
|
||||
src.module_active = null
|
||||
src.module_state_2 = null
|
||||
src.inv2.icon_state = "inv2"
|
||||
else if(src.module_state_3 == src.module_active)
|
||||
if (src.client)
|
||||
src.client.screen -= module_state_3
|
||||
src.contents -= module_state_3
|
||||
src.module_active = null
|
||||
src.module_state_3 = null
|
||||
src.inv3.icon_state = "inv3"
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/proc/activated(obj/item/O)
|
||||
if(src.module_state_1 == O)
|
||||
return 1
|
||||
else if(src.module_state_2 == O)
|
||||
return 1
|
||||
else if(src.module_state_3 == O)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/hivebot/proc/radio_menu()
|
||||
var/dat = {"
|
||||
<TT>
|
||||
Microphone: [src.radio.broadcasting ? "<A href='byond://?src=\ref[src.radio];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];talk=1'>Disengaged</A>"]<BR>
|
||||
Speaker: [src.radio.listening ? "<A href='byond://?src=\ref[src.radio];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];listen=1'>Disengaged</A>"]<BR>
|
||||
Frequency:
|
||||
<A href='byond://?src=\ref[src.radio];freq=-10'>-</A>
|
||||
<A href='byond://?src=\ref[src.radio];freq=-2'>-</A>
|
||||
[format_frequency(src.radio.frequency)]
|
||||
<A href='byond://?src=\ref[src.radio];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[src.radio];freq=10'>+</A><BR>
|
||||
-------
|
||||
</TT>"}
|
||||
src << browse(dat, "window=radio")
|
||||
onclose(src, "radio")
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/Move(a, b, flag)
|
||||
|
||||
if (src.buckled)
|
||||
return
|
||||
|
||||
if (src.restrained())
|
||||
src.pulling = null
|
||||
|
||||
var/t7 = 1
|
||||
if (src.restrained())
|
||||
for(var/mob/M in range(src, 1))
|
||||
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
|
||||
t7 = null
|
||||
if ((t7 && (src.pulling && ((get_dist(src, src.pulling) <= 1 || src.pulling.loc == src.loc) && (src.client && src.client.moving)))))
|
||||
var/turf/T = src.loc
|
||||
. = ..()
|
||||
|
||||
if (src.pulling && src.pulling.loc)
|
||||
if(!( isturf(src.pulling.loc) ))
|
||||
src.pulling = null
|
||||
return
|
||||
else
|
||||
if(Debug)
|
||||
diary <<"src.pulling disappeared? at [__LINE__] in mob.dm - src.pulling = [src.pulling]"
|
||||
diary <<"REPORT THIS"
|
||||
|
||||
/////
|
||||
if(src.pulling && src.pulling.anchored)
|
||||
src.pulling = null
|
||||
return
|
||||
|
||||
if (!src.restrained())
|
||||
var/diag = get_dir(src, src.pulling)
|
||||
if ((diag - 1) & diag)
|
||||
else
|
||||
diag = null
|
||||
if ((get_dist(src, src.pulling) > 1 || diag))
|
||||
if (ismob(src.pulling))
|
||||
var/mob/M = src.pulling
|
||||
var/ok = 1
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by))
|
||||
if (prob(75))
|
||||
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
|
||||
if (istype(G, /obj/item/weapon/grab))
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red [G.affecting] has been pulled from [G.assailant]'s grip by [src]"), 1)
|
||||
del(G)
|
||||
else
|
||||
ok = 0
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
|
||||
ok = 0
|
||||
if (ok)
|
||||
var/t = M.pulling
|
||||
M.pulling = null
|
||||
step(src.pulling, get_dir(src.pulling.loc, T))
|
||||
M.pulling = t
|
||||
else
|
||||
if (src.pulling)
|
||||
step(src.pulling, get_dir(src.pulling.loc, T))
|
||||
else
|
||||
src.pulling = null
|
||||
. = ..()
|
||||
if ((src.s_active && !( s_active in src.contents ) ))
|
||||
src.s_active.close(src)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot/verb/cmd_return_mainframe()
|
||||
set category = "Robot Commands"
|
||||
set name = "Recall to Mainframe."
|
||||
return_mainframe()
|
||||
|
||||
/mob/living/silicon/hivebot/proc/return_mainframe()
|
||||
if(mainframe)
|
||||
mainframe.return_to(src)
|
||||
else
|
||||
src << "\red You lack a dedicated mainframe!"
|
||||
return
|
||||
@@ -1,250 +0,0 @@
|
||||
|
||||
/obj/hud/proc/hivebot_hud()
|
||||
|
||||
src.adding = list( )
|
||||
src.other = list( )
|
||||
src.intents = list( )
|
||||
src.mon_blo = list( )
|
||||
src.m_ints = list( )
|
||||
src.mov_int = list( )
|
||||
src.vimpaired = list( )
|
||||
src.darkMask = list( )
|
||||
|
||||
src.g_dither = new src.h_type( src )
|
||||
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.g_dither.name = "Mask"
|
||||
src.g_dither.icon_state = "dither12g"
|
||||
src.g_dither.layer = 18
|
||||
src.g_dither.mouse_opacity = 0
|
||||
|
||||
src.alien_view = new src.h_type(src)
|
||||
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.alien_view.name = "Alien"
|
||||
src.alien_view.icon_state = "alien"
|
||||
src.alien_view.layer = 18
|
||||
src.alien_view.mouse_opacity = 0
|
||||
|
||||
src.blurry = new src.h_type( src )
|
||||
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.blurry.name = "Blurry"
|
||||
src.blurry.icon_state = "blurry"
|
||||
src.blurry.layer = 17
|
||||
src.blurry.mouse_opacity = 0
|
||||
|
||||
src.druggy = new src.h_type( src )
|
||||
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.druggy.name = "Druggy"
|
||||
src.druggy.icon_state = "druggy"
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
|
||||
//Radio
|
||||
using = new src.h_type( src )
|
||||
using.name = "radio"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = "radio"
|
||||
using.screen_loc = ui_movi
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
|
||||
//Generic overlays
|
||||
|
||||
using = new src.h_type(src) //Right hud bar
|
||||
using.dir = SOUTH
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new src.h_type(src) //Lower hud bar
|
||||
using.dir = EAST
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new src.h_type(src) //Corner Button
|
||||
using.dir = NORTHWEST
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.screen_loc = "EAST+1,SOUTH-1"
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
|
||||
//Module select
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "module1"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = "inv1"
|
||||
using.screen_loc = ui_inv1
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
mymob:inv1 = using
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "module2"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = "inv2"
|
||||
using.screen_loc = ui_inv2
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
mymob:inv2 = using
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "module3"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = "inv3"
|
||||
using.screen_loc = ui_inv3
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
mymob:inv3 = using
|
||||
|
||||
//End of module select
|
||||
|
||||
//Intent
|
||||
using = new src.h_type( src )
|
||||
using.name = "act_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
action_intent = using
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "arrowleft"
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = "s_arrow"
|
||||
using.dir = WEST
|
||||
using.screen_loc = ui_iarrowleft
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new src.h_type( src )
|
||||
using.name = "arrowright"
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = "s_arrow"
|
||||
using.dir = EAST
|
||||
using.screen_loc = ui_iarrowright
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
//End of Intent
|
||||
|
||||
//Cell
|
||||
mymob:cells = new /obj/screen( null )
|
||||
mymob:cells.icon = 'screen1_robot.dmi'
|
||||
mymob:cells.icon_state = "charge-empty"
|
||||
mymob:cells.name = "cell"
|
||||
mymob:cells.screen_loc = ui_toxin
|
||||
|
||||
//Health
|
||||
mymob.healths = new /obj/screen( null )
|
||||
mymob.healths.icon = 'screen1_robot.dmi'
|
||||
mymob.healths.icon_state = "health0"
|
||||
mymob.healths.name = "health"
|
||||
mymob.healths.screen_loc = ui_health
|
||||
|
||||
//Installed Module
|
||||
mymob.hands = new /obj/screen( null )
|
||||
mymob.hands.icon = 'screen1_robot.dmi'
|
||||
mymob.hands.icon_state = "nomod"
|
||||
mymob.hands.name = "module"
|
||||
mymob.hands.screen_loc = ui_dropbutton
|
||||
|
||||
//Module Panel
|
||||
using = new src.h_type( src )
|
||||
using.name = "panel"
|
||||
using.icon = 'screen1_robot.dmi'
|
||||
using.icon_state = "panel"
|
||||
using.screen_loc = ui_throw
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
//Store
|
||||
mymob.throw_icon = new /obj/screen(null)
|
||||
mymob.throw_icon.icon = 'screen1_robot.dmi'
|
||||
mymob.throw_icon.icon_state = "store"
|
||||
mymob.throw_icon.name = "store"
|
||||
mymob.throw_icon.screen_loc = ui_hand
|
||||
|
||||
//Temp
|
||||
mymob.bodytemp = new /obj/screen( null )
|
||||
mymob.bodytemp.icon_state = "temp0"
|
||||
mymob.bodytemp.name = "body temperature"
|
||||
mymob.bodytemp.screen_loc = ui_temp
|
||||
|
||||
//does nothing (fire and oxy)
|
||||
mymob.oxygen = new /obj/screen( null )
|
||||
mymob.oxygen.icon = 'screen1_robot.dmi'
|
||||
mymob.oxygen.icon_state = "oxy0"
|
||||
mymob.oxygen.name = "oxygen"
|
||||
mymob.oxygen.screen_loc = ui_oxygen
|
||||
|
||||
mymob.fire = new /obj/screen( null )
|
||||
mymob.fire.icon = 'screen1_robot.dmi'
|
||||
mymob.fire.icon_state = "fire0"
|
||||
mymob.fire.name = "fire"
|
||||
mymob.fire.screen_loc = ui_fire
|
||||
|
||||
|
||||
|
||||
mymob.pullin = new /obj/screen( null )
|
||||
mymob.pullin.icon = 'screen1_robot.dmi'
|
||||
mymob.pullin.icon_state = "pull0"
|
||||
mymob.pullin.name = "pull"
|
||||
mymob.pullin.screen_loc = ui_pull
|
||||
|
||||
mymob.blind = new /obj/screen( null )
|
||||
mymob.blind.icon = 'screen1_robot.dmi'
|
||||
mymob.blind.icon_state = "black"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "1,1 to 15,15"
|
||||
mymob.blind.layer = 0
|
||||
|
||||
mymob.flash = new /obj/screen( null )
|
||||
mymob.flash.icon = 'screen1_robot.dmi'
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "1,1 to 15,15"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.sleep = new /obj/screen( null )
|
||||
mymob.sleep.icon = 'screen1_robot.dmi'
|
||||
mymob.sleep.icon_state = "sleep0"
|
||||
mymob.sleep.name = "sleep"
|
||||
mymob.sleep.screen_loc = ui_sleep
|
||||
|
||||
mymob.rest = new /obj/screen( null )
|
||||
mymob.rest.icon = 'screen1_robot.dmi'
|
||||
mymob.rest.icon_state = "rest0"
|
||||
mymob.rest.name = "rest"
|
||||
mymob.rest.screen_loc = ui_rest
|
||||
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel( null )
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
return
|
||||
@@ -1,229 +0,0 @@
|
||||
/mob/living/silicon/hivebot/Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
|
||||
if (src.monkeyizing)
|
||||
return
|
||||
|
||||
if (src.stat != 2)
|
||||
use_power()
|
||||
|
||||
src.blinded = null
|
||||
|
||||
clamp_values()
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
if(client)
|
||||
src.shell = 0
|
||||
handle_regular_hud_updates()
|
||||
update_items()
|
||||
if(dependent)
|
||||
mainframe_check()
|
||||
|
||||
update_canmove()
|
||||
|
||||
|
||||
/mob/living/silicon/hivebot
|
||||
proc
|
||||
clamp_values()
|
||||
|
||||
stunned = max(min(stunned, 10),0)
|
||||
paralysis = max(min(paralysis, 1), 0)
|
||||
weakened = max(min(weakened, 15), 0)
|
||||
sleeping = max(min(sleeping, 1), 0)
|
||||
bruteloss = max(bruteloss, 0)
|
||||
toxloss = 0
|
||||
oxyloss = 0
|
||||
fireloss = max(fireloss, 0)
|
||||
|
||||
use_power()
|
||||
|
||||
if (src.energy)
|
||||
if(src.energy <= 0)
|
||||
death()
|
||||
|
||||
else if (src.energy <= 10)
|
||||
src.module_active = null
|
||||
src.module_state_1 = null
|
||||
src.module_state_2 = null
|
||||
src.module_state_3 = null
|
||||
src.energy -=1
|
||||
else
|
||||
if(src.module_state_1)
|
||||
src.energy -=1
|
||||
if(src.module_state_2)
|
||||
src.energy -=1
|
||||
if(src.module_state_3)
|
||||
src.energy -=1
|
||||
src.energy -=1
|
||||
src.blinded = 0
|
||||
src.stat = 0
|
||||
else
|
||||
src.blinded = 1
|
||||
src.stat = 1
|
||||
|
||||
update_canmove()
|
||||
if(paralysis || stunned || weakened || buckled) canmove = 0
|
||||
else canmove = 1
|
||||
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
health = src.health_max - (fireloss + bruteloss)
|
||||
|
||||
if(health <= 0)
|
||||
death()
|
||||
|
||||
if (src.stat != 2) //Alive.
|
||||
|
||||
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
|
||||
if (src.stunned > 0)
|
||||
src.stunned--
|
||||
src.stat = 0
|
||||
if (src.weakened > 0)
|
||||
src.weakened--
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
if (src.paralysis > 0)
|
||||
src.paralysis--
|
||||
src.blinded = 0
|
||||
src.lying = 0
|
||||
src.stat = 1
|
||||
|
||||
else //Not stunned.
|
||||
src.lying = 0
|
||||
src.stat = 0
|
||||
|
||||
else //Dead.
|
||||
src.blinded = 1
|
||||
src.stat = 2
|
||||
|
||||
src.density = !( src.lying )
|
||||
|
||||
if ((src.sdisabilities & 1))
|
||||
src.blinded = 1
|
||||
if ((src.sdisabilities & 4))
|
||||
src.ear_deaf = 1
|
||||
|
||||
if (src.eye_blurry > 0)
|
||||
src.eye_blurry--
|
||||
src.eye_blurry = max(0, src.eye_blurry)
|
||||
|
||||
if (src.druggy > 0)
|
||||
src.druggy--
|
||||
src.druggy = max(0, src.druggy)
|
||||
|
||||
return 1
|
||||
|
||||
handle_regular_hud_updates()
|
||||
|
||||
if (src.stat == 2 || src.mutations & XRAY)
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
else if (src.stat != 2)
|
||||
src.sight &= ~SEE_MOBS
|
||||
src.sight &= ~SEE_TURFS
|
||||
src.sight &= ~SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
switch(health)
|
||||
if(health_max to INFINITY)
|
||||
src.healths.icon_state = "health0"
|
||||
if(src.health_max*0.80 to src.health_max)
|
||||
src.healths.icon_state = "health1"
|
||||
if(src.health_max*0.60 to src.health_max*0.80)
|
||||
src.healths.icon_state = "health2"
|
||||
if(src.health_max*0.40 to src.health_max*0.60)
|
||||
src.healths.icon_state = "health3"
|
||||
if(src.health_max*0.20 to src.health_max*0.40)
|
||||
src.healths.icon_state = "health4"
|
||||
if(0 to health_max*0.20)
|
||||
src.healths.icon_state = "health5"
|
||||
else
|
||||
src.healths.icon_state = "health6"
|
||||
else
|
||||
src.healths.icon_state = "health7"
|
||||
|
||||
if (src.cells)
|
||||
switch(src.energy)
|
||||
if(src.energy_max*0.75 to INFINITY)
|
||||
src.cells.icon_state = "charge4"
|
||||
if(0.5*src.energy_max to 0.75*src.energy_max)
|
||||
src.cells.icon_state = "charge3"
|
||||
if(0.25*src.energy_max to 0.5*src.energy_max)
|
||||
src.cells.icon_state = "charge2"
|
||||
if(0 to 0.25*src.energy_max)
|
||||
src.cells.icon_state = "charge1"
|
||||
else
|
||||
src.cells.icon_state = "charge0"
|
||||
|
||||
switch(src.bodytemperature) //310.055 optimal body temp
|
||||
|
||||
if(335 to INFINITY)
|
||||
src.bodytemp.icon_state = "temp2"
|
||||
if(320 to 335)
|
||||
src.bodytemp.icon_state = "temp1"
|
||||
if(300 to 320)
|
||||
src.bodytemp.icon_state = "temp0"
|
||||
if(260 to 300)
|
||||
src.bodytemp.icon_state = "temp-1"
|
||||
else
|
||||
src.bodytemp.icon_state = "temp-2"
|
||||
|
||||
|
||||
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
|
||||
|
||||
src.client.screen -= src.hud_used.blurry
|
||||
src.client.screen -= src.hud_used.druggy
|
||||
src.client.screen -= src.hud_used.vimpaired
|
||||
|
||||
if ((src.blind && src.stat != 2))
|
||||
if ((src.blinded))
|
||||
src.blind.layer = 18
|
||||
else
|
||||
src.blind.layer = 0
|
||||
|
||||
if (src.disabilities & 1)
|
||||
src.client.screen += src.hud_used.vimpaired
|
||||
|
||||
if (src.eye_blurry)
|
||||
src.client.screen += src.hud_used.blurry
|
||||
|
||||
if (src.druggy)
|
||||
src.client.screen += src.hud_used.druggy
|
||||
|
||||
if (src.stat != 2)
|
||||
if (src.machine)
|
||||
if (!( src.machine.check_eye(src) ))
|
||||
src.reset_view(null)
|
||||
else
|
||||
if(!client.adminobs)
|
||||
reset_view(null)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
update_items()
|
||||
if (src.client)
|
||||
src.client.screen -= src.contents
|
||||
src.client.screen += src.contents
|
||||
if(src.module_state_1)
|
||||
src.module_state_1:screen_loc = ui_inv1
|
||||
if(src.module_state_2)
|
||||
src.module_state_2:screen_loc = ui_inv2
|
||||
if(src.module_state_3)
|
||||
src.module_state_3:screen_loc = ui_inv3
|
||||
|
||||
mainframe_check()
|
||||
if(mainframe)
|
||||
if(mainframe.stat == 2)
|
||||
mainframe.return_to(src)
|
||||
else
|
||||
death()
|
||||
@@ -1,15 +0,0 @@
|
||||
/mob/living/silicon/hivebot/Login()
|
||||
..()
|
||||
|
||||
update_clothing()
|
||||
|
||||
if (!isturf(src.loc))
|
||||
src.client.eye = src.loc
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
if (src.stat == 2)
|
||||
src.verbs += /mob/proc/ghost
|
||||
if(src.real_name == "Hiveborg")
|
||||
src.real_name += " "
|
||||
src.real_name += "-[rand(1, 999)]"
|
||||
src.name = src.real_name
|
||||
return
|
||||
@@ -1,178 +0,0 @@
|
||||
/mob/living/silicon/hive_mainframe/New()
|
||||
Namepick()
|
||||
|
||||
/mob/living/silicon/hive_mainframe/Life()
|
||||
if (src.stat == 2)
|
||||
return
|
||||
else
|
||||
src.updatehealth()
|
||||
|
||||
if (src.health <= 0)
|
||||
death()
|
||||
return
|
||||
|
||||
if(src.force_mind)
|
||||
if(!src.mind)
|
||||
if(src.client)
|
||||
src.mind = new
|
||||
src.mind.key = src.key
|
||||
src.mind.current = src
|
||||
src.force_mind = 0
|
||||
|
||||
/mob/living/silicon/hive_mainframe/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
if (src.client.statpanel == "Status")
|
||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
||||
var/timeleft = emergency_shuttle.timeleft()
|
||||
if (timeleft)
|
||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||
/*
|
||||
if(ticker.mode.name == "AI malfunction")
|
||||
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
||||
*/
|
||||
|
||||
/mob/living/silicon/hive_mainframe/updatehealth()
|
||||
if (src.nodamage == 0)
|
||||
src.health = 100 - src.fireloss - src.bruteloss
|
||||
else
|
||||
src.health = 100
|
||||
src.stat = 0
|
||||
|
||||
/mob/living/silicon/hive_mainframe/death(gibbed)
|
||||
src.stat = 2
|
||||
src.canmove = 0
|
||||
if(src.blind)
|
||||
src.blind.layer = 0
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = 2
|
||||
src.lying = 1
|
||||
src.icon_state = "hive_main-crash"
|
||||
|
||||
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
|
||||
mind.store_memory("Time of death: [tod]", 0)
|
||||
|
||||
if (src.key)
|
||||
spawn(50)
|
||||
if(src.key && src.stat == 2)
|
||||
src.verbs += /mob/proc/ghost
|
||||
return ..(gibbed)
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/say_understands(var/other)
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/robot))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/hivebot))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/ai))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/hive_mainframe/say_quote(var/text)
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return "queries, \"[text]\"";
|
||||
else if (ending == "!")
|
||||
return "declares, \"[copytext(text, 1, length(text))]\"";
|
||||
|
||||
return "states, \"[text]\"";
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/proc/return_to(var/mob/user)
|
||||
if(user.mind)
|
||||
user.mind.transfer_to(src)
|
||||
spawn(20)
|
||||
user:shell = 1
|
||||
user:real_name = "Robot [pick(rand(1, 999))]"
|
||||
user:name = user:real_name
|
||||
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/hive_mainframe/verb/cmd_deploy_to()
|
||||
set category = "Mainframe Commands"
|
||||
set name = "Deploy to shell."
|
||||
deploy_to()
|
||||
|
||||
/mob/living/silicon/hive_mainframe/verb/deploy_to()
|
||||
|
||||
if(usr.stat == 2)
|
||||
usr << "You can't deploy because you are dead!"
|
||||
return
|
||||
|
||||
var/list/bodies = new/list()
|
||||
|
||||
for(var/mob/living/silicon/hivebot/H in world)
|
||||
if(H.z == src.z)
|
||||
if(H.shell)
|
||||
if(!H.stat)
|
||||
bodies += H
|
||||
|
||||
var/target_shell = input(usr, "Which body to control?") as null|anything in bodies
|
||||
|
||||
if (!target_shell)
|
||||
return
|
||||
|
||||
else if(src.mind)
|
||||
spawn(30)
|
||||
target_shell:mainframe = src
|
||||
target_shell:dependent = 1
|
||||
target_shell:real_name = src.name
|
||||
target_shell:name = target_shell:real_name
|
||||
src.mind.transfer_to(target_shell)
|
||||
return
|
||||
|
||||
|
||||
/client/proc/MainframeMove(n,direct,var/mob/living/silicon/hive_mainframe/user)
|
||||
return
|
||||
/obj/hud/proc/hive_mainframe_hud()
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/Login()
|
||||
..()
|
||||
update_clothing()
|
||||
for(var/S in src.client.screen)
|
||||
del(S)
|
||||
src.flash = new /obj/screen( null )
|
||||
src.flash.icon_state = "blank"
|
||||
src.flash.name = "flash"
|
||||
src.flash.screen_loc = "1,1 to 15,15"
|
||||
src.flash.layer = 17
|
||||
src.blind = new /obj/screen( null )
|
||||
src.blind.icon_state = "black"
|
||||
src.blind.name = " "
|
||||
src.blind.screen_loc = "1,1 to 15,15"
|
||||
src.blind.layer = 0
|
||||
src.client.screen += list( src.blind, src.flash )
|
||||
if(!isturf(src.loc))
|
||||
src.client.eye = src.loc
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
if (src.stat == 2)
|
||||
src.verbs += /mob/proc/ghost
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/proc/Namepick()
|
||||
var/randomname = pick(ai_names)
|
||||
var/newname = input(src,"You are the a Mainframe Unit. Would you like to change your name to something else?", "Name change",randomname)
|
||||
|
||||
if (length(newname) == 0)
|
||||
newname = randomname
|
||||
|
||||
if (newname)
|
||||
if (length(newname) >= 26)
|
||||
newname = copytext(newname, 1, 26)
|
||||
newname = dd_replacetext(newname, ">", "'")
|
||||
src.real_name = newname
|
||||
src.name = newname
|
||||
@@ -1,18 +0,0 @@
|
||||
/mob/living/silicon/hivebot/say_understands(var/other)
|
||||
if (istype(other, /mob/living/silicon/ai))
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/robot))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/hivebot/say_quote(var/text)
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return "queries, \"[text]\"";
|
||||
else if (ending == "!")
|
||||
return "declares, \"[copytext(text, 1, length(text))]\"";
|
||||
|
||||
return "states, \"[text]\"";
|
||||
@@ -5,8 +5,8 @@
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/hivebot))
|
||||
return 1
|
||||
// if (istype(other, /mob/living/silicon/hivebot))
|
||||
// return 1
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/say_quote(var/text)
|
||||
|
||||
+11
-11
@@ -57,15 +57,15 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ishivebot(A)
|
||||
/*proc/ishivebot(A)
|
||||
if(A && istype(A, /mob/living/silicon/hivebot))
|
||||
return 1
|
||||
return 0
|
||||
return 0*/
|
||||
|
||||
/proc/ishivemainframe(A)
|
||||
/*proc/ishivemainframe(A)
|
||||
if(A && istype(A, /mob/living/silicon/hive_mainframe))
|
||||
return 1
|
||||
return 0
|
||||
return 0*/
|
||||
|
||||
/proc/isAI(A)
|
||||
if(istype(A, /mob/living/silicon/ai))
|
||||
@@ -974,20 +974,20 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
||||
usr << "\blue You successfully unbuckle yourself."
|
||||
usr:buckled.manual_unbuckle_all(usr)
|
||||
if("module")
|
||||
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
if(usr:module)
|
||||
return
|
||||
usr:pick_module()
|
||||
|
||||
if("radio")
|
||||
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
usr:radio_menu()
|
||||
if("panel")
|
||||
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
usr:installed_modules()
|
||||
|
||||
if("store")
|
||||
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
usr:uneq_active()
|
||||
|
||||
if("module1")
|
||||
@@ -1254,7 +1254,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
||||
|
||||
/mob/proc/equipped()
|
||||
if(issilicon(src))
|
||||
if(ishivebot(src)||isrobot(src))
|
||||
if(isrobot(src))
|
||||
if(src:module_active)
|
||||
return src:module_active
|
||||
else
|
||||
@@ -1751,8 +1751,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
||||
|
||||
if(isAI(mob))
|
||||
return AIMove(n,direct,mob)
|
||||
if(ishivemainframe(mob))
|
||||
return MainframeMove(n,direct,mob)
|
||||
// if(ishivemainframe(mob))
|
||||
// return MainframeMove(n,direct,mob)
|
||||
|
||||
if(mob.anchored)/*If mob is not AI and is anchored. This means most anchored mobs will not be able to move.
|
||||
This is a fix for ninja energy_net to where mobs can not move but can still act to destroy it.
|
||||
|
||||
@@ -126,8 +126,6 @@
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_camera_track
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_alerts
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_camera_list
|
||||
O.verbs += /mob/living/silicon/ai/proc/lockdown
|
||||
O.verbs += /mob/living/silicon/ai/proc/disablelockdown
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_statuschange
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_roster
|
||||
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/*///////////////Circuit Imprinter (By Darem)////////////////////////
|
||||
Used to print new circuit boards (for computers and similar systems) and AI modules. Each circuit board pattern are stored in
|
||||
a /datum/desgin on the linked R&D console. You can then print them out in a fasion similar to a regular lathe. However, instead of
|
||||
using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/circuit_imprinter
|
||||
name = "Circuit Imprinter"
|
||||
icon_state = "circuit_imprinter"
|
||||
flags = OPENCONTAINER
|
||||
var
|
||||
g_amount = 0
|
||||
gold_amount = 0
|
||||
diamond_amount = 0
|
||||
max_material_amount = 75000.0
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/circuit_imprinter(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
RefreshParts()
|
||||
|
||||
RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
T += G.reagents.maximum_volume
|
||||
var/datum/reagents/R = new/datum/reagents(T) //Holder for the reagents used as materials.
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
T += M.rating
|
||||
max_material_amount = T * 75000.0
|
||||
|
||||
|
||||
blob_act()
|
||||
if (prob(50))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
proc/TotalMaterials()
|
||||
return g_amount + gold_amount + diamond_amount
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if(linked_console)
|
||||
linked_console.linked_imprinter = null
|
||||
linked_console = null
|
||||
icon_state = "circuit_imprinter_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "circuit_imprinter"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
if(g_amount >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(g_amount / 3750)
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console)
|
||||
user << "\The [name] must be linked to an R&D console first!"
|
||||
return 1
|
||||
if (O.is_open_container())
|
||||
return 1
|
||||
if (!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/gold) && !istype(O, /obj/item/stack/sheet/diamond))
|
||||
user << "\red You cannot insert this item into the [name]!"
|
||||
return 1
|
||||
if (stat)
|
||||
return 1
|
||||
if (busy)
|
||||
user << "\red The [name] is busy. Please wait for completion of previous operation."
|
||||
return 1
|
||||
if ((TotalMaterials() + 3750) > max_material_amount)
|
||||
user << "\red The [name] is full. Please remove glass from the protolathe in order to insert more."
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/stack = O
|
||||
var/amount = 1
|
||||
var/title = "[stack.name]: [stack.amount] sheet\s left"
|
||||
switch(alert(title, "How many sheets do you want to load?", "one", "max", "cancel", null))
|
||||
if("one")
|
||||
amount = 1
|
||||
if("max")
|
||||
amount = min(stack.amount, round((max_material_amount-TotalMaterials())/3750))
|
||||
else
|
||||
return 1
|
||||
|
||||
busy = 1
|
||||
use_power(max(1000, (3750*amount/10)))
|
||||
spawn(16)
|
||||
user << "\blue You add [amount] sheets to the [src.name]."
|
||||
if(istype(stack, /obj/item/stack/sheet/glass))
|
||||
g_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/gold))
|
||||
gold_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/diamond))
|
||||
diamond_amount += amount * 3750
|
||||
stack.use(amount)
|
||||
busy = 0
|
||||
src.updateUsrDialog()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
Destructive Analyzer
|
||||
|
||||
It is used to destroy hand-held objects and advance technological research. Controls are in the linked R&D console.
|
||||
|
||||
Note: Must be placed within 3 tiles of the R&D Console
|
||||
*/
|
||||
/obj/machinery/r_n_d/destructive_analyzer
|
||||
name = "Destructive Analyzer"
|
||||
icon_state = "d_analyzer"
|
||||
var
|
||||
obj/item/weapon/loaded_item = null
|
||||
decon_mod = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/destructive_analyzer(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
RefreshParts()
|
||||
|
||||
RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/stock_parts/S in src)
|
||||
T += S.rating * 0.1
|
||||
T = between (0, T, 1)
|
||||
decon_mod = T
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
proc/ConvertReqString2List(var/list/source_list)
|
||||
var/list/temp_list = params2list(source_list)
|
||||
for(var/O in temp_list)
|
||||
temp_list[O] = text2num(temp_list[O])
|
||||
return temp_list
|
||||
|
||||
|
||||
attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if(linked_console)
|
||||
linked_console.linked_destroy = null
|
||||
linked_console = null
|
||||
icon_state = "d_analyzer_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "d_analyzer"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console)
|
||||
user << "\red The protolathe must be linked to an R&D console first!"
|
||||
return
|
||||
if (busy)
|
||||
user << "\red The protolathe is busy right now."
|
||||
return
|
||||
if (istype(O, /obj/item) && !loaded_item)
|
||||
if(!O.origin_tech)
|
||||
user << "\red This doesn't seem to have a tech origin!"
|
||||
return
|
||||
var/list/temp_tech = ConvertReqString2List(O.origin_tech)
|
||||
if (temp_tech.len == 0)
|
||||
user << "\red You cannot deconstruct this item!"
|
||||
return
|
||||
if(O.reliability < 90 && O.crit_fail == 0)
|
||||
usr << "\red Item is neither reliable enough or broken enough to learn from."
|
||||
return
|
||||
busy = 1
|
||||
loaded_item = O
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
user << "\blue You add the [O.name] to the machine!"
|
||||
flick("d_analyzer_la", src)
|
||||
spawn(10)
|
||||
icon_state = "d_analyzer_l"
|
||||
busy = 0
|
||||
return
|
||||
|
||||
//For testing purposes only.
|
||||
/*/obj/item/weapon/deconstruction_test
|
||||
name = "Test Item"
|
||||
desc = "WTF?"
|
||||
icon = 'weapons.dmi'
|
||||
icon_state = "d20"
|
||||
g_amt = 5000
|
||||
m_amt = 5000
|
||||
origin_tech = "materials=5;plasmatech=5;syndicate=5;programming=9"*/
|
||||
@@ -0,0 +1,89 @@
|
||||
/datum/data_pda_msg
|
||||
var/recipient = "Unspecified" //name of the person
|
||||
var/sender = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
|
||||
/datum/data_pda_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "")
|
||||
if(param_rec)
|
||||
recipient = param_rec
|
||||
if(param_sender)
|
||||
sender = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
|
||||
/datum/data_rc_msg
|
||||
var/rec_dpt = "Unspecified" //name of the person
|
||||
var/send_dpt = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
var/stamp = "Unstamped"
|
||||
var/id_auth = "Unauthenticated"
|
||||
var/priority = "Normal"
|
||||
|
||||
/datum/data_rc_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "",var/param_stamp = "",var/param_id_auth = "",var/param_priority)
|
||||
if(param_rec)
|
||||
rec_dpt = param_rec
|
||||
if(param_sender)
|
||||
send_dpt = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
if(param_stamp)
|
||||
stamp = param_stamp
|
||||
if(param_id_auth)
|
||||
id_auth = param_id_auth
|
||||
if(param_priority)
|
||||
switch(param_priority)
|
||||
if(1)
|
||||
priority = "Normal"
|
||||
if(2)
|
||||
priority = "High"
|
||||
if(3)
|
||||
priority = "Extreme"
|
||||
else
|
||||
priority = "Undetermined"
|
||||
|
||||
/obj/machinery/message_server
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "server"
|
||||
name = "Messaging Server"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
|
||||
var/list/datum/data_pda_msg/pda_msgs = list()
|
||||
var/list/datum/data_rc_msg/rc_msgs = list()
|
||||
|
||||
/obj/machinery/message_server/proc/send_pda_message(var/recipient = "",var/sender = "",var/message = "")
|
||||
pda_msgs += new/datum/data_pda_msg(recipient,sender,message)
|
||||
|
||||
/obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth)
|
||||
|
||||
/obj/machinery/message_server/attack_hand(user as mob)
|
||||
user << "\blue There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays."
|
||||
|
||||
|
||||
|
||||
/obj/machinery/blackbox_recorder
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "blackbox"
|
||||
name = "Blackbox Recorder"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/messages = list()
|
||||
var/messages_admin = list()
|
||||
|
||||
var/msg_common = list()
|
||||
var/msg_science = list()
|
||||
var/msg_command = list()
|
||||
var/msg_medical = list()
|
||||
var/msg_engineering = list()
|
||||
var/msg_security = list()
|
||||
var/msg_deathsquad = list()
|
||||
var/msg_syndicate = list()
|
||||
var/msg_mining = list()
|
||||
var/msg_cargo = list()
|
||||
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
Protolathe
|
||||
|
||||
Similar to an autolathe, you load glass and metal sheets (but not other objects) into it to be used as raw materials for the stuff
|
||||
it creates. All the menus and other manipulation commands are in the R&D console.
|
||||
|
||||
Note: Must be placed west/left of and R&D console to function.
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/protolathe
|
||||
name = "Protolathe"
|
||||
icon_state = "protolathe"
|
||||
flags = OPENCONTAINER
|
||||
var
|
||||
max_material_storage = 100000 //All this could probably be done better with a list but meh.
|
||||
m_amount = 0.0
|
||||
g_amount = 0.0
|
||||
gold_amount = 0.0
|
||||
silver_amount = 0.0
|
||||
plasma_amount = 0.0
|
||||
uranium_amount = 0.0
|
||||
diamond_amount = 0.0
|
||||
clown_amount = 0.0
|
||||
adamantine_amount = 0.0
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/protolathe(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
RefreshParts()
|
||||
|
||||
proc/TotalMaterials() //returns the total of all the stored materials. Makes code neater.
|
||||
return m_amount + g_amount + gold_amount + silver_amount + plasma_amount + uranium_amount + diamond_amount + clown_amount
|
||||
|
||||
RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
T += G.reagents.maximum_volume
|
||||
var/datum/reagents/R = new/datum/reagents(T) //Holder for the reagents used as materials.
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
T += M.rating
|
||||
max_material_storage = T * 75000
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (O.is_open_container())
|
||||
return 1
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if(linked_console)
|
||||
linked_console.linked_lathe = null
|
||||
linked_console = null
|
||||
icon_state = "protolathe_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "protolathe"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
if(m_amount >= 3750)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
|
||||
G.amount = round(m_amount / 3750)
|
||||
if(g_amount >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(g_amount / 3750)
|
||||
if(plasma_amount >= 3750)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma(src.loc)
|
||||
G.amount = round(plasma_amount / 3750)
|
||||
if(silver_amount >= 3750)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver(src.loc)
|
||||
G.amount = round(silver_amount / 3750)
|
||||
if(gold_amount >= 3750)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold(src.loc)
|
||||
G.amount = round(gold_amount / 3750)
|
||||
if(uranium_amount >= 3750)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/uranium(src.loc)
|
||||
G.amount = round(uranium_amount / 3750)
|
||||
if(diamond_amount >= 3750)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond(src.loc)
|
||||
G.amount = round(diamond_amount / 3750)
|
||||
if(clown_amount >= 3750)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown(src.loc)
|
||||
G.amount = round(clown_amount / 3750)
|
||||
if(adamantine_amount >= 3750)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine(src.loc)
|
||||
G.amount = round(adamantine_amount / 3750)
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console)
|
||||
user << "\The protolathe must be linked to an R&D console first!"
|
||||
return 1
|
||||
if (busy)
|
||||
user << "\red The protolathe is busy. Please wait for completion of previous operation."
|
||||
return 1
|
||||
if (!istype(O, /obj/item/stack/sheet))
|
||||
user << "\red You cannot insert this item into the protolathe!"
|
||||
return 1
|
||||
if (stat)
|
||||
return 1
|
||||
if (TotalMaterials() + 3750 > max_material_storage)
|
||||
user << "\red The protolathe's material bin is full. Please remove material before adding more."
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/stack = O
|
||||
var/amount = 1
|
||||
var/title = "[stack.name]: [stack.amount] sheet\s left"
|
||||
switch(alert(title, "How many sheets do you want to load?", "one", "max", "cancel", null))
|
||||
if("one")
|
||||
amount = 1
|
||||
if("max")
|
||||
amount = min(stack.amount, round((max_material_storage-TotalMaterials())/3750))
|
||||
else
|
||||
return 1
|
||||
|
||||
if(istype(O, /obj/item/stack/sheet/glass))
|
||||
flick("protolathe_r",src)//plays glass insertion animation
|
||||
else
|
||||
flick("protolathe_o",src)//plays metal insertion animation
|
||||
|
||||
icon_state = "protolathe"
|
||||
busy = 1
|
||||
use_power(max(1000, (3750*amount/10)))
|
||||
spawn(16)
|
||||
user << "\blue You add [amount] sheets to the [src.name]."
|
||||
icon_state = "protolathe"
|
||||
flick("protolathe_o",src)
|
||||
if(istype(stack, /obj/item/stack/sheet/metal))
|
||||
m_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/glass))
|
||||
g_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/gold))
|
||||
gold_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/silver))
|
||||
silver_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/plasma))
|
||||
plasma_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/uranium))
|
||||
uranium_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/diamond))
|
||||
diamond_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/clown))
|
||||
clown_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/adamantine))
|
||||
adamantine_amount += amount * 3750
|
||||
stack.use(amount)
|
||||
busy = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
Research and Development System. (Designed specifically for the /tg/station 13 (Space Station 13) open source project)
|
||||
|
||||
///////////////Overview///////////////////
|
||||
This system is a "tech tree" research and development system designed for SS13. It allows a "researcher" job (this document assumes
|
||||
the "scientist" job is given this role) the tools necessiary to research new and better technologies. In general, the system works
|
||||
by breaking existing technology and using what you learn from to advance your knowledge of SCIENCE! As your knowledge progresses,
|
||||
you can build newer (and better?) devices (which you can also, eventually, deconstruct to advance your knowledge).
|
||||
|
||||
A brief overview is below. For more details, see the related files.
|
||||
|
||||
////////////Game Use/////////////
|
||||
The major research and development is performed using a combination of four machines:
|
||||
- R&D Console: A computer console that allows you to manipulate the other devices that are linked to it and view/manipulate the
|
||||
technologies you have researched so far.
|
||||
- Protolathe: Used to make new hand-held devices and parts for larger devices. All metals and reagents as raw materials.
|
||||
- Destructive Analyzer: You can put hand-held objects into it and it'll analyze them for technological advancements but it destroys
|
||||
them in the process. Destroyed items will send their raw materials to a linked Protolathe (if any)
|
||||
- Circuit Imprinter: Similar to the Protolathe, it allows for the construction of circuit boards. Uses glass and acid as the raw
|
||||
materials.
|
||||
|
||||
While researching you are dealing with two different types of information: Technology Paths and Device Designs. Technology Paths
|
||||
are the "Tech Trees" of the game. You start out with a number of them at the game start and they are improved by using the
|
||||
Destructive Analyzer. By themselves, they don't do a whole lot. However, they unlock Device Designs. This is the information used
|
||||
by the circuit imprinter and the protolathe to produce objects. It also tracks the current reliability of that particular design.
|
||||
|
||||
//EXISTING TECH
|
||||
Each tech path should have at LEAST one item at every level (levels 1 - 20). This is to allow for a more fluid progression of the
|
||||
researching. Existing tech (ie, anything you can find on the station or get from the quartermaster) shouldn't go higher then
|
||||
level 5 or 7. Everything past that should be stuff you research.
|
||||
|
||||
Below is a checklist to make sure every tree is filled. As new items get added to R&D, add them here if there is an empty slot.
|
||||
When thinking about new stuff, check here to see if there are any slots unfilled.
|
||||
|
||||
//MATERIALS
|
||||
1 | Metal
|
||||
2 | Solid Plasma
|
||||
3 | Silver
|
||||
4 | Gold, Super Capacitor
|
||||
5 | Uranium, Nuclear Gun, SUPERPACMAN
|
||||
6 | Diamond, MRSPACMAN
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//PLASMA TECH
|
||||
1 |
|
||||
2 | Solid Plasma
|
||||
3 | Pacman Generator
|
||||
4 |
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//POWER TECH
|
||||
1 | Basic Capacitor, Basic Cell
|
||||
2 | High-Capacity Cell (10,000)
|
||||
3 | Super-Capacity Cell (20,000), Powersink, PACMAN
|
||||
4 | SUPERPACMAN
|
||||
5 | MRSPACMAN, Super Capacitor
|
||||
6 | Hyper-Capacity Cell (30,000)
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//BLUE SPACE
|
||||
1 |
|
||||
2 | Teleporter Console Board
|
||||
3 | Teleport Gun, Hand Tele
|
||||
4 | Teleportation Scroll
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//BIOTECH
|
||||
1 | Bruise Pack, Scalple
|
||||
2 | PANDEMIC Board, Mass Spectrometer
|
||||
3 | AI Core, Brains (MMI)
|
||||
4 | MMI+Radio
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//MAGNETS
|
||||
1 | Basic Sensor
|
||||
2 | Comm Console Board
|
||||
3 | Adv Sensor
|
||||
4 | Adv Mass Spectrometer, Chameleon Projector
|
||||
5 | Phasic Sensor
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//PROGRAMMING
|
||||
1 | Arcade Board
|
||||
2 | Sec Camera
|
||||
3 | Cloning Machine Console Board
|
||||
4 | AI Core, Intellicard
|
||||
5 | Pico-Manipulator, Ultra-Micro-Laser
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//SYNDICATE
|
||||
1 | Sleepypen
|
||||
2 | TYRANT Module, Emag
|
||||
3 | Cloaking Device, Power Sink
|
||||
4 |
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//COMBAT
|
||||
1 | Flashbang, Mousetrap, Nettle
|
||||
2 | Stun Baton
|
||||
3 | Power Axe, Death Nettle, Nuclear Gun
|
||||
4 |
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,867 @@
|
||||
/*
|
||||
Research and Development (R&D) Console
|
||||
|
||||
This is the main work horse of the R&D system. It contains the menus/controls for the Destructive Analyzer, Protolathe, and Circuit
|
||||
imprinter. It also contains the /datum/research holder with all the known/possible technology paths and device designs.
|
||||
|
||||
Basic use: When it first is created, it will attempt to link up to related devices within 3 squares. It'll only link up if they
|
||||
aren't already linked to another console. Any consoles it cannot link up with (either because all of a certain type are already
|
||||
linked or there aren't any in range), you'll just not have access to that menu. In the settings menu, there are menu options that
|
||||
allow a player to attempt to re-sync with nearby consoles. You can also force it to disconnect from a specific console.
|
||||
|
||||
The imprinting and construction menus do NOT require toxins access to access but all the other menus do. However, if you leave it
|
||||
on a menu, nothing is to stop the person from using the options on that menu (although they won't be able to change to a different
|
||||
one). You can also lock the console on the settings menu if you're feeling paranoid and you don't want anyone messing with it who
|
||||
doesn't have toxins access.
|
||||
|
||||
When a R&D console is destroyed or even partially disassembled, you lose all research data on it. However, there are two ways around
|
||||
this dire fate:
|
||||
- The easiest way is to go to the settings menu and select "Sync Database with Network." That causes it to upload (but not download)
|
||||
it's data to every other device in the game. Each console has a "disconnect from network" option that'll will cause data base sync
|
||||
operations to skip that console. This is useful if you want to make a "public" R&D console or, for example, give the engineers
|
||||
a circuit imprinter with certain designs on it and don't want it accidentally updating. The downside of this method is that you have
|
||||
to have physical access to the other console to send data back. Note: An R&D console is on CentCom so if a random griffan happens to
|
||||
cause a ton of data to be lost, an admin can go send it back.
|
||||
- The second method is with Technology Disks and Design Disks. Each of these disks can hold a single technology or design datum in
|
||||
it's entirety. You can then take the disk to any R&D console and upload it's data to it. This method is a lot more secure (since it
|
||||
won't update every console in existence) but it's more of a hassle to do. Also, the disks can be stolen.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/rdconsole
|
||||
name = "R&D Console"
|
||||
icon_state = "rdcomp"
|
||||
var
|
||||
datum/research/files //Stores all the collected research data.
|
||||
obj/item/weapon/disk/tech_disk/t_disk = null //Stores the technology disk.
|
||||
obj/item/weapon/disk/design_disk/d_disk = null //Stores the design disk.
|
||||
|
||||
obj/machinery/r_n_d/destructive_analyzer/linked_destroy = null //Linked Destructive Analyzer
|
||||
obj/machinery/r_n_d/protolathe/linked_lathe = null //Linked Protolathe
|
||||
obj/machinery/r_n_d/circuit_imprinter/linked_imprinter = null //Linked Circuit Imprinter
|
||||
|
||||
screen = 1.0 //Which screen is currently showing.
|
||||
id = 0 //ID of the computer (for server restrictions).
|
||||
sync = 1 //If sync = 0, it doesn't show up on Server Control Console
|
||||
emagged = 0 //Turns off ID check
|
||||
|
||||
req_access = list(access_tox) //Data and setting manipulation requires scientist access.
|
||||
|
||||
proc
|
||||
CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID.
|
||||
var/datum/tech/check_tech
|
||||
var/return_name = null
|
||||
for(var/T in typesof(/datum/tech) - /datum/tech)
|
||||
check_tech = null
|
||||
check_tech = new T()
|
||||
if(check_tech.id == ID)
|
||||
return_name = check_tech.name
|
||||
del(check_tech)
|
||||
check_tech = null
|
||||
break
|
||||
|
||||
return return_name
|
||||
|
||||
CallMaterialName(var/ID)
|
||||
var/datum/reagent/temp_reagent
|
||||
var/return_name = null
|
||||
if (copytext(ID, 1, 2) == "$")
|
||||
return_name = copytext(ID, 2)
|
||||
switch(return_name)
|
||||
if("metal")
|
||||
return_name = "Metal"
|
||||
if("glass")
|
||||
return_name = "Glass"
|
||||
if("gold")
|
||||
return_name = "Gold"
|
||||
if("silver")
|
||||
return_name = "Silver"
|
||||
if("plasma")
|
||||
return_name = "Solid Plasma"
|
||||
if("uranium")
|
||||
return_name = "Uranium"
|
||||
if("diamond")
|
||||
return_name = "Diamond"
|
||||
if("clown")
|
||||
return_name = "Bananium"
|
||||
else
|
||||
for(var/R in typesof(/datum/reagent) - /datum/reagent)
|
||||
temp_reagent = null
|
||||
temp_reagent = new R()
|
||||
if(temp_reagent.id == ID)
|
||||
return_name = temp_reagent.name
|
||||
del(temp_reagent)
|
||||
temp_reagent = null
|
||||
break
|
||||
return return_name
|
||||
|
||||
SyncRDevices() //Makes sure it is properly sync'ed up with the devices attached to it (if any).
|
||||
for(var/obj/machinery/r_n_d/D in oview(3,src))
|
||||
if(D.linked_console != null || D.disabled || D.opened)
|
||||
continue
|
||||
if(istype(D, /obj/machinery/r_n_d/destructive_analyzer))
|
||||
if(linked_destroy == null)
|
||||
linked_destroy = D
|
||||
D.linked_console = src
|
||||
else if(istype(D, /obj/machinery/r_n_d/protolathe))
|
||||
if(linked_lathe == null)
|
||||
linked_lathe = D
|
||||
D.linked_console = src
|
||||
else if(istype(D, /obj/machinery/r_n_d/circuit_imprinter))
|
||||
if(linked_imprinter == null)
|
||||
linked_imprinter = D
|
||||
D.linked_console = src
|
||||
return
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
files = new /datum/research(src) //Setup the research data holder.
|
||||
if(!id)
|
||||
for(var/obj/machinery/r_n_d/server/centcom/S in world)
|
||||
S.initialize()
|
||||
break
|
||||
|
||||
initialize()
|
||||
SyncRDevices()
|
||||
|
||||
process()
|
||||
for(var/obj/machinery/r_n_d/server/centcom/C in world) //have it automatically push research to the centcomm server so wild griffins can't fuck up R&D's work --NEO
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
C.files.AddTech2Known(T)
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
C.files.AddDesign2Known(D)
|
||||
C.files.RefreshResearch()
|
||||
|
||||
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
|
||||
//The construction/deconstruction of the console code.
|
||||
if(istype(D, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdconsole/M = new /obj/item/weapon/circuitboard/rdconsole( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdconsole/M = new /obj/item/weapon/circuitboard/rdconsole( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
//Loading a disk into it.
|
||||
else if(istype(D, /obj/item/weapon/disk))
|
||||
if(t_disk || d_disk)
|
||||
user << "A disk is already loaded into the machine."
|
||||
return
|
||||
|
||||
if(istype(D, /obj/item/weapon/disk/tech_disk)) t_disk = D
|
||||
else if (istype(D, /obj/item/weapon/disk/design_disk)) d_disk = D
|
||||
else
|
||||
user << "\red Machine cannot accept disks in that format."
|
||||
return
|
||||
user.drop_item()
|
||||
D.loc = src
|
||||
user << "\blue You add the disk to the machine!"
|
||||
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
|
||||
playsound(src.loc, 'sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "\blue You you disable the security protocols"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
usr.machine = src
|
||||
if(href_list["menu"]) //Switches menu screens. Converts a sent text string into a number. Saves a LOT of code.
|
||||
var/temp_screen = text2num(href_list["menu"])
|
||||
if(temp_screen <= 1.1 || (3 <= temp_screen && 4.9 >= temp_screen) || src.allowed(usr) || emagged) //Unless you are making something, you need access.
|
||||
screen = temp_screen
|
||||
else
|
||||
usr << "Unauthorized Access."
|
||||
|
||||
else if(href_list["updt_tech"]) //Update the research holder with information from the technology disk.
|
||||
screen = 0.0
|
||||
spawn(50)
|
||||
screen = 1.2
|
||||
files.AddTech2Known(t_disk.stored)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["clear_tech"]) //Erase data on the technology disk.
|
||||
t_disk.stored = null
|
||||
|
||||
else if(href_list["eject_tech"]) //Eject the technology disk.
|
||||
t_disk:loc = src.loc
|
||||
t_disk = null
|
||||
screen = 1.0
|
||||
|
||||
else if(href_list["copy_tech"]) //Copys some technology data from the research holder to the disk.
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
if(href_list["copy_tech_ID"] == T.id)
|
||||
t_disk.stored = T
|
||||
break
|
||||
screen = 1.2
|
||||
|
||||
else if(href_list["updt_design"]) //Updates the research holder with design data from the design disk.
|
||||
screen = 0.0
|
||||
spawn(50)
|
||||
screen = 1.4
|
||||
files.AddDesign2Known(d_disk.blueprint)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["clear_design"]) //Erases data on the design disk.
|
||||
d_disk.blueprint = null
|
||||
|
||||
else if(href_list["eject_design"]) //Eject the design disk.
|
||||
d_disk:loc = src.loc
|
||||
d_disk = null
|
||||
screen = 1.0
|
||||
|
||||
else if(href_list["copy_design"]) //Copy design data from the research holder to the design disk.
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(href_list["copy_design_ID"] == D.id)
|
||||
d_disk.blueprint = D
|
||||
break
|
||||
screen = 1.4
|
||||
|
||||
else if(href_list["eject_item"]) //Eject the item inside the destructive analyzer.
|
||||
if(linked_destroy)
|
||||
if(linked_destroy.busy)
|
||||
usr << "\red The destructive analyzer is busy at the moment."
|
||||
|
||||
else if(linked_destroy.loaded_item)
|
||||
linked_destroy.loaded_item.loc = linked_destroy.loc
|
||||
linked_destroy.loaded_item = null
|
||||
linked_destroy.icon_state = "d_analyzer"
|
||||
screen = 2.1
|
||||
|
||||
else if(href_list["deconstruct"]) //Deconstruct the item in the destructive analyzer and update the research holder.
|
||||
if(linked_destroy)
|
||||
if(linked_destroy.busy)
|
||||
usr << "\red The destructive analyzer is busy at the moment."
|
||||
else
|
||||
var/choice = input("Proceeding will destroy loaded item.") in list("Proceed", "Cancel")
|
||||
if(choice == "Cancel") return
|
||||
linked_destroy.busy = 1
|
||||
screen = 0.1
|
||||
updateUsrDialog()
|
||||
flick("d_analyzer_process", linked_destroy)
|
||||
spawn(24)
|
||||
if(linked_destroy)
|
||||
linked_destroy.busy = 0
|
||||
if(!linked_destroy.hacked)
|
||||
if(!linked_destroy.loaded_item)
|
||||
usr <<"\red The destructive analyzer appears to be empty."
|
||||
return
|
||||
if(linked_destroy.loaded_item.reliability >= 90)
|
||||
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
|
||||
for(var/T in temp_tech)
|
||||
files.UpdateTech(T, temp_tech[T])
|
||||
if(linked_destroy.loaded_item.reliability < 100 && linked_destroy.loaded_item.crit_fail)
|
||||
files.UpdateDesign(linked_destroy.loaded_item.type)
|
||||
if(linked_lathe) //Also sends salvaged materials to a linked protolathe, if any.
|
||||
linked_lathe.m_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.m_amt*linked_destroy.decon_mod))
|
||||
linked_lathe.g_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.g_amt*linked_destroy.decon_mod))
|
||||
linked_destroy.loaded_item = null
|
||||
for(var/obj/I in linked_destroy.contents)
|
||||
for(var/mob/M in I.contents)
|
||||
M.death()
|
||||
del(I)
|
||||
use_power(250)
|
||||
linked_destroy.icon_state = "d_analyzer"
|
||||
screen = 1.0
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["lock"]) //Lock the console from use by anyone without tox access.
|
||||
if(src.allowed(usr))
|
||||
screen = text2num(href_list["lock"])
|
||||
else
|
||||
usr << "Unauthorized Access."
|
||||
|
||||
else if(href_list["sync"]) //Sync the research holder with all the R&D consoles in the game that aren't sync protected.
|
||||
screen = 0.0
|
||||
if(!sync)
|
||||
usr << "\red You must connect to the network first!"
|
||||
else
|
||||
spawn(30)
|
||||
if(src)
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
var/server_processed = 0
|
||||
if(S.disabled)
|
||||
continue
|
||||
if((id in S.id_with_upload) || istype(S, /obj/machinery/r_n_d/server/centcom))
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
S.files.AddTech2Known(T)
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
S.files.AddDesign2Known(D)
|
||||
S.files.RefreshResearch()
|
||||
server_processed = 1
|
||||
if(((id in S.id_with_download) && !istype(S, /obj/machinery/r_n_d/server/centcom)) || S.hacked)
|
||||
for(var/datum/tech/T in S.files.known_tech)
|
||||
files.AddTech2Known(T)
|
||||
for(var/datum/design/D in S.files.known_designs)
|
||||
files.AddDesign2Known(D)
|
||||
files.RefreshResearch()
|
||||
server_processed = 1
|
||||
if(!istype(S, /obj/machinery/r_n_d/server/centcom) && server_processed)
|
||||
S.produce_heat(100)
|
||||
screen = 1.6
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["togglesync"]) //Prevents the console from being synced by other consoles. Can still send data.
|
||||
sync = !sync
|
||||
|
||||
else if(href_list["build"]) //Causes the Protolathe to build something.
|
||||
if(linked_lathe)
|
||||
var/datum/design/being_built = null
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(D.id == href_list["build"])
|
||||
being_built = D
|
||||
break
|
||||
var/power = 2000
|
||||
for(var/M in being_built.materials)
|
||||
power += round(being_built.materials[M] / 5)
|
||||
power = max(2000, power)
|
||||
screen = 0.3
|
||||
linked_lathe.busy = 1
|
||||
flick("protolathe_n",linked_lathe)
|
||||
spawn(16)
|
||||
use_power(power)
|
||||
spawn(16)
|
||||
for(var/M in being_built.materials)
|
||||
switch(M)
|
||||
if("$metal")
|
||||
linked_lathe.m_amount = max(0, (linked_lathe.m_amount-being_built.materials[M]))
|
||||
if("$glass")
|
||||
linked_lathe.g_amount = max(0, (linked_lathe.g_amount-being_built.materials[M]))
|
||||
if("$gold")
|
||||
linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount-being_built.materials[M]))
|
||||
if("$silver")
|
||||
linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount-being_built.materials[M]))
|
||||
if("$plasma")
|
||||
linked_lathe.plasma_amount = max(0, (linked_lathe.plasma_amount-being_built.materials[M]))
|
||||
if("$uranium")
|
||||
linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-being_built.materials[M]))
|
||||
if("$diamond")
|
||||
linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-being_built.materials[M]))
|
||||
if("$clown")
|
||||
linked_lathe.clown_amount = max(0, (linked_lathe.clown_amount-being_built.materials[M]))
|
||||
else
|
||||
linked_lathe.reagents.remove_reagent(M, being_built.materials[M])
|
||||
|
||||
if(being_built.build_path)
|
||||
var/obj/new_item = new being_built.build_path(src)
|
||||
new_item.reliability = being_built.reliability
|
||||
if(linked_lathe.hacked) being_built.reliability = max((reliability / 2), 0)
|
||||
new_item.loc = linked_lathe.loc
|
||||
linked_lathe.busy = 0
|
||||
screen = 3.1
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["imprint"]) //Causes the Circuit Imprinter to build something.
|
||||
if(linked_imprinter)
|
||||
var/datum/design/being_built = null
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(D.id == href_list["imprint"])
|
||||
being_built = D
|
||||
break
|
||||
var/power = 2000
|
||||
for(var/M in being_built.materials)
|
||||
power += round(being_built.materials[M] / 5)
|
||||
power = max(2000, power)
|
||||
screen = 0.4
|
||||
linked_imprinter.busy = 1
|
||||
flick("circuit_imprinter_ani",linked_imprinter)
|
||||
spawn(16)
|
||||
use_power(power)
|
||||
for(var/M in being_built.materials)
|
||||
switch(M)
|
||||
if("$glass")
|
||||
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]))
|
||||
if("$gold")
|
||||
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]))
|
||||
if("$diamond")
|
||||
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]))
|
||||
else
|
||||
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M])
|
||||
var/obj/new_item = new being_built.build_path(src)
|
||||
new_item.reliability = being_built.reliability
|
||||
if(linked_imprinter.hacked) being_built.reliability = max((reliability / 2), 0)
|
||||
new_item.loc = linked_imprinter.loc
|
||||
linked_imprinter.busy = 0
|
||||
screen = 4.1
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["disposeI"] && linked_imprinter) //Causes the circuit imprinter to dispose of a single reagent (all of it)
|
||||
linked_imprinter.reagents.del_reagent(href_list["dispose"])
|
||||
|
||||
else if(href_list["disposeallI"] && linked_imprinter) //Causes the circuit imprinter to dispose of all it's reagents.
|
||||
linked_imprinter.reagents.clear_reagents()
|
||||
|
||||
else if(href_list["disposeP"] && linked_lathe) //Causes the protolathe to dispose of a single reagent (all of it)
|
||||
linked_lathe.reagents.del_reagent(href_list["dispose"])
|
||||
|
||||
else if(href_list["disposeallP"] && linked_lathe) //Causes the protolathe to dispose of all it's reagents.
|
||||
linked_lathe.reagents.clear_reagents()
|
||||
|
||||
else if(href_list["lathe_ejectsheet"] && linked_lathe) //Causes the protolathe to eject a sheet of material
|
||||
var/desired_num_sheets = text2num(href_list["lathe_ejectsheet_amt"])
|
||||
var/res_amount, type
|
||||
switch(href_list["lathe_ejectsheet"])
|
||||
if("metal")
|
||||
type = /obj/item/stack/sheet/metal
|
||||
res_amount = "m_amount"
|
||||
if("glass")
|
||||
type = /obj/item/stack/sheet/glass
|
||||
res_amount = "g_amount"
|
||||
if("gold")
|
||||
type = /obj/item/stack/sheet/gold
|
||||
res_amount = "gold_amount"
|
||||
if("silver")
|
||||
type = /obj/item/stack/sheet/silver
|
||||
res_amount = "silver_amount"
|
||||
if("plasma")
|
||||
type = /obj/item/stack/sheet/plasma
|
||||
res_amount = "plasma_amount"
|
||||
if("uranium")
|
||||
type = /obj/item/stack/sheet/uranium
|
||||
res_amount = "uranium_amount"
|
||||
if("diamond")
|
||||
type = /obj/item/stack/sheet/diamond
|
||||
res_amount = "diamond_amount"
|
||||
if("clown")
|
||||
type = /obj/item/stack/sheet/clown
|
||||
res_amount = "clown_amount"
|
||||
if(ispath(type) && hasvar(linked_lathe, res_amount))
|
||||
var/obj/item/stack/sheet/sheet = new type(linked_lathe.loc)
|
||||
var/available_num_sheets = round(linked_lathe.vars[res_amount]/sheet.perunit)
|
||||
if(available_num_sheets>0)
|
||||
sheet.amount = min(available_num_sheets, desired_num_sheets)
|
||||
linked_lathe.vars[res_amount] = max(0, (linked_lathe.vars[res_amount]-sheet.amount * sheet.perunit))
|
||||
else
|
||||
del sheet
|
||||
else if(href_list["imprinter_ejectsheet"] && linked_imprinter) //Causes the protolathe to eject a sheet of material
|
||||
var/desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"])
|
||||
var/res_amount, type
|
||||
switch(href_list["imprinter_ejectsheet"])
|
||||
if("glass")
|
||||
type = /obj/item/stack/sheet/glass
|
||||
res_amount = "g_amount"
|
||||
if("gold")
|
||||
type = /obj/item/stack/sheet/gold
|
||||
res_amount = "gold_amount"
|
||||
if("diamond")
|
||||
type = /obj/item/stack/sheet/diamond
|
||||
res_amount = "diamond_amount"
|
||||
if(ispath(type) && hasvar(linked_imprinter, res_amount))
|
||||
var/obj/item/stack/sheet/sheet = new type(linked_imprinter.loc)
|
||||
var/available_num_sheets = round(linked_imprinter.vars[res_amount]/sheet.perunit)
|
||||
if(available_num_sheets>0)
|
||||
sheet.amount = min(available_num_sheets, desired_num_sheets)
|
||||
linked_imprinter.vars[res_amount] = max(0, (linked_imprinter.vars[res_amount]-sheet.amount * sheet.perunit))
|
||||
else
|
||||
del sheet
|
||||
|
||||
else if(href_list["find_device"]) //The R&D console looks for devices nearby to link up with.
|
||||
screen = 0.0
|
||||
spawn(20)
|
||||
SyncRDevices()
|
||||
screen = 1.7
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["disconnect"]) //The R&D console disconnects with a specific device.
|
||||
switch(href_list["disconnect"])
|
||||
if("destroy")
|
||||
linked_destroy.linked_console = null
|
||||
linked_destroy = null
|
||||
if("lathe")
|
||||
linked_lathe.linked_console = null
|
||||
linked_lathe = null
|
||||
if("imprinter")
|
||||
linked_imprinter.linked_console = null
|
||||
linked_imprinter = null
|
||||
|
||||
else if(href_list["reset"]) //Reset the R&D console's database.
|
||||
var/choice = alert("R&D Console Database Reset", "Are you sure you want to reset the R&D console's database? Data lost cannot be recovered.", "Continue", "Cancel")
|
||||
if(choice == "Continue")
|
||||
screen = 0.0
|
||||
del(files)
|
||||
files = new /datum/research(src)
|
||||
spawn(20)
|
||||
screen = 1.6
|
||||
updateUsrDialog()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
if(ishuman(user))
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
call(/obj/item/clothing/gloves/space_ninja/proc/drain)("RESEARCH",src,user:wear_suit)
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
files.RefreshResearch()
|
||||
switch(screen) //A quick check to make sure you get the right screen when a device is disconnected.
|
||||
if(2 to 2.9)
|
||||
if(linked_destroy == null)
|
||||
screen = 2.0
|
||||
else if(linked_destroy.loaded_item == null)
|
||||
screen = 2.1
|
||||
else
|
||||
screen = 2.2
|
||||
if(3 to 3.9)
|
||||
if(linked_lathe == null)
|
||||
screen = 3.0
|
||||
if(4 to 4.9)
|
||||
if(linked_imprinter == null)
|
||||
screen = 4.0
|
||||
|
||||
switch(screen)
|
||||
|
||||
//////////////////////R&D CONSOLE SCREENS//////////////////
|
||||
if(0.0) dat += "Updating Database...."
|
||||
|
||||
if(0.1) dat += "Processing and Updating Database..."
|
||||
|
||||
if(0.2)
|
||||
dat += "SYSTEM LOCKED<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];lock=1.6'>Unlock</A>"
|
||||
|
||||
if(0.3)
|
||||
dat += "Constructing Prototype. Please Wait..."
|
||||
|
||||
if(0.4)
|
||||
dat += "Imprinting Circuit. Please Wait..."
|
||||
|
||||
if(1.0) //Main Menu
|
||||
dat += "Main Menu:<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.1'>Current Research Levels</A><BR>"
|
||||
if(t_disk) dat += "<A href='?src=\ref[src];menu=1.2'>Disk Operations</A><BR>"
|
||||
else if(d_disk) dat += "<A href='?src=\ref[src];menu=1.4'>Disk Operations</A><BR>"
|
||||
else dat += "(Please Insert Disk)<BR>"
|
||||
if(linked_destroy != null) dat += "<A href='?src=\ref[src];menu=2.2'>Destructive Analyzer Menu</A><BR>"
|
||||
if(linked_lathe != null) dat += "<A href='?src=\ref[src];menu=3.1'>Protolathe Construction Menu</A><BR>"
|
||||
if(linked_imprinter != null) dat += "<A href='?src=\ref[src];menu=4.1'>Circuit Construction Menu</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.6'>Settings</A>"
|
||||
|
||||
if(1.1) //Research viewer
|
||||
dat += "Current Research Levels:<BR><BR>"
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
dat += "[T.name]<BR>"
|
||||
dat += "* Level: [T.level]<BR>"
|
||||
dat += "* Summary: [T.desc]<HR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.2) //Technology Disk Menu
|
||||
dat += "Disk Contents: (Technology Data Disk)<BR><BR>"
|
||||
if(t_disk.stored == null)
|
||||
dat += "The disk has no data stored on it.<HR>"
|
||||
dat += "Operations: "
|
||||
dat += "<A href='?src=\ref[src];menu=1.3'>Load Tech to Disk</A> || "
|
||||
else
|
||||
dat += "Name: [t_disk.stored.name]<BR>"
|
||||
dat += "Level: [t_disk.stored.level]<BR>"
|
||||
dat += "Description: [t_disk.stored.desc]<HR>"
|
||||
dat += "Operations: "
|
||||
dat += "<A href='?src=\ref[src];updt_tech=1'>Upload to Database</A> || "
|
||||
dat += "<A href='?src=\ref[src];clear_tech=1'>Clear Disk</A> || "
|
||||
dat += "<A href='?src=\ref[src];eject_tech=1'>Eject Disk</A><HR>"
|
||||
dat += "<BR><A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.3) //Technology Disk submenu
|
||||
dat += "Load Technology to Disk:<BR><BR>"
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
dat += "[T.name] "
|
||||
dat += "<A href='?src=\ref[src];copy_tech=1;copy_tech_ID=[T.id]'>(Copy to Disk)</A><BR>"
|
||||
dat += "<HR><BR><A href='?src=\ref[src];menu=1.0'>Main Menu</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.2'>Return to Disk Operations</A>"
|
||||
|
||||
if(1.4) //Design Disk menu.
|
||||
if(d_disk.blueprint == null)
|
||||
dat += "The disk has no data stored on it.<HR>"
|
||||
dat += "Operations: "
|
||||
dat += "<A href='?src=\ref[src];menu=1.5'>Load Design to Disk</A> || "
|
||||
else
|
||||
dat += "Name: [d_disk.blueprint.name]<BR>"
|
||||
dat += "Level: [between(0, (d_disk.blueprint.reliability + rand(-15,15)), 100)]<BR>"
|
||||
switch(d_disk.blueprint.build_type)
|
||||
if(IMPRINTER) dat += "Lathe Type: Circuit Imprinter<BR>"
|
||||
if(PROTOLATHE) dat += "Lathe Type: Proto-lathe<BR>"
|
||||
if(AUTOLATHE) dat += "Lathe Type: Auto-lathe<BR>"
|
||||
dat += "Required Materials:<BR>"
|
||||
for(var/M in d_disk.blueprint.materials)
|
||||
if(copytext(M, 1, 2) == "$") dat += "* [copytext(M, 2)] x [d_disk.blueprint.materials[M]]<BR>"
|
||||
else dat += "* [M] x [d_disk.blueprint.materials[M]]<BR>"
|
||||
dat += "<HR>Operations: "
|
||||
dat += "<A href='?src=\ref[src];updt_design=1'>Upload to Database</A> || "
|
||||
dat += "<A href='?src=\ref[src];clear_design=1'>Clear Disk</A> || "
|
||||
dat += "<A href='?src=\ref[src];eject_design=1'>Eject Disk</A><HR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.5) //Technology disk submenu
|
||||
dat += "Load Design to Disk:<BR><BR>"
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
dat += "[D.name] "
|
||||
dat += "<A href='?src=\ref[src];copy_design=1;copy_design_ID=[D.id]'>(Copy to Disk)</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=1.0'>Main Menu</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.4'>Return to Disk Operations</A>"
|
||||
|
||||
if(1.6) //R&D console settings
|
||||
dat += "R&D Console Setting:<BR><BR>"
|
||||
if(sync)
|
||||
dat += "<A href='?src=\ref[src];sync=1'>Sync Database with Network</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];togglesync=1'>Disconnect from Research Network</A><BR>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];togglesync=1'>Connect to Research Network</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.7'>Device Linkage Menu</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];lock=0.2'>Lock Console</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];reset=1'>Reset R&D Database.</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.7) //R&D device linkage
|
||||
dat += "R&D Console Device Linkage Menu:<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];find_device=1'>Re-sync with Nearby Devices</A><BR>"
|
||||
dat += "Linked Devices:<BR>"
|
||||
if(linked_destroy)
|
||||
dat += "* Destructive Analyzer <A href='?src=\ref[src];disconnect=destroy'>(Disconnect)</A><BR>"
|
||||
else
|
||||
dat += "* (No Destructive Analyzer Linked)<BR>"
|
||||
if(linked_lathe)
|
||||
dat += "* Protolathe <A href='?src=\ref[src];disconnect=lathe'>(Disconnect)</A><BR>"
|
||||
else
|
||||
dat += "* (No Protolathe Linked)<BR>"
|
||||
if(linked_imprinter)
|
||||
dat += "* Circuit Imprinter <A href='?src=\ref[src];disconnect=imprinter'>(Disconnect)</A><BR>"
|
||||
else
|
||||
dat += "* (No Circuit Imprinter Linked)<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=1.6'>Settings Menu</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
////////////////////DESTRUCTIVE ANALYZER SCREENS////////////////////////////
|
||||
if(2.0)
|
||||
dat += "NO DESTRUCTIVE ANALYZER LINKED TO CONSOLE<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(2.1)
|
||||
dat += "No Item Loaded. Standing-by...<BR><HR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(2.2)
|
||||
dat += "Deconstruction Menu<HR>"
|
||||
dat += "Name: [linked_destroy.loaded_item.name]<BR>"
|
||||
dat += "Origin Tech:<BR>"
|
||||
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
|
||||
for(var/T in temp_tech)
|
||||
dat += "* [CallTechName(T)] [temp_tech[T]]<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];deconstruct=1'>Deconstruct Item</A> || "
|
||||
dat += "<A href='?src=\ref[src];eject_item=1'>Eject Item</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
/////////////////////PROTOLATHE SCREENS/////////////////////////
|
||||
if(3.0)
|
||||
dat += "NO PROTOLATHE LINKED TO CONSOLE<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(3.1)
|
||||
dat += "Protolathe Menu:<BR><BR>"
|
||||
dat += "<B>Material Amount:</B> [linked_lathe.TotalMaterials()] cm<sup>3</sup> (MAX: [linked_lathe.max_material_storage])<BR>"
|
||||
dat += "<B>Chemical Volume:</B> [linked_lathe.reagents.total_volume] (MAX: [linked_lathe.reagents.maximum_volume])<HR>"
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(!(D.build_type & PROTOLATHE))
|
||||
continue
|
||||
var/temp_dat = "[D.name]"
|
||||
var/check_materials = 1
|
||||
for(var/M in D.materials)
|
||||
temp_dat += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
if(copytext(M, 1, 2) == "$")
|
||||
switch(M)
|
||||
if("$glass")
|
||||
if(D.materials[M] > linked_lathe.g_amount) check_materials = 0
|
||||
if("$metal")
|
||||
if(D.materials[M] > linked_lathe.m_amount) check_materials = 0
|
||||
if("$gold")
|
||||
if(D.materials[M] > linked_lathe.gold_amount) check_materials = 0
|
||||
if("$silver")
|
||||
if(D.materials[M] > linked_lathe.silver_amount) check_materials = 0
|
||||
if("$plasma")
|
||||
if(D.materials[M] > linked_lathe.plasma_amount) check_materials = 0
|
||||
if("$uranium")
|
||||
if(D.materials[M] > linked_lathe.uranium_amount) check_materials = 0
|
||||
if("$diamond")
|
||||
if(D.materials[M] > linked_lathe.diamond_amount) check_materials = 0
|
||||
if("$clown")
|
||||
if(D.materials[M] > linked_lathe.clown_amount) check_materials = 0
|
||||
else if (!linked_lathe.reagents.has_reagent(M, D.materials[M]))
|
||||
check_materials = 0
|
||||
if (check_materials)
|
||||
dat += "* <A href='?src=\ref[src];build=[D.id]'>[temp_dat]</A><BR>"
|
||||
else
|
||||
dat += "* [temp_dat]<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=3.2'>Material Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=3.3'>Chemical Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(3.2) //Protolathe Material Storage Sub-menu
|
||||
dat += "Material Storage<BR><HR>"
|
||||
//Metal
|
||||
dat += "* [linked_lathe.m_amount] cm<sup>3</sup> of Metal || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.m_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=metal;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.m_amount > 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=metal;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.m_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=metal;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Glass
|
||||
dat += "* [linked_lathe.g_amount] cm<sup>3</sup> of Glass || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.g_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=glass;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.g_amount > 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=glass;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.g_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=glass;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Gold
|
||||
dat += "* [linked_lathe.gold_amount] cm<sup>3</sup> of Gold || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.gold_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=gold;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.gold_amount > 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=gold;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.gold_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=gold;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Silver
|
||||
dat += "* [linked_lathe.silver_amount] cm<sup>3</sup> of Silver || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.silver_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=silver;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.silver_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=silver;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.silver_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=silver;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Plasma
|
||||
dat += "* [linked_lathe.plasma_amount] cm<sup>3</sup> of Solid Plasma || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.plasma_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=plasma;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.plasma_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=plasma;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.plasma_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=plasmalathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Uranium
|
||||
dat += "* [linked_lathe.uranium_amount] cm<sup>3</sup> of Uranium || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.uranium_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=uranium;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.uranium_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=uranium;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.uranium_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=uranium;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Diamond
|
||||
dat += "* [linked_lathe.diamond_amount] cm<sup>3</sup> of Diamond || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.diamond_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.diamond_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.diamond_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Bananium
|
||||
dat += "* [linked_lathe.clown_amount] cm<sup>3</sup> of Bananium || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.clown_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.clown_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.clown_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
|
||||
dat += "<HR><A href='?src=\ref[src];menu=3.1'>Protolathe Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(3.3) //Protolathe Chemical Storage Submenu
|
||||
dat += "Chemical Storage<BR><HR>"
|
||||
for(var/datum/reagent/R in linked_lathe.reagents.reagent_list)
|
||||
dat += "Name: [R.name] | Units: [R.volume] "
|
||||
dat += "<A href='?src=\ref[src];disposeP=[R.id]'>(Purge)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];disposeallP=1'><U>Disposal All Chemicals in Storage</U></A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=3.1'>Protolathe Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
///////////////////CIRCUIT IMPRINTER SCREENS////////////////////
|
||||
if(4.0)
|
||||
dat += "NO CIRCUIT IMPRINTER LINKED TO CONSOLE<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(4.1)
|
||||
dat += "Circuit Imprinter Menu:<BR><BR>"
|
||||
dat += "Material Amount: [linked_imprinter.TotalMaterials()] cm<sup>3</sup><BR>"
|
||||
dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]<HR>"
|
||||
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(!(D.build_type & IMPRINTER))
|
||||
continue
|
||||
var/temp_dat = "[D.name]"
|
||||
var/check_materials = 1
|
||||
for(var/M in D.materials)
|
||||
temp_dat += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
if(copytext(M, 1, 2) == "$")
|
||||
switch(M)
|
||||
if("$glass")
|
||||
if(D.materials[M] > linked_imprinter.g_amount) check_materials = 0
|
||||
if("$gold")
|
||||
if(D.materials[M] > linked_imprinter.gold_amount) check_materials = 0
|
||||
if("$diamond")
|
||||
if(D.materials[M] > linked_imprinter.diamond_amount) check_materials = 0
|
||||
else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M]))
|
||||
check_materials = 0
|
||||
if (check_materials)
|
||||
dat += "* <A href='?src=\ref[src];imprint=[D.id]'>[temp_dat]</A><BR>"
|
||||
else
|
||||
dat += "* [temp_dat]<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=4.3'>Material Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=4.2'>Chemical Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(4.2)
|
||||
dat += "Chemical Storage<BR><HR>"
|
||||
for(var/datum/reagent/R in linked_imprinter.reagents.reagent_list)
|
||||
dat += "Name: [R.name] | Units: [R.volume] "
|
||||
dat += "<A href='?src=\ref[src];disposeI=[R.id]'>(Purge)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];disposeallI=1'><U>Disposal All Chemicals in Storage</U></A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=4.1'>Imprinter Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(4.3)
|
||||
dat += "Material Storage<BR><HR>"
|
||||
//Glass
|
||||
dat += "* [linked_imprinter.g_amount] cm<sup>3</sup> of Glass || "
|
||||
dat += "Eject: "
|
||||
if(linked_imprinter.g_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=glass;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.g_amount > 18750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=glass;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.g_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=glass;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Gold
|
||||
dat += "* [linked_imprinter.gold_amount] cm<sup>3</sup> of Gold || "
|
||||
dat += "Eject: "
|
||||
if(linked_imprinter.gold_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=gold;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.gold_amount > 18750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=gold;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.gold_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=gold;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Diamond
|
||||
dat += "* [linked_imprinter.diamond_amount] cm<sup>3</sup> of Diamond || "
|
||||
dat += "Eject: "
|
||||
if(linked_imprinter.diamond_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.diamond_amount > 18750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.diamond_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
|
||||
dat += "<HR><A href='?src=\ref[src];menu=4.1'>Circuit Imprinter Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
user << browse("<TITLE>Research and Development Console</TITLE><HR>[dat]", "window=rdconsole;size=575x400")
|
||||
onclose(user, "rdconsole")
|
||||
@@ -0,0 +1,105 @@
|
||||
//All devices that link into the R&D console fall into thise type for easy identification and some shared procs.
|
||||
|
||||
|
||||
/obj/machinery/r_n_d
|
||||
name = "R&D Device"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
var
|
||||
busy = 0
|
||||
hacked = 0
|
||||
disabled = 0
|
||||
shocked = 0
|
||||
list/wires = list()
|
||||
hack_wire
|
||||
disable_wire
|
||||
shock_wire
|
||||
opened = 0
|
||||
obj/machinery/computer/rdconsole/linked_console
|
||||
|
||||
New()
|
||||
..()
|
||||
wires["Red"] = 0
|
||||
wires["Blue"] = 0
|
||||
wires["Green"] = 0
|
||||
wires["Yellow"] = 0
|
||||
wires["Black"] = 0
|
||||
wires["White"] = 0
|
||||
var/list/w = list("Red","Blue","Green","Yellow","Black","White")
|
||||
src.hack_wire = pick(w)
|
||||
w -= src.hack_wire
|
||||
src.shock_wire = pick(w)
|
||||
w -= src.shock_wire
|
||||
src.disable_wire = pick(w)
|
||||
w -= src.disable_wire
|
||||
|
||||
proc
|
||||
shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return 0
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if(opened)
|
||||
var/dat as text
|
||||
dat += "[src.name] Wires:<BR>"
|
||||
for(var/wire in src.wires)
|
||||
dat += text("[wire] Wire: <A href='?src=\ref[src];wire=[wire];cut=1'>[src.wires[wire] ? "Mend" : "Cut"]</A> <A href='?src=\ref[src];wire=[wire];pulse=1'>Pulse</A><BR>")
|
||||
|
||||
dat += text("The red light is [src.disabled ? "off" : "on"].<BR>")
|
||||
dat += text("The green light is [src.shocked ? "off" : "on"].<BR>")
|
||||
dat += text("The blue light is [src.hacked ? "off" : "on"].<BR>")
|
||||
user << browse("<HTML><HEAD><TITLE>[src.name] Hacking</TITLE></HEAD><BODY>[dat]</BODY></HTML>","window=hack_win")
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["pulse"])
|
||||
var/temp_wire = href_list["wire"]
|
||||
if (!istype(usr.equipped(), /obj/item/device/multitool))
|
||||
usr << "You need a multitool!"
|
||||
else
|
||||
if(src.wires[temp_wire])
|
||||
usr << "You can't pulse a cut wire."
|
||||
else
|
||||
if(src.hack_wire == href_list["wire"])
|
||||
src.hacked = !src.hacked
|
||||
spawn(100) src.hacked = !src.hacked
|
||||
if(src.disable_wire == href_list["wire"])
|
||||
src.disabled = !src.disabled
|
||||
src.shock(usr,50)
|
||||
spawn(100) src.disabled = !src.disabled
|
||||
if(src.shock_wire == href_list["wire"])
|
||||
src.shocked = !src.shocked
|
||||
src.shock(usr,50)
|
||||
spawn(100) src.shocked = !src.shocked
|
||||
if(href_list["cut"])
|
||||
if (!istype(usr.equipped(), /obj/item/weapon/wirecutters))
|
||||
usr << "You need wirecutters!"
|
||||
else
|
||||
var/temp_wire = href_list["wire"]
|
||||
wires[temp_wire] = !wires[temp_wire]
|
||||
if(src.hack_wire == temp_wire)
|
||||
src.hacked = !src.hacked
|
||||
if(src.disable_wire == temp_wire)
|
||||
src.disabled = !src.disabled
|
||||
src.shock(usr,50)
|
||||
if(src.shock_wire == temp_wire)
|
||||
src.shocked = !src.shocked
|
||||
src.shock(usr,50)
|
||||
src.updateUsrDialog()
|
||||
@@ -0,0 +1,254 @@
|
||||
/*
|
||||
General Explination:
|
||||
The research datum is the "folder" where all the research information is stored in a R&D console. It's also a holder for all the
|
||||
various procs used to manipulate it. It has four variables and seven procs:
|
||||
|
||||
Variables:
|
||||
- possible_tech is a list of all the /datum/tech that can potentially be researched by the player. The RefreshResearch() proc
|
||||
(explained later) only goes through those when refreshing what you know. Generally, possible_tech contains ALL of the existing tech
|
||||
but it is possible to add tech to the game that DON'T start in it (example: Xeno tech). Generally speaking, you don't want to mess
|
||||
with these since they should be the default version of the datums. They're actually stored in a list rather then using typesof to
|
||||
refer to them since it makes it a bit easier to search through them for specific information.
|
||||
- know_tech is the companion list to possible_tech. It's the tech you can actually research and improve. Until it's added to this
|
||||
list, it can't be improved. All the tech in this list are visible to the player.
|
||||
- possible_designs is functionally identical to possbile_tech except it's for /datum/design.
|
||||
- known_designs is functionally identical to known_tech except it's for /datum/design
|
||||
|
||||
Procs:
|
||||
- TechHasReqs: Used by other procs (specifically RefreshResearch) to see whether all of a tech's requirements are currently in
|
||||
known_tech and at a high enough level.
|
||||
- DesignHasReqs: Same as TechHasReqs but for /datum/design and known_design.
|
||||
- AddTech2Known: Adds a /datum/tech to known_tech. It checks to see whether it already has that tech (if so, it just replaces it). If
|
||||
it doesn't have it, it adds it. Note: It does NOT check possible_tech at all. So if you want to add something strange to it (like
|
||||
a player made tech?) you can.
|
||||
- AddDesign2Known: Same as AddTech2Known except for /datum/design and known_designs.
|
||||
- RefreshResearch: This is the workhorse of the R&D system. It updates the /datum/research holder and adds any unlocked tech paths
|
||||
and designs you have reached the requirements for. It only checks through possible_tech and possible_designs, however, so it won't
|
||||
accidentally add "secret" tech to it.
|
||||
- UpdateTech is used as part of the actual researching process. It takes an ID and finds techs with that same ID in known_tech. When
|
||||
it finds it, it checks to see whether it can improve it at all. If the known_tech's level is less then or equal to
|
||||
the inputted level, it increases the known tech's level to the inputted level -1 or know tech's level +1 (whichever is higher).
|
||||
|
||||
The tech datums are the actual "tech trees" that you improve through researching. Each one has five variables:
|
||||
- Name: Pretty obvious. This is often viewable to the players.
|
||||
- Desc: Pretty obvious. Also player viewable.
|
||||
- ID: This is the unique ID of the tech that is used by the various procs to find and/or maniuplate it.
|
||||
- Level: This is the current level of the tech. All techs start at 1 and have a max of 20. Devices and some techs require a certain
|
||||
level in specific techs before you can produce them.
|
||||
- Req_tech: This is a list of the techs required to unlock this tech path. If left blank, it'll automatically be loaded into the
|
||||
research holder datum.
|
||||
|
||||
*/
|
||||
/***************************************************************
|
||||
** Master Types **
|
||||
** Includes all the helper procs and basic tech processing. **
|
||||
***************************************************************/
|
||||
|
||||
/datum/research //Holder for all the existing, archived, and known tech. Individual to console.
|
||||
var
|
||||
list //Datum/tech go here.
|
||||
possible_tech = list() //List of all tech in the game that players have access to (barring special events).
|
||||
known_tech = list() //List of locally known tech.
|
||||
possible_designs = list() //List of all designs (at base reliability).
|
||||
known_designs = list() //List of available designs (at base reliability).
|
||||
|
||||
New() //Insert techs into possible_tech here. Known_tech automatically updated.
|
||||
for(var/T in typesof(/datum/tech) - /datum/tech)
|
||||
possible_tech += new T(src)
|
||||
for(var/D in typesof(/datum/design) - /datum/design)
|
||||
possible_designs += new D(src)
|
||||
RefreshResearch()
|
||||
|
||||
proc
|
||||
|
||||
//Checks to see if tech has all the required pre-reqs.
|
||||
//Input: datum/tech; Output: 0/1 (false/true)
|
||||
TechHasReqs(var/datum/tech/T)
|
||||
if(T.req_tech.len == 0)
|
||||
return 1
|
||||
var/matches = 0
|
||||
for(var/req in T.req_tech)
|
||||
for(var/datum/tech/known in known_tech)
|
||||
if((req == known.id) && (known.level >= T.req_tech[req]))
|
||||
matches++
|
||||
break
|
||||
if(matches == T.req_tech.len)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
//Checks to see if design has all the required pre-reqs.
|
||||
//Input: datum/design; Output: 0/1 (false/true)
|
||||
DesignHasReqs(var/datum/design/D)
|
||||
if(D.req_tech.len == 0)
|
||||
return 1
|
||||
var/matches = 0
|
||||
for(var/req in D.req_tech)
|
||||
for(var/datum/tech/known in known_tech)
|
||||
if((req == known.id) && (known.level >= D.req_tech[req]))
|
||||
matches++
|
||||
break
|
||||
if(matches == D.req_tech.len)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
//Adds a tech to known_tech list. Checks to make sure there aren't duplicates and updates existing tech's levels if needed.
|
||||
//Input: datum/tech; Output: Null
|
||||
AddTech2Known(var/datum/tech/T)
|
||||
for(var/datum/tech/known in known_tech)
|
||||
if(T.id == known.id)
|
||||
if(T.level > known.level)
|
||||
known.level = T.level
|
||||
return
|
||||
known_tech += T
|
||||
return
|
||||
|
||||
AddDesign2Known(var/datum/design/D)
|
||||
for(var/datum/design/known in known_designs)
|
||||
if(D.id == known.id)
|
||||
if(D.reliability_mod > known.reliability_mod)
|
||||
known.reliability_mod = D.reliability_mod
|
||||
return
|
||||
known_designs += D
|
||||
return
|
||||
|
||||
//Refreshes known_tech and known_designs list. Then updates the reliability vars of the designs in the known_designs list.
|
||||
//Input/Output: n/a
|
||||
RefreshResearch()
|
||||
for(var/datum/tech/PT in possible_tech)
|
||||
if(TechHasReqs(PT))
|
||||
AddTech2Known(PT)
|
||||
for(var/datum/design/PD in possible_designs)
|
||||
if(DesignHasReqs(PD))
|
||||
AddDesign2Known(PD)
|
||||
for(var/datum/tech/T in known_tech)
|
||||
T = between(1,T.level,20)
|
||||
for(var/datum/design/D in known_designs)
|
||||
D.CalcReliability(known_tech)
|
||||
return
|
||||
|
||||
//Refreshes the levels of a given tech.
|
||||
//Input: Tech's ID and Level; Output: null
|
||||
UpdateTech(var/ID, var/level)
|
||||
for(var/datum/tech/KT in known_tech)
|
||||
if(KT.id == ID)
|
||||
if(KT.level <= level) KT.level = max((KT.level + 1), (level - 1))
|
||||
return
|
||||
|
||||
UpdateDesign(var/path)
|
||||
for(var/datum/design/KD in known_designs)
|
||||
if(KD.build_path == path)
|
||||
KD.reliability_mod += rand(1,2)
|
||||
break
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************************
|
||||
** Technology Datums **
|
||||
** Includes all the various technoliges and what they make. **
|
||||
***************************************************************/
|
||||
|
||||
datum
|
||||
tech //Datum of individual technologies.
|
||||
var
|
||||
name = "name" //Name of the technology.
|
||||
desc = "description" //General description of what it does and what it makes.
|
||||
id = "id" //An easily referenced ID. Must be alphanumeric, lower-case, and no symbols.
|
||||
level = 1 //A simple number scale of the research level. Level 0 = Secret tech.
|
||||
list/req_tech = list() //List of ids associated values of techs required to research this tech. "id" = #
|
||||
|
||||
|
||||
//Trunk Technologies (don't require any other techs and you start knowning them).
|
||||
|
||||
materials
|
||||
name = "Materials Research"
|
||||
desc = "Development of new and improved materials."
|
||||
id = "materials"
|
||||
|
||||
engineering
|
||||
name = "Engineering Research"
|
||||
desc = "Development of new and improved engineering parts and."
|
||||
id = "engineering"
|
||||
|
||||
plasmatech
|
||||
name = "Plasma Research"
|
||||
desc = "Research into the mysterious substance colloqually known as 'plasma'."
|
||||
id = "plasmatech"
|
||||
|
||||
powerstorage
|
||||
name = "Power Manipulation Technology"
|
||||
desc = "The various technologies behind the storage and generation of electicity."
|
||||
id = "powerstorage"
|
||||
|
||||
bluespace
|
||||
name = "'Blue-space' Research"
|
||||
desc = "Research into the sub-reality known as 'blue-space'"
|
||||
id = "bluespace"
|
||||
|
||||
biotech
|
||||
name = "Biological Technology"
|
||||
desc = "Research into the deeper mysteries of life and organic substances."
|
||||
id = "biotech"
|
||||
|
||||
combat
|
||||
name = "Combat Systems Research"
|
||||
desc = "The development of offensive and defensive systems."
|
||||
id = "combat"
|
||||
|
||||
magnets
|
||||
name = "Electromagnetic Spectrum Research"
|
||||
desc = "Research into the electromagnetic spectrum. No clue how they actually work, though."
|
||||
id = "magnets"
|
||||
|
||||
programming
|
||||
name = "Data Theory Research"
|
||||
desc = "The development of new computer and artificial intelligence and data storage systems."
|
||||
id = "programming"
|
||||
|
||||
syndicate
|
||||
name = "Illegal Technologies Research"
|
||||
desc = "The study of technologies that violate Nanotrassen regulations."
|
||||
id = "syndicate"
|
||||
|
||||
/* arcane
|
||||
name = "Arcane Research"
|
||||
desc = "Research into the acult and arcane field for use in practical science"
|
||||
id = "arcane"
|
||||
level = 0 //It didn't become "secret" as advertised.
|
||||
|
||||
//Branch Techs
|
||||
explosives
|
||||
name = "Explosives Research"
|
||||
desc = "The creation and application of explosive materials."
|
||||
id = "explosives"
|
||||
req_tech = list("materials" = 3)
|
||||
|
||||
generators
|
||||
name = "Power Generation Technology"
|
||||
desc = "Research into more powerful and more reliable sources."
|
||||
id = "generators"
|
||||
req_tech = list("powerstorage" = 2)
|
||||
|
||||
robotics
|
||||
name = "Robotics Technology"
|
||||
desc = "The development of advanced automated, autonomous machines."
|
||||
id = "robotics"
|
||||
req_tech = list("materials" = 3, "programming" = 3)*/
|
||||
|
||||
|
||||
/obj/item/weapon/disk/tech_disk
|
||||
name = "Technology Disk"
|
||||
desc = "A disk for storing technology data for further research."
|
||||
icon = 'cloning.dmi'
|
||||
icon_state = "datadisk2"
|
||||
item_state = "card-id"
|
||||
w_class = 1.0
|
||||
m_amt = 30
|
||||
g_amt = 10
|
||||
var/datum/tech/stored
|
||||
New()
|
||||
src.pixel_x = rand(-5.0, 5)
|
||||
src.pixel_y = rand(-5.0, 5)
|
||||
@@ -0,0 +1,334 @@
|
||||
/obj/machinery/r_n_d/server
|
||||
name = "R&D Server"
|
||||
icon_state = "server"
|
||||
var
|
||||
datum/research/files
|
||||
health = 100
|
||||
list
|
||||
id_with_upload = list() //List of R&D consoles with upload to server access.
|
||||
id_with_download = list() //List of R&D consoles with download from server access.
|
||||
id_with_upload_string = "" //String versions for easy editing in map editor.
|
||||
id_with_download_string = ""
|
||||
server_id = 0
|
||||
heat_gen = 100
|
||||
heating_power = 40000
|
||||
delay = 10
|
||||
req_access = list(access_rd) //Only the R&D can change server settings.
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/rdserver(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/cable_coil(src)
|
||||
component_parts += new /obj/item/weapon/cable_coil(src)
|
||||
RefreshParts()
|
||||
|
||||
RefreshParts()
|
||||
var/tot_rating = 0
|
||||
for(var/obj/item/weapon/stock_parts/SP in src)
|
||||
tot_rating += SP.rating
|
||||
heat_gen /= max(1, tot_rating)
|
||||
|
||||
initialize()
|
||||
if(!files) files = new /datum/research(src)
|
||||
var/list/temp_list
|
||||
if(!id_with_upload.len)
|
||||
temp_list = list()
|
||||
temp_list = dd_text2list(id_with_upload_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_upload += text2num(N)
|
||||
if(!id_with_download.len)
|
||||
temp_list = list()
|
||||
temp_list = dd_text2list(id_with_download_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_download += text2num(N)
|
||||
|
||||
process()
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
switch(environment.temperature)
|
||||
if(0 to T0C)
|
||||
health = min(100, health + 1)
|
||||
if(T0C to (T20C + 20))
|
||||
health = between(0, health, 100)
|
||||
if((T20C + 20) to (T0C + 70))
|
||||
health = max(0, health - 1)
|
||||
if(health <= 0)
|
||||
files.known_designs = list()
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
if(prob(1))
|
||||
T.level--
|
||||
files.RefreshResearch()
|
||||
if(delay)
|
||||
delay--
|
||||
else
|
||||
produce_heat(heat_gen)
|
||||
delay = initial(delay)
|
||||
|
||||
|
||||
proc
|
||||
produce_heat(heat_amt)
|
||||
if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater.
|
||||
var/turf/simulated/L = loc
|
||||
if(istype(L))
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
if(env.temperature < (heat_amt+T0C))
|
||||
|
||||
var/transfer_moles = 0.25 * env.total_moles()
|
||||
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
|
||||
if(removed)
|
||||
|
||||
var/heat_capacity = removed.heat_capacity()
|
||||
if(heat_capacity == 0 || heat_capacity == null)
|
||||
heat_capacity = 1
|
||||
removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000)
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (disabled)
|
||||
return
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
icon_state = "server_o"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "server"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
return 1
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if (disabled)
|
||||
return
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if(ishuman(user))
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
call(/obj/item/clothing/gloves/space_ninja/proc/drain)("RESEARCH",src,user:wear_suit)
|
||||
return
|
||||
|
||||
/obj/machinery/r_n_d/server/centcom
|
||||
name = "Centcom Central R&D Database"
|
||||
server_id = -1
|
||||
|
||||
initialize()
|
||||
..()
|
||||
var/list/no_id_servers = list()
|
||||
var/list/server_ids = list()
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
switch(S.server_id)
|
||||
if(-1)
|
||||
continue
|
||||
if(0)
|
||||
no_id_servers += S
|
||||
else
|
||||
server_ids += S.server_id
|
||||
|
||||
for(var/obj/machinery/r_n_d/server/S in no_id_servers)
|
||||
var/num = 1
|
||||
while(!S.server_id)
|
||||
if(num in server_ids)
|
||||
num++
|
||||
else
|
||||
S.server_id = num
|
||||
server_ids += num
|
||||
no_id_servers -= S
|
||||
|
||||
process()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rdservercontrol
|
||||
name = "R&D Server Controller"
|
||||
icon_state = "rdcomp"
|
||||
var
|
||||
screen = 0
|
||||
obj/machinery/r_n_d/server/temp_server
|
||||
list
|
||||
servers = list()
|
||||
consoles = list()
|
||||
badmin = 0
|
||||
emagged = 0
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
if(!src.allowed(usr) && !emagged)
|
||||
usr << "\red You do not have the required access level"
|
||||
return
|
||||
|
||||
if(href_list["main"])
|
||||
screen = 0
|
||||
|
||||
else if(href_list["access"] || href_list["data"] || href_list["transfer"])
|
||||
temp_server = null
|
||||
consoles = list()
|
||||
servers = list()
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
if(S.server_id == text2num(href_list["access"]) || S.server_id == text2num(href_list["data"]) || S.server_id == text2num(href_list["transfer"]))
|
||||
temp_server = S
|
||||
break
|
||||
if(href_list["access"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/computer/rdconsole/C in world)
|
||||
if(C.sync)
|
||||
consoles += C
|
||||
else if(href_list["data"])
|
||||
screen = 2
|
||||
else if(href_list["transfer"])
|
||||
screen = 3
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
if(S == src)
|
||||
continue
|
||||
servers += S
|
||||
|
||||
else if(href_list["upload_toggle"])
|
||||
var/num = text2num(href_list["upload_toggle"])
|
||||
if(num in temp_server.id_with_upload)
|
||||
temp_server.id_with_upload -= num
|
||||
else
|
||||
temp_server.id_with_upload += num
|
||||
|
||||
else if(href_list["download_toggle"])
|
||||
var/num = text2num(href_list["download_toggle"])
|
||||
if(num in temp_server.id_with_download)
|
||||
temp_server.id_with_download -= num
|
||||
else
|
||||
temp_server.id_with_download += num
|
||||
|
||||
else if(href_list["reset_tech"])
|
||||
var/choice = alert("Technology Data Rest", "Are you sure you want to reset this technology to it's default data? Data lost cannot be recovered.", "Continue", "Cancel")
|
||||
if(choice == "Continue")
|
||||
for(var/datum/tech/T in temp_server.files.known_tech)
|
||||
if(T.id == href_list["reset_tech"])
|
||||
T.level = 1
|
||||
break
|
||||
temp_server.files.RefreshResearch()
|
||||
|
||||
else if(href_list["reset_design"])
|
||||
var/choice = alert("Design Data Deletion", "Are you sure you want to delete this design? If you still have the prerequisites for the design, it'll reset to it's base reliability. Data lost cannot be recovered.", "Continue", "Cancel")
|
||||
if(choice == "Continue")
|
||||
for(var/datum/design/D in temp_server.files.known_designs)
|
||||
if(D.id == href_list["reset_design"])
|
||||
D.reliability_mod = 0
|
||||
temp_server.files.known_designs -= D
|
||||
break
|
||||
temp_server.files.RefreshResearch()
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
|
||||
switch(screen)
|
||||
if(0) //Main Menu
|
||||
dat += "Connected Servers:<BR><BR>"
|
||||
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
if(istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin)
|
||||
continue
|
||||
dat += "[S.name] || "
|
||||
dat += "<A href='?src=\ref[src];access=[S.server_id]'> Access Rights</A> | "
|
||||
dat += "<A href='?src=\ref[src];data=[S.server_id]'>Data Management</A>"
|
||||
if(badmin) dat += " | <A href='?src=\ref[src];transfer=[S.server_id]'>Server-to-Server Transfer</A>"
|
||||
dat += "<BR>"
|
||||
|
||||
if(1) //Access rights menu
|
||||
dat += "[temp_server.name] Access Rights<BR><BR>"
|
||||
dat += "Consoles with Upload Access<BR>"
|
||||
for(var/obj/machinery/computer/rdconsole/C in consoles)
|
||||
var/turf/console_turf = get_turf(C)
|
||||
dat += "* <A href='?src=\ref[src];upload_toggle=[C.id]'>[console_turf.loc]" //FYI, these are all numeric ids, eventually.
|
||||
if(C.id in temp_server.id_with_upload)
|
||||
dat += " (Remove)</A><BR>"
|
||||
else
|
||||
dat += " (Add)</A><BR>"
|
||||
dat += "Consoles with Download Access<BR>"
|
||||
for(var/obj/machinery/computer/rdconsole/C in consoles)
|
||||
var/turf/console_turf = get_turf(C)
|
||||
dat += "* <A href='?src=\ref[src];download_toggle=[C.id]'>[console_turf.loc]"
|
||||
if(C.id in temp_server.id_with_download)
|
||||
dat += " (Remove)</A><BR>"
|
||||
else
|
||||
dat += " (Add)</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];main=1'>Main Menu</A>"
|
||||
|
||||
if(2) //Data Management menu
|
||||
dat += "[temp_server.name] Data ManagementP<BR><BR>"
|
||||
dat += "Known Technologies<BR>"
|
||||
for(var/datum/tech/T in temp_server.files.known_tech)
|
||||
dat += "* [T.name] "
|
||||
dat += "<A href='?src=\ref[src];reset_tech=[T.id]'>(Reset)</A><BR>" //FYI, these are all strings.
|
||||
dat += "Known Designs<BR>"
|
||||
for(var/datum/design/D in temp_server.files.known_designs)
|
||||
dat += "* [D.name] "
|
||||
dat += "<A href='?src=\ref[src];reset_design=[D.id]'>(Delete)</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];main=1'>Main Menu</A>"
|
||||
|
||||
if(3) //Server Data Transfer
|
||||
dat += "[temp_server.name] Server to Server Transfer<BR><BR>"
|
||||
dat += "Send Data to what server?<BR>"
|
||||
for(var/obj/machinery/r_n_d/server/S in servers)
|
||||
dat += "[S.name] <A href='?src=\ref[src];send_to=[S.server_id]'> (Transfer)</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];main=1'>Main Menu</A>"
|
||||
user << browse("<TITLE>R&D Server Control</TITLE><HR>[dat]", "window=server_control;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
|
||||
if(istype(D, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdservercontrol/M = new /obj/item/weapon/circuitboard/rdservercontrol( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdservercontrol/M = new /obj/item/weapon/circuitboard/rdservercontrol( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
|
||||
playsound(src.loc, 'sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "\blue You you disable the security protocols"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -1,75 +0,0 @@
|
||||
/obj/machinery/disease2/diseaseanalyser
|
||||
name = "Disease Analyser"
|
||||
icon = 'virology.dmi'
|
||||
icon_state = "analyser"
|
||||
anchored = 1
|
||||
density = 1
|
||||
|
||||
var/scanning = 0
|
||||
var/pause = 0
|
||||
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\blue [user.name] inserts the [dish.name] in the [src.name]", 3)
|
||||
|
||||
|
||||
else
|
||||
user << "There is already a dish inserted"
|
||||
|
||||
//else
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(scanning == 0)
|
||||
var/r = "GNAv2 based virus lifeform"
|
||||
r += "<BR>Infection rate : [dish.virus2.infectionchance * 10]"
|
||||
r += "<BR>Spread form : [dish.virus2.spreadtype]"
|
||||
r += "<BR>Progress Speed : [dish.virus2.stageprob * 10]"
|
||||
for(var/datum/disease2/effectholder/E in dish.virus2.effects)
|
||||
r += "<BR>Effect:[E.effect.name]. Strength : [E.multiplier * 8]. Verosity : [E.chance * 15]. Type : [5-E.stage]."
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
|
||||
P.info = r
|
||||
dish.info = r
|
||||
dish.analysed = 1
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
icon_state = "analyser"
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] prints a sheet of paper", 3)
|
||||
else if(dish && !scanning && !pause)
|
||||
if(dish.virus2 && dish.growth > 50)
|
||||
dish.growth -= 10
|
||||
scanning = 25
|
||||
icon_state = "analyser_processing"
|
||||
else
|
||||
pause = 1
|
||||
spawn(25)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\icon[src] \blue The [src.name] buzzes", 2)
|
||||
pause = 0
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -1,331 +0,0 @@
|
||||
//To simplify, all diseases have 4 stages, with effects starting at stage 2
|
||||
//Stage 1 = Rest,Minor disease
|
||||
//Stage 2 = Minimal effect
|
||||
//Stage 3 = Medium effect
|
||||
//Stage 4 = Death/Really Really really bad effect
|
||||
|
||||
|
||||
/proc/infect_virus2(var/mob/living/carbon/M,var/datum/disease2/disease/disease,var/forced = 0)
|
||||
if(prob(disease.infectionchance))
|
||||
if(M.virus2)
|
||||
return
|
||||
else
|
||||
var/score = 0
|
||||
if(!forced)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(M:gloves)
|
||||
score += 5
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/space)) score += 10
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit)) score += 10
|
||||
if(istype(M:head, /obj/item/clothing/head/helmet/space)) score += 5
|
||||
if(istype(M:head, /obj/item/clothing/head/bio_hood)) score += 5
|
||||
if(M.wear_mask)
|
||||
score += 5
|
||||
if((istype(M:wear_mask, /obj/item/clothing/mask) || istype(M:wear_mask, /obj/item/clothing/mask/surgical)) && !M.internal)
|
||||
score += 5
|
||||
if(M.internal)
|
||||
score += 5
|
||||
|
||||
if(score > 15)
|
||||
return
|
||||
// else if(score == 20 && prob(95))
|
||||
// return
|
||||
else if(score == 15 && prob(75))
|
||||
return
|
||||
else if(score == 10 && prob(55))
|
||||
return
|
||||
else if(score == 5 && prob(35))
|
||||
return
|
||||
|
||||
M.virus2 = disease.getcopy()
|
||||
M.virus2.minormutate()
|
||||
|
||||
for(var/datum/disease2/resistance/res in M.resistances)
|
||||
if(res.resistsdisease(M.virus2))
|
||||
M.virus2 = null
|
||||
|
||||
|
||||
|
||||
/datum/disease2/resistance
|
||||
var/list/datum/disease2/effect/resistances = list()
|
||||
|
||||
proc/resistsdisease(var/datum/disease2/disease/virus2)
|
||||
var/list/res2 = list()
|
||||
for(var/datum/disease2/effect/e in resistances)
|
||||
res2 += e.type
|
||||
for(var/datum/disease2/effectholder/holder in virus2)
|
||||
if(!(holder.effect.type in res2))
|
||||
return 0
|
||||
else
|
||||
res2 -= holder.effect.type
|
||||
if(res2.len > 0)
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
||||
New(var/datum/disease2/disease/virus2)
|
||||
for(var/datum/disease2/effectholder/h in virus2.effects)
|
||||
resistances += h.effect.type
|
||||
|
||||
|
||||
/proc/infect_mob_random(var/mob/living/carbon/M)
|
||||
if(!M.virus2)
|
||||
M.virus2 = new /datum/disease2/disease
|
||||
M.virus2.makerandom()
|
||||
|
||||
/datum/disease2/disease
|
||||
var/infectionchance = 10
|
||||
var/spreadtype = "Blood" // Can also be "Airborne"
|
||||
var/stage = 1
|
||||
var/stageprob = 2
|
||||
var/dead = 0
|
||||
var/clicks = 0
|
||||
|
||||
var/uniqueID = 0
|
||||
var/list/datum/disease2/effectholder/effects = list()
|
||||
proc/makerandom()
|
||||
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
|
||||
holder.stage = 1
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 2
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 3
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 4
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
uniqueID = rand(0,10000)
|
||||
infectionchance = rand(1,10)
|
||||
spreadtype = "Airborne"
|
||||
proc/minormutate()
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.minormutate()
|
||||
infectionchance = min(10,infectionchance + rand(0,1))
|
||||
proc/issame(var/datum/disease2/disease/disease)
|
||||
var/list/types = list()
|
||||
var/list/types2 = list()
|
||||
for(var/datum/disease2/effectholder/d in effects)
|
||||
types += d.effect.type
|
||||
var/equal = 1
|
||||
|
||||
for(var/datum/disease2/effectholder/d in disease.effects)
|
||||
types2 += d.effect.type
|
||||
|
||||
for(var/type in types)
|
||||
if(!(type in types2))
|
||||
equal = 0
|
||||
return equal
|
||||
|
||||
proc/activate(var/mob/living/carbon/mob)
|
||||
if(dead)
|
||||
mob.virus2 = null
|
||||
return
|
||||
if(mob.stat == 2)
|
||||
return
|
||||
if(mob.radiation > 50)
|
||||
if(prob(1))
|
||||
majormutate()
|
||||
if(mob.reagents.has_reagent("spaceacillin"))
|
||||
return
|
||||
if(prob(stageprob) && prob(25 + (clicks/100)) && stage != 4)
|
||||
stage++
|
||||
clicks = 0
|
||||
for(var/datum/disease2/effectholder/e in effects)
|
||||
e.runeffect(mob,stage)
|
||||
|
||||
proc/cure_added(var/datum/disease2/resistance/res)
|
||||
if(res.resistsdisease(src))
|
||||
dead = 1
|
||||
|
||||
proc/majormutate()
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.majormutate()
|
||||
|
||||
|
||||
proc/getcopy()
|
||||
// world << "getting copy"
|
||||
var/datum/disease2/disease/disease = new /datum/disease2/disease
|
||||
disease.infectionchance = infectionchance
|
||||
disease.spreadtype = spreadtype
|
||||
disease.stageprob = stageprob
|
||||
for(var/datum/disease2/effectholder/holder in effects)
|
||||
// world << "adding effects"
|
||||
var/datum/disease2/effectholder/newholder = new /datum/disease2/effectholder
|
||||
newholder.effect = new holder.effect.type
|
||||
newholder.chance = holder.chance
|
||||
newholder.cure = holder.cure
|
||||
newholder.multiplier = holder.multiplier
|
||||
newholder.happensonce = holder.happensonce
|
||||
newholder.stage = holder.stage
|
||||
disease.effects += newholder
|
||||
// world << "[newholder.effect.name]"
|
||||
// world << "[disease]"
|
||||
return disease
|
||||
|
||||
/datum/disease2/effect
|
||||
var/name = "Blanking effect"
|
||||
var/stage = 4
|
||||
var/maxm = 1
|
||||
proc/activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
|
||||
/datum/disease2/effect/gibbingtons
|
||||
name = "Gibbingtons Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.gib()
|
||||
|
||||
/datum/disease2/effect/radian
|
||||
name = "Radian's syndrome"
|
||||
stage = 4
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.radiation += (2*multiplier)
|
||||
|
||||
/datum/disease2/effect/toxins
|
||||
name = "Hyperacid Syndrome"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.toxloss += (2*multiplier)
|
||||
|
||||
/datum/disease2/effect/scream
|
||||
name = "Random screaming syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*scream")
|
||||
|
||||
/datum/disease2/effect/drowsness
|
||||
name = "Automated sleeping syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.drowsyness += 10
|
||||
|
||||
/datum/disease2/effect/shakey
|
||||
name = "World Shaking syndrome"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
shake_camera(mob,5*multiplier)
|
||||
|
||||
/datum/disease2/effect/deaf
|
||||
name = "Hard of hearing syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.ear_deaf += 20
|
||||
|
||||
/datum/disease2/effect/invisible
|
||||
name = "Waiting Syndrome"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
return
|
||||
/*
|
||||
/datum/disease2/effect/telepathic
|
||||
name = "Telepathy Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.mutations |= 512
|
||||
*/
|
||||
/datum/disease2/effect/noface
|
||||
name = "Identity Loss syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.real_name = "Unknown"
|
||||
|
||||
/datum/disease2/effect/monkey
|
||||
name = "Monkism syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/h = mob
|
||||
h.monkeyize()
|
||||
|
||||
/datum/disease2/effect/sneeze
|
||||
name = "Coldingtons Effect"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*sneeze")
|
||||
|
||||
/datum/disease2/effect/gunck
|
||||
name = "Flemmingtons"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "\red Mucous runs down the back of your throat."
|
||||
|
||||
/datum/disease2/effect/killertoxins
|
||||
name = "Toxification syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.toxloss += 15
|
||||
/*
|
||||
/datum/disease2/effect/hallucinations
|
||||
name = "Hallucinational Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.hallucination += 25
|
||||
*/
|
||||
/datum/disease2/effect/sleepy
|
||||
name = "Resting syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*collapse")
|
||||
|
||||
/datum/disease2/effect/mind
|
||||
name = "Lazy mind syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.brainloss = 50
|
||||
|
||||
/datum/disease2/effect/suicide
|
||||
name = "Suicidal syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.suiciding = 1
|
||||
//instead of killing them instantly, just put them at -175 health and let 'em gasp for a while
|
||||
viewers(mob) << "\red <b>[mob.name] is holding \his breath. It looks like \he's trying to commit suicide.</b>"
|
||||
mob.oxyloss = max(175 - mob.toxloss - mob.fireloss - mob.bruteloss, mob.oxyloss)
|
||||
mob.updatehealth()
|
||||
spawn(200) //in case they get revived by cryo chamber or something stupid like that, let them suicide again in 20 seconds
|
||||
mob.suiciding = 0
|
||||
|
||||
/datum/disease2/effectholder
|
||||
var/name = "Holder"
|
||||
var/datum/disease2/effect/effect
|
||||
var/chance = 0 //Chance in percentage each tick
|
||||
var/cure = "" //Type of cure it requires
|
||||
var/happensonce = 0
|
||||
var/multiplier = 1 //The chance the effects are WORSE
|
||||
var/stage = 0
|
||||
|
||||
proc/runeffect(var/mob/living/carbon/human/mob,var/stage)
|
||||
if(happensonce > -1 && effect.stage <= stage && prob(chance))
|
||||
effect.activate(mob)
|
||||
if(happensonce == 1)
|
||||
happensonce = -1
|
||||
|
||||
proc/getrandomeffect()
|
||||
var/list/datum/disease2/effect/list = list()
|
||||
for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
|
||||
// world << "Making [e]"
|
||||
var/datum/disease2/effect/f = new e
|
||||
if(f.stage == src.stage)
|
||||
list += f
|
||||
effect = pick(list)
|
||||
chance = rand(1,6)
|
||||
|
||||
proc/minormutate()
|
||||
switch(pick(1,2,3,4,5))
|
||||
if(1)
|
||||
chance = rand(0,100)
|
||||
if(2)
|
||||
multiplier = rand(1,effect.maxm)
|
||||
proc/majormutate()
|
||||
getrandomeffect()
|
||||
|
||||
/proc/dprob(var/p)
|
||||
return(prob(sqrt(p)) && prob(sqrt(p)))
|
||||
@@ -1,20 +0,0 @@
|
||||
/obj/machinery/disease2/biodestroyer
|
||||
name = "Biohazard destroyer"
|
||||
icon = 'disposal.dmi'
|
||||
icon_state = "disposal"
|
||||
var/list/accepts = list(/obj/item/clothing,/obj/item/weapon/virusdish/,/obj/item/weapon/cureimplanter,/obj/item/weapon/diseasedisk)
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
for(var/path in accepts)
|
||||
if(I.type in typesof(path))
|
||||
user.drop_item()
|
||||
del(I)
|
||||
overlays += image('disposal.dmi', "dispover-handle")
|
||||
return
|
||||
user.drop_item()
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] beeps", 2)
|
||||
@@ -1,42 +0,0 @@
|
||||
/obj/item/weapon/cureimplanter
|
||||
name = "Hypospray injector"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "implanter1"
|
||||
var/datum/disease2/resistance/resistance = null
|
||||
var/works = 0
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
item_state = "syringe_0"
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = 2.0
|
||||
|
||||
|
||||
/obj/item/weapon/cureimplanter/attack(mob/target as mob, mob/user as mob)
|
||||
if(ismob(target))
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
if (target != user)
|
||||
O.show_message(text("\red <B>[] is trying to inject [] with [src.name]!</B>", user, target), 1)
|
||||
else
|
||||
O.show_message("\red <B>[user] is trying to inject themselves with [src.name]!</B>", 1)
|
||||
if(!do_mob(user, target,60)) return
|
||||
|
||||
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
if (target != user)
|
||||
O.show_message(text("\red [] injects [] with [src.name]!", user, target), 1)
|
||||
else
|
||||
O.show_message("\red [user] injects themself with [src.name]!", 1)
|
||||
|
||||
|
||||
var/mob/living/carbon/M = target
|
||||
|
||||
if(works == 0 && prob(25))
|
||||
M.resistances2 += resistance
|
||||
if(M.virus2)
|
||||
M.virus2.cure_added(resistance)
|
||||
else if(works == 1)
|
||||
M.toxloss += rand(20,50)
|
||||
else if(works == 2)
|
||||
M.toxloss += rand(50,100)
|
||||
else if(works == 3)
|
||||
infect_virus2(M,virus2,1)
|
||||
@@ -1,154 +0,0 @@
|
||||
/obj/machinery/computer/curer
|
||||
name = "Cure Research Machine"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "dna"
|
||||
// brightnessred = 0
|
||||
// brightnessgreen = 2 //Used for multicoloured lighting on BS12
|
||||
// brightnessblue = 2
|
||||
var/curing
|
||||
var/virusing
|
||||
circuit = "/obj/item/weapon/circuitboard/mining"
|
||||
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
|
||||
/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
/*if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/curer/M = new /obj/item/weapon/circuitboard/curer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/curer/M = new /obj/item/weapon/circuitboard/curer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)*/
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
|
||||
//else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/curer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat
|
||||
if(curing)
|
||||
dat = "Antibody production in progress"
|
||||
else if(virusing)
|
||||
dat = "Virus production in progress"
|
||||
else if(dish)
|
||||
dat = "Virus dish inserted"
|
||||
if(dish.virus2)
|
||||
if(dish.growth >= 100)
|
||||
dat += "<BR><A href='?src=\ref[src];antibody=1'>Begin antibody production</a>"
|
||||
dat += "<BR><A href='?src=\ref[src];virus=1'>Begin virus production</a>"
|
||||
else
|
||||
dat += "<BR>Insufficent cells to attempt to create cure"
|
||||
else
|
||||
dat += "<BR>Please check dish contents"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
|
||||
else
|
||||
dat = "Please insert dish"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/process()
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
if(curing)
|
||||
curing -= 1
|
||||
if(curing == 0)
|
||||
icon_state = "dna"
|
||||
if(dish.virus2)
|
||||
createcure(dish.virus2)
|
||||
if(virusing)
|
||||
virusing -= 1
|
||||
if(virusing == 0)
|
||||
icon_state = "dna"
|
||||
if(dish.virus2)
|
||||
createvirus(dish.virus2)
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["antibody"])
|
||||
curing = 30
|
||||
dish.growth -= 50
|
||||
src.icon_state = "dna"
|
||||
if (href_list["virus"])
|
||||
virusing = 30
|
||||
dish.growth -= 100
|
||||
src.icon_state = "dna"
|
||||
else if(href_list["eject"])
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/curer/proc/createcure(var/datum/disease2/disease/virus2)
|
||||
var/obj/item/weapon/cureimplanter/implanter = new /obj/item/weapon/cureimplanter(src.loc)
|
||||
implanter.resistance = new /datum/disease2/resistance(dish.virus2)
|
||||
if(probG("Virus curing",3))
|
||||
implanter.works = 0
|
||||
else
|
||||
implanter.works = rand(1,2)
|
||||
state("The [src.name] Buzzes")
|
||||
|
||||
/obj/machinery/computer/curer/proc/createvirus(var/datum/disease2/disease/virus2)
|
||||
var/obj/item/weapon/cureimplanter/implanter = new /obj/item/weapon/cureimplanter(src.loc)
|
||||
implanter.name = "Viral implanter (MAJOR BIOHAZARD)"
|
||||
implanter.virus2 = dish.virus2.getcopy()
|
||||
implanter.works = 3
|
||||
state("The [src.name] Buzzes")
|
||||
|
||||
|
||||
/obj/machinery/computer/curer/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
@@ -1,202 +0,0 @@
|
||||
/obj/machinery/computer/diseasesplicer
|
||||
name = "Disease Splicer"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "crew"
|
||||
//brightnessred = 0
|
||||
// brightnessgreen = 2
|
||||
// brightnessblue = 2
|
||||
// broken_icon
|
||||
|
||||
var/datum/disease2/effectholder/memorybank = null
|
||||
var/analysed = 0
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
var/burning = 0
|
||||
|
||||
var/splicing = 0
|
||||
var/scanning = 0
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
/*
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)*/
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
if(istype(I,/obj/item/weapon/diseasedisk))
|
||||
user << "You upload the contents of the disk into the buffer"
|
||||
memorybank = I:effect
|
||||
|
||||
|
||||
//else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat
|
||||
if(splicing)
|
||||
dat = "Splicing in progress"
|
||||
else if(scanning)
|
||||
dat = "Splicing in progress"
|
||||
else if(burning)
|
||||
dat = "Data disk burning in progress"
|
||||
else
|
||||
if(dish)
|
||||
dat = "Virus dish inserted"
|
||||
|
||||
dat += "<BR>Current DNA strand : "
|
||||
if(memorybank)
|
||||
dat += "<A href='?src=\ref[src];splice=1'>"
|
||||
if(analysed)
|
||||
dat += "[memorybank.effect.name] ([5-memorybank.effect.stage])"
|
||||
else
|
||||
dat += "Unknown DNA strand ([5-memorybank.effect.stage])"
|
||||
dat += "</a>"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];disk=1'>Burn DNA Sequence to data storage disk</a>"
|
||||
else
|
||||
dat += "Empty"
|
||||
|
||||
dat += "<BR><BR>"
|
||||
|
||||
if(dish)
|
||||
if(dish.virus2)
|
||||
if(dish.growth >= 50)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
dat += "<BR><A href='?src=\ref[src];grab=\ref[e]'> DNA strand"
|
||||
if(dish.analysed)
|
||||
dat += ": [e.effect.name]"
|
||||
dat += " (5-[e.effect.stage])</a>"
|
||||
else
|
||||
dat += "<BR>Insufficent cells to attempt gene splicing"
|
||||
else
|
||||
dat += "<BR>No virus found in dish"
|
||||
|
||||
dat += "<BR><BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
|
||||
else
|
||||
dat += "<BR>Please insert dish"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(!scanning)
|
||||
state("The [src.name] beeps")
|
||||
icon_state = "crew"
|
||||
if(splicing)
|
||||
splicing -= 1
|
||||
if(!splicing)
|
||||
state("The [src.name] pings")
|
||||
icon_state = "crew"
|
||||
if(burning)
|
||||
burning -= 1
|
||||
if(!burning)
|
||||
var/obj/item/weapon/diseasedisk/d = new /obj/item/weapon/diseasedisk(src.loc)
|
||||
if(analysed)
|
||||
d.name = "[memorybank.effect.name] GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
else
|
||||
d.name = "Unknown GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
state("The [src.name] zings")
|
||||
icon_state = "crew"
|
||||
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["grab"])
|
||||
memorybank = locate(href_list["grab"])
|
||||
analysed = dish.analysed
|
||||
del(dish)
|
||||
dish = null
|
||||
scanning = 30
|
||||
icon_state = "crew"
|
||||
|
||||
else if(href_list["eject"])
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
else if(href_list["splice"])
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == memorybank.stage)
|
||||
e.effect = memorybank.effect
|
||||
splicing = 50
|
||||
dish.virus2.spreadtype = "Blood"
|
||||
icon_state = "crew"
|
||||
|
||||
else if(href_list["disk"])
|
||||
burning = 20
|
||||
icon_state = "crew"
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
|
||||
|
||||
/obj/item/weapon/diseasedisk
|
||||
name = "Blank GNA disk"
|
||||
icon = 'cloning.dmi'
|
||||
icon_state = "datadisk2"
|
||||
var/datum/disease2/effectholder/effect = null
|
||||
var/stage = 1
|
||||
|
||||
/obj/item/weapon/diseasedisk/premade/New()
|
||||
name = "Blank GNA disk (stage: [5-stage])"
|
||||
effect = new /datum/disease2/effectholder
|
||||
effect.effect = new /datum/disease2/effect/invisible
|
||||
effect.stage = stage
|
||||
@@ -1,176 +0,0 @@
|
||||
/obj/machinery/disease2/incubator/
|
||||
name = "Pathogenic incubator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'virology.dmi'
|
||||
icon_state = "incubator"
|
||||
var/obj/item/weapon/virusdish/dish
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/radiation = 0
|
||||
|
||||
var/on = 0
|
||||
var/power = 0
|
||||
|
||||
var/foodsupply = 0
|
||||
var/toxins = 0
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(25))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
attackby(var/obj/B as obj, var/mob/user as mob)
|
||||
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
|
||||
if(src.beaker)
|
||||
if(istype(beaker,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "A syringe is already loaded into the machine."
|
||||
else
|
||||
user << "A beaker is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
user << "You add the beaker to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
if(src.dish)
|
||||
user << "A dish is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.dish = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
user << "You add the dish to the machine!"
|
||||
src.updateUsrDialog()
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!dish) return
|
||||
|
||||
if (href_list["power"])
|
||||
on = !on
|
||||
if(on)
|
||||
icon_state = "incubator_on"
|
||||
else
|
||||
icon_state = "incubator"
|
||||
if (href_list["ejectchem"])
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
if (href_list["ejectdish"])
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
if (href_list["rad"])
|
||||
radiation += 10
|
||||
if (href_list["flush"])
|
||||
radiation = 0
|
||||
toxins = 0
|
||||
foodsupply = 0
|
||||
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!dish)
|
||||
dat = "Please insert dish into the incubator.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
var/string = "Off"
|
||||
if(on)
|
||||
string = "On"
|
||||
dat += "Power status : <A href='?src=\ref[src];power=1'>[string]</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Food supply : [foodsupply]"
|
||||
dat += "<BR>"
|
||||
dat += "Radiation Levels : [radiation] RADS : <A href='?src=\ref[src];rad=1'>Radiate</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Toxins : [toxins]"
|
||||
dat += "<BR><BR>"
|
||||
if(beaker)
|
||||
dat += "Eject chemicals : <A href='?src=\ref[src];ejectchem=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
if(dish)
|
||||
dat += "Eject Virus dish : <A href='?src=\ref[src];ejectdish=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
dat += "<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];flush=1'>Flush system</a>"
|
||||
|
||||
|
||||
user << browse("<TITLE>Pathogenic incubator</TITLE>incubator menu:<BR><BR>[dat]", "window=incubator;size=575x400")
|
||||
onclose(user, "incubator")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
process()
|
||||
|
||||
if(dish && on && dish.virus2)
|
||||
use_power(50,EQUIP)
|
||||
if(!powered(EQUIP))
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
if(foodsupply)
|
||||
foodsupply -= 1
|
||||
dish.growth += 1
|
||||
if(dish.growth == 100)
|
||||
state("The [src.name] pings")
|
||||
if(radiation)
|
||||
if(radiation > 50 & prob(5))
|
||||
dish.virus2.majormutate()
|
||||
if(dish.info)
|
||||
dish.info = "OUTDATED : [dish.info]"
|
||||
dish.analysed = 0
|
||||
state("The [src.name] beeps")
|
||||
|
||||
else if(prob(5))
|
||||
dish.virus2.minormutate()
|
||||
radiation -= 1
|
||||
if(toxins && prob(5))
|
||||
dish.virus2.infectionchance -= 1
|
||||
if(toxins > 50)
|
||||
dish.virus2 = null
|
||||
else if(!dish)
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
|
||||
|
||||
if(beaker)
|
||||
if(!beaker.reagents.remove_reagent("virusfood",5))
|
||||
foodsupply += 20
|
||||
if(!beaker.reagents.remove_reagent("toxins",1))
|
||||
toxins += 1
|
||||
|
||||
proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
@@ -1,139 +0,0 @@
|
||||
/obj/machinery/disease2/isolator/
|
||||
name = "Pathogenic Isolator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'virology.dmi'
|
||||
icon_state = "isolator"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/isolating = 0
|
||||
var/beaker = null
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(25))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/reagent_containers/glass/B as obj, var/mob/user as mob)
|
||||
if(!istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
return
|
||||
|
||||
if(src.beaker)
|
||||
user << "A syringe is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
icon_state = "isolator_in"
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!beaker) return
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
|
||||
if (href_list["isolate"])
|
||||
var/datum/reagent/blood/Blood
|
||||
for(var/datum/reagent/blood/B in R.reagent_list)
|
||||
if(B)
|
||||
Blood = B
|
||||
break
|
||||
|
||||
if(Blood.data["virus2"])
|
||||
virus2 = Blood.data["virus2"]
|
||||
isolating = 40
|
||||
icon_state = "isolator_processing"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
else if (href_list["main"])
|
||||
attack_hand(usr)
|
||||
return
|
||||
else if (href_list["eject"])
|
||||
beaker:loc = src.loc
|
||||
beaker = null
|
||||
icon_state = "isolator"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!beaker)
|
||||
dat = "Please insert sample into the isolator.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
else if(isolating)
|
||||
dat = "Isolating"
|
||||
else
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
dat += "<A href='?src=\ref[src];eject=1'>Eject</A><BR><BR>"
|
||||
if(!R.total_volume)
|
||||
dat += "[beaker] is empty."
|
||||
else
|
||||
dat += "Contained reagents:<BR>"
|
||||
for(var/datum/reagent/blood/G in R.reagent_list)
|
||||
dat += " [G.name]: <A href='?src=\ref[src];isolate=[G.id]'>Isolate</a>"
|
||||
user << browse("<TITLE>Pathogenic Isolator</TITLE>Isolator menu:<BR><BR>[dat]", "window=isolator;size=575x400")
|
||||
onclose(user, "isolator")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
process()
|
||||
if(isolating > 0)
|
||||
isolating -= 1
|
||||
if(isolating == 0)
|
||||
var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc)
|
||||
d.virus2 = virus2.getcopy()
|
||||
virus2 = null
|
||||
icon_state = "isolator_in"
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/virusdish
|
||||
name = "Virus containment/growth dish"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "implantcase-b"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/growth = 0
|
||||
var/info = 0
|
||||
var/analysed = 0
|
||||
|
||||
/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob)
|
||||
if(istype(W,/obj/item/weapon/hand_labeler))
|
||||
return
|
||||
..()
|
||||
if(prob(50))
|
||||
user << "The dish shatters"
|
||||
if(virus2.infectionchance > 0)
|
||||
infect_virus2(user,virus2)
|
||||
del src
|
||||
|
||||
/obj/item/weapon/virusdish/examine()
|
||||
usr << "This is a virus containment dish"
|
||||
if(src.info)
|
||||
usr << "It has the following information about its contents"
|
||||
usr << src.info
|
||||
@@ -1,30 +0,0 @@
|
||||
/obj/machinery/disease2/monkeycloner
|
||||
name = "Monkey dispensor"
|
||||
icon = 'cloning.dmi'
|
||||
icon_state = "pod_0"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/cloning = 0
|
||||
|
||||
/obj/machinery/disease2/monkeycloner/attack_hand()
|
||||
if(!cloning)
|
||||
cloning = 150
|
||||
|
||||
icon_state = "pod_g"
|
||||
|
||||
/obj/machinery/disease2/monkeycloner/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
if(cloning)
|
||||
cloning -= 1
|
||||
if(!cloning)
|
||||
new /mob/living/carbon/monkey(src.loc)
|
||||
icon_state = "pod_0"
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -1,12 +0,0 @@
|
||||
var/list/prob_G_list = list()
|
||||
|
||||
/proc/probG(var/define,var/everyother)
|
||||
if(prob_G_list["[define]"])
|
||||
prob_G_list["[define]"] += 1
|
||||
if(prob_G_list["[define]"] == everyother)
|
||||
prob_G_list["[define]"] = 0
|
||||
return 1
|
||||
else
|
||||
(prob_G_list["[define]"]) = 0
|
||||
(prob_G_list["[define]"]) = rand(1,everyother-1)
|
||||
return 0
|
||||
Reference in New Issue
Block a user