Merge pull request #7210 from Zuhayr/dev

Fixes #7209
This commit is contained in:
Snapshot
2014-12-02 17:23:19 -08:00
4 changed files with 86 additions and 71 deletions

View File

@@ -531,7 +531,19 @@ As such, it's hard-coded for now. No reason for it not to be, really.
else else
equip_to_slot_or_del(new /obj/item/clothing/under/color/black(src), slot_w_uniform) equip_to_slot_or_del(new /obj/item/clothing/under/color/black(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/weapon/rig/light/ninja(src), slot_back) var/obj/item/weapon/rig/light/ninja/ninjasuit = new(src)
// Make sure the ninja can actually equip the suit.
if(src.dna && src.dna.unique_enzymes)
src << "<span class='warning'>Suit hardware locked to your DNA hash.</span>"
ninjasuit.locked_dna = src.dna.unique_enzymes
else
ninjasuit.req_access = list()
equip_to_slot_or_del(ninjasuit,slot_back)
spawn(10)
ninjasuit.toggle_seals(src,1)
equip_to_slot_or_del(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask) equip_to_slot_or_del(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_belt) equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_belt)
equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(src), slot_s_store) equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(src), slot_s_store)

View File

@@ -63,6 +63,7 @@
var/malfunction_delay = 0 var/malfunction_delay = 0
var/electrified = 0 var/electrified = 0
var/locked_down = 0 var/locked_down = 0
var/locked_dna = null
var/sealing // Keeps track of seal status independantly of canremove. var/sealing // Keeps track of seal status independantly of canremove.
var/offline = 1 // Should we be applying suit maluses? var/offline = 1 // Should we be applying suit maluses?
@@ -139,12 +140,6 @@
piece.siemens_coefficient = siemens_coefficient piece.siemens_coefficient = siemens_coefficient
piece.permeability_coefficient = permeability_coefficient piece.permeability_coefficient = permeability_coefficient
spawn(1)
var/mob/M = loc
if(istype(M))
toggle_seals(M,1)
update_icon()
/obj/item/weapon/rig/Del() /obj/item/weapon/rig/Del()
for(var/obj/item/piece in list(gloves,boots,helmet,chest)) for(var/obj/item/piece in list(gloves,boots,helmet,chest))
var/mob/living/M = piece.loc var/mob/living/M = piece.loc
@@ -171,9 +166,6 @@
if(sealing) return if(sealing) return
if(M && !(istype(M) && M.back == src ) && !istype(M,/mob/living/silicon))
return 0
if(!check_power_cost(M)) if(!check_power_cost(M))
return 0 return 0
@@ -189,16 +181,10 @@
M << "<span class='danger'>The suit flashes an error light. It can't function properly without being fully deployed.</span>" M << "<span class='danger'>The suit flashes an error light. It can't function properly without being fully deployed.</span>"
failed_to_seal = 1 failed_to_seal = 1
if(!failed_to_seal && instant) if(!failed_to_seal)
for(var/obj/item/piece in list(helmet,boots,gloves,chest))
if(!piece) continue
piece.icon_state = "[initial(icon_state)]_sealed"
update_icon()
else if(!failed_to_seal)
if(!instant)
M << "<font color='blue'>With a quiet hum, the suit begins running checks and adjusting components.</font>" M << "<font color='blue'>With a quiet hum, the suit begins running checks and adjusting components.</font>"
if(!do_after(M,SEAL_DELAY)) if(!do_after(M,SEAL_DELAY))
if(M) M << "<span class='warning'>You must remain still while the suit is adjusting the components.</span>" if(M) M << "<span class='warning'>You must remain still while the suit is adjusting the components.</span>"
failed_to_seal = 1 failed_to_seal = 1
@@ -222,7 +208,12 @@
failed_to_seal = 1 failed_to_seal = 1
break break
if(M.back == src && piece == compare_piece && do_after(M,SEAL_DELAY)) if(M.back == src && piece == compare_piece)
if(!instant)
if(!do_after(M,SEAL_DELAY))
failed_to_seal = 1
piece.icon_state = "[initial(icon_state)][!seal_target ? "_sealed" : ""]" piece.icon_state = "[initial(icon_state)][!seal_target ? "_sealed" : ""]"
switch(msg_type) switch(msg_type)
if("boots") if("boots")
@@ -292,6 +283,10 @@
piece.flags |= AIRTIGHT piece.flags |= AIRTIGHT
update_icon(1) update_icon(1)
if(instant && air_supply)
wearer.internals = air_supply
wearer.internals.icon_state = "internal1"
/obj/item/weapon/rig/process() /obj/item/weapon/rig/process()
if(!istype(wearer) || loc != wearer || wearer.back != src || canremove || !cell || cell.charge <= 0) if(!istype(wearer) || loc != wearer || wearer.back != src || canremove || !cell || cell.charge <= 0)
@@ -477,24 +472,38 @@
wearer.update_inv_back() wearer.update_inv_back()
return return
/obj/item/weapon/rig/proc/check_suit_access(var/mob/living/carbon/human/user)
if(!security_check_enabled)
return 1
if(istype(user))
if(user.back != src)
return 0
if(locked_dna)
if(!user.dna || user.dna.unique_enzymes != locked_dna)
user << "<span class='danger'>DNA scan mismatch. Access denied.</span>"
return 0
else if(!src.allowed(user))
user << "<span class='danger'>Unauthorized user. Access denied.</span>"
return 0
else if(user.loc && user.loc.loc && istype(user.loc.loc,/obj/item/rig_module/ai_container))
if(!ai_override_enabled)
user << "<span class='danger'>Synthetic access disabled. Please consult hardware provider.</span>"
return 0
return 1
/obj/item/weapon/rig/Topic(href,href_list) /obj/item/weapon/rig/Topic(href,href_list)
var/mob/living/carbon/human/H = usr if(!check_suit_access(usr))
if((istype(H) && H.back == src) || (istype(H,/mob/living/silicon)))
if(istype(H,/mob/living/silicon))
if(!ai_override_enabled)
usr << "<span class='danger'>Synthetic access disabled. Please consult hardware provider.</span>"
return
else if(security_check_enabled && !src.allowed(usr))
usr << "<span class='danger'>Access denied.</span>"
return return
if(href_list["toggle_piece"]) if(href_list["toggle_piece"])
toggle_piece(href_list["toggle_piece"], H) toggle_piece(href_list["toggle_piece"], usr)
else if(href_list["toggle_seals"]) else if(href_list["toggle_seals"])
toggle_seals(H) toggle_seals(usr)
else if(href_list["interact_module"]) else if(href_list["interact_module"])
var/module_index = text2num(href_list["interact_module"]) var/module_index = text2num(href_list["interact_module"])

View File

@@ -20,6 +20,7 @@
user << "<span class='danger'>It looks like the locking system has been shorted out.</span>" user << "<span class='danger'>It looks like the locking system has been shorted out.</span>"
return return
else if(istype(W, /obj/item/weapon/card/emag)) else if(istype(W, /obj/item/weapon/card/emag))
locked_dna = null
req_access = null req_access = null
req_one_access = null req_one_access = null
locked = 0 locked = 0

View File

@@ -27,8 +27,7 @@
usr << "<span class='warning'>The suit is not active.</span>" usr << "<span class='warning'>The suit is not active.</span>"
return return
if((security_check_enabled && !src.allowed(wearer)) || control_overridden) if(!check_suit_access(usr))
wearer << "<span class='danger'>Access denied.</span>"
return return
if(!visor) if(!visor)
@@ -51,8 +50,7 @@
usr << "<span class='warning'>The hardsuit is not being worn.</span>" usr << "<span class='warning'>The hardsuit is not being worn.</span>"
return return
if((security_check_enabled && !src.allowed(wearer)) || control_overridden) if(!check_suit_access(usr))
wearer << "<span class='danger'>Access denied.</span>"
return return
toggle_piece("helmet",wearer) toggle_piece("helmet",wearer)
@@ -64,8 +62,7 @@
set category = "Hardsuit" set category = "Hardsuit"
set src = usr.contents set src = usr.contents
if((security_check_enabled && !src.allowed(wearer)) || control_overridden) if(!check_suit_access(usr))
wearer << "<span class='danger'>Access denied.</span>"
return return
toggle_piece("chest",wearer) toggle_piece("chest",wearer)
@@ -81,8 +78,7 @@
usr << "<span class='warning'>The hardsuit is not being worn.</span>" usr << "<span class='warning'>The hardsuit is not being worn.</span>"
return return
if((security_check_enabled && !src.allowed(wearer)) || control_overridden) if(!check_suit_access(usr))
wearer << "<span class='danger'>Access denied.</span>"
return return
toggle_piece("gauntlets",wearer) toggle_piece("gauntlets",wearer)
@@ -98,8 +94,7 @@
usr << "<span class='warning'>The hardsuit is not being worn.</span>" usr << "<span class='warning'>The hardsuit is not being worn.</span>"
return return
if((security_check_enabled && !src.allowed(wearer)) || control_overridden) if(!check_suit_access(usr))
wearer << "<span class='danger'>Access denied.</span>"
return return
toggle_piece("boots",wearer) toggle_piece("boots",wearer)
@@ -115,8 +110,7 @@
usr << "<span class='warning'>The hardsuit is not being worn.</span>" usr << "<span class='warning'>The hardsuit is not being worn.</span>"
return return
if((security_check_enabled && !src.allowed(wearer)) || control_overridden) if(!check_suit_access(usr))
wearer << "<span class='danger'>Access denied.</span>"
return return
if(!check_power_cost(usr)) if(!check_power_cost(usr))
@@ -135,8 +129,7 @@
usr << "<span class='warning'>The hardsuit is not being worn.</span>" usr << "<span class='warning'>The hardsuit is not being worn.</span>"
return return
if((security_check_enabled && !src.allowed(wearer)) || control_overridden) if(!check_suit_access(usr))
wearer << "<span class='danger'>Access denied.</span>"
return return
toggle_seals(wearer) toggle_seals(wearer)