mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 17:45:02 +01:00
@@ -1,6 +1,7 @@
|
||||
#define MAX_ADMIN_BANS_PER_ADMIN 1
|
||||
|
||||
datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null)
|
||||
//Either pass the mob you wish to ban in the 'banned_mob' attribute, or the banckey, banip and bancid variables. If both are passed, the mob takes priority! If a mob is not passed, banckey is the minimum that needs to be passed! banip and bancid are optional.
|
||||
datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null, var/banip = null, var/bancid = null)
|
||||
|
||||
if(!check_rights(R_BAN)) return
|
||||
|
||||
@@ -71,6 +72,8 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
|
||||
ip = banned_mob.lastKnownIP
|
||||
else if(banckey)
|
||||
ckey = ckey(banckey)
|
||||
computerid = bancid
|
||||
ip = banip
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_player WHERE ckey = '[ckey]'")
|
||||
query.Execute()
|
||||
@@ -353,6 +356,8 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
output += "<option value='[BANTYPE_ADMIN_TEMP]'>ADMIN TEMPBAN</option>"
|
||||
output += "</select></td>"
|
||||
output += "<td><b>Ckey:</b> <input type='text' name='dbbanaddckey'></td></tr>"
|
||||
output += "<tr><td><b>IP:</b> <input type='text' name='dbbanaddip'></td>"
|
||||
output += "<td><b>Computer id:</b> <input type='text' name='dbbanaddcid'></td></tr>"
|
||||
output += "<tr><td><b>Duration:</b> <input type='text' name='dbbaddduration'></td>"
|
||||
output += "<td><b>Job:</b><select name='dbbanaddjob'>"
|
||||
output += "<option value=''>--</option>"
|
||||
|
||||
@@ -37,10 +37,14 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
if("stealth") rights |= R_STEALTH
|
||||
if("rejuv","rejuvinate") rights |= R_REJUVINATE
|
||||
if("varedit") rights |= R_VAREDIT
|
||||
if("everything","host","all") rights |= R_HOST
|
||||
if("everything","host","all") rights |= ((2 * R_MAXPERMISSION) - 1)
|
||||
if("sound","sounds") rights |= R_SOUNDS
|
||||
if("spawn","create") rights |= R_SPAWN
|
||||
|
||||
/* --ONCE FLAGS LARGER OR EQUAL THAN 2^16 = 65536 START BEING USED, USE THIS CODE!
|
||||
if("nukeeverything") rights += R_NUKEEVERYTHING
|
||||
*/
|
||||
|
||||
admin_ranks[rank] = rights
|
||||
previous_rights = rights
|
||||
|
||||
|
||||
@@ -52,19 +52,11 @@ you will have to do something like if(client.rights & R_ADMIN) yourself.
|
||||
*/
|
||||
/proc/check_rights(rights_required, show_msg=1)
|
||||
if(usr && usr.client)
|
||||
if(rights_required)
|
||||
if(usr.client.holder)
|
||||
if(rights_required & usr.client.holder.rights)
|
||||
return 1
|
||||
else
|
||||
if(show_msg)
|
||||
usr << "<font color='red'>Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].</font>"
|
||||
if (check_rights_for(usr.client, rights_required))
|
||||
return 1
|
||||
else
|
||||
if(usr.client.holder)
|
||||
return 1
|
||||
else
|
||||
if(show_msg)
|
||||
usr << "<font color='red'>Error: You are not an admin.</font>"
|
||||
if(show_msg)
|
||||
usr << "<font color='red'>Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].</font>"
|
||||
return 0
|
||||
|
||||
//probably a bit iffy - will hopefully figure out a better solution
|
||||
@@ -73,9 +65,13 @@ you will have to do something like if(client.rights & R_ADMIN) yourself.
|
||||
if(usr.client.holder)
|
||||
if(!other || !other.holder)
|
||||
return 1
|
||||
if(usr.client.holder.rights != other.holder.rights)
|
||||
if( (usr.client.holder.rights & other.holder.rights) == other.holder.rights )
|
||||
return 1 //we have all the rights they have and more
|
||||
|
||||
var/usr_rights_pt2 = usr.client.holder.rights / 65536
|
||||
var/other_rights_pt2 = other.holder.rights / 65536
|
||||
if( (usr_rights_pt2 & other_rights_pt2) == other_rights_pt2 ) //Check values larger than 65535
|
||||
if(usr.client.holder.rights != other.holder.rights) //Check values smaller than 65536
|
||||
if( (usr.client.holder.rights & other.holder.rights) == other.holder.rights )
|
||||
return 1 //we have all the rights they have and more
|
||||
usr << "<font color='red'>Error: Cannot proceed. They have more or equal rights to us.</font>"
|
||||
return 0
|
||||
|
||||
@@ -85,4 +81,21 @@ you will have to do something like if(client.rights & R_ADMIN) yourself.
|
||||
if(holder)
|
||||
holder.disassociate()
|
||||
del(holder)
|
||||
return 1
|
||||
return 1
|
||||
|
||||
//This proc checks whether subject has at least ONE of the rights specified in rights_required.
|
||||
/proc/check_rights_for(client/subject, rights_required)
|
||||
if(subject)
|
||||
if(rights_required)
|
||||
if(subject.holder)
|
||||
if(rights_required >= 65536)
|
||||
var/rights_required_pt2 = rights_required / 65536
|
||||
var/rights_pt2 = subject.holder.rights / 65536
|
||||
if(rights_required_pt2 & rights_pt2)
|
||||
return 1
|
||||
if(rights_required & subject.holder.rights)
|
||||
return 1
|
||||
else
|
||||
if(subject.holder)
|
||||
return 1
|
||||
return 0
|
||||
@@ -50,8 +50,7 @@
|
||||
if(!usr.client)
|
||||
return
|
||||
|
||||
if(!usr.client.holder || !(usr.client.holder.rights & R_PERMISSIONS))
|
||||
usr << "\red You do not have permission to do this!"
|
||||
if (!check_rights(R_PERMISSIONS))
|
||||
return
|
||||
|
||||
establish_db_connection()
|
||||
@@ -100,8 +99,7 @@
|
||||
if(!usr.client)
|
||||
return
|
||||
|
||||
if(!usr.client.holder || !(usr.client.holder.rights & R_PERMISSIONS))
|
||||
usr << "\red You do not have permission to do this!"
|
||||
if (check_rights(R_PERMISSIONS))
|
||||
return
|
||||
|
||||
establish_db_connection()
|
||||
|
||||
@@ -476,6 +476,20 @@
|
||||
dat += "<tr><td><i>Traitor not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
if(istype(ticker.mode, /datum/game_mode/blob))
|
||||
var/datum/game_mode/blob/mode = ticker.mode
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Blob</B></td><td></td><td></td></tr>"
|
||||
dat += "<tr><td><i>Progress: [blobs.len]/[mode.blobwincount]</i></td></tr>"
|
||||
|
||||
for(var/datum/mind/blob in mode.infected_crew)
|
||||
var/mob/M = blob.current
|
||||
if(M)
|
||||
dat += "<tr><td><a href='?_src_=holder;adminplayeropts=\ref[M]'>[M.real_name]</a>[M.client ? "" : " <i>(logged out)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>"
|
||||
dat += "<td><A href='?priv_msg=[M.ckey]'>PM</A></td>"
|
||||
else
|
||||
dat += "<tr><td><i>Blob not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
dat += "</body></html>"
|
||||
usr << browse(dat, "window=roundstatus;size=400x500")
|
||||
else
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
|
||||
var/bantype = text2num(href_list["dbbanaddtype"])
|
||||
var/banckey = href_list["dbbanaddckey"]
|
||||
var/banip = href_list["dbbanaddip"]
|
||||
var/bancid = href_list["dbbanaddcid"]
|
||||
var/banduration = text2num(href_list["dbbaddduration"])
|
||||
var/banjob = href_list["dbbanaddjob"]
|
||||
var/banreason = href_list["dbbanreason"]
|
||||
@@ -130,9 +132,18 @@
|
||||
playermob = M
|
||||
break
|
||||
|
||||
|
||||
banreason = "(MANUAL BAN) "+banreason
|
||||
|
||||
DB_ban_record(bantype, playermob, banduration, banreason, banjob, null, banckey)
|
||||
if(!playermob)
|
||||
if(banip)
|
||||
banreason = "[banreason] (CUSTOM IP)"
|
||||
if(bancid)
|
||||
banreason = "[banreason] (CUSTOM CID)"
|
||||
else
|
||||
message_admins("Ban process: A mob matching [playermob.ckey] was found at location [playermob.x], [playermob.y], [playermob.z]. Custom ip and computer id fields replaced with the ip and computer id from the located mob")
|
||||
|
||||
DB_ban_record(bantype, playermob, banduration, banreason, banjob, null, banckey, banip, bancid )
|
||||
|
||||
else if(href_list["editrights"])
|
||||
if(!check_rights(R_PERMISSIONS))
|
||||
@@ -688,11 +699,6 @@
|
||||
usr << "This can only be used on instances of type /mob"
|
||||
return
|
||||
|
||||
if(M != usr) //we can jobban ourselves
|
||||
if(M.client && M.client.holder && (M.client.holder.rights & R_BAN)) //they can ban too. So we can't ban them
|
||||
alert("You cannot perform this action. You must be of a higher administrative rank!")
|
||||
return
|
||||
|
||||
if(!job_master)
|
||||
usr << "Job Master has not been setup!"
|
||||
return
|
||||
|
||||
@@ -88,10 +88,21 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
msg = "\blue <b><font color=red>HELP: </font>[key_name(src, 1)] (<A HREF='?_src_=holder;adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) [ai_found ? " (<A HREF='?_src_=holder;adminchecklaws=[ref_mob]'>CL</A>)" : ""]:</b> [msg]"
|
||||
|
||||
//send this msg to all admins
|
||||
var/admin_number_afk = 0
|
||||
var/admin_number_total = 0 //Total number of admins
|
||||
var/admin_number_afk = 0 //Holds the number of admins who are afk
|
||||
var/admin_number_ignored = 0 //Holds the number of admins without +BAN (so admins who are not really admins)
|
||||
var/admin_number_decrease = 0 //Holds the number of admins with are afk, ignored or both
|
||||
for(var/client/X in admins)
|
||||
admin_number_total++;
|
||||
var/invalid = 0
|
||||
if(!check_rights_for(X, R_BAN))
|
||||
admin_number_ignored++
|
||||
invalid = 1
|
||||
if(X.is_afk())
|
||||
admin_number_afk++
|
||||
invalid = 1
|
||||
if(invalid)
|
||||
admin_number_decrease++
|
||||
if(X.prefs.toggles & SOUND_ADMINHELP)
|
||||
X << 'sound/effects/adminhelp.ogg'
|
||||
X << msg
|
||||
@@ -99,13 +110,13 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
//show it to the person adminhelping too
|
||||
src << "<font color='blue'>PM to-<b>Admins</b>: [original_msg]</font>"
|
||||
|
||||
var/admin_number_present = admins.len - admin_number_afk
|
||||
log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.")
|
||||
var/admin_number_present = admin_number_total - admin_number_decrease //Number of admins who are neither afk nor invalid
|
||||
log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins who have +BAN.")
|
||||
if(admin_number_present <= 0)
|
||||
if(!admin_number_afk)
|
||||
if(!admin_number_afk && !admin_number_ignored)
|
||||
send2irc(ckey, "[original_msg] - No admins online")
|
||||
else
|
||||
send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk])")
|
||||
send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk]/[admin_number_total]) or skipped ([admin_number_ignored]/[admin_number_total])")
|
||||
feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
|
||||
@@ -440,22 +440,31 @@ var/global/list/g_fancy_list_of_safe_types = null
|
||||
return
|
||||
if (istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if (H.wear_id)
|
||||
var/obj/item/weapon/card/id/id = H.wear_id
|
||||
if(istype(H.wear_id, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = H.wear_id
|
||||
id = pda.id
|
||||
var/obj/item/worn = H.wear_id
|
||||
var/obj/item/weapon/card/id/id = null
|
||||
if(worn)
|
||||
id = worn.GetID()
|
||||
if(id)
|
||||
id.icon_state = "gold"
|
||||
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
|
||||
id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
|
||||
else
|
||||
var/obj/item/weapon/card/id/id = new/obj/item/weapon/card/id(M);
|
||||
id.icon_state = "gold"
|
||||
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
|
||||
id = new /obj/item/weapon/card/id/gold(H.loc)
|
||||
id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
|
||||
id.registered_name = H.real_name
|
||||
id.assignment = "Captain"
|
||||
id.name = "[id.registered_name]'s ID Card ([id.assignment])"
|
||||
H.equip_to_slot_or_del(id, slot_wear_id)
|
||||
H.update_inv_wear_id()
|
||||
|
||||
if(worn)
|
||||
if(istype(worn,/obj/item/device/pda))
|
||||
worn:id = id
|
||||
id.loc = worn
|
||||
else if(istype(worn,/obj/item/weapon/storage/wallet))
|
||||
worn:front_id = id
|
||||
id.loc = worn
|
||||
worn.update_icon()
|
||||
else
|
||||
H.equip_to_slot(id,slot_wear_id)
|
||||
|
||||
else
|
||||
alert("Invalid mob")
|
||||
feedback_add_details("admin_verb","GFA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -32,24 +32,22 @@
|
||||
return
|
||||
|
||||
/obj/machinery/artillerycontrol/Topic(href, href_list)
|
||||
..()
|
||||
if (usr.stat || usr.restrained())
|
||||
if(..())
|
||||
return
|
||||
var/A
|
||||
A = input("Area to jump bombard", "Open Fire", A) in teleportlocs
|
||||
var/area/thearea = teleportlocs[A]
|
||||
if (usr.stat || usr.restrained()) return
|
||||
if(src.reload < 180) return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
var/A
|
||||
A = input("Area to jump bombard", "Open Fire", A) in teleportlocs
|
||||
var/area/thearea = teleportlocs[A]
|
||||
if (usr.stat || usr.restrained()) return
|
||||
if(src.reload < 180) return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
command_alert("Bluespace artillery fire detected. Brace for impact.")
|
||||
message_admins("[key_name_admin(usr)] has launched an artillery strike.", 1)
|
||||
var/list/L = list()
|
||||
for(var/turf/T in get_area_turfs(thearea.type))
|
||||
L+=T
|
||||
var/loc = pick(L)
|
||||
explosion(loc,2,5,11)
|
||||
reload = 0
|
||||
command_alert("Bluespace artillery fire detected. Brace for impact.")
|
||||
message_admins("[key_name_admin(usr)] has launched an artillery strike.", 1)
|
||||
var/list/L = list()
|
||||
for(var/turf/T in get_area_turfs(thearea.type))
|
||||
L+=T
|
||||
var/loc = pick(L)
|
||||
explosion(loc,2,5,11)
|
||||
reload = 0
|
||||
|
||||
/*mob/proc/openfire()
|
||||
var/A
|
||||
|
||||
@@ -10,7 +10,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set
|
||||
"wizard" = IS_MODE_COMPILED("wizard"), // 3
|
||||
"malf AI" = IS_MODE_COMPILED("malfunction"), // 4
|
||||
"revolutionary" = IS_MODE_COMPILED("revolution"), // 5
|
||||
"alien candidate" = 1, //always show // 6
|
||||
"alien lifeform" = 1, //always show // 6
|
||||
"pAI candidate" = 1, // -- TLE // 7
|
||||
"cultist" = IS_MODE_COMPILED("cult"), // 8
|
||||
"infested monkey" = IS_MODE_COMPILED("monkey"), // 9
|
||||
@@ -77,7 +77,7 @@ datum/preferences
|
||||
|
||||
// OOC Metadata:
|
||||
var/metadata = ""
|
||||
|
||||
|
||||
var/unlock_content = 0
|
||||
|
||||
/datum/preferences/New(client/C)
|
||||
@@ -210,13 +210,13 @@ datum/preferences
|
||||
dat += "<b>Adminhelp Sound:</b> "
|
||||
dat += "<a href='?_src_=prefs;preference=hear_adminhelps'>[(toggles & SOUND_ADMINHELP)?"On":"Off"]</a><br>"
|
||||
|
||||
if(unlock_content || (user.client.holder && (user.client.holder.rights & R_ADMIN)))
|
||||
if(unlock_content || check_rights_for(user, R_ADMIN))
|
||||
dat += "<b>OOC:</b> <span style='border: 1px solid #161616; background-color: [ooccolor];'> </span> <a href='?_src_=prefs;preference=ooccolor;task=input'>Change</a><br>"
|
||||
|
||||
|
||||
if(unlock_content)
|
||||
dat += "<b>BYOND Membership Publicity:</b> <a href='?_src_=prefs;preference=publicity'>[(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]</a><br>"
|
||||
dat += "<b>Ghost Form:</b> <a href='?_src_=prefs;task=input;preference=ghostform'>[ghost_form]</a><br>"
|
||||
|
||||
|
||||
|
||||
dat += "</td><td width='300px' height='300px' valign='top'>"
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
if(2) //steal
|
||||
var/datum/objective/steal/O = new /datum/objective/steal()
|
||||
O.set_target(pick(O.possible_items_special))
|
||||
O.owner = Mind
|
||||
Mind.objectives += O
|
||||
|
||||
if(3) //protect/kill
|
||||
|
||||
@@ -220,9 +220,8 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/biogenerator/Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
help_shake_act(M)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/mob/living/carbon/alien/humanoid/u_equip(obj/item/I)
|
||||
if(!I) return 0
|
||||
|
||||
var/success = 1
|
||||
|
||||
if(I == r_hand)
|
||||
r_hand = null
|
||||
update_inv_r_hand(0)
|
||||
@@ -13,14 +15,17 @@
|
||||
else if(I == l_store)
|
||||
l_store = null
|
||||
update_inv_pockets(0)
|
||||
else
|
||||
success = 0
|
||||
|
||||
if(I)
|
||||
if(client)
|
||||
client.screen -= I
|
||||
I.loc = loc
|
||||
I.dropped(src)
|
||||
if(success)
|
||||
if(I)
|
||||
I.layer = initial(I.layer)
|
||||
if(client)
|
||||
client.screen -= I
|
||||
I.loc = loc
|
||||
I.dropped(src)
|
||||
if(I)
|
||||
I.layer = initial(I.layer)
|
||||
|
||||
|
||||
//yaaaaaaay snowflakes
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
help_shake_act(M)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
|
||||
|
||||
@@ -326,6 +326,8 @@
|
||||
/mob/living/carbon/alien/larva/show_inv(mob/user)
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/larva/toggle_throw_mode()
|
||||
return
|
||||
|
||||
/* Commented out because it's duplicated in life.dm
|
||||
/mob/living/carbon/alien/larva/proc/grow() // Larvae can grow into full fledged Xenos if they survive long enough -- TLE
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
usr << "This one seems particularly lifeless. Perhaps it will regain some of it's luster later.."
|
||||
|
||||
|
||||
/obj/item/organ/brain/attack(mob/living/carbon/M, mob/living/carbon/user)
|
||||
if(!istype(M, /mob))
|
||||
return
|
||||
/obj/item/organ/brain/attack(mob/living/carbon/M, mob/user)
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
|
||||
@@ -370,11 +370,6 @@
|
||||
if(src.client)
|
||||
src.client.screen -= item
|
||||
|
||||
item.loc = src.loc
|
||||
|
||||
if(istype(item, /obj/item))
|
||||
item:dropped(src) // let it know it's been dropped
|
||||
|
||||
//actually throw it!
|
||||
if(item)
|
||||
item.layer = initial(item.layer)
|
||||
|
||||
@@ -275,6 +275,13 @@
|
||||
mymob.pullin.screen_loc = ui_pull_resist
|
||||
hotkeybuttons += mymob.pullin
|
||||
|
||||
lingchemdisplay = new /obj/screen()
|
||||
lingchemdisplay.name = "chemical storage"
|
||||
lingchemdisplay.icon_state = "power_display"
|
||||
lingchemdisplay.screen_loc = ui_lingchemdisplay
|
||||
lingchemdisplay.layer = 20
|
||||
lingchemdisplay.invisibility = 101
|
||||
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
@@ -303,7 +310,7 @@
|
||||
|
||||
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.hands, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
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, lingchemdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
mymob.client.screen += adding + hotkeybuttons
|
||||
inventory_shown = 0;
|
||||
|
||||
@@ -330,23 +337,29 @@
|
||||
return
|
||||
|
||||
client.screen -= hud_used.item_action_list
|
||||
hud_used.item_action_list = list()
|
||||
|
||||
for(var/obj/item/I in src)
|
||||
if(I.action_button_name)
|
||||
var/obj/screen/item_action/A = new(hud_used)
|
||||
if(hud_used.item_action_list.len < num)
|
||||
var/obj/screen/item_action/N = new(hud_used)
|
||||
hud_used.item_action_list += N
|
||||
|
||||
var/obj/screen/item_action/A = hud_used.item_action_list[num]
|
||||
|
||||
A.icon = ui_style2icon(client.prefs.UI_style)
|
||||
A.icon_state = "template"
|
||||
var/image/img = image(I.icon, I.icon_state)
|
||||
|
||||
A.overlays = list()
|
||||
var/image/img = image(I.icon, A, I.icon_state)
|
||||
img.pixel_x = 0
|
||||
img.pixel_y = 0
|
||||
A.overlays += img
|
||||
if(I.action_button_name)
|
||||
A.name = I.action_button_name
|
||||
else
|
||||
A.name = "Use [I.name]"
|
||||
|
||||
A.name = I.action_button_name
|
||||
A.owner = I
|
||||
hud_used.item_action_list += A
|
||||
|
||||
client.screen += hud_used.item_action_list[num]
|
||||
|
||||
switch(num)
|
||||
if(1)
|
||||
A.screen_loc = ui_action_slot1
|
||||
@@ -359,6 +372,4 @@
|
||||
if(5)
|
||||
A.screen_loc = ui_action_slot5
|
||||
break //5 slots available, so no more can be added.
|
||||
num++
|
||||
|
||||
client.screen += hud_used.item_action_list
|
||||
num++
|
||||
|
||||
@@ -120,8 +120,8 @@
|
||||
stat("Distribution Pressure", internal.distribute_pressure)
|
||||
if(mind)
|
||||
if(mind.changeling)
|
||||
stat("Chemical Storage", mind.changeling.chem_charges)
|
||||
stat("Genetic Damage Time", mind.changeling.geneticdamage)
|
||||
stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]")
|
||||
stat("Absorbed DNA", mind.changeling.absorbedcount)
|
||||
if (istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)&&wear_suit:s_initialized)
|
||||
stat("Energy Charge", round(wear_suit:cell:charge/100))
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
if ("help")
|
||||
visible_message(text("\blue [M] caresses [src] with its scythe like arm."))
|
||||
if ("grab")
|
||||
if(M == src) return
|
||||
if(M == src || anchored)
|
||||
return
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
src << "<span class='unconscious'>You feel a breath of fresh air enter your lungs. It feels good.</span>"
|
||||
|
||||
if("grab")
|
||||
if(M == src)
|
||||
if(M == src || anchored)
|
||||
return 0
|
||||
if(w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
|
||||
@@ -1022,6 +1022,12 @@
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
seer = 0
|
||||
|
||||
if(mind && mind.changeling)
|
||||
hud_used.lingchemdisplay.invisibility = 0
|
||||
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'> <font color='#dd66dd'>[src.mind.changeling.chem_charges]</font></div>"
|
||||
else
|
||||
hud_used.lingchemdisplay.invisibility = 101
|
||||
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja))
|
||||
var/obj/item/clothing/mask/gas/voice/space_ninja/O = wear_mask
|
||||
switch(O.mode)
|
||||
|
||||
@@ -432,7 +432,7 @@
|
||||
help_shake_act(M)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
|
||||
|
||||
@@ -523,7 +523,7 @@
|
||||
O.show_message(text("\red <B>[] has attempted to lunge at [name]!</B>", M), 1)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
|
||||
|
||||
@@ -589,6 +589,9 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
/mob/living/carbon/slime/show_inv(mob/user)
|
||||
return
|
||||
|
||||
/mob/living/carbon/slime/toggle_throw_mode()
|
||||
return
|
||||
|
||||
/mob/living/carbon/slime/proc/get_obstacle_ok(atom/A)
|
||||
var/direct = get_dir(src, A)
|
||||
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( src.loc )
|
||||
|
||||
@@ -96,8 +96,12 @@
|
||||
if("deathgasp")
|
||||
message = "<b>The [src.name]</b> lets out a faint chimper as it collapses and stops moving..."
|
||||
m_type = 1
|
||||
if("giggle")
|
||||
if (!muzzled)
|
||||
message = "<B>The [src.name]</B> giggles happily."
|
||||
m_type = 2
|
||||
if("help")
|
||||
src << "choke, collapse, dance, deathgasp, drool, gasp, shiver, gnarl, jump, paw, moan, nod, roar, roll, scratch,\nscretch, shake, sign-#, sit, sulk, sway, tail, twitch, whimper"
|
||||
src << "choke, collapse, dance, deathgasp, drool, gasp, shiver, gnarl, giggle, jump, paw, moan, nod, roar, roll, scratch,\nscretch, shake, sign-#, sit, sulk, sway, tail, twitch, whimper"
|
||||
else
|
||||
src << text("Invalid Emote: []", act)
|
||||
if ((message && src.stat == 0))
|
||||
@@ -111,4 +115,4 @@
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
//Foreach goto(746)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -142,6 +142,13 @@
|
||||
mymob.pullin.name = "pull"
|
||||
mymob.pullin.screen_loc = ui_pull_resist
|
||||
|
||||
lingchemdisplay = new /obj/screen()
|
||||
lingchemdisplay.name = "chemical storage"
|
||||
lingchemdisplay.icon_state = "power_display"
|
||||
lingchemdisplay.screen_loc = ui_lingchemdisplay
|
||||
lingchemdisplay.layer = 20
|
||||
lingchemdisplay.invisibility = 101
|
||||
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
O.show_message(text("\red <B>[] has attempted to punch [name]!</B>", M), 1)
|
||||
else
|
||||
if (M.a_intent == "grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
|
||||
@@ -230,7 +230,7 @@
|
||||
O.show_message(text("\red <B>[] has attempted to lunge at [name]!</B>", M), 1)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
|
||||
|
||||
@@ -345,8 +345,8 @@
|
||||
if(client && mind)
|
||||
if (client.statpanel == "Status")
|
||||
if(mind.changeling)
|
||||
stat("Chemical Storage", mind.changeling.chem_charges)
|
||||
stat("Genetic Damage Time", mind.changeling.geneticdamage)
|
||||
stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]")
|
||||
stat("Absorbed DNA", mind.changeling.absorbedcount)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/mob/living/Login()
|
||||
..()
|
||||
//Mind updates
|
||||
mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist)
|
||||
mind.active = 1 //indicates that the mind is currently synced with a client
|
||||
sync_mind()
|
||||
mind.show_memory(src, 0)
|
||||
|
||||
//Round specific stuff like hud updates
|
||||
|
||||
@@ -31,7 +31,7 @@ var/list/ai_list = list()
|
||||
var/obj/item/device/multitool/aiMulti = null
|
||||
|
||||
//MALFUNCTION
|
||||
var/datum/AI_Module/module_picker/malf_picker
|
||||
var/datum/module_picker/malf_picker
|
||||
var/processing_time = 100
|
||||
var/list/datum/AI_Module/current_modules = list()
|
||||
var/fire_res_on_core = 0
|
||||
@@ -48,6 +48,7 @@ var/list/ai_list = list()
|
||||
var/datum/trackable/track = null
|
||||
|
||||
var/last_paper_seen = null
|
||||
var/can_shunt = 1
|
||||
|
||||
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
|
||||
var/list/possibleNames = ai_names
|
||||
|
||||
@@ -587,7 +587,7 @@
|
||||
O.show_message(text("\blue [M] caresses [src]'s plating with its scythe like arm."), 1)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
|
||||
|
||||
|
||||
@@ -159,7 +159,30 @@
|
||||
M.show_message("\red [user] gently taps [src] with [O]. ")
|
||||
|
||||
|
||||
/mob/living/simple_animal/construct/armoured/bullet_act(var/obj/item/projectile/P)
|
||||
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
|
||||
var/reflectchance = 65 - round(P.damage/3)
|
||||
if(prob(reflectchance))
|
||||
visible_message("<span class='danger'>The [P.name] gets reflected by [src]'s shell!</span>", \
|
||||
"<span class='userdanger'>The [P.name] gets reflected by [src]'s shell!</span>")
|
||||
|
||||
// Find a turf near or on the original location to bounce to
|
||||
if(P.starting)
|
||||
var/new_x = P.starting.x + pick(0, 0, -1, 1, -1, 1, -2, 2, -2, 2, -2, 2)
|
||||
var/new_y = P.starting.y + pick(0, 0, -1, 1, -1, 1, -2, 2, -2, 2, -2, 2)
|
||||
var/turf/curloc = get_turf(src)
|
||||
|
||||
// redirect the projectile
|
||||
P.original = locate(new_x, new_y, P.z)
|
||||
P.starting = curloc
|
||||
P.current = curloc
|
||||
P.firer = src
|
||||
P.yo = new_y - curloc.y
|
||||
P.xo = new_x - curloc.x
|
||||
|
||||
return -1 // complete projectile permutation
|
||||
|
||||
return (..(P))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -141,6 +141,11 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
..(loc)
|
||||
CopyObject(copy, creator)
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/Life()
|
||||
..()
|
||||
for(var/mob/living/M in contents) //a fix for animated statues from the flesh to stone spell
|
||||
Die()
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/Die()
|
||||
|
||||
for(var/atom/movable/M in src)
|
||||
|
||||
@@ -109,8 +109,6 @@ lines 294-301 in living/say.dm (speech buffer)
|
||||
|
||||
parrot_sleep_dur = parrot_sleep_max //In case someone decides to change the max without changing the duration var
|
||||
|
||||
player_list += src
|
||||
|
||||
verbs.Add(/mob/living/simple_animal/parrot/proc/steal_from_ground, \
|
||||
/mob/living/simple_animal/parrot/proc/steal_from_mob, \
|
||||
/mob/living/simple_animal/parrot/verb/drop_held_item_player, \
|
||||
@@ -160,10 +158,11 @@ lines 294-301 in living/say.dm (speech buffer)
|
||||
switch(remove_from)
|
||||
if("ears")
|
||||
if(ears)
|
||||
if(available_channels.len)
|
||||
src.say("[pick(available_channels)] BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
|
||||
else
|
||||
src.say("BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
|
||||
if(!stat)
|
||||
if(available_channels.len)
|
||||
src.say("[pick(available_channels)] BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
|
||||
else
|
||||
src.say("BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
|
||||
ears.loc = src.loc
|
||||
ears = null
|
||||
for(var/possible_phrase in speak)
|
||||
@@ -264,7 +263,7 @@ lines 294-301 in living/say.dm (speech buffer)
|
||||
if(parrot_state == PARROT_PERCH)
|
||||
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
|
||||
|
||||
if(M.melee_damage_upper > 0)
|
||||
if(M.melee_damage_upper > 0 && !stat)
|
||||
parrot_interest = M
|
||||
parrot_state = PARROT_SWOOP | PARROT_ATTACK //Attack other animals regardless
|
||||
icon_state = "parrot_fly"
|
||||
@@ -704,7 +703,7 @@ lines 294-301 in living/say.dm (speech buffer)
|
||||
|
||||
|
||||
//parrots will eat crackers instead of dropping them
|
||||
if(istype(held_item,/obj/item/weapon/reagent_containers/food/snacks/cracker) && (!drop_gently))
|
||||
if(istype(held_item,/obj/item/weapon/reagent_containers/food/snacks/cracker) && (drop_gently))
|
||||
del(held_item)
|
||||
held_item = null
|
||||
if(health < maxHealth)
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
O.show_message("\blue [M] [response_help] [src].")
|
||||
|
||||
if("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
if (!(status_flags & CANPUSH))
|
||||
return
|
||||
@@ -304,7 +304,7 @@
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
if ("grab")
|
||||
if(M == src)
|
||||
if(M == src || anchored)
|
||||
return
|
||||
if(!(status_flags & CANPUSH))
|
||||
return
|
||||
@@ -457,6 +457,8 @@
|
||||
|
||||
/mob/living/simple_animal/adjustBruteLoss(damage)
|
||||
health = Clamp(health - damage, 0, maxHealth)
|
||||
if(health < 1)
|
||||
Die()
|
||||
|
||||
/mob/living/simple_animal/proc/SA_attackable(target)
|
||||
if (isliving(target))
|
||||
@@ -467,4 +469,4 @@
|
||||
var/obj/mecha/M = target
|
||||
if (M.occupant)
|
||||
return 0
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
//Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code.
|
||||
/obj/item/weapon/grab/proc/throw()
|
||||
if(affecting)
|
||||
if(affecting.buckled)
|
||||
return null
|
||||
if(state >= GRAB_AGGRESSIVE)
|
||||
return affecting
|
||||
return null
|
||||
@@ -78,6 +80,7 @@
|
||||
affecting.drop_item()
|
||||
affecting.hand = h
|
||||
for(var/obj/item/weapon/grab/G in affecting.grabbed_by)
|
||||
if(G == src) continue
|
||||
if(G.state == GRAB_AGGRESSIVE)
|
||||
allow_upgrade = 0
|
||||
if(allow_upgrade)
|
||||
@@ -106,7 +109,7 @@
|
||||
return
|
||||
if(assailant.next_move > world.time)
|
||||
return
|
||||
if(last_upgrade > world.time + UPGRADE_COOLDOWN)
|
||||
if(world.time < (last_upgrade + UPGRADE_COOLDOWN))
|
||||
return
|
||||
if(!assailant.canmove || assailant.lying)
|
||||
del(src)
|
||||
|
||||
@@ -151,21 +151,23 @@ proc/isorgan(A)
|
||||
return zone
|
||||
|
||||
|
||||
/proc/ran_zone(zone, probability)
|
||||
/proc/ran_zone(zone, probability = 80)
|
||||
|
||||
zone = check_zone(zone)
|
||||
if(!probability) probability = 90
|
||||
if(probability == 100) return zone
|
||||
|
||||
if(zone == "chest")
|
||||
if(prob(probability)) return "chest"
|
||||
var/t = rand(1, 9)
|
||||
switch(t)
|
||||
if(1 to 3) return "head"
|
||||
if(4 to 6) return "l_arm"
|
||||
if(7 to 9) return "r_arm"
|
||||
if(prob(probability))
|
||||
return zone
|
||||
|
||||
if(prob(probability * 0.75)) return zone
|
||||
return "chest"
|
||||
var/t = rand(1, 17) // randomly pick a different zone, or maybe the same one
|
||||
switch(t)
|
||||
if(1) return "head"
|
||||
if(2) return "chest"
|
||||
if(3 to 6) return "l_arm"
|
||||
if(7 to 10) return "r_arm"
|
||||
if(10 to 13) return "l_leg"
|
||||
if(14 to 17) return "r_leg"
|
||||
|
||||
return zone
|
||||
|
||||
|
||||
/proc/stars(n, pr)
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
onclose(user, "copier")
|
||||
|
||||
/obj/machinery/photocopier/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["copy"])
|
||||
if(copy)
|
||||
for(var/i = 0, i < copies, i++)
|
||||
|
||||
@@ -300,11 +300,7 @@
|
||||
|
||||
|
||||
/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")
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["close"])
|
||||
|
||||
@@ -694,11 +694,12 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
|
||||
if(..())
|
||||
return
|
||||
if(!isrobot(usr))
|
||||
if(!can_use(usr, 1))
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if (href_list["lock"])
|
||||
@@ -796,6 +797,9 @@
|
||||
if(istype(malf.loc, /obj/machinery/power/apc)) // Already in an APC
|
||||
malf << "<span class='warning'>You must evacuate your current apc first.</span>"
|
||||
return
|
||||
if(!malf.can_shunt)
|
||||
malf << "<span class='warning'>You cannot shunt.</span>"
|
||||
return
|
||||
if(src.z != 1)
|
||||
return
|
||||
src.occupant = new /mob/living/silicon/ai(src,malf.laws,null,1)
|
||||
|
||||
@@ -151,7 +151,8 @@
|
||||
|
||||
|
||||
/obj/machinery/power/generator/Topic(href, href_list)
|
||||
..()
|
||||
if(..())
|
||||
return
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=teg")
|
||||
usr.unset_machine()
|
||||
|
||||
@@ -128,7 +128,8 @@
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/Topic(href, href_list)
|
||||
..()
|
||||
if(..())
|
||||
return
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=teg")
|
||||
|
||||
@@ -114,13 +114,9 @@
|
||||
|
||||
/obj/machinery/computer/gravity_control_computer/Topic(href, href_list)
|
||||
set background = 1
|
||||
..()
|
||||
|
||||
if ( (get_dist(src, usr) > 1 ))
|
||||
if (!istype(usr, /mob/living/silicon))
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=air_alarm")
|
||||
return
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["gentoggle"])
|
||||
if(gravity_generator:on)
|
||||
|
||||
@@ -73,11 +73,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/particle_accelerator/control_box/Topic(href, href_list)
|
||||
..()
|
||||
//Ignore input if we are broken, !silicon guy cant touch us, or nonai controlling from super far away
|
||||
if(stat & (BROKEN|NOPOWER) || (get_dist(src, usr) > 1 && !istype(usr, /mob/living/silicon)) || (get_dist(src, usr) > 8 && !istype(usr, /mob/living/silicon/ai)))
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=pacontrol")
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!interface_control)
|
||||
|
||||
+57
-71
@@ -210,96 +210,82 @@
|
||||
|
||||
|
||||
/obj/machinery/power/smes/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if (usr.stat || usr.restrained() )
|
||||
if(..())
|
||||
return
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
if(!istype(usr, /mob/living/silicon/ai))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
//world << "[href] ; [href_list[href]]"
|
||||
|
||||
if (( usr.machine==src && ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=smes")
|
||||
usr.unset_machine()
|
||||
return
|
||||
|
||||
else if( href_list["cmode"] )
|
||||
chargemode = !chargemode
|
||||
if(!chargemode)
|
||||
charging = 0
|
||||
updateicon()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=smes")
|
||||
usr.unset_machine()
|
||||
return
|
||||
else if( href_list["online"] )
|
||||
online = !online
|
||||
updateicon()
|
||||
else if( href_list["input"] )
|
||||
|
||||
else if( href_list["cmode"] )
|
||||
chargemode = !chargemode
|
||||
if(!chargemode)
|
||||
charging = 0
|
||||
updateicon()
|
||||
var/i = text2num(href_list["input"])
|
||||
|
||||
else if( href_list["online"] )
|
||||
online = !online
|
||||
updateicon()
|
||||
else if( href_list["input"] )
|
||||
var/d = 0
|
||||
switch(i)
|
||||
if(-4)
|
||||
chargelevel = 0
|
||||
if(4)
|
||||
chargelevel = SMESMAXCHARGELEVEL //30000
|
||||
|
||||
var/i = text2num(href_list["input"])
|
||||
if(1)
|
||||
d = 100
|
||||
if(-1)
|
||||
d = -100
|
||||
if(2)
|
||||
d = 1000
|
||||
if(-2)
|
||||
d = -1000
|
||||
if(3)
|
||||
d = 10000
|
||||
if(-3)
|
||||
d = -10000
|
||||
|
||||
var/d = 0
|
||||
switch(i)
|
||||
if(-4)
|
||||
chargelevel = 0
|
||||
if(4)
|
||||
chargelevel = SMESMAXCHARGELEVEL //30000
|
||||
chargelevel += d
|
||||
chargelevel = max(0, min(SMESMAXCHARGELEVEL, chargelevel)) // clamp to range
|
||||
|
||||
if(1)
|
||||
d = 100
|
||||
if(-1)
|
||||
d = -100
|
||||
if(2)
|
||||
d = 1000
|
||||
if(-2)
|
||||
d = -1000
|
||||
if(3)
|
||||
d = 10000
|
||||
if(-3)
|
||||
d = -10000
|
||||
else if( href_list["output"] )
|
||||
|
||||
chargelevel += d
|
||||
chargelevel = max(0, min(SMESMAXCHARGELEVEL, chargelevel)) // clamp to range
|
||||
var/i = text2num(href_list["output"])
|
||||
|
||||
else if( href_list["output"] )
|
||||
var/d = 0
|
||||
switch(i)
|
||||
if(-4)
|
||||
output = 0
|
||||
if(4)
|
||||
output = SMESMAXOUTPUT //30000
|
||||
|
||||
var/i = text2num(href_list["output"])
|
||||
if(1)
|
||||
d = 100
|
||||
if(-1)
|
||||
d = -100
|
||||
if(2)
|
||||
d = 1000
|
||||
if(-2)
|
||||
d = -1000
|
||||
if(3)
|
||||
d = 10000
|
||||
if(-3)
|
||||
d = -10000
|
||||
|
||||
var/d = 0
|
||||
switch(i)
|
||||
if(-4)
|
||||
output = 0
|
||||
if(4)
|
||||
output = SMESMAXOUTPUT //30000
|
||||
|
||||
if(1)
|
||||
d = 100
|
||||
if(-1)
|
||||
d = -100
|
||||
if(2)
|
||||
d = 1000
|
||||
if(-2)
|
||||
d = -1000
|
||||
if(3)
|
||||
d = 10000
|
||||
if(-3)
|
||||
d = -10000
|
||||
|
||||
output += d
|
||||
output = max(0, min(SMESMAXOUTPUT, output)) // clamp to range
|
||||
output += d
|
||||
output = max(0, min(SMESMAXOUTPUT, output)) // clamp to range
|
||||
|
||||
investigate_log("input/output; [chargelevel>output?"<font color='green'>":"<font color='red'>"][chargelevel]/[output]</font> | Output-mode: [online?"<font color='green'>on</font>":"<font color='red'>off</font>"] | Input-mode: [chargemode?"<font color='green'>auto</font>":"<font color='red'>off</font>"] by [usr.key]","singulo")
|
||||
src.updateUsrDialog()
|
||||
|
||||
else
|
||||
usr << browse(null, "window=smes")
|
||||
usr.unset_machine()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/smes/proc/ion_act()
|
||||
if(src.z == 1)
|
||||
|
||||
@@ -185,39 +185,21 @@
|
||||
return
|
||||
|
||||
/obj/machinery/power/turbine/Topic(href, href_list)
|
||||
..()
|
||||
if(stat & BROKEN)
|
||||
if(..())
|
||||
return
|
||||
if (usr.stat || usr.restrained() )
|
||||
return
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
if(!istype(usr, /mob/living/silicon/ai))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (( usr.machine==src && ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=turbine")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
else if( href_list["str"] )
|
||||
compressor.starter = !compressor.starter
|
||||
|
||||
spawn(0)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.interact(M)
|
||||
|
||||
else
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=turbine")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
else if( href_list["str"] )
|
||||
compressor.starter = !compressor.starter
|
||||
|
||||
spawn(0)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.interact(M)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
loc = A.loc
|
||||
return 0// nope.avi
|
||||
|
||||
var/distance = get_dist(original,loc)
|
||||
def_zone = ran_zone(def_zone, 100-(5*distance)) //Lower accurancy/longer range tradeoff.
|
||||
var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
|
||||
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
|
||||
if(silenced)
|
||||
M << "<span class='userdanger'>You've been shot in the [parse_zone(def_zone)] by [src]!</span>"
|
||||
else
|
||||
|
||||
@@ -243,11 +243,9 @@
|
||||
return
|
||||
|
||||
/obj/machinery/chem_master/Topic(href, href_list)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
|
||||
|
||||
@@ -122,10 +122,9 @@
|
||||
/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W, mob/user)
|
||||
if(istype(W,/obj/item/weapon/storage))
|
||||
..() // -> item/attackby()
|
||||
if(istype(W,/obj/item/weapon/storage))
|
||||
..() // -> item/attackby()
|
||||
return 0
|
||||
if((slices_num <= 0 || !slices_num) || !slice_path)
|
||||
return 1
|
||||
return 0
|
||||
var/inaccurate = 0
|
||||
if( \
|
||||
istype(W, /obj/item/weapon/kitchenknife) || \
|
||||
@@ -143,7 +142,7 @@
|
||||
inaccurate = 1
|
||||
else if(W.w_class <= 2 && istype(src,/obj/item/weapon/reagent_containers/food/snacks/sliceable))
|
||||
if(!iscarbon(user))
|
||||
return 1
|
||||
return 0
|
||||
user << "<span class='notice'>You slip [W] inside [src].</span>"
|
||||
user.u_equip(W)
|
||||
if ((user.client && user.s_active != src))
|
||||
@@ -151,9 +150,10 @@
|
||||
W.dropped(user)
|
||||
add_fingerprint(user)
|
||||
contents += W
|
||||
return
|
||||
return 1 // no afterattack here
|
||||
else
|
||||
return 1
|
||||
return 0 // --- this is everything that is NOT a slicing implement, and which is not being slipped into food; allow afterattack ---
|
||||
|
||||
if ( \
|
||||
!isturf(src.loc) || \
|
||||
!(locate(/obj/structure/table) in src.loc) && \
|
||||
@@ -162,6 +162,7 @@
|
||||
)
|
||||
user << "<span class='notice'>You cannot slice [src] here! You need a table or at least a tray.</span>"
|
||||
return 1
|
||||
|
||||
var/slices_lost = 0
|
||||
if (!inaccurate)
|
||||
user.visible_message( \
|
||||
@@ -178,7 +179,7 @@
|
||||
for(var/i=1 to (slices_num-slices_lost))
|
||||
var/obj/slice = new slice_path (src.loc)
|
||||
reagents.trans_to(slice,reagents_per_slice)
|
||||
del(src)
|
||||
del(src) // so long and thanks for all the fish
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/Del()
|
||||
|
||||
+405
-419
@@ -25,446 +25,432 @@
|
||||
|
||||
// create a new disposal
|
||||
// find the attached trunk (if present) and init gas resvr.
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
trunk = locate() in src.loc
|
||||
if(!trunk)
|
||||
mode = 0
|
||||
flush = 0
|
||||
else
|
||||
trunk.linked = src // link the pipe trunk to self
|
||||
|
||||
air_contents = new/datum/gas_mixture()
|
||||
//gas.volume = 1.05 * CELLSTANDARD
|
||||
update()
|
||||
|
||||
Del()
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.loc = src.loc
|
||||
..()
|
||||
|
||||
// attack by item places it in to disposal
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if(stat & BROKEN || !I || !user)
|
||||
return
|
||||
|
||||
if(isrobot(user) && !istype(I, /obj/item/weapon/storage/bag/trash))
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
if(mode<=0) // It's off
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(contents.len > 0)
|
||||
user << "Eject the items first!"
|
||||
return
|
||||
if(mode==0) // It's off but still not unscrewed
|
||||
mode=-1 // Set it to doubleoff l0l
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "You remove the screws around the power connection."
|
||||
return
|
||||
else if(mode==-1)
|
||||
mode=0
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "You attach the screws around the power connection."
|
||||
return
|
||||
else if(istype(I,/obj/item/weapon/weldingtool) && mode==-1)
|
||||
if(contents.len > 0)
|
||||
user << "Eject the items first!"
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
|
||||
user << "You start slicing the floorweld off the disposal unit."
|
||||
|
||||
if(do_after(user,20))
|
||||
if(!src || !W.isOn()) return
|
||||
user << "You sliced the floorweld off the disposal unit."
|
||||
var/obj/structure/disposalconstruct/C = new (src.loc)
|
||||
src.transfer_fingerprints_to(C)
|
||||
C.ptype = 6 // 6 = disposal unit
|
||||
C.anchored = 1
|
||||
C.density = 1
|
||||
C.update()
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
user << "You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/melee/energy/blade))
|
||||
user << "You can't place that item inside the disposal unit."
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/storage/bag/trash))
|
||||
var/obj/item/weapon/storage/bag/trash/T = I
|
||||
user << "\blue You empty the bag."
|
||||
for(var/obj/item/O in T.contents)
|
||||
T.remove_from_storage(O,src)
|
||||
T.update_icon()
|
||||
update()
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(istype(G)) // handle grabbed mob
|
||||
if(ismob(G.affecting))
|
||||
var/mob/GM = G.affecting
|
||||
for (var/mob/V in viewers(usr))
|
||||
V.show_message("[usr] starts putting [GM.name] into the disposal.", 3)
|
||||
if(do_after(usr, 20))
|
||||
if (GM.client)
|
||||
GM.client.perspective = EYE_PERSPECTIVE
|
||||
GM.client.eye = src
|
||||
GM.loc = src
|
||||
for (var/mob/C in viewers(src))
|
||||
C.show_message("\red [GM.name] has been placed in the [src] by [user].", 3)
|
||||
del(G)
|
||||
return
|
||||
|
||||
if(!I) return
|
||||
|
||||
user.drop_item()
|
||||
if(I)
|
||||
I.loc = src
|
||||
|
||||
user << "You place \the [I] into the [src]."
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user)
|
||||
continue
|
||||
M.show_message("[user.name] places \the [I] into the [src].", 3)
|
||||
|
||||
update()
|
||||
|
||||
// mouse drop another mob or self
|
||||
//
|
||||
MouseDrop_T(mob/target, mob/user)
|
||||
if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai))
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
var/target_loc = target.loc
|
||||
var/msg
|
||||
for (var/mob/V in viewers(usr))
|
||||
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
V.show_message("[usr] starts climbing into the disposal.", 3)
|
||||
if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
if(target.anchored) return
|
||||
if(!ishuman(user) && !ismonkey(user)) return
|
||||
V.show_message("[usr] starts stuffing [target.name] into the disposal.", 3)
|
||||
if(!do_after(usr, 20))
|
||||
return
|
||||
if(target_loc != target.loc)
|
||||
return
|
||||
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis) // if drop self, then climbed in
|
||||
// must be awake, not stunned or whatever
|
||||
msg = "[user.name] climbs into the [src]."
|
||||
user << "You climb into the [src]."
|
||||
else if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
msg = "[user.name] stuffs [target.name] into the [src]!"
|
||||
user << "You stuff [target.name] into the [src]!"
|
||||
else
|
||||
return
|
||||
if (target.client)
|
||||
target.client.perspective = EYE_PERSPECTIVE
|
||||
target.client.eye = src
|
||||
target.loc = src
|
||||
|
||||
for (var/mob/C in viewers(src))
|
||||
if(C == user)
|
||||
continue
|
||||
C.show_message(msg, 3)
|
||||
|
||||
update()
|
||||
return
|
||||
|
||||
// can breath normally in the disposal
|
||||
alter_health()
|
||||
return get_turf(src)
|
||||
|
||||
// attempt to move while inside
|
||||
relaymove(mob/user as mob)
|
||||
if(user.stat || src.flushing)
|
||||
return
|
||||
src.go_out(user)
|
||||
return
|
||||
|
||||
// leave the disposal
|
||||
proc/go_out(mob/user)
|
||||
|
||||
if (user.client)
|
||||
user.client.eye = user.client.mob
|
||||
user.client.perspective = MOB_PERSPECTIVE
|
||||
user.loc = src.loc
|
||||
update()
|
||||
return
|
||||
|
||||
|
||||
// monkeys can only pull the flush lever
|
||||
attack_paw(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
flush = !flush
|
||||
update()
|
||||
return
|
||||
|
||||
// ai as human but can't flush
|
||||
attack_ai(mob/user as mob)
|
||||
interact(user, 1)
|
||||
|
||||
// human interact with machine
|
||||
attack_hand(mob/user as mob)
|
||||
if(user && user.loc == src)
|
||||
usr << "\red You cannot reach the controls from inside."
|
||||
return
|
||||
/*
|
||||
if(mode==-1)
|
||||
usr << "\red The disposal units power is disabled."
|
||||
return
|
||||
*/
|
||||
interact(user, 0)
|
||||
|
||||
// user interaction
|
||||
interact(mob/user, var/ai=0)
|
||||
|
||||
src.add_fingerprint(user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
return
|
||||
|
||||
var/dat = "<head><title>Waste Disposal Unit</title></head><body><TT><B>Waste Disposal Unit</B><HR>"
|
||||
|
||||
if(!ai) // AI can't pull flush handle
|
||||
if(flush)
|
||||
dat += "Disposal handle: <A href='?src=\ref[src];handle=0'>Disengage</A> <B>Engaged</B>"
|
||||
else
|
||||
dat += "Disposal handle: <B>Disengaged</B> <A href='?src=\ref[src];handle=1'>Engage</A>"
|
||||
|
||||
dat += "<BR><HR><A href='?src=\ref[src];eject=1'>Eject contents</A><HR>"
|
||||
|
||||
if(mode <= 0)
|
||||
dat += "Pump: <B>Off</B> <A href='?src=\ref[src];pump=1'>On</A><BR>"
|
||||
else if(mode == 1)
|
||||
dat += "Pump: <A href='?src=\ref[src];pump=0'>Off</A> <B>On</B> (pressurizing)<BR>"
|
||||
else
|
||||
dat += "Pump: <A href='?src=\ref[src];pump=0'>Off</A> <B>On</B> (idle)<BR>"
|
||||
|
||||
var/per = 100* air_contents.return_pressure() / (SEND_PRESSURE)
|
||||
|
||||
dat += "Pressure: [round(per, 1)]%<BR></body>"
|
||||
|
||||
|
||||
user.set_machine(src)
|
||||
user << browse(dat, "window=disposal;size=360x170")
|
||||
onclose(user, "disposal")
|
||||
|
||||
// handle machine interaction
|
||||
|
||||
Topic(href, href_list)
|
||||
if(usr.loc == src)
|
||||
usr << "\red You cannot reach the controls from inside."
|
||||
return
|
||||
|
||||
if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1
|
||||
usr << "\red The disposal units power is disabled."
|
||||
return
|
||||
..()
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(usr.stat || usr.restrained() || src.flushing)
|
||||
return
|
||||
|
||||
if (in_range(src, usr) && istype(src.loc, /turf))
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["close"])
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=disposal")
|
||||
return
|
||||
|
||||
if(href_list["pump"])
|
||||
if(text2num(href_list["pump"]))
|
||||
mode = 1
|
||||
else
|
||||
mode = 0
|
||||
update()
|
||||
|
||||
if(href_list["handle"])
|
||||
flush = text2num(href_list["handle"])
|
||||
update()
|
||||
|
||||
if(href_list["eject"])
|
||||
eject()
|
||||
else
|
||||
usr << browse(null, "window=disposal")
|
||||
usr.unset_machine()
|
||||
return
|
||||
return
|
||||
|
||||
// eject the contents of the disposal unit
|
||||
proc/eject()
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.loc = src.loc
|
||||
AM.pipe_eject(0)
|
||||
update()
|
||||
|
||||
// update the icon & overlays to reflect mode & status
|
||||
proc/update()
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "disposal-broken"
|
||||
/obj/machinery/disposal/New()
|
||||
..()
|
||||
spawn(5)
|
||||
trunk = locate() in src.loc
|
||||
if(!trunk)
|
||||
mode = 0
|
||||
flush = 0
|
||||
return
|
||||
else
|
||||
trunk.linked = src // link the pipe trunk to self
|
||||
|
||||
// flush handle
|
||||
if(flush)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle")
|
||||
air_contents = new/datum/gas_mixture()
|
||||
//gas.volume = 1.05 * CELLSTANDARD
|
||||
update()
|
||||
|
||||
// only handle is shown if no power
|
||||
if(stat & NOPOWER || mode == -1)
|
||||
return
|
||||
/obj/machinery/disposal/Del()
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.loc = src.loc
|
||||
..()
|
||||
|
||||
// check for items in disposal - occupied light
|
||||
if(contents.len > 0)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-full")
|
||||
|
||||
// charging and ready light
|
||||
if(mode == 1)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-charge")
|
||||
else if(mode == 2)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-ready")
|
||||
|
||||
// timed process
|
||||
// charge the gas reservoir and perform flush if ready
|
||||
process()
|
||||
if(stat & BROKEN) // nothing can happen if broken
|
||||
return
|
||||
|
||||
if(!air_contents) // Potentially causes a runtime otherwise (if this is really shitty, blame pete //Donkie)
|
||||
return
|
||||
|
||||
flush_count++
|
||||
if( flush_count >= flush_every_ticks )
|
||||
if( contents.len )
|
||||
if(mode == 2)
|
||||
spawn(0)
|
||||
feedback_inc("disposal_auto_flush",1)
|
||||
flush()
|
||||
flush_count = 0
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
if(flush && air_contents.return_pressure() >= SEND_PRESSURE ) // flush can happen even without power
|
||||
flush()
|
||||
|
||||
if(stat & NOPOWER) // won't charge if no power
|
||||
return
|
||||
|
||||
use_power(100) // base power usage
|
||||
|
||||
if(mode != 1) // if off or ready, no need to charge
|
||||
return
|
||||
|
||||
// otherwise charge
|
||||
use_power(500) // charging power usage
|
||||
|
||||
var/atom/L = loc // recharging from loc turf
|
||||
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
var/pressure_delta = (SEND_PRESSURE*1.01) - air_contents.return_pressure()
|
||||
|
||||
if(env.temperature > 0)
|
||||
var/transfer_moles = 0.1 * pressure_delta*air_contents.volume/(env.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
air_contents.merge(removed)
|
||||
|
||||
|
||||
// if full enough, switch to ready mode
|
||||
if(air_contents.return_pressure() >= SEND_PRESSURE)
|
||||
mode = 2
|
||||
update()
|
||||
// attack by item places it in to disposal
|
||||
/obj/machinery/disposal/attackby(var/obj/item/I, var/mob/user)
|
||||
if(stat & BROKEN || !I || !user)
|
||||
return
|
||||
|
||||
// perform a flush
|
||||
proc/flush()
|
||||
if(isrobot(user) && !istype(I, /obj/item/weapon/storage/bag/trash))
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
if(mode<=0) // It's off
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(contents.len > 0)
|
||||
user << "Eject the items first!"
|
||||
return
|
||||
if(mode==0) // It's off but still not unscrewed
|
||||
mode=-1 // Set it to doubleoff l0l
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "You remove the screws around the power connection."
|
||||
return
|
||||
else if(mode==-1)
|
||||
mode=0
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "You attach the screws around the power connection."
|
||||
return
|
||||
else if(istype(I,/obj/item/weapon/weldingtool) && mode==-1)
|
||||
if(contents.len > 0)
|
||||
user << "Eject the items first!"
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
|
||||
user << "You start slicing the floorweld off the disposal unit."
|
||||
|
||||
flushing = 1
|
||||
flick("[icon_state]-flush", src)
|
||||
if(do_after(user,20))
|
||||
if(!src || !W.isOn()) return
|
||||
user << "You sliced the floorweld off the disposal unit."
|
||||
var/obj/structure/disposalconstruct/C = new (src.loc)
|
||||
src.transfer_fingerprints_to(C)
|
||||
C.ptype = 6 // 6 = disposal unit
|
||||
C.anchored = 1
|
||||
C.density = 1
|
||||
C.update()
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
user << "You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
var/wrapcheck = 0
|
||||
var/obj/structure/disposalholder/H = new() // virtual holder object which actually
|
||||
// travels through the pipes.
|
||||
for(var/obj/item/smallDelivery/O in src)
|
||||
wrapcheck = 1
|
||||
if(istype(I, /obj/item/weapon/melee/energy/blade))
|
||||
user << "You can't place that item inside the disposal unit."
|
||||
return
|
||||
|
||||
if(wrapcheck == 1)
|
||||
H.tomail = 1
|
||||
|
||||
|
||||
air_contents = new() // new empty gas resv.
|
||||
|
||||
sleep(10)
|
||||
if(last_sound < world.time + 1)
|
||||
playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0)
|
||||
last_sound = world.time
|
||||
sleep(5) // wait for animation to finish
|
||||
|
||||
|
||||
H.init(src) // copy the contents of disposer to holder
|
||||
|
||||
H.start(src) // start the holder processing movement
|
||||
flushing = 0
|
||||
// now reset disposal state
|
||||
flush = 0
|
||||
if(mode == 2) // if was ready,
|
||||
mode = 1 // switch to charging
|
||||
if(istype(I, /obj/item/weapon/storage/bag/trash))
|
||||
var/obj/item/weapon/storage/bag/trash/T = I
|
||||
user << "\blue You empty the bag."
|
||||
for(var/obj/item/O in T.contents)
|
||||
T.remove_from_storage(O,src)
|
||||
T.update_icon()
|
||||
update()
|
||||
return
|
||||
|
||||
|
||||
// called when area power changes
|
||||
power_change()
|
||||
..() // do default setting/reset of stat NOPOWER bit
|
||||
update() // update icon
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(istype(G)) // handle grabbed mob
|
||||
if(ismob(G.affecting))
|
||||
var/mob/GM = G.affecting
|
||||
for (var/mob/V in viewers(usr))
|
||||
V.show_message("[usr] starts putting [GM.name] into the disposal.", 3)
|
||||
if(do_after(usr, 20))
|
||||
if (GM.client)
|
||||
GM.client.perspective = EYE_PERSPECTIVE
|
||||
GM.client.eye = src
|
||||
GM.loc = src
|
||||
for (var/mob/C in viewers(src))
|
||||
C.show_message("\red [GM.name] has been placed in the [src] by [user].", 3)
|
||||
del(G)
|
||||
return
|
||||
|
||||
if(!I) return
|
||||
|
||||
// called when holder is expelled from a disposal
|
||||
// should usually only occur if the pipe network is modified
|
||||
proc/expel(var/obj/structure/disposalholder/H)
|
||||
user.drop_item()
|
||||
if(I)
|
||||
I.loc = src
|
||||
|
||||
var/turf/target
|
||||
playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
|
||||
if(H) // Somehow, someone managed to flush a window which broke mid-transit and caused the disposal to go in an infinite loop trying to expel null, hopefully this fixes it
|
||||
for(var/atom/movable/AM in H)
|
||||
target = get_offset_target_turf(src.loc, rand(5)-rand(5), rand(5)-rand(5))
|
||||
user << "You place \the [I] into the [src]."
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user)
|
||||
continue
|
||||
M.show_message("[user.name] places \the [I] into the [src].", 3)
|
||||
|
||||
AM.loc = src.loc
|
||||
AM.pipe_eject(0)
|
||||
spawn(1)
|
||||
if(AM)
|
||||
AM.throw_at(target, 5, 1)
|
||||
update()
|
||||
|
||||
H.vent_gas(loc)
|
||||
del(H)
|
||||
// mouse drop another mob or self
|
||||
//
|
||||
/obj/machinery/disposal/MouseDrop_T(mob/target, mob/user)
|
||||
if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai))
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
var/target_loc = target.loc
|
||||
var/msg
|
||||
for (var/mob/V in viewers(usr))
|
||||
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
V.show_message("[usr] starts climbing into the disposal.", 3)
|
||||
if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
if(target.anchored) return
|
||||
if(!ishuman(user) && !ismonkey(user)) return
|
||||
V.show_message("[usr] starts stuffing [target.name] into the disposal.", 3)
|
||||
if(!do_after(usr, 20))
|
||||
return
|
||||
if(target_loc != target.loc)
|
||||
return
|
||||
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis) // if drop self, then climbed in
|
||||
// must be awake, not stunned or whatever
|
||||
msg = "[user.name] climbs into the [src]."
|
||||
user << "You climb into the [src]."
|
||||
else if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
msg = "[user.name] stuffs [target.name] into the [src]!"
|
||||
user << "You stuff [target.name] into the [src]!"
|
||||
else
|
||||
return
|
||||
if (target.client)
|
||||
target.client.perspective = EYE_PERSPECTIVE
|
||||
target.client.eye = src
|
||||
target.loc = src
|
||||
|
||||
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if (istype(mover,/obj/item) && mover.throwing)
|
||||
var/obj/item/I = mover
|
||||
if(istype(I, /obj/item/weapon/dummy) || istype(I, /obj/item/projectile))
|
||||
return
|
||||
if(prob(75))
|
||||
I.loc = src
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\the [I] lands in \the [src].", 3)
|
||||
else
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\the [I] bounces off of \the [src]'s rim!.", 3)
|
||||
return 0
|
||||
for (var/mob/C in viewers(src))
|
||||
if(C == user)
|
||||
continue
|
||||
C.show_message(msg, 3)
|
||||
|
||||
update()
|
||||
return
|
||||
|
||||
// can breath normally in the disposal
|
||||
/obj/machinery/disposal/alter_health()
|
||||
return get_turf(src)
|
||||
|
||||
// attempt to move while inside
|
||||
/obj/machinery/disposal/relaymove(mob/user as mob)
|
||||
if(user.stat || src.flushing)
|
||||
return
|
||||
src.go_out(user)
|
||||
return
|
||||
|
||||
// leave the disposal
|
||||
/obj/machinery/disposal/proc/go_out(mob/user)
|
||||
|
||||
if (user.client)
|
||||
user.client.eye = user.client.mob
|
||||
user.client.perspective = MOB_PERSPECTIVE
|
||||
user.loc = src.loc
|
||||
update()
|
||||
return
|
||||
|
||||
|
||||
// monkeys can only pull the flush lever
|
||||
/obj/machinery/disposal/attack_paw(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
flush = !flush
|
||||
update()
|
||||
return
|
||||
|
||||
// ai as human but can't flush
|
||||
/obj/machinery/disposal/attack_ai(mob/user as mob)
|
||||
interact(user, 1)
|
||||
|
||||
// human interact with machine
|
||||
/obj/machinery/disposal/attack_hand(mob/user as mob)
|
||||
if(user && user.loc == src)
|
||||
usr << "\red You cannot reach the controls from inside."
|
||||
return
|
||||
/*
|
||||
if(mode==-1)
|
||||
usr << "\red The disposal units power is disabled."
|
||||
return
|
||||
*/
|
||||
interact(user, 0)
|
||||
|
||||
// user interaction
|
||||
/obj/machinery/disposal/interact(mob/user, var/ai=0)
|
||||
|
||||
src.add_fingerprint(user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
return
|
||||
|
||||
var/dat = "<head><title>Waste Disposal Unit</title></head><body><TT><B>Waste Disposal Unit</B><HR>"
|
||||
|
||||
if(!ai) // AI can't pull flush handle
|
||||
if(flush)
|
||||
dat += "Disposal handle: <A href='?src=\ref[src];handle=0'>Disengage</A> <B>Engaged</B>"
|
||||
else
|
||||
return ..(mover, target, height, air_group)
|
||||
dat += "Disposal handle: <B>Disengaged</B> <A href='?src=\ref[src];handle=1'>Engage</A>"
|
||||
|
||||
dat += "<BR><HR><A href='?src=\ref[src];eject=1'>Eject contents</A><HR>"
|
||||
|
||||
if(mode <= 0)
|
||||
dat += "Pump: <B>Off</B> <A href='?src=\ref[src];pump=1'>On</A><BR>"
|
||||
else if(mode == 1)
|
||||
dat += "Pump: <A href='?src=\ref[src];pump=0'>Off</A> <B>On</B> (pressurizing)<BR>"
|
||||
else
|
||||
dat += "Pump: <A href='?src=\ref[src];pump=0'>Off</A> <B>On</B> (idle)<BR>"
|
||||
|
||||
var/per = 100* air_contents.return_pressure() / (SEND_PRESSURE)
|
||||
|
||||
dat += "Pressure: [round(per, 1)]%<BR></body>"
|
||||
|
||||
|
||||
user.set_machine(src)
|
||||
user << browse(dat, "window=disposal;size=360x170")
|
||||
onclose(user, "disposal")
|
||||
|
||||
// handle machine interaction
|
||||
|
||||
/obj/machinery/disposal/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(usr.loc == src)
|
||||
usr << "\red You cannot reach the controls from inside."
|
||||
return
|
||||
|
||||
if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1
|
||||
usr << "\red The disposal units power is disabled."
|
||||
return
|
||||
..()
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["close"])
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=disposal")
|
||||
return
|
||||
|
||||
if(href_list["pump"])
|
||||
if(text2num(href_list["pump"]))
|
||||
mode = 1
|
||||
else
|
||||
mode = 0
|
||||
update()
|
||||
|
||||
if(href_list["handle"])
|
||||
flush = text2num(href_list["handle"])
|
||||
update()
|
||||
|
||||
if(href_list["eject"])
|
||||
eject()
|
||||
return
|
||||
|
||||
// eject the contents of the disposal unit
|
||||
/obj/machinery/disposal/proc/eject()
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.loc = src.loc
|
||||
AM.pipe_eject(0)
|
||||
update()
|
||||
|
||||
// update the icon & overlays to reflect mode & status
|
||||
/obj/machinery/disposal/proc/update()
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "disposal-broken"
|
||||
mode = 0
|
||||
flush = 0
|
||||
return
|
||||
|
||||
// flush handle
|
||||
if(flush)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle")
|
||||
|
||||
// only handle is shown if no power
|
||||
if(stat & NOPOWER || mode == -1)
|
||||
return
|
||||
|
||||
// check for items in disposal - occupied light
|
||||
if(contents.len > 0)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-full")
|
||||
|
||||
// charging and ready light
|
||||
if(mode == 1)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-charge")
|
||||
else if(mode == 2)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-ready")
|
||||
|
||||
// timed process
|
||||
// charge the gas reservoir and perform flush if ready
|
||||
/obj/machinery/disposal/process()
|
||||
if(stat & BROKEN) // nothing can happen if broken
|
||||
return
|
||||
|
||||
flush_count++
|
||||
if( flush_count >= flush_every_ticks )
|
||||
if( contents.len )
|
||||
if(mode == 2)
|
||||
spawn(0)
|
||||
feedback_inc("disposal_auto_flush",1)
|
||||
flush()
|
||||
flush_count = 0
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
if(flush && air_contents.return_pressure() >= SEND_PRESSURE ) // flush can happen even without power
|
||||
spawn(0)
|
||||
flush()
|
||||
|
||||
if(stat & NOPOWER) // won't charge if no power
|
||||
return
|
||||
|
||||
use_power(100) // base power usage
|
||||
|
||||
if(mode != 1) // if off or ready, no need to charge
|
||||
return
|
||||
|
||||
// otherwise charge
|
||||
use_power(500) // charging power usage
|
||||
|
||||
var/atom/L = loc // recharging from loc turf
|
||||
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
var/pressure_delta = (SEND_PRESSURE*1.01) - air_contents.return_pressure()
|
||||
|
||||
if(env.temperature > 0)
|
||||
var/transfer_moles = 0.1 * pressure_delta*air_contents.volume/(env.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
air_contents.merge(removed)
|
||||
|
||||
|
||||
// if full enough, switch to ready mode
|
||||
if(air_contents.return_pressure() >= SEND_PRESSURE)
|
||||
mode = 2
|
||||
update()
|
||||
return
|
||||
|
||||
// perform a flush
|
||||
/obj/machinery/disposal/proc/flush()
|
||||
|
||||
flushing = 1
|
||||
flick("[icon_state]-flush", src)
|
||||
|
||||
var/wrapcheck = 0
|
||||
var/obj/structure/disposalholder/H = new() // virtual holder object which actually
|
||||
// travels through the pipes.
|
||||
for(var/obj/item/smallDelivery/O in src)
|
||||
wrapcheck = 1
|
||||
|
||||
if(wrapcheck == 1)
|
||||
H.tomail = 1
|
||||
|
||||
sleep(10)
|
||||
if(last_sound < world.time + 1)
|
||||
playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0)
|
||||
last_sound = world.time
|
||||
sleep(5) // wait for animation to finish
|
||||
|
||||
H.init(src) // copy the contents of disposer to holder
|
||||
air_contents = new() // new empty gas resv.
|
||||
|
||||
H.start(src) // start the holder processing movement
|
||||
flushing = 0
|
||||
// now reset disposal state
|
||||
flush = 0
|
||||
if(mode == 2) // if was ready,
|
||||
mode = 1 // switch to charging
|
||||
update()
|
||||
return
|
||||
|
||||
|
||||
// called when area power changes
|
||||
/obj/machinery/disposal/power_change()
|
||||
..() // do default setting/reset of stat NOPOWER bit
|
||||
update() // update icon
|
||||
return
|
||||
|
||||
|
||||
// called when holder is expelled from a disposal
|
||||
// should usually only occur if the pipe network is modified
|
||||
/obj/machinery/disposal/proc/expel(var/obj/structure/disposalholder/H)
|
||||
|
||||
var/turf/target
|
||||
playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
|
||||
if(H) // Somehow, someone managed to flush a window which broke mid-transit and caused the disposal to go in an infinite loop trying to expel null, hopefully this fixes it
|
||||
for(var/atom/movable/AM in H)
|
||||
target = get_offset_target_turf(src.loc, rand(5)-rand(5), rand(5)-rand(5))
|
||||
|
||||
AM.loc = src.loc
|
||||
AM.pipe_eject(0)
|
||||
spawn(1)
|
||||
if(AM)
|
||||
AM.throw_at(target, 5, 1)
|
||||
|
||||
H.vent_gas(loc)
|
||||
del(H)
|
||||
|
||||
/obj/machinery/disposal/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if (istype(mover,/obj/item) && mover.throwing)
|
||||
var/obj/item/I = mover
|
||||
if(istype(I, /obj/item/weapon/dummy) || istype(I, /obj/item/projectile))
|
||||
return
|
||||
if(prob(75))
|
||||
I.loc = src
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\the [I] lands in \the [src].", 3)
|
||||
else
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\the [I] bounces off of \the [src]'s rim!.", 3)
|
||||
return 0
|
||||
else
|
||||
return ..(mover, target, height, air_group)
|
||||
|
||||
// virtual disposal object
|
||||
// travels through pipes in lieu of actual items
|
||||
|
||||
@@ -80,13 +80,11 @@
|
||||
|
||||
|
||||
/obj/machinery/keycard_auth/Topic(href, href_list)
|
||||
..()
|
||||
if(..())
|
||||
return
|
||||
if(busy)
|
||||
usr << "This device is busy."
|
||||
return
|
||||
if(usr.stat || stat & (BROKEN|NOPOWER))
|
||||
usr << "This device is without power."
|
||||
return
|
||||
if(href_list["triggerevent"])
|
||||
event = href_list["triggerevent"]
|
||||
screen = 2
|
||||
@@ -94,7 +92,6 @@
|
||||
reset()
|
||||
|
||||
updateUsrDialog()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/keycard_auth/proc/reset()
|
||||
|
||||
Reference in New Issue
Block a user