Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into OrganRefactor

This commit is contained in:
Aurorablade
2016-01-01 22:38:23 -05:00
166 changed files with 1472 additions and 9206 deletions
-180
View File
@@ -1,180 +0,0 @@
// Reports are a way to notify admins of wrongdoings that happened
// while no admin was present. They work a bit similar to news, but
// they can only be read by admins and moderators.
// a single admin report
datum/admin_report/var
ID // the ID of the report
body // the content of the report
author // key of the author
date // date on which this was created
done // whether this was handled
offender_key // store the key of the offender
offender_cid // store the cid of the offender
datum/report_topic_handler
Topic(href,href_list)
..()
var/client/C = locate(href_list["client"])
if(href_list["action"] == "show_reports")
C.display_admin_reports()
else if(href_list["action"] == "remove")
C.mark_report_done(text2num(href_list["ID"]))
else if(href_list["action"] == "edit")
C.edit_report(text2num(href_list["ID"]))
var/datum/report_topic_handler/report_topic_handler
world/New()
..()
report_topic_handler = new
// add a new news datums
proc/make_report(body, author, okey, cid)
var/savefile/Reports = new("data/reports.sav")
var/list/reports
var/lastID
Reports["reports"] >> reports
Reports["lastID"] >> lastID
if(!reports) reports = list()
if(!lastID) lastID = 0
var/datum/admin_report/created = new()
created.ID = ++lastID
created.body = body
created.author = author
created.date = world.realtime
created.done = 0
created.offender_key = okey
created.offender_cid = cid
reports.Insert(1, created)
Reports["reports"] << reports
Reports["lastID"] << lastID
// load the reports from disk
proc/load_reports()
var/savefile/Reports = new("data/reports.sav")
var/list/reports
Reports["reports"] >> reports
if(!reports) reports = list()
return reports
// check if there are any unhandled reports
client/proc/unhandled_reports()
if(!src.holder) return 0
var/list/reports = load_reports()
for(var/datum/admin_report/N in reports)
if(N.done)
continue
else return 1
return 0
// checks if the player has an unhandled report against him
client/proc/is_reported()
var/list/reports = load_reports()
for(var/datum/admin_report/N in reports) if(!N.done)
if(N.offender_key == src.key)
return 1
return 0
// display only the reports that haven't been handled
client/proc/display_admin_reports()
set category = "Admin"
set name = "Display Admin Reports"
if(!src.holder) return
var/list/reports = load_reports()
var/output = ""
if(unhandled_reports())
// load the list of unhandled reports
for(var/datum/admin_report/N in reports)
if(N.done)
continue
output += "<b>Reported player:</b> [N.offender_key](CID: [N.offender_cid])<br>"
output += "<b>Offense:</b>[N.body]<br>"
output += "<small>Occured at [time2text(N.date,"MM/DD hh:mm:ss")]</small><br>"
output += "<small>authored by <i>[N.author]</i></small><br>"
output += " <a href='?src=\ref[report_topic_handler];client=\ref[src];action=remove;ID=[N.ID]'>Flag as Handled</a>"
if(src.key == N.author)
output += " <a href='?src=\ref[report_topic_handler];client=\ref[src];action=edit;ID=[N.ID]'>Edit</a>"
output += "<br>"
output += "<br>"
else
output += "Whoops, no reports!"
usr << browse(output, "window=news;size=600x400")
client/proc/Report(mob/M as mob in view())
set category = "Admin"
if(!src.holder)
return
var/CID = "Unknown"
if(M.client)
CID = M.client.computer_id
var/body = input(src.mob, "Describe in detail what you're reporting [M] for", "Report") as null|text
if(!body) return
make_report(body, key, M.key, CID)
spawn(1)
display_admin_reports()
client/proc/mark_report_done(ID as num)
if(!src.holder || src.holder.level < 0)
return
var/savefile/Reports = new("data/reports.sav")
var/list/reports
Reports["reports"] >> reports
var/datum/admin_report/found
for(var/datum/admin_report/N in reports)
if(N.ID == ID)
found = N
if(!found) src << "<b>* An error occured, sorry.</b>"
found.done = 1
Reports["reports"] << reports
client/proc/edit_report(ID as num)
if(!src.holder || src.holder.level < 0)
src << "<b>You tried to modify the news, but you're not an admin!"
return
var/savefile/Reports = new("data/reports.sav")
var/list/reports
Reports["reports"] >> reports
var/datum/admin_report/found
for(var/datum/admin_report/N in reports)
if(N.ID == ID)
found = N
if(!found) src << "<b>* An error occured, sorry.</b>"
var/body = input(src.mob, "Enter a body for the news", "Body") as null|message
if(!body) return
found.body = body
Reports["reports"] << reports
+37 -14
View File
@@ -444,44 +444,59 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/list/areas_with_intercom = list()
var/list/areas_with_camera = list()
var/list/areas_with_multiple_APCs = list()
var/list/areas_with_multiple_air_alarms = list()
for(var/area/A in world)
if(!(A.type in areas_all))
areas_all.Add(A.type)
areas_all |= A.type
for(var/obj/machinery/power/apc/APC in world)
var/area/A = get_area(APC)
if(!A)
continue
if(!(A.type in areas_with_APC))
areas_with_APC.Add(A.type)
areas_with_APC |= A.type
else
areas_with_multiple_APCs |= A.type
for(var/obj/machinery/alarm/alarm in world)
var/area/A = get_area(alarm)
if(!A)
continue
if(!(A.type in areas_with_air_alarm))
areas_with_air_alarm.Add(A.type)
areas_with_air_alarm |= A.type
else
areas_with_multiple_air_alarms |= A.type
for(var/obj/machinery/requests_console/RC in world)
var/area/A = get_area(RC)
if(!(A.type in areas_with_RC))
areas_with_RC.Add(A.type)
if(!A)
continue
areas_with_RC |= A.type
for(var/obj/machinery/light/L in world)
var/area/A = get_area(L)
if(!(A.type in areas_with_light))
areas_with_light.Add(A.type)
if(!A)
continue
areas_with_light |= A.type
for(var/obj/machinery/light_switch/LS in world)
var/area/A = get_area(LS)
if(!(A.type in areas_with_LS))
areas_with_LS.Add(A.type)
if(!A)
continue
areas_with_LS |= A.type
for(var/obj/item/device/radio/intercom/I in world)
var/area/A = get_area(I)
if(!(A.type in areas_with_intercom))
areas_with_intercom.Add(A.type)
if(!A)
continue
areas_with_intercom |= A.type
for(var/obj/machinery/camera/C in world)
var/area/A = get_area(C)
if(!(A.type in areas_with_camera))
areas_with_camera.Add(A.type)
if(!A)
continue
areas_with_camera |= A.type
var/list/areas_without_APC = areas_all - areas_with_APC
var/list/areas_without_air_alarm = areas_all - areas_with_air_alarm
@@ -499,6 +514,14 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for(var/areatype in areas_without_air_alarm)
world << "* [areatype]"
world << "<b>AREAS WITH TOO MANY APCS:</b>"
for(var/areatype in areas_with_multiple_APCs)
world << "* [areatype]"
world << "<b>AREAS WITH TOO MANY AIR ALARMS:</b>"
for(var/areatype in areas_with_multiple_air_alarms)
world << "* [areatype]"
world << "<b>AREAS WITHOUT A REQUEST CONSOLE:</b>"
for(var/areatype in areas_without_RC)
world << "* [areatype]"
+17 -17
View File
@@ -33,7 +33,7 @@ client/proc/one_click_antag()
var/datum/mind/themind = null
for(var/mob/living/silicon/ai/ai in player_list)
if(ai.client && ai.client.prefs.be_special & BE_MALF)
if(ai.client && (ROLE_MALF in ai.client.prefs.be_special))
AIs += ai
if(AIs.len)
@@ -57,8 +57,8 @@ client/proc/one_click_antag()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_TRAITOR)
if(player_old_enough_antag(applicant.client,BE_TRAITOR))
if(ROLE_TRAITOR in applicant.client.prefs.be_special)
if(player_old_enough_antag(applicant.client,ROLE_TRAITOR))
if(!applicant.stat)
if(applicant.mind)
if (!applicant.mind.special_role)
@@ -91,8 +91,8 @@ client/proc/one_click_antag()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_CHANGELING)
if(player_old_enough_antag(applicant.client,BE_CHANGELING))
if(ROLE_CHANGELING in applicant.client.prefs.be_special)
if(player_old_enough_antag(applicant.client,ROLE_CHANGELING))
if(!applicant.stat)
if(applicant.mind)
if (!applicant.mind.special_role)
@@ -123,8 +123,8 @@ client/proc/one_click_antag()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_REV)
if(player_old_enough_antag(applicant.client,BE_REV))
if(ROLE_REV in applicant.client.prefs.be_special)
if(player_old_enough_antag(applicant.client,ROLE_REV))
if(applicant.stat == CONSCIOUS)
if(applicant.mind)
if(!applicant.mind.special_role)
@@ -150,9 +150,9 @@ client/proc/one_click_antag()
var/time_passed = world.time
for(var/mob/G in respawnable_list)
if(istype(G) && G.client && G.client.prefs.be_special & BE_WIZARD)
if(istype(G) && G.client && (ROLE_WIZARD in G.client.prefs.be_special))
if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate"))
if(player_old_enough_antag(G.client,BE_WIZARD))
if(player_old_enough_antag(G.client,ROLE_WIZARD))
spawn(0)
switch(G.timed_alert("Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","No",300,"Yes","No"))//alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
@@ -192,8 +192,8 @@ client/proc/one_click_antag()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_CULTIST)
if(player_old_enough_antag(applicant.client,BE_CULTIST))
if(ROLE_CULTIST in applicant.client.prefs.be_special)
if(player_old_enough_antag(applicant.client,ROLE_CULTIST))
if(applicant.stat == CONSCIOUS)
if(applicant.mind)
if(!applicant.mind.special_role)
@@ -224,9 +224,9 @@ client/proc/one_click_antag()
var/time_passed = world.time
for(var/mob/G in respawnable_list)
if(istype(G) && G.client && G.client.prefs.be_special & BE_OPERATIVE)
if(istype(G) && G.client && (ROLE_OPERATIVE in G.client.prefs.be_special))
if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate"))
if(player_old_enough_antag(G.client,BE_OPERATIVE))
if(player_old_enough_antag(G.client,ROLE_OPERATIVE))
spawn(0)
switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
@@ -442,8 +442,8 @@ client/proc/one_click_antag()
//Generates a list of candidates from active ghosts.
for(var/mob/G in respawnable_list)
if(istype(G) && G.client && G.client.prefs.be_special & BE_RAIDER)
if(player_old_enough_antag(G.client,BE_RAIDER))
if(istype(G) && G.client && (ROLE_RAIDER in G.client.prefs.be_special))
if(player_old_enough_antag(G.client,ROLE_RAIDER))
if(!jobban_isbanned(G, "raider") && !jobban_isbanned(G, "Syndicate"))
spawn(0)
switch(alert(G,"Do you wish to be considered for a vox raiding party arriving on the station?","Please answer in 30 seconds!","Yes","No"))
@@ -543,8 +543,8 @@ client/proc/one_click_antag()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_VAMPIRE)
if(player_old_enough_antag(applicant.client,BE_VAMPIRE))
if(ROLE_VAMPIRE in applicant.client.prefs.be_special)
if(player_old_enough_antag(applicant.client,ROLE_VAMPIRE))
if(!applicant.stat)
if(applicant.mind)
if (!applicant.mind.special_role)
+1 -1
View File
@@ -444,7 +444,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/list/candidates = list()
for(var/mob/M in player_list)
if(M.stat != DEAD) continue //we are not dead!
if(!M.client.prefs.be_special & BE_ALIEN) continue //we don't want to be an alium
if(!(ROLE_ALIEN in M.client.prefs.be_special)) continue //we don't want to be an alium
if(jobban_isbanned(M, "alien") || jobban_isbanned(M, "Syndicate")) continue //we are jobbanned
if(M.client.is_afk()) continue //we are afk
if(M.mind && M.mind.current && M.mind.current.stat != DEAD) continue //we have a live body we are tied to
@@ -1,237 +0,0 @@
/*
DMP to swapmap converter
version 1.0
by Lummox JR
*/
mob/verb/Convert(filename as file)
dmp2swapmap(filename)
proc/d2sm_prepmap(filename)
var/txt = file2text(filename)
if(!txt) return
var/i,j
i=findText(txt,ascii2text(13)) // eliminate carriage returns
while(i)
txt=copytext(txt,1,i)+copytext(txt,i+1)
i=findText(txt,ascii2text(13),i)
i=findText(txt,"\\\n")
while(i)
for(j=i+2,j<=length(txt),++j) if(text2ascii(txt,j)>32) break
txt=copytext(txt,1,i)+copytext(txt,j)
i=findText(txt,"\\\n",i)
return txt
proc/dmp2swapmap(filename)
//var/txt = file2text(filename)
//if(!txt) return
var/txt = d2sm_prepmap(filename)
var/mapname="[filename]"
var/i,j,k
i=findtext(mapname,".dmp")
while(i && i+4<length(mapname)) i=findtext(mapname,".dmp",i+1)
mapname=copytext(mapname,1,i)
/* i=findText(txt,ascii2text(13))
while(i)
txt=copytext(txt,1,i)+copytext(txt,i+1)
i=findText(txt,ascii2text(13),i)
i=findText(txt,"\\\n")
while(i)
for(j=i+2,j<=length(txt),++j) if(text2ascii(txt,j)>32) break
txt=copytext(txt,1,i)+copytext(txt,j)
i=findText(txt,"\\\n",i) */
var/list/codes=new
var/codelen=1
var/list/areas
var/mode=34
var/z=0
var/X=0,Y=0,Z=0
while(txt)
if(text2ascii(txt)==34)
if(mode!=34)
world << "Corrupt map file [filename]: Unexpected code found after z-level [z]"
return
// standard line:
// "a" = (/obj, /obj, /turf, /area)
i=findtext(txt,"\"",2)
var/code=copytext(txt,2,i)
codelen=length(code)
i=findtext(txt,"(",i)
if(!i)
world << "Corrupt map file [filename]: No type list follows \"[code]\""
return
k=findtext(txt,"\n",++i)
j=(k || length(txt+1))
while(--j>=i && text2ascii(txt,j)!=41)
if(j<i)
world << "Corrupt map file [filename]: Type list following \"[code]\" is incomplete"
return
var/list/L = d2sm_ParseCommaList(copytext(txt,i,j))
if(istext(L))
world << "Corrupt map file [filename]: [L]"
return
if(L.len<2)
world << "Corrupt map file [filename]: Type list following \"[code]\" has only 1 item"
return
txt=k?copytext(txt,k+1):null
if(L[L.len] == "[world.area]") L[L.len]=0
else
if(!areas) areas=list()
i=areas.Find(L[L.len])
if(i) L[L.len]=i
else
areas+=L[L.len]
L[L.len]=areas.len
var/codetrans=d2sm_ConvertType(L[L.len-1],"\t\t\t\t")
if(L[L.len]) codetrans+="\t\t\t\tAREA = [L[L.len]]\n"
if(L.len>2) codetrans+=d2sm_Contents(L,L.len-2,"\t\t\t\t")
codes[code]=copytext(codetrans,1,length(codetrans))
else if(text2ascii(txt)==40)
mode=40
// standard line (top-down, left-right symbol order):
// (1,1,1) = {"
// abcde
// bcdef
// "}
i=d2sm_MatchBrace(txt,1,40)
if(!i)
world << "Corrupt map file [filename]: No matching ) for coordinates: [copytext(txt,1,findtext(txt,"\n"))]"
return
var/list/coords=d2sm_ParseCommaList(copytext(txt,2,i))
if(istext(coords) || coords.len!=3)
world << "Corrupt map file [filename]: [istext(coords)?(coords):"[copytext(txt,1,i+1)] is not a valid (x,y,z) coordinate"]"
return
j=findtext(txt,"{",i+1)
if(!j)
world << "Corrupt map file [filename]: No braces {} following [copytext(txt,1,i+1)]"
return
k=d2sm_MatchBrace(txt,j,123)
if(!k)
world << "Corrupt map file [filename]: No closing brace } following [copytext(txt,1,i+1)]"
return
var/mtxt=copytext(txt,j+1,k)
if(findText(mtxt,"\"\n")!=1 || !findText(mtxt,"\n\"",length(mtxt)-1))
world << findText(mtxt,"\"\n")
world << findText(mtxt,"\n\"",length(mtxt)-1)
world << "Corrupt map file [filename]: No quotes in braces following [copytext(txt,1,i+1)]"
return
mtxt=copytext(mtxt,2,length(mtxt))
var/_x=0,_y=0
for(i=1,,++_y)
j=findText(mtxt,"\n",i+1)
if(!j) break
_x=max(_x,(j-i-1)/codelen)
i=j
X=max(X,_x)
Y=max(Y,_y)
z=text2num(coords[3])
Z=max(Z,z)
txt=copytext(txt,k+1)
else
i=findtext(txt,"\n")
txt=i?copytext(txt,i+1):null
world << "Map size: [X],[Y],[Z]"
//for(var/code in codes)
// world << "Code \"[code]\":\n[codes[code]]"
fdel("map_[mapname].txt")
var/F = file("map_[mapname].txt")
F << ". = object(\".0\")\n.0\n\ttype = /swapmap\n\tid = \"[mapname]\"\n\tz = [Z]\n\ty = [Y]\n\tx = [X]"
if(areas)
txt=""
for(i=0,i<areas.len,++i)
txt+="[i?", ":""]object(\".[i]\")"
F << "\tareas = list([txt])"
for(i=0,i<areas.len,++i)
F << "\t\t.[i]"
txt=d2sm_ConvertType(areas[i+1],"\t\t\t")
F << copytext(txt,1,length(txt))
// 2nd pass
txt=d2sm_prepmap(filename)
while(txt)
// skip all non-data sections
if(text2ascii(txt)!=40)
i=findText(txt,"\n")
if(i) txt=copytext(txt,i+1)
else txt=null
continue
i=d2sm_MatchBrace(txt,1,40)
var/list/coords=d2sm_ParseCommaList(copytext(txt,2,i))
j=findtext(txt,"{",i+1)
k=d2sm_MatchBrace(txt,j,123)
var/mtxt=copytext(txt,j+2,k-1)
var/_x=0,_y=0
for(i=1,,++_y)
j=findText(mtxt,"\n",i+1)
if(!j) break
_x=max(_x,(j-i-1)/codelen)
i=j
// print out this z-level now
F << "\t[coords[3]]"
i=1
for(var/y=_y,y>0,--y) // map is top-down
++i
F << "\t\t[y]"
for(var/x in 1 to _x)
F << "\t\t\t[x]"
j=i+codelen
F << codes[copytext(mtxt,i,j)]
i=j
txt=copytext(txt,k+1)
/* for(z in 1 to Z)
F << "\t[z]"
for(var/y in 1 to Y)
F << "\t\t[y]"
for(var/x in 1 to X)
F << "\t\t\t[x]"
F << codes[pick(codes)] */
proc/d2sm_ParseCommaList(txt)
var/list/L=new
var/i,ch
for(i=1,i<=length(txt),++i)
if(text2ascii(txt,i)>32) break
for(,i<=length(txt),++i)
ch=text2ascii(txt,i)
if(ch==44)
L+=copytext(txt,1,i)
for(++i,i<=length(txt),++i) if(text2ascii(txt,i)>32) break
txt=copytext(txt,i)
i=0;continue
if(ch==40 || ch==91 || ch==123)
i=d2sm_MatchBrace(txt,i,ch)
if(!i) return "No matching brace found for [ascii2text(ch)]"
if(i>1) L+=copytext(txt,1,i)
return L
proc/d2sm_MatchBrace(txt, i, which)
if(which==40) ++which
else which+=2
var/j,ch
for(j=i+1,j<=length(txt),++j)
ch=text2ascii(txt,j)
if(ch==which) return j
if(ch==40 || ch==91 || ch==123)
j=d2sm_MatchBrace(txt,j,ch)
if(!j) return 0
proc/d2sm_ConvertType(tt,tabs="")
var/i=findText(tt,"{")
if(!i) return "[tabs]type = [tt]\n"
.="[tabs]type = [copytext(tt,1,i)]\n"
var/list/L=d2sm_ParseCommaList(copytext(tt,i+1,d2sm_MatchBrace(tt,i,123)))
if(istext(L)) return
for(var/pair in L)
.="[.][tabs][pair]\n"
proc/d2sm_Contents(list/conts,n,tabs="")
.="[tabs]contents = list("
var/i
for(i=0,i<n,++i)
.+="[i?", ":""]object(\".[i]\")"
.+=")\n"
tabs+="\t"
for(i=0,i<n,++i)
.+="[tabs].[i]\n"
.+=d2sm_ConvertType(conts[i+1],tabs+"\t")
+212 -62
View File
@@ -5,7 +5,7 @@
UI_style,
UI_style_color,
UI_style_alpha,
be_special,
be_role,
default_slot,
toggles,
sound,
@@ -28,18 +28,19 @@
UI_style = query.item[2]
UI_style_color = query.item[3]
UI_style_alpha = text2num(query.item[4])
be_special = text2num(query.item[5])
be_special = params2list(query.item[5])
default_slot = text2num(query.item[6])
toggles = text2num(query.item[7])
sound = text2num(query.item[8])
randomslot = text2num(query.item[9])
volume = text2num(query.item[10])
old_roles_to_new(C)
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
// lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, list("White", "Midnight"), initial(UI_style))
be_special = sanitize_integer(be_special, 0, 65535, initial(be_special))
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
sound = sanitize_integer(sound, 0, 65535, initial(sound))
@@ -51,13 +52,19 @@
/datum/preferences/proc/save_preferences(client/C)
// Might as well scrub out any malformed be_special list entries while we're here
for (var/role in be_special)
if(!(role in special_roles))
log_to_dd("[C.key] had a malformed role entry: '[role]'. Removing!")
be_special -= role
var/DBQuery/query = dbcon.NewQuery({"UPDATE [format_table_name("player")]
SET
ooccolor='[ooccolor]',
UI_style='[UI_style]',
UI_style_color='[UI_style_color]',
UI_style_alpha='[UI_style_alpha]',
be_special='[be_special]',
be_role='[list2params(sql_sanitize_text_list(be_special))]',
default_slot='[default_slot]',
toggles='[toggles]',
sound='[sound]',
@@ -82,7 +89,60 @@
var/DBQuery/firstquery = dbcon.NewQuery("UPDATE [format_table_name("player")] SET default_slot=[slot] WHERE ckey='[C.ckey]'")
firstquery.Execute()
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("characters")] WHERE ckey='[C.ckey]' AND slot='[slot]'")
// Let's not have this explode if you sneeze on the DB
var/DBQuery/query = dbcon.NewQuery({"SELECT
OOC_Notes,
real_name,
name_is_always_random,
gender,
age,
species,
language,
hair_red,
hair_green,
hair_blue,
facial_red,
facial_green,
facial_blue,
skin_tone,
skin_red,
skin_green,
skin_blue,
hair_style_name,
facial_style_name,
eyes_red,
eyes_green,
eyes_blue,
underwear,
undershirt,
backbag,
b_type,
alternate_option,
job_support_high,
job_support_med,
job_support_low,
job_medsci_high,
job_medsci_med,
job_medsci_low,
job_engsec_high,
job_engsec_med,
job_engsec_low,
job_karma_high,
job_karma_med,
job_karma_low,
flavor_text,
med_record,
sec_record,
gen_record,
disabilities,
player_alt_titles,
organ_data,
rlimb_data,
nanotrasen_relation,
speciesprefs,
socks,
body_accessory
FROM [format_table_name("characters")] WHERE ckey='[C.ckey]' AND slot='[slot]'"})
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during character slot loading. Error : \[[err]\]\n")
@@ -91,68 +151,67 @@
while(query.NextRow())
//Character
metadata = query.item[4]
real_name = query.item[5]
be_random_name = text2num(query.item[6])
gender = query.item[7]
age = text2num(query.item[8])
species = query.item[9]
language = query.item[10]
metadata = query.item[1]
real_name = query.item[2]
be_random_name = text2num(query.item[3])
gender = query.item[4]
age = text2num(query.item[5])
species = query.item[6]
language = query.item[7]
//colors to be consolidated into hex strings (requires some work with dna code)
r_hair = text2num(query.item[11])
g_hair = text2num(query.item[12])
b_hair = text2num(query.item[13])
r_facial = text2num(query.item[14])
g_facial = text2num(query.item[15])
b_facial = text2num(query.item[16])
s_tone = text2num(query.item[17])
r_skin = text2num(query.item[18])
g_skin = text2num(query.item[19])
b_skin = text2num(query.item[20])
h_style = query.item[21]
f_style = query.item[22]
r_eyes = text2num(query.item[23])
g_eyes = text2num(query.item[24])
b_eyes = text2num(query.item[25])
underwear = query.item[26]
undershirt = query.item[27]
backbag = text2num(query.item[28])
b_type = query.item[29]
r_hair = text2num(query.item[8])
g_hair = text2num(query.item[9])
b_hair = text2num(query.item[10])
r_facial = text2num(query.item[11])
g_facial = text2num(query.item[12])
b_facial = text2num(query.item[13])
s_tone = text2num(query.item[14])
r_skin = text2num(query.item[15])
g_skin = text2num(query.item[16])
b_skin = text2num(query.item[17])
h_style = query.item[18]
f_style = query.item[19]
r_eyes = text2num(query.item[20])
g_eyes = text2num(query.item[21])
b_eyes = text2num(query.item[22])
underwear = query.item[23]
undershirt = query.item[24]
backbag = text2num(query.item[25])
b_type = query.item[26]
//Jobs
alternate_option = text2num(query.item[30])
job_support_high = text2num(query.item[31])
job_support_med = text2num(query.item[32])
job_support_low = text2num(query.item[33])
job_medsci_high = text2num(query.item[34])
job_medsci_med = text2num(query.item[35])
job_medsci_low = text2num(query.item[36])
job_engsec_high = text2num(query.item[37])
job_engsec_med = text2num(query.item[38])
job_engsec_low = text2num(query.item[39])
job_karma_high = text2num(query.item[40])
job_karma_med = text2num(query.item[41])
job_karma_low = text2num(query.item[42])
alternate_option = text2num(query.item[27])
job_support_high = text2num(query.item[28])
job_support_med = text2num(query.item[29])
job_support_low = text2num(query.item[30])
job_medsci_high = text2num(query.item[31])
job_medsci_med = text2num(query.item[32])
job_medsci_low = text2num(query.item[33])
job_engsec_high = text2num(query.item[34])
job_engsec_med = text2num(query.item[35])
job_engsec_low = text2num(query.item[36])
job_karma_high = text2num(query.item[37])
job_karma_med = text2num(query.item[38])
job_karma_low = text2num(query.item[39])
//Miscellaneous
flavor_text = query.item[43]
med_record = query.item[44]
sec_record = query.item[45]
gen_record = query.item[46]
be_special = text2num(query.item[47])
disabilities = text2num(query.item[48])
player_alt_titles = params2list(query.item[49])
organ_data = params2list(query.item[50])
rlimb_data = params2list(query.item[51])
nanotrasen_relation = query.item[52]
speciesprefs = text2num(query.item[53])
flavor_text = query.item[40]
med_record = query.item[41]
sec_record = query.item[42]
gen_record = query.item[43]
disabilities = text2num(query.item[44])
player_alt_titles = params2list(query.item[45])
organ_data = params2list(query.item[46])
rlimb_data = params2list(query.item[47])
nanotrasen_relation = query.item[48]
speciesprefs = text2num(query.item[49])
//socks
socks = query.item[54]
body_accessory = query.item[55]
socks = query.item[50]
body_accessory = query.item[51]
//Sanitize
metadata = sanitize_text(metadata, initial(metadata))
real_name = reject_bad_name(real_name)
@@ -198,7 +257,6 @@
job_karma_med = sanitize_integer(job_karma_med, 0, 65535, initial(job_karma_med))
job_karma_low = sanitize_integer(job_karma_low, 0, 65535, initial(job_karma_low))
disabilities = sanitize_integer(disabilities, 0, 65535, initial(disabilities))
be_special = sanitize_integer(be_special, 0, 65535, initial(be_special))
socks = sanitize_text(socks, initial(socks))
body_accessory = sanitize_text(body_accessory, initial(body_accessory))
@@ -269,7 +327,6 @@
sec_record='[sql_sanitize_text(html_decode(sec_record))]',
gen_record='[sql_sanitize_text(html_decode(gen_record))]',
player_alt_titles='[playertitlelist]',
be_special='[be_special]',
disabilities='[disabilities]',
organ_data='[organlist]',
rlimb_data='[rlimblist]',
@@ -303,7 +360,7 @@
job_engsec_high, job_engsec_med, job_engsec_low,
job_karma_high, job_karma_med, job_karma_low,
flavor_text, med_record, sec_record, gen_record,
player_alt_titles, be_special,
player_alt_titles,
disabilities, organ_data, rlimb_data, nanotrasen_relation, speciesprefs,
socks, body_accessory)
@@ -322,7 +379,7 @@
'[job_engsec_high]', '[job_engsec_med]', '[job_engsec_low]',
'[job_karma_high]', '[job_karma_med]', '[job_karma_low]',
'[sql_sanitize_text(html_encode(flavor_text))]', '[sql_sanitize_text(html_encode(med_record))]', '[sql_sanitize_text(html_encode(sec_record))]', '[sql_sanitize_text(html_encode(gen_record))]',
'[playertitlelist]', '[be_special]',
'[playertitlelist]',
'[disabilities]', '[organlist]', '[rlimblist]', '[nanotrasen_relation]', '[speciesprefs]',
'[socks]', '[body_accessory]')
@@ -335,6 +392,99 @@
message_admins("SQL ERROR during character slot saving. Error : \[[err]\]\n")
return
return 1
// If you see this proc lying around and don't know why it's there, expunge it, as this is for a short-term DB update, starting 27/12/2015
// 0 on failed update, 1 on success
/datum/preferences/proc/old_roles_to_new(var/client/C)
var/DBQuery/query = dbcon.NewQuery({"
SELECT be_special
FROM [format_table_name("player")]
WHERE ckey='[C.ckey]'"})
if(!query.Execute())
return 0
var/old_be_special
while(query.NextRow())
old_be_special = text2num(query.item[1])
if(isnull(old_be_special))
message_admins("SQL NOTICE: be_special has been purged from the database, bug the coders.\n")
return 0
old_be_special = sanitize_integer(old_be_special, 0, 65535)
var/B_traitor = 1
var/B_operative = 2
var/B_changeling = 4
var/B_wizard = 8
var/B_malf = 16
var/B_rev = 32
var/B_alien = 64
var/B_pai = 128
var/B_cultist = 256
var/B_ninja = 512
var/B_raider = 1024
var/B_vampire = 2048
var/B_mutineer = 4096
var/B_blob = 8192
var/B_shadowling = 16384
var/B_revenant = 32768
var/list/archived = list(B_traitor,B_operative,B_changeling,B_wizard,B_malf,B_rev,B_alien,B_pai,B_cultist,B_ninja,B_raider,B_vampire,B_mutineer,B_blob,B_shadowling,B_revenant)
// meow meow I am the copy cat
for(var/flag in archived)
if(old_be_special & flag)
switch(flag)
// hello i am byond i think constant variables r dumm
if(1)
be_special |= ROLE_TRAITOR
if(2)
be_special |= ROLE_OPERATIVE
if(4)
be_special |= ROLE_CHANGELING
if(8)
be_special |= ROLE_WIZARD
if(16)
be_special |= ROLE_MALF
if(32)
be_special |= ROLE_REV
if(64)
be_special |= ROLE_ALIEN
be_special |= ROLE_SENTIENT
be_special |= ROLE_DEMON
be_special |= ROLE_BORER
if(128)
be_special |= ROLE_PAI
be_special |= ROLE_POSIBRAIN
be_special |= ROLE_GUARDIAN
if(256)
be_special |= ROLE_CULTIST
if(512)
be_special |= ROLE_NINJA
if(1024)
be_special |= ROLE_RAIDER
if(2048)
be_special |= ROLE_VAMPIRE
if(4096)
be_special |= ROLE_MUTINEER
if(8192)
be_special |= ROLE_BLOB
if(16384)
be_special |= ROLE_SHADOWLING
if(32768)
be_special |= ROLE_REVENANT
var/DBQuery/query2 = dbcon.NewQuery({"UPDATE [format_table_name("player")]
SET
be_role='[list2params(sql_sanitize_text_list(be_special))]'
WHERE ckey='[C.ckey]'"}
)
if(!query2.Execute())
var/err = query2.ErrorMsg()
log_game("SQL ERROR during saving player preferences. Error : \[[err]\]\n")
message_admins("SQL ERROR during saving player preferences. Error : \[[err]\]\n")
return
return 1
/*
/datum/preferences/proc/random_character(client/C)
var/DBQuery/query = dbcon.NewQuery("SELECT slot FROM [format_table_name("characters")] WHERE ckey='[C.ckey]' ORDER BY slot")
-443
View File
@@ -1,443 +0,0 @@
#define SAVEFILE_VERSION_MIN 8
#define SAVEFILE_VERSION_MAX 12
//handles converting savefiles to new formats
//MAKE SURE YOU KEEP THIS UP TO DATE!
//If the sanity checks are capable of handling any issues. Only increase SAVEFILE_VERSION_MAX,
//this will mean that savefile_version will still be over SAVEFILE_VERSION_MIN, meaning
//this savefile update doesn't run everytime we load from the savefile.
//This is mainly for format changes, such as the bitflags in toggles changing order or something.
//if a file can't be updated, return 0 to delete it and start again
//if a file was updated, return 1
/datum/preferences/proc/savefile_update()
if(savefile_version < 8) //lazily delete everything + additional files so they can be saved in the new format
for(var/ckey in preferences_datums)
var/datum/preferences/D = preferences_datums[ckey]
if(D == src)
var/delpath = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/"
if(delpath && fexists(delpath))
fdel(delpath)
break
return 0
if(savefile_version == SAVEFILE_VERSION_MAX) //update successful.
save_preferences()
save_character()
return 1
return 0
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
if(!ckey) return
path = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/[filename]"
savefile_version = SAVEFILE_VERSION_MAX
/*
/datum/preferences/proc/load_preferences()
if(!path) return 0
if(!fexists(path)) return 0
var/savefile/S = new /savefile(path)
if(!S) return 0
S.cd = "/"
S["version"] >> savefile_version
//Conversion
if(!savefile_version || !isnum(savefile_version) || savefile_version < SAVEFILE_VERSION_MIN || savefile_version > SAVEFILE_VERSION_MAX)
if(!savefile_update()) //handles updates
savefile_version = SAVEFILE_VERSION_MAX
save_preferences()
save_character()
return 0
//general preferences
S["ooccolor"] >> ooccolor
S["lastchangelog"] >> lastchangelog
S["UI_style"] >> UI_style
S["be_special"] >> be_special
S["default_slot"] >> default_slot
S["toggles"] >> toggles
S["sound"] >> sound
S["UI_style_color"] >> UI_style_color
S["UI_style_alpha"] >> UI_style_alpha
S["randomslot"] >> randomslot
S["volume"] >> volume
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, list("White", "Midnight"), initial(UI_style))
be_special = sanitize_integer(be_special, 0, 65535, initial(be_special))
default_slot = sanitize_integer(default_slot, 1, MAX_SAVE_SLOTS, initial(default_slot))
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
sound = sanitize_integer(sound, 0, 65535, initial(toggles))
UI_style_color = sanitize_hexcolor(UI_style_color, initial(UI_style_color))
UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha))
randomslot = sanitize_integer(randomslot, 0, 1, initial(randomslot))
volume = sanitize_integer(volume, 0, 100, initial(volume))
return 1
/datum/preferences/proc/save_preferences()
if(!path) return 0
var/savefile/S = new /savefile(path)
if(!S) return 0
S.cd = "/"
S["version"] << savefile_version
//general preferences
S["ooccolor"] << ooccolor
S["lastchangelog"] << lastchangelog
S["UI_style"] << UI_style
S["be_special"] << be_special
S["default_slot"] << default_slot
S["toggles"] << toggles
S["sound"] << sound
S["UI_style_color"] << UI_style_color
S["UI_style_alpha"] << UI_style_alpha
S["randomslot"] << randomslot
S["volume"] << volume
return 1
//saving volume changes
/datum/preferences/proc/save_volume()
if(!path) return 0
var/savefile/S = new /savefile(path)
if(!S) return 0
S.cd = "/"
S["volume"] << volume
return 1
*/
/datum/preferences/proc/load_save(dir)
var/savefile/S = new /savefile(path)
if(!S) return 0
S.cd = dir
//Character
S["OOC_Notes"] >> metadata
S["real_name"] >> real_name
S["name_is_always_random"] >> be_random_name
S["gender"] >> gender
S["age"] >> age
S["species"] >> species
S["language"] >> language
S["spawnpoint"] >> spawnpoint
//colors to be consolidated into hex strings (requires some work with dna code)
S["hair_red"] >> r_hair
S["hair_green"] >> g_hair
S["hair_blue"] >> b_hair
S["facial_red"] >> r_facial
S["facial_green"] >> g_facial
S["facial_blue"] >> b_facial
S["skin_tone"] >> s_tone
S["skin_red"] >> r_skin
S["skin_green"] >> g_skin
S["skin_blue"] >> b_skin
S["hair_style_name"] >> h_style
S["facial_style_name"] >> f_style
S["eyes_red"] >> r_eyes
S["eyes_green"] >> g_eyes
S["eyes_blue"] >> b_eyes
S["underwear"] >> underwear
S["undershirt"] >> undershirt
S["socks"] >> socks
S["backbag"] >> backbag
S["b_type"] >> b_type
S["accent"] >> accent
S["voice"] >> voice
S["pitch"] >> pitch
S["talkspeed"] >> talkspeed
//Jobs
S["alternate_option"] >> alternate_option
S["job_civilian_high"] >> job_civilian_high
S["job_civilian_med"] >> job_civilian_med
S["job_civilian_low"] >> job_civilian_low
S["job_medsci_high"] >> job_medsci_high
S["job_medsci_med"] >> job_medsci_med
S["job_medsci_low"] >> job_medsci_low
S["job_engsec_high"] >> job_engsec_high
S["job_engsec_med"] >> job_engsec_med
S["job_engsec_low"] >> job_engsec_low
S["job_karma_high"] >> job_karma_high
S["job_karma_med"] >> job_karma_med
S["job_karma_low"] >> job_karma_low
//Miscellaneous
S["flavor_text"] >> flavor_text
S["med_record"] >> med_record
S["sec_record"] >> sec_record
S["gen_record"] >> gen_record
S["be_special"] >> be_special
S["disabilities"] >> disabilities
S["player_alt_titles"] >> player_alt_titles
S["organ_data"] >> organ_data
S["nanotrasen_relation"] >> nanotrasen_relation
//S["skin_style"] >> skin_style
//Sanitize
metadata = sanitize_text(metadata, initial(metadata))
real_name = reject_bad_name(real_name)
if(isnull(species)) species = "Human"
if(isnull(language)) language = "None"
if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation)
if(!real_name) real_name = random_name(gender,species)
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
gender = sanitize_gender(gender)
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
r_hair = sanitize_integer(r_hair, 0, 255, initial(r_hair))
g_hair = sanitize_integer(g_hair, 0, 255, initial(g_hair))
b_hair = sanitize_integer(b_hair, 0, 255, initial(b_hair))
r_facial = sanitize_integer(r_facial, 0, 255, initial(r_facial))
g_facial = sanitize_integer(g_facial, 0, 255, initial(g_facial))
b_facial = sanitize_integer(b_facial, 0, 255, initial(b_facial))
s_tone = sanitize_integer(s_tone, -185, 34, initial(s_tone))
r_skin = sanitize_integer(r_skin, 0, 255, initial(r_skin))
g_skin = sanitize_integer(g_skin, 0, 255, initial(g_skin))
b_skin = sanitize_integer(b_skin, 0, 255, initial(b_skin))
h_style = sanitize_inlist(h_style, hair_styles_list, initial(h_style))
f_style = sanitize_inlist(f_style, facial_hair_styles_list, initial(f_style))
r_eyes = sanitize_integer(r_eyes, 0, 255, initial(r_eyes))
g_eyes = sanitize_integer(g_eyes, 0, 255, initial(g_eyes))
b_eyes = sanitize_integer(b_eyes, 0, 255, initial(b_eyes))
underwear = sanitize_integer(underwear, 1, underwear_m.len, initial(underwear))
undershirt = sanitize_integer(undershirt, 1, undershirt_t.len, initial(undershirt))
socks = sanitize_integer(socks,1 socks_t.len, initial(socks))
backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag))
b_type = sanitize_text(b_type, initial(b_type))
accent = sanitize_text(accent, initial(accent))
voice = sanitize_text(voice, initial(voice))
pitch = sanitize_text(pitch, initial(pitch))
talkspeed = sanitize_text(talkspeed, initial(talkspeed))
alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option))
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med))
job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low))
job_medsci_high = sanitize_integer(job_medsci_high, 0, 65535, initial(job_medsci_high))
job_medsci_med = sanitize_integer(job_medsci_med, 0, 65535, initial(job_medsci_med))
job_medsci_low = sanitize_integer(job_medsci_low, 0, 65535, initial(job_medsci_low))
job_engsec_high = sanitize_integer(job_engsec_high, 0, 65535, initial(job_engsec_high))
job_engsec_med = sanitize_integer(job_engsec_med, 0, 65535, initial(job_engsec_med))
job_engsec_low = sanitize_integer(job_engsec_low, 0, 65535, initial(job_engsec_low))
job_karma_high = sanitize_integer(job_karma_high, 0, 65535, initial(job_karma_high))
job_karma_med = sanitize_integer(job_karma_med, 0, 65535, initial(job_karma_med))
job_karma_low = sanitize_integer(job_karma_low, 0, 65535, initial(job_karma_low))
if(isnull(disabilities)) disabilities = 0
if(!player_alt_titles) player_alt_titles = new()
if(!organ_data) src.organ_data = list()
//if(!skin_style) skin_style = "Default"
/datum/preferences/proc/random_character()
if(!path) return 0
if(!fexists(path)) return 0
var/savefile/S = new /savefile(path)
if(!S) return 0
var/list/saves = list()
var/name
for(var/i=1, i<=MAX_SAVE_SLOTS, i++)
S.cd = "/character[i]"
S["real_name"] >> name
if(!name) continue
saves.Add(S.cd)
if(!saves.len)
load_character()
return 0
S.cd = pick(saves)
load_save(S.cd)
return 1
/*
/datum/preferences/proc/load_character(slot)
if(!path) return 0
if(!fexists(path)) return 0
var/savefile/S = new /savefile(path)
if(!S) return 0
S.cd = "/"
if(!slot) slot = default_slot
slot = sanitize_integer(slot, 1, MAX_SAVE_SLOTS, initial(default_slot))
if(slot != default_slot)
default_slot = slot
S["default_slot"] << slot
S.cd = "/character[slot]"
load_save(S.cd)
Now loaded by proc load_save(S.cd)
//Character
S["OOC_Notes"] >> metadata
S["real_name"] >> real_name
S["name_is_always_random"] >> be_random_name
S["gender"] >> gender
S["age"] >> age
S["species"] >> species
S["language"] >> language
//colors to be consolidated into hex strings (requires some work with dna code)
S["hair_red"] >> r_hair
S["hair_green"] >> g_hair
S["hair_blue"] >> b_hair
S["facial_red"] >> r_facial
S["facial_green"] >> g_facial
S["facial_blue"] >> b_facial
S["skin_tone"] >> s_tone
S["skin_red"] >> r_skin
S["skin_green"] >> g_skin
S["skin_blue"] >> b_skin
S["hair_style_name"] >> h_style
S["facial_style_name"] >> f_style
S["eyes_red"] >> r_eyes
S["eyes_green"] >> g_eyes
S["eyes_blue"] >> b_eyes
S["underwear"] >> underwear
S["undershirt"] >> undershirt
S["backbag"] >> backbag
S["b_type"] >> b_type
//Jobs
S["alternate_option"] >> alternate_option
S["job_civilian_high"] >> job_civilian_high
S["job_civilian_med"] >> job_civilian_med
S["job_civilian_low"] >> job_civilian_low
S["job_medsci_high"] >> job_medsci_high
S["job_medsci_med"] >> job_medsci_med
S["job_medsci_low"] >> job_medsci_low
S["job_engsec_high"] >> job_engsec_high
S["job_engsec_med"] >> job_engsec_med
S["job_engsec_low"] >> job_engsec_low
//Miscellaneous
S["flavor_text"] >> flavor_text
S["med_record"] >> med_record
S["sec_record"] >> sec_record
S["gen_record"] >> gen_record
S["be_special"] >> be_special
S["disabilities"] >> disabilities
S["player_alt_titles"] >> player_alt_titles
S["organ_data"] >> organ_data
S["nanotrasen_relation"] >> nanotrasen_relation
//S["skin_style"] >> skin_style
//Sanitize
metadata = sanitize_text(metadata, initial(metadata))
real_name = reject_bad_name(real_name)
if(isnull(species)) species = "Human"
if(isnull(language)) language = "None"
if(isnull(spawnpoint)) spawnpoint = "Arrivals Shuttle"
if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation)
if(!real_name) real_name = random_name(gender)
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
gender = sanitize_gender(gender)
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
r_hair = sanitize_integer(r_hair, 0, 255, initial(r_hair))
g_hair = sanitize_integer(g_hair, 0, 255, initial(g_hair))
b_hair = sanitize_integer(b_hair, 0, 255, initial(b_hair))
r_facial = sanitize_integer(r_facial, 0, 255, initial(r_facial))
g_facial = sanitize_integer(g_facial, 0, 255, initial(g_facial))
b_facial = sanitize_integer(b_facial, 0, 255, initial(b_facial))
s_tone = sanitize_integer(s_tone, -185, 34, initial(s_tone))
r_skin = sanitize_integer(r_skin, 0, 255, initial(r_skin))
g_skin = sanitize_integer(g_skin, 0, 255, initial(g_skin))
b_skin = sanitize_integer(b_skin, 0, 255, initial(b_skin))
h_style = sanitize_inlist(h_style, hair_styles_list, initial(h_style))
f_style = sanitize_inlist(f_style, facial_hair_styles_list, initial(f_style))
r_eyes = sanitize_integer(r_eyes, 0, 255, initial(r_eyes))
g_eyes = sanitize_integer(g_eyes, 0, 255, initial(g_eyes))
b_eyes = sanitize_integer(b_eyes, 0, 255, initial(b_eyes))
underwear = sanitize_integer(underwear, 1, underwear_m.len, initial(underwear))
undershirt = sanitize_integer(undershirt, 1, undershirt_t.len, initial(undershirt))
backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag))
b_type = sanitize_text(b_type, initial(b_type))
alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option))
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med))
job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low))
job_medsci_high = sanitize_integer(job_medsci_high, 0, 65535, initial(job_medsci_high))
job_medsci_med = sanitize_integer(job_medsci_med, 0, 65535, initial(job_medsci_med))
job_medsci_low = sanitize_integer(job_medsci_low, 0, 65535, initial(job_medsci_low))
job_engsec_high = sanitize_integer(job_engsec_high, 0, 65535, initial(job_engsec_high))
job_engsec_med = sanitize_integer(job_engsec_med, 0, 65535, initial(job_engsec_med))
job_engsec_low = sanitize_integer(job_engsec_low, 0, 65535, initial(job_engsec_low))
if(isnull(disabilities)) disabilities = 0
if(!player_alt_titles) player_alt_titles = new()
if(!organ_data) src.organ_data = list()
//if(!skin_style) skin_style = "Default"
return 1
/datum/preferences/proc/save_character()
if(!path) return 0
var/savefile/S = new /savefile(path)
if(!S) return 0
S.cd = "/character[default_slot]"
//Character
S["OOC_Notes"] << metadata
S["real_name"] << real_name
S["name_is_always_random"] << be_random_name
S["gender"] << gender
S["age"] << age
S["species"] << species
S["language"] << language
S["hair_red"] << r_hair
S["hair_green"] << g_hair
S["hair_blue"] << b_hair
S["facial_red"] << r_facial
S["facial_green"] << g_facial
S["facial_blue"] << b_facial
S["skin_tone"] << s_tone
S["skin_red"] << r_skin
S["skin_green"] << g_skin
S["skin_blue"] << b_skin
S["hair_style_name"] << h_style
S["facial_style_name"] << f_style
S["eyes_red"] << r_eyes
S["eyes_green"] << g_eyes
S["eyes_blue"] << b_eyes
S["underwear"] << underwear
S["undershirt"] << undershirt
S["backbag"] << backbag
S["b_type"] << b_type
S["accent"] << accent
S["voice"] << voice
S["pitch"] << pitch
S["talkspeed"] << talkspeed
//Jobs
S["alternate_option"] << alternate_option
S["job_civilian_high"] << job_civilian_high
S["job_civilian_med"] << job_civilian_med
S["job_civilian_low"] << job_civilian_low
S["job_medsci_high"] << job_medsci_high
S["job_medsci_med"] << job_medsci_med
S["job_medsci_low"] << job_medsci_low
S["job_engsec_high"] << job_engsec_high
S["job_engsec_med"] << job_engsec_med
S["job_engsec_low"] << job_engsec_low
S["job_karma_high"] << job_karma_high
S["job_karma_med"] << job_karma_med
S["job_karma_low"] << job_karma_low
//Miscellaneous
S["flavor_text"] << flavor_text
S["med_record"] << med_record
S["sec_record"] << sec_record
S["gen_record"] << gen_record
S["player_alt_titles"] << player_alt_titles
S["be_special"] << be_special
S["disabilities"] << disabilities
S["organ_data"] << organ_data
S["nanotrasen_relation"] << nanotrasen_relation
//S["skin_style"] << skin_style
return 1
*/
#undef SAVEFILE_VERSION_MAX
#undef SAVEFILE_VERSION_MIN
+1
View File
@@ -264,6 +264,7 @@ BLIND // can't see anything
var/flash_protect = 0
var/tint = 0
var/HUDType = null
var/darkness_view = 0
var/vision_flags = 0
var/see_darkness = 1
@@ -1,29 +0,0 @@
//Captain's Spacesuit
/obj/item/clothing/head/helmet/space/capspace
name = "space helmet"
icon_state = "capspace"
item_state = "capspacehelmet"
desc = "A special helmet designed for work in a hazardous, low-pressure environment. Only for the most fashionable of military figureheads."
flags = HEADCOVERSEYES | BLOCKHAIR | STOPSPRESSUREDMAGE|HEADCOVERSMOUTH
flags_inv = HIDEFACE
permeability_coefficient = 0.01
armor = list(melee = 65, bullet = 50, laser = 50,energy = 25, bomb = 50, bio = 100, rad = 50)
//Captain's space suit This is not the proper path but I don't currently know enough about how this all works to mess with it.
/obj/item/clothing/suit/armor/captain
name = "Captain's armor"
desc = "A bulky, heavy-duty piece of exclusive Nanotrasen armor. YOU are in charge!"
icon_state = "caparmor"
item_state = "capspacesuit"
w_class = 4
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.02
flags = STOPSPRESSUREDMAGE | ONESIZEFITSALL
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy, /obj/item/weapon/gun/projectile, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs)
slowdown = 1.5
armor = list(melee = 65, bullet = 50, laser = 50, energy = 25, bomb = 50, bio = 100, rad = 50)
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT||HIDETAIL
cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS
min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE
siemens_coefficient = 0.7
+21
View File
@@ -364,6 +364,27 @@
user.update_inv_wear_suit()
user.update_inv_w_uniform()
//Elite Syndie suit
/obj/item/clothing/head/helmet/space/rig/syndi/elite
name = "elite syndicate hardsuit helmet"
desc = "An elite version of the syndicate helmet, with improved armour and fire shielding. It is in travel mode. Property of Gorlex Marauders."
icon_state = "hardsuit0-syndielite"
item_color = "syndielite"
armor = list(melee = 80, bullet = 70, laser = 50, energy = 25, bomb = 55, bio = 100, rad = 70)
heat_protection = HEAD
max_heat_protection_temperature = FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT
sprite_sheets = null
/obj/item/clothing/suit/space/rig/syndi/elite
name = "elite syndicate hardsuit"
desc = "An elite version of the syndicate hardsuit, with improved armour and fire shielding. It is in travel mode."
icon_state = "hardsuit0-syndielite"
item_color = "syndielite"
armor = list(melee = 80, bullet = 70, laser = 50, energy = 25, bomb = 55, bio = 100, rad = 70)
heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
max_heat_protection_temperature = FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT
sprite_sheets = null
//Wizard Rig
/obj/item/clothing/head/helmet/space/rig/wizard
name = "gem-encrusted hardsuit helmet"
-290
View File
@@ -1,290 +0,0 @@
//This dm file includes some food processing machines:
// - I. Mill
// - II. Fermenter
// - III. Still
// - IV. Squeezer
// - V. Centrifuge
// I. The mill is intended to be loaded with produce and returns ground up items. For example: Wheat should become flour and grapes should become raisins.
/obj/machinery/mill
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/milled_item
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Mill"
desc = "It is a machine that grinds produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 1000
/obj/machinery/mill/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
milled_item = input[1]
input -= milled_item
progress = 0
busy = 1
use_power = 2
return
progress++
if(progress < 10) //Edit this value to make milling faster or slower
return //Not done yet.
switch(milled_item.type)
if(/obj/item/weapon/reagent_containers/food/snacks/grown/wheat) //Wheat becomes flour
var/obj/item/weapon/reagent_containers/food/snacks/flour/F = new(src)
output += F
if(/obj/item/weapon/reagent_containers/food/snacks/flour) //Flour is still flour
var/obj/item/weapon/reagent_containers/food/snacks/flour/F = new(src)
output += F
else
error = 1
del(milled_item)
busy = 0
/obj/machinery/mill/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.unEquip(W)
W.loc = src
input += W
else
..()
/obj/machinery/mill/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// II. The fermenter is intended to be loaded with food items and returns medium-strength alcohol items, sucha s wine and beer.
/obj/machinery/fermenter
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/fermenting_item
var/water_level = 0
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Fermenter"
desc = "It is a machine that ferments produce into alcoholic drinks."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 500
/obj/machinery/fermenter/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
fermenting_item = input[1]
input -= fermenting_item
progress = 0
busy = 1
use_power = 2
return
if(!water_level)
return
water_level--
progress++
if(progress < 10) //Edit this value to make milling faster or slower
return //Not done yet.
switch(fermenting_item.type)
if(/obj/item/weapon/reagent_containers/food/snacks/flour) //Flour is still flour
var/obj/item/weapon/reagent_containers/food/drinks/cans/beer/B = new(src)
output += B
else
error = 1
del(fermenting_item)
busy = 0
/obj/machinery/fermenter/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.unEquip(W)
W.loc = src
input += W
else
..()
/obj/machinery/fermenter/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// III. The still is a machine that is loaded with food items and returns hard liquor, such as vodka.
/obj/machinery/still
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/destilling_item
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Still"
desc = "It is a machine that produces hard liquor from alcoholic drinks."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 10000
/obj/machinery/still/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
destilling_item = input[1]
input -= destilling_item
progress = 0
busy = 1
use_power = 2
return
progress++
if(progress < 10) //Edit this value to make distilling faster or slower
return //Not done yet.
switch(destilling_item.type)
if(/obj/item/weapon/reagent_containers/food/drinks/cans/beer) //Flour is still flour
var/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka/V = new(src)
output += V
else
error = 1
del(destilling_item)
busy = 0
/obj/machinery/still/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.unEquip(W)
W.loc = src
input += W
else
..()
/obj/machinery/still/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// IV. The squeezer is intended to destroy inserted food items, but return some of the reagents they contain.
/obj/machinery/squeezer
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/obj/item/weapon/reagent_containers/food/squeezed_item
var/water_level = 0
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Squeezer"
desc = "It is a machine that squeezes extracts from produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 500
// V. The centrifuge spins inserted food items. It is intended to squeeze out the reagents that are common food catalysts (enzymes currently)
/obj/machinery/centrifuge
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/spinning_item
var/busy = 0
var/progress = 0
var/error = 0
var/enzymes = 0
var/water = 0
name = "\improper Centrifuge"
desc = "It is a machine that spins produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 10000
/obj/machinery/centrifuge/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
spinning_item = input[1]
input -= spinning_item
progress = 0
busy = 1
use_power = 2
return
progress++
if(progress < 10) //Edit this value to make milling faster or slower
return //Not done yet.
var/transfer_enzymes = spinning_item.reagents.get_reagent_amount("enzyme")
if(transfer_enzymes)
enzymes += transfer_enzymes
spinning_item.reagents.remove_reagent("enzyme",transfer_enzymes)
output += spinning_item
busy = 0
/obj/machinery/centrifuge/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.unEquip(W)
W.loc = src
input += W
else
..()
/obj/machinery/centrifuge/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
while(enzymes >= 50)
enzymes -= 50
new/obj/item/weapon/reagent_containers/food/condiment/enzyme(src.loc)
-50
View File
@@ -1,50 +0,0 @@
/obj/item/weapon/spacecash
name = "0 credit chip"
desc = "It's worth 0 credits."
gender = PLURAL
icon = 'icons/obj/items.dmi'
icon_state = "spacecash"
opacity = 0
density = 0
anchored = 0.0
force = 1.0
throwforce = 1.0
throw_speed = 1
throw_range = 2
w_class = 1.0
var/access = list()
access = access_crate_cash
var/worth = 0
/obj/item/weapon/spacecash/c1
icon_state = "spacecash"
worth = 1
/obj/item/weapon/spacecash/c10
icon_state = "spacecash10"
worth = 10
/obj/item/weapon/spacecash/c20
icon_state = "spacecash20"
worth = 20
/obj/item/weapon/spacecash/c50
icon_state = "spacecash50"
worth = 50
/obj/item/weapon/spacecash/c100
icon_state = "spacecash100"
worth = 100
/obj/item/weapon/spacecash/c200
icon_state = "spacecash200"
worth = 200
/obj/item/weapon/spacecash/c500
icon_state = "spacecash500"
worth = 500
/obj/item/weapon/spacecash/c1000
icon_state = "spacecash1000"
worth = 1000
+2 -2
View File
@@ -21,7 +21,7 @@
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/candidates = get_candidates(BE_ALIEN,ALIEN_AFK_BRACKET)
var/list/candidates = get_candidates(ROLE_ALIEN,ALIEN_AFK_BRACKET)
while(spawncount > 0 && vents.len && candidates.len)
var/obj/vent = pick_n_take(vents)
@@ -33,4 +33,4 @@
spawncount--
successSpawn = 1
+2 -2
View File
@@ -22,7 +22,7 @@
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
var/list/candidates = get_candidates(BE_ALIEN,ALIEN_AFK_BRACKET)
var/list/candidates = get_candidates(ROLE_BORER,ALIEN_AFK_BRACKET)
while(spawncount > 0 && vents.len && candidates.len)
var/obj/vent = pick_n_take(vents)
var/client/C = pick_n_take(candidates)
@@ -32,4 +32,4 @@
spawncount--
successSpawn = 1
+1 -2
View File
@@ -4,7 +4,7 @@
/datum/event/spawn_slaughter/proc/get_slaughter(var/end_if_fail = 0)
key_of_slaughter = null
if(!key_of_slaughter)
var/list/candidates = get_candidates(BE_ALIEN)
var/list/candidates = get_candidates(ROLE_DEMON)
if(!candidates.len)
if(end_if_fail)
return 0
@@ -55,4 +55,3 @@
return 0
message_admins("Unfortunately, no candidates were available for becoming a Slaugter Demon. Shutting down.")
kill()
View File
-222
View File
@@ -1,222 +0,0 @@
/datum/playingcard
var/name = "playing card"
var/card_icon = "card_back"
/obj/item/weapon/deck
name = "deck of cards"
desc = "A simple deck of playing cards."
icon = 'icons/obj/playing_cards.dmi'
icon_state = "deck"
w_class = 2
var/list/cards = list()
/obj/item/weapon/deck/New()
..()
var/datum/playingcard/P
for(var/suit in list("spades","clubs","diamonds","hearts"))
var/colour
if(suit == "spades" || suit == "clubs")
colour = "black_"
else
colour = "red_"
for(var/number in list("ace","two","three","four","five","six","seven","eight","nine","ten"))
P = new()
P.name = "[number] of [suit]"
P.card_icon = "[colour]num"
cards += P
for(var/number in list("jack","queen","king"))
P = new()
P.name = "[number] of [suit]"
P.card_icon = "[colour]col"
cards += P
for(var/i = 0,i<2,i++)
P = new()
P.name = "joker"
P.card_icon = "joker"
cards += P
/obj/item/weapon/deck/attackby(obj/O as obj, mob/user as mob, params)
if(istype(O,/obj/item/weapon/hand))
var/obj/item/weapon/hand/H = O
for(var/datum/playingcard/P in H.cards)
cards += P
del(O)
user << "You place your cards on the bottom of the deck."
return
..()
/obj/item/weapon/deck/verb/draw_card()
set category = "Object"
set name = "Draw"
set desc = "Draw a card from a deck."
set src in oview(1)
if(usr.stat || !Adjacent(usr)) return
if(!istype(usr,/mob/living/carbon))
return
var/mob/living/carbon/user = usr
if(!cards.len)
usr << "There are no cards in the deck."
return
var/obj/item/weapon/hand/H
if(user.l_hand && istype(user.l_hand,/obj/item/weapon/hand))
H = user.l_hand
else if(user.r_hand && istype(user.r_hand,/obj/item/weapon/hand))
H = user.r_hand
else
H = new(get_turf(src))
user.put_in_hands(H)
if(!H || !user) return
var/datum/playingcard/P = cards[1]
H.cards += P
cards -= P
H.update_icon()
user.visible_message("\The [user] draws a card.")
user << "It's the [P]."
/obj/item/weapon/deck/verb/deal_card()
set category = "Object"
set name = "Deal"
set desc = "Deal a card from a deck."
if(usr.stat || !Adjacent(usr)) return
if(!cards.len)
usr << "There are no cards in the deck."
return
var/list/players = list()
for(var/mob/living/player in orange(3))
if(!player.stat)
players += player
players -= usr
var/mob/living/M = input("Who do you wish to deal a card?") as null|anything in players
if(!usr || !src || !M) return
var/obj/item/weapon/hand/H = new(get_turf(src))
H.cards += cards[1]
cards -= cards[1]
H.concealed = 1
H.update_icon()
usr.visible_message("\The [usr] deals a card to \the [M].")
H.throw_at(get_step(M,M.dir),10,1,H)
/obj/item/weapon/hand/attackby(obj/O as obj, mob/user as mob, params)
if(istype(O,/obj/item/weapon/hand))
var/obj/item/weapon/hand/H = O
for(var/datum/playingcard/P in H.cards)
cards += P
del(O)
user.put_in_hands(src)
update_icon()
return
..()
/obj/item/weapon/deck/attack_self(var/mob/user as mob)
var/list/newcards = list()
while(cards.len)
var/datum/playingcard/P = pick(cards)
newcards += P
cards -= P
cards = newcards
user.visible_message("\The [user] shuffles [src].")
/obj/item/weapon/hand
name = "hand of cards"
desc = "Some playing cards."
icon = 'icons/obj/playing_cards.dmi'
icon_state = "empty"
w_class = 1
var/concealed = 0
var/list/cards = list()
/obj/item/weapon/hand/verb/discard()
set category = "Object"
set name = "Discard"
set desc = "Place a card from your hand in front of you."
var/list/to_discard = list()
for(var/datum/playingcard/P in cards)
to_discard[P.name] = P
var/discarding = input("Which card do you wish to put down?") as null|anything in to_discard
if(!discarding || !to_discard[discarding] || !usr || !src) return
var/datum/playingcard/card = to_discard[discarding]
del(to_discard)
var/obj/item/weapon/hand/H = new(src.loc)
H.cards += card
cards -= card
H.concealed = 0
H.update_icon()
usr.visible_message("\The [usr] plays \the [discarding].")
H.loc = get_step(usr,usr.dir)
if(!cards.len)
del(src)
/obj/item/weapon/hand/attack_self(var/mob/user as mob)
concealed = !concealed
update_icon()
user.visible_message("\The [user] [concealed ? "conceals" : "reveals"] their hand.")
/obj/item/weapon/hand/examine(mob/user)
..(user)
if((!concealed || src.loc == usr) && cards.len)
user << "It contains: "
for(var/datum/playingcard/P in cards)
user << "The [P.name]."
/obj/item/weapon/hand/update_icon()
if(!cards.len)
del(src)
return
else if(cards.len > 1)
name = "hand of cards"
desc = "Some playing cards."
else
name = "a playing card"
desc = "A playing card."
overlays.Cut()
if(cards.len == 1)
var/datum/playingcard/P = cards[1]
var/image/I = new(src.icon, (concealed ? "card_back" : "[P.card_icon]") )
I.pixel_x += (-5+rand(10))
I.pixel_y += (-5+rand(10))
overlays += I
return
var/origin = -12
var/offset = Floor(32/cards.len)
var/i = 0
for(var/datum/playingcard/P in cards)
var/image/I = new(src.icon, (concealed ? "card_back" : "[P.card_icon]") )
I.pixel_x = origin+(offset*i)
overlays += I
i++
+1 -77
View File
@@ -2,80 +2,4 @@
var/list/currently_querying // Used to avoid asking the same ghost repeatedly.
// The following procs are used to grab players for mobs produced by a seed (mostly for dionaea).
/datum/seed/proc/handle_living_product(var/mob/living/host)
/*
if(!host || !istype(host)) return
spawn(0)
request_player(host)
if(istype(host,/mob/living/simple_animal))
return
spawn(75)
if(!host.ckey && !host.client)
host.death() // This seems redundant, but a lot of mobs don't
host.stat = DEAD // handle death() properly. Better safe than etc.
host.visible_message("<span class='danger'>[host] is malformed and unable to survive. It expires pitifully, leaving behind some seeds.</span>")
var/total_yield = rand(1,3)
for(var/j = 0;j<=total_yield;j++)
var/obj/item/seeds/S = new(get_turf(host))
S.seed_type = name
S.update_seed()
/datum/seed/proc/request_player(var/mob/living/host)
if(!host) return
for(var/mob/dead/observer/O in player_list)
if(jobban_isbanned(O, "Dionaea"))
continue
if(O.client)
if(O.client.prefs.be_special & BE_PLANT && !(O.client in currently_querying))
currently_querying |= O.client
question(O.client,host)
/datum/seed/proc/question(var/client/C,var/mob/living/host)
spawn(0)
if(!C || !host || !(C.mob && istype(C.mob,/mob/dead))) return // We don't want to spam them repeatedly if they're already in a mob.
var/response = alert(C, "Someone is harvesting [display_name]. Would you like to play as one?", "Sentient plant harvest", "Yes", "No", "Never for this round.")
if(!C || !host || !(C.mob && istype(C.mob,/mob/dead))) return // ...or accidentally accept an invalid argument for transfer.
if(response == "Yes")
transfer_personality(C,host)
else if (response == "Never for this round")
C.prefs.be_special ^= BE_PLANT
currently_querying -= C
/datum/seed/proc/transfer_personality(var/client/player,var/mob/living/host)
//Something is wrong, abort.
if(!player || !host) return
//Host already has a controller, pike off slowpoke.
if(host.client && host.ckey) return
//Transfer them over.
host.ckey = player.ckey
if(player.mob && player.mob.mind)
player.mob.mind.transfer_to(host)
if(host.dna) host.dna.real_name = host.real_name
// Update mode specific HUD icons.
callHook("harvest_podman", list(host))
host << "\green <B>You awaken slowly, stirring into sluggish motion as the air caresses you.</B>"
// This is a hack, replace with some kind of species blurb proc.
if(istype(host,/mob/living/simple_animal/diona))
host << "<B>You are [host], one of a race of drifting interstellar plantlike creatures that sometimes share their seeds with human traders.</B>"
host << "<B>Too much darkness will send you into shock and starve you, but light will help you heal.</B>"
var/newname = input(host,"Enter a name, or leave blank for the default name.", "Name change","") as text
newname = sanitize(newname)
if (newname != "")
host.real_name = newname
host.name = host.real_name
*/
/datum/seed/proc/handle_living_product(var/mob/living/host)
-209
View File
@@ -1,209 +0,0 @@
#define LIQUID_TRANSFER_THRESHOLD 0.05
var/liquid_delay = 4
var/list/datum/puddle/puddles = list()
datum/puddle
var/list/obj/effect/liquid/liquid_objects = list()
datum/puddle/proc/process()
//world << "DEBUG: Puddle process!"
for(var/obj/effect/liquid/L in liquid_objects)
L.spread()
for(var/obj/effect/liquid/L in liquid_objects)
L.apply_calculated_effect()
if(liquid_objects.len == 0)
del(src)
datum/puddle/New()
..()
puddles += src
datum/puddle/Del()
puddles -= src
for(var/obj/O in liquid_objects)
del(O)
..()
client/proc/splash()
var/volume = input("Volume?","Volume?", 0 ) as num
if(!isnum(volume)) return
if(volume <= LIQUID_TRANSFER_THRESHOLD) return
var/turf/T = get_turf(src.mob)
if(!isturf(T)) return
trigger_splash(T, volume)
proc/trigger_splash(turf/epicenter as turf, volume as num)
if(!epicenter)
return
if(volume <= 0)
return
var/obj/effect/liquid/L = new/obj/effect/liquid(epicenter)
L.volume = volume
L.update_icon2()
var/datum/puddle/P = new/datum/puddle()
P.liquid_objects.Add(L)
L.controller = P
obj/effect/liquid
icon = 'icons/effects/liquid.dmi'
icon_state = "0"
name = "liquid"
var/volume = 0
var/new_volume = 0
var/datum/puddle/controller
obj/effect/liquid/New()
..()
if( !isturf(loc) )
del(src)
for( var/obj/effect/liquid/L in loc )
if(L != src)
del(L)
obj/effect/liquid/proc/spread()
//world << "DEBUG: liquid spread!"
var/surrounding_volume = 0
var/list/spread_directions = list(1,2,4,8)
var/turf/loc_turf = get_turf(src)
for(var/direction in spread_directions)
var/turf/T = get_step(src,direction)
if(!T)
spread_directions.Remove(direction)
//world << "ERROR: Map edge!"
continue //Map edge
if(!loc_turf.can_leave_liquid(direction)) //Check if this liquid can leave the tile in the direction
spread_directions.Remove(direction)
continue
if(!T.can_accept_liquid(turn(direction,180))) //Check if this liquid can enter the tile
spread_directions.Remove(direction)
continue
var/obj/effect/liquid/L = locate(/obj/effect/liquid) in T
if(L)
if(L.volume >= src.volume)
spread_directions.Remove(direction)
continue
surrounding_volume += L.volume //If liquid already exists, add it's volume to our sum
else
var/obj/effect/liquid/NL = new(T) //Otherwise create a new object which we'll spread to.
NL.controller = src.controller
controller.liquid_objects.Add(NL)
if(!spread_directions.len)
//world << "ERROR: No candidate to spread to."
return //No suitable candidate to spread to
var/average_volume = (src.volume + surrounding_volume) / (spread_directions.len + 1) //Average amount of volume on this and the surrounding tiles.
var/volume_difference = src.volume - average_volume //How much more/less volume this tile has than the surrounding tiles.
if(volume_difference <= (spread_directions.len*LIQUID_TRANSFER_THRESHOLD)) //If we have less than the threshold excess liquid - then there is nothing to do as other tiles will be giving us volume.or the liquid is just still.
//world << "ERROR: transfer volume lower than THRESHOLD!"
return
var/volume_per_tile = volume_difference / spread_directions.len
for(var/direction in spread_directions)
var/turf/T = get_step(src,direction)
if(!T)
//world << "ERROR: Map edge 2!"
continue //Map edge
var/obj/effect/liquid/L = locate(/obj/effect/liquid) in T
if(L)
src.volume -= volume_per_tile //Remove the volume from this tile
L.new_volume = L.new_volume + volume_per_tile //Add it to the volume to the other tile
obj/effect/liquid/proc/apply_calculated_effect()
volume += new_volume
if(volume < LIQUID_TRANSFER_THRESHOLD)
del(src)
new_volume = 0
update_icon2()
obj/effect/liquid/Move()
return 0
obj/effect/liquid/Destroy()
src.controller.liquid_objects.Remove(src)
return ..()
obj/effect/liquid/proc/update_icon2()
//icon_state = num2text( max(1,min(7,(floor(volume),10)/10)) )
overlays = null
switch(volume)
if(0 to 0.2)
del(src)
if(0.2 to 5)
icon_state = "1"
overlays += image('icons/effects/liquid.dmi', src , "1-1", 5)
if(5 to 10)
icon_state = "2"
overlays += image('icons/effects/liquid.dmi', src , "2-1", 5)
if(10 to 20)
icon_state = "3"
overlays += image('icons/effects/liquid.dmi', src , "3-1", 5)
if(20 to 30)
icon_state = "4"
overlays += image('icons/effects/liquid.dmi', src , "4-1", 5)
if(30 to 40)
icon_state = "5"
overlays += image('icons/effects/liquid.dmi', src , "5-1", 5)
if(40 to 50)
icon_state = "6"
overlays += image('icons/effects/liquid.dmi', src , "6-1", 5)
if(50 to INFINITY)
icon_state = "7"
layer = 5
turf/proc/can_accept_liquid(from_direction)
return 0
turf/proc/can_leave_liquid(from_direction)
return 0
turf/space/can_accept_liquid(from_direction)
return 1
turf/space/can_leave_liquid(from_direction)
return 1
turf/simulated/floor/can_accept_liquid(from_direction)
for(var/obj/structure/window/W in src)
if(W.is_fulltile())
return 0
if(W.dir & from_direction)
return 0
for(var/obj/O in src)
if(!O.liquid_pass())
return 0
return 1
turf/simulated/floor/can_leave_liquid(to_direction)
for(var/obj/structure/window/W in src)
if(W.is_fulltile())
return 0
if(W.dir & to_direction)
return 0
for(var/obj/O in src)
if(!O.liquid_pass())
return 0
return 1
turf/simulated/wall/can_accept_liquid(from_direction)
return 0
turf/simulated/wall/can_leave_liquid(from_direction)
return 0
obj/proc/liquid_pass()
return 1
obj/machinery/door/liquid_pass()
return !density
#undef LIQUID_TRANSFER_THRESHOLD
@@ -1,242 +0,0 @@
/datum/hud/proc/alien_hud()
src.adding = list( )
src.other = list( )
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.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
//intent small hud objects
var/icon/ico
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = "harm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
//equippable shit
//suit
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_alien_oclothing
inv_box.slot_id = slot_wear_suit
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
using.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
inv_box.slot_id = slot_r_hand
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.layer = 19
inv_box.slot_id = slot_l_hand
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
//pocket 1
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
src.adding += inv_box
//pocket 2
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
src.adding += inv_box
//head
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hair"
inv_box.screen_loc = ui_alien_head
inv_box.slot_id = slot_head
inv_box.layer = 19
src.adding += inv_box
//end of equippable shit
/*
using = new /obj/screen()
using.name = "resist"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_resist"
using.screen_loc = ui_resist
using.layer = 19
src.adding += using
*/
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi'
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_alien_oxygen
mymob.toxin = new /obj/screen()
mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_alien_toxin
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_alien_fire
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
@@ -1,3 +0,0 @@
/mob/living/carbon/alien/larva/Login()
return ..()
@@ -1,71 +0,0 @@
//XCOM alien code
//By Xerif (Donated by the Foundation project, ss13.org)
/mob/living/carbon/alien/humanoid/special
has_fine_manipulation = 1
var/xcom_state
New()
..()
spawn (1)
var/datum/reagents/R = new/datum/reagents(100)
reagents = R
R.my_atom = src
mind = new()
mind.key = key
mind.special_role = "Special Xeno"
name = "[name] ([rand(1, 1000)])"
real_name = name
src.stand_icon = new /icon('xcomalien.dmi', xcom_state)
src.lying_icon = new /icon('xcomalien.dmi', xcom_state)
src.icon = src.stand_icon
remove_special_verbs()
rebuild_appearance()
death(gibbed)
..()
spawn(5)
gib()
Stat()
statpanel("Status")
if (src.client && src.client.holder)
stat(null, "([x], [y], [z])")
stat(null, "Intent: [src.a_intent]")
stat(null, "Move Mode: [src.m_intent]")
if (src.client.statpanel == "Status")
if (src.internal)
if (!src.internal.air_contents)
del(src.internal)
else
stat("Internal Atmosphere Info", src.internal.name)
stat("Tank Pressure", src.internal.air_contents.return_pressure())
stat("Distribution Pressure", src.internal.distribute_pressure)
return
alien_talk()
if(istype(src, /mob/living/carbon/alien/humanoid/special/etheral))
..()
return
if(istype(src, /mob/living/carbon/alien/humanoid/special/sectoid))
..()
return
return
/mob/living/carbon/alien/humanoid/special/proc/xcom_attack()
return
/mob/living/carbon/alien/humanoid/special/proc/remove_special_verbs()
verbs -= /mob/living/carbon/alien/humanoid/verb/plant
verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers
verbs -= /mob/living/carbon/alien/humanoid/verb/whisp
verbs -= /mob/living/carbon/alien/humanoid/verb/transfer_plasma
verbs -= /mob/living/carbon/alien/humanoid/verb/corrode
return
@@ -1,59 +0,0 @@
/mob/living/carbon/alien/humanoid/special/snakeman
name = "Snakeman"
desc = "This race developed in an extremely hostile environment. They are extremely tough and can resist extreme temperature variations. Their mobility depends on a snake-like giant \"foot\" which protects all the vital organs. "
xcom_state = "snake"
movement_delay()
return 4
/mob/living/carbon/alien/humanoid/special/snakeman/verb/lay_egg(mob/living/carbon/human/M as mob)
set name = "Impregnate"
set desc = "Lays an egg on a corpse, allowing the egg to feed."
set category = "Snakeman"
set src = view(0)
if(stat)
return
if(!M)
return
if(!M.client)
src << "This being is missing a brain."
return
visible_message("[src] extends a probiscis and stabs it into [M]")
if (!do_mob(usr, M, 50))
usr << "\red The injection of the egg has been interrupted!"
return
if(M.client)
M.client.mob = new/mob/living/carbon/alien/humanoid/special/snakeman(new/obj/effect/snake_egg(src.loc))
visible_message("[src] injects [M] with an egg.")
visible_message("The egg absorbs [M]")
M.mutations |= NOCLONE
M.update_body()
M.death()
else
src << "This being is missing a brain."
return
/obj/effect/snake_egg
name = "Egg"
icon = 'icons/mob/alien.dmi'
icon_state = "egg"
density = 1
anchored = 1
New()
..()
spawn(300)
for(var/mob/M in src)
M.loc = src.loc
icon_state = "egg_hatched"
density = 0
return
@@ -32,8 +32,9 @@
/obj/item/device/mmi/posibrain/proc/request_player()
for(var/mob/dead/observer/O in player_list)
if(check_observer(O))
O << "\blue <b>\A [src] has been activated. (<a href='?src=\ref[O];jump=\ref[src]'>Teleport</a> | <a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)"
//question(O.client)
O << "<span class='boldnotice'>\A [src] has been activated. (<a href='?src=\ref[O];jump=\ref[src]'>Teleport</a> | <a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)</span>"
// if(ROLE_POSIBRAIN in O.client.prefs.be_special) The Guardian implementation looks cleaner
// question(O.client)
/obj/item/device/mmi/posibrain/proc/check_observer(var/mob/dead/observer/O)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
@@ -52,7 +53,7 @@
if(response == "Yes")
transfer_personality(C.mob)
else if (response == "Never for this round")
C.prefs.be_special ^= BE_PAI
C.prefs.be_special -= ROLE_POSIBRAIN
// This should not ever happen, but let's be safe
/obj/item/device/mmi/posibrain/dropbrain(var/turf/dropspot)
+24 -35
View File
@@ -114,8 +114,7 @@
return
return
/mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null,var/override = 0, tesla_shock = 0)
/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, override = 0, tesla_shock = 0)
if(status_flags & GODMODE) //godmode
return 0
if(NO_SHOCK in mutations) //shockproof
@@ -124,42 +123,32 @@
shock_damage *= siemens_coeff
if(shock_damage<1 && !override)
return 0
src.apply_damage(shock_damage, BURN, def_zone, used_weapon="Electrocution")
if(heart_attack && prob(25))
heart_attack = 0
playsound(loc, "sparks", 50, 1, -1)
if (shock_damage < 10)
src.visible_message(
"\red [src] was mildly shocked by the [source].", \
"\red You feel a mild shock course through your body.", \
"\red You hear a light zapping." \
)
jitteriness += (rand(2,4))//mostly for the swarmer trap
do_jitter_animation(jitteriness)
if (shock_damage > 10)
if (shock_damage < 200)
src.visible_message(
"\red [src] was shocked by the [source]!", \
"\red <B>You feel a powerful shock course through your body!</B>", \
"\red You hear a heavy electrical crack." \
)
jitteriness += 1000 //High numbers for violent convulsions
do_jitter_animation(jitteriness)
stuttering += 2
if(reagents.has_reagent("teslium"))
shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging!
take_overall_damage(0,shock_damage)
//src.burn_skin(shock_damage)
//src.adjustFireLoss(shock_damage) //burn_skin will do this for us
//src.updatehealth()
visible_message(
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
"<span class='italics'>You hear a heavy electrical crack.</span>" \
)
jitteriness += 1000 //High numbers for violent convulsions
do_jitter_animation(jitteriness)
stuttering += 2
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
Stun(2)
spawn(20)
jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
Stun(2)
spawn(20)
jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
Stun(3)
Weaken(3)
Stun(3)
Weaken(3)
if (shock_damage > 200)
src.visible_message(
"\red [src] was arc flashed by the [source]!", \
"\red <B>The [source] arc flashes and electrocutes you!</B>", \
"\red You hear a lightning-like crack!" \
"<span class='danger'>[src] was arc flashed by the [source]!</span>", \
"<span class='userdanger'>The [source] arc flashes and electrocutes you!</span>", \
"<span class='italics'>You hear a lightning-like crack!</span>" \
)
playsound(loc, "sound/effects/eleczap.ogg", 50, 1, -1)
explosion(src.loc,-1,0,2,2)
@@ -245,6 +245,9 @@
else
msg += "[t_He] [t_is] quite chubby.\n"
if(reagents.has_reagent("teslium"))
msg += "[t_He] is emitting a gentle blue glow!\n"
msg += "</span>"
if(getBrainLoss() >= 60)
-528
View File
@@ -1,528 +0,0 @@
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
src.adding = list()
src.other = list()
src.hotkeybuttons = list() //These can be disabled for hotkey usersx
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = "intent_"+mymob.a_intent
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
var/icon/ico
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = "harm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.hotkeybuttons += using
inv_box = new /obj/screen/inventory()
inv_box.name = "i_clothing"
inv_box.dir = SOUTH
inv_box.icon = ui_style
inv_box.slot_id = slot_w_uniform
inv_box.icon_state = "center"
inv_box.screen_loc = ui_iclothing
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = ui_style
inv_box.slot_id = slot_wear_suit
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_oclothing
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "id"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "id"
inv_box.screen_loc = ui_id
inv_box.slot_id = slot_wear_id
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "back"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "suit storage"
inv_box.icon = ui_style
inv_box.dir = 8 //The sprite at dir=8 has the background whereas the others don't.
inv_box.icon_state = "belt"
inv_box.screen_loc = ui_sstore1
inv_box.slot_id = slot_s_store
inv_box.layer = 19
src.adding += inv_box
using = new /obj/screen()
using.name = "resist"
using.icon = ui_style
using.icon_state = "act_resist"
using.screen_loc = ui_pull_resist
using.layer = 19
src.hotkeybuttons += using
using = new /obj/screen()
using.name = "other"
using.icon = ui_style
using.icon_state = "other"
using.screen_loc = ui_inventory
using.layer = 20
src.adding += using
using = new /obj/screen()
using.name = "equip"
using.icon = ui_style
using.icon_state = "act_equip"
using.screen_loc = ui_equip
using.layer = 20
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "gloves"
inv_box.icon = ui_style
inv_box.icon_state = "gloves"
inv_box.screen_loc = ui_gloves
inv_box.slot_id = slot_gloves
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "eyes"
inv_box.icon = ui_style
inv_box.icon_state = "glasses"
inv_box.screen_loc = ui_glasses
inv_box.slot_id = slot_glasses
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "ears"
inv_box.icon = ui_style
inv_box.icon_state = "ears"
inv_box.screen_loc = ui_ears
inv_box.slot_id = slot_l_ear
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = ui_style
inv_box.icon_state = "hair"
inv_box.screen_loc = ui_head
inv_box.slot_id = slot_head
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "shoes"
inv_box.icon = ui_style
inv_box.icon_state = "shoes"
inv_box.screen_loc = ui_shoes
inv_box.slot_id = slot_shoes
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "belt"
inv_box.icon = ui_style
inv_box.icon_state = "belt"
inv_box.screen_loc = ui_belt
inv_box.slot_id = slot_belt
inv_box.layer = 19
src.adding += inv_box
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
src.hotkeybuttons += mymob.throw_icon
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.pressure = new /obj/screen()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
mymob.toxin = new /obj/screen()
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_toxin
mymob.internals = new /obj/screen()
mymob.internals.icon = ui_style
mymob.internals.icon_state = "internal0"
mymob.internals.name = "internal"
mymob.internals.screen_loc = ui_internal
mymob.fire = new /obj/screen()
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon = ui_style
mymob.bodytemp.icon_state = "temp1"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.healths = new /obj/screen()
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.nutrition_icon = new /obj/screen()
mymob.nutrition_icon.icon = ui_style
mymob.nutrition_icon.icon_state = "nutrition0"
mymob.nutrition_icon.name = "nutrition"
mymob.nutrition_icon.screen_loc = ui_nutrition
mymob.pullin = new /obj/screen()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
src.hotkeybuttons += mymob.pullin
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.mouse_opacity = 0
mymob.blind.layer = 0
mymob.damageoverlay = new /obj/screen()
mymob.damageoverlay.icon = 'icons/mob/screen1_full.dmi'
mymob.damageoverlay.icon_state = "oxydamageoverlay0"
mymob.damageoverlay.name = "dmg"
mymob.damageoverlay.screen_loc = "1,1"
mymob.damageoverlay.mouse_opacity = 0
mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.pain = new /obj/screen( null )
/*
mymob.hands = new /obj/screen( null )
mymob.hands.icon = ui_style
mymob.hands.icon_state = "hand"
mymob.hands.name = "hand"
mymob.hands.screen_loc = ui_hand
mymob.hands.dir = NORTH
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = ui_style
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = ui_style
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
*/
/*/Monkey blockers
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_ears
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_belt
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_shoes
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage2
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_glasses
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_gloves
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage1
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_headset
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_oclothing
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_iclothing
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_id
using.layer = 20
src.mon_blo += using
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_head
using.layer = 20
src.mon_blo += using
//Monkey blockers
*/
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.icon = ui_style
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += src.adding + src.hotkeybuttons
inventory_shown = 0;
return
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
set name = "Toggle hotkey buttons"
set desc = "This disables or enables the user interface buttons which can be used with hotkeys."
if(hud_used.hotkey_ui_hidden)
client.screen += src.hud_used.hotkeybuttons
src.hud_used.hotkey_ui_hidden = 0
else
client.screen -= src.hud_used.hotkeybuttons
src.hud_used.hotkey_ui_hidden = 1
+16 -11
View File
@@ -742,19 +742,11 @@
//Removed the horrible safety parameter. It was only being used by ninja code anyways.
//Now checks siemens_coefficient of the affected area by default
/mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null,var/override = 0, tesla_shock = 0)
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
if(status_flags & GODMODE) //godmode
return 0
if(NO_SHOCK in mutations) //shockproof
return 0
if (!def_zone)
def_zone = pick("l_hand", "r_hand")
var/obj/item/organ/external/affected_organ = get_organ(check_zone(def_zone))
var/siemens_coeff = base_siemens_coeff * get_siemens_coefficient_organ(affected_organ)
if(tesla_shock)
var/total_coeff = 1
if(gloves)
@@ -766,8 +758,21 @@
if(S.siemens_coefficient <= 0)
total_coeff -= 0.95
siemens_coeff = total_coeff
return ..(shock_damage, source, siemens_coeff, def_zone, override, tesla_shock)
else if(!safety)
var/gloves_siemens_coeff = 1
var/species_siemens_coeff = 1
if(gloves)
var/obj/item/clothing/gloves/G = gloves
gloves_siemens_coeff = G.siemens_coefficient
if(species)
species_siemens_coeff = species.siemens_coeff
siemens_coeff = gloves_siemens_coeff * species_siemens_coeff
if(heart_attack)
if(shock_damage * siemens_coeff >= 1 && prob(25))
heart_attack = 0
if(stat == CONSCIOUS)
src << "<span class='notice'>You feel your heart beating again!</span>"
. = ..()
/mob/living/carbon/human/Topic(href, href_list)
@@ -90,7 +90,7 @@
/mob/living/carbon/human/Move(NewLoc, direct)
. = ..()
if(shoes)
if(shoes && .) // did we actually move?
if(!lying && !buckled)
if(!has_gravity(loc))
return
@@ -12,7 +12,7 @@
blood_color = "#515573"
flesh_color = "#137E8F"
siemens_coeff = 0
has_organ = list(
"brain" = /obj/item/organ/internal/brain/golem
@@ -42,6 +42,8 @@
var/passive_temp_gain = 0 //IS_SYNTHETIC species will gain this much temperature every second
var/reagent_tag //Used for metabolizing reagents.
var/siemens_coeff = 1 //base electrocution coefficient
var/darksight = 2
var/hazard_high_pressure = HAZARD_HIGH_PRESSURE // Dangerously high pressure.
var/warning_high_pressure = WARNING_HIGH_PRESSURE // High pressure warning.
@@ -421,6 +423,7 @@
if(H.client)
H.client.screen += global_hud.darkMask
var/minimum_darkness_view = INFINITY
if(H.glasses)
if(istype(H.glasses, /obj/item/clothing/glasses))
var/obj/item/clothing/glasses/G = H.glasses
@@ -428,6 +431,7 @@
if(G.darkness_view)
H.see_in_dark = G.darkness_view
minimum_darkness_view = G.darkness_view
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
@@ -445,6 +449,9 @@
var/obj/item/clothing/head/hat = H.head
H.sight |= hat.vision_flags
if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet.
H.see_in_dark = hat.darkness_view
if(!hat.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
@@ -1,2 +0,0 @@
/mob/living/carbon/slime/regular_hud_updates()
return
@@ -789,7 +789,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
user << "<span class='notice'>You offer the sentience potion to [M]...</span>"
being_used = 1
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
var/list/candidates = get_candidates(ROLE_SENTIENT, ALIEN_AFK_BRACKET)
shuffle(candidates)
+3 -2
View File
@@ -477,8 +477,9 @@
if (s_active && !( s_active in contents ) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much.
s_active.close(src)
handle_footstep(loc)
step_count++
if(.) // did we actually move?
handle_footstep(loc)
step_count++
if(update_slimes)
for(var/mob/living/carbon/slime/M in view(1,src))
+1 -1
View File
@@ -65,7 +65,7 @@
apply_damage(P.damage, P.damage_type, def_zone, armor)
return P.on_hit(src, armor, def_zone)
/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null, tesla_shock = 0)
/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
return 0 //only carbon liveforms have this proc
/mob/living/emp_act(severity)
@@ -1,280 +0,0 @@
/mob/living/silicon/robot/mommi/Life()
set invisibility = 0
set background = 1
if (src.notransform)
return
src.blinded = null
//Status updates, death etc.
clamp_values()
handle_regular_status_updates()
if(client)
handle_regular_hud_updates()
update_items()
if (src.stat != DEAD) //still using power
use_power()
process_killswitch()
process_locks()
update_canmove()
/mob/living/silicon/robot/mommi/clamp_values()
// SetStunned(min(stunned, 30))
SetParalysis(min(paralysis, 30))
// SetWeakened(min(weakened, 20))
sleeping = 0
adjustBruteLoss(0)
adjustToxLoss(0)
adjustOxyLoss(0)
adjustFireLoss(0)
/mob/living/silicon/robot/mommi/use_power()
if (src.cell)
if(src.cell.charge <= 0)
uneq_all()
src.stat = 1
else if (src.cell.charge <= 100)
src.module_active = null
src.sight_state = null
src.tool_state = null
src.sight_mode = 0
src.cell.use(1)
else
if(src.sight_state)
src.cell.use(5)
if(src.tool_state)
src.cell.use(5)
src.cell.use(1)
src.blinded = 0
src.stat = 0
else
uneq_all()
src.stat = 1
/mob/living/silicon/robot/mommi/handle_regular_status_updates()
if(src.camera && !scrambledcodes)
if(src.stat == 2 || wires.IsCameraCut())
src.camera.status = 0
else
src.camera.status = 1
health = maxHealth - (getOxyLoss() + getFireLoss() + getBruteLoss())
if(getOxyLoss() > 50) Paralyse(3)
if(src.sleeping)
Paralyse(3)
src.sleeping--
if(src.resting)
Weaken(5)
if(health <= 0 && src.stat != 2) //die only once
gib()
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
src.stat = 1
if (src.stunned > 0)
AdjustStunned(-1)
if (src.weakened > 0)
AdjustWeakened(-1)
if (src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 1
else
src.blinded = 0
else //Not stunned.
src.stat = 0
else //Dead.
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 & BLIND))
src.blinded = 1
if ((src.sdisabilities & DEAF))
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
/
/mob/living/silicon/robot/mommi/handle_regular_hud_updates()
if (src.stat == 2 || XRAY in mutations || src.sight_mode & BORGXRAY)
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (src.sight_mode & BORGMESON && src.sight_mode & BORGTHERM)
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if (src.sight_mode & BORGMESON)
src.sight |= SEE_TURFS
src.see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if (src.sight_mode & BORGTHERM)
src.sight |= SEE_MOBS
src.see_in_dark = 8
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
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 = SEE_INVISIBLE_LEVEL_TWO
var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src)
if(hud && hud.hud) hud.hud.process_hud(src)
if (src.healths)
if (src.stat != 2)
switch(health)
if(60 to INFINITY)
src.healths.icon_state = "health0"
if(40 to 60)
src.healths.icon_state = "health1"
if(30 to 40)
src.healths.icon_state = "health2"
if(10 to 20)
src.healths.icon_state = "health3"
if(0 to 10)
src.healths.icon_state = "health4"
if(config.health_threshold_dead to 0)
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
else
src.healths.icon_state = "health7"
if (src.syndicate && src.client)
if(ticker.mode.name == "traitor")
for(var/datum/mind/tra in ticker.mode.traitors)
if(tra.current)
var/I = image('icons/mob/mob.dmi', loc = tra.current, icon_state = "traitor")
src.client.images += I
if(src.connected_ai)
src.connected_ai.connected_robots -= src
src.connected_ai = null
if(src.mind)
if(!src.mind.special_role)
src.mind.special_role = "traitor"
ticker.mode.traitors += src.mind
if (src.cells)
if (src.cell)
var/cellcharge = src.cell.charge/src.cell.maxcharge
switch(cellcharge)
if(0.75 to INFINITY)
src.cells.icon_state = "charge4"
if(0.5 to 0.75)
src.cells.icon_state = "charge3"
if(0.25 to 0.5)
src.cells.icon_state = "charge2"
if(0 to 0.25)
src.cells.icon_state = "charge1"
else
src.cells.icon_state = "charge0"
else
src.cells.icon_state = "charge-empty"
if(bodytemp)
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]"
//Oxygen and fire does nothing yet!!
// 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]"
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((src.blind && src.stat != 2))
if(src.blinded)
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & NEARSIGHTED)
src.client.screen += global_hud.vimpaired
if (src.eye_blurry)
src.client.screen += global_hud.blurry
if (src.druggy)
src.client.screen += global_hud.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
// MoMMIs only have one hand.
/mob/living/silicon/robot/mommi/update_items()
if (src.client)
src.client.screen -= src.contents
for(var/obj/I in src.contents)
//if(I && !(istype(I,/obj/item/weapon/stock_parts/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/machinery/camera) || istype(I,/obj/item/device/mmi)))
if(I)
// Make sure we're not showing any of our internal components, as that would be lewd.
// This way of doing it ensures that shit we pick up will be visible, wheras shit inside of us isn't.
if(I!=src.cell && I!=src.radio && I!=src.camera && I!=src.mmi)
src.client.screen += I
if(src.sight_state)
src.sight_state:screen_loc = ui_inv1
if(src.tool_state)
src.tool_state:screen_loc = ui_inv2
/mob/living/silicon/robot/mommi/update_canmove()
canmove = !(paralysis || stunned || weakened || buckled || lockcharge || anchored)
return canmove
@@ -1,536 +0,0 @@
/* Basically, the concept is this:
You have an MMI. It can't do squat on its own.
Now you put some robot legs and arms on the thing, and POOF! You have a Mobile MMI, or MoMMI.
Why? MoMMIs can do all sorts of shit, like ventcrawl, do shit with their hands, etc.
They can only use one tool at a time, they can't choose modules, and they have 1/6th the HP of a borg.
*/
/mob/living/silicon/robot/mommi
name = "Mobile MMI"
real_name = "Mobile MMI"
icon = 'icons/mob/robots.dmi'//
icon_state = "mommi"
maxHealth = 60
health = 60
pass_flags = PASSTABLE
var/keeper=0 // 0 = No, 1 = Yes (Disables speech and common radio.)
var/picked = 0
var/subtype="keeper"
var/obj/screen/inv_tool = null
var/obj/screen/inv_sight = null
//one tool and one sightmod can be activated at any one time.
var/tool_state = null
var/sight_state = null
modtype = "robot" // Not sure what this is, but might be cool to have seperate loadouts for MoMMIs (e.g. paintjobs and tools)
//Cyborgs will sync their laws with their AI by default, but we may want MoMMIs to be mute independents at some point, kinda like the Keepers in Ass Effect.
lawupdate = 1
/mob/living/carbon/can_use_hands()
return 1
/mob/living/silicon/robot/mommi/New(loc)
spark_system = new /datum/effect/system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)
ident = rand(1, 999)
updatename()
updateicon()
if(!cell)
cell = new /obj/item/weapon/stock_parts/cell(src)
cell.maxcharge = 7500
cell.charge = 7500
..()
module = new /obj/item/weapon/robot_module/mommi(src)
laws = new mommi_base_law_type
// Don't sync if we're a KEEPER.
if(!istype(laws,/datum/ai_laws/keeper))
connected_ai = select_active_ai_with_fewest_borgs()
else
// Enforce silence.
keeper=1
connected_ai = null // Enforce no AI parent
scrambledcodes = 1 // Hide from console because people are fucking idiots
if(connected_ai)
connected_ai.connected_robots += src
lawsync()
lawupdate = 1
else
lawupdate = 0
radio = new /obj/item/device/radio/borg(src)
if(!scrambledcodes && !camera)
camera = new /obj/machinery/camera(src)
camera.c_tag = real_name
camera.network = list("SS13")
if(wires.IsCameraCut()) // 5 = BORG CAMERA
camera.status = 0
// Sanity check
if(connected_ai && keeper)
world << "\red ASSERT FAILURE: connected_ai && keeper in mommi.dm"
//playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
playsound(loc, 'sound/misc/interference.ogg', 75, 1)
/mob/living/silicon/robot/mommi/choose_icon()
var/icontype = input("Select an icon!", "Mobile MMI", null) in list("Basic", "Keeper")
switch(icontype)
if("Basic") subtype = "mommi"
else subtype = "keeper"
updateicon()
var/answer = input("Is this what you want?", "Mobile MMI", null) in list("Yes", "No")
switch(answer)
if("No")
choose_icon()
return
picked = 1
/mob/living/silicon/robot/mommi/pick_module()
if(module)
return
var/list/modules = list("MoMMI")
if(modules.len)
modtype = input("Please, select a module!", "Robot", null, null) in modules
else:
modtype=modules[0]
var/module_sprites[0] //Used to store the associations between sprite names and sprite index.
var/channels = list()
if(module)
return
switch(modtype)
if("MoMMI")
module = new /obj/item/weapon/robot_module/standard(src)
module_sprites["Basic"] = "mommi"
module_sprites["Keeper"] = "keeper"
//Custom_sprite check and entry
if (custom_sprite == 1)
module_sprites["Custom"] = "[src.ckey]-[modtype]"
hands.icon_state = lowertext(modtype)
feedback_inc("mommi_[lowertext(modtype)]",1)
updatename()
choose_icon(6,module_sprites)
radio.config(channels)
base_icon = icon_state
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
//Improved /N
/mob/living/silicon/robot/mommi/Del()
if(mmi)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
var/obj/item/device/mmi/nmmi = mmi
var/turf/T = get_turf(loc)//To hopefully prevent run time errors.
if(T) nmmi.loc = T
if(mind) mind.transfer_to(nmmi.brainmob)
mmi = null
nmmi.icon = 'icons/obj/assemblies.dmi'
nmmi.invisibility = 0
..()
/mob/living/silicon/robot/mommi/updatename(var/prefix as text)
var/changed_name = ""
if(custom_name)
changed_name = custom_name
else
changed_name = "Mobile MMI [num2text(ident)]"
real_name = changed_name
name = real_name
/mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if (istype(W, /obj/item/weapon/restraints/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do
return
if (istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0))
adjustBruteLoss(-30)
updatehealth()
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
else if(istype(W, /obj/item/stack/cable_coil) && wiresexposed)
var/obj/item/stack/cable_coil/coil = W
adjustFireLoss(-30)
updatehealth()
coil.use(1)
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [user] has fixed some of the burnt wires on [src]!"), 1)
else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover
if(stat == DEAD)
user << "You pop the MMI off the base."
spawn(0)
del(src)
return
if(opened)
user << "You close the cover."
opened = 0
updateicon()
else
if(locked)
user << "The cover is locked and cannot be opened."
else
user << "You open the cover."
opened = 1
updateicon()
else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
if(wiresexposed)
user << "Close the panel first."
else if(cell)
user << "There is a power cell already installed."
else
user.drop_item()
W.loc = src
cell = W
user << "You insert the power cell."
// chargecount = 0
updateicon()
else if (istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool))
if (wiresexposed)
wires.Interact()
else
user << "You can't reach the wiring."
else if(istype(W, /obj/item/weapon/screwdriver) && opened && !cell) // haxing
wiresexposed = !wiresexposed
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
updateicon()
else if(istype(W, /obj/item/weapon/screwdriver) && opened && cell) // radio
if(radio)
radio.attackby(W,user)//Push it to the radio to let it handle everything
else
user << "Unable to locate a radio."
updateicon()
else if(istype(W, /obj/item/device/encryptionkey/) && opened)
if(radio)//sanityyyyyy
radio.attackby(W,user)//GTFO, you have your own procs
else
user << "Unable to locate a radio."
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
if(emagged)//still allow them to open the cover
user << "The interface seems slightly damaged"
if(opened)
user << "You must close the cover to swipe an ID card."
else
if(allowed(usr))
locked = !locked
user << "You [ locked ? "lock" : "unlock"] [src]'s interface."
updateicon()
else
user << "\red Access denied."
else if(istype(W, /obj/item/borg/upgrade/))
var/obj/item/borg/upgrade/U = W
if(!opened)
usr << "You must access the borgs internals!"
else if(!src.module && U.require_module)
usr << "The borg must choose a module before he can be upgraded!"
else if(U.locked)
usr << "The upgrade is locked and cannot be used yet!"
else
if(U.action(src))
usr << "You apply the upgrade to [src]!"
usr.drop_item()
U.loc = src
else
usr << "Upgrade error!"
else
spark_system.start()
return ..()
/mob/living/silicon/robot/mommi/emag_act(user as mob)
if(!opened)//Cover is closed
if(locked)
if(prob(90))
user << "You emag the cover lock."
locked = 0
else
user << "You fail to emag the cover lock."
if(prob(25))
src << "Hack attempt detected."
else
user << "The cover is already unlocked."
return
if(opened)//Cover is open
if(emagged) return//Prevents the X has hit Y with Z message also you cant emag them twice
if(wiresexposed)
user << "You must close the panel first"
return
else
sleep(6)
if(prob(50))
emagged = 1
lawupdate = 0
connected_ai = null
user << "You emag [src]'s interface."
// message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
clear_supplied_laws()
clear_inherent_laws()
laws = new /datum/ai_laws/syndicate_override
var/time = time2text(world.realtime,"hh:mm:ss")
lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
set_zeroth_law("Only [user.real_name] and people he designates as being such are Syndicate Agents.")
src << "\red ALERT: Foreign software detected."
sleep(5)
src << "\red Initiating diagnostics..."
sleep(20)
src << "\red SynBorg v1.7 loaded."
sleep(5)
src << "\red LAW SYNCHRONISATION ERROR"
sleep(5)
src << "\red Would you like to send a report to NanoTraSoft? Y/N"
sleep(10)
src << "\red > N"
sleep(20)
src << "\red ERRORERRORERROR"
src << "<b>Obey these laws:</b>"
laws.show_laws(src)
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner))
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
del(D)
src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module)
src.module.rebuild()
updateicon()
else
user << "You fail to [ locked ? "unlock" : "lock"] [src]'s interface."
if(prob(25))
src << "Hack attempt detected."
return
/mob/living/silicon/robot/mommi/attack_hand(mob/user)
add_fingerprint(user)
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
if(cell)
cell.updateicon()
cell.add_fingerprint(user)
user.put_in_active_hand(cell)
user << "You remove \the [cell]."
cell = null
updateicon()
return
if(ishuman(user))
if(user.a_intent == I_HELP)
user.visible_message("\blue [user.name] pats [src.name] on the head.")
return
if(!istype(user, /mob/living/silicon))
switch(user.a_intent)
if(I_DISARM)
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [user.name] ([user.ckey])</font>")
log_admin("ATTACK: [user.name] ([user.ckey]) disarmed [src.name] ([src.ckey])")
log_attack("<font color='red'>[user.name] ([user.ckey]) disarmed [src.name] ([src.ckey])</font>")
var/randn = rand(1,100)
//var/talked = 0;
if (randn <= 25)
weakened = 3
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("\red <B>[user] has pushed [src]!</B>")
var/obj/item/found = locate(tool_state) in src.module.modules
if(!found)
var/obj/item/TS = tool_state
drop_item()
if(TS && TS.loc)
TS.loc = src.loc
visible_message("\red <B>[src]'s robotic arm loses grip on what it was holding")
return
if(randn <= 50)//MoMMI's robot arm is stronger than a human's, but not by much
var/obj/item/found = locate(tool_state) in src.module.modules
if(!found)
var/obj/item/TS = tool_state
drop_item()
if(TS && TS.loc)
TS.loc = src.loc
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("\red <B>[user] has disarmed [src]!</B>")
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[user] attempted to disarm [src]!</B>")
return
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[user] attempted to disarm [src]!</B>")
/mob/living/silicon/robot/mommi/updateicon()
icon_state=subtype
// Clear all overlays.
overlays.Cut()
if(opened) // TODO: Open the front "head" panel
if(wiresexposed)
overlays += "ov-openpanel +w"
else if(cell)
overlays += "ov-openpanel +c"
else
overlays += "ov-openpanel -c"
// Put our eyes just on top of the lighting, so it looks emissive in maint tunnels.
if(layer==MOB_LAYER)
overlays+=image(icon,"eyes-[subtype][emagged?"-emagged":""]",LIGHTING_LAYER+1)
if(anchored)
overlays+=image(icon,"[subtype]-park", LIGHTING_LAYER+1)
else
overlays+=image(icon,"eyes-[subtype][emagged?"-emagged":""]",TURF_LAYER+0.2) // Fixes floating eyes
if(anchored)
overlays+=image(icon,"[subtype]-park", TURF_LAYER+0.2)
return
/mob/living/silicon/robot/mommi/installed_modules()
if(weapon_lock)
src << "\red Weapon lock active, unable to use modules! Count:[weaponlock_time]"
return
if(!module)
pick_module()
return
if(!picked)
choose_icon()
return
var/dat = "<HEAD><TITLE>Modules</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
dat += {"<BR>
<BR>
<B>Activated Modules</B>
<BR>
Sight Mode: [sight_state ? "<A HREF=?src=\ref[src];mod=\ref[sight_state]>[sight_state]</A>" : "No module selected"]<BR>
Utility Module: [tool_state ? "<A HREF=?src=\ref[src];mod=\ref[tool_state]>[tool_state]</A>" : "No module selected"]<BR>
<BR>
<B>Installed Modules</B><BR><BR>"}
for (var/obj in module.modules)
if (!obj)
dat += text("<B>Resource depleted</B><BR>")
else if(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 (emagged)
if(activated(module.emag))
dat += text("[module.emag]: <B>Activated</B><BR>")
else
dat += text("[module.emag]: <A HREF=?src=\ref[src];act=\ref[module.emag]>Activate</A><BR>")
src << browse(dat, "window=robotmod")
onclose(src,"robotmod") // Register on-close shit, which unsets machinery.
/mob/living/silicon/robot/mommi/Topic(href, href_list)
..()
if(usr && (src != usr))
return
if (href_list["mach_close"])
var/t1 = text("window=[href_list["mach_close"]]")
unset_machine()
src << browse(null, t1)
return
if (href_list["showalerts"])
robot_alerts()
return
if (href_list["mod"])
var/obj/item/O = locate(href_list["mod"])
if (O)
O.attack_self(src)
if (href_list["act"])
var/obj/item/O = locate(href_list["act"])
var/obj/item/TS
if(!(locate(O) in src.module.modules) && O != src.module.emag)
return
if(istype(O,/obj/item/borg/sight))
TS = sight_state
if(sight_state)
contents -= sight_state
sight_mode &= ~sight_state:sight_mode
if (client)
client.screen -= sight_state
sight_state = O
O.layer = 20
contents += O
sight_mode |= sight_state:sight_mode
inv_sight.icon_state = "sight+a"
inv_tool.icon_state = "inv1"
module_active=sight_state
else
TS = tool_state
if(tool_state)
contents -= tool_state
if (client)
client.screen -= tool_state
tool_state = O
O.layer = 20
contents += O
inv_sight.icon_state = "sight"
inv_tool.icon_state = "inv1 +a"
module_active=tool_state
if(TS && istype(TS))
if(src.is_in_modules(TS))
TS.loc = src.module
else
TS.layer=initial(TS.layer)
TS.loc = src.loc
installed_modules()
return
/mob/living/silicon/robot/mommi/radio_menu()
radio.interact(src)//Just use the radio's Topic() instead of bullshit special-snowflake code
/mob/living/silicon/robot/mommi/Move(a, b, flag)
..()
/mob/living/silicon/robot/mommi/proc/ActivateKeeper()
set category = "Robot Commands"
set name = "Activate KEEPER"
set desc = "Performs a full purge of your laws and disconnects you from AIs and cyborg consoles. However, you lose the ability to speak and must remain neutral, only being permitted to perform station upkeep. You can still be emagged in this state."
if(keeper)
return
var/mob/living/silicon/robot/R = src
if(R)
R.UnlinkSelf()
var/obj/item/weapon/aiModule/keeper/mdl = new
mdl.transmitInstructions(src, src)
src << "These are your laws now:"
src.show_laws()
src.verbs -= /mob/living/silicon/robot/mommi/proc/ActivateKeeper
@@ -348,15 +348,15 @@ var/datum/paiController/paiController // Global handler for pAI candidates
proc/requestRecruits(var/obj/item/device/paicard/P)
for(var/mob/dead/observer/O in player_list)
if(O.client && O.client.prefs.be_special & BE_PAI)
if(player_old_enough_antag(O.client,BE_PAI))
if(O.client && (ROLE_PAI in O.client.prefs.be_special))
if(player_old_enough_antag(O.client,ROLE_PAI))
if(check_recruit(O))
O << "\blue <b>A pAI card is looking for personalities. (<a href='?src=\ref[O];jump=\ref[P]'>Teleport</a> | <a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)</b>"
//question(O.client)
proc/check_recruit(var/mob/dead/observer/O)
if(jobban_isbanned(O, "pAI") || jobban_isbanned(O,"nonhumandept"))
return 0
if(!player_old_enough_antag(O.client,BE_PAI))
if(!player_old_enough_antag(O.client,ROLE_PAI))
return 0
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
return 0
@@ -259,7 +259,7 @@
if(jobban_isbanned(O,"nonhumandept") || jobban_isbanned(O,"Drone"))
continue
if(O.client)
if(O.client.prefs.be_special & BE_PAI)
if(ROLE_PAI in O.client.prefs.be_special)
question(O.client,O)
/mob/living/silicon/robot/drone/proc/question(var/client/C,var/mob/M)
@@ -1,171 +0,0 @@
/datum/hud/proc/robot_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
//Radio
using = new /obj/screen()
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
//Module select
using = new /obj/screen()
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
src.adding += using
mymob:inv1 = using
using = new /obj/screen()
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
src.adding += using
mymob:inv2 = using
using = new /obj/screen()
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'icons/mob/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 /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/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
//Cell
mymob:cells = new /obj/screen()
mymob:cells.icon = 'icons/mob/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()
mymob.healths.icon = 'icons/mob/screen1_robot.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_borg_health
//Installed Module
mymob.hands = new /obj/screen()
mymob.hands.icon = 'icons/mob/screen1_robot.dmi'
mymob.hands.icon_state = "nomod"
mymob.hands.name = "module"
mymob.hands.screen_loc = ui_borg_module
//Module Panel
using = new /obj/screen()
using.name = "panel"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "panel"
using.screen_loc = ui_borg_panel
using.layer = 19
src.adding += using
//Store
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
mymob.throw_icon.icon_state = "store"
mymob.throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_borg_store
//Temp
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_robot.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_robot.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_borg_pull
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
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.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return
@@ -1,149 +0,0 @@
#define BORG_WIRE_LAWCHECK 1
#define BORG_WIRE_MAIN_POWER1 2
#define BORG_WIRE_MAIN_POWER2 3
#define BORG_WIRE_AI_CONTROL 4
#define BORG_WIRE_CAMERA 5
/proc/RandomBorgWires()
//to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
var/list/Borgwires = list(0, 0, 0, 0, 0)
BorgIndexToFlag = list(0, 0, 0, 0, 0)
BorgIndexToWireColor = list(0, 0, 0, 0, 0)
BorgWireColorToIndex = list(0, 0, 0, 0, 0)
var/flagIndex = 1
//I think it's easier to read this way, also doesn't rely on the random number generator to land on a new wire.
var/list/colorIndexList = list(BORG_WIRE_LAWCHECK, BORG_WIRE_MAIN_POWER1, BORG_WIRE_MAIN_POWER2, BORG_WIRE_AI_CONTROL, BORG_WIRE_CAMERA)
for (var/flag=1, flag<=16, flag+=flag)
var/colorIndex = pick(colorIndexList)
if (Borgwires[colorIndex]==0)
Borgwires[colorIndex] = flag
BorgIndexToFlag[flagIndex] = flag
BorgIndexToWireColor[flagIndex] = colorIndex
BorgWireColorToIndex[colorIndex] = flagIndex
colorIndexList -= colorIndex // Shortens the list.
//log_to_dd("Flag: [flag], CIndex: [colorIndex], FIndex: [flagIndex]")
flagIndex+=1
return Borgwires
/mob/living/silicon/robot/proc/isWireColorCut(var/wireColor)
var/wireFlag = BorgWireColorToFlag[wireColor]
return ((src.borgwires & wireFlag) == 0)
/mob/living/silicon/robot/proc/isWireCut(var/wireIndex)
var/wireFlag = BorgIndexToFlag[wireIndex]
return ((src.borgwires & wireFlag) == 0)
/mob/living/silicon/robot/proc/cut(var/wireColor)
var/wireFlag = BorgWireColorToFlag[wireColor]
var/wireIndex = BorgWireColorToIndex[wireColor]
borgwires &= ~wireFlag
switch(wireIndex)
if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI
if (src.lawupdate == 1)
src << "LawSync protocol engaged."
src.show_laws()
if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
if (src.connected_ai)
src.connected_ai = null
if (BORG_WIRE_CAMERA)
if(!isnull(src.camera) && !scrambledcodes)
src.camera.status = 0
src.camera.deactivate(usr, 0) // Will kick anyone who is watching the Cyborg's camera.
src.interact(usr)
/mob/living/silicon/robot/proc/mend(var/wireColor)
var/wireFlag = BorgWireColorToFlag[wireColor]
var/wireIndex = BorgWireColorToIndex[wireColor]
borgwires |= wireFlag
switch(wireIndex)
if(BORG_WIRE_LAWCHECK) //turns law updates back on assuming the borg hasn't been emagged
if (src.lawupdate == 0 && !src.emagged)
src.lawupdate = 1
if(BORG_WIRE_CAMERA)
if (!isnull(src.camera) && !scrambledcodes)
src.camera.status = 1
src.camera.deactivate(usr, 0) // Will kick anyone who is watching the Cyborg's camera.
src.interact(usr)
/mob/living/silicon/robot/proc/pulse(var/wireColor)
var/wireIndex = BorgWireColorToIndex[wireColor]
switch(wireIndex)
if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh
if (src.lawupdate)
src.lawsync()
src.photosync()
if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
if(!src.emagged)
src.connected_ai = select_active_ai()
if (BORG_WIRE_CAMERA)
if(!isnull(src.camera) && src.camera.status && !scrambledcodes)
src.camera.deactivate(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera.
usr << "[src]'s camera lens focuses loudly."
src << "Your camera lens focuses loudly."
src.interact(usr)
/mob/living/silicon/robot/proc/interact(mob/user)
if(wiresexposed && (!istype(user, /mob/living/silicon)))
user.set_machine(src)
var/t1 = text("<B>Access Panel</B><br>\n")
var/list/Borgwires = list(
"Orange" = 1,
"Dark red" = 2,
"White" = 3,
"Yellow" = 4,
"Blue" = 5,
)
for(var/wiredesc in Borgwires)
var/is_uncut = src.borgwires & BorgWireColorToFlag[Borgwires[wiredesc]]
t1 += "[wiredesc] wire: "
if(!is_uncut)
t1 += "<a href='?src=\ref[src];borgwires=[Borgwires[wiredesc]]'>Mend</a>"
else
t1 += "<a href='?src=\ref[src];borgwires=[Borgwires[wiredesc]]'>Cut</a> "
t1 += "<a href='?src=\ref[src];pulse=[Borgwires[wiredesc]]'>Pulse</a> "
t1 += "<br>"
t1 += text("<br>\n[(src.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]<br>\n[(src.connected_ai ? "The AI link light is on." : "The AI link light is off.")]")
t1 += text("<br>\n[((!isnull(src.camera) && src.camera.status == 1) ? "The Camera light is on." : "The Camera light is off.")]<br>\n")
t1 += text("<p><a href='?src=\ref[src];close2=1'>Close</a></p>\n")
user << browse(t1, "window=borgwires")
onclose(user, "borgwires")
/mob/living/silicon/robot/Topic(href, href_list)
..()
if (((in_range(src, usr) && istype(src.loc, /turf))) && !istype(usr, /mob/living/silicon))
usr.set_machine(src)
if (href_list["borgwires"])
var/t1 = text2num(href_list["borgwires"])
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
usr << "You need wirecutters!"
return
if (src.isWireColorCut(t1))
src.mend(t1)
else
src.cut(t1)
else if (href_list["pulse"])
var/t1 = text2num(href_list["pulse"])
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
return
if (src.isWireColorCut(t1))
usr << "You can't pulse a cut wire."
return
else
src.pulse(t1)
else if (href_list["close2"])
usr << browse(null, "window=borgwires")
usr.unset_machine()
return
#undef BORG_WIRE_LAWCHECK
#undef BORG_WIRE_MAIN_POWER1
#undef BORG_WIRE_MAIN_POWER2
#undef BORG_WIRE_AI_CONTROL
#undef BORG_WIRE_CAMERA
@@ -16,7 +16,7 @@
if (!message)
return
log_say("[key_name(src)] : [message]")
if (stat == 2)
if (stat == DEAD)
return say_dead(message)
var/mob/living/simple_animal/borer/B = src.loc
src << "You whisper silently, \"[message]\""
@@ -302,7 +302,7 @@
detatch()
leave_host()
mob/living/simple_animal/borer/proc/detatch()
/mob/living/simple_animal/borer/proc/detatch()
if(!host) return
@@ -416,7 +416,7 @@ mob/living/simple_animal/borer/proc/detatch()
src << "You cannot infest a target in your current state."
return
if(M.stat == 2)
if(M.stat == DEAD)
src << "That is not an appropriate target."
return
@@ -457,15 +457,15 @@ mob/living/simple_animal/borer/proc/detatch()
return
//Procs for grabbing players.
mob/living/simple_animal/borer/proc/request_player()
/mob/living/simple_animal/borer/proc/request_player()
for(var/mob/O in respawnable_list)
if(jobban_isbanned(O, "Syndicate"))
continue
if(O.client)
if(O.client.prefs.be_special & BE_ALIEN && !jobban_isbanned(O, "alien"))
if((ROLE_BORER in O.client.prefs.be_special) && !jobban_isbanned(O, "alien"))
question(O.client)
mob/living/simple_animal/borer/proc/question(var/client/C)
/mob/living/simple_animal/borer/proc/question(var/client/C)
spawn(0)
if(!C) return
var/response = alert(C, "A cortical borer needs a player. Are you interested?", "Cortical borer request", "Yes", "No", "Never for this round")
@@ -474,9 +474,9 @@ mob/living/simple_animal/borer/proc/question(var/client/C)
if(response == "Yes")
transfer_personality(C)
else if (response == "Never for this round")
C.prefs.be_special ^= BE_ALIEN
C.prefs.be_special -= ROLE_BORER
mob/living/simple_animal/borer/proc/transfer_personality(var/client/candidate)
/mob/living/simple_animal/borer/proc/transfer_personality(var/client/candidate)
if(!candidate)
return
@@ -69,7 +69,7 @@
pass_flags = PASSTABLE
ventcrawler = 2
ranged = 1
ranged_cooldown_cap = 2
ranged_cooldown_cap = 1
universal_speak = 0
universal_understand = 0
projectilesound = 'sound/weapons/taser2.ogg'
@@ -163,8 +163,27 @@
S.DisIntegrate(src)
deactivate(S, 0)
/obj/machinery/particle_accelerator/control_box/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S.DisIntegrate(src)
/obj/machinery/particle_accelerator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S << "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>"
/obj/structure/particle_accelerator/fuel_chamber/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S << "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>"
/obj/structure/particle_accelerator/particle_emitter/center/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S << "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>"
/obj/structure/particle_accelerator/particle_emitter/left/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S << "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>"
/obj/structure/particle_accelerator/particle_emitter/right/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S << "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>"
/obj/structure/particle_accelerator/particle_emitter/end_cap/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S << "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>"
/obj/structure/particle_accelerator/particle_emitter/power_box/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S << "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>"
/obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S.DisIntegrate(src)
@@ -434,8 +453,7 @@
var/mob/living/L = AM
if(!istype(L, /mob/living/simple_animal/hostile/swarmer))
playsound(loc,'sound/effects/snap.ogg',50, 1, -1)
L.Stun(1) //i am doing this here instead of electrocute act
L.electrocute_act(0, src, 1, "l_foot", 1)
L.electrocute_act(0, src, 1, 1)
if(isrobot(L) || L.isSynthetic())
L.Weaken(5)
qdel(src)
@@ -641,7 +641,7 @@
return
used = TRUE
user << "[use_message]"
var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as the [mob_name] of [user.real_name]?",BE_PAI, null, FALSE, 100)
var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as the [mob_name] of [user.real_name]?",ROLE_GUARDIAN, null, FALSE, 100)
var/mob/dead/observer/theghost = null
if(candidates.len)
@@ -688,16 +688,18 @@
user.verbs += /mob/living/proc/guardian_comm
user.verbs += /mob/living/proc/guardian_recall
user.verbs += /mob/living/proc/guardian_reset
var/magic_suite = pick("Wands","Cups","Swords","Pentacles")
var/picked_name = pick("Aries", "Leo", "Sagittarius", "Taurus", "Virgo", "Capricorn", "Gemini", "Libra", "Aquarius", "Cancer", "Scorpio", "Pisces")
switch (theme)
if("magic")
G.name = "[mob_name]"
G.name = "[mob_name] of [magic_suite]"
G.color = picked_color
G.real_name = "[mob_name]"
G.real_name = "[mob_name] of [magic_suite]"
user << "[G.magic_fluff_string]."
if("tech")
var/colour = pick("orange", "neon", "pink", "red", "blue", "green")
G.name = "[mob_name] [capitalize(colour)]"
G.real_name = "[mob_name] [capitalize(colour)]"
G.name = "[picked_name] [capitalize(colour)]"
G.real_name = "[picked_name] [capitalize(colour)]"
G.icon_living = "parasite[colour]"
G.icon_state = "parasite[colour]"
G.icon_dead = "parasite[colour]"
@@ -706,9 +708,9 @@
G.speak_emote = list("states")
if("bio")
user << "[G.bio_fluff_string]."
G.name = "[mob_name]"
G.name = "[mob_name] [picked_name]"
G.color = picked_color
G.real_name = "[mob_name]"
G.real_name = "[mob_name] [picked_name]"
G.icon_living = "headcrab"
G.icon_state = "headcrab"
G.attacktext = "swarms"
@@ -1,59 +0,0 @@
//Look Sir, free head!
/mob/living/simple_animal/head
name = "CommandBattle AI"
desc = "A standard borg shell on its chest crude marking saying CommandBattle AI MK4 : Head."
icon_state = "crab"
icon_living = "crab"
icon_dead = "crab_dead"
speak_emote = list("clicks")
emote_hear = list("clicks")
emote_see = list("clacks")
speak_chance = 1
turns_per_move = 5
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "punches the"
var/list/insults = list(
"Man you suck",
"You look like the most retarded douche around",
"What's up?, oh wait nevermind you are a fucking asshat",
"you are just overly retarded",
"Whiteman said what?!",)
var/list/comments = list("Man have you seen those furry cats?,I mean who in the right mind would like something like that?",
"They call me abusive,I just like the truth",
"Beeboop, im a robit",
"Gooogooooll, break ya bones",
"Crab say what?",
"Man they say we have space lizards now, man this shit is getting more wack every minute",
"The so called \"improved\" station AI is just bullshit, that thing aint fun for noone",
"The Captain is a traitor, he took my power core.",
"Say \"what\" again. Say \"what\" again. I dare you. I double-dare you, motherfucker. Say \"what\" one more goddamn time.",
"Ezekiel 25:17 ,The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who in the name of charity and good will shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who attempt to poison and destroy my brothers. And you will know my name is the Lord... when I lay my vengeance upon thee.",
"Did you notice a sign out in front of my house that said \"Dead Nigger Storage\"?")
stop_automated_movement = 1
/mob/living/simple_animal/head/Life()
if(stat == DEAD)
if(health > 0)
icon_state = icon_living
stat = CONSCIOUS
density = 1
return
else if(health < 1)
death()
else if(health > maxHealth)
health = maxHealth
for(var/mob/A in viewers(world.view,src))
if(A.ckey)
say_something(A)
/mob/living/simple_animal/head/proc/say_something(mob/A)
if(prob(85))
return
if(prob(30))
var/msg = pick(insults)
msg = "Hey, [A.name].. [msg]"
src.say(msg)
else
var/msg = pick(comments)
src.say(msg)
@@ -43,6 +43,8 @@
/mob/living/simple_animal/hostile/winter/snowman/death()
if(weapon1 && prob(50)) //50% chance to drop weapon on death, if it has one to drop
new weapon1(get_turf(src))
if(prob(20)) //chance to become a stationary snowman structure instead of a corpse
new /obj/structure/snowman(get_turf(src))
visible_message("<span class='notice'>The [src.name] shimmers as its animating magic fades away!</span>")
@@ -121,12 +123,12 @@
/mob/living/simple_animal/hostile/winter/santa/stage_4 //stage 4: fast spinebreaker
name = "Final Form Santa"
desc = "WHAT THE HELL IS HE!?! WHY WON'T HE STAY DEAD!?!"
ranged = 0
rapid = 0
maxHealth = 200
health = 200
speed = 0 //he's lost some weight from the fighting
environment_smash = 2 //naughty walls must be punished too
melee_damage_lower = 10
melee_damage_lower = 15
melee_damage_upper = 25 //that's gonna leave a mark, for sure
/mob/living/simple_animal/hostile/winter/santa/stage_4/death()
@@ -1,33 +0,0 @@
//kobold
/mob/living/simple_animal/kobold
name = "kobold"
desc = "A small, rat-like creature."
icon = 'icons/mob/mob.dmi'
icon_state = "kobold_idle"
icon_living = "kobold_idle"
icon_dead = "kobold_dead"
//speak = list("You no take candle!","Ooh, pretty shiny.","Me take?","Where gold here...","Me likey.")
speak_emote = list("mutters","hisses","grumbles")
emote_hear = list("mutters under it's breath.","grumbles.", "yips!")
emote_see = list("looks around suspiciously.", "scratches it's arm.","putters around a bit.")
speak_chance = 15
turns_per_move = 5
see_in_dark = 6
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/monkey
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "kicks the"
minbodytemp = 250
min_oxy = 16 //Require atleast 16kPA oxygen
minbodytemp = 223 //Below -50 Degrees Celcius
maxbodytemp = 323 //Above 50 Degrees Celcius
/mob/living/simple_animal/kobold/Life()
..()
if(prob(15) && turns_since_move && !stat)
flick("kobold_act",src)
/mob/living/simple_animal/kobold/Move(var/dir)
..()
if(!stat)
flick("kobold_walk",src)
@@ -442,7 +442,7 @@
if(!key_of_revenant)
message_admins("The new revenant's old client either could not be found or is in a new, living mob - grabbing a random candidate instead...")
var/list/candidates = get_candidates(BE_REVENANT)
var/list/candidates = get_candidates(ROLE_REVENANT)
if(!candidates.len)
qdel(R)
message_admins("No candidates were found for the new revenant. Oh well!")
@@ -105,7 +105,7 @@
if(M == user)
return
M.Beam(L,icon_state="purple_lightning",icon='icons/effects/effects.dmi',time=5)
M.electrocute_act(shock_damage, "[L.name]")
M.electrocute_act(shock_damage, "[L.name]", safety=1)
var/datum/effect/system/spark_spread/z = new /datum/effect/system/spark_spread/
z.set_up(4, 0, M)
z.start()
@@ -13,7 +13,7 @@
return
key_of_revenant = null
if(!key_of_revenant)
var/list/candidates = get_candidates(BE_REVENANT)
var/list/candidates = get_candidates(ROLE_REVENANT)
if(!candidates.len)
if(end_if_fail)
return 0
-199
View File
@@ -1,199 +0,0 @@
//Methods that need to be cleaned.
/* INFORMATION
Put (mob/proc)s here that are in dire need of a code cleanup.
*/
/mob/proc/has_disease(var/datum/disease/virus)
for(var/datum/disease/D in viruses)
if(D.IsSame(virus))
//error("[D.name]/[D.type] is the same as [virus.name]/[virus.type]")
return 1
return 0
// This proc has some procs that should be extracted from it. I believe we can develop some helper procs from it - Rockdtben
/mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0, var/force_species_check=1, var/spread_type = -5)
//world << "Contract_disease called by [src] with virus [virus]"
if(stat >=2)
//world << "He's dead jim."
return
if(istype(virus, /datum/disease/advance))
//world << "It's an advance virus."
var/datum/disease/advance/A = virus
if(A.GetDiseaseID() in resistances)
//world << "It resisted us!"
return
if(count_by_type(viruses, /datum/disease/advance) >= 3)
return
else
if(src.resistances.Find(virus.type))
//world << "Normal virus and resisted"
return
if(has_disease(virus))
return
if(force_species_check)
var/fail = 1
for(var/name in virus.affected_species)
var/mob_type = text2path("/mob/living/carbon/[lowertext(name)]")
if(mob_type && istype(src, mob_type))
fail = 0
break
if(fail) return
if(skip_this == 1)
//world << "infectin"
//if(src.virus) < -- this used to replace the current disease. Not anymore!
//src.virus.cure(0)
var/datum/disease/v = new virus.type(1, virus, 0)
src.viruses += v
v.affected_mob = src
v.strain_data = v.strain_data.Copy()
v.holder = src
if(v.can_carry && prob(5))
v.carrier = 1
return
//world << "Not skipping."
//if(src.virus) //
//return //
/*
var/list/clothing_areas = list()
var/list/covers = list(UPPER_TORSO,LOWER_TORSO,LEGS,FEET,ARMS,HANDS)
for(var/Covers in covers)
clothing_areas[Covers] = list()
for(var/obj/item/clothing/Clothing in src)
if(Clothing)
for(var/Covers in covers)
if(Clothing&Covers)
clothing_areas[Covers] += Clothing
*/
if(prob(15/virus.permeability_mod)) return //the power of immunity compels this disease! but then you forgot resistances
//world << "past prob()"
var/obj/item/clothing/Cl = null
var/passed = 1
//chances to target this zone
var/head_ch
var/body_ch
var/hands_ch
var/feet_ch
if(spread_type == -5)
spread_type = virus.spread_type
switch(spread_type)
if(CONTACT_HANDS)
head_ch = 0
body_ch = 0
hands_ch = 100
feet_ch = 0
if(CONTACT_FEET)
head_ch = 0
body_ch = 0
hands_ch = 0
feet_ch = 100
else
head_ch = 100
body_ch = 100
hands_ch = 25
feet_ch = 25
var/target_zone = pick(head_ch;1,body_ch;2,hands_ch;3,feet_ch;4)//1 - head, 2 - body, 3 - hands, 4- feet
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
switch(target_zone)
if(1)
if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper))
Cl = H.head
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.wear_mask))
Cl = H.wear_mask
passed = prob((Cl.permeability_coefficient*100) - 1)
if(2)//arms and legs included
if(isobj(H.wear_suit))
Cl = H.wear_suit
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(slot_w_uniform))
Cl = slot_w_uniform
passed = prob((Cl.permeability_coefficient*100) - 1)
if(3)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&HANDS)
Cl = H.wear_suit
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.gloves))
Cl = H.gloves
passed = prob((Cl.permeability_coefficient*100) - 1)
if(4)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&FEET)
Cl = H.wear_suit
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.shoes))
Cl = H.shoes
passed = prob((Cl.permeability_coefficient*100) - 1)
else
src << "Something strange's going on, something's wrong."
/*if("feet")
if(H.shoes && istype(H.shoes, /obj/item/clothing/))
Cl = H.shoes
passed = prob(Cl.permeability_coefficient*100)
//
world << "Shoes pass [passed]"
*/ //
if(!passed && spread_type == AIRBORNE && !internals)
passed = (prob((50*virus.permeability_mod) - 1))
if(passed)
//world << "Infection in the mob [src]. YAY"
/*
var/score = 0
if(istype(src, /mob/living/carbon/human))
if(src:gloves) score += 5
if(istype(src:wear_suit, /obj/item/clothing/suit/space)) score += 10
if(istype(src:wear_suit, /obj/item/clothing/suit/bio_suit)) score += 10
if(istype(src:head, /obj/item/clothing/head/helmet/space)) score += 5
if(istype(src:head, /obj/item/clothing/head/bio_hood)) score += 5
if(wear_mask)
score += 5
if((istype(src:wear_mask, /obj/item/clothing/mask) || istype(src:wear_mask, /obj/item/clothing/mask/surgical)) && !internal)
score += 5
if(internal)
score += 5
if(score > 20)
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
else if(prob(15))
return
else*/
var/datum/disease/v = new virus.type(1, virus, 0)
src.viruses += v
v.affected_mob = src
v.strain_data = v.strain_data.Copy()
v.holder = src
if(v.can_carry && prob(5))
v.carrier = 1
return
return
+182
View File
@@ -0,0 +1,182 @@
/*
*Contains:
* Creeping Widow martial art datum
* Creeping Widow MMB override datum
* Creeping Widow injector
*/
// Creeping Widow injector - Single use nanomachine thing that teaches people the creeping widow style.
/obj/item/weapon/creeping_widow_injector/
name = "strange injector"
desc = "A strange autoinjector made of a black metal.<br>You can see a green liquid through the glass."
icon = 'icons/obj/ninjaobjects.dmi'
icon_state = "injector"
attack_verb = list("poked", "prodded")
var/used = 0
/obj/item/weapon/creeping_widow_injector/attack_self(mob/living/carbon/human/user as mob)
if(!used)
user.visible_message("<span class='warning'>You stick the [src]'s needle into your arm and press the button.", \
"<span class='warning'>[user] sticks the [src]'s needle \his arm and presses the button.")
user << "<span class='info'>The nanomachines in the [src] flow through your bloodstream."
var/datum/martial_art/ninja_martial_art/N = new/datum/martial_art/ninja_martial_art(null)
N.teach(user)
used = 1
icon_state = "injector-used"
desc = "A strange autoinjector made of a black metal.<br>It appears to be used up and empty."
return 0
else
user << "<span class='warning'>The [src] has been used already!</span>"
return 1
// Ninja martial art datum
/datum/martial_art/ninja_martial_art
name = "Creeping Widow Style"
var/list/attack_names = list("dragon", "eagle", "mantis", "tiger", "spider", "monkey", "snake", "crane", "xeno") // Fluff attack texts, used later in attack message generation.
var/has_choke_hold = 0 // Are we current choking a bitch?
var/has_focus = 1 //Can we user our special moves?
/datum/martial_art/ninja_martial_art/teach(var/mob/living/carbon/human/H,var/make_temporary=0)
..()
H.middleClickOverride = new /datum/middleClickOverride/ninja_martial_art()
H << "You have been taugh the ways of the <i>Creeping Widow</i>.<br>\
Your stikes on harm intent will deal more damage.<br>Using middle mouse button on a nearby person while on harm intent will send them flying backwards.<br>\
Your grabs will instantly be aggressive while you are using this style.<br>Using middle mouse button while on harm intent and behind a person will put them in a silencing choke hold.<br>\
Using middle mouse button on a nearby person while on disarm intent will wrench their wrist, causing them to drop what they are holding.</span>"
/datum/martial_art/ninja_martial_art/proc/wrist_wrench(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(!D.stat && !D.weakened)
if(has_focus)
has_focus = 0
A.face_atom(D)
D.visible_message("<span class='warning'>[A] grabs [D]'s wrist and wrenches it sideways!</span>", \
"<span class='userdanger'>[A] grabs your wrist and violently wrenches it to the side!</span>")
playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
D.emote("scream")
D.drop_item()
D.apply_damage(5, BRUTE, pick("l_arm", "r_arm"))
D.Stun(1)
spawn(50) has_focus = 1
return 1
A << "<span class='warning'>You are not focused enough to use that move yet!</span>"
return 0
return A.pointed(D)
/datum/martial_art/ninja_martial_art/proc/choke_hold(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(!D.stat && !D.weakened)
A.face_atom(D)
if(A.dir != D.dir) // If the user's direction is not the same as the target's after A.face_atom(D) you are not behind them, and cannot use this ability.
A << "<span class='warning'>You cannot grab [D] from that angle!</span>"
return 0
if(has_choke_hold) // Are we already choking someone?
A<< "<span class='warning'>You are have a target in your grip!</span>"
return 0
has_choke_hold = 1
var/hold_name = "[pick(attack_names)] [pick("grip", "hold", "vise", "press")]"
D.visible_message("<span class='warning'>[A] comes from behind and puts [D] in a [hold_name]!</span>", \
"<span class='userdanger'>[A]\ puts you in a [hold_name]! You are unable to speak!</span>")
step_to(D,get_step(D,D.dir),1)
D.grabbedby(A, 1)
var/obj/item/weapon/grab/G = A.get_active_hand()
if(G)
G.state = GRAB_NECK
var/I = 0
while(I < 20) // Loop to process the silence for the person being strangled so we don't have to add 20 silence all at once.
if(G == A.get_active_hand() && G.state >= GRAB_NECK) // Grab must be in the user's active hand for the duration of the strangle.
D.silent += 1
D.adjustOxyLoss(1)
else
D.visible_message("<span class='warning'>[A] loses his grip on [D]'s neck!</span>", \
"<span class='userdanger'>[A] loses his grip on your neck!</span>")
has_choke_hold = 0
return 0
I++
sleep(5)
A << "<span class='warning'>You feel [D] go limp in your grip.</span>"
D << "<span class='userdanger'>You feel your consciousness slip away as [A] strangles you!</span>"
D.AdjustParalysis(20)
has_choke_hold = 0
return 1
return A.pointed(D)
/datum/martial_art/ninja_martial_art/proc/palm_strike(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(!D.stat && !D.weakened)
if(has_focus)
has_focus = 0
A.face_atom(D)
var/strike_adjective = pick(attack_names)
D.visible_message("<span class='danger'>[A] sends [D] flying backwards with a [strike_adjective] palm strike!</span>", \
"<span class='userdanger'>[A] delivers a [strike_adjective] palm strike to you and sends you flying!</span>")
var/atom/throw_target = get_ranged_target_turf(D, get_dir(D, get_step_away(D, A)), 3) // Get a turf 3 tiles away from the target relative to our direction from him.
D.throw_at(throw_target, 200, 4) // Throw the poor bastard at the target we just gabbed.
D.Weaken(2)
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
spawn(50) has_focus = 1
return 1
A << "<span class='warning'>You are not focused enough to use that move yet!</span>"
return 0
return A.pointed(D)
/datum/martial_art/ninja_martial_art/grab_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) //Instant aggressive grab
D.grabbedby(A)
var/obj/item/weapon/grab/G = A.get_active_hand()
if(G)
G.state = GRAB_AGGRESSIVE
return 1
/datum/martial_art/ninja_martial_art/harm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) // 10 damage punches
var/strike_name = "[pick(attack_names)] [pick("punches", "kicks", "chops", "slams", "strikes")]"
D.visible_message("<span class='danger'>[A] [strike_name] on [D]!</span>", \
"<span class='userdanger'>[A] [strike_name] you!</span>")
D.apply_damage(10, BRUTE)
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
return 1
// Ninja middle click override, required for the special moves to function and handled in grant_ninja_martial_art
/datum/middleClickOverride/ninja_martial_art
/datum/middleClickOverride/ninja_martial_art/onClick(var/atom/A, var/mob/living/carbon/human/user)
if(!istype(user.martial_art, /datum/martial_art/ninja_martial_art))
user.pointed(A) // If they don't have the required martial art just point at the target.
if(!istype(A, /mob/living/carbon/human)) // Special moves only work on humans.
user.pointed(A)
return 0
if(user.a_intent == "help") // No special move for help intent.
user.pointed(A)
return 0
if (!(A in range(1,user))) // Is the target within one tile of us?
user.pointed(A)
return 0
var/datum/martial_art/ninja_martial_art/user_martial_art = user.martial_art
var/mob/living/carbon/human/target = A
switch(user.a_intent)
if("disarm")
user_martial_art.wrist_wrench(user, target)
if("grab")
user_martial_art.choke_hold(user, target)
if("harm")
user_martial_art.palm_strike(user, target)
return 1
@@ -1,88 +0,0 @@
/obj/effect/bhole
name = "black hole"
icon = 'icons/obj/objects.dmi'
desc = "FUCK FUCK FUCK AAAHHH"
icon_state = "bhole3"
opacity = 1
unacidable = 1
density = 0
anchored = 1
/obj/effect/bhole/New()
spawn(4)
controller()
/obj/effect/bhole/proc/controller()
while(src)
if(!isturf(loc))
qdel(src)
return
//DESTROYING STUFF AT THE EPICENTER
for(var/mob/living/M in orange(1,src))
qdel(M)
for(var/obj/O in orange(1,src))
qdel(O)
for(var/turf/simulated/ST in orange(1,src))
ST.ChangeTurf(/turf/space)
sleep(6)
grav(10, 4, 10, 0 )
sleep(6)
grav( 8, 4, 10, 0 )
sleep(6)
grav( 9, 4, 10, 0 )
sleep(6)
grav( 7, 3, 40, 1 )
sleep(6)
grav( 5, 3, 40, 1 )
sleep(6)
grav( 6, 3, 40, 1 )
sleep(6)
grav( 4, 2, 50, 6 )
sleep(6)
grav( 3, 2, 50, 6 )
sleep(6)
grav( 2, 2, 75,25 )
sleep(6)
//MOVEMENT
if( prob(50) )
src.anchored = 0
step(src,pick(alldirs))
src.anchored = 1
/obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen
qdel(src)
return
for(var/t = -r, t < r, t++)
affect_coord(x+t, y-r, ex_act_force, pull_chance, turf_removal_chance)
affect_coord(x-t, y+r, ex_act_force, pull_chance, turf_removal_chance)
affect_coord(x+r, y+t, ex_act_force, pull_chance, turf_removal_chance)
affect_coord(x-r, y-t, ex_act_force, pull_chance, turf_removal_chance)
return
/obj/effect/bhole/proc/affect_coord(var/x, var/y, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
//Get turf at coordinate
var/turf/T = locate(x, y, z)
if(isnull(T)) return
//Pulling and/or ex_act-ing movable atoms in that turf
if( prob(pull_chance) )
for(var/obj/O in T.contents)
if(O.anchored)
O.ex_act(ex_act_force)
else
step_towards(O,src)
for(var/mob/living/M in T.contents)
step_towards(M,src)
//Destroying the turf
if( T && istype(T,/turf/simulated) && prob(turf_removal_chance) )
var/turf/simulated/ST = T
ST.ChangeTurf(/turf/space)
return
-95
View File
@@ -1,95 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05
#define STATE_DEFAULT 1
#define STATE_INJECTOR 2
#define STATE_ENGINE 3
/obj/machinery/computer/am_engine
name = "Antimatter Engine Console"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "comm_computer"
req_access = list(ACCESS_ENGINE)
var/engine_id = 0
var/authenticated = 0
var/obj/machinery/power/am_engine/engine/connected_E = null
var/obj/machinery/power/am_engine/injector/connected_I = null
var/state = STATE_DEFAULT
/obj/machinery/computer/am_engine/New()
..()
spawn( 24 )
for(var/obj/machinery/power/am_engine/engine/E in world)
if(E.engine_id == src.engine_id)
src.connected_E = E
for(var/obj/machinery/power/am_engine/injector/I in world)
if(I.engine_id == src.engine_id)
src.connected_I = I
return
/obj/machinery/computer/am_engine/Topic(href, href_list)
if(..())
return
usr.machine = src
if(!href_list["operation"])
return
switch(href_list["operation"])
// main interface
if("activate")
src.connected_E.engine_process()
if("engine")
src.state = STATE_ENGINE
if("injector")
src.state = STATE_INJECTOR
if("main")
src.state = STATE_DEFAULT
if("login")
var/mob/M = usr
var/obj/item/weapon/card/id/I = M.equipped()
if (I && istype(I))
if(src.check_access(I))
authenticated = 1
if("deactivate")
src.connected_E.stopping = 1
if("logout")
authenticated = 0
src.updateUsrDialog()
/obj/machinery/computer/am_engine/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/am_engine/attack_paw(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/am_engine/attack_hand(var/mob/user as mob)
if(..())
return
user.machine = src
var/dat = "<head><title>Engine Computer</title></head><body>"
switch(src.state)
if(STATE_DEFAULT)
if (src.authenticated)
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=logout'>Log Out</A> \]<br>"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=engine'>Engine Menu</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=injector'>Injector Menu</A> \]"
else
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=login'>Log In</A> \]"
if(STATE_INJECTOR)
if(src.connected_I.injecting)
dat += "<BR>\[ Injecting \]<br>"
else
dat += "<BR>\[ Injecting not in progress \]<br>"
if(STATE_ENGINE)
if(src.connected_E.stopping)
dat += "<BR>\[ STOPPING \]"
else if(src.connected_E.operating && !src.connected_E.stopping)
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=deactivate'>Emergency Stop</A> \]"
else
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=activate'>Activate Engine</A> \]"
dat += "<BR>Contents:<br>[src.connected_E.H_fuel]kg of Hydrogen<br>[src.connected_E.antiH_fuel]kg of Anti-Hydrogen<br>"
dat += "<BR>\[ [(src.state != STATE_DEFAULT) ? "<A HREF='?src=\ref[src];operation=main'>Main Menu</A> | " : ""]<A HREF='?src=\ref[user];mach_close=communications'>Close</A> \]"
user << browse(dat, "window=communications;size=400x500")
onclose(user, "communications")
@@ -1,41 +0,0 @@
/obj/item/weapon/am_containment
name = "antimatter containment jar"
desc = "Holds antimatter."
icon = 'icons/obj/machines/antimatter.dmi'
icon_state = "jar"
density = 0
anchored = 0
force = 8
throwforce = 10
throw_speed = 1
throw_range = 2
var/fuel = 10000
var/fuel_max = 10000//Lets try this for now
var/stability = 100//TODO: add all the stability things to this so its not very safe if you keep hitting in on things
/obj/item/weapon/am_containment/ex_act(severity)
switch(severity)
if(1.0)
explosion(get_turf(src), 1, 2, 3, 5)//Should likely be larger but this works fine for now I guess
if(src)
qdel(src)
return
if(2.0)
if(prob((fuel/10)-stability))
explosion(get_turf(src), 1, 2, 3, 5)
if(src)
qdel(src)
return
stability -= 40
if(3.0)
stability -= 20
//check_stability()
return
/obj/item/weapon/am_containment/proc/usefuel(var/wanted)
if(fuel < wanted)
wanted = fuel
fuel -= wanted
return wanted
-339
View File
@@ -1,339 +0,0 @@
/obj/machinery/power/am_control_unit
name = "antimatter control unit"
desc = "This device injects antimatter into connected shielding units, the more antimatter injected the more power produced. Wrench the device to set it up."
icon = 'icons/obj/machines/antimatter.dmi'
icon_state = "control"
anchored = 1
density = 1
use_power = 1
idle_power_usage = 100
active_power_usage = 1000
var/list/obj/machinery/am_shielding/linked_shielding
var/list/obj/machinery/am_shielding/linked_cores
var/obj/item/weapon/am_containment/fueljar
var/update_shield_icons = 0
var/stability = 100
var/exploding = 0
var/active = 0//On or not
var/fuel_injection = 2//How much fuel to inject
var/shield_icon_delay = 0//delays resetting for a short time
var/reported_core_efficiency = 0
var/power_cycle = 0
var/power_cycle_delay = 4//How many ticks till produce_power is called
var/stored_core_stability = 0
var/stored_core_stability_delay = 0
var/stored_power = 0//Power to deploy per tick
/obj/machinery/power/am_control_unit/New()
..()
linked_shielding = list()
linked_cores = list()
/obj/machinery/power/am_control_unit/Destroy()//Perhaps damage and run stability checks rather than just del on the others
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
del(AMS)
return ..()
/obj/machinery/power/am_control_unit/process()
if(exploding)
explosion(get_turf(src),8,12,18,12)
if(src) del(src)
if(update_shield_icons && !shield_icon_delay)
check_shield_icons()
update_shield_icons = 0
if(stat & (NOPOWER|BROKEN) || !active)//can update the icons even without power
return
if(!fueljar)//No fuel but we are on, shutdown
toggle_power()
//Angry buzz or such here
return
add_avail(stored_power)
power_cycle++
if(power_cycle >= power_cycle_delay)
produce_power()
power_cycle = 0
return
/obj/machinery/power/am_control_unit/proc/produce_power()
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
var/core_power = reported_core_efficiency//Effectively how much fuel we can safely deal with
if(core_power <= 0) return 0//Something is wrong
var/core_damage = 0
var/fuel = fueljar.usefuel(fuel_injection)
stored_power = (fuel/core_power)*fuel*200000
//Now check if the cores could deal with it safely, this is done after so you can overload for more power if needed, still a bad idea
if(fuel > (2*core_power))//More fuel has been put in than the current cores can deal with
if(prob(50))core_damage = 1//Small chance of damage
if((fuel-core_power) > 5) core_damage = 5//Now its really starting to overload the cores
if((fuel-core_power) > 10) core_damage = 20//Welp now you did it, they wont stand much of this
if(core_damage == 0) return
for(var/obj/machinery/am_shielding/AMS in linked_cores)
AMS.stability -= core_damage
AMS.check_stability(1)
playsound(src.loc, 'sound/effects/bang.ogg', 50, 1)
return
/obj/machinery/power/am_control_unit/emp_act(severity)
switch(severity)
if(1)
if(active) toggle_power()
stability -= rand(15,30)
if(2)
if(active) toggle_power()
stability -= rand(10,20)
..()
return 0
/obj/machinery/power/am_control_unit/blob_act()
stability -= 20
if(prob(100-stability))//Might infect the rest of the machine
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
AMS.blob_act()
spawn(0)
//Likely explode
del(src)
return
check_stability()
return
/obj/machinery/power/am_control_unit/ex_act(severity)
switch(severity)
if(1.0)
stability -= 60
if(2.0)
stability -= 40
if(3.0)
stability -= 20
check_stability()
return
/obj/machinery/power/am_control_unit/bullet_act(var/obj/item/projectile/Proj)
if(Proj.flag != "bullet")
stability -= Proj.force
return 0
/obj/machinery/power/am_control_unit/power_change()
..()
if(stat & NOPOWER && active)
toggle_power()
return
/obj/machinery/power/am_control_unit/update_icon()
if(active) icon_state = "control_on"
else icon_state = "control"
//No other icons for it atm
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
if(!istype(W) || !user) return
if(istype(W, /obj/item/weapon/wrench))
if(!anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] secures the [src.name] to the floor.", \
"You secure the anchor bolts to the floor.", \
"You hear a ratchet")
src.anchored = 1
connect_to_network()
else if(!linked_shielding.len > 0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] unsecures the [src.name].", \
"You remove the anchor bolts.", \
"You hear a ratchet")
src.anchored = 0
disconnect_from_network()
else
user << "\red Once bolted and linked to a shielding unit it the [src.name] is unable to be moved!"
return
if(istype(W, /obj/item/weapon/am_containment))
if(fueljar)
user << "\red There is already a [fueljar] inside!"
return
fueljar = W
W.loc = src
if(user.client)
user.client.screen -= W
user.unEquip(W)
user.update_icons()
user.visible_message("[user.name] loads an [W.name] into the [src.name].", \
"You load an [W.name].", \
"You hear a thunk.")
return
if(W.force >= 20)
stability -= W.force/2
check_stability()
..()
return
/obj/machinery/power/am_control_unit/attack_hand(mob/user as mob)
if(anchored)
interact(user)
return
/obj/machinery/power/am_control_unit/proc/add_shielding(var/obj/machinery/am_shielding/AMS, var/AMS_linking = 0)
if(!istype(AMS)) return 0
if(!anchored) return 0
if(!AMS_linking && !AMS.link_control(src)) return 0
linked_shielding.Add(AMS)
update_shield_icons = 1
return 1
/obj/machinery/power/am_control_unit/proc/remove_shielding(var/obj/machinery/am_shielding/AMS)
if(!istype(AMS)) return 0
linked_shielding.Remove(AMS)
update_shield_icons = 2
if(active) toggle_power()
return 1
/obj/machinery/power/am_control_unit/proc/check_stability()//TODO: make it break when low also might want to add a way to fix it like a part or such that can be replaced
if(stability <= 0)
del(src)
return
/obj/machinery/power/am_control_unit/proc/toggle_power()
active = !active
if(active)
use_power = 2
visible_message("The [src.name] starts up.")
else
use_power = 1
visible_message("The [src.name] shuts down.")
update_icon()
return
/obj/machinery/power/am_control_unit/proc/check_shield_icons()//Forces icon_update for all shields
if(shield_icon_delay) return
shield_icon_delay = 1
if(update_shield_icons == 2)//2 means to clear everything and rebuild
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
if(AMS.processing) AMS.shutdown_core()
AMS.control_unit = null
spawn(10)
AMS.controllerscan()
linked_shielding = list()
else
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
AMS.update_icon()
spawn(20)
shield_icon_delay = 0
return
/obj/machinery/power/am_control_unit/proc/check_core_stability()
if(stored_core_stability_delay || linked_cores.len <= 0) return
stored_core_stability_delay = 1
stored_core_stability = 0
for(var/obj/machinery/am_shielding/AMS in linked_cores)
stored_core_stability += AMS.stability
stored_core_stability/=linked_cores.len
spawn(40)
stored_core_stability_delay = 0
return
/obj/machinery/power/am_control_unit/interact(mob/user)
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
if(!istype(user, /mob/living/silicon/ai))
user.unset_machine()
user << browse(null, "window=AMcontrol")
return
user.set_machine(src)
var/dat = ""
dat += "AntiMatter Control Panel<BR>"
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A><BR>"
dat += "<A href='?src=\ref[src];refreshicons=1'>Force Shielding Update</A><BR><BR>"
dat += "Status: [(active?"Injecting":"Standby")] <BR>"
dat += "<A href='?src=\ref[src];togglestatus=1'>Toggle Status</A><BR>"
dat += "Stability: [stability]%<BR>"
dat += "Reactor parts: [linked_shielding.len]<BR>"//TODO: perhaps add some sort of stability check
dat += "Cores: [linked_cores.len]<BR><BR>"
dat += "-Current Efficiency: [reported_core_efficiency]<BR>"
dat += "-Average Stability: [stored_core_stability] <A href='?src=\ref[src];refreshstability=1'>(update)</A><BR>"
dat += "Last Produced: [stored_power]<BR>"
dat += "Fuel: "
if(!fueljar)
dat += "<BR>No fuel receptacle detected."
else
dat += "<A href='?src=\ref[src];ejectjar=1'>Eject</A><BR>"
dat += "- [fueljar.fuel]/[fueljar.fuel_max] Units<BR>"
dat += "- Injecting: [fuel_injection] units<BR>"
dat += "- <A href='?src=\ref[src];strengthdown=1'>--</A>|<A href='?src=\ref[src];strengthup=1'>++</A><BR><BR>"
user << browse(dat, "window=AMcontrol;size=420x500")
onclose(user, "AMcontrol")
return
/obj/machinery/power/am_control_unit/Topic(href, href_list)
..()
//Ignore input if we are broken or guy is not touching us, AI can control from a ways away
if(stat & (BROKEN|NOPOWER) || (get_dist(src, usr) > 1 && !istype(usr, /mob/living/silicon/ai)))
usr.unset_machine()
usr << browse(null, "window=AMcontrol")
return
if(href_list["close"])
usr << browse(null, "window=AMcontrol")
usr.unset_machine()
return
if(href_list["togglestatus"])
toggle_power()
if(href_list["refreshicons"])
update_shield_icons = 1
if(href_list["ejectjar"])
if(fueljar)
fueljar.loc = src.loc
fueljar = null
//fueljar.control_unit = null currently it does not care where it is
//update_icon() when we have the icon for it
if(href_list["strengthup"])
fuel_injection++
if(href_list["strengthdown"])
fuel_injection--
if(fuel_injection < 0) fuel_injection = 0
if(href_list["refreshstability"])
check_core_stability()
updateDialog()
return
-207
View File
@@ -1,207 +0,0 @@
/obj/machinery/power/am_engine
icon = 'icons/am_engine.dmi'
density = 1
anchored = 1.0
flags = ON_BORDER
/obj/machinery/power/am_engine/bits
name = "Antimatter Engine"
icon_state = "1"
/obj/machinery/power/am_engine/engine
name = "Antimatter Engine"
icon_state = "am_engine"
var/engine_id = 0
var/H_fuel = 0
var/antiH_fuel = 0
var/operating = 0
var/stopping = 0
var/obj/machinery/power/am_engine/injector/connected = null
/obj/machinery/power/am_engine/injector
name = "Injector"
icon_state = "injector"
var/engine_id = 0
var/injecting = 0
var/fuel = 0
var/obj/machinery/power/am_engine/engine/connected = null
//injector
/obj/machinery/power/am_engine/injector/New()
..()
spawn( 13 )
var/loc = get_step(src, NORTH)
src.connected = locate(/obj/machinery/power/am_engine/engine, get_step(loc, NORTH))
return
return
/obj/machinery/power/am_engine/injector/attackby(obj/item/weapon/fuel/F, mob/user, params)
if( (stat & BROKEN) || !connected) return
if(istype(F, /obj/item/weapon/fuel/H))
if(injecting)
user << "Theres already a fuel rod in the injector!"
return
user << "You insert the rod into the injector"
injecting = 1
var/fuel = F.fuel
del(F)
spawn( 300 )
injecting = 0
new/obj/item/weapon/fuel(src.loc)
connected.H_fuel += fuel
if(istype(F, /obj/item/weapon/fuel/antiH))
if(injecting)
user << "Theres already a fuel rod in the injector!"
return
user << "You insert the rod into the injector"
injecting = 1
var/fuel = F.fuel
del(F)
spawn( 300 )
injecting = 0
new /obj/item/weapon/fuel(src.loc)
connected.antiH_fuel += fuel
return
//engine
/obj/machinery/power/am_engine/engine/New()
..()
spawn( 7 )
var/loc = get_step(src, SOUTH)
src.connected = locate(/obj/machinery/power/am_engine/injector, get_step(loc, SOUTH))
return
return
/obj/machinery/power/am_engine/engine/proc/engine_go()
if( (!src.connected) || (stat & BROKEN) )
return
if(!antiH_fuel || !H_fuel)
return
operating = 1
var/energy = 0
if(antiH_fuel == H_fuel)
var/mass = antiH_fuel + H_fuel
energy = convert2energy(mass)
H_fuel = 0
antiH_fuel = 0
else
var/residual_matter = modulus(H_fuel - antiH_fuel)
var/mass = antiH_fuel + H_fuel - residual_matter
energy = convert2energy(mass)
if( H_fuel > antiH_fuel )
H_fuel = residual_matter
antiH_fuel = 0
else
H_fuel = 0
antiH_fuel = residual_matter
for(var/mob/M in hearers(src, null))
M.show_message(text("\red You hear a loud bang!"))
//Q = k x (delta T)
energy = energy*0.75
operating = 0
//TODO: DEFERRED Heat tile
return
/obj/machinery/power/am_engine/engine/proc/engine_process()
do
if( (!src.connected) || (stat & BROKEN) )
return
if(!antiH_fuel || !H_fuel)
return
if(operating)
return
operating = 1
sleep(50)
var/energy //energy from the reaction
var/H //residual matter if H
var/antiH //residual matter if antiH
var/mass //total mass
if(antiH_fuel == H_fuel) //if they're equal then convert the whole mass to energy
mass = antiH_fuel + H_fuel
energy = convert2energy(mass)
else //else if they're not equal determine which isn't equal
//and set it equal to either H or antiH so we don't lose anything
var/residual_matter = modulus(H_fuel - antiH_fuel)
mass = antiH_fuel + H_fuel - residual_matter
energy = convert2energy(mass)
if( H_fuel > antiH_fuel )
H = residual_matter
else
antiH = residual_matter
if(energy > convert2energy(8e-12)) //TOO MUCH ENERGY
for(var/mob/M in hearers(src, null))
M.show_message(text("\red You hear a loud whirring!"))
sleep(20)
//Q = k x (delta T)
//Too much energy so machine panics and dissapates half of it as heat
//The rest of the energetic photons then form into H and anti H particles again!
H_fuel -= H
antiH_fuel -= antiH
antiH_fuel = antiH_fuel/2
H_fuel = H_fuel/2
energy = convert2energy(H_fuel + antiH_fuel)
H_fuel += H
antiH_fuel += antiH
if(energy > convert2energy(8e-12)) //FAR TOO MUCH ENERGY STILL
for(var/mob/M in hearers(src, null))
M.show_message(text("\red <big>BANG!</big>"))
new /obj/effect/bhole(src.loc)
else //this amount of energy is okay so it does the proper output thing
sleep(60)
//E = Pt
//Lets say its 86% efficient
var/output = 0.86*energy/20
add_avail(output)
//yeah the machine realises that something isn't right and accounts for it if H or antiH
H_fuel -= H
antiH_fuel -= antiH
antiH_fuel = antiH_fuel/4
H_fuel = H_fuel/4
H_fuel += H
antiH_fuel += antiH
operating = 0
sleep(100)
while(!stopping)
stopping = 0
return
-99
View File
@@ -1,99 +0,0 @@
/obj/item/weapon/fuel
name = "Magnetic Storage Ring"
desc = "A magnetic storage ring."
icon = 'icons/obj/items.dmi'
icon_state = "rcdammo"
opacity = 0
density = 0
anchored = 0.0
var/fuel = 0
var/s_time = 1.0
var/content = null
/obj/item/weapon/fuel/H
name = "Hydrogen storage ring"
content = "Hydrogen"
fuel = 1e-12 //pico-kilogram
/obj/item/weapon/fuel/antiH
name = "Anti-Hydrogen storage ring"
content = "Anti-Hydrogen"
fuel = 1e-12 //pico-kilogram
/obj/item/weapon/fuel/attackby(obj/item/weapon/fuel/F, mob/user, params)
..()
if(istype(src, /obj/item/weapon/fuel/antiH))
if(istype(F, /obj/item/weapon/fuel/antiH))
src.fuel += F.fuel
F.fuel = 0
user << "You have added the anti-Hydrogen to the storage ring, it now contains [src.fuel]kg"
if(istype(F, /obj/item/weapon/fuel/H))
src.fuel += F.fuel
del(F)
src:annihilation(src.fuel)
if(istype(src, /obj/item/weapon/fuel/H))
if(istype(F, /obj/item/weapon/fuel/H))
src.fuel += F.fuel
F.fuel = 0
user << "You have added the Hydrogen to the storage ring, it now contains [src.fuel]kg"
if(istype(F, /obj/item/weapon/fuel/antiH))
src.fuel += F.fuel
del(src)
F:annihilation(F.fuel)
/obj/item/weapon/fuel/antiH/proc/annihilation(var/mass)
var/strength = convert2energy(mass)
if (strength < 773.0)
var/turf/T = get_turf(src)
if (strength > (450+T0C))
explosion(T, 0, 1, 2, 4)
else
if (strength > (300+T0C))
explosion(T, 0, 0, 2, 3)
del(src)
return
var/turf/ground_zero = get_turf(loc)
var/ground_zero_range = round(strength / 387)
explosion(ground_zero, ground_zero_range, ground_zero_range*2, ground_zero_range*3, ground_zero_range*4)
//SN src = null
del(src)
return
/obj/item/weapon/fuel/examine(mob/user)
if(..(user, 1))
user << "A magnetic storage ring, it contains [fuel]kg of [content ? content : "nothing"]."
/obj/item/weapon/fuel/proc/injest(mob/M as mob)
switch(content)
if("Anti-Hydrogen")
M.gib()
if("Hydrogen")
M << "\blue You feel very light, as if you might just float away..."
del(src)
return
/obj/item/weapon/fuel/attack(mob/M as mob, mob/user as mob)
if (user != M)
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
O.source = user
O.target = M
O.item = src
O.s_loc = user.loc
O.t_loc = M.loc
O.place = "fuel"
M.requests += O
spawn( 0 )
O.process()
return
else
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [M] ate the [content ? content : "empty canister"]!"), 1)
src.injest(M)
-221
View File
@@ -1,221 +0,0 @@
//like orange but only checks north/south/east/west for one step
proc/cardinalrange(var/center)
var/list/things = list()
for(var/direction in cardinal)
var/turf/T = get_step(center, direction)
if(!T) continue
things += T.contents
return things
/obj/machinery/am_shielding
name = "antimatter reactor section"
desc = "This device was built using a plasma life-form that seems to increase plasma's natural ability to react with neutrinos while reducing the combustibility."
icon = 'icons/obj/machines/antimatter.dmi'
icon_state = "shield"
anchored = 1
density = 1
dir = 1
use_power = 0//Living things generally dont use power
idle_power_usage = 0
active_power_usage = 0
var/obj/machinery/power/am_control_unit/control_unit = null
var/processing = 0//To track if we are in the update list or not, we need to be when we are damaged and if we ever
var/stability = 100//If this gets low bad things tend to happen
var/efficiency = 1//How many cores this core counts for when doing power processing, plasma in the air and stability could affect this
/obj/machinery/am_shielding/New(loc)
..(loc)
spawn(10)
controllerscan()
return
/obj/machinery/am_shielding/proc/controllerscan(var/priorscan = 0)
//Make sure we are the only one here
if(!istype(src.loc, /turf))
del(src)
return
for(var/obj/machinery/am_shielding/AMS in loc.contents)
if(AMS == src) continue
spawn(0)
del(src)
return
//Search for shielding first
for(var/obj/machinery/am_shielding/AMS in cardinalrange(src))
if(AMS && AMS.control_unit && link_control(AMS.control_unit))
break
if(!control_unit)//No other guys nearby look for a control unit
for(var/direction in cardinal)
for(var/obj/machinery/power/am_control_unit/AMC in cardinalrange(src))
if(AMC.add_shielding(src))
break
if(!control_unit)
if(!priorscan)
spawn(20)
controllerscan(1)//Last chance
return
spawn(0)
del(src)
return
/obj/machinery/am_shielding/Destroy()
if(control_unit) control_unit.remove_shielding(src)
if(processing) shutdown_core()
visible_message("\red The [src.name] melts!")
//Might want to have it leave a mess on the floor but no sprites for now
return ..()
/obj/machinery/am_shielding/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
return 0
/obj/machinery/am_shielding/process()
if(!processing) . = PROCESS_KILL
//TODO: core functions and stability
//TODO: think about checking the airmix for plasma and increasing power output
return
/obj/machinery/am_shielding/emp_act()//Immune due to not really much in the way of electronics.
return 0
/obj/machinery/am_shielding/blob_act()
stability -= 20
if(prob(100-stability))
if(prob(10))//Might create a node
new /obj/effect/blob/node(src.loc,150)
else
new /obj/effect/blob(src.loc,60)
spawn(0)
del(src)
return
check_stability()
return
/obj/machinery/am_shielding/ex_act(severity)
switch(severity)
if(1.0)
stability -= 80
if(2.0)
stability -= 40
if(3.0)
stability -= 20
check_stability()
return
/obj/machinery/am_shielding/bullet_act(var/obj/item/projectile/Proj)
if(Proj.flag != "bullet")
stability -= Proj.force/2
return 0
/obj/machinery/am_shielding/update_icon()
overlays.Cut()
for(var/direction in alldirs)
var/machine = locate(/obj/machinery, get_step(loc, direction))
if((istype(machine, /obj/machinery/am_shielding) && machine:control_unit == control_unit)||(istype(machine, /obj/machinery/power/am_control_unit) && machine == control_unit))
overlays += "shield_[direction]"
if(core_check())
overlays += "core"
if(!processing) setup_core()
else if(processing) shutdown_core()
/obj/machinery/am_shielding/attackby(obj/item/W, mob/user, params)
if(!istype(W) || !user) return
if(W.force > 10)
stability -= W.force/2
check_stability()
..()
return
//Call this to link a detected shilding unit to the controller
/obj/machinery/am_shielding/proc/link_control(var/obj/machinery/power/am_control_unit/AMC)
if(!istype(AMC)) return 0
if(control_unit && control_unit != AMC) return 0//Already have one
control_unit = AMC
control_unit.add_shielding(src,1)
return 1
//Scans cards for shields or the control unit and if all there it
/obj/machinery/am_shielding/proc/core_check()
for(var/direction in alldirs)
var/machine = locate(/obj/machinery, get_step(loc, direction))
if(!machine) return 0//Need all for a core
if(!istype(machine, /obj/machinery/am_shielding) && !istype(machine, /obj/machinery/power/am_control_unit)) return 0
return 1
/obj/machinery/am_shielding/proc/setup_core()
processing = 1
machines.Add(src)
if(!control_unit) return
control_unit.linked_cores.Add(src)
control_unit.reported_core_efficiency += efficiency
return
/obj/machinery/am_shielding/proc/shutdown_core()
processing = 0
if(!control_unit) return
control_unit.linked_cores.Remove(src)
control_unit.reported_core_efficiency -= efficiency
return
/obj/machinery/am_shielding/proc/check_stability(var/injecting_fuel = 0)
if(stability > 0) return
if(injecting_fuel && control_unit)
control_unit.exploding = 1
if(src)
del(src)
return
/obj/machinery/am_shielding/proc/recalc_efficiency(var/new_efficiency)//tbh still not 100% sure how I want to deal with efficiency so this is likely temp
if(!control_unit || !processing) return
if(stability < 50)
new_efficiency /= 2
control_unit.reported_core_efficiency += (new_efficiency - efficiency)
efficiency = new_efficiency
return
/obj/item/device/am_shielding_container
name = "packaged antimatter reactor section"
desc = "A small storage unit containing an antimatter reactor section. To use place near an antimatter control unit or deployed antimatter reactor section and use a multitool to activate this package."
icon = 'icons/obj/machines/antimatter.dmi'
icon_state = "box"
item_state = "electronic"
w_class = 4.0
flags = CONDUCT
throwforce = 5
throw_speed = 1
throw_range = 2
m_amt = 100
w_amt = 2000
/obj/item/device/am_shielding_container/attackby(var/obj/item/I, var/mob/user, params)
if(istype(I, /obj/item/device/multitool) && istype(src.loc,/turf))
new/obj/machinery/am_shielding(src.loc)
del(src)
return
..()
return
+1
View File
@@ -172,6 +172,7 @@
cell = null
if(terminal)
disconnect_terminal()
area.apc -= src
return ..()
/obj/machinery/power/apc/proc/make_terminal()
+1 -3
View File
@@ -15,7 +15,7 @@
/datum/reagent/nicotine/on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
var/smoke_message = pick("You can just feel your lungs dying!", "You feel relaxed.", "You feel calmed.", "You feel the lung cancer forming.", "You feel the money you wasted.", "You feel like a space cowboy.", "You feel rugged.")
var/smoke_message = pick("You feel relaxed.", "You feel calmed.", "You feel less stressed.", "You feel more placid.", "You feel more undivided.")
if(prob(5))
M << "<span class='notice'>[smoke_message]</span>"
if(prob(50))
@@ -27,8 +27,6 @@
return
/datum/reagent/nicotine/overdose_process(var/mob/living/M as mob)
if(prob(20))
M << "You feel like you smoked too much."
M.adjustToxLoss(1*REM)
M.adjustOxyLoss(1*REM)
..()
@@ -45,7 +45,6 @@ datum/reagents/proc/metabolize(var/mob/M)
if(M && R)
if(R.volume >= R.overdose_threshold && !R.overdosed && R.overdose_threshold > 0)
R.overdosed = 1
M << "<span class = 'userdanger'>You feel like you took too much [R.name]!</span>"
R.overdose_start(M)
if(R.volume < R.overdose_threshold && R.overdosed)
R.overdosed = 0
+8 -1
View File
@@ -36,4 +36,11 @@
desc = "Helps with burn injuries."
New()
..()
reagents.add_reagent("synthflesh", 20)
reagents.add_reagent("synthflesh", 20)
/obj/item/weapon/reagent_containers/pill/patch/nicotine
name = "nicotine patch"
desc = "Helps temporarily curb the cravings of nicotine dependency."
New()
..()
reagents.add_reagent("nicotine", 20)
+18
View File
@@ -608,3 +608,21 @@ datum/reagent/firefighting_foam/reaction_obj(var/obj/O, var/volume)
var/location = get_turf(holder.my_atom)
explosion(location,0,0,3)
return
/datum/chemical_reaction/shock_explosion
name = "shock_explosion"
id = "shock_explosion"
result = null
required_reagents = list("teslium" = 5, "uranium" = 5) //uranium to this so it can't be spammed like no tomorrow without mining help.
result_amount = 1
mix_message = "<span class='danger'>The reaction releases an electrical blast!</span>"
mix_sound = 'sound/magic/lightningbolt.ogg'
/datum/chemical_reaction/shock_explosion/on_reaction(var/datum/reagents/holder, var/created_volume)
var/turf/T = get_turf(holder.my_atom)
for(var/mob/living/carbon/C in view(6, T))
C.Beam(T,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5) //What? Why are we beaming from the mob to the turf? Turf to mob generates really odd results.
C.electrocute_act(1, "electrical blast")
holder.del_reagent("teslium") //Clear all remaining Teslium and Uranium, but leave all other reagents untouched.
holder.del_reagent("uranium")
return
+34
View File
@@ -745,3 +745,37 @@ datum/reagent/ants/on_mob_life(var/mob/living/M as mob)
M.adjustBruteLoss(2)
..()
return
/datum/reagent/teslium //Teslium. Causes periodic shocks, and makes shocks against the target much more effective.
name = "Teslium"
id = "teslium"
description = "An unstable, electrically-charged metallic slurry. Increases the conductance of living things."
reagent_state = LIQUID
color = "#20324D" //RGB: 32, 50, 77
metabolization_rate = 0.2
var/shock_timer = 0
/datum/reagent/teslium/on_mob_life(mob/living/M)
shock_timer++
if(shock_timer >= rand(5,30)) //Random shocks are wildly unpredictable
shock_timer = 0
M.electrocute_act(rand(5,20), "Teslium in their body", 1, 1) //Override because it's caused from INSIDE of you
playsound(M, "sparks", 50, 1)
..()
/datum/chemical_reaction/teslium
name = "Teslium"
id = "teslium"
result = "teslium"
required_reagents = list("plasma" = 1, "silver" = 1, "blackpowder" = 1)
result_amount = 3
mix_message = "<span class='danger'>A jet of sparks flies from the mixture as it merges into a flickering slurry.</span>"
min_temp = 400
mix_sound = null
/datum/chemical_reaction/teslium/on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(6, 1, location)
s.start()
return
@@ -144,13 +144,16 @@
confused_start = 100
//copy paste from LSD... shoot me
/datum/reagent/ethanol/absinthe/on_mob_life(var/mob/M)
/datum/reagent/ethanol/absinthe/on_mob_life(var/mob/living/M)
if(!M) M = holder.my_atom
if(!data) data = 1
data++
M:hallucination += 5
if(volume > overdose_threshold)
M:adjustToxLoss(1)
M.hallucination += 5
..()
return
/datum/reagent/ethanol/absinthe/overdose_process(mob/living/M)
M.adjustToxLoss(1)
..()
return
@@ -164,8 +167,11 @@
/datum/reagent/ethanol/rum/on_mob_life(var/mob/living/M as mob)
..()
M.dizziness +=5
if(volume > overdose_threshold)
M:adjustToxLoss(1)
return
/datum/reagent/ethanol/rum/overdose_process(mob/living/M)
M.adjustToxLoss(1)
..()
return
/datum/reagent/ethanol/mojito
@@ -1,734 +0,0 @@
// ***********************************************************
// Foods that are produced from hydroponics ~~~~~~~~~~
// Data from the seeds carry over to these grown foods
// ***********************************************************
//Grown foods
//Subclass so we can pass on values
/obj/item/weapon/reagent_containers/food/snacks/grown/
var/plantname
var/potency = -1
icon = 'icons/obj/harvest.dmi'
New(newloc,newpotency)
if (!isnull(newpotency))
potency = newpotency
..()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
/obj/item/weapon/reagent_containers/food/snacks/grown/New()
..()
//Handle some post-spawn var stuff.
spawn(1)
// Fill the object up with the appropriate reagents.
if(!isnull(plantname))
var/datum/seed/S = seed_types[plantname]
if(!S || !S.chems)
return
potency = S.potency
for(var/rid in S.chems)
var/list/reagent_data = S.chems[rid]
var/rtotal = reagent_data[1]
if(reagent_data.len > 1 && potency > 0)
rtotal += round(potency/reagent_data[2])
reagents.add_reagent(rid,max(1,rtotal))
if(reagents.total_volume > 0)
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/corn
name = "ear of corn"
desc = "Needs some butter!"
plantname = "corn"
icon_state = "corn"
potency = 40
filling_color = "#FFEE00"
trash = /obj/item/weapon/corncob
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries
name = "cherries"
desc = "Great for toppings!"
icon_state = "cherry"
filling_color = "#FF0000"
gender = PLURAL
plantname = "cherry"
/obj/item/weapon/reagent_containers/food/snacks/grown/poppy
name = "poppy"
desc = "Long-used as a symbol of rest, peace, and death."
icon_state = "poppy"
potency = 30
filling_color = "#CC6464"
plantname = "poppies"
/obj/item/weapon/reagent_containers/food/snacks/grown/harebell
name = "harebell"
desc = "\"I'll sweeten thy sad grave: thou shalt not lack the flower that's like thy face, pale primrose, nor the azured hare-bell, like thy veins; no, nor the leaf of eglantine, whom not to slander, out-sweetend not thy breath.\""
icon_state = "harebell"
potency = 1
filling_color = "#D4B2C9"
plantname = "harebells"
/obj/item/weapon/reagent_containers/food/snacks/grown/potato
name = "potato"
desc = "Boil 'em! Mash 'em! Stick 'em in a stew!"
icon_state = "potato"
potency = 25
filling_color = "#E6E8DA"
plantname = "potato"
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
..()
if(istype(W, /obj/item/stack/cable_coil))
if(W:amount >= 5)
W:amount -= 5
if(!W:amount) del(W)
user << "<span class='notice'>You add some cable to the potato and slide it inside the battery encasing.</span>"
var/obj/item/weapon/stock_parts/cell/potato/pocell = new /obj/item/weapon/stock_parts/cell/potato(user.loc)
pocell.maxcharge = src.potency * 10
pocell.charge = pocell.maxcharge
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes
name = "bunch of grapes"
desc = "Nutritious!"
icon_state = "grapes"
filling_color = "#A332AD"
plantname = "grapes"
/obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes
name = "bunch of green grapes"
desc = "Nutritious!"
icon_state = "greengrapes"
potency = 25
filling_color = "#A6FFA3"
plantname = "greengrapes"
/obj/item/weapon/reagent_containers/food/snacks/grown/peanut
name = "peanut"
desc = "Nuts!"
icon_state = "peanut"
filling_color = "857e27"
potency = 25
plantname = "peanut"
/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage
name = "cabbage"
desc = "Ewwwwwwwwww. Cabbage."
icon_state = "cabbage"
potency = 25
filling_color = "#A2B5A1"
plantname = "cabbage"
/obj/item/weapon/reagent_containers/food/snacks/grown/berries
name = "bunch of berries"
desc = "Nutritious!"
icon_state = "berrypile"
filling_color = "#C2C9FF"
plantname = "berries"
/obj/item/weapon/reagent_containers/food/snacks/grown/plastellium
name = "clump of plastellium"
desc = "Hmm, needs some processing"
icon_state = "plastellium"
filling_color = "#C4C4C4"
plantname = "plastic"
/obj/item/weapon/reagent_containers/food/snacks/grown/shand
name = "S'rendarr's Hand leaf"
desc = "A leaf sample from a lowland thicket shrub. Smells strongly like wax."
icon_state = "shand"
filling_color = "#70C470"
plantname = "shand"
/obj/item/weapon/reagent_containers/food/snacks/grown/mtear
name = "sprig of Messa's Tear"
desc = "A mountain climate herb with a soft, cold blue flower, known to contain an abundance of healing chemicals."
icon_state = "mtear"
filling_color = "#70C470"
plantname = "mtear"
/obj/item/weapon/reagent_containers/food/snacks/grown/mtear/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
var/obj/item/stack/medical/ointment/tajaran/poultice = new /obj/item/stack/medical/ointment/tajaran(user.loc)
poultice.heal_burn = potency
del(src)
user << "<span class='notice'>You mash the petals into a poultice.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/shand/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
var/obj/item/stack/medical/bruise_pack/tajaran/poultice = new /obj/item/stack/medical/bruise_pack/tajaran(user.loc)
poultice.heal_brute = potency
del(src)
user << "<span class='notice'>You mash the leaves into a poultice.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries
name = "bunch of glow-berries"
desc = "Nutritious!"
var/light_on = 1
var/brightness_on = 2 //luminosity when on
filling_color = "#D3FF9E"
icon_state = "glowberrypile"
plantname = "glowberries"
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/Destroy()
if(istype(loc,/mob))
loc.set_light(round(loc.luminosity - potency/5,1))
return ..()
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/pickup(mob/user)
src.set_light(0)
user.set_light(round(user.luminosity + (potency/5),1))
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/dropped(mob/user)
user.set_light(round(user.luminosity - (potency/5),1))
src.set_light(round(potency/5,1))
/obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod
name = "cocoa pod"
desc = "Can be ground into cocoa powder."
icon_state = "cocoapod"
potency = 50
filling_color = "#9C8E54"
plantname = "cocoa"
/obj/item/weapon/reagent_containers/food/snacks/grown/sugarcane
name = "sugarcane"
desc = "Sickly sweet."
icon_state = "sugarcane"
potency = 50
filling_color = "#C0C9AD"
plantname = "sugarcane"
/obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries
name = "bunch of poison-berries"
desc = "Taste so good, you could die!"
icon_state = "poisonberrypile"
gender = PLURAL
potency = 15
filling_color = "#B422C7"
plantname = "poisonberries"
/obj/item/weapon/reagent_containers/food/snacks/grown/deathberries
name = "bunch of death-berries"
desc = "Taste so good, you could die!"
icon_state = "deathberrypile"
gender = PLURAL
potency = 50
filling_color = "#4E0957"
plantname = "deathberries"
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
name = "ambrosia vulgaris branch"
desc = "This is a plant containing various healing chemicals."
icon_state = "ambrosiavulgaris"
slot_flags = SLOT_HEAD
potency = 10
filling_color = "#125709"
plantname = "ambrosia"
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris/attackby(var/obj/item/W as obj, var/mob/user as mob, params)
if(istype(W, /obj/item/weapon/rollingpaper))
user.unEquip(W)
var/obj/item/clothing/mask/cigarette/joint/J = new /obj/item/clothing/mask/cigarette/joint(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
user.put_in_active_hand(J)
user << "\blue You roll the ambrosia vulgaris into a rolling paper."
del(src)
else
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus
name = "ambrosia deus branch"
desc = "Eating this makes you feel immortal!"
icon_state = "ambrosiadeus"
slot_flags = SLOT_HEAD
potency = 10
filling_color = "#229E11"
plantname = "ambrosiadeus"
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus/attackby(var/obj/item/W as obj, var/mob/user as mob, params)
if(istype(W, /obj/item/weapon/rollingpaper))
user.unEquip(W)
var/obj/item/clothing/mask/cigarette/joint/deus/J = new /obj/item/clothing/mask/cigarette/joint/deus(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
user.put_in_active_hand(J)
user << "\blue You roll the ambrosia deus into a rolling paper."
del(src)
else
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/apple
name = "apple"
desc = "It's a little piece of Eden."
icon_state = "apple"
potency = 15
filling_color = "#DFE88B"
plantname = "apple"
/obj/item/weapon/reagent_containers/food/snacks/grown/apple/poisoned
name = "apple"
desc = "It's a little piece of Eden."
icon_state = "apple"
potency = 15
filling_color = "#B3BD5E"
plantname = "poisonapple"
/obj/item/weapon/reagent_containers/food/snacks/grown/goldapple
name = "golden apple"
desc = "Emblazoned upon the apple is the word 'Kallisti'."
icon_state = "goldapple"
potency = 15
filling_color = "#F5CB42"
plantname = "goldapple"
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon
name = "watermelon"
desc = "It's full of watery goodness."
icon_state = "watermelon"
potency = 10
filling_color = "#FA2863"
slice_path = /obj/item/weapon/reagent_containers/food/snacks/watermelonslice
slices_num = 5
plantname = "watermelon"
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin
name = "pumpkin"
desc = "It's large and scary."
icon_state = "pumpkin"
potency = 10
filling_color = "#FAB728"
plantname = "pumpkin"
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
..()
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/twohanded/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/melee/energy))
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
new /obj/item/clothing/head/hardhat/pumpkinhead (user.loc)
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/lime
name = "lime"
desc = "It's so sour, your face will twist."
icon_state = "lime"
potency = 20
filling_color = "#28FA59"
plantname = "lime"
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon
name = "lemon"
desc = "When life gives you lemons, be grateful they aren't limes."
icon_state = "lemon"
potency = 20
filling_color = "#FAF328"
plantname = "lemon"
/obj/item/weapon/reagent_containers/food/snacks/grown/orange
name = "orange"
desc = "It's an tangy fruit."
icon_state = "orange"
potency = 20
filling_color = "#FAAD28"
plantname = "orange"
/obj/item/weapon/reagent_containers/food/snacks/grown/whitebeet
name = "white-beet"
desc = "You can't beat white-beet."
icon_state = "whitebeet"
potency = 15
filling_color = "#FFFCCC"
plantname = "whitebeet"
/obj/item/weapon/reagent_containers/food/snacks/grown/banana
name = "banana"
desc = "It's an excellent prop for a comedy."
icon = 'icons/obj/items.dmi'
icon_state = "banana"
item_state = "banana"
filling_color = "#FCF695"
trash = /obj/item/weapon/bananapeel
plantname = "banana"
/obj/item/weapon/reagent_containers/food/snacks/grown/chili
name = "chili"
desc = "It's spicy! Wait... IT'S BURNING ME!!"
icon_state = "chilipepper"
filling_color = "#FF0000"
plantname = "chili"
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant
name = "eggplant"
desc = "Maybe there's a chicken inside?"
icon_state = "eggplant"
filling_color = "#550F5C"
plantname = "eggplant"
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans
name = "soybeans"
desc = "It's pretty bland, but oh the possibilities..."
gender = PLURAL
filling_color = "#E6E8B7"
icon_state = "soybeans"
plantname = "soybean"
/obj/item/weapon/reagent_containers/food/snacks/grown/koibeans
name = "koibean"
desc = "Something about these seems fishy."
icon_state = "koibeans"
/obj/item/weapon/reagent_containers/food/snacks/grown/moonflower
name = "moonflower"
desc = "Store in a location at least 50 yards away from werewolves."
icon_state = "moonflower"
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chilli
name = "ghost chili"
desc = "It seems to be vibrating gently."
icon_state = "ghostchilipepper"
var/mob/held_mob
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato
name = "tomato"
desc = "I say to-mah-to, you say tom-mae-to."
icon_state = "tomato"
filling_color = "#FF0000"
potency = 10
plantname = "tomato"
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/throw_impact(atom/hit_atom)
..()
new/obj/effect/decal/cleanable/tomato_smudge(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/killertomato
name = "killer-tomato"
desc = "I say to-mah-to, you say tom-mae-to... OH GOD IT'S EATING MY LEGS!!"
icon_state = "killertomato"
potency = 10
filling_color = "#FF0000"
potency = 30
plantname = "killertomato"
/obj/item/weapon/reagent_containers/food/snacks/grown/killertomato/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
new /mob/living/simple_animal/tomato(user.loc)
del(src)
user << "<span class='notice'>You plant the killer-tomato.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/bloodtomato
name = "blood-tomato"
desc = "So bloody...so...very...bloody....AHHHH!!!!"
icon_state = "bloodtomato"
potency = 10
filling_color = "#FF0000"
plantname = "bloodtomato"
/obj/item/weapon/reagent_containers/food/snacks/grown/bloodtomato/throw_impact(atom/hit_atom)
..()
new/obj/effect/decal/cleanable/blood/splatter(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
src.reagents.reaction(get_turf(hit_atom))
for(var/atom/A in get_turf(hit_atom))
src.reagents.reaction(A)
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato
name = "blue-tomato"
desc = "I say blue-mah-to, you say blue-mae-to."
icon_state = "bluetomato"
potency = 10
filling_color = "#586CFC"
plantname = "bluetomato"
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato/throw_impact(atom/hit_atom)
..()
new/obj/effect/decal/cleanable/blood/oil(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
src.reagents.reaction(get_turf(hit_atom))
for(var/atom/A in get_turf(hit_atom))
src.reagents.reaction(A)
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato/Crossed(AM as mob|obj)
if (istype(AM, /mob/living/carbon))
var/mob/M = AM
if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP) || M.buckled)
return
M.stop_pulling()
M << "\blue You slipped on the [name]!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(8)
M.Weaken(5)
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat
name = "wheat"
desc = "Sigh... wheat... a-grain?"
gender = PLURAL
icon_state = "wheat"
filling_color = "#F7E186"
plantname = "wheat"
/obj/item/weapon/reagent_containers/food/snacks/grown/ricestalk
name = "rice stalk"
desc = "Rice to see you."
gender = PLURAL
icon_state = "rice"
filling_color = "#FFF8DB"
plantname = "rice"
/obj/item/weapon/reagent_containers/food/snacks/grown/kudzupod
name = "kudzu pod"
desc = "<I>Pueraria Virallis</I>: An invasive species with vines that rapidly creep and wrap around whatever they contact."
icon_state = "kudzupod"
filling_color = "#59691B"
plantname = "kudzu"
/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper
name = "ice-pepper"
desc = "It's a mutant strain of chili"
icon_state = "icepepper"
potency = 20
filling_color = "#66CEED"
plantname = "icechili"
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot
name = "carrot"
desc = "It's good for the eyes!"
icon_state = "carrot"
potency = 10
filling_color = "#FFC400"
plantname = "carrot"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/reishi
name = "reishi"
desc = "<I>Ganoderma lucidum</I>: A special fungus believed to help relieve stress."
icon_state = "reishi"
potency = 10
filling_color = "#FF4800"
plantname = "reishi"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita
name = "fly amanita"
desc = "<I>Amanita Muscaria</I>: Learn poisonous mushrooms by heart. Only pick mushrooms you know."
icon_state = "amanita"
potency = 10
filling_color = "#FF0000"
plantname = "amanita"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel
name = "destroying angel"
desc = "<I>Amanita Virosa</I>: Deadly poisonous basidiomycete fungus filled with alpha amatoxins."
icon_state = "angel"
potency = 35
filling_color = "#FFDEDE"
plantname = "destroyingangel"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap
name = "liberty-cap"
desc = "<I>Psilocybe Semilanceata</I>: Liberate yourself!"
icon_state = "libertycap"
potency = 15
filling_color = "#F714BE"
plantname = "libertycap"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet
name = "plump-helmet"
desc = "<I>Plumus Hellmus</I>: Plump, soft and s-so inviting~"
icon_state = "plumphelmet"
filling_color = "#F714BE"
plantname = "plumphelmet"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom
name = "walking mushroom"
desc = "<I>Plumus Locomotus</I>: The beginning of the great walk."
icon_state = "walkingmushroom"
filling_color = "#FFBFEF"
potency = 30
plantname = "walkingmushroom"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
var/mob/living/simple_animal/hostile/mushroom/M = new /mob/living/simple_animal/hostile/mushroom(user.loc)
M.maxHealth += round(potency / 4)
M.melee_damage_lower += round(potency / 20)
M.melee_damage_upper += round(potency / 20)
M.move_to_delay -= round(potency / 50)
M.health = M.maxHealth
del(src)
user << "<span class='notice'>You plant the walking mushroom.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle
name = "chanterelle cluster"
desc = "<I>Cantharellus Cibarius</I>: These jolly yellow little shrooms sure look tasty!"
icon_state = "chanterelle"
filling_color = "#FFE991"
plantname = "mushrooms"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom
name = "glowshroom cluster"
desc = "<I>Mycena Bregprox</I>: This species of mushroom glows in the dark. Or does it?"
icon_state = "glowshroom"
filling_color = "#DAFF91"
potency = 30
plantname = "glowshroom"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
var/obj/effect/glowshroom/planted = new /obj/effect/glowshroom(user.loc)
planted.delay = 50
planted.endurance = 100
planted.potency = potency
del(src)
user << "<span class='notice'>You plant the glowshroom.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/Destroy()
if(istype(loc,/mob))
loc.set_light(round(loc.luminosity - potency/10,1))
return ..()
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user)
set_light(0)
user.set_light(round(user.luminosity + (potency/10),1))
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
user.set_light(round(user.luminosity - (potency/10),1))
set_light(round(potency/10,1))
//Tobacco/varieties
/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco
name = "tobacco leaves"
desc = "It's tobacco... Put that in your pipe and smoke it."
icon_state = "tobacco_leaves"
filling_color = "#FFE991"
plantname = "tobacco"
/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco/space
name = "space-tobacco leaves"
desc = "It's tobacco... From SPACE!"
icon_state = "stobacco_leaves"
filling_color = "#FFE991"
plantname = "stobacco"
//Tea/varieties
/obj/item/weapon/reagent_containers/food/snacks/grown/teaaspera
name = "tea-aspera leaves"
desc = "Tea Aspera is well documented to have beneficial health effects!"
icon_state = "tea_aspera_leaves"
filling_color = "#7F8400"
plantname = "teaaspera"
/obj/item/weapon/reagent_containers/food/snacks/grown/teaastra
name = "tea-astra leaves"
desc = "Tea Astra is well documented to have significant health effects."
icon_state = "tea_astra_leaves"
filling_color = "#7F8400"
plantname = "teaastra"
//Coffee/varieties
/obj/item/weapon/reagent_containers/food/snacks/grown/coffeea
name = "coffee-arabica beans"
desc = "Coffee Arabica: A great way start to your morning, or to prolong your nights."
icon_state = "coffee_arabica"
filling_color = "#5B2E0D"
plantname = "coffeea"
/obj/item/weapon/reagent_containers/food/snacks/grown/coffeer
name = "coffee-robusta beans"
desc = "Coffee Robusta: Coffe so robust we had to put it in the name."
icon_state = "coffee_robusta"
filling_color = "#5B2E0D"
plantname = "coffeer"
// *************************************
// Complex Grown Object Defines -
// Putting these at the bottom so they don't clutter the list up. -Cheridan
// *************************************
/obj/item/weapon/reagent_containers/food/snacks/grown/bluespacetomato
name = "blue-space tomato"
desc = "So lubricated, you might slip through space-time."
icon_state = "bluespacetomato"
potency = 20
origin_tech = "bluespace=3"
filling_color = "#91F8FF"
plantname = "bluespacetomato"
/obj/item/weapon/reagent_containers/food/snacks/grown/bluespacetomato/throw_impact(atom/hit_atom)
..()
var/mob/M = usr
var/outer_teleport_radius = potency/10 //Plant potency determines radius of teleport.
var/inner_teleport_radius = potency/15
var/list/turfs = new/list()
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
if(inner_teleport_radius < 1) //Wasn't potent enough, it just splats.
new/obj/effect/decal/cleanable/blood/oil(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
del(src)
return
for(var/turf/T in orange(M,outer_teleport_radius))
if(T in orange(M,inner_teleport_radius)) continue
if(istype(T,/turf/space)) continue
if(T.density) continue
if(T.x>world.maxx-outer_teleport_radius || T.x<outer_teleport_radius) continue
if(T.y>world.maxy-outer_teleport_radius || T.y<outer_teleport_radius) continue
turfs += T
if(!turfs.len)
var/list/turfs_to_pick_from = list()
for(var/turf/T in orange(M,outer_teleport_radius))
if(!(T in orange(M,inner_teleport_radius)))
turfs_to_pick_from += T
turfs += pick(/turf in turfs_to_pick_from)
var/turf/picked = pick(turfs)
if(!isturf(picked)) return
switch(rand(1,2))//Decides randomly to teleport the thrower or the throwee.
if(1) // Teleports the person who threw the tomato.
s.set_up(3, 1, M)
s.start()
new/obj/effect/decal/cleanable/molten_item(M.loc) //Leaves a pile of goo behind for dramatic effect.
M.loc = picked //
sleep(1)
s.set_up(3, 1, M)
s.start() //Two set of sparks, one before the teleport and one after.
if(2) //Teleports mob the tomato hit instead.
for(var/mob/A in get_turf(hit_atom))//For the mobs in the tile that was hit...
s.set_up(3, 1, A)
s.start()
new/obj/effect/decal/cleanable/molten_item(A.loc) //Leave a pile of goo behind for dramatic effect...
A.loc = picked//And teleport them to the chosen location.
sleep(1)
s.set_up(3, 1, A)
s.start()
new/obj/effect/decal/cleanable/blood/oil(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed, causing a distortion in space-time.</span>","<span class='moderate'>You hear a splat and a crackle.</span>")
del(src)
return
-6
View File
@@ -309,12 +309,6 @@ var/obj/machinery/blackbox_recorder/blackbox
var/DBQuery/query_insert = dbcon.NewQuery(sql)
query_insert.Execute()
// Sanitize inputs to avoid SQL injection attacks
proc/sql_sanitize_text(var/text)
text = replacetext(text, "'", "''")
text = replacetext(text, ";", "")
text = replacetext(text, "&", "")
return text
proc/feedback_set(var/variable,var/value)
if(!blackbox) return
+9
View File
@@ -913,6 +913,15 @@ proc/CallMaterialName(ID)
temp_material += " [D.materials[M]/coeff] [CallMaterialName(M)]"
c = min(c,t)
for(var/R in D.reagents)
t = linked_lathe.check_mat(D, R)
temp_material += " | "
if (t < 1)
temp_material += "<span class='bad'>[D.reagents[R]/coeff] [CallMaterialName(R)]</span>"
else
temp_material += " [D.reagents[R]/coeff] [CallMaterialName(R)]"
c = min(c,t)
if (c >= 1)
dat += "<A href='?src=\ref[src];build=[D.id];amount=1'>[D.name]</A>"
if(c >= 5)
-195
View File
@@ -1,195 +0,0 @@
/client/verb/tcssave()
set hidden = 1
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\client/verb/tcssave() called tick#: [world.time]")
if(mob.machine || issilicon(mob))
if(telecomms_check(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
if(Machine.SelectedServer)
var/obj/machinery/telecomms/server/Server = Machine.SelectedServer
var/tcscode = winget(src, "tcscode", "text")
Server.setcode( tcscode ) // this actually saves the code from input to the server
src << output(null, "tcserror") // clear the errors
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to save: Unable to locate server machine. (Back up your code before exiting the window!)</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to save: Unable to locate machine. (Back up your code before exiting the window!)</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to save: Unable to locate machine. (Back up your code before exiting the window!)</font color>", "tcserror")
/client/verb/tcscompile()
set hidden = 1
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\client/verb/tcscompile() called tick#: [world.time]")
if(mob.machine || issilicon(mob))
if(telecomms_check(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
if(Machine.SelectedServer)
var/obj/machinery/telecomms/server/Server = Machine.SelectedServer
Server.setcode( winget(src, "tcscode", "text") ) // save code first
spawn(0)
// Output all the compile-time errors
src << output(null, "tcserror")
src << output("<font color = black>Please wait, compiling...</font>", "tcserror")
var/list/compileerrors = Server.compile(mob) // then compile the code!
if(!telecomms_check(mob))
return
if(compileerrors.len)
src << output("<b>Compile Errors</b>", "tcserror")
for(var/datum/scriptError/e in compileerrors)
src << output("<font color = red>\t>[e.message]</font color>", "tcserror")
src << output("([compileerrors.len] errors)", "tcserror")
// Output compile errors to all other people viewing the code too
for(var/mob/M in Machine.viewingcode)
if(M.client)
M << output(null, "tcserror")
M << output("<b>Compile Errors</b>", "tcserror")
for(var/datum/scriptError/e in compileerrors)
M << output("<font color = red>\t>[e.message]</font color>", "tcserror")
M << output("([compileerrors.len] errors)", "tcserror")
else
src << output("<font color = blue>TCS compilation successful!</font color>", "tcserror")
src << output("(0 errors)", "tcserror")
for(var/mob/M in Machine.viewingcode)
if(M.client)
M << output("<font color = blue>TCS compilation successful!</font color>", "tcserror")
M << output("(0 errors)", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to compile: Unable to locate server machine. (Back up your code before exiting the window!)</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to compile: Unable to locate machine. (Back up your code before exiting the window!)</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to compile: Unable to locate machine. (Back up your code before exiting the window!)</font color>", "tcserror")
/client/verb/tcsrun()
set hidden = 1
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\client/verb/tcsrun() called tick#: [world.time]")
if(mob.machine || issilicon(mob))
if(telecomms_check(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
if(Machine.SelectedServer)
var/obj/machinery/telecomms/server/Server = Machine.SelectedServer
var/datum/signal/signal = new
signal.data["message"] = ""
if(Server.freq_listening.len > 0)
signal.frequency = Server.freq_listening[1]
else
signal.frequency = 1459
signal.data["name"] = ""
signal.data["job"] = ""
signal.data["reject"] = 0
signal.data["server"] = Server
Server.Compiler.Run(signal)
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to run: Unable to locate server machine. (Back up your code before exiting the window!)</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to run: Unable to locate machine. (Back up your code before exiting the window!)</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to run: Unable to locate machine. (Back up your code before exiting the window!)</font color>", "tcserror")
/client/verb/exittcs()
set hidden = 1
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\client/verb/exittcs() called tick#: [world.time]")
if(mob.machine || issilicon(mob))
if(telecomms_check(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode == mob)
Machine.storedcode = "[winget(mob, "tcscode", "text")]"
Machine.editingcode = null
else
if(mob in Machine.viewingcode)
Machine.viewingcode.Remove(mob)
/client/verb/tcsrevert()
set hidden = 1
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\client/verb/tcsrevert() called tick#: [world.time]")
if(mob.machine || issilicon(mob))
if(telecomms_check(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
if(Machine.SelectedServer)
var/obj/machinery/telecomms/server/Server = Machine.SelectedServer
// Replace quotation marks with quotation macros for proper winset() compatibility
var/showcode = replacetext(Server.rawcode, "\\\"", "\\\\\"")
showcode = replacetext(showcode, "\"", "\\\"")
winset(mob, "tcscode", "text=\"[showcode]\"")
src << output(null, "tcserror") // clear the errors
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to revert: Unable to locate server machine.</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to revert: Unable to locate machine.</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to revert: Unable to locate machine.</font color>", "tcserror")
/client/verb/tcsclearmem()
set hidden = 1
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\client/verb/tcsclearmem() called tick#: [world.time]")
if(mob.machine || issilicon(mob))
if(telecomms_check(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
if(Machine.SelectedServer)
var/obj/machinery/telecomms/server/Server = Machine.SelectedServer
Server.memory = list() // clear the memory
// Show results
src << output(null, "tcserror")
src << output("<font color = blue>Server memory cleared!</font color>", "tcserror")
for(var/mob/M in Machine.viewingcode)
if(M.client)
M << output("<font color = blue>Server memory cleared!</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to clear memory: Unable to locate server machine.</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to clear memory: Unable to locate machine.</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to clear memory: Unable to locate machine.</font color>", "tcserror")
/proc/telecomms_check(var/mob/mob)
//writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/telecomms_check() called tick#: [world.time]")
if(mob && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && in_range(mob.machine, mob) || issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic))
return 1
return 0
-26
View File
@@ -1,26 +0,0 @@
/datum/stack
var/list/contents = list()
/datum/stack/proc/Push(value)
contents += value
/datum/stack/proc/Pop()
if(!contents.len)
return null
. = contents[contents.len]
contents.len--
/datum/stack/proc/Top() //returns the item on the top of the stack without removing it
if(!contents.len)
return null
return contents[contents.len]
/datum/stack/proc/Copy()
var/datum/stack/S = new()
S.contents = src.contents.Copy()
return S
/datum/stack/proc/Clear()
contents.Cut()
+11
View File
@@ -676,6 +676,7 @@
shuttleId = "whiteship"
possible_destinations = "whiteship_away;whiteship_home;whiteship_z4"
#define SYNDICATE_CHALLENGE_TIMER 12000 //20 minutes
/obj/machinery/computer/shuttle/syndicate
name = "syndicate shuttle terminal"
@@ -684,11 +685,21 @@
req_access = list(access_syndicate)
shuttleId = "syndicate"
possible_destinations = "syndicate_away;syndicate_z5;syndicate_z3;syndicate_ne;syndicate_nw;syndicate_n;syndicate_se;syndicate_sw;syndicate_s"
var/challenge = FALSE
/obj/machinery/computer/shuttle/syndicate/recall
name = "syndicate shuttle recall terminal"
possible_destinations = "syndicate_away"
/obj/machinery/computer/shuttle/syndicate/Topic(href, href_list)
if(href_list["move"])
if(challenge && world.time < SYNDICATE_CHALLENGE_TIMER)
usr << "<span class='warning'>You've issued a combat challenge to the station! You've got to give them at least [round(((SYNDICATE_CHALLENGE_TIMER - world.time) / 10) / 60)] more minutes to allow them to prepare.</span>"
return 0
..()
#undef SYNDICATE_CHALLENGE_TIMER
/obj/machinery/computer/shuttle/vox
name = "skipjack control console"
req_access = list(access_vox)
+1 -1
View File
@@ -150,7 +150,7 @@
var/obj/item/weapon/weldingtool/welder = tool
if(!welder.isOn() || !welder.remove_fuel(1,user))
return 0
return affected && affected.open == 2 && affected.brute_dam > 0 && target_zone != "mouth"
return affected && affected.open == 2 && (affected.brute_dam > 0 || affected.disfigured)&& target_zone != "mouth"
begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -1,20 +0,0 @@
/obj/machinery/disease2/biodestroyer
name = "Biohazard destroyer"
icon = 'icons/obj/pipes/disposal.dmi'
icon_state = "disposalbio"
var/list/accepts = list(/obj/item/clothing,/obj/item/weapon/virusdish/,/obj/item/weapon/cureimplanter,/obj/item/weapon/diseasedisk,/obj/item/weapon/reagent_containers)
density = 1
anchored = 1
/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob, params)
for(var/path in accepts)
if(I.type in typesof(path))
user.drop_item()
del(I)
overlays += image('icons/obj/pipes/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)