mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-02 13:32:32 +00:00
Merge remote-tracking branch 'upstream/dev' into 151205-MoreCharacterSetupOptions
Conflicts: code/modules/client/preferences.dm
This commit is contained in:
15
code/modules/client/movement.dm
Normal file
15
code/modules/client/movement.dm
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
/client/New()
|
||||
..()
|
||||
dir = NORTH
|
||||
|
||||
/client/verb/spinleft()
|
||||
set name = "Spin View CCW"
|
||||
set category = "OOC"
|
||||
dir = turn(dir, 90)
|
||||
|
||||
/client/verb/spinright()
|
||||
set name = "Spin View CW"
|
||||
set category = "OOC"
|
||||
dir = turn(dir, -90)
|
||||
|
||||
@@ -192,9 +192,9 @@ datum/preferences
|
||||
|
||||
if(path)
|
||||
dat += "Slot - "
|
||||
dat += "<a href=\"byond://?src=\ref[user];preference=open_load_dialog\">Load slot</a> - "
|
||||
dat += "<a href=\"byond://?src=\ref[user];preference=save\">Save slot</a> - "
|
||||
dat += "<a href=\"byond://?src=\ref[user];preference=reload\">Reload slot</a>"
|
||||
dat += "<a href='?src=\ref[src];load=1'>Load slot</a> - "
|
||||
dat += "<a href='?src=\ref[src];save=1'>Save slot</a> - "
|
||||
dat += "<a href='?src=\ref[src];reload=1'>Reload slot</a>"
|
||||
|
||||
else
|
||||
dat += "Please create an account to save your preferences."
|
||||
@@ -218,26 +218,30 @@ datum/preferences
|
||||
else
|
||||
user << "<span class='danger'>The forum URL is not set in the server configuration.</span>"
|
||||
return
|
||||
ShowChoices(usr)
|
||||
return 1
|
||||
|
||||
/datum/preferences/Topic(href, list/href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["save"])
|
||||
save_preferences()
|
||||
save_character()
|
||||
else if(href_list["reload"])
|
||||
load_preferences()
|
||||
load_character()
|
||||
else if(href_list["load"])
|
||||
if(!IsGuestKey(usr.key))
|
||||
open_load_dialog(usr)
|
||||
return 1
|
||||
else if(href_list["changeslot"])
|
||||
load_character(text2num(href_list["changeslot"]))
|
||||
close_load_dialog(usr)
|
||||
else
|
||||
switch(href_list["preference"])
|
||||
if("save")
|
||||
save_preferences()
|
||||
save_character()
|
||||
return 0
|
||||
|
||||
if("reload")
|
||||
load_preferences()
|
||||
load_and_update_character()
|
||||
|
||||
if("open_load_dialog")
|
||||
if(!IsGuestKey(user.key))
|
||||
open_load_dialog(user)
|
||||
return 1
|
||||
|
||||
if("changeslot")
|
||||
load_and_update_character(text2num(href_list["num"]))
|
||||
close_load_dialog(user)
|
||||
|
||||
ShowChoices(user)
|
||||
ShowChoices(usr)
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/copy_to(mob/living/carbon/human/character, safety = 0)
|
||||
@@ -364,10 +368,9 @@ datum/preferences
|
||||
if(!name) name = "Character[i]"
|
||||
if(i==default_slot)
|
||||
name = "<b>[name]</b>"
|
||||
dat += "<a href='?_src_=prefs;preference=changeslot;num=[i];'>[name]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];changeslot=[i]'>[name]</a><br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<a href='byond://?src=\ref[user];preference=close_load_dialog'>Close</a><br>"
|
||||
dat += "</center></tt>"
|
||||
user << browse(dat, "window=saves;size=300x390")
|
||||
|
||||
|
||||
@@ -144,8 +144,8 @@
|
||||
suit_overlay_active = "mounted-taser"
|
||||
suit_overlay_inactive = "mounted-taser"
|
||||
|
||||
interface_name = "mounted energy gun"
|
||||
interface_desc = "A shoulder-mounted cell-powered energy gun."
|
||||
interface_name = "mounted taser"
|
||||
interface_desc = "A shoulder-mounted cell-powered taser."
|
||||
|
||||
gun_type = /obj/item/weapon/gun/energy/taser/mounted
|
||||
|
||||
|
||||
@@ -103,64 +103,34 @@ var/list/slot_equipment_priority = list( \
|
||||
|
||||
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||
/mob/proc/put_in_l_hand(var/obj/item/W)
|
||||
if(lying) return 0
|
||||
if(!istype(W)) return 0
|
||||
if(!l_hand)
|
||||
W.forceMove(src) //TODO: move to equipped?
|
||||
l_hand = W
|
||||
W.layer = 20 //TODO: move to equipped?
|
||||
// l_hand.screen_loc = ui_lhand
|
||||
W.equipped(src,slot_l_hand)
|
||||
if(client) client.screen |= W
|
||||
if(pulling == W) stop_pulling()
|
||||
update_inv_l_hand()
|
||||
return 1
|
||||
return 0
|
||||
if(lying || !istype(W))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
//Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||
/mob/proc/put_in_r_hand(var/obj/item/W)
|
||||
if(lying) return 0
|
||||
if(!istype(W)) return 0
|
||||
if(!r_hand)
|
||||
W.forceMove(src)
|
||||
r_hand = W
|
||||
W.layer = 20
|
||||
// r_hand.screen_loc = ui_rhand
|
||||
W.equipped(src,slot_r_hand)
|
||||
if(client) client.screen |= W
|
||||
if(pulling == W) stop_pulling()
|
||||
update_inv_r_hand()
|
||||
return 1
|
||||
return 0
|
||||
if(lying || !istype(W))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
//Puts the item into our active hand if possible. returns 1 on success.
|
||||
/mob/proc/put_in_active_hand(var/obj/item/W)
|
||||
if(hand) return put_in_l_hand(W)
|
||||
else return put_in_r_hand(W)
|
||||
return 0 // Moved to human procs because only they need to use hands.
|
||||
|
||||
//Puts the item into our inactive hand if possible. returns 1 on success.
|
||||
/mob/proc/put_in_inactive_hand(var/obj/item/W)
|
||||
if(hand) return put_in_r_hand(W)
|
||||
else return put_in_l_hand(W)
|
||||
return 0 // As above.
|
||||
|
||||
//Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success.
|
||||
//If both fail it drops it on the floor and returns 0.
|
||||
//This is probably the main one you need to know :)
|
||||
/mob/proc/put_in_hands(var/obj/item/W)
|
||||
if(!W) return 0
|
||||
if(put_in_active_hand(W))
|
||||
update_inv_l_hand()
|
||||
update_inv_r_hand()
|
||||
return 1
|
||||
else if(put_in_inactive_hand(W))
|
||||
update_inv_l_hand()
|
||||
update_inv_r_hand()
|
||||
return 1
|
||||
else
|
||||
W.forceMove(get_turf(src))
|
||||
W.layer = initial(W.layer)
|
||||
W.dropped()
|
||||
if(!W)
|
||||
return 0
|
||||
W.forceMove(get_turf(src))
|
||||
W.layer = initial(W.layer)
|
||||
W.dropped()
|
||||
return 0
|
||||
|
||||
// Removes an item from inventory and places it in the target atom.
|
||||
// If canremove or other conditions need to be checked then use unEquip instead.
|
||||
|
||||
@@ -107,12 +107,9 @@
|
||||
space_chance = 10
|
||||
|
||||
/datum/language/machine/get_random_name()
|
||||
var/new_name
|
||||
if(prob(70))
|
||||
new_name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
|
||||
else
|
||||
new_name = pick(ai_names)
|
||||
return new_name
|
||||
return "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
|
||||
return pick(ai_names)
|
||||
|
||||
/datum/language/resomi
|
||||
name = "Resomi"
|
||||
|
||||
@@ -83,7 +83,11 @@
|
||||
break
|
||||
. += copytext(message, 1, min_index)
|
||||
if(copytext(message, min_index, min_index+1) == uppertext(min_char))
|
||||
. += capitalize(pick(map[min_char]))
|
||||
switch(text2ascii(message, min_index+1))
|
||||
if(65 to 90) // A-Z, uppercase; uppercase R/S followed by another uppercase letter, uppercase the entire replacement string
|
||||
. += uppertext(pick(map[min_char]))
|
||||
else
|
||||
. += capitalize(pick(map[min_char]))
|
||||
else
|
||||
. += pick(map[min_char])
|
||||
message = copytext(message, min_index + 1)
|
||||
|
||||
@@ -1,53 +1,41 @@
|
||||
mob/living/carbon/verb/give(var/mob/living/carbon/target in view(1)-usr)
|
||||
/mob/living/carbon/human/verb/give(var/mob/living/target in view(1)-usr)
|
||||
set category = "IC"
|
||||
set name = "Give"
|
||||
if(!istype(target) || target.stat == 2 || usr.stat == 2|| target.client == null)
|
||||
|
||||
if(incapacitated())
|
||||
return
|
||||
var/obj/item/I
|
||||
if(!usr.hand && usr.r_hand == null)
|
||||
usr << "<span class='warning'>You don't have anything in your right hand to give to [target.name]</span>"
|
||||
if(!istype(target) || target.stat || target.lying || target.resting || target.buckled || target.client == null)
|
||||
return
|
||||
if(usr.hand && usr.l_hand == null)
|
||||
usr << "<span class='warning'>You don't have anything in your left hand to give to [target.name]</span>"
|
||||
return
|
||||
if(usr.hand)
|
||||
I = usr.l_hand
|
||||
else if(!usr.hand)
|
||||
I = usr.r_hand
|
||||
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if(!I)
|
||||
I = usr.get_inactive_hand()
|
||||
if(!I)
|
||||
usr << "<span class='warning'>You don't have anything in your hands to give to \the [target].</span>"
|
||||
return
|
||||
if(target.r_hand == null || target.l_hand == null)
|
||||
switch(alert(target,"[usr] wants to give you \a [I]?",,"Yes","No"))
|
||||
if("Yes")
|
||||
if(!I)
|
||||
return
|
||||
if(!Adjacent(usr))
|
||||
usr << "<span class='warning'>You need to stay in reaching distance while giving an object.</span>"
|
||||
target << "<span class='warning'>[usr.name] moved too far away.</span>"
|
||||
return
|
||||
if((usr.hand && usr.l_hand != I) || (!usr.hand && usr.r_hand != I))
|
||||
usr << "<span class='warning'>You need to keep the item in your active hand.</span>"
|
||||
target << "<span class='warning'>[usr.name] seem to have given up on giving \the [I.name] to you.</span>"
|
||||
return
|
||||
if(target.r_hand != null && target.l_hand != null)
|
||||
target << "<span class='warning'>Your hands are full.</span>"
|
||||
usr << "<span class='warning'>Their hands are full.</span>"
|
||||
return
|
||||
else
|
||||
usr.drop_item()
|
||||
if(target.r_hand == null)
|
||||
target.r_hand = I
|
||||
else
|
||||
target.l_hand = I
|
||||
I.loc = target
|
||||
I.layer = 20
|
||||
I.add_fingerprint(target)
|
||||
target.update_inv_l_hand()
|
||||
target.update_inv_r_hand()
|
||||
usr.update_inv_l_hand()
|
||||
usr.update_inv_r_hand()
|
||||
target.visible_message("<span class='notice'>[usr.name] handed \the [I.name] to [target.name].</span>")
|
||||
if("No")
|
||||
target.visible_message("<span class='warning'>[usr.name] tried to hand [I.name] to [target.name] but [target.name] didn't want it.</span>")
|
||||
else
|
||||
usr << "<span class='warning'>[target.name]'s hands are full.</span>"
|
||||
|
||||
if(alert(target,"[usr] wants to give you \a [I]. Will you accept it?",,"No","Yes") == "No")
|
||||
target.visible_message("<span class='notice'>\The [usr] tried to hand \the [I] to \the [target], \
|
||||
but \the [target] didn't want it.</span>")
|
||||
return
|
||||
|
||||
if(!I) return
|
||||
|
||||
if(!Adjacent(target))
|
||||
usr << "<span class='warning'>You need to stay in reaching distance while giving an object.</span>"
|
||||
target << "<span class='warning'>\The [usr] moved too far away.</span>"
|
||||
return
|
||||
|
||||
if(I.loc != usr || (usr.l_hand != I && usr.r_hand != I))
|
||||
usr << "<span class='warning'>You need to keep the item in your hands.</span>"
|
||||
target << "<span class='warning'>\The [usr] seems to have given up on passing \the [I] to you.</span>"
|
||||
return
|
||||
|
||||
if(target.r_hand != null && target.l_hand != null)
|
||||
target << "<span class='warning'>Your hands are full.</span>"
|
||||
usr << "<span class='warning'>Their hands are full.</span>"
|
||||
return
|
||||
|
||||
if(usr.unEquip(I))
|
||||
target.put_in_hands(I) // If this fails it will just end up on the floor, but that's fitting for things like dionaea.
|
||||
target.visible_message("<span class='notice'>\The [usr] handed \the [I] to \the [target].</span>")
|
||||
|
||||
@@ -1389,6 +1389,48 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
//Puts the item into our active hand if possible. returns 1 on success.
|
||||
/mob/living/carbon/human/put_in_active_hand(var/obj/item/W)
|
||||
return (hand ? put_in_l_hand(W) : put_in_r_hand(W))
|
||||
|
||||
//Puts the item into our inactive hand if possible. returns 1 on success.
|
||||
/mob/living/carbon/human/put_in_inactive_hand(var/obj/item/W)
|
||||
return (hand ? put_in_r_hand(W) : put_in_l_hand(W))
|
||||
|
||||
/mob/living/carbon/human/put_in_hands(var/obj/item/W)
|
||||
if(!W)
|
||||
return 0
|
||||
if(put_in_active_hand(W))
|
||||
update_inv_l_hand()
|
||||
update_inv_r_hand()
|
||||
return 1
|
||||
else if(put_in_inactive_hand(W))
|
||||
update_inv_l_hand()
|
||||
update_inv_r_hand()
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/put_in_l_hand(var/obj/item/W)
|
||||
if(!..() || l_hand)
|
||||
return 0
|
||||
W.forceMove(src)
|
||||
l_hand = W
|
||||
W.equipped(src,slot_l_hand)
|
||||
W.add_fingerprint(src)
|
||||
update_inv_l_hand()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/put_in_r_hand(var/obj/item/W)
|
||||
if(!..() || r_hand)
|
||||
return 0
|
||||
W.forceMove(src)
|
||||
r_hand = W
|
||||
W.equipped(src,slot_r_hand)
|
||||
W.add_fingerprint(src)
|
||||
update_inv_r_hand()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/verb/pull_punches()
|
||||
set name = "Pull Punches"
|
||||
set desc = "Try not to hurt them."
|
||||
@@ -1398,3 +1440,4 @@
|
||||
pulling_punches = !pulling_punches
|
||||
src << "<span class='notice'>You are now [pulling_punches ? "pulling your punches" : "not pulling your punches"].</span>"
|
||||
return
|
||||
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
/*
|
||||
Add fingerprints to items when we put them in our hands.
|
||||
This saves us from having to call add_fingerprint() any time something is put in a human's hands programmatically.
|
||||
|
||||
*/
|
||||
/mob/living/carbon/human/put_in_l_hand(var/obj/item/W)
|
||||
. = ..()
|
||||
if(.) W.add_fingerprint(src)
|
||||
|
||||
/mob/living/carbon/human/put_in_r_hand(var/obj/item/W)
|
||||
. = ..()
|
||||
if(.) W.add_fingerprint(src)
|
||||
|
||||
/mob/living/carbon/human/verb/quick_equip()
|
||||
set name = "quick-equip"
|
||||
|
||||
@@ -173,11 +173,6 @@
|
||||
for(var/u_type in unarmed_types)
|
||||
unarmed_attacks += new u_type()
|
||||
|
||||
if(gluttonous)
|
||||
if(!inherent_verbs)
|
||||
inherent_verbs = list()
|
||||
inherent_verbs |= /mob/living/carbon/human/proc/regurgitate
|
||||
|
||||
/datum/species/proc/get_station_variant()
|
||||
return name
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
halloss_message_self = "ERROR: Unrecoverable machine check exception.<BR>System halted, rebooting..."
|
||||
|
||||
warning_low_pressure = 50
|
||||
hazard_low_pressure = 0
|
||||
hazard_low_pressure = -1
|
||||
|
||||
cold_level_1 = 50
|
||||
cold_level_2 = -1
|
||||
@@ -316,11 +316,18 @@
|
||||
"r_foot" = list("path" = /obj/item/organ/external/foot/right/ipc)
|
||||
)
|
||||
|
||||
|
||||
heat_discomfort_level = 373.15
|
||||
heat_discomfort_strings = list(
|
||||
"Your CPU temperature probes warn you that you are approaching critical heat levels!"
|
||||
)
|
||||
|
||||
/datum/species/machine/handle_death(var/mob/living/carbon/human/H)
|
||||
..()
|
||||
H.h_style = ""
|
||||
spawn(100)
|
||||
if(H) H.update_hair()
|
||||
|
||||
/datum/species/machine/sanitize_name(var/name)
|
||||
return sanitizeName(name, allow_numbers = 1)
|
||||
/datum/species/machine/sanitize_name(var/new_name)
|
||||
return sanitizeName(new_name, allow_numbers = 1)
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/equipped(mob/M)
|
||||
..()
|
||||
Attach(M)
|
||||
|
||||
/obj/item/clothing/mask/facehugger/Crossed(atom/target)
|
||||
|
||||
@@ -98,6 +98,9 @@ default behaviour is:
|
||||
if(!can_move_mob(tmob, 0, 0))
|
||||
now_pushing = 0
|
||||
return
|
||||
if(a_intent == I_HELP || src.restrained())
|
||||
now_pushing = 0
|
||||
return
|
||||
if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations))
|
||||
if(prob(40) && !(FAT in src.mutations))
|
||||
src << "<span class='danger'>You fail to push [tmob]'s fat ass out of the way.</span>"
|
||||
|
||||
@@ -162,7 +162,8 @@ var/global/list/robot_modules = list(
|
||||
sprites = list( "Basic" = "robot_old",
|
||||
"Android" = "droid",
|
||||
"Default" = "robot",
|
||||
"Drone" = "drone-standard"
|
||||
"Drone" = "drone-standard",
|
||||
"Eyebot" = "eyebot-standard"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/standard/New()
|
||||
@@ -189,7 +190,8 @@ var/global/list/robot_modules = list(
|
||||
"Standard" = "surgeon",
|
||||
"Advanced Droid" = "droid-medical",
|
||||
"Needles" = "medicalrobot",
|
||||
"Drone" = "drone-surgery"
|
||||
"Drone" = "drone-surgery",
|
||||
"Eyebot" = "eyebot-medical"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/medical/surgeon/New()
|
||||
@@ -240,7 +242,8 @@ var/global/list/robot_modules = list(
|
||||
"Advanced Droid" = "droid-medical",
|
||||
"Needles" = "medicalrobot",
|
||||
"Drone - Medical" = "drone-medical",
|
||||
"Drone - Chemistry" = "drone-chemistry"
|
||||
"Drone - Chemistry" = "drone-chemistry",
|
||||
"Eyebot" = "eyebot-medical"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/medical/crisis/New()
|
||||
@@ -304,7 +307,8 @@ var/global/list/robot_modules = list(
|
||||
"Antique" = "engineerrobot",
|
||||
"Landmate" = "landmate",
|
||||
"Landmate - Treaded" = "engiborg+tread",
|
||||
"Drone" = "drone-engineer"
|
||||
"Drone" = "drone-engineer",
|
||||
"Eyebot" = "eyebot-engineering"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/engineering/construction
|
||||
@@ -417,7 +421,8 @@ var/global/list/robot_modules = list(
|
||||
"Black Knight" = "securityrobot",
|
||||
"Bloodhound" = "bloodhound",
|
||||
"Bloodhound - Treaded" = "secborg+tread",
|
||||
"Drone" = "drone-sec"
|
||||
"Drone" = "drone-sec",
|
||||
"Eyebot" = "eyebot-security"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/security/general/New()
|
||||
@@ -449,7 +454,8 @@ var/global/list/robot_modules = list(
|
||||
"Basic" = "JanBot2",
|
||||
"Mopbot" = "janitorrobot",
|
||||
"Mop Gear Rex" = "mopgearrex",
|
||||
"Drone" = "drone-janitor"
|
||||
"Drone" = "drone-janitor",
|
||||
"Eyebot" = "eyebot-janitor"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/janitor/New()
|
||||
@@ -492,7 +498,8 @@ var/global/list/robot_modules = list(
|
||||
"Rich" = "maximillion",
|
||||
"Default" = "Service2",
|
||||
"Drone - Service" = "drone-service",
|
||||
"Drone - Hydro" = "drone-hydro"
|
||||
"Drone - Hydro" = "drone-hydro",
|
||||
"Eyebot" = "eyebot-standard"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/clerical/butler/New()
|
||||
@@ -534,7 +541,8 @@ var/global/list/robot_modules = list(
|
||||
"Bro" = "Brobot",
|
||||
"Rich" = "maximillion",
|
||||
"Default" = "Service2",
|
||||
"Drone" = "drone-service"
|
||||
"Drone" = "drone-service",
|
||||
"Eyebot" = "eyebot-standard"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/clerical/general/New()
|
||||
@@ -562,7 +570,8 @@ var/global/list/robot_modules = list(
|
||||
"Basic" = "Miner_old",
|
||||
"Advanced Droid" = "droid-miner",
|
||||
"Treadhead" = "Miner",
|
||||
"Drone" = "drone-miner"
|
||||
"Drone" = "drone-miner",
|
||||
"Eyebot" = "eyebot-miner"
|
||||
)
|
||||
supported_upgrades = list(/obj/item/borg/upgrade/jetpack)
|
||||
|
||||
@@ -585,7 +594,8 @@ var/global/list/robot_modules = list(
|
||||
channels = list("Science" = 1)
|
||||
sprites = list(
|
||||
"Droid" = "droid-science",
|
||||
"Drone" = "drone-science"
|
||||
"Drone" = "drone-science",
|
||||
"Eyebot" = "eyebot-science"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/research/New()
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
// Allows us to process UI clicks, which are relayed in form of hrefs.
|
||||
/datum/nano_module/power_monitor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
return 1
|
||||
if( href_list["clear"] )
|
||||
active_sensor = null
|
||||
if( href_list["refresh"] )
|
||||
|
||||
@@ -140,6 +140,7 @@ nanoui is used to open and update nano browser uis
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/update_status(var/push_update = 0)
|
||||
src_object = src_object.nano_host()
|
||||
var/new_status = src_object.CanUseTopic(user, state)
|
||||
if(master_ui)
|
||||
new_status = min(new_status, master_ui.status)
|
||||
|
||||
@@ -498,8 +498,6 @@
|
||||
user << "<span class='warning'>There is nothing to secure.</span>"
|
||||
return
|
||||
update_icon()
|
||||
else if(emagged)
|
||||
user << "The interface is broken."
|
||||
else
|
||||
wiresexposed = !wiresexposed
|
||||
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
|
||||
@@ -628,8 +626,9 @@
|
||||
qdel(W)
|
||||
stat &= ~BROKEN
|
||||
// Malf AI, removes the APC from AI's hacked APCs list.
|
||||
if(hacker && hacker.hacked_apcs && src in hacker.hacked_apcs)
|
||||
if(hacker && hacker.hacked_apcs && (src in hacker.hacked_apcs))
|
||||
hacker.hacked_apcs -= src
|
||||
hacker = null
|
||||
if (opened==2)
|
||||
opened = 1
|
||||
update_icon()
|
||||
@@ -740,7 +739,7 @@
|
||||
return
|
||||
|
||||
var/list/data = list(
|
||||
"locked" = locked,
|
||||
"locked" = (locked && !emagged) ? 1 : 0,
|
||||
"isOperating" = operating,
|
||||
"externalPower" = main_status,
|
||||
"powerCellStatus" = cell ? cell.percent() : null,
|
||||
@@ -854,7 +853,7 @@
|
||||
user << "<span class='danger'>\The [src] have AI control disabled!</span>"
|
||||
return 0
|
||||
else
|
||||
if ((!in_range(src, user) || !istype(src.loc, /turf) || hacker)) // AI-hacked APCs cannot be controlled by other AIs, unlinked cyborgs or humans.
|
||||
if (!in_range(src, user) || !istype(src.loc, /turf))
|
||||
return 0
|
||||
var/mob/living/carbon/human/H = user
|
||||
if (istype(H))
|
||||
@@ -873,7 +872,7 @@
|
||||
if(!can_use(usr, 1))
|
||||
return 1
|
||||
|
||||
if(!istype(usr, /mob/living/silicon) && locked)
|
||||
if(!istype(usr, /mob/living/silicon) && (locked && !emagged))
|
||||
// Shouldn't happen, this is here to prevent href exploits
|
||||
usr << "You must unlock the panel to use this!"
|
||||
return 1
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
if(propname == "mode_name")
|
||||
name = propvalue
|
||||
if(isnull(propvalue))
|
||||
else if(isnull(propvalue))
|
||||
settings[propname] = gun.vars[propname] //better than initial() as it handles list vars like burst_accuracy
|
||||
else
|
||||
settings[propname] = propvalue
|
||||
@@ -261,7 +261,7 @@
|
||||
for(var/obj/item/weapon/grab/G in M.grabbed_by)
|
||||
grabstate = max(grabstate, G.state)
|
||||
if(grabstate >= GRAB_NECK)
|
||||
damage_mult = 3.0
|
||||
damage_mult = 2.5
|
||||
else if(grabstate >= GRAB_AGGRESSIVE)
|
||||
damage_mult = 1.5
|
||||
P.damage *= damage_mult
|
||||
@@ -332,6 +332,7 @@
|
||||
|
||||
in_chamber.on_hit(M)
|
||||
if (in_chamber.damage_type != HALLOSS)
|
||||
log_and_message_admins("[key_name(user)] commited suicide using \a [src]")
|
||||
user.apply_damage(in_chamber.damage*2.5, in_chamber.damage_type, "head", used_weapon = "Point blank shot in the mouth with \a [in_chamber]", sharp=1)
|
||||
user.death()
|
||||
else
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
var/charge_tick = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/switch_firemodes()
|
||||
if(..())
|
||||
. = ..()
|
||||
if(.)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/emp_act(severity)
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
/obj/item/weapon/gun/projectile/attack_self(mob/user as mob)
|
||||
if(firemodes.len > 1)
|
||||
switch_firemodes(user)
|
||||
..()
|
||||
else
|
||||
unload_ammo(user)
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
return splash_mob(target, amount, copy)
|
||||
if(isturf(target))
|
||||
return trans_to_turf(target, amount, multiplier, copy)
|
||||
if(isobj(target))
|
||||
if(isobj(target) && target.is_open_container())
|
||||
return trans_to_obj(target, amount, multiplier, copy)
|
||||
return 0
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
var/obj/machinery/artifact/A = scanned_object
|
||||
A.anchored = 0
|
||||
A.being_used = 0
|
||||
scanned_object = null
|
||||
|
||||
/obj/machinery/artifact_analyser/Topic(href, href_list)
|
||||
if(href_list["begin_scan"])
|
||||
@@ -97,8 +98,8 @@
|
||||
continue
|
||||
if(O.invisibility)
|
||||
continue
|
||||
if(istype(scanned_object, /obj/machinery/artifact))
|
||||
var/obj/machinery/artifact/A = scanned_object
|
||||
if(istype(O, /obj/machinery/artifact))
|
||||
var/obj/machinery/artifact/A = O
|
||||
if(A.being_used)
|
||||
artifact_in_use = 1
|
||||
else
|
||||
|
||||
1
code/modules/surgery/_defines.dm
Normal file
1
code/modules/surgery/_defines.dm
Normal file
@@ -0,0 +1 @@
|
||||
#define SURGERY_FAILURE -1
|
||||
@@ -72,8 +72,8 @@
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
if(I.robotic < 2)
|
||||
user.visible_message("\blue [user] treats damage to [target]'s [I.name] with [tool_name].", \
|
||||
"\blue You treat damage to [target]'s [I.name] with [tool_name]." )
|
||||
user.visible_message("<span class='notice'>[user] treats damage to [target]'s [I.name] with [tool_name].</span>", \
|
||||
"<span class='notice'>You treat damage to [target]'s [I.name] with [tool_name].</span>" )
|
||||
I.damage = 0
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
@@ -82,8 +82,8 @@
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!", \
|
||||
"\red Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!</span>")
|
||||
var/dam_amt = 2
|
||||
|
||||
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
|
||||
@@ -145,8 +145,8 @@
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\blue [user] has separated [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have separated [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
user.visible_message("<span class='notice'>[user] has separated [target]'s [target.op_stage.current_organ] with \the [tool].</span>" , \
|
||||
"<span class='notice'>You have separated [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
@@ -154,8 +154,8 @@
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \
|
||||
"\red Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>")
|
||||
affected.createwound(CUT, rand(30,50), 1)
|
||||
|
||||
/datum/surgery_step/internal/remove_organ
|
||||
@@ -196,8 +196,8 @@
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\blue [user] has removed [target]'s [target.op_stage.current_organ] with \the [tool].", \
|
||||
"\blue You have removed [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
user.visible_message("<span class='notice'>[user] has removed [target]'s [target.op_stage.current_organ] with \the [tool].</span>", \
|
||||
"<span class='notice'>You have removed [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
|
||||
// Extract the organ!
|
||||
if(target.op_stage.current_organ)
|
||||
@@ -208,8 +208,8 @@
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!", \
|
||||
"\red Your hand slips, damaging [target]'s [affected.name] with \the [tool]!")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging [target]'s [affected.name] with \the [tool]!</span>")
|
||||
affected.createwound(BRUISE, 20)
|
||||
|
||||
/datum/surgery_step/internal/replace_organ
|
||||
@@ -233,11 +233,11 @@
|
||||
|
||||
if((affected.status & ORGAN_ROBOT) && !(O.status & ORGAN_ROBOT))
|
||||
user << "<span class='danger'>You cannot install a naked organ into a robotic body.</span>"
|
||||
return 2
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.species)
|
||||
user << "\red You have no idea what species this person is. Report this on the bug tracker."
|
||||
return 2
|
||||
user << "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
var/o_is = (O.gender == PLURAL) ? "are" : "is"
|
||||
var/o_a = (O.gender == PLURAL) ? "" : "a "
|
||||
@@ -248,23 +248,23 @@
|
||||
else if(target.species.has_organ[O.organ_tag])
|
||||
|
||||
if(O.damage > (O.max_damage * 0.75))
|
||||
user << "\red \The [O.organ_tag] [o_is] in no state to be transplanted."
|
||||
return 2
|
||||
user << "<span class='warning'>\The [O.organ_tag] [o_is] in no state to be transplanted.</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.internal_organs_by_name[O.organ_tag])
|
||||
organ_missing = 1
|
||||
else
|
||||
user << "\red \The [target] already has [o_a][O.organ_tag]."
|
||||
return 2
|
||||
user << "<span class='warning'>\The [target] already has [o_a][O.organ_tag].</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(O && affected.limb_name == O.parent_organ)
|
||||
organ_compatible = 1
|
||||
else
|
||||
user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.name]."
|
||||
return 2
|
||||
user << "<span class='warning'>\The [O.organ_tag] [o_do] normally go in \the [affected.name].</span>"
|
||||
return SURGERY_FAILURE
|
||||
else
|
||||
user << "\red You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag]."
|
||||
return 2
|
||||
user << "<span class='warning'>You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag].</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
return ..() && organ_missing && organ_compatible
|
||||
|
||||
@@ -277,16 +277,16 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] has transplanted \the [tool] into [target]'s [affected.name].", \
|
||||
"\blue You have transplanted \the [tool] into [target]'s [affected.name].")
|
||||
user.visible_message("<span class='notice'>[user] has transplanted \the [tool] into [target]'s [affected.name].</span>", \
|
||||
"<span class='notice'>You have transplanted \the [tool] into [target]'s [affected.name].</span>")
|
||||
var/obj/item/organ/O = tool
|
||||
if(istype(O))
|
||||
user.remove_from_mob(O)
|
||||
O.replaced(target,affected)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\red [user]'s hand slips, damaging \the [tool]!", \
|
||||
"\red Your hand slips, damaging \the [tool]!")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging \the [tool]!</span>")
|
||||
var/obj/item/organ/I = tool
|
||||
if(istype(I))
|
||||
I.take_damage(rand(3,5),0)
|
||||
@@ -327,8 +327,8 @@
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
user.visible_message("<span class='notice'>[user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool].</span>" , \
|
||||
"<span class='notice'>You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
@@ -336,8 +336,8 @@
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!", \
|
||||
"\red Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!</span>")
|
||||
affected.createwound(BRUISE, 20)
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -44,14 +44,14 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] has opened the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
|
||||
"\blue You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool].",)
|
||||
user.visible_message("<span class='notice'>[user] has opened the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>",)
|
||||
affected.open = 1
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s [tool.name] slips, failing to unscrew [target]'s [affected.name].", \
|
||||
"\red Your [tool] slips, failing to unscrew [target]'s [affected.name].")
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, failing to unscrew [target]'s [affected.name].</span>", \
|
||||
"<span class='warning'>Your [tool] slips, failing to unscrew [target]'s [affected.name].</span>")
|
||||
|
||||
/datum/surgery_step/robotics/open_hatch
|
||||
allowed_tools = list(
|
||||
@@ -76,14 +76,14 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] opens the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
|
||||
"\blue You open the maintenance hatch on [target]'s [affected.name] with \the [tool]." )
|
||||
user.visible_message("<span class='notice'>[user] opens the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You open the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.open = 2
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s [tool.name] slips, failing to open the hatch on [target]'s [affected.name].",
|
||||
"\red Your [tool] slips, failing to open the hatch on [target]'s [affected.name].")
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, failing to open the hatch on [target]'s [affected.name].</span>",
|
||||
"<span class='warning'>Your [tool] slips, failing to open the hatch on [target]'s [affected.name].</span>")
|
||||
|
||||
/datum/surgery_step/robotics/close_hatch
|
||||
allowed_tools = list(
|
||||
@@ -108,15 +108,15 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] closes and secures the hatch on [target]'s [affected.name] with \the [tool].", \
|
||||
"\blue You close and secure the hatch on [target]'s [affected.name] with \the [tool].")
|
||||
user.visible_message("<span class='notice'>[user] closes and secures the hatch on [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You close and secure the hatch on [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.open = 0
|
||||
affected.germ_level = 0
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s [tool.name] slips, failing to close the hatch on [target]'s [affected.name].",
|
||||
"\red Your [tool.name] slips, failing to close the hatch on [target]'s [affected.name].")
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, failing to close the hatch on [target]'s [affected.name].</span>",
|
||||
"<span class='warning'>Your [tool.name] slips, failing to close the hatch on [target]'s [affected.name].</span>")
|
||||
|
||||
/datum/surgery_step/robotics/repair_brute
|
||||
allowed_tools = list(
|
||||
@@ -144,14 +144,14 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] finishes patching damage to [target]'s [affected.name] with \the [tool].", \
|
||||
"\blue You finish patching damage to [target]'s [affected.name] with \the [tool].")
|
||||
user.visible_message("<span class='notice'>[user] finishes patching damage to [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You finish patching damage to [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.heal_damage(rand(30,50),0,1,1)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s [tool.name] slips, damaging the internal structure of [target]'s [affected.name].",
|
||||
"\red Your [tool.name] slips, damaging the internal structure of [target]'s [affected.name].")
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, damaging the internal structure of [target]'s [affected.name].</span>",
|
||||
"<span class='warning'>Your [tool.name] slips, damaging the internal structure of [target]'s [affected.name].</span>")
|
||||
target.apply_damage(rand(5,10), BURN, affected)
|
||||
|
||||
/datum/surgery_step/robotics/repair_burn
|
||||
@@ -171,7 +171,7 @@
|
||||
if(istype(C))
|
||||
if(!C.get_amount() >= 3)
|
||||
user << "<span class='danger'>You need three or more cable pieces to repair this damage.</span>"
|
||||
return 2
|
||||
return SURGERY_FAILURE
|
||||
C.use(3)
|
||||
return 1
|
||||
return 0
|
||||
@@ -184,14 +184,14 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] finishes splicing cable into [target]'s [affected.name].", \
|
||||
"\blue You finishes splicing new cable into [target]'s [affected.name].")
|
||||
user.visible_message("<span class='notice'>[user] finishes splicing cable into [target]'s [affected.name].</span>", \
|
||||
"<span class='notice'>You finishes splicing new cable into [target]'s [affected.name].</span>")
|
||||
affected.heal_damage(0,rand(30,50),1,1)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user] causes a short circuit in [target]'s [affected.name]!",
|
||||
"\red You cause a short circuit in [target]'s [affected.name]!")
|
||||
user.visible_message("<span class='warning'>[user] causes a short circuit in [target]'s [affected.name]!</span>",
|
||||
"<span class='warning'>You cause a short circuit in [target]'s [affected.name]!</span>")
|
||||
target.apply_damage(rand(5,10), BURN, affected)
|
||||
|
||||
/datum/surgery_step/robotics/fix_organ_robotic //For artificial organs
|
||||
@@ -242,8 +242,8 @@
|
||||
|
||||
if(I && I.damage > 0)
|
||||
if(I.robotic >= 2)
|
||||
user.visible_message("\blue [user] repairs [target]'s [I.name] with [tool].", \
|
||||
"\blue You repair [target]'s [I.name] with [tool]." )
|
||||
user.visible_message("<span class='notice'>[user] repairs [target]'s [I.name] with [tool].</span>", \
|
||||
"<span class='notice'>You repair [target]'s [I.name] with [tool].</span>" )
|
||||
I.damage = 0
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
@@ -252,8 +252,8 @@
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("\red [user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!", \
|
||||
"\red Your hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!</span>")
|
||||
|
||||
target.adjustToxLoss(5)
|
||||
affected.createwound(CUT, 5)
|
||||
@@ -301,16 +301,16 @@
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\blue [user] has decoupled [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have decoupled [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
user.visible_message("<span class='notice'>[user] has decoupled [target]'s [target.op_stage.current_organ] with \the [tool].</span>" , \
|
||||
"<span class='notice'>You have decoupled [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status |= ORGAN_CUT_AWAY
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\red [user]'s hand slips, disconnecting \the [tool].", \
|
||||
"\red Your hand slips, disconnecting \the [tool].")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, disconnecting \the [tool].</span>", \
|
||||
"<span class='warning'>Your hand slips, disconnecting \the [tool].</span>")
|
||||
|
||||
/datum/surgery_step/robotics/attach_organ_robotic
|
||||
allowed_tools = list(
|
||||
@@ -349,16 +349,16 @@
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
user.visible_message("<span class='notice'>[user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool].</span>" , \
|
||||
"<span class='notice'>You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status &= ~ORGAN_CUT_AWAY
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\red [user]'s hand slips, disconnecting \the [tool].", \
|
||||
"\red Your hand slips, disconnecting \the [tool].")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, disconnecting \the [tool].</span>", \
|
||||
"<span class='warning'>Your hand slips, disconnecting \the [tool].</span>")
|
||||
|
||||
/datum/surgery_step/robotics/install_mmi
|
||||
allowed_tools = list(
|
||||
@@ -383,23 +383,23 @@
|
||||
|
||||
if(!M.brainmob || !M.brainmob.client || !M.brainmob.ckey || M.brainmob.stat >= DEAD)
|
||||
user << "<span class='danger'>That brain is not usable.</span>"
|
||||
return 2
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!(affected.status & ORGAN_ROBOT))
|
||||
user << "<span class='danger'>You cannot install a computer brain into a meat skull.</span>"
|
||||
return 2
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.species)
|
||||
user << "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>"
|
||||
return 2
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.species.has_organ["brain"])
|
||||
user << "<span class='danger'>You're pretty sure [target.species.name_plural] don't normally have a brain.</span>"
|
||||
return 2
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!isnull(target.internal_organs["brain"]))
|
||||
user << "<span class='danger'>Your subject already has a brain.</span>"
|
||||
return 2
|
||||
return SURGERY_FAILURE
|
||||
|
||||
return 1
|
||||
|
||||
@@ -411,8 +411,8 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] has installed \the [tool] into [target]'s [affected.name].", \
|
||||
"\blue You have installed \the [tool] into [target]'s [affected.name].")
|
||||
user.visible_message("<span class='notice'>[user] has installed \the [tool] into [target]'s [affected.name].</span>", \
|
||||
"<span class='notice'>You have installed \the [tool] into [target]'s [affected.name].</span>")
|
||||
|
||||
var/obj/item/device/mmi/M = tool
|
||||
var/obj/item/organ/mmi_holder/holder = new(target, 1)
|
||||
@@ -426,5 +426,5 @@
|
||||
M.brainmob.mind.transfer_to(target)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\red [user]'s hand slips.", \
|
||||
"\red Your hand slips.")
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips.</span>", \
|
||||
"<span class='warning'>Your hand slips.</span>")
|
||||
@@ -84,14 +84,14 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
|
||||
return 0
|
||||
var/zone = user.zone_sel.selecting
|
||||
if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly.
|
||||
user << "\red You can't operate on this area while surgery is already in progress."
|
||||
user << "<span class='warning'>You can't operate on this area while surgery is already in progress.</span>"
|
||||
return 1
|
||||
for(var/datum/surgery_step/S in surgery_steps)
|
||||
//check if tool is right or close enough and if this step is possible
|
||||
if(S.tool_quality(tool))
|
||||
var/step_is_valid = S.can_use(user, M, zone, tool)
|
||||
if(step_is_valid && S.is_valid_target(M))
|
||||
if(step_is_valid == 2) // This is a failure that already has a message for failing.
|
||||
if(step_is_valid == SURGERY_FAILURE) // This is a failure that already has a message for failing.
|
||||
return 1
|
||||
M.op_stage.in_progress += zone
|
||||
S.begin_step(user, M, zone, tool) //start on it
|
||||
@@ -101,7 +101,7 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
|
||||
else if ((tool in user.contents) && user.Adjacent(M)) //or
|
||||
S.fail_step(user, M, zone, tool) //malpractice~
|
||||
else // This failing silently was a pain.
|
||||
user << "\red You must remain close to your patient to conduct surgery."
|
||||
user << "<span class='warning'>You must remain close to your patient to conduct surgery.</span>"
|
||||
M.op_stage.in_progress -= zone // Clear the in-progress flag.
|
||||
if (ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
@@ -109,7 +109,7 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
|
||||
return 1 //don't want to do weapony things after surgery
|
||||
|
||||
if (user.a_intent == I_HELP)
|
||||
user << "\red You can't see any useful way to use [tool] on [M]."
|
||||
user << "<span class='warning'>You can't see any useful way to use [tool] on [M].</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
1
code/modules/surgery/~defines.dm
Normal file
1
code/modules/surgery/~defines.dm
Normal file
@@ -0,0 +1 @@
|
||||
#undef SURGERY_FAILURE
|
||||
@@ -5,11 +5,11 @@
|
||||
// Receiver: does whatever the subtype does. deactivate() by default calls activate(), so you will have to override in
|
||||
// it in a subtype if you want it to do something.
|
||||
//-------------------------------
|
||||
/datum/wifi/sender/button/proc/activate(mob/living/user)
|
||||
/datum/wifi/sender/button/activate(mob/living/user)
|
||||
for(var/datum/wifi/receiver/button/B in connected_devices)
|
||||
B.activate(user)
|
||||
|
||||
/datum/wifi/sender/button/proc/deactivate(mob/living/user)
|
||||
/datum/wifi/sender/button/deactivate(mob/living/user)
|
||||
for(var/datum/wifi/receiver/button/B in connected_devices)
|
||||
B.deactivate(user)
|
||||
|
||||
@@ -24,32 +24,70 @@
|
||||
// open at approximately the same time. Waits until all doors have finished opening before returning.
|
||||
// Receiver: will try to open/close the parent door when activate/deactivate is called.
|
||||
//-------------------------------
|
||||
/datum/wifi/sender/door/proc/open()
|
||||
|
||||
// Sender procs
|
||||
/datum/wifi/sender/door/activate(var/command)
|
||||
if(!command)
|
||||
return
|
||||
|
||||
var/datum/spawn_sync/S = new()
|
||||
|
||||
for(var/datum/wifi/receiver/button/door/D in connected_devices)
|
||||
S.start_worker(D, "activate")
|
||||
S.start_worker(D, command)
|
||||
S.wait_until_done()
|
||||
return
|
||||
|
||||
/datum/wifi/sender/door/proc/close()
|
||||
var/datum/spawn_sync/S = new()
|
||||
|
||||
for(var/datum/wifi/receiver/button/door/D in connected_devices)
|
||||
S.start_worker(D, "deactivate")
|
||||
S.wait_until_done()
|
||||
return
|
||||
|
||||
/datum/wifi/receiver/button/door/activate()
|
||||
//Receiver procs
|
||||
/datum/wifi/receiver/button/door/proc/open()
|
||||
var/obj/machinery/door/D = parent
|
||||
if(istype(D) && D.can_open())
|
||||
D.open()
|
||||
|
||||
/datum/wifi/receiver/button/door/deactivate()
|
||||
/datum/wifi/receiver/button/door/proc/close()
|
||||
var/obj/machinery/door/D = parent
|
||||
if(istype(D) && D.can_close())
|
||||
D.close()
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/lock()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.lock()
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/unlock()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.unlock()
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/enable_idscan()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.set_idscan(1)
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/disable_idscan()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.set_idscan(0)
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/enable_safeties()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.set_safeties(1)
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/disable_safeties()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.set_safeties(0)
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/electrify()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.electrify(-1)
|
||||
|
||||
/datum/wifi/receiver/button/door/proc/unelectrify()
|
||||
var/obj/machinery/door/airlock/D = parent
|
||||
if(istype(D))
|
||||
D.electrify(0)
|
||||
|
||||
//-------------------------------
|
||||
// Emitter
|
||||
// Activates/deactivates the parent emitter.
|
||||
@@ -133,28 +171,25 @@
|
||||
// then closes all connected doors. It will wait before continuing the sequence after opening/closing the doors.
|
||||
// Receiver: Triggers the parent mass dirver to activate.
|
||||
//-------------------------------
|
||||
/datum/wifi/sender/mass_driver/proc/cycle()
|
||||
/datum/wifi/sender/mass_driver/activate()
|
||||
var/datum/spawn_sync/S = new()
|
||||
|
||||
//tell all doors to open
|
||||
for(var/datum/wifi/receiver/button/door/D in connected_devices)
|
||||
S.start_worker(D, "activate")
|
||||
S.start_worker(D, "open")
|
||||
S.wait_until_done()
|
||||
|
||||
S.reset()
|
||||
//tell all mass drivers to launch
|
||||
for(var/datum/wifi/receiver/button/mass_driver/M in connected_devices)
|
||||
spawn()
|
||||
M.activate()
|
||||
|
||||
sleep(20)
|
||||
|
||||
//tell all doors to close
|
||||
S.reset()
|
||||
for(var/datum/wifi/receiver/button/door/D in connected_devices)
|
||||
S.start_worker(D, "deactivate")
|
||||
S.start_worker(D, "close")
|
||||
S.wait_until_done()
|
||||
|
||||
return
|
||||
|
||||
/datum/wifi/receiver/button/mass_driver/activate(mob/living/user)
|
||||
|
||||
@@ -96,6 +96,11 @@
|
||||
var/datum/connection_request/C = new(src, id)
|
||||
wirelessProcess.add_request(C)
|
||||
|
||||
/datum/wifi/sender/proc/activate(mob/living/user)
|
||||
return
|
||||
|
||||
/datum/wifi/sender/proc/deactivate(mob/living/user)
|
||||
return
|
||||
|
||||
//-------------------------------
|
||||
// Connection request
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
return 1
|
||||
|
||||
|
||||
/datum/gas_mixture/proc/react(atom/dump_location)
|
||||
/datum/gas_mixture/proc/react()
|
||||
zburn(null, force_burn=0, no_check=0) //could probably just call zburn() here with no args but I like being explicit.
|
||||
|
||||
|
||||
@@ -442,20 +442,25 @@
|
||||
total_gas[g] += gasmix.gas[g]
|
||||
|
||||
if(total_volume > 0)
|
||||
//Average out the gases
|
||||
for(var/g in total_gas)
|
||||
total_gas[g] /= total_volume
|
||||
var/datum/gas_mixture/combined = new(total_volume)
|
||||
combined.gas = total_gas
|
||||
|
||||
//Calculate temperature
|
||||
var/temperature = 0
|
||||
|
||||
if(total_heat_capacity > 0)
|
||||
temperature = total_thermal_energy / total_heat_capacity
|
||||
combined.temperature = total_thermal_energy / total_heat_capacity
|
||||
combined.update_values()
|
||||
|
||||
//Allow for reactions
|
||||
combined.react()
|
||||
|
||||
//Average out the gases
|
||||
for(var/g in combined.gas)
|
||||
combined.gas[g] /= total_volume
|
||||
|
||||
//Update individual gas_mixtures
|
||||
for(var/datum/gas_mixture/gasmix in gases)
|
||||
gasmix.gas = total_gas.Copy()
|
||||
gasmix.temperature = temperature
|
||||
gasmix.gas = combined.gas.Copy()
|
||||
gasmix.temperature = combined.temperature
|
||||
gasmix.multiply(gasmix.volume)
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user