Merge remote-tracking branch 'upstream/master' into dev-freeze

Conflicts:
	code/game/verbs/suicide.dm
	code/modules/nano/modules/crew_monitor.dm
This commit is contained in:
PsiOmegaDelta
2015-12-06 11:34:36 +01:00
25 changed files with 165 additions and 137 deletions

View File

@@ -28,9 +28,6 @@ datum/pipeline
if(!member.check_pressure(pressure))
break //Only delete 1 pipe per process
//Allow for reactions
//air.react() //Should be handled by pipe_network now
proc/temporarily_store_air()
//Update individual gas_mixtures by volume ratio

View File

@@ -48,7 +48,7 @@
else
assignment = "Unassigned"
var/id = add_zero(num2hex(rand(1, 1.6777215E7)), 6) //this was the best they could come up with? A large random number? *sigh*
var/id = generate_record_id()
var/icon/front = new(get_id_photo(H), dir = SOUTH)
var/icon/side = new(get_id_photo(H), dir = WEST)
//General Record
@@ -136,8 +136,10 @@
locked += L
return
/proc/generate_record_id()
return add_zero(num2hex(rand(1, 65535)), 4) //no point generating higher numbers because of the limitations of num2hex
proc/get_id_photo(var/mob/living/carbon/human/H)
/proc/get_id_photo(var/mob/living/carbon/human/H)
var/icon/preview_icon = null
var/g = "m"

View File

@@ -5,7 +5,7 @@
var/icon/side = new(get_id_photo(dummy), dir = WEST)
var/datum/data/record/G = new /datum/data/record()
G.fields["name"] = "New Record"
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
G.fields["id"] = generate_record_id()
G.fields["rank"] = "Unassigned"
G.fields["real_rank"] = "Unassigned"
G.fields["sex"] = "Male"

View File

@@ -140,9 +140,19 @@
if(weld(W, user))
if(assembly)
assembly.loc = src.loc
assembly.state = 1
assembly.anchored = 1
assembly.camera_name = c_tag
assembly.camera_network = english_list(network, "Exodus", ",", ",")
assembly.update_icon()
assembly.dir = src.dir
assembly = null //so qdel doesn't eat it.
new /obj/item/stack/cable_coil(src.loc, length=2)
if(stat & BROKEN)
assembly.state = 2
user << "<span class='notice'>You repaired \the [src] frame.</span>"
else
assembly.state = 1
user << "<span class='notice'>You cut \the [src] free from the wall.</span>"
new /obj/item/stack/cable_coil(src.loc, length=2)
qdel(src)
// OTHER

View File

@@ -11,6 +11,8 @@
// Motion, EMP-Proof, X-Ray
var/list/obj/item/possible_upgrades = list(/obj/item/device/assembly/prox_sensor, /obj/item/stack/material/osmium, /obj/item/weapon/stock_parts/scanning_module)
var/list/upgrades = list()
var/camera_name
var/camera_network
var/state = 0
var/busy = 0
/*
@@ -47,7 +49,7 @@
else if(iswrench(W))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "You unattach the assembly from it's place."
user << "You unattach the assembly from its place."
anchored = 0
update_icon()
state = 0
@@ -67,7 +69,7 @@
else if(iswelder(W))
if(weld(W, user))
user << "You unweld the assembly from it's place."
user << "You unweld the assembly from its place."
state = 1
anchored = 1
return
@@ -78,7 +80,7 @@
if(isscrewdriver(W))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Exodus,Security,Secret ", "Set Network", "Exodus"))
var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Exodus,Security,Secret ", "Set Network", camera_network ? camera_network : "Exodus"))
if(!input)
usr << "No input found please hang up and try your call again."
return
@@ -90,7 +92,7 @@
var/area/camera_area = get_area(src)
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
input = sanitizeSafe(input(usr, "How would you like to name the camera?", "Set Camera Name", temptag), MAX_NAME_LEN)
input = sanitizeSafe(input(usr, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN)
state = 4
var/obj/machinery/camera/C = new(src.loc)

View File

@@ -88,7 +88,7 @@ obj/machinery/scanner/attack_hand(mob/living/carbon/human/user)
G.fields["rank"] = "Unassigned"
G.fields["real_rank"] = G.fields["rank"]
G.fields["name"] = mname
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
G.fields["id"] = generate_record_id()
M.fields["name"] = G.fields["name"]
M.fields["id"] = G.fields["id"]
S.fields["name"] = G.fields["name"]

View File

@@ -247,6 +247,9 @@
// for items that can be placed in multiple slots
// note this isn't called during the initial dressing of a player
/obj/item/proc/equipped(var/mob/user, var/slot)
layer = 20
if(user.client) user.client.screen |= src
if(user.pulling == src) user.stop_pulling()
return
//Defines which slots correspond to which slot flags

View File

@@ -18,9 +18,11 @@
/obj/item/device/chameleon/dropped()
disrupt()
..()
/obj/item/device/chameleon/equipped()
disrupt()
..()
/obj/item/device/chameleon/attack_self()
toggle()

View File

@@ -172,19 +172,18 @@
if(1)
for(var/atom/movable/A as mob|obj in src)//pulls everything out of the locker and hits it with an explosion
A.forceMove(src.loc)
A.ex_act(severity++)
A.ex_act(severity + 1)
qdel(src)
if(2)
if(prob(50))
for (var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.ex_act(severity++)
A.ex_act(severity + 1)
qdel(src)
if(3)
if(prob(5))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.ex_act(severity++)
qdel(src)
/obj/structure/closet/proc/damage(var/damage)

View File

@@ -31,6 +31,7 @@
if(held_item)
var/damagetype = held_item.suicide_act(src)
if(damagetype)
log_and_message_admins("[key_name(src)] commited suicide using \a [held_item]")
var/damage_mod = 1
switch(damagetype) //Sorry about the magic numbers.
//brute = 1, burn = 2, tox = 4, oxy = 8
@@ -70,7 +71,7 @@
updatehealth()
return
log_and_message_admins("[key_name(src)] commited suicide")
viewers(src) << pick("<span class='danger'>[src] is attempting to bite \his tongue off! It looks like \he's trying to commit suicide.</span>", \
"<span class='danger'>[src] is jamming \his thumbs into \his eye sockets! It looks like \he's trying to commit suicide.</span>", \
"<span class='danger'>[src] is twisting \his own neck! It looks like \he's trying to commit suicide.</span>", \

View File

@@ -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

View File

@@ -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.

View File

@@ -1,53 +1,42 @@
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)
// TODO : Change to incapacitated() on merge.
if(usr.stat || usr.lying || usr.resting || usr.buckled)
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>")

View File

@@ -1404,3 +1404,45 @@
get_scooped(H)
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

View File

@@ -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"

View File

@@ -70,6 +70,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)

View File

@@ -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"] )

View File

@@ -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)

View File

@@ -479,8 +479,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"]"
@@ -608,8 +606,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()
@@ -725,7 +724,7 @@
return
var/list/data = list(
"locked" = locked,
"locked" = (locked && !emagged) ? 1 : 0,
"isOperating" = operating,
"externalPower" = main_status,
"powerCellStatus" = cell ? cell.percent() : null,
@@ -838,7 +837,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))
@@ -857,7 +856,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

View File

@@ -269,7 +269,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
@@ -340,6 +340,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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -56,6 +56,13 @@
-->
<div class="commit sansserif">
<h2 class="date">06 December 2015</h2>
<h3 class="author">Hubblenaut updated:</h3>
<ul class="changes bgimages16">
<li class="bugfix">Welding a broken camera will use the correct icon.</li>
<li class="tweak">Camera assemblies remember their tag and network from previous usage.</li>
</ul>
<h2 class="date">22 November 2015</h2>
<h3 class="author">neersighted updated:</h3>
<ul class="changes bgimages16">

View File

@@ -2150,3 +2150,7 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py.
neersighted:
- bugfix: Laptop Vendors now accept ID Containers (PDA, Wallet, etc).
- bugfix: Personal Lockers now accept ID Containers (PDA, Wallet, etc).
2015-12-06:
Hubblenaut:
- bugfix: Welding a broken camera will use the correct icon.
- tweak: Camera assemblies remember their tag and network from previous usage.