Merge pull request #7183 from Zuhayr/dev

Hardsuit fixes.
This commit is contained in:
PsiOmegaDelta
2014-12-01 05:58:24 +01:00
15 changed files with 110 additions and 91 deletions

View File

@@ -262,7 +262,8 @@
if(H.wear_mask)
return 0
if(H.head && !(H.head.canremove) && (H.head.flags & HEADCOVERSMOUTH))
H << "\red \The [H.head] is in the way."
if(!disable_warning)
H << "<span class='warning'>\The [H.head] is in the way.</span>"
return 0
if( !(slot_flags & SLOT_MASK) )
return 0
@@ -296,7 +297,7 @@
return 0
if(!H.w_uniform && (slot_w_uniform in mob_equip))
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
H << "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if( !(slot_flags & SLOT_BELT) )
return
@@ -305,7 +306,8 @@
if(H.glasses)
return 0
if(H.head && !(H.head.canremove) && (H.head.flags & HEADCOVERSEYES))
H << "\red \The [H.head] is in the way."
if(!disable_warning)
H << "<span class='warning'>\The [H.head] is in the way.</span>"
return 0
if( !(slot_flags & SLOT_EYES) )
return 0
@@ -339,6 +341,10 @@
if(slot_w_uniform)
if(H.w_uniform)
return 0
if(H.wear_suit)
if(!disable_warning)
H << "<span class='warning'>\The [H.wear_suit] is in the way.</span>"
return 0
if( !(slot_flags & SLOT_ICLOTHING) )
return 0
return 1
@@ -347,7 +353,7 @@
return 0
if(!H.w_uniform && (slot_w_uniform in mob_equip))
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
H << "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if( !(slot_flags & SLOT_ID) )
return 0
@@ -357,7 +363,7 @@
return 0
if(!H.w_uniform && (slot_w_uniform in mob_equip))
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
H << "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if(slot_flags & SLOT_DENYPOCKET)
return 0
@@ -368,7 +374,7 @@
return 0
if(!H.w_uniform && (slot_w_uniform in mob_equip))
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
H << "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if(slot_flags & SLOT_DENYPOCKET)
return 0
@@ -380,11 +386,11 @@
return 0
if(!H.wear_suit && (slot_wear_suit in mob_equip))
if(!disable_warning)
H << "\red You need a suit before you can attach this [name]."
H << "<span class='warning'>You need a suit before you can attach this [name].</span>"
return 0
if(!H.wear_suit.allowed)
if(!disable_warning)
usr << "You somehow have a suit with no defined allowed items for suit storage, stop that."
usr << "<span class='warning'>You somehow have a suit with no defined allowed items for suit storage, stop that.</span>"
return 0
if( istype(src, /obj/item/device/pda) || istype(src, /obj/item/weapon/pen) || is_type_in_list(src, H.wear_suit.allowed) )
return 1
@@ -410,12 +416,12 @@
if(slot_tie)
if(!H.w_uniform && (slot_w_uniform in mob_equip))
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
H << "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>"
return 0
var/obj/item/clothing/under/uniform = H.w_uniform
if(uniform.hastie)
if (!disable_warning)
H << "\red You already have [uniform.hastie] attached to your [uniform]."
H << "<span class='warning'>You already have [uniform.hastie] attached to your [uniform].</span>"
return 0
if( !(slot_flags & SLOT_TIE) )
return 0
@@ -655,7 +661,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
usr << "You are unable to focus through the [devicename]"
cannotzoom = 1
else if(!zoom && global_hud.darkMask[1] in usr.client.screen)
usr << "Your welding equipment gets in the way of you looking through the [devicename]"
usr << "Your visor gets in the way of looking through the [devicename]"
cannotzoom = 1
else if(!zoom && usr.get_active_hand() != src)
usr << "You are too distracted to look through the [devicename], perhaps if it was in your active hand this might work better"

View File

@@ -254,31 +254,31 @@ BLIND // can't see anything
/obj/item/clothing/head/attack_self(mob/user)
if(brightness_on)
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
return
on = !on
overlays.Cut()
update_icon()
if(on)
if(!light_overlay_cache["[light_overlay]_icon"])
light_overlay_cache["[light_overlay]_icon"] = image("icon" = 'icons/obj/light_overlays.dmi', "icon_state" = "[light_overlay]")
if(!light_overlay_cache["[light_overlay]"])
light_overlay_cache["[light_overlay]"] = image("icon" = 'icons/mob/light_overlays.dmi', "icon_state" = "[light_overlay]")
overlays |= light_overlay_cache["[light_overlay]_icon"]
user.SetLuminosity(user.luminosity + brightness_on)
else
user.SetLuminosity(user.luminosity - brightness_on)
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
H.update_inv_head()
else
return ..(user)
/obj/item/clothing/head/update_icon(var/mob/user)
overlays.Cut()
if(on)
if(!light_overlay_cache["[light_overlay]_icon"])
light_overlay_cache["[light_overlay]_icon"] = image("icon" = 'icons/obj/light_overlays.dmi', "icon_state" = "[light_overlay]")
if(!light_overlay_cache["[light_overlay]"])
light_overlay_cache["[light_overlay]"] = image("icon" = 'icons/mob/light_overlays.dmi', "icon_state" = "[light_overlay]")
overlays |= light_overlay_cache["[light_overlay]_icon"]
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
H.update_inv_head()
/obj/item/clothing/head/proc/update_light(mob/user)
if(!brightness_on)

View File

@@ -173,6 +173,14 @@
/obj/item/rig_module/self_destruct/engage()
explosion(get_turf(src), 0, 0, 3, 4)
if(holder && holder.wearer)
holder.wearer.drop_from_inventory(src)
del(holder)
del(src)
/obj/item/rig_module/self_destruct/small/engage()
explosion(get_turf(src), 0, 0, 1, 2)
explosion(get_turf(src), 0, 0, 1, 2)
if(holder && holder.wearer)
holder.wearer.drop_from_inventory(src)
del(holder)
del(src)

View File

@@ -279,7 +279,7 @@
disruptive = 0
suit_overlay_active = "maneuvering_active"
suit_overlay_inactive = "maneuvering_inactive"
suit_overlay_inactive = null //"maneuvering_inactive"
engage_string = "Toggle Stabilizers"
activate_string = "Activate Thrusters"

View File

@@ -32,14 +32,14 @@
var/list/initial_modules
var/chest_type = /obj/item/clothing/suit/space/rig
var/helm_type = /obj/item/clothing/head/helmet/space/rig
var/boot_type = /obj/item/clothing/shoes/rig
var/boot_type = /obj/item/clothing/shoes/magboots/rig
var/glove_type = /obj/item/clothing/gloves/rig
var/cell_type = /obj/item/weapon/cell/high
var/air_type = /obj/item/weapon/tank/oxygen
//Component/device holders.
var/obj/item/weapon/tank/air_supply // Air tank, if any.
var/obj/item/clothing/shoes/rig/boots = null // Deployable boots, if any.
var/obj/item/clothing/shoes/boots = null // Deployable boots, if any.
var/obj/item/clothing/suit/space/rig/chest // Deployable chestpiece, if any.
var/obj/item/clothing/head/helmet/space/rig/helmet = null // Deployable helmet, if any.
var/obj/item/clothing/gloves/rig/gloves = null // Deployable gauntlets, if any.
@@ -155,13 +155,13 @@
/obj/item/weapon/rig/proc/suit_is_deployed()
if(!istype(wearer) || src.loc != wearer || wearer.back != src)
return 0
if(helm_type && (!helmet || wearer.head != helmet))
if(helm_type && !(helmet && wearer.head == helmet))
return 0
if(glove_type && (!gloves || wearer.gloves != gloves))
if(glove_type && !(gloves && wearer.gloves == gloves))
return 0
if(boot_type && (!boots || wearer.shoes != boots))
if(boot_type && !(boots && wearer.shoes == boots))
return 0
if(chest_type && (!chest || wearer.wear_suit != chest))
if(chest_type && !(chest && wearer.wear_suit == chest))
return 0
return 1
@@ -204,13 +204,14 @@
if(!M)
failed_to_seal = 1
else
for(var/list/piece_data in list(list(M.shoes,boots,"boots"),list(M.gloves,gloves,"gloves"),list(M.head,helmet,"helmet"),list(M.wear_suit,chest,"chest")))
for(var/list/piece_data in list(list(M.shoes,boots,"boots",boot_type),list(M.gloves,gloves,"gloves",glove_type),list(M.head,helmet,"helmet",helm_type),list(M.wear_suit,chest,"chest",chest_type)))
var/obj/item/piece = piece_data[1]
var/obj/item/compare_piece = piece_data[2]
var/msg_type = piece_data[3]
var/piece_type = piece_data[4]
if(!piece)
if(!piece || !piece_type)
continue
if(!istype(M) || !istype(piece) || !istype(compare_piece) || !msg_type)
@@ -437,7 +438,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 800, 600)
ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 750, 550)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
@@ -510,7 +511,7 @@
else if(href_list["toggle_ai_control"])
ai_override_enabled = !ai_override_enabled
else if(href_list["toggle_suit_lock"])
security_check_enabled = !security_check_enabled
locked = !locked
usr.set_machine(src)
src.add_fingerprint(usr)

View File

@@ -21,7 +21,7 @@
species_restricted = null
gender = PLURAL
/obj/item/clothing/shoes/rig
/obj/item/clothing/shoes/magboots/rig
name = "boots"
cold_protection = FEET
heat_protection = FEET

View File

@@ -16,4 +16,4 @@
icon_state = "breacher_rig"
armor = list(melee = 90, bullet = 90, laser = 90, energy = 90, bomb = 90, bio = 100, rad = 80)
vision_restriction = 0
offline_vision_restriction = 2
slowdown = 4

View File

@@ -36,8 +36,7 @@
/obj/item/rig_module/ai_container,
/obj/item/rig_module/maneuvering_jets,
/obj/item/rig_module/device/plasmacutter,
/obj/item/rig_module/device/rcd,
/obj/item/rig_module/foam_sprayer
/obj/item/rig_module/device/rcd
)
/obj/item/weapon/rig/ert/medical

View File

@@ -13,7 +13,7 @@
chest_type = /obj/item/clothing/suit/space/rig/light
helm_type = /obj/item/clothing/head/helmet/space/rig/light
boot_type = /obj/item/clothing/shoes/rig/light
boot_type = /obj/item/clothing/shoes/magboots/rig/light
glove_type = /obj/item/clothing/gloves/rig/light
/obj/item/clothing/suit/space/rig/light
@@ -22,7 +22,7 @@
/obj/item/clothing/gloves/rig/light
name = "gloves"
/obj/item/clothing/shoes/rig/light
/obj/item/clothing/shoes/magboots/rig/light
name = "shoes"
/obj/item/clothing/head/helmet/space/rig/light

View File

@@ -49,7 +49,7 @@
name = "AMI control module"
suit_type = "hazmat"
desc = "An Anomalous Material Interaction hardsuit that protects against the strangest energies the universe can throw at it."
icon_state = "science_rig"
icon_state = "medical_rig" //placeholder
armor = list(melee = 15, bullet = 15, laser = 80, energy = 80, bomb = 60, bio = 100, rad = 100)
slowdown = 1
offline_slowdown = 3

View File

@@ -1245,7 +1245,7 @@
if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe
client.images.Remove(hud)
client.screen.Remove(global_huds)
client.screen -= global_huds
update_action_buttons()
@@ -1484,20 +1484,23 @@
if(eye_blurry) client.screen += global_hud.blurry
if(druggy) client.screen += global_hud.druggy
var/masked = 0
if(!masked && istype(glasses, /obj/item/clothing/glasses/welding))
var/obj/item/clothing/glasses/welding/O = glasses
if(!O.up && tinted_weldhelh)
if(tinted_weldhelh)
var/found_welder
if(istype(glasses, /obj/item/clothing/glasses/welding))
var/obj/item/clothing/glasses/welding/O = glasses
if(!O.up)
found_welder = 1
else if(istype(head, /obj/item/clothing/head/welding))
var/obj/item/clothing/head/welding/O = head
if(!O.up)
found_welder = 1
else if(istype(back, /obj/item/weapon/rig))
var/obj/item/weapon/rig/O = back
if(O.helmet && O.helmet == head && (O.helmet.body_parts_covered & EYES))
if((O.offline && O.offline_vision_restriction == 1) || (!O.offline && O.vision_restriction == 1))
found_welder = 1
if(found_welder)
client.screen |= global_hud.darkMask
masked = 1
if(!masked && istype(back, /obj/item/weapon/rig))
var/obj/item/weapon/rig/O = back
// Ugh, why is this done on a case by case basis? Why is there no flag for causing weldervision?
if(O.helmet && O.helmet == head && (O.helmet.body_parts_covered & EYES))
if((O.offline && O.offline_vision_restriction == 1) || (!O.offline && O.vision_restriction == 1))
client.screen |= global_hud.darkMask
if(machine)
if(!machine.check_eye(src))

View File

@@ -26,8 +26,7 @@
/obj/item/weapon/smes_coil
)
//Item currently being held.
var/obj/item/wrapped = null
var/obj/item/wrapped = null // Item currently being held.
/obj/item/weapon/gripper/paperwork
name = "paperwork gripper"
@@ -44,7 +43,8 @@
/obj/item/weapon/gripper/attack_self(mob/user as mob)
if(wrapped)
wrapped.attack_self(user)
return wrapped.attack_self(user)
return ..()
/obj/item/weapon/gripper/verb/drop_item()
@@ -68,12 +68,9 @@
//update_icon()
/obj/item/weapon/gripper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
return
return (wrapped ? wrapped.attack(M,user) : 0)
/obj/item/weapon/gripper/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params)
if(!target || !proximity) //Target is invalid or we are not adjacent.
return
/obj/item/weapon/gripper/afterattack(var/atom/target, var/mob/living/user, proximity, params)
//There's some weirdness with items being lost inside the arm. Trying to fix all cases. ~Z
if(!wrapped)
@@ -82,13 +79,10 @@
break
if(wrapped) //Already have an item.
//Temporary put wrapped into user so target's attackby() checks pass.
wrapped.loc = user
//Pass the attack on to the target. This might delete/relocate wrapped.
target.attackby(wrapped,user)
wrapped.afterattack(target,user)
//If wrapped was neither deleted nor put into target, put it back into the gripper.
if(wrapped && user && (wrapped.loc == user))
wrapped.loc = src

View File

@@ -80,13 +80,17 @@ obj/item/weapon/gun/energy/laser/retro
/obj/item/weapon/gun/energy/lasercannon/mounted/load_into_chamber()
if(in_chamber)
return 1
var/mob/living/carbon/human/H = loc
if(istype(H) && H.back)
var/obj/item/weapon/rig/suit = H.back
if(istype(suit) && suit.cell && suit.cell.charge >= 250)
suit.cell.use(250)
in_chamber = new /obj/item/projectile/beam/heavylaser(src)
return 1
var/obj/item/rig_module/module = loc
if(!istype(module))
return 0
if(module.holder && module.holder.wearer)
var/mob/living/carbon/human/H = module.holder.wearer
if(istype(H) && H.back)
var/obj/item/weapon/rig/suit = H.back
if(istype(suit) && suit.cell && suit.cell.charge >= 250)
suit.cell.use(250)
in_chamber = new /obj/item/projectile/beam/heavylaser(src)
return 1
return 0
/obj/item/weapon/gun/energy/lasercannon/cyborg/load_into_chamber()

View File

@@ -38,14 +38,18 @@
/obj/item/weapon/gun/energy/gun/mounted/load_into_chamber()
if(in_chamber)
return 1
var/mob/living/carbon/human/H = loc
if(istype(H) && H.back)
var/obj/item/weapon/rig/suit = H.back
if(istype(suit) && suit.cell && suit.cell.charge >= 250)
suit.cell.use(250)
var/prog_path = text2path(projectile_type)
in_chamber = new prog_path(src)
return 1
var/obj/item/rig_module/module = loc
if(!istype(module))
return 0
if(module.holder && module.holder.wearer)
var/mob/living/carbon/human/H = module.holder.wearer
if(istype(H) && H.back)
var/obj/item/weapon/rig/suit = H.back
if(istype(suit) && suit.cell && suit.cell.charge >= 250)
suit.cell.use(250)
var/prog_path = text2path(projectile_type)
in_chamber = new prog_path(src)
return 1
return 0
/obj/item/weapon/gun/energy/gun/nuclear