diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 3f00db9ce0..e9c5429dd2 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -256,59 +256,99 @@ datum/hud/New(mob/owner) set name = "F12" set hidden = 1 - if(hud_used) - if(ishuman(src)) - if(!client) return - if(client.view != world.view) - return - if(hud_used.hud_shown) - hud_used.hud_shown = 0 - if(src.hud_used.adding) - src.client.screen -= src.hud_used.adding - if(src.hud_used.other) - src.client.screen -= src.hud_used.other - if(src.hud_used.hotkeybuttons) - src.client.screen -= src.hud_used.hotkeybuttons - if(src.hud_used.item_action_list) - src.client.screen -= src.hud_used.item_action_list - - //Due to some poor coding some things need special treatment: - //These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay - if(!full) - src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible - src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible - src.client.screen += src.hud_used.action_intent //we want the intent swticher visible - src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is. - else - src.client.screen -= src.healths - src.client.screen -= src.internals - src.client.screen -= src.gun_setting_icon - - //These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone. - src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason. - - else - hud_used.hud_shown = 1 - if(src.hud_used.adding) - src.client.screen += src.hud_used.adding - if(src.hud_used.other && src.hud_used.inventory_shown) - src.client.screen += src.hud_used.other - if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden) - src.client.screen += src.hud_used.hotkeybuttons - if(src.healths) - src.client.screen |= src.healths - if(src.internals) - src.client.screen |= src.internals - if(src.gun_setting_icon) - src.client.screen |= src.gun_setting_icon - - src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position - src.client.screen += src.zone_sel //This one is a special snowflake - - hud_used.hidden_inventory_update() - hud_used.persistant_inventory_update() - update_action_buttons() - else - usr << "\red Inventory hiding is currently only supported for human mobs, sorry." - else + if(!hud_used) usr << "\red This mob type does not use a HUD." + return + + if(!ishuman(src)) + usr << "\red Inventory hiding is currently only supported for human mobs, sorry." + return + + if(!client) return + if(client.view != world.view) + return + if(hud_used.hud_shown) + hud_used.hud_shown = 0 + if(src.hud_used.adding) + src.client.screen -= src.hud_used.adding + if(src.hud_used.other) + src.client.screen -= src.hud_used.other + if(src.hud_used.hotkeybuttons) + src.client.screen -= src.hud_used.hotkeybuttons + if(src.hud_used.item_action_list) + src.client.screen -= src.hud_used.item_action_list + + //Due to some poor coding some things need special treatment: + //These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay + if(!full) + src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible + src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible + src.client.screen += src.hud_used.action_intent //we want the intent swticher visible + src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is. + else + src.client.screen -= src.healths + src.client.screen -= src.internals + src.client.screen -= src.gun_setting_icon + + //These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone. + src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason. + + else + hud_used.hud_shown = 1 + if(src.hud_used.adding) + src.client.screen += src.hud_used.adding + if(src.hud_used.other && src.hud_used.inventory_shown) + src.client.screen += src.hud_used.other + if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden) + src.client.screen += src.hud_used.hotkeybuttons + if(src.healths) + src.client.screen |= src.healths + if(src.internals) + src.client.screen |= src.internals + if(src.gun_setting_icon) + src.client.screen |= src.gun_setting_icon + + src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position + src.client.screen += src.zone_sel //This one is a special snowflake + + hud_used.hidden_inventory_update() + hud_used.persistant_inventory_update() + update_action_buttons() + +//Similar to button_pressed_F12() but keeps zone_sel, gun_setting_icon, and healths. +/mob/proc/toggle_zoom_hud() + if(!hud_used) + return + if(!ishuman(src)) + return + if(!client) + return + if(client.view != world.view) + return + + if(hud_used.hud_shown) + hud_used.hud_shown = 0 + if(src.hud_used.adding) + src.client.screen -= src.hud_used.adding + if(src.hud_used.other) + src.client.screen -= src.hud_used.other + if(src.hud_used.hotkeybuttons) + src.client.screen -= src.hud_used.hotkeybuttons + if(src.hud_used.item_action_list) + src.client.screen -= src.hud_used.item_action_list + src.client.screen -= src.internals + else + hud_used.hud_shown = 1 + if(src.hud_used.adding) + src.client.screen += src.hud_used.adding + if(src.hud_used.other && src.hud_used.inventory_shown) + src.client.screen += src.hud_used.other + if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden) + src.client.screen += src.hud_used.hotkeybuttons + if(src.internals) + src.client.screen |= src.internals + src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position + + hud_used.hidden_inventory_update() + hud_used.persistant_inventory_update() + update_action_buttons() \ No newline at end of file diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 63447c5168..8879eeb2b7 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -198,11 +198,7 @@ // apparently called whenever an item is removed from a slot, container, or anything else. /obj/item/proc/dropped(mob/user as mob) ..() - if(zoom) //binoculars, scope, etc - user.client.view = world.view - user.client.pixel_x = 0 - user.client.pixel_y = 0 - zoom = 0 + if(zoom) zoom() //binoculars, scope, etc // called just as an item is picked up (loc is not yet changed) /obj/item/proc/pickup(mob/user) @@ -660,9 +656,8 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. cannotzoom = 1 if(!zoom && !cannotzoom) - if(!usr.hud_used.hud_shown) - usr.button_pressed_F12(1) // If the user has already limited their HUD this avoids them having a HUD when they zoom in - usr.button_pressed_F12(1) + if(usr.hud_used.hud_shown) + usr.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in usr.client.view = viewsize zoom = 1 @@ -688,7 +683,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. else usr.client.view = world.view if(!usr.hud_used.hud_shown) - usr.button_pressed_F12(1) + usr.toggle_zoom_hud() zoom = 0 usr.client.pixel_x = 0 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 599707aaa1..21657fce41 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1240,7 +1240,7 @@ if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO if(healths) healths.icon_state = "health7" //DEAD healthmeter if(client) - if(client.view != world.view) // If mob moves while zoomed in with device, unzoom them. + if(client.view != world.view) // If mob dies while zoomed in with device, unzoom them. for(var/obj/item/item in contents) if(item.zoom) item.zoom() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 707bceaf2c..4dcc006df6 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -497,10 +497,11 @@ Note that amputating the affected organ does in fact remove the infection from t H = owner for(var/datum/wound/W in wounds) - if(W.damage_type == CUT || W.damage_type == BRUISE) - brute_dam += W.damage - else if(W.damage_type == BURN) - burn_dam += W.damage + if(!W.internal) //so IB doesn't count towards crit/paincrit + if(W.damage_type == CUT || W.damage_type == BRUISE) + brute_dam += W.damage + else if(W.damage_type == BURN) + burn_dam += W.damage if(!(status & ORGAN_ROBOT) && W.bleeding() && (H && !(H.species.flags & NO_BLOOD))) W.bleed_timer-- diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 3cd90347f9..19f1157371 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -76,7 +76,13 @@ /obj/item/weapon/gun/energy/update_icon() if(charge_meter) var/ratio = power_supply.charge / power_supply.maxcharge - ratio = round(ratio, 0.25) * 100 + + //make sure that rounding down will not give us the empty state even if we have charge for a shot left. + if(power_supply.charge < charge_cost) + ratio = 0 + else + ratio = max(round(ratio, 0.25) * 100, 25) + if(modifystate) icon_state = "[modifystate][ratio]" else diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 112a33e387..76bcebac3c 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -2,9 +2,10 @@ name = "ion rifle" desc = "A man portable anti-armor weapon designed to disable mechanical threats" icon_state = "ionrifle" + item_state = "ionrifle" fire_sound = 'sound/weapons/Laser.ogg' origin_tech = "combat=2;magnets=4" - w_class = 4.0 + w_class = 4 force = 10 flags = CONDUCT slot_flags = SLOT_BACK @@ -16,6 +17,13 @@ return //so it doesn't EMP itself, I guess ..() +/obj/item/weapon/gun/energy/ionrifle/update_icon() + ..() + if(power_supply.charge < charge_cost) + item_state = "ionrifle-empty" + else + item_state = initial(item_state) + /obj/item/weapon/gun/energy/decloner name = "biological demolecularisor" desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements." diff --git a/icons/mob/items_lefthand.dmi b/icons/mob/items_lefthand.dmi index ed8a04987e..9f1f22c1a3 100644 Binary files a/icons/mob/items_lefthand.dmi and b/icons/mob/items_lefthand.dmi differ diff --git a/icons/mob/items_righthand.dmi b/icons/mob/items_righthand.dmi index f95abe3fd8..889346d863 100644 Binary files a/icons/mob/items_righthand.dmi and b/icons/mob/items_righthand.dmi differ