From 3b5c753b7b843a578dc0adff61c9081af684c695 Mon Sep 17 00:00:00 2001 From: Rykka Date: Fri, 1 Apr 2022 05:22:48 -0600 Subject: [PATCH 01/11] Start of TGMC Ammo HUD Port Ports Ammo HUD from TGMC, still WIP. Progress Commit for tracking + allowing work on it later. --- code/_onclick/hud/_defines_ch.dm | 8 ++ code/_onclick/hud/hud.dm | 5 + code/_onclick/hud/hud_ch.dm | 29 +++++ code/_onclick/hud/screen_objects_ch.dm | 107 ++++++++++++++++++ code/_onclick/hud/screen_objects_zz_ch.dm | 30 ----- .../items/weapons/grenades/explosive.dm | 1 + .../objects/items/weapons/grenades/grenade.dm | 2 + .../items/weapons/grenades/smokebomb.dm | 1 + icons/mob/ammoHUD.dmi | Bin 0 -> 5639 bytes vorestation.dme | 4 +- 10 files changed, 156 insertions(+), 31 deletions(-) create mode 100644 code/_onclick/hud/_defines_ch.dm create mode 100644 code/_onclick/hud/hud_ch.dm create mode 100644 code/_onclick/hud/screen_objects_ch.dm delete mode 100644 code/_onclick/hud/screen_objects_zz_ch.dm create mode 100644 icons/mob/ammoHUD.dmi diff --git a/code/_onclick/hud/_defines_ch.dm b/code/_onclick/hud/_defines_ch.dm new file mode 100644 index 0000000000..3fb902eba8 --- /dev/null +++ b/code/_onclick/hud/_defines_ch.dm @@ -0,0 +1,8 @@ +/** CHOMP-Specific Defines + * Put defines specific to OUR HUDs here. + * First thing to go here is the TGMC Ammo HUD. + */ +#define ui_ammo_hud1 "EAST-1:28,CENTER+1:25" +#define ui_ammo_hud2 "EAST-1:28,CENTER+2:27" +#define ui_ammo_hud3 "EAST-1:28,CENTER+3:29" +#define ui_ammo_hud4 "EAST-1:28,CENTER+4:31" \ No newline at end of file diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 98c187fc97..2f2ed75400 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -1,3 +1,4 @@ +#define MAX_AMMO_HUD_POSSIBLE 4 // Cap the amount of HUDs at 4. /* The global hud: Uses the same visual objects for all players. @@ -191,6 +192,9 @@ var/list/global_huds = list( var/icon/ui_style var/ui_color var/ui_alpha + + // TGMC Ammo HUD Port + var/list/obj/screen/ammo_hud_list = list() var/list/minihuds = list() @@ -220,6 +224,7 @@ var/list/global_huds = list( other_important = null hotkeybuttons = null // item_action_list = null // ? + QDEL_LIST(ammo_hud_list) mymob = null /datum/hud/proc/hidden_inventory_update() diff --git a/code/_onclick/hud/hud_ch.dm b/code/_onclick/hud/hud_ch.dm new file mode 100644 index 0000000000..f68ecb0864 --- /dev/null +++ b/code/_onclick/hud/hud_ch.dm @@ -0,0 +1,29 @@ +/** + * CHOMP-Specific HUD override. This will be backported to Polaris if they want it. + */ +///Add an ammo hud to the user informing of the ammo count of G +/datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G) + if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE) + return + var/obj/screen/ammo/ammo_hud = new + ammo_hud_list[G] = ammo_hud + ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[length(ammo_hud_list)] + ammo_hud.add_hud(user, G) + ammo_hud.update_hud(user, G) + +///Remove the ammo hud related to the gun G from the user +/datum/hud/proc/remove_ammo_hud(mob/living/user, obj/item/weapon/gun/G) + var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] + ammo_hud.remove_hud(user, G) + qdel(ammo_hud) + ammo_hud_list -= G + var/i = 1 + for(var/key in ammo_hud_list) + ammo_hud = ammo_hud_list[key] + ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[i] + i++ + +///Update the ammo hud related to the gun G +/datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G) + var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] + ammo_hud?.update_hud(user, G) \ No newline at end of file diff --git a/code/_onclick/hud/screen_objects_ch.dm b/code/_onclick/hud/screen_objects_ch.dm new file mode 100644 index 0000000000..07886a4546 --- /dev/null +++ b/code/_onclick/hud/screen_objects_ch.dm @@ -0,0 +1,107 @@ +//Invesitgating a runtime made me discover that all simplemobs have HUD on hands set to themselves +//Which cause this original code to die because the mob does not have a mymob var... +//So yeah this is why we now check if it is type of mob first... +//Is this pretty? Fuck no, but its how i know to fix it -shark +//Oh also the swap button on simple mob hands has hud set to null so we also need to catch that. +/obj/screen/inventory/add_overlays() + if(!hud) //Simplemob swap hands button has this set to null :) + return + var/mob/user + if(istype(hud,/mob )) //Simplemob hands directly reference the mob in hud, dont ask me. + user = hud + else + user = hud.mymob //original intended behaviour + if(hud && user && slot_id) + + var/obj/item/holding = user.get_active_hand() + + if(!holding || user.get_equipped_item(slot_id)) + return + + var/image/item_overlay = image(holding) + item_overlay.alpha = 92 + + if(!holding.mob_can_equip(user, slot_id, disable_warning = TRUE)) + item_overlay.color = "#ff0000" + else + item_overlay.color = "#00ff00" + + object_overlays += item_overlay + add_overlay(object_overlays) + +// Begin TGMC Ammo HUD Port +/obj/screen/ammo + name = "ammo" + icon = 'icons/mob/ammoHUD.dmi' + icon_state = "ammo" + screen_loc = ui_ammo_hud1 + var/warned = FALSE + var/static/list/ammo_screen_loc_list = list(ui_ammo_hud1, ui_ammo_hud2, ui_ammo_hud3 ,ui_ammo_hud4) + +/obj/screen/ammo/proc/add_hud(var/mob/living/user) + if(!user?.client) + return + + var/obj/item/weapon/gun/G = user.get_active_hand() + + if(!G || !G.has_ammo_counter() || !G.hud_enabled) + return + + user.client.screen += src + +/obj/screen/ammo/proc/remove_hud(var/mob/living/user) + user?.client?.screen -= src + +/obj/screen/ammo/proc/update_hud(var/mob/living/user) + if(!user?.client?.screen.Find(src)) + return + + var/obj/item/weapon/gun/G = user.get_active_hand() + + if(!G || !istype(G) || !G.has_ammo_counter() || !G.hud_enabled || !G.get_ammo_type() || isnull(G.get_ammo_count())) + remove_hud() + return + + var/list/ammo_type = G.get_ammo_type() + var/rounds = G.get_ammo_count() + + var/hud_state = ammo_type[1] + var/hud_state_empty = ammo_type[2] + + overlays.Cut() + + var/empty = image('icons/mob/ammoHUD.dmi', src, "[hud_state_empty]") + + if(rounds == 0) + if(warned) + overlays += empty + else + warned = TRUE + var/obj/screen/ammo/F = new /obj/screen/ammo(src) + F.icon_state = "frame" + user.client.screen += F + flick("[hud_state_empty]_flash", F) + spawn(20) + user.client.screen -= F + qdel(F) + overlays += empty + else + warned = FALSE + overlays += image('icons/mob/ammoHUD.dmi', src, "[hud_state]") + + rounds = num2text(rounds) + //Handle the amount of rounds + switch(length(rounds)) + if(1) + overlays += image('icons/mob/ammoHUD.dmi', src, "o[rounds[1]]") + if(2) + overlays += image('icons/mob/ammoHUD.dmi', src, "o[rounds[2]]") + overlays += image('icons/mob/ammoHUD.dmi', src, "t[rounds[1]]") + if(3) + overlays += image('icons/mob/ammoHUD.dmi', src, "o[rounds[3]]") + overlays += image('icons/mob/ammoHUD.dmi', src, "t[rounds[2]]") + overlays += image('icons/mob/ammoHUD.dmi', src, "h[rounds[1]]") + else //"0" is still length 1 so this means it's over 999 + overlays += image('icons/mob/ammoHUD.dmi', src, "o9") + overlays += image('icons/mob/ammoHUD.dmi', src, "t9") + overlays += image('icons/mob/ammoHUD.dmi', src, "h9") \ No newline at end of file diff --git a/code/_onclick/hud/screen_objects_zz_ch.dm b/code/_onclick/hud/screen_objects_zz_ch.dm deleted file mode 100644 index f0fbd912fe..0000000000 --- a/code/_onclick/hud/screen_objects_zz_ch.dm +++ /dev/null @@ -1,30 +0,0 @@ -//Invesitgating a runtime made me discover that all simplemobs have HUD on hands set to themselves -//Which cause this original code to die because the mob does not have a mymob var... -//So yeah this is why we now check if it is type of mob first... -//Is this pretty? Fuck no, but its how i know to fix it -shark -//Oh also the swap button on simple mob hands has hud set to null so we also need to catch that. -/obj/screen/inventory/add_overlays() - if(!hud) //Simplemob swap hands button has this set to null :) - return - var/mob/user - if(istype(hud,/mob )) //Simplemob hands directly reference the mob in hud, dont ask me. - user = hud - else - user = hud.mymob //original intended behaviour - if(hud && user && slot_id) - - var/obj/item/holding = user.get_active_hand() - - if(!holding || user.get_equipped_item(slot_id)) - return - - var/image/item_overlay = image(holding) - item_overlay.alpha = 92 - - if(!holding.mob_can_equip(user, slot_id, disable_warning = TRUE)) - item_overlay.color = "#ff0000" - else - item_overlay.color = "#00ff00" - - object_overlays += item_overlay - add_overlay(object_overlays) \ No newline at end of file diff --git a/code/game/objects/items/weapons/grenades/explosive.dm b/code/game/objects/items/weapons/grenades/explosive.dm index 076a7accce..77e07e2c5f 100644 --- a/code/game/objects/items/weapons/grenades/explosive.dm +++ b/code/game/objects/items/weapons/grenades/explosive.dm @@ -12,6 +12,7 @@ //The radius of the circle used to launch projectiles. Lower values mean less projectiles are used but if set too low gaps may appear in the spread pattern var/spread_range = 7 loadable = null + hud_state = "grenade_frag" // TGMC Ammo HUD Port /obj/item/weapon/grenade/explosive/detonate() ..() diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 209e47b253..9bdf650c64 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -13,6 +13,8 @@ var/det_time = 50 var/loadable = TRUE var/arm_sound = 'sound/weapons/armbomb.ogg' + var/hud_state = "grenade_he" // TGMC Ammo HUD Port + var/hud_state_empty = "grenade_empty" // TGMC Ammo HUD Port /obj/item/weapon/grenade/proc/clown_check(var/mob/living/user) if((CLUMSY in user.mutations) && prob(50)) diff --git a/code/game/objects/items/weapons/grenades/smokebomb.dm b/code/game/objects/items/weapons/grenades/smokebomb.dm index 75c0e6a299..1cb98be61a 100644 --- a/code/game/objects/items/weapons/grenades/smokebomb.dm +++ b/code/game/objects/items/weapons/grenades/smokebomb.dm @@ -6,6 +6,7 @@ det_time = 20 item_state = "flashbang" slot_flags = SLOT_BELT + hud_state = "grenade_smoke" var/datum/effect/effect/system/smoke_spread/bad/smoke var/smoke_color var/smoke_strength = 8 diff --git a/icons/mob/ammoHUD.dmi b/icons/mob/ammoHUD.dmi new file mode 100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ZUw2NW0vuMVoqv{xF$VW(Zh&~_fDn_!5KmfxV7v+3kK%)EK?+=Gy|{{Gh6Cws?p7 zHCy4hk?NCic=Bl$h5d$)jInnDT^o5dFT199<>{sLi_*T~WD8Q|UNQ$g3~k+te1;O{*`A%oh!{D jbF${Szqdn0e~DFWObZ;p#>LwH0(|;}twq5xkDLDokapIH literal 0 HcmV?d00001 diff --git a/vorestation.dme b/vorestation.dme index b09968cc59..55b0592e30 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -169,6 +169,7 @@ #include "code\_onclick\rig.dm" #include "code\_onclick\telekinesis.dm" #include "code\_onclick\hud\_defines.dm" +#include "code\_onclick\hud\_defines_ch.dm" #include "code\_onclick\hud\_defines_vr.dm" #include "code\_onclick\hud\ability_screen_objects.dm" #include "code\_onclick\hud\action.dm" @@ -180,6 +181,7 @@ #include "code\_onclick\hud\ghost.dm" #include "code\_onclick\hud\gun_mode.dm" #include "code\_onclick\hud\hud.dm" +#include "code\_onclick\hud\hud_ch.dm" #include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\map_popups.dm" #include "code\_onclick\hud\minihud.dm" @@ -193,8 +195,8 @@ #include "code\_onclick\hud\robot.dm" #include "code\_onclick\hud\robot_vr.dm" #include "code\_onclick\hud\screen_objects.dm" +#include "code\_onclick\hud\screen_objects_ch.dm" #include "code\_onclick\hud\screen_objects_vr.dm" -#include "code\_onclick\hud\screen_objects_zz_ch.dm" #include "code\_onclick\hud\skybox.dm" #include "code\_onclick\hud\soulcatcher_guest.dm" #include "code\_onclick\hud\spell_screen_objects.dm" From 85e69ffba4e793be83bdbb53e6eff7ab8c7cc602 Mon Sep 17 00:00:00 2001 From: Rykka Date: Sun, 3 Apr 2022 21:51:07 -0600 Subject: [PATCH 02/11] Progress Commit 2 - Energy Gun HUD works, starting Projectiles Saving progress to resume later. --- code/_onclick/hud/screen_objects_ch.dm | 18 +++++++----- code/modules/projectiles/gun.dm | 5 ++++ code/modules/projectiles/gun_ch.dm | 28 ++++++++++++++++++- code/modules/projectiles/guns/energy.dm | 22 +++++++++++++++ .../projectiles/guns/projectile/shotgun.dm | 24 ++++++++++++++++ code/modules/projectiles/projectile/beams.dm | 5 ++++ .../modules/projectiles/projectile/bullets.dm | 8 ++++++ code/modules/projectiles/projectile_ch.dm | 2 ++ 8 files changed, 104 insertions(+), 8 deletions(-) diff --git a/code/_onclick/hud/screen_objects_ch.dm b/code/_onclick/hud/screen_objects_ch.dm index 07886a4546..2a0cf6f3e7 100644 --- a/code/_onclick/hud/screen_objects_ch.dm +++ b/code/_onclick/hud/screen_objects_ch.dm @@ -38,13 +38,17 @@ var/warned = FALSE var/static/list/ammo_screen_loc_list = list(ui_ammo_hud1, ui_ammo_hud2, ui_ammo_hud3 ,ui_ammo_hud4) -/obj/screen/ammo/proc/add_hud(var/mob/living/user) +/obj/screen/ammo/proc/add_hud(var/mob/living/user, var/obj/item/weapon/gun/G) + if(!user?.client) return + + // var/obj/item/weapon/gun/G = user.get_active_hand() + + if(!G) + CRASH("/obj/screen/ammo/proc/add_hud() has been called from [src] without the required param of G") - var/obj/item/weapon/gun/G = user.get_active_hand() - - if(!G || !G.has_ammo_counter() || !G.hud_enabled) + if(!G.has_ammo_counter()) return user.client.screen += src @@ -52,13 +56,13 @@ /obj/screen/ammo/proc/remove_hud(var/mob/living/user) user?.client?.screen -= src -/obj/screen/ammo/proc/update_hud(var/mob/living/user) +/obj/screen/ammo/proc/update_hud(var/mob/living/user, var/obj/item/weapon/gun/G) if(!user?.client?.screen.Find(src)) return - var/obj/item/weapon/gun/G = user.get_active_hand() + // var/obj/item/weapon/gun/G = user.get_active_hand() - if(!G || !istype(G) || !G.has_ammo_counter() || !G.hud_enabled || !G.get_ammo_type() || isnull(G.get_ammo_count())) + if(!G || !istype(G) || !G.has_ammo_counter() || !G.get_ammo_type() || isnull(G.get_ammo_count())) remove_hud() return diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 217f206381..4b56821d01 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -451,6 +451,9 @@ to_chat(nerd, "You're so tiny that the pull of the trigger causes you to drop the gun!") //YAWNEDIT: Knockdown code end + + // CHOMPEdit: TGMC Ammo HUD insertion: + user.hud_used.update_ammo_hud(user, src) // Similar to the above proc, but does not require a user, which is ideal for things like turrets. /obj/item/weapon/gun/proc/Fire_userless(atom/target) @@ -543,6 +546,7 @@ /obj/item/weapon/gun/proc/handle_click_empty(mob/user) if (user) user.visible_message("*click click*", "*click*") + user.hud_used.update_ammo_hud(user, src) else src.visible_message("*click click*") playsound(src, 'sound/weapons/empty.ogg', 100, 1) @@ -774,6 +778,7 @@ var/datum/firemode/new_mode = firemodes[sel_mode] new_mode.apply_to(src) to_chat(user, "\The [src] is now set to [new_mode.name].") + user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD return new_mode diff --git a/code/modules/projectiles/gun_ch.dm b/code/modules/projectiles/gun_ch.dm index 58e2fd9483..61e657ae58 100644 --- a/code/modules/projectiles/gun_ch.dm +++ b/code/modules/projectiles/gun_ch.dm @@ -1,2 +1,28 @@ /obj/item/weapon/gun - var/holy = 0 //For Divinely blessed guns \ No newline at end of file + var/holy = 0 //For Divinely blessed guns + +/* TGMC Ammo HUD Port Begin */ +/obj/item/weapon/gun + var/hud_enabled = TRUE + +/obj/item/weapon/gun/proc/has_ammo_counter() + return FALSE + +/obj/item/weapon/gun/proc/get_ammo_type() + return FALSE + +/obj/item/weapon/gun/proc/get_ammo_count() + return FALSE + +/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible. + if(slot == slot_l_hand || slot == slot_r_hand) + user.hud_used.add_ammo_hud(user, src) + else + user.hud_used.remove_ammo_hud(user, src) + + return ..() + +/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti. + user.hud_used.remove_ammo_hud(user, src) + + ..() \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index b869a7c6b5..c9e418e5c4 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -92,6 +92,9 @@ power_supply.give(rechargeamt) //... to recharge 1/5th the battery update_icon() + var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD + if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + M?.hud_used.update_ammo_hud(M, src) // CHOMPEdit: TGMC Ammo HUD else charge_tick = 0 return 1 @@ -132,6 +135,7 @@ playsound(src, 'sound/weapons/flipblade.ogg', 50, 1) update_icon() update_held_icon() + user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD else to_chat(user, "This cell is not fitted for [src].") return @@ -148,6 +152,7 @@ playsound(src, 'sound/weapons/empty.ogg', 50, 1) update_icon() update_held_icon() + user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD else to_chat(user, "[src] does not have a power cell.") @@ -235,3 +240,20 @@ results += ..() return results + +// CHOMPEDIT: TGMC AMMO HUD PORT Start +/obj/item/weapon/gun/energy/has_ammo_counter() + return TRUE + +/obj/item/weapon/gun/energy/get_ammo_type() + if(!projectile_type) + return list("unknown", "unknown") + else + var/obj/item/projectile/P = projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) + +/obj/item/weapon/gun/energy/get_ammo_count() + if(!power_supply) + return 0 + else + return FLOOR(power_supply.charge / max(charge_cost, 1), 1) \ No newline at end of file diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 7a00e2b92e..3771e5810a 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -1,6 +1,30 @@ /* * Shotgun */ +// TGMC Ammo HUD Insertion +/obj/item/weapon/gun/projectile/shotgun/has_ammo_counter() + return TRUE + +/obj/item/weapon/gun/projectile/shotgun/get_ammo_type() + if(load_method == MAGAZINE) + if(!ammo_magazine) + + else if(load_method == SINGLE_CASING|SPEEDLOADER && loaded.len) + + else + return list("unknown", "unknown") + +/obj/item/weapon/gun/projectile/shotgun/get_ammo_count() + if(load_method == MAGAZINE) + if(!ammo_magazine) + return chambered ? 1 : 0 + else + return chambered ? (ammo_magazine.stored_ammo + 1) : ammo_magazine.stored_ammo + else if(load_method == SINGLE_CASING|SPEEDLOADER) + if(chambered) + else + + /obj/item/weapon/gun/projectile/shotgun/pump name = "shotgun" // desc = "The mass-produced MarsTech Meteor 29 shotgun is a favourite of police and security forces on many worlds. Uses 12g rounds." //CHOMP Disable diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index 7cc79d8d15..4635684f25 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -20,6 +20,9 @@ muzzle_type = /obj/effect/projectile/muzzle/laser tracer_type = /obj/effect/projectile/tracer/laser impact_type = /obj/effect/projectile/impact/laser + + hud_state = "laser" + hud_state_empty = "battery_empty" /obj/item/projectile/beam/practice name = "laser" @@ -229,6 +232,8 @@ muzzle_type = /obj/effect/projectile/muzzle/stun tracer_type = /obj/effect/projectile/tracer/stun impact_type = /obj/effect/projectile/impact/stun + + hud_state = "taser" // TGMC Ammo HUD port /obj/item/projectile/beam/stun/weak name = "weak stun beam" diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index a1d09e76f1..2c2e0c12da 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -70,30 +70,38 @@ /obj/item/projectile/bullet/pistol // 9mm pistols and most SMGs. Sacrifice power for capacity. fire_sound = 'sound/weapons/gunshot2.ogg' damage = 20 + hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state_empty = "pistol_empty" // CHOMPEdit: Putting these here for easier upstream porting. /obj/item/projectile/bullet/pistol/ap damage = 15 armor_penetration = 30 + hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting. /obj/item/projectile/bullet/pistol/hp damage = 25 armor_penetration = -50 + hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting. /obj/item/projectile/bullet/pistol/medium // .45 (and maybe .40 if it ever gets added) caliber security pistols. Balance between capacity and power. fire_sound = 'sound/weapons/gunshot3.ogg' // Snappier sound. damage = 25 + hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting. /obj/item/projectile/bullet/pistol/medium/ap damage = 20 armor_penetration = 15 + hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting. /obj/item/projectile/bullet/pistol/medium/hp damage = 30 armor_penetration = -50 + hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting. /obj/item/projectile/bullet/pistol/strong // .357 and .44 caliber stuff. High power pistols like the Mateba or Desert Eagle. Sacrifice capacity for power. fire_sound = 'sound/weapons/gunshot4.ogg' damage = 60 + hud_state = "pistol_heavy" /obj/item/projectile/bullet/pistol/rubber/strong // "Rubber" bullets for high power pistols. fire_sound = 'sound/weapons/gunshot3.ogg' // Rubber shots have less powder, but these still have more punch than normal rubber shot. diff --git a/code/modules/projectiles/projectile_ch.dm b/code/modules/projectiles/projectile_ch.dm index a2af0b08be..649673c772 100644 --- a/code/modules/projectiles/projectile_ch.dm +++ b/code/modules/projectiles/projectile_ch.dm @@ -1,6 +1,8 @@ /obj/item/projectile /// If this projectile is holy. Silver bullets, etc. Currently no effects. var/holy = 0 + var/hud_state = "unknown" // TGMC Ammo HUD Port + var/hud_state_empty = "unknown" // TGMC Ammo HUD Port /obj/item/projectile/bullet/pellet/shotgun/silver name = "shrapnel" From ce6f0e568c3ea12f5d4df8d0f872d5ab8940a0e7 Mon Sep 17 00:00:00 2001 From: Rykka Date: Tue, 5 Apr 2022 21:26:50 -0600 Subject: [PATCH 03/11] Makes Projectile Ammo HUD code work! Now to just get all the boolets to have `hud_state`s set. D: --- code/_onclick/hud/screen_objects_ch.dm | 24 +++---- code/modules/projectiles/guns/projectile.dm | 60 ++++++++++++++++++ .../projectiles/guns/projectile/shotgun.dm | 26 +------- .../modules/projectiles/guns/projectile_ch.dm | 8 +++ icons/mob/{ammoHUD.dmi => screen_ammo.dmi} | Bin 5 files changed, 83 insertions(+), 35 deletions(-) rename icons/mob/{ammoHUD.dmi => screen_ammo.dmi} (100%) diff --git a/code/_onclick/hud/screen_objects_ch.dm b/code/_onclick/hud/screen_objects_ch.dm index 2a0cf6f3e7..0d70f974a5 100644 --- a/code/_onclick/hud/screen_objects_ch.dm +++ b/code/_onclick/hud/screen_objects_ch.dm @@ -32,7 +32,7 @@ // Begin TGMC Ammo HUD Port /obj/screen/ammo name = "ammo" - icon = 'icons/mob/ammoHUD.dmi' + icon = 'icons/mob/screen_ammo.dmi' icon_state = "ammo" screen_loc = ui_ammo_hud1 var/warned = FALSE @@ -74,7 +74,7 @@ overlays.Cut() - var/empty = image('icons/mob/ammoHUD.dmi', src, "[hud_state_empty]") + var/empty = image('icons/mob/screen_ammo.dmi', src, "[hud_state_empty]") if(rounds == 0) if(warned) @@ -91,21 +91,21 @@ overlays += empty else warned = FALSE - overlays += image('icons/mob/ammoHUD.dmi', src, "[hud_state]") + overlays += image('icons/mob/screen_ammo.dmi', src, "[hud_state]") rounds = num2text(rounds) //Handle the amount of rounds switch(length(rounds)) if(1) - overlays += image('icons/mob/ammoHUD.dmi', src, "o[rounds[1]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[1]]") if(2) - overlays += image('icons/mob/ammoHUD.dmi', src, "o[rounds[2]]") - overlays += image('icons/mob/ammoHUD.dmi', src, "t[rounds[1]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[2]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[1]]") if(3) - overlays += image('icons/mob/ammoHUD.dmi', src, "o[rounds[3]]") - overlays += image('icons/mob/ammoHUD.dmi', src, "t[rounds[2]]") - overlays += image('icons/mob/ammoHUD.dmi', src, "h[rounds[1]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[3]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[2]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "h[rounds[1]]") else //"0" is still length 1 so this means it's over 999 - overlays += image('icons/mob/ammoHUD.dmi', src, "o9") - overlays += image('icons/mob/ammoHUD.dmi', src, "t9") - overlays += image('icons/mob/ammoHUD.dmi', src, "h9") \ No newline at end of file + overlays += image('icons/mob/screen_ammo.dmi', src, "o9") + overlays += image('icons/mob/screen_ammo.dmi', src, "t9") + overlays += image('icons/mob/screen_ammo.dmi', src, "h9") \ No newline at end of file diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 31ffe40e13..e443fa27cb 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -98,6 +98,10 @@ if(handle_casings != HOLD_CASINGS) chambered = null + + var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD + if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + M?.hud_used.update_ammo_hud(M, src) //Attempts to load A into src, depending on the type of thing being loaded and the load_method @@ -117,6 +121,7 @@ AM.loc = src ammo_magazine = AM user.visible_message("[user] inserts [AM] into [src].", "You insert [AM] into [src].") + user.hud_used.update_ammo_hud(user, src) playsound(src, 'sound/weapons/flipblade.ogg', 50, 1) if(SPEEDLOADER) if(loaded.len >= max_shells) @@ -131,8 +136,10 @@ loaded += C AM.stored_ammo -= C //should probably go inside an ammo_magazine proc, but I guess less proc calls this way... count++ + user.hud_used.update_ammo_hud(user, src) if(count) user.visible_message("[user] reloads [src].", "You load [count] round\s into [src].") + user.hud_used.update_ammo_hud(user, src) playsound(src, 'sound/weapons/empty.ogg', 50, 1) AM.update_icon() else if(istype(A, /obj/item/ammo_casing)) @@ -168,6 +175,7 @@ sleep(1 SECOND) update_icon() + user.hud_used.update_ammo_hud(user, src) //attempts to unload src. If allow_dump is set to 0, the speedloader unloading method will be disabled /obj/item/weapon/gun/projectile/proc/unload_ammo(mob/user, var/allow_dump=1) @@ -177,6 +185,7 @@ playsound(src, 'sound/weapons/empty.ogg', 50, 1) ammo_magazine.update_icon() ammo_magazine = null + user.hud_used.update_ammo_hud(user, src) else if(loaded.len) //presumably, if it can be speed-loaded, it can be speed-unloaded. if(allow_dump && (load_method & SPEEDLOADER)) @@ -195,6 +204,7 @@ user.put_in_hands(C) user.visible_message("[user] removes \a [C] from [src].", "You remove \a [C] from [src].") playsound(src, 'sound/weapons/empty.ogg', 50, 1) + user.hud_used.update_ammo_hud(user, src) else to_chat(user, "[src] is empty.") update_icon() @@ -256,3 +266,53 @@ unload_ammo(usr) */ + +// TGMC Ammo HUD Insertion +/obj/item/weapon/gun/projectile/has_ammo_counter() + return TRUE + +/obj/item/weapon/gun/projectile/get_ammo_type() + if(load_method == MAGAZINE) + if(chambered) // Do we have a round chambered + var/obj/item/ammo_casing/A = chambered + var/obj/item/projectile/P = A.projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) + else if(loaded.len && ammo_magazine && ammo_magazine.stored_ammo) // Are we loaded, have a mag, and have ammo in the mag? + var/obj/item/ammo_casing/A = ammo_magazine.stored_ammo[1] + var/obj/item/projectile/P = A.projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) + else + return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case + else if(load_method == SINGLE_CASING|SPEEDLOADER) + if(chambered) // Do we have a round loaded in the chamber? + var/obj/item/ammo_casing/A = chambered + var/obj/item/projectile/P = A.projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the casing's ammo hud state + else if(!chambered && loaded.len) // Else, is the gun loaded, but no rounds in chamber currently? + var/obj/item/ammo_casing/A = loaded[1] + var/obj/item/projectile/P = A.projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the ammunition in mag's hud_state + else + return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case + else + return list("unknown", "unknown") // Failsafe if we somehow fail both methods + +/obj/item/weapon/gun/projectile/get_ammo_count() + if(load_method == MAGAZINE) + if(!ammo_magazine) // No magazine? Return if we have a round chambered or not + return chambered ? 1 : 0 + else if(ammo_magazine) // If we have a magazine loaded, check if chambered and return either the magazine + chambered or the loaded amount + return chambered ? (ammo_magazine.stored_ammo.len + 1) : ammo_magazine.stored_ammo.len + else // Completely unloaded or code failure. + return 0 + else if(load_method == SINGLE_CASING|SPEEDLOADER) + if(chambered && !loaded.len) // Chambered, but nothing in the magazine/internal ammo + return chambered ? 1: 0 + else if(chambered && loaded.len) // Chambered + has ammo + return loaded.len + (chambered ? 1 : 0) + else if(loaded.len) // Has ammo, no round chambered + return loaded.len + else // Completely unloaded, nothing in chamber or ammo, or code failed??? + return 0 + else + CRASH("/obj/item/weapon/gun/projectile/get_ammo_count() was called from [src] but did not have a valid load_method set! Load_method set was [load_method].") diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 3771e5810a..ed17f9ce42 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -1,29 +1,6 @@ /* * Shotgun */ -// TGMC Ammo HUD Insertion -/obj/item/weapon/gun/projectile/shotgun/has_ammo_counter() - return TRUE - -/obj/item/weapon/gun/projectile/shotgun/get_ammo_type() - if(load_method == MAGAZINE) - if(!ammo_magazine) - - else if(load_method == SINGLE_CASING|SPEEDLOADER && loaded.len) - - else - return list("unknown", "unknown") - -/obj/item/weapon/gun/projectile/shotgun/get_ammo_count() - if(load_method == MAGAZINE) - if(!ammo_magazine) - return chambered ? 1 : 0 - else - return chambered ? (ammo_magazine.stored_ammo + 1) : ammo_magazine.stored_ammo - else if(load_method == SINGLE_CASING|SPEEDLOADER) - if(chambered) - else - /obj/item/weapon/gun/projectile/shotgun/pump name = "shotgun" @@ -75,12 +52,14 @@ else chambered.loc = get_turf(src) // Eject casing chambered = null + user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD Port // Load next shell if(loaded.len) var/obj/item/ammo_casing/AC = loaded[1] // Load next casing. loaded -= AC // Remove casing from loaded list. chambered = AC + user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD Port if(pump_animation) // This affects all bolt action and shotguns. flick("[pump_animation]", src) // This plays any pumping @@ -212,6 +191,7 @@ burst = 2 user.visible_message("The shotgun goes off!", "The shotgun goes off in your face!") Fire_userless(user) + user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD Port burst = burstsetting return if(do_after(user, 30)) // SHIT IS STEALTHY EYYYYY diff --git a/code/modules/projectiles/guns/projectile_ch.dm b/code/modules/projectiles/guns/projectile_ch.dm index 6fc2391ca1..768331c771 100644 --- a/code/modules/projectiles/guns/projectile_ch.dm +++ b/code/modules/projectiles/guns/projectile_ch.dm @@ -106,6 +106,7 @@ playsound(src, sound_ejectchamber, 50, 0) user.visible_message("[user] pulls back \the [bolt_name] before releasing it[close_open_ejected] causing it to slide forward again[casing_chambered].", \ "You pull back \the [bolt_name] before releasing it[close_open_ejected] causing it to slide forward again[casing_chambered].") + user.hud_used.update_ammo_hud(user, src) else if(opened) playsound(src, sound_eject, 50, 0) if(locked) @@ -135,6 +136,7 @@ else user.visible_message("[user] closes \the [bolt_name][casing_chambered].", \ "You close \the [bolt_name][casing_chambered].") + user.hud_used.update_ammo_hud(user, src) /obj/item/weapon/gun/projectile/proc/bolt_toggle(var/manual) if(!bolt_open) @@ -298,6 +300,7 @@ chamber_bullet() bolt_toggle() playsound(src, 'sound/weapons/flipblade.ogg', 50, 1) + user.hud_used.update_ammo_hud(user, src) if(SPEEDLOADER) if(only_open_load && !bolt_open) to_chat(user, "[src] must have its bolt open to be loaded!") @@ -317,6 +320,7 @@ if(count) user.visible_message("[user] reloads [src].", "You load [count] round\s into [src].") playsound(src, 'sound/weapons/empty.ogg', 50, 1) + user.hud_used.update_ammo_hud(user, src) AM.update_icon() else if(istype(A, /obj/item/ammo_casing)) var/obj/item/ammo_casing/C = A @@ -330,6 +334,7 @@ if(do_after(user,5)) user.visible_message("[user] slides \the [C] into the [src]'s chamber.","You slide \the [C] into the [src]'s chamber.") chambered = C + user.hud_used.update_ammo_hud(user, src) else return else if(!(CHECK_BITFIELD(auto_loading_type,LOCK_OPEN_EMPTY) || (CHECK_BITFIELD(auto_loading_type,LOCK_MANUAL_LOCK)))) @@ -337,6 +342,7 @@ user.visible_message("[user] holds open \the [src]'s [bolt_name] and slides [C] into the chamber before letting the bolt close again.","You slide \the [C] into the [src]'s chamber.") chambered = C + user.hud_used.update_ammo_hud(user, src) else return else @@ -366,6 +372,7 @@ loaded.Insert(1, C) //add to the head of the list user.visible_message("[user] inserts \a [C] into [src].", "You insert \a [C] into [src].") playsound(src, 'sound/weapons/empty.ogg', 50, 1) + user.hud_used.update_ammo_hud(user, src) else if(istype(A, /obj/item/weapon/storage)) var/obj/item/weapon/storage/storage = A @@ -379,6 +386,7 @@ continue load_ammo(ammo, user) + user.hud_used.update_ammo_hud(user, src) if(loaded.len >= max_shells) to_chat(user, "[src] is full.") diff --git a/icons/mob/ammoHUD.dmi b/icons/mob/screen_ammo.dmi similarity index 100% rename from icons/mob/ammoHUD.dmi rename to icons/mob/screen_ammo.dmi From 0cdd2da44ca50a54ecc6343e654210d750080bd0 Mon Sep 17 00:00:00 2001 From: Rykka Date: Tue, 5 Apr 2022 22:44:02 -0600 Subject: [PATCH 04/11] Adds hud_states to almost all weaponry, credit to Serdy Reshuffles files to match Polaris --- code/_onclick/hud/screen_objects.dm | 81 +++++++++++++++++ code/_onclick/hud/screen_objects_ch.dm | 82 +----------------- .../guns/energy/cell_loaded_vr/nerd_cells.dm | 1 + code/modules/projectiles/projectile/beams.dm | 40 +++++++-- .../projectiles/projectile/beams_ch.dm | 7 ++ .../modules/projectiles/projectile/bullets.dm | 38 ++++++++ .../projectiles/projectile/bullets_ch.dm | 44 +++++++++- code/modules/projectiles/projectile/energy.dm | 32 ++++++- .../projectiles/projectile/energy_ch.dm | 2 + .../projectiles/projectile/energy_yw.dm | 7 ++ .../projectiles/projectile/magnetic.dm | 13 +++ .../projectiles/projectile/magnetic_ch.dm | 2 + .../modules/projectiles/projectile/special.dm | 14 ++- icons/mob/screen_ammo.dmi | Bin 5639 -> 5633 bytes 14 files changed, 272 insertions(+), 91 deletions(-) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 00446add6d..c4b80f27ae 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -898,3 +898,84 @@ icon_state = null plane = PLANE_HOLOMAP_ICONS appearance_flags = KEEP_TOGETHER + +// Begin TGMC Ammo HUD Port +/obj/screen/ammo + name = "ammo" + icon = 'icons/mob/screen_ammo.dmi' + icon_state = "ammo" + screen_loc = ui_ammo_hud1 + var/warned = FALSE + var/static/list/ammo_screen_loc_list = list(ui_ammo_hud1, ui_ammo_hud2, ui_ammo_hud3 ,ui_ammo_hud4) + +/obj/screen/ammo/proc/add_hud(var/mob/living/user, var/obj/item/weapon/gun/G) + + if(!user?.client) + return + + // var/obj/item/weapon/gun/G = user.get_active_hand() + + if(!G) + CRASH("/obj/screen/ammo/proc/add_hud() has been called from [src] without the required param of G") + + if(!G.has_ammo_counter()) + return + + user.client.screen += src + +/obj/screen/ammo/proc/remove_hud(var/mob/living/user) + user?.client?.screen -= src + +/obj/screen/ammo/proc/update_hud(var/mob/living/user, var/obj/item/weapon/gun/G) + if(!user?.client?.screen.Find(src)) + return + + // var/obj/item/weapon/gun/G = user.get_active_hand() + + if(!G || !istype(G) || !G.has_ammo_counter() || !G.get_ammo_type() || isnull(G.get_ammo_count())) + remove_hud() + return + + var/list/ammo_type = G.get_ammo_type() + var/rounds = G.get_ammo_count() + + var/hud_state = ammo_type[1] + var/hud_state_empty = ammo_type[2] + + overlays.Cut() + + var/empty = image('icons/mob/screen_ammo.dmi', src, "[hud_state_empty]") + + if(rounds == 0) + if(warned) + overlays += empty + else + warned = TRUE + var/obj/screen/ammo/F = new /obj/screen/ammo(src) + F.icon_state = "frame" + user.client.screen += F + flick("[hud_state_empty]_flash", F) + spawn(20) + user.client.screen -= F + qdel(F) + overlays += empty + else + warned = FALSE + overlays += image('icons/mob/screen_ammo.dmi', src, "[hud_state]") + + rounds = num2text(rounds) + //Handle the amount of rounds + switch(length(rounds)) + if(1) + overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[1]]") + if(2) + overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[2]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[1]]") + if(3) + overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[3]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[2]]") + overlays += image('icons/mob/screen_ammo.dmi', src, "h[rounds[1]]") + else //"0" is still length 1 so this means it's over 999 + overlays += image('icons/mob/screen_ammo.dmi', src, "o9") + overlays += image('icons/mob/screen_ammo.dmi', src, "t9") + overlays += image('icons/mob/screen_ammo.dmi', src, "h9") \ No newline at end of file diff --git a/code/_onclick/hud/screen_objects_ch.dm b/code/_onclick/hud/screen_objects_ch.dm index 0d70f974a5..c229c3c57c 100644 --- a/code/_onclick/hud/screen_objects_ch.dm +++ b/code/_onclick/hud/screen_objects_ch.dm @@ -28,84 +28,4 @@ object_overlays += item_overlay add_overlay(object_overlays) - -// Begin TGMC Ammo HUD Port -/obj/screen/ammo - name = "ammo" - icon = 'icons/mob/screen_ammo.dmi' - icon_state = "ammo" - screen_loc = ui_ammo_hud1 - var/warned = FALSE - var/static/list/ammo_screen_loc_list = list(ui_ammo_hud1, ui_ammo_hud2, ui_ammo_hud3 ,ui_ammo_hud4) - -/obj/screen/ammo/proc/add_hud(var/mob/living/user, var/obj/item/weapon/gun/G) - - if(!user?.client) - return - - // var/obj/item/weapon/gun/G = user.get_active_hand() - - if(!G) - CRASH("/obj/screen/ammo/proc/add_hud() has been called from [src] without the required param of G") - - if(!G.has_ammo_counter()) - return - - user.client.screen += src - -/obj/screen/ammo/proc/remove_hud(var/mob/living/user) - user?.client?.screen -= src - -/obj/screen/ammo/proc/update_hud(var/mob/living/user, var/obj/item/weapon/gun/G) - if(!user?.client?.screen.Find(src)) - return - - // var/obj/item/weapon/gun/G = user.get_active_hand() - - if(!G || !istype(G) || !G.has_ammo_counter() || !G.get_ammo_type() || isnull(G.get_ammo_count())) - remove_hud() - return - - var/list/ammo_type = G.get_ammo_type() - var/rounds = G.get_ammo_count() - - var/hud_state = ammo_type[1] - var/hud_state_empty = ammo_type[2] - - overlays.Cut() - - var/empty = image('icons/mob/screen_ammo.dmi', src, "[hud_state_empty]") - - if(rounds == 0) - if(warned) - overlays += empty - else - warned = TRUE - var/obj/screen/ammo/F = new /obj/screen/ammo(src) - F.icon_state = "frame" - user.client.screen += F - flick("[hud_state_empty]_flash", F) - spawn(20) - user.client.screen -= F - qdel(F) - overlays += empty - else - warned = FALSE - overlays += image('icons/mob/screen_ammo.dmi', src, "[hud_state]") - - rounds = num2text(rounds) - //Handle the amount of rounds - switch(length(rounds)) - if(1) - overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[1]]") - if(2) - overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[2]]") - overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[1]]") - if(3) - overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[3]]") - overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[2]]") - overlays += image('icons/mob/screen_ammo.dmi', src, "h[rounds[1]]") - else //"0" is still length 1 so this means it's over 999 - overlays += image('icons/mob/screen_ammo.dmi', src, "o9") - overlays += image('icons/mob/screen_ammo.dmi', src, "t9") - overlays += image('icons/mob/screen_ammo.dmi', src, "h9") \ No newline at end of file + \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy/cell_loaded_vr/nerd_cells.dm b/code/modules/projectiles/guns/energy/cell_loaded_vr/nerd_cells.dm index 48e16029e2..34a1790ffb 100644 --- a/code/modules/projectiles/guns/energy/cell_loaded_vr/nerd_cells.dm +++ b/code/modules/projectiles/guns/energy/cell_loaded_vr/nerd_cells.dm @@ -13,6 +13,7 @@ damage = 0 check_armour = "laser" light_color = "#80F5FF" + hud_state = "laser_disabler" combustion = FALSE diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index 4635684f25..d363bc7ccf 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -20,7 +20,7 @@ muzzle_type = /obj/effect/projectile/muzzle/laser tracer_type = /obj/effect/projectile/tracer/laser impact_type = /obj/effect/projectile/impact/laser - + hud_state = "laser" hud_state_empty = "battery_empty" @@ -32,15 +32,18 @@ damage_type = BURN check_armour = "laser" eyeblur = 2 + hud_state = "laser" /obj/item/projectile/beam/weaklaser name = "weak laser" icon_state = "laser" damage = 15 + hud_state = "laser" /obj/item/projectile/beam/weaklaser/blue icon_state = "bluelaser" light_color = "#0066FF" + hud_state = "laser_disabler" muzzle_type = /obj/effect/projectile/muzzle/laser_blue tracer_type = /obj/effect/projectile/tracer/laser_blue @@ -48,14 +51,17 @@ /obj/item/projectile/beam/smalllaser damage = 25 + hud_state = "laser" /obj/item/projectile/beam/burstlaser damage = 30 armor_penetration = 10 + hud_state = "laser" /obj/item/projectile/beam/midlaser damage = 40 armor_penetration = 10 + hud_state = "laser" /obj/item/projectile/beam/heavylaser name = "heavy laser" @@ -70,6 +76,7 @@ muzzle_type = /obj/effect/projectile/muzzle/laser_heavy tracer_type = /obj/effect/projectile/tracer/laser_heavy impact_type = /obj/effect/projectile/impact/laser_heavy + hud_state = "laser_overcharge" /obj/item/projectile/beam/heavylaser/fakeemitter name = "emitter beam" @@ -77,6 +84,7 @@ fire_sound = 'sound/weapons/emitter.ogg' light_color = "#00CC33" excavation_amount = 140 // 2 shots to dig a standard rock turf. Superior due to being a mounted tool beam, to make it actually viable. + hud_state = "laser_overcharge" muzzle_type = /obj/effect/projectile/muzzle/emitter tracer_type = /obj/effect/projectile/tracer/emitter @@ -86,6 +94,7 @@ damage = 80 armor_penetration = 50 light_color = "#FF0D00" + hud_state = "laser_overcharge" /obj/item/projectile/beam/xray name = "xray beam" @@ -94,6 +103,7 @@ damage = 25 armor_penetration = 50 light_color = "#00CC33" + hud_state = "laser_sniper" muzzle_type = /obj/effect/projectile/muzzle/xray tracer_type = /obj/effect/projectile/tracer/xray @@ -107,6 +117,7 @@ armor_penetration = 90 irradiate = 20 light_color = "#00CC33" + hud_state = "laser_sniper" muzzle_type = /obj/effect/projectile/muzzle/xray tracer_type = /obj/effect/projectile/tracer/xray @@ -118,6 +129,7 @@ fire_sound = 'sound/weapons/eluger.ogg' damage = 40 light_color = "#00C6FF" + hud_state = "laser_disabler" muzzle_type = /obj/effect/projectile/muzzle/laser_omni tracer_type = /obj/effect/projectile/tracer/laser_omni @@ -130,6 +142,7 @@ damage = 100 //Badmin toy, don't care armor_penetration = 100 light_color = "#0066FF" + hud_state = "pulse" muzzle_type = /obj/effect/projectile/muzzle/laser_pulse tracer_type = /obj/effect/projectile/tracer/laser_pulse @@ -147,6 +160,7 @@ damage = 0 // The actual damage is computed in /code/modules/power/singularity/emitter.dm light_color = "#00CC33" excavation_amount = 70 // 3 shots to mine a turf + hud_state = "laser_overcharge" muzzle_type = /obj/effect/projectile/muzzle/emitter tracer_type = /obj/effect/projectile/tracer/emitter @@ -160,13 +174,14 @@ no_attack_log = 1 damage_type = BURN check_armour = "laser" + hud_state = "monkey" combustion = FALSE /obj/item/projectile/beam/lasertag/blue icon_state = "bluelaser" light_color = "#0066FF" - + hud_state = "monkey" muzzle_type = /obj/effect/projectile/muzzle/laser_blue tracer_type = /obj/effect/projectile/tracer/laser_blue impact_type = /obj/effect/projectile/impact/laser_blue @@ -181,6 +196,7 @@ /obj/item/projectile/beam/lasertag/red icon_state = "laser" light_color = "#FF0D00" + hud_state = "monkey" /obj/item/projectile/beam/lasertag/red/on_hit(var/atom/target, var/blocked = 0) if(ishuman(target)) @@ -192,6 +208,7 @@ /obj/item/projectile/beam/lasertag/omni//A laser tag bolt that stuns EVERYONE icon_state = "omnilaser" light_color = "#00C6FF" + hud_state = "monkey" muzzle_type = /obj/effect/projectile/muzzle/laser_omni tracer_type = /obj/effect/projectile/tracer/laser_omni @@ -211,6 +228,7 @@ damage = 50 armor_penetration = 10 light_color = "#00CC33" + hud_state = "laser_sniper" muzzle_type = /obj/effect/projectile/muzzle/xray tracer_type = /obj/effect/projectile/tracer/xray @@ -227,12 +245,13 @@ light_color = "#FFFFFF" hitsound = 'sound/weapons/zapbang.ogg' + combustion = FALSE muzzle_type = /obj/effect/projectile/muzzle/stun tracer_type = /obj/effect/projectile/tracer/stun impact_type = /obj/effect/projectile/impact/stun - + hud_state = "taser" // TGMC Ammo HUD port /obj/item/projectile/beam/stun/weak @@ -269,6 +288,7 @@ muzzle_type = /obj/effect/projectile/muzzle/laser_omni tracer_type = /obj/effect/projectile/tracer/laser_omni impact_type = /obj/effect/projectile/impact/laser_omni + hud_state = "laser_disabler" /obj/item/projectile/beam/stun/blue icon_state = "bluelaser" @@ -276,6 +296,7 @@ muzzle_type = /obj/effect/projectile/muzzle/laser_blue tracer_type = /obj/effect/projectile/tracer/laser_blue impact_type = /obj/effect/projectile/impact/laser_blue + hud_state = "laser_disabler" /obj/item/projectile/beam/disable name = "disabler beam" @@ -285,6 +306,7 @@ agony = 100 //One shot stuns for the time being until adjustments are fully made. damage_type = HALLOSS light_color = "#00CECE" + hud_state = "laser_disabler" muzzle_type = /obj/effect/projectile/muzzle/laser_omni tracer_type = /obj/effect/projectile/tracer/laser_omni @@ -303,6 +325,7 @@ agony = 15 eyeblur = 2 hitsound = 'sound/weapons/zapbang.ogg' + hud_state = "taser" /obj/item/projectile/beam/shock/weak damage = 5 @@ -317,7 +340,7 @@ muzzle_type = /obj/effect/projectile/muzzle/precursor tracer_type = /obj/effect/projectile/tracer/precursor impact_type = /obj/effect/projectile/impact/precursor - + hud_state = "plasma_rifle" damage = 48 armor_penetration = 10 /obj/item/projectile/beam/eluger @@ -327,6 +350,7 @@ muzzle_type = /obj/effect/projectile/muzzle/xray tracer_type = /obj/effect/projectile/tracer/xray impact_type = /obj/effect/projectile/impact/xray + hud_state = "laser" /obj/item/projectile/beam/imperial name = "laser beam" @@ -336,7 +360,7 @@ muzzle_type = /obj/effect/projectile/muzzle/darkmatter tracer_type = /obj/effect/projectile/tracer/darkmatter impact_type = /obj/effect/projectile/impact/darkmatter - + hud_state = "plasma_rifle_blast" // // Projectile Beam Definitions // @@ -347,7 +371,7 @@ damage_type = ELECTROCUTE //You should be safe inside a voidsuit sharp = FALSE //"Wide" spectrum beam light_color = COLOR_GOLD - + hud_state = "monkey" excavation_amount = 200 // Good at shooting rocks muzzle_type = /obj/effect/projectile/muzzle/pointdefense @@ -364,6 +388,8 @@ agony = 5 damage_type = HALLOSS light_color = "#00CC33" + hud_state = "flame_green" + hud_state_empty = "flame_empty" muzzle_type = /obj/effect/projectile/muzzle/xray tracer_type = /obj/effect/projectile/tracer/xray @@ -389,7 +415,7 @@ damage_type = BURN check_armour = "laser" light_color = "#80F5FF" - + hud_state = "laser_disabler" combustion = FALSE muzzle_type = /obj/effect/projectile/muzzle/medigun diff --git a/code/modules/projectiles/projectile/beams_ch.dm b/code/modules/projectiles/projectile/beams_ch.dm index cc0925cad5..6c2afaf856 100644 --- a/code/modules/projectiles/projectile/beams_ch.dm +++ b/code/modules/projectiles/projectile/beams_ch.dm @@ -8,6 +8,7 @@ muzzle_type = /obj/effect/projectile/muzzle/phaser tracer_type = /obj/effect/projectile/tracer/phaser impact_type = /obj/effect/projectile/impact/phaser + hud_state = "laser_heat" /obj/item/projectile/beam/phaser/light @@ -20,6 +21,7 @@ tracer_type = /obj/effect/projectile/tracer/phaser/light impact_type = /obj/effect/projectile/impact/phaser/light + /obj/item/projectile/beam/phaser/heavy SA_bonus_damage = 55 icon_state = "phaser_heavy" @@ -29,16 +31,19 @@ tracer_type = /obj/effect/projectile/tracer/phaser/heavy impact_type = /obj/effect/projectile/impact/phaser/heavy + /obj/item/projectile/beam/phaser/heavy/cannon damage = 15 SA_bonus_damage = 60 + /obj/effect/projectile/tracer/phaser icon = 'icons/obj/projectiles_ch.dmi' icon_state = "phaser_tracer" light_color = "#F18F12" light_range = 2 light_power = 0.5 + hud_state = "laser_heat" /obj/effect/projectile/tracer/phaser/heavy icon_state = "phaser_heavy_tracer" @@ -56,6 +61,7 @@ light_color = "#F18F12" light_range = 2 light_power = 0.5 + hud_state = "laser_heat" /obj/effect/projectile/muzzle/phaser/heavy icon_state = "phaser_heavy_muzzle" @@ -73,6 +79,7 @@ light_color = "#F18F12" light_range = 2 light_power = 0.5 + hud_state = "laser_heat" /obj/effect/projectile/impact/phaser/heavy icon_state = "phaser_heavy_impact" diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 2c2e0c12da..9e6724b0fa 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -12,6 +12,7 @@ hitsound_wall = "ricochet" impact_effect_type = /obj/effect/temp_visual/impact_effect var/mob_passthrough_check = 0 + hud_state = "pistol_lightap" muzzle_type = /obj/effect/projectile/muzzle/bullet @@ -110,6 +111,7 @@ embed_chance = 0 sharp = FALSE check_armour = "melee" + hud_state = "pistol_special" /obj/item/projectile/bullet/pistol/rubber // "Rubber" bullets for all other pistols. name = "rubber bullet" @@ -118,6 +120,7 @@ embed_chance = 0 sharp = FALSE check_armour = "melee" + hud_state = "pistol_special" fire_sound ='sound/weapons/Gunshot_pathetic.ogg' // Rubber shots have less powder in the casing. /* shotgun projectiles */ @@ -128,6 +131,8 @@ fire_sound = 'sound/weapons/Gunshot_shotgun.ogg' damage = 50 armor_penetration = 20 + hud_state = "shotgun_slug" + hud_state_empty = "shotgun_empty" /obj/item/projectile/bullet/shotgun/beanbag //because beanbags are not bullets name = "beanbag" @@ -136,6 +141,7 @@ embed_chance = 0 sharp = FALSE check_armour = "melee" + hud_state = "shotgun_beanbag" //Should do about 80 damage at 1 tile distance (adjacent), and 50 damage at 3 tiles distance. //Overall less damage than slugs in exchange for more damage at very close range and more embedding @@ -146,12 +152,14 @@ pellets = 6 range_step = 1 spread_step = 10 + hud_state = "shotgun_buckshot" /obj/item/projectile/bullet/pellet/shotgun/flak damage = 2 //The main weapon using these fires four at a time, usually with different destinations. Usually. range_step = 2 spread_step = 30 armor_penetration = 10 + hud_state = "shotgun_flechette" //EMP shotgun 'slug', it's basically a beanbag that pops a tiny emp when it hits. //Not currently used /obj/item/projectile/bullet/shotgun/ion @@ -161,6 +169,7 @@ embed_chance = 0 sharp = FALSE check_armour = "melee" + hud_state = "shotgun_ion" combustion = FALSE @@ -176,46 +185,57 @@ fire_sound = 'sound/weapons/Gunshot_generic_rifle.ogg' armor_penetration = 15 penetrating = 1 + hud_state = "rifle" + hud_state_empty = "rifle_empty" /obj/item/projectile/bullet/rifle/a762 fire_sound = 'sound/weapons/Gunshot_heavy.ogg' damage = 35 + hud_state = "rifle_heavy" /obj/item/projectile/bullet/rifle/a762/sniper // Hitscan specifically for sniper ammo; to be implimented at a later date, probably for the SVD. -Ace fire_sound = 'sound/weapons/Gunshot_sniper.ogg' hitscan = 1 //so the ammo isn't useless as a sniper weapon + hud_state = "hivelo" /obj/item/projectile/bullet/rifle/a762/ap damage = 30 armor_penetration = 50 // At 30 or more armor, this will do more damage than standard rounds. + hud_state = "rifle_ap" /obj/item/projectile/bullet/rifle/a762/hp damage = 40 armor_penetration = -50 penetrating = 0 + hud_state = "hivelo_iff" /obj/item/projectile/bullet/rifle/a762/hunter // Optimized for killing simple animals and not people, because Balance(tm) damage = 20 SA_bonus_damage = 50 // 70 total on animals. SA_vulnerability = SA_ANIMAL + hud_state = "rifle_heavy" /obj/item/projectile/bullet/rifle/a545 fire_sound = 'sound/weapons/Gunshot_light.ogg' damage = 25 + hud_state = "rifle" /obj/item/projectile/bullet/rifle/a545/ap damage = 20 armor_penetration = 50 // At 40 or more armor, this will do more damage than standard rounds. + hud_state = "rifle_ap" /obj/item/projectile/bullet/rifle/a545/hp damage = 35 armor_penetration = -50 penetrating = 0 + hud_state = "hivelo_iff" /obj/item/projectile/bullet/rifle/a545/hunter damage = 15 SA_bonus_damage = 35 // 50 total on animals. SA_vulnerability = SA_ANIMAL + hud_state = "rifle_heavy" /obj/item/projectile/bullet/rifle/a145 // 14.5�114mm is bigger than a .50 BMG round. fire_sound = 'sound/weapons/Gunshot_cannon.ogg' // This is literally an anti-tank rifle caliber. It better sound like a fucking cannon. @@ -225,6 +245,7 @@ penetrating = 5 armor_penetration = 80 hitscan = 1 //so the PTR isn't useless as a sniper weapon + hud_state = "sniper" icon_state = "bullet_alt" tracer_type = /obj/effect/projectile/tracer/cannon @@ -235,10 +256,12 @@ weaken = 0 penetrating = 15 armor_penetration = 90 + hud_state = "sniper_flak" /obj/item/projectile/bullet/rifle/a44rifle fire_sound = 'sound/weapons/gunshot4.ogg' damage = 50 + hud_state = "revolver" /* Miscellaneous */ @@ -246,11 +269,13 @@ name = "co bullet" damage = 20 damage_type = OXY + hud_state = "pistol_tranq" /obj/item/projectile/bullet/cyanideround name = "poison bullet" damage = 40 damage_type = TOX + hud_state = "pistol_tranq" /obj/item/projectile/bullet/burstbullet name = "exploding bullet" @@ -258,6 +283,7 @@ damage = 20 embed_chance = 0 edge = TRUE + hud_state = "pistol_fire" /obj/item/projectile/bullet/burstbullet/on_hit(var/atom/target, var/blocked = 0) if(isturf(target)) @@ -273,6 +299,7 @@ damage_type = BURN incendiary = 0.5 flammability = 2 + hud_state = "pistol_fire" /obj/item/projectile/bullet/incendiary/flamethrower name = "ball of fire" @@ -285,12 +312,14 @@ agony = 30 range = 4 vacuum_traversal = 0 + hud_state = "flame" /obj/item/projectile/bullet/incendiary/flamethrower/large damage = 5 incendiary = 3 flammability = 2 range = 6 + hud_state = "flame" /obj/item/projectile/bullet/incendiary/flamethrower/tiny damage = 2 @@ -300,11 +329,13 @@ modifier_duration = 20 SECONDS range = 6 agony = 0 + hud_state = "flame" /* Practice rounds and blanks */ /obj/item/projectile/bullet/practice damage = 5 + hud_state = "smg_light" /obj/item/projectile/bullet/pistol/cap // Just the primer, such as a cap gun. name = "cap" @@ -314,6 +345,7 @@ nodamage = 1 embed_chance = 0 sharp = FALSE + hud_state = "monkey" combustion = FALSE @@ -329,6 +361,7 @@ nodamage = 1 embed_chance = 0 sharp = FALSE + hud_state = "smg_light" /* BB Rounds */ /obj/item/projectile/bullet/bb // Generic single BB @@ -338,6 +371,7 @@ embed_chance = 0 sharp = FALSE silenced = TRUE + hud_state = "pistol_light" /obj/item/projectile/bullet/pellet/shotgun/bb // Shotgun name = "BB" @@ -349,6 +383,7 @@ range_step = 1 spread_step = 10 silenced = TRUE + hud_state = "pistol_light" /* toy projectiles */ /obj/item/projectile/bullet/cap @@ -362,6 +397,7 @@ impact_effect_type = null fire_sound = 'sound/effects/snap.ogg' combustion = FALSE + hud_state = "pistol_light" /obj/item/projectile/bullet/cap/process() loc = null @@ -381,6 +417,7 @@ icon = 'icons/obj/gun_toy.dmi' icon_state = "foamdart_proj" range = 15 + hud_state = "grenade_dummy" /obj/item/projectile/bullet/foam_dart/on_impact(var/atom/A) . = ..() @@ -409,6 +446,7 @@ icon = 'icons/obj/gun_toy.dmi' icon_state = "foamdart_riot_proj" range = 15 + hud_state = "grenade_he" /obj/item/projectile/bullet/foam_dart_riot/on_impact(var/atom/A) . = ..() diff --git a/code/modules/projectiles/projectile/bullets_ch.dm b/code/modules/projectiles/projectile/bullets_ch.dm index 27f3c5e259..5a86baf385 100644 --- a/code/modules/projectiles/projectile/bullets_ch.dm +++ b/code/modules/projectiles/projectile/bullets_ch.dm @@ -80,16 +80,19 @@ only use the hollow_point and armor_penetration values.*/ velocity = 716 damage = 15 armor_penetration = 15 //Unfortunately my penetration code doesn't recognize the glory of 5.7x28 FN, so we must show it the wae. + hud_state = "smg_light" /obj/item/projectile/bullet/a57/ap grains = 23 energy_add = 312.75 velocity = 850 armor_penetration = 25 //Also, no, this isn't as high as it looks because of the formulas I was using. This would have around a 35% chance of piercing combat armor(50 bullet armor) + hud_state = "smg_ap" /obj/item/projectile/bullet/a57/hp hollow_point = TRUE armor_penetration = -10 + hud_state = "smg" /obj/item/projectile/bullet/a357 fire_sound = 'sound/weapons/gunshot4.ogg' @@ -97,27 +100,32 @@ only use the hollow_point and armor_penetration values.*/ grains = 125 velocity = 440 damage = 20 + hud_state = "revolver" /obj/item/projectile/bullet/a357/ap energy_add = 298.07 velocity = 480 armor_penetration = 15 + hud_state = "revolver_heavy" /obj/item/projectile/bullet/a357/hp hollow_point = TRUE armor_penetration = -10 + hud_state = "revolver_slim" /obj/item/projectile/bullet/a38 fire_sound = 'sound/weapons/gunshot2.ogg' diam = 9.1 grains = 147 velocity = 270 + hud_state = "revolver_small" /obj/item/projectile/bullet/a38/ap grains = 125 energy_add = 138 velocity = 300 armor_penetration = 15 + hud_state = "pistol_lightap" /obj/item/projectile/bullet/a38/hp grains = 158 @@ -125,18 +133,21 @@ only use the hollow_point and armor_penetration values.*/ velocity = 297 hollow_point = TRUE armor_penetration = -10 + hud_state = "pistol_hollow" /obj/item/projectile/bullet/a762x25 fire_sound = 'sound/weapons/gunshot2.ogg' diam = 7.92 grains = 85 velocity = 469 + hud_state = "pistol_light" /obj/item/projectile/bullet/a9x18 fire_sound = 'sound/weapons/gunshot2.ogg' diam = 9.27 grains = 95 velocity = 319 + hud_state = "pistol" /obj/item/projectile/bullet/a9x18/rubber armor_penetration = -10 @@ -153,12 +164,14 @@ only use the hollow_point and armor_penetration values.*/ diam = 10.17 grains = 180 velocity = 400 + hud_state = "pistol" /obj/item/projectile/bullet/a10mm/ap grains = 200 energy_add = 435 velocity = 440 armor_penetration = 15 + hud_state = "pistol_ap" /obj/item/projectile/bullet/a10mm/hp grains = 135 @@ -166,6 +179,7 @@ only use the hollow_point and armor_penetration values.*/ velocity = 490 armor_penetration = -10 hollow_point = TRUE + hud_state = "pistol_hollow" /obj/item/projectile/bullet/a10mm/rubber armor_penetration = -10 @@ -182,12 +196,14 @@ only use the hollow_point and armor_penetration values.*/ diam = 9 grains= 95 velocity = 300 + hud_state = "pistol_light" /obj/item/projectile/bullet/a380/ap grains = 45 energy_add = 648.74 velocity = 559 armor_penetration = 15 + hud_state = "pistol_lightap" /obj/item/projectile/bullet/a380/hp grains = 95 @@ -195,23 +211,27 @@ only use the hollow_point and armor_penetration values.*/ velocity = 343 armor_penetration = -10 hollow_point = TRUE + hud_state = "pistol_hollow" /obj/item/projectile/bullet/a22lr fire_sound = 'sound/weapons/gunshot_pathetic.ogg' grains = 40 diam = 5.7 velocity = 370 + hud_state = "pistol_light" /obj/item/projectile/bullet/a22lr/ap grains = 31 velocity = 530 armor_penetration = 15 + hud_state = "pistol_ap" /obj/item/projectile/bullet/a22lr/hp grains = 38 velocity = 380 hollow_point = TRUE armor_penetration = -5 + hud_state = "pistol_hollow" //Shotgun projectiles @@ -233,6 +253,7 @@ only use the hollow_point and armor_penetration values.*/ use_submunitions = TRUE submunition_spread_max = 67.5 submunitions = list(/obj/item/projectile/bullet/shotgun/buckshot = 8) + hud_state = "shotgun_buckshot" //Rifle projectiles /obj/item/projectile/bullet/rifle @@ -271,16 +292,19 @@ only use the hollow_point and armor_penetration values.*/ diam = 7.85 grains = 122 velocity = 730 + hud_state = "rifle" /obj/item/projectile/bullet/rifle/a762x39/ap grains = 123 velocity = 740 energy_add = 117.16 armor_penetration = 25 + hud_state = "rifle_ap" /obj/item/projectile/bullet/rifle/a762x39/hp hollow_point = TRUE armor_penetration = -10 + hud_state = "hivelo_iff" /obj/item/projectile/bullet/rifle/a762x39/rubber armor_penetration = -10 @@ -321,16 +345,19 @@ only use the hollow_point and armor_penetration values.*/ diam = 5.7 grains = 62 velocity = 961 + hud_state = "rifle" /obj/item/projectile/bullet/rifle/a556/ap grains = 52 velocity = 1030 energy_add = 462.92 armor_penetration = 25 + hud_state = "rifle_ap" /obj/item/projectile/bullet/rifle/a556/hp hollow_point = TRUE armor_penetration = -10 + hud_state = "hivelo_iff" /obj/item/projectile/bullet/rifle/a556/rubber armor_penetration = -10 @@ -363,16 +390,21 @@ only use the hollow_point and armor_penetration values.*/ diam = 9.5 grains = 310 velocity = 365 //cadyn cope above, beware ^^ + hud_state = "rifle" + +//beware of cadyn cope above ^^ - Ocelot /obj/item/projectile/bullet/rifle/a9x39 //We also have actual 9x39mm fire_sound = 'sound/weapons/ballistics/a545.ogg' diam = 9.25 grains = 259 velocity = 280 + hud_state = "smartgun" /obj/item/projectile/bullet/rifle/a9x39/ap grains = 267 armor_penetration = 25 + hud_state = "minigun" /obj/item/projectile/bullet/rifle/a9x39/rubber armor_penetration = -10 @@ -388,6 +420,7 @@ only use the hollow_point and armor_penetration values.*/ grains = 210 diam = 10.2 velocity = 840 + hud_state = "rifle" /obj/item/projectile/bullet/rifle/a10x24/rubber armor_penetration = -10 @@ -403,6 +436,7 @@ only use the hollow_point and armor_penetration values.*/ diam = 7.92 grains = 181 velocity = 820 + hud_state = "rifle" /obj/item/projectile/bullet/rifle/a762x54 fire_sound = 'sound/weapons/ballistics/a762x54.ogg' @@ -410,9 +444,11 @@ only use the hollow_point and armor_penetration values.*/ grains = 151 velocity = 830 hitscan = 1 + hud_state = "sniper_crude" /obj/item/projectile/bullet/rifle/a762x54/ap armor_penetration = 35 + hud_state = "sniper_supersonic" /obj/item/projectile/bullet/rifle/a338 fire_sound = 'sound/weapons/ballistics/a762x54.ogg' @@ -422,9 +458,11 @@ only use the hollow_point and armor_penetration values.*/ velocity = 921 hitscan = 1 penetrating = 2 + hud_state = "sniper_crude" /obj/item/projectile/bullet/rifle/a338/ap armor_penetration = 50 + hud_state = "sniper_supersonic" /obj/item/projectile/bullet/rifle/a50bmg fire_sound = 'sound/weapons/ballistics/a145.ogg' @@ -434,6 +472,7 @@ only use the hollow_point and armor_penetration values.*/ velocity = 860 hitscan = 1 penetrating = 2 + hud_state = "sniper_supersonic" /obj/item/projectile/bullet/rifle/a50bmg/ap armor_penetration = 50 @@ -446,6 +485,7 @@ only use the hollow_point and armor_penetration values.*/ velocity = 820 penetrating = 2 armor_penetration=30 + hud_state = "sniper_fire" /obj/item/projectile/bullet/rifle/a45lc //yee haw diam = 11.43 @@ -521,6 +561,8 @@ only use the hollow_point and armor_penetration values.*/ accuracy = -20 // he do miss actually speed = 0.4 // if the pathfinder gets a funny burst rifle, they deserve a rival // that's 2x projectile speed btw + hud_state = "monkey" /obj/item/projectile/bullet/pistol/medium/ap/suppressor/turbo // spicy boys - speed = 0.2 // this is 4x projectile speed \ No newline at end of file + speed = 0.2 // this is 4x projectile speed + hud_state = "monkey" \ No newline at end of file diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index 5af79cc519..4325d25ed4 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -8,6 +8,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect hitsound_wall = 'sound/weapons/effects/searwall.ogg' hitsound = 'sound/weapons/zapbang.ogg' + hud_state = "monkey" var/flash_strength = 10 @@ -22,6 +23,7 @@ var/flash_range = 0 var/brightness = 7 var/light_colour = "#ffffff" + hud_state = "grenade_dummy" /obj/item/projectile/energy/flash/on_impact(var/atom/A) var/turf/T = flash_range? src.loc : get_turf(A) @@ -59,6 +61,7 @@ flash_range = 1 brightness = 15 flash_strength = 20 + hud_state = "grenade_dummy" /obj/item/projectile/energy/flash/flare/on_impact(var/atom/A) light_colour = pick("#e58775", "#ffffff", "#90ff90", "#a09030") @@ -77,15 +80,18 @@ light_range = 2 light_power = 0.5 light_color = "#FFFFFF" + hud_state = "taser" //Damage will be handled on the MOB side, to prevent window shattering. /obj/item/projectile/energy/electrode/strong agony = 55 + hud_state = "taser" /obj/item/projectile/energy/electrode/stunshot name = "stunshot" damage = 5 agony = 80 + hud_state = "taser" /obj/item/projectile/energy/electrode/stunshot/strong name = "stunshot" @@ -93,6 +99,7 @@ damage = 10 taser_effect = 1 agony = 100 + hud_state = "taser" /obj/item/projectile/energy/declone name = "declone" @@ -107,6 +114,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser combustion = FALSE + hud_state = "plasma_pistol" /obj/item/projectile/energy/excavate name = "kinetic blast" @@ -120,6 +128,7 @@ vacuum_traversal = 0 combustion = FALSE + hud_state = "plasma_blast" /obj/item/projectile/energy/dart name = "dart" @@ -128,6 +137,7 @@ damage_type = TOX agony = 120 check_armour = "energy" + hud_state = "pistol_tranq" combustion = FALSE @@ -138,23 +148,28 @@ damage_type = TOX agony = 40 stutter = 10 + hud_state = "electrothermal" /obj/item/projectile/energy/bolt/large name = "largebolt" damage = 20 + hud_state = "electrothermal" /obj/item/projectile/energy/bow name = "engergy bolt" icon_state = "cbbolt" damage = 20 + hud_state = "electrothermal" /obj/item/projectile/energy/bow/heavy damage = 30 icon_state = "cbbolt" + hud_state = "electrothermal" /obj/item/projectile/energy/bow/stun name = "stun bolt" agony = 30 + hud_state = "electrothermal" /obj/item/projectile/energy/acid //Slightly up-gunned (Read: The thing does agony and checks bio resist) variant of the simple alien mob's projectile, for queens and sentinels. name = "acidic spit" @@ -166,6 +181,7 @@ armor_penetration = 25 // It's acid hitsound_wall = 'sound/weapons/effects/alien_spit_wall.ogg' hitsound = 'sound/weapons/effects/alien_spit_wall.ogg' + hud_state = "electrothermal" combustion = FALSE @@ -179,6 +195,7 @@ armor_penetration = 25 // It's acid-based hitsound_wall = 'sound/weapons/effects/alien_spit_wall.ogg' hitsound = 'sound/weapons/effects/alien_spit_wall.ogg' + hud_state = "electrothermal" combustion = FALSE @@ -188,6 +205,7 @@ damage = 20 damage_type = BIOACID agony = 20 + hud_state = "electrothermal" check_armour = "bio" armor_penetration = 25 // It's acid-based @@ -202,6 +220,7 @@ light_power = 0.5 light_color = "#33CC00" impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser + hud_state = "plasma_rifle" combustion = FALSE @@ -215,6 +234,7 @@ agony = 55 damage_type = BURN vacuum_traversal = 0 //Projectile disappears in empty space + hud_state = "plasma_rifle_blast" /obj/item/projectile/energy/plasmastun/proc/bang(var/mob/living/carbon/M) @@ -259,6 +279,7 @@ embed_chance = 0 muzzle_type = /obj/effect/projectile/muzzle/pulse impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser + hud_state = "plasma_sphere" /obj/item/projectile/energy/phase name = "phase wave" @@ -267,28 +288,35 @@ damage = 5 SA_bonus_damage = 45 // 50 total on animals SA_vulnerability = list(SA_ANIMAL, MOB_CLASS_SYNTHETIC, MOB_CLASS_ABERRATION, MOB_CLASS_HUMANOID) //CHOMP Edit expand this list + hud_state = "laser_heat" /obj/item/projectile/energy/phase/light range = 4 SA_bonus_damage = 35 // 40 total on animals + hud_state = "laser_heat" /obj/item/projectile/energy/phase/heavy range = 8 SA_bonus_damage = 55 // 60 total on animals + hud_state = "laser_heat" /obj/item/projectile/energy/phase/heavy/cannon range = 10 damage = 15 SA_bonus_damage = 60 // 75 total on animals + hud_state = "laser_heat" /obj/item/projectile/energy/electrode/strong agony = 70 + hud_state = "taser" /obj/item/projectile/energy flash_strength = 10 + hud_state = "taser" /obj/item/projectile/energy/flash flash_range = 1 + hud_state = "grenade_dummy" /obj/item/projectile/energy/flash/strong name = "chemical shell" @@ -297,6 +325,8 @@ range = 15 //if the shell hasn't hit anything after travelling this far it just explodes. flash_strength = 15 brightness = 15 + hud_state = "grenade_dummy" /obj/item/projectile/energy/flash/flare - flash_range = 2 \ No newline at end of file + flash_range = 2 + hud_state = "grenade_dummy" \ No newline at end of file diff --git a/code/modules/projectiles/projectile/energy_ch.dm b/code/modules/projectiles/projectile/energy_ch.dm index 94d3f925c6..60a6bd0b26 100644 --- a/code/modules/projectiles/projectile/energy_ch.dm +++ b/code/modules/projectiles/projectile/energy_ch.dm @@ -2,10 +2,12 @@ range = 4 SA_bonus_damage = 15 // 30 total on animals icon_state = "cbbolt" + hud_state = "taser" /obj/item/projectile/energy/phase/bolt/heavy range = 4 SA_bonus_damage = 25 // 20 total on animals + hud_state = "taser" /obj/item/projectile/energy/plasma/vepr name = "plasma bolt" diff --git a/code/modules/projectiles/projectile/energy_yw.dm b/code/modules/projectiles/projectile/energy_yw.dm index b49c224bf7..4c0a709e03 100644 --- a/code/modules/projectiles/projectile/energy_yw.dm +++ b/code/modules/projectiles/projectile/energy_yw.dm @@ -11,6 +11,7 @@ damage_type = BURN pass_flags = PASSTABLE | PASSGRILLE check_armour = "laser" + hud_state = "alloy_spike" /obj/item/projectile/energy/gaussweak name = "gauss bolt" @@ -23,6 +24,7 @@ damage_type = BURN pass_flags = PASSTABLE | PASSGRILLE check_armour = "laser" + hud_state = "alloy_spike" /obj/item/projectile/energy/gaussrifle name = "gauss bolt" @@ -36,6 +38,8 @@ pass_flags = PASSTABLE | PASSGRILLE penetrating = 0 check_armour = "laser" + hud_state = "alloy_spike" + //End of gaussguns// //Stun projectile for HOSgun @@ -48,6 +52,8 @@ agony = 65 damage_type = HALLOSS stutter = 10 + hud_state = "taser" + //plasma weaponry /obj/item/projectile/energy/Plasma name = "Plasma Blast" @@ -57,3 +63,4 @@ damage_type = BURN pass_flags = PASSGRILLE check_armour = "laser" + hud_state = "plasma_rifle_blast" diff --git a/code/modules/projectiles/projectile/magnetic.dm b/code/modules/projectiles/projectile/magnetic.dm index dd4ea1a07f..588a20820e 100644 --- a/code/modules/projectiles/projectile/magnetic.dm +++ b/code/modules/projectiles/projectile/magnetic.dm @@ -9,12 +9,14 @@ weaken = 1 penetrating = 5 armor_penetration = 70 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/slug name = "slug" icon_state = "gauss_silenced" damage = 75 armor_penetration = 90 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/flechette name = "flechette" @@ -22,6 +24,7 @@ fire_sound = 'sound/weapons/rapidslice.ogg' damage = 20 armor_penetration = 100 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/flechette/small name = "small flechette" @@ -29,6 +32,7 @@ fire_sound = 'sound/weapons/rapidslice.ogg' damage = 12 armor_penetration = 100 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/flechette/small/khi name = "small carbyne flechette" @@ -37,12 +41,14 @@ damage = 18 armor_penetration = 100 penetrating = 10 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/flechette/hunting name = "shredder slug" armor_penetration = 30 SA_bonus_damage = 40 SA_vulnerability = SA_ANIMAL + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/heated name = "slug" @@ -54,6 +60,7 @@ embed_chance = 0 armor_penetration = 40 penetrating = 1 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/heated/weak icon_state = "gauss_silenced" @@ -62,6 +69,7 @@ embed_chance = 0 armor_penetration = 30 penetrating = 0 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/fuelrod name = "fuel rod" @@ -76,6 +84,7 @@ embed_chance = 0 armor_penetration = 40 range = 20 + hud_state = "rocket_he" var/searing = 0 //Does this fuelrod ignore shields? var/detonate_travel = 0 //Will this fuelrod explode when it reaches maximum distance? @@ -122,6 +131,7 @@ flammability = -1 armor_penetration = 50 penetrating = 3 + hud_state = "rocket_ap" /obj/item/projectile/bullet/magnetic/fuelrod/phoron name = "blazing fuel rod" @@ -133,6 +143,7 @@ penetrating = 5 irradiate = 20 detonate_mob = 1 + hud_state = "rocket_fire" /obj/item/projectile/bullet/magnetic/fuelrod/supermatter name = "painfully incandescent fuel rod" @@ -149,6 +160,7 @@ detonate_travel = 1 detonate_mob = 1 energetic_impact = 1 + hud_state = "rocket_thermobaric" /obj/item/projectile/bullet/magnetic/fuelrod/supermatter/on_hit(var/atom/target, var/blocked = 0, var/def_zone = null) //You cannot touch the supermatter without disentigrating. Assumedly, this is true for condensed rods of it flying at relativistic speeds. if(istype(target,/turf/simulated/wall) || istype(target,/mob/living)) @@ -169,6 +181,7 @@ check_armour = "melee" irradiate = 20 range = 6 + hud_state = "plasma_rifle_blast" /obj/item/projectile/bullet/magnetic/bore/Initialize(loc, range_mod) // i'm gonna be real honest i dunno how this works but it does . = ..() diff --git a/code/modules/projectiles/projectile/magnetic_ch.dm b/code/modules/projectiles/projectile/magnetic_ch.dm index 663e6ffd0b..41d11cfe40 100644 --- a/code/modules/projectiles/projectile/magnetic_ch.dm +++ b/code/modules/projectiles/projectile/magnetic_ch.dm @@ -4,6 +4,7 @@ fire_sound = 'sound/weapons/rapidslice.ogg' damage = 10 armor_penetration = 35 + hud_state = "alloy_spike" /obj/item/projectile/bullet/magnetic/fuelrod/blitz name = "blitz rod" @@ -22,6 +23,7 @@ detonate_travel = 1 detonate_mob = 1 energetic_impact = 1 + hud_state = "rocket_thermobaric" /obj/item/projectile/bullet/magnetic/fuelrod/blitz/on_impact(var/atom/A) if(src.loc) diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 142cde4071..c439197fe3 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -9,6 +9,7 @@ light_range = 2 light_power = 0.5 light_color = "#55AAFF" + hud_state = "plasma_blast" combustion = FALSE impact_effect_type = /obj/effect/temp_visual/impact_effect/ion @@ -43,6 +44,7 @@ check_armour = "bullet" sharp = TRUE edge = TRUE + hud_state = "rocket_fire" /obj/item/projectile/bullet/gyro/on_hit(var/atom/target, var/blocked = 0) explosion(target, -1, 0, 2) @@ -62,6 +64,7 @@ light_power = 0.5 light_color = "#55AAFF" impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser + hud_state = "water" combustion = FALSE @@ -98,6 +101,7 @@ /obj/item/projectile/temp/hot name = "heat beam" target_temperature = 1000 + hud_state = "flame" combustion = TRUE @@ -109,6 +113,7 @@ damage_type = BRUTE nodamage = 1 check_armour = "bullet" + hud_state = "monkey" /obj/item/projectile/meteor/Bump(atom/A as mob|obj|turf|area) if(A == firer) @@ -145,6 +150,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser var/lasermod = 0 combustion = FALSE + hud_state = "electrothermal" /obj/item/projectile/energy/floramut/on_hit(var/atom/target, var/blocked = 0) var/mob/living/M = target @@ -187,6 +193,7 @@ nodamage = 1 check_armour = "energy" var/decl/plantgene/gene = null + hud_state = "electrothermal" /obj/item/projectile/energy/florayield name = "beta somatoray" @@ -201,6 +208,7 @@ light_color = "#FFFFFF" impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser var/lasermod = 0 + hud_state = "electrothermal" /obj/item/projectile/energy/florayield/on_hit(var/atom/target, var/blocked = 0) var/mob/living/M = target @@ -218,6 +226,7 @@ name = "flayer ray" combustion = FALSE + hud_state = "electrothermal" /obj/item/projectile/beam/mindflayer/on_hit(var/atom/target, var/blocked = 0) if(ishuman(target)) @@ -233,6 +242,7 @@ nodamage = 1 damage_type = HALLOSS muzzle_type = /obj/effect/projectile/muzzle/bullet + hud_state = "monkey" /obj/item/projectile/bola name = "bola" @@ -241,6 +251,7 @@ embed_chance = 0 //Nada. damage_type = HALLOSS muzzle_type = null + hud_state = "monkey" combustion = FALSE @@ -260,7 +271,7 @@ embed_chance = 0 //Nada. damage_type = BRUTE muzzle_type = null - + hud_state = "monkey" combustion = FALSE /obj/item/projectile/webball/on_hit(var/atom/target, var/blocked = 0) @@ -282,6 +293,7 @@ light_range = 4 light_power = 3 light_color = "#3300ff" + hud_state = "alloy_spike" muzzle_type = /obj/effect/projectile/muzzle/tungsten tracer_type = /obj/effect/projectile/tracer/tungsten diff --git a/icons/mob/screen_ammo.dmi b/icons/mob/screen_ammo.dmi index e138438e0e69bfbba9d2a16cc384aac0a3e73b8e..57ab8e772e95e5c28da09592b8f1c4b0afc4d4bc 100644 GIT binary patch delta 4995 zcmYLMdpy(a`~Pe#4?<6jp5#y|B2D!aIc+*oawz4H!&V;2L*{X|na`vr6`4{IIaQJz zd&qe<9jHf|$tjD8Vl&LL1DkEX)%W}R{q8^R&+Go&*Z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Cy{~diXg{@U{UxLc zO=DQAySFMF`~y-b$;R6s)@tMy5=UD;j*Q+dO3H`Vi`Xo^SDB)Vw-=L@t z6GNS?xHpRC4^FJwjyJ8dx%F!d?{d%Am0U}EcX%sUXvZU42&?x`JEMD5bCKqOVyVQoPm5S}vZP_RN~-%k`HV>H%c#=Zv>K|QP%z6l8ptX1zcOs*J-M@;fTRe@Ga z*aSlC*DX&F+ctwj7bug-JgNB#Pe&*HbKCmKh{g2sKzc~b9g9P=eWU6|#RAXL1uvHT zX+?{uy0o#2^$z&AQ%Iq=mg>=l`6pFcLWU)*-qj%!lQJ*fvK?5U zIUUW;p&ZD#%i$MofM})T7770=4AEDWKQhcn()_(+X#+@>G=jy|nhjm!WE=kI*}xJ% zB`1Xz4#q4ZC9SCiiuN_PT+1zIm#=yYlTjq?1eeNtB}T_Nxk9cEWzMQD>lP(nNI$Qf+aF0e0#@yy@UesN zmUZdaYO@v{Nm#IS^fhNiwz#pVeMspHDy0RDnpXnRDDr&nE>lTk53BwhCHh94S~Trn qOO$a$O<^;t)^Gl+REqzQYdIV!bomy4^VGi;%Za0>juamDzVScM{3wwC From 7cedcee7bce70b295837c542b6dad68bbc593f29 Mon Sep 17 00:00:00 2001 From: Rykka Date: Tue, 5 Apr 2022 22:56:11 -0600 Subject: [PATCH 05/11] Fixes Compile time errors --- code/modules/projectiles/guns/projectile/shotgun.dm | 4 ++-- code/modules/projectiles/projectile/beams_ch.dm | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index ed17f9ce42..5e87e05cfc 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -52,14 +52,14 @@ else chambered.loc = get_turf(src) // Eject casing chambered = null - user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD Port + M.hud_used.update_ammo_hud(M, src) // TGMC Ammo HUD Port // Load next shell if(loaded.len) var/obj/item/ammo_casing/AC = loaded[1] // Load next casing. loaded -= AC // Remove casing from loaded list. chambered = AC - user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD Port + M.hud_used.update_ammo_hud(M, src) // TGMC Ammo HUD Port if(pump_animation) // This affects all bolt action and shotguns. flick("[pump_animation]", src) // This plays any pumping diff --git a/code/modules/projectiles/projectile/beams_ch.dm b/code/modules/projectiles/projectile/beams_ch.dm index 6c2afaf856..f95458a6a5 100644 --- a/code/modules/projectiles/projectile/beams_ch.dm +++ b/code/modules/projectiles/projectile/beams_ch.dm @@ -43,7 +43,6 @@ light_color = "#F18F12" light_range = 2 light_power = 0.5 - hud_state = "laser_heat" /obj/effect/projectile/tracer/phaser/heavy icon_state = "phaser_heavy_tracer" @@ -61,7 +60,6 @@ light_color = "#F18F12" light_range = 2 light_power = 0.5 - hud_state = "laser_heat" /obj/effect/projectile/muzzle/phaser/heavy icon_state = "phaser_heavy_muzzle" @@ -79,7 +77,6 @@ light_color = "#F18F12" light_range = 2 light_power = 0.5 - hud_state = "laser_heat" /obj/effect/projectile/impact/phaser/heavy icon_state = "phaser_heavy_impact" From f84c9d720f4d72c22d74f5ca6d33c8a7c0833195 Mon Sep 17 00:00:00 2001 From: Rykka Date: Wed, 6 Apr 2022 00:15:36 -0600 Subject: [PATCH 06/11] Fixes issues with HUDs not updating Forces updates upon cycling the next round. Fixes Chambered casings still counting for ammo despite having no associated projectile. Because for ~realism~ the casing has a BB var that determines if we currently have a bullet available to fire. Adds rocket states for our ONE measly rocket launcher. Phasers will now update their ammunition count on every single pump. --- .../projectiles/guns/energy/laser_vr.dm | 2 ++ code/modules/projectiles/guns/projectile.dm | 28 +++++++++++-------- .../projectiles/projectile/explosive.dm | 3 ++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/code/modules/projectiles/guns/energy/laser_vr.dm b/code/modules/projectiles/guns/energy/laser_vr.dm index 10421a5829..15de81b515 100644 --- a/code/modules/projectiles/guns/energy/laser_vr.dm +++ b/code/modules/projectiles/guns/energy/laser_vr.dm @@ -184,11 +184,13 @@ if(!do_after(user, 10, src)) break playsound(src,'sound/items/change_drill.ogg',25,1) + user.hud_used.update_ammo_hud(user, src) if(power_supply.give(phase_power) < phase_power) break recharging = 0 update_icon() + user.hud_used.update_ammo_hud(user, src) // Update one last time once we're finished! /obj/item/weapon/gun/energy/locked/frontier/update_icon() if(recharging) diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index e443fa27cb..399ee18086 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -54,6 +54,10 @@ chambered = ammo_magazine.stored_ammo[ammo_magazine.stored_ammo.len] if(handle_casings != HOLD_CASINGS) ammo_magazine.stored_ammo -= chambered + + var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD + if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + M?.hud_used.update_ammo_hud(M, src) if (chambered) return chambered.BB @@ -273,22 +277,22 @@ /obj/item/weapon/gun/projectile/get_ammo_type() if(load_method == MAGAZINE) - if(chambered) // Do we have a round chambered + if(chambered) // Do we have an ammo casing chambered var/obj/item/ammo_casing/A = chambered var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) - else if(loaded.len && ammo_magazine && ammo_magazine.stored_ammo) // Are we loaded, have a mag, and have ammo in the mag? + else if(ammo_magazine && ammo_magazine.stored_ammo) // Are we loaded, have a mag, and have ammo in the mag? var/obj/item/ammo_casing/A = ammo_magazine.stored_ammo[1] var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) else return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case else if(load_method == SINGLE_CASING|SPEEDLOADER) - if(chambered) // Do we have a round loaded in the chamber? + if(chambered) // Do we have an ammo casing loaded in the chamber? var/obj/item/ammo_casing/A = chambered var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the casing's ammo hud state - else if(!chambered && loaded.len) // Else, is the gun loaded, but no rounds in chamber currently? + else if(!chambered && loaded.len) // Else, is the gun loaded, but no ammo casings in chamber currently? var/obj/item/ammo_casing/A = loaded[1] var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the ammunition in mag's hud_state @@ -299,18 +303,18 @@ /obj/item/weapon/gun/projectile/get_ammo_count() if(load_method == MAGAZINE) - if(!ammo_magazine) // No magazine? Return if we have a round chambered or not - return chambered ? 1 : 0 + if(!ammo_magazine) // No magazine? Return if we have a round chambered or not. BB is the var for the round inside the casing. + return chambered.BB ? 1 : 0 else if(ammo_magazine) // If we have a magazine loaded, check if chambered and return either the magazine + chambered or the loaded amount - return chambered ? (ammo_magazine.stored_ammo.len + 1) : ammo_magazine.stored_ammo.len + return chambered.BB ? (ammo_magazine.stored_ammo.len + 1) : ammo_magazine.stored_ammo.len else // Completely unloaded or code failure. return 0 else if(load_method == SINGLE_CASING|SPEEDLOADER) - if(chambered && !loaded.len) // Chambered, but nothing in the magazine/internal ammo - return chambered ? 1: 0 - else if(chambered && loaded.len) // Chambered + has ammo - return loaded.len + (chambered ? 1 : 0) - else if(loaded.len) // Has ammo, no round chambered + if(chambered.BB && !loaded.len) // Chambered and has a round in the casing, but nothing in the magazine/internal ammo. BB is the var for the round inside the casing. + return chambered.BB ? 1: 0 + else if(chambered.BB && loaded.len) // Chambered casing + round + has ammo. BB is the var for the round inside the casing. + return loaded.len + (chambered.BB ? 1 : 0) + else if(loaded.len) // Has ammo, no round chambered (but might have a casing still in the breech). BB is the var for the round inside the casing. return loaded.len else // Completely unloaded, nothing in chamber or ammo, or code failed??? return 0 diff --git a/code/modules/projectiles/projectile/explosive.dm b/code/modules/projectiles/projectile/explosive.dm index 307febc8bc..76da8f3e3a 100644 --- a/code/modules/projectiles/projectile/explosive.dm +++ b/code/modules/projectiles/projectile/explosive.dm @@ -7,6 +7,8 @@ icon_state = "missile" damage = 30 //Meaty whack. *Chuckles* does_spin = 0 + hud_state = "rocket_he" + hud_state_empty = "rocket_empty" /obj/item/projectile/bullet/srmrocket/on_hit(atom/target, blocked=0) if(!isliving(target)) //if the target isn't alive, so is a wall or something @@ -24,6 +26,7 @@ /obj/item/projectile/bullet/srmrocket/weak //Used in the jury rigged one. damage = 10 + hud_state = "rocket_he" /obj/item/projectile/bullet/srmrocket/weak/on_hit(atom/target, blocked=0) explosion(target, 0, 0, 2, 4)//No need to have a question. From 92ccb52ca7896a0ece1fc7032cc449756fb99241 Mon Sep 17 00:00:00 2001 From: Rykka Date: Wed, 6 Apr 2022 03:45:18 -0600 Subject: [PATCH 07/11] Multiple Testing Fixes - Fixes all projectile guns not having an empty state after unloading the gun via various methods - Fixes stun revolver not having an empty sprite - Fixes self-charging guns not updating ammo counts Still needing fixes: - Revolvers do not update ammo counts after firing, only on emptying the gun/adding new shells. --- code/modules/projectiles/guns/energy.dm | 3 ++ code/modules/projectiles/guns/projectile.dm | 34 ++++++++++++------- code/modules/projectiles/projectile/energy.dm | 3 +- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index c9e418e5c4..25d5dc26e1 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -114,6 +114,9 @@ if(!power_supply) return null if(!ispath(projectile_type)) return null if(!power_supply.checked_use(charge_cost)) return null + var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD + if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + M?.hud_used.update_ammo_hud(M, src) return new projectile_type(src) /obj/item/weapon/gun/energy/proc/load_ammo(var/obj/item/C, mob/user) diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 399ee18086..c617bd7b06 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -281,21 +281,27 @@ var/obj/item/ammo_casing/A = chambered var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) - else if(ammo_magazine && ammo_magazine.stored_ammo) // Are we loaded, have a mag, and have ammo in the mag? + else if(ammo_magazine && ammo_magazine.stored_ammo.len) // Are we loaded, have a mag, and have ammo in the mag? var/obj/item/ammo_casing/A = ammo_magazine.stored_ammo[1] var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) + else if(!ammo_magazine && !chambered && src.projectile_type) // Else, we're entirely empty, and have no mag/nothing loaded in the gun, and nothing in the chamber. Return the DEFAULT projectile_type on the gun, if set. + var/obj/item/projectile/P = src.projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) else return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case - else if(load_method == SINGLE_CASING|SPEEDLOADER) - if(chambered) // Do we have an ammo casing loaded in the chamber? + else if(load_method == (SINGLE_CASING | SPEEDLOADER)) + if(chambered) // Do we have an ammo casing loaded in the chamber? All casings still have a projectile_type var. var/obj/item/ammo_casing/A = chambered var/obj/item/projectile/P = A.projectile_type - return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the casing's ammo hud state + return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the casing's projectile_type ammo hud state else if(!chambered && loaded.len) // Else, is the gun loaded, but no ammo casings in chamber currently? var/obj/item/ammo_casing/A = loaded[1] var/obj/item/projectile/P = A.projectile_type - return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the ammunition in mag's hud_state + return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the ammunition loaded in the gun's hud_state + else if(!chambered && !loaded.len && src.projectile_type) // Else, we're entirely empty, and have no mag/nothing loaded in the gun, and nothing in the chamber. Return the DEFAULT projectile_type on the gun, if set. + var/obj/item/projectile/P = src.projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) else return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case else @@ -303,18 +309,22 @@ /obj/item/weapon/gun/projectile/get_ammo_count() if(load_method == MAGAZINE) - if(!ammo_magazine) // No magazine? Return if we have a round chambered or not. BB is the var for the round inside the casing. + if(!ammo_magazine && chambered) // No magazine, and we have a casing chambered? Return if we have a round chambered or not. BB is the var for the round inside the casing. return chambered.BB ? 1 : 0 - else if(ammo_magazine) // If we have a magazine loaded, check if chambered and return either the magazine + chambered or the loaded amount + else if(ammo_magazine && chambered) // If we have a magazine loaded, check if chambered and return either the magazine + chambered or the loaded amount return chambered.BB ? (ammo_magazine.stored_ammo.len + 1) : ammo_magazine.stored_ammo.len + else if(!chambered && ammo_magazine) // If we have a magazine loaded, but nothing chambered, return the magazine amount, if it exists. + return ammo_magazine.stored_ammo.len else // Completely unloaded or code failure. return 0 - else if(load_method == SINGLE_CASING|SPEEDLOADER) - if(chambered.BB && !loaded.len) // Chambered and has a round in the casing, but nothing in the magazine/internal ammo. BB is the var for the round inside the casing. - return chambered.BB ? 1: 0 - else if(chambered.BB && loaded.len) // Chambered casing + round + has ammo. BB is the var for the round inside the casing. + else if(load_method == SINGLE_CASING | SPEEDLOADER) + if(chambered && chambered.BB && !loaded.len) // Chambered and has a round in the casing, but nothing in the magazine/internal ammo. BB is the var for the round inside the casing. + return chambered.BB ? 1 : 0 + else if(chambered && chambered.BB && loaded.len) // Chambered casing + round + has ammo. BB is the var for the round inside the casing. return loaded.len + (chambered.BB ? 1 : 0) - else if(loaded.len) // Has ammo, no round chambered (but might have a casing still in the breech). BB is the var for the round inside the casing. + else if(chambered && !chambered.BB && loaded.len) // Has ammo, no round chambered (but might have a casing still in the breech). BB is the var for the round inside the casing. + return loaded.len + else if(!chambered && loaded.len) // Has ammo, not chambered, or doesn't use the chambered var return loaded.len else // Completely unloaded, nothing in chamber or ammo, or code failed??? return 0 diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index 4325d25ed4..de2baf0ba6 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -8,7 +8,8 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect hitsound_wall = 'sound/weapons/effects/searwall.ogg' hitsound = 'sound/weapons/zapbang.ogg' - hud_state = "monkey" + hud_state = "plasma" + hud_state = "battery_empty" var/flash_strength = 10 From 26fbd5e3cb820e037cb9079cdd0bff67b3cc6d88 Mon Sep 17 00:00:00 2001 From: Rykka Date: Wed, 6 Apr 2022 22:59:20 -0600 Subject: [PATCH 08/11] TGMC Final Commit - Fixes Ammo Count + symbols + Medigun/Curabitur Changes: - Code copied over to hud.dm and commented out, to prep for upstream pull. - Commented-out, unused code removed. - CHOMPEdits removed, pending upstream PR. - Medigun no longer shows 2x the actual ammo loaded. - Curabitur now fetches the amount of shots correctly, bar 1 extra for some reason. - Curabitur ammo updates on automatic recharge ticks. - A ton of projectile get_ammo_count optimization - mostly swaps the massive if/else for for loops. Fixes multiple guns not getting ammo properly, now casings won't register as ammo unless they have a shell in the casing. - hud_state_empty defined as base on all bullets. - Corrects energy weapons missing a hud_state_empty. - Gives Ion weapons a hud_state_empty All changes have been tested, and bar the Curabitur having an extra shot for ??? reason, which is a base bug I've yet to fix, this is entirely ready for testmerge. --- code/_onclick/hud/hud.dm | 38 +++++++++- code/_onclick/hud/hud_ch.dm | 3 + code/_onclick/hud/screen_objects.dm | 4 -- code/modules/projectiles/guns/energy.dm | 16 ++--- .../guns/energy/cell_loaded_vr/cell_loaded.dm | 39 +++++++++- .../energy/cell_loaded_vr/multi_cannon.dm | 14 +++- .../cell_loaded_vr/multi_cannon_cells.dm | 13 ++++ code/modules/projectiles/guns/projectile.dm | 71 +++++++++++-------- .../modules/projectiles/projectile/bullets.dm | 1 + code/modules/projectiles/projectile/energy.dm | 2 +- .../modules/projectiles/projectile/special.dm | 1 + 11 files changed, 154 insertions(+), 48 deletions(-) diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 2f2ed75400..8d9990024b 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -465,4 +465,40 @@ var/list/global_huds = list( client.screen += client.void /mob/new_player/add_click_catcher() - return \ No newline at end of file + return + +/* TGMC Ammo HUD Port + * These procs call to screen_objects.dm's respective procs. + * All these do is manage the amount of huds on screen and set the HUD. + * CHOMPEdit: Commented out, just uncomment once Polaris merges + it comes down from VORE. +*/ +/* +///Add an ammo hud to the user informing of the ammo count of G +/datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G) + if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE) + return + var/obj/screen/ammo/ammo_hud = new + ammo_hud_list[G] = ammo_hud + ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[length(ammo_hud_list)] + ammo_hud.add_hud(user, G) + ammo_hud.update_hud(user, G) + +///Remove the ammo hud related to the gun G from the user +/datum/hud/proc/remove_ammo_hud(mob/living/user, obj/item/weapon/gun/G) + var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] + if(isnull(ammo_hud)) + return + ammo_hud.remove_hud(user, G) + qdel(ammo_hud) + ammo_hud_list -= G + var/i = 1 + for(var/key in ammo_hud_list) + ammo_hud = ammo_hud_list[key] + ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[i] + i++ + +///Update the ammo hud related to the gun G +/datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G) + var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] + ammo_hud?.update_hud(user, G) +*/ \ No newline at end of file diff --git a/code/_onclick/hud/hud_ch.dm b/code/_onclick/hud/hud_ch.dm index f68ecb0864..84772f4a9f 100644 --- a/code/_onclick/hud/hud_ch.dm +++ b/code/_onclick/hud/hud_ch.dm @@ -1,5 +1,6 @@ /** * CHOMP-Specific HUD override. This will be backported to Polaris if they want it. + * Comment this out once Polaris has it! */ ///Add an ammo hud to the user informing of the ammo count of G /datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G) @@ -14,6 +15,8 @@ ///Remove the ammo hud related to the gun G from the user /datum/hud/proc/remove_ammo_hud(mob/living/user, obj/item/weapon/gun/G) var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] + if(isnull(ammo_hud)) + return ammo_hud.remove_hud(user, G) qdel(ammo_hud) ammo_hud_list -= G diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index c4b80f27ae..a06df0c082 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -912,8 +912,6 @@ if(!user?.client) return - - // var/obj/item/weapon/gun/G = user.get_active_hand() if(!G) CRASH("/obj/screen/ammo/proc/add_hud() has been called from [src] without the required param of G") @@ -930,8 +928,6 @@ if(!user?.client?.screen.Find(src)) return - // var/obj/item/weapon/gun/G = user.get_active_hand() - if(!G || !istype(G) || !G.has_ammo_counter() || !G.get_ammo_type() || isnull(G.get_ammo_count())) remove_hud() return diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 25d5dc26e1..6424f90b44 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -92,9 +92,9 @@ power_supply.give(rechargeamt) //... to recharge 1/5th the battery update_icon() - var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD - if(istype(M)) // CHOMPEdit: TGMC Ammo HUD - M?.hud_used.update_ammo_hud(M, src) // CHOMPEdit: TGMC Ammo HUD + var/mob/living/M = loc // TGMC Ammo HUD + if(istype(M)) // TGMC Ammo HUD + M?.hud_used.update_ammo_hud(M, src) // TGMC Ammo HUD else charge_tick = 0 return 1 @@ -114,8 +114,8 @@ if(!power_supply) return null if(!ispath(projectile_type)) return null if(!power_supply.checked_use(charge_cost)) return null - var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD - if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + var/mob/living/M = loc // TGMC Ammo HUD + if(istype(M)) // TGMC Ammo HUD M?.hud_used.update_ammo_hud(M, src) return new projectile_type(src) @@ -138,7 +138,7 @@ playsound(src, 'sound/weapons/flipblade.ogg', 50, 1) update_icon() update_held_icon() - user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD + user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD else to_chat(user, "This cell is not fitted for [src].") return @@ -155,7 +155,7 @@ playsound(src, 'sound/weapons/empty.ogg', 50, 1) update_icon() update_held_icon() - user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD + user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD else to_chat(user, "[src] does not have a power cell.") @@ -244,7 +244,7 @@ return results -// CHOMPEDIT: TGMC AMMO HUD PORT Start +// TGMC AMMO HUD /obj/item/weapon/gun/energy/has_ammo_counter() return TRUE diff --git a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm index eaa3a2d9e8..b1ac9f5085 100644 --- a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm +++ b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm @@ -50,8 +50,6 @@ var/obj/item/ammo_casing/microbattery/batt = chambered - charge_left = batt.shots_left - max_charge = initial(batt.shots_left) if(ammo_magazine) //Crawl to find more for(var/obj/item/ammo_casing/microbattery/bullet as anything in ammo_magazine.stored_ammo) if(istype(bullet,batt.type)) @@ -68,6 +66,9 @@ chambered = new_batt update_charge() update_icon() + var/mob/living/M = loc // TGMC Ammo HUD + if(istype(M)) // TGMC Ammo HUD + M?.hud_used.update_ammo_hud(M, src) /obj/item/weapon/gun/projectile/cell_loaded/attack_self(mob/user) if(!chambered) @@ -170,6 +171,11 @@ update_icon() playsound(src, 'sound/weapons/flipblade.ogg', 50, 1) update_icon() + if(istype(loc, /obj/item/weapon/gun/projectile/cell_loaded)) // Update the HUD if we're in a gun + have a user. Not that one should be able to reload the mag while it's in a gun, but just in caaaaase. + var/obj/item/weapon/gun/projectile/cell_loaded/cell_load = loc + var/mob/living/M = cell_load.loc + if(istype(M)) + M?.hud_used.update_ammo_hud(M, cell_load) /obj/item/ammo_magazine/cell_mag/update_icon() cut_overlays() @@ -278,4 +284,31 @@ new /obj/item/ammo_casing/microbattery/combat/xray(src) new /obj/item/ammo_casing/microbattery/medical/stabilize2(src) new /obj/item/ammo_casing/microbattery/medical/haste(src) - new /obj/item/ammo_casing/microbattery/medical/resist(src) \ No newline at end of file + new /obj/item/ammo_casing/microbattery/medical/resist(src) + +// TGMC Ammo HUD: Custom handling for cell-loaded weaponry. +/* +/obj/item/weapon/gun/projectile/cell_loaded/get_ammo_type() + if(!projectile_type) + return list("unknown", "unknown") + else + var/obj/item/projectile/P = projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) +*/ +/obj/item/weapon/gun/projectile/cell_loaded/get_ammo_count() + if(!chambered) + return 0 // We're not chambered, so we have 0 rounds loaded. + + var/obj/item/ammo_casing/microbattery/batt = chambered + + var/shots + if(ammo_magazine) // Check how much ammo we have + for(var/obj/item/ammo_casing/microbattery/bullet as anything in ammo_magazine.stored_ammo) + if(istype(bullet,batt.type)) + shots += bullet.shots_left + if(shots > 0) // We have shots ready to fire. + return shots + else // We're out of shots. + return 0 + else // Else, we're unloaded/don't have a magazine. + return 0 \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon.dm b/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon.dm index 136eb26f3d..fa09eaea5c 100644 --- a/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon.dm +++ b/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon.dm @@ -57,4 +57,16 @@ /obj/item/weapon/gun/projectile/multi_cannon/unload_ammo(mob/user, var/allow_dump=1) .=..() update_icon() - chambered = null \ No newline at end of file + chambered = null + +/obj/item/weapon/gun/projectile/multi_cannon/get_ammo_count() // Custom handling for the Curabitur. + if(istype(chambered, /obj/item/ammo_casing/macrobattery)) + var/obj/item/ammo_casing/macrobattery/battery = chambered + if(battery.charge) // Does the battery have charge? + return battery.charge // This should safely return the amount of shots we have. Every time we fire, we decrement charge by 1, at least in all the cells I can see. + else // No charge in the battery. + return 0 // Return 0 ammo to the HUD. + else if(chambered == null) + return 0 + else + CRASH("/obj/item/weapon/gun/projectile/multi_cannon/get_ammo_count() was called from [src] but did not have a valid magazine loaded, somehow! Chambered is currently [chambered].") \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon_cells.dm b/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon_cells.dm index 53dd7c0ad3..d333081c37 100644 --- a/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon_cells.dm +++ b/code/modules/projectiles/guns/energy/cell_loaded_vr/multi_cannon_cells.dm @@ -38,6 +38,12 @@ //alright, the below seems jank. it IS jank, but for whatever reason I can't reuse BB. big bad BB = null BB = new projectile_type + // TGMC Ammo HUD - Update the HUD every time we expend/fire, given the Curabitur's method of handling firing. + if(istype(loc, /obj/item/weapon/gun/projectile/multi_cannon)) + var/obj/item/weapon/gun/projectile/multi_cannon = loc + var/mob/living/user = multi_cannon.loc + if(istype(user)) + user?.hud_used.update_ammo_hud(user, multi_cannon) return else BB = null @@ -52,6 +58,13 @@ STOP_PROCESSING(SSobj, src) if(istype(loc,/obj/item/weapon/gun/projectile/multi_cannon)) loc.update_icon() + + // TGMC Ammo HUD - Update the HUD every time we're called to recharge. + if(istype(loc, /obj/item/weapon/gun/projectile/multi_cannon)) + var/obj/item/weapon/gun/projectile/multi_cannon = loc + var/mob/living/user = multi_cannon.loc + if(istype(user)) + user?.hud_used.update_ammo_hud(user, multi_cannon) //variants here, there's not many of them. diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index c617bd7b06..6ed5194bc0 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -212,6 +212,7 @@ else to_chat(user, "[src] is empty.") update_icon() + user.hud_used.update_ammo_hud(user, src) /obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob) ..() @@ -242,6 +243,7 @@ ammo_magazine.update_icon() ammo_magazine = null update_icon() //make sure to do this after unsetting ammo_magazine + user.hud_used.update_ammo_hud(user, src) /obj/item/weapon/gun/projectile/examine(mob/user) . = ..() @@ -276,57 +278,66 @@ return TRUE /obj/item/weapon/gun/projectile/get_ammo_type() - if(load_method == MAGAZINE) + if(load_method & MAGAZINE) if(chambered) // Do we have an ammo casing chambered var/obj/item/ammo_casing/A = chambered var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) - else if(ammo_magazine && ammo_magazine.stored_ammo.len) // Are we loaded, have a mag, and have ammo in the mag? + else if(ammo_magazine && ammo_magazine.stored_ammo.len) // Do we have a mag, and have ammo in the mag, but nothing chambered? var/obj/item/ammo_casing/A = ammo_magazine.stored_ammo[1] var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) - else if(!ammo_magazine && !chambered && src.projectile_type) // Else, we're entirely empty, and have no mag/nothing loaded in the gun, and nothing in the chamber. Return the DEFAULT projectile_type on the gun, if set. + else if(src.projectile_type) // Else, we're entirely empty, and irregardless of the mag we have loaded (as it's empty, or it would've passed the length check above), return the DEFAULT projectile_type on the gun, if set. var/obj/item/projectile/P = src.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) else return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case - else if(load_method == (SINGLE_CASING | SPEEDLOADER)) + else if(load_method & (SINGLE_CASING|SPEEDLOADER)) // Do we load with single casings OR speedloaders? if(chambered) // Do we have an ammo casing loaded in the chamber? All casings still have a projectile_type var. var/obj/item/ammo_casing/A = chambered var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the casing's projectile_type ammo hud state - else if(!chambered && loaded.len) // Else, is the gun loaded, but no ammo casings in chamber currently? + else if(loaded.len) // Else, is the gun loaded, but no ammo casings in chamber currently? var/obj/item/ammo_casing/A = loaded[1] var/obj/item/projectile/P = A.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the ammunition loaded in the gun's hud_state - else if(!chambered && !loaded.len && src.projectile_type) // Else, we're entirely empty, and have no mag/nothing loaded in the gun, and nothing in the chamber. Return the DEFAULT projectile_type on the gun, if set. + else if(src.projectile_type) // Else, we're entirely empty, and have nothing loaded in the gun, and nothing in the chamber. Return the DEFAULT projectile_type on the gun, if set. var/obj/item/projectile/P = src.projectile_type return list(initial(P.hud_state), initial(P.hud_state_empty)) else return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case - else - return list("unknown", "unknown") // Failsafe if we somehow fail both methods + else if(src.projectile_type) // Failsafe if we somehow don't pass the above. Return the DEFAULT projectile_type on the gun, if set. + var/obj/item/projectile/P = src.projectile_type + return list(initial(P.hud_state), initial(P.hud_state_empty)) + else // Failsafe if we somehow fail all three methods + return list("unknown", "unknown") /obj/item/weapon/gun/projectile/get_ammo_count() - if(load_method == MAGAZINE) - if(!ammo_magazine && chambered) // No magazine, and we have a casing chambered? Return if we have a round chambered or not. BB is the var for the round inside the casing. - return chambered.BB ? 1 : 0 - else if(ammo_magazine && chambered) // If we have a magazine loaded, check if chambered and return either the magazine + chambered or the loaded amount - return chambered.BB ? (ammo_magazine.stored_ammo.len + 1) : ammo_magazine.stored_ammo.len - else if(!chambered && ammo_magazine) // If we have a magazine loaded, but nothing chambered, return the magazine amount, if it exists. - return ammo_magazine.stored_ammo.len - else // Completely unloaded or code failure. - return 0 - else if(load_method == SINGLE_CASING | SPEEDLOADER) - if(chambered && chambered.BB && !loaded.len) // Chambered and has a round in the casing, but nothing in the magazine/internal ammo. BB is the var for the round inside the casing. - return chambered.BB ? 1 : 0 - else if(chambered && chambered.BB && loaded.len) // Chambered casing + round + has ammo. BB is the var for the round inside the casing. - return loaded.len + (chambered.BB ? 1 : 0) - else if(chambered && !chambered.BB && loaded.len) // Has ammo, no round chambered (but might have a casing still in the breech). BB is the var for the round inside the casing. - return loaded.len - else if(!chambered && loaded.len) // Has ammo, not chambered, or doesn't use the chambered var - return loaded.len - else // Completely unloaded, nothing in chamber or ammo, or code failed??? - return 0 - else - CRASH("/obj/item/weapon/gun/projectile/get_ammo_count() was called from [src] but did not have a valid load_method set! Load_method set was [load_method].") + if(ammo_magazine) // Do we have a magazine loaded? + var/shots_left + if(chambered && chambered.BB) // Do we have a bullet in the currently-chambered casing, if any? + shots_left++ + for(var/obj/item/ammo_casing/bullet in ammo_magazine.stored_ammo) + if(bullet.BB) + shots_left++ + + if(shots_left > 0) + return shots_left + else + return 0 // No ammo left or failsafe. + else if(loaded) // Do we use internal ammunition + var/shots_left + if(chambered && chambered.BB) // Do we have a bullet in the currently-chambered casing, if any? + shots_left++ + for(var/obj/item/ammo_casing/bullet in loaded) + if(bullet.BB) // Only increment how many shots we have left if we're loaded. + shots_left++ + + if(shots_left > 0) + return shots_left + else + return 0 // No ammo left or failsafe. + else if(chambered) // If we don't have a magazine or internal ammunition loaded, but we have a casing in chamber, return the amount. + return chambered.BB ? 1 : 0 + else // Failsafe, or completely unloaded + return 0 diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 9e6724b0fa..fb83c4bdcd 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -13,6 +13,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect var/mob_passthrough_check = 0 hud_state = "pistol_lightap" + hud_state_empty = "pistol_empty" // Just in case we somehow have no hud_state_empty defined muzzle_type = /obj/effect/projectile/muzzle/bullet diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index de2baf0ba6..6caa1d5070 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -9,7 +9,7 @@ hitsound_wall = 'sound/weapons/effects/searwall.ogg' hitsound = 'sound/weapons/zapbang.ogg' hud_state = "plasma" - hud_state = "battery_empty" + hud_state_empty = "battery_empty" var/flash_strength = 10 diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index c439197fe3..e45e4ee3a5 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -10,6 +10,7 @@ light_power = 0.5 light_color = "#55AAFF" hud_state = "plasma_blast" + hud_state_empty = "battery_empty" combustion = FALSE impact_effect_type = /obj/effect/temp_visual/impact_effect/ion From 0e3b6a9ba9587861cc9c032891a679b63948a1be Mon Sep 17 00:00:00 2001 From: Rykka Date: Thu, 7 Apr 2022 00:54:02 -0600 Subject: [PATCH 09/11] Forgot about self-charging cells, oops. --- code/modules/power/cell.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 4ec2d0a5e2..852a086d97 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -54,6 +54,12 @@ if(self_recharge) if(world.time >= last_use + charge_delay) give(charge_amount) + // TGMC Ammo HUD - Update the HUD every time we're called to recharge. + if(istype(loc, /obj/item/weapon/gun/energy)) // Are we in a gun currently? + var/obj/item/weapon/gun/energy/gun = loc + var/mob/living/user = gun.loc + if(istype(user)) + user?.hud_used.update_ammo_hud(user, gun) // Update the HUD else return PROCESS_KILL From 50b98e7f35851990e50eeb0a1113ef9c56d6c95b Mon Sep 17 00:00:00 2001 From: Rykka Date: Thu, 7 Apr 2022 02:16:57 -0600 Subject: [PATCH 10/11] Remove CHOMPEdit codes + _ch files added, given upstream ports in progress As stated, per maintainer/headmin request (and common sense). --- code/_onclick/hud/_defines.dm | 6 ++++ code/_onclick/hud/_defines_ch.dm | 8 ----- code/_onclick/hud/hud.dm | 5 +-- code/_onclick/hud/hud_ch.dm | 32 ------------------- code/modules/projectiles/gun.dm | 29 +++++++++++++++-- code/modules/projectiles/gun_ch.dm | 27 +--------------- code/modules/projectiles/guns/projectile.dm | 8 ++--- code/modules/projectiles/projectile.dm | 4 +++ .../modules/projectiles/projectile/bullets.dm | 14 ++++---- code/modules/projectiles/projectile_ch.dm | 2 -- vorestation.dme | 2 -- 11 files changed, 50 insertions(+), 87 deletions(-) delete mode 100644 code/_onclick/hud/_defines_ch.dm delete mode 100644 code/_onclick/hud/hud_ch.dm diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 44037305dd..14feaf1b5f 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -103,6 +103,12 @@ #define ui_alien_fire "EAST-1:28,NORTH-3:25" #define ui_alien_oxygen "EAST-1:28,NORTH-4:25" +// Goes above HUD, mid-right +#define ui_ammo_hud1 "EAST-1:28,CENTER+1:25" +#define ui_ammo_hud2 "EAST-1:28,CENTER+2:27" +#define ui_ammo_hud3 "EAST-1:28,CENTER+3:29" +#define ui_ammo_hud4 "EAST-1:28,CENTER+4:31" + //Middle right (status indicators) #define ui_temp "EAST-1:28,CENTER-2:13" #define ui_health "EAST-1:28,CENTER-1:15" diff --git a/code/_onclick/hud/_defines_ch.dm b/code/_onclick/hud/_defines_ch.dm deleted file mode 100644 index 3fb902eba8..0000000000 --- a/code/_onclick/hud/_defines_ch.dm +++ /dev/null @@ -1,8 +0,0 @@ -/** CHOMP-Specific Defines - * Put defines specific to OUR HUDs here. - * First thing to go here is the TGMC Ammo HUD. - */ -#define ui_ammo_hud1 "EAST-1:28,CENTER+1:25" -#define ui_ammo_hud2 "EAST-1:28,CENTER+2:27" -#define ui_ammo_hud3 "EAST-1:28,CENTER+3:29" -#define ui_ammo_hud4 "EAST-1:28,CENTER+4:31" \ No newline at end of file diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 8d9990024b..aef10cd979 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -470,9 +470,7 @@ var/list/global_huds = list( /* TGMC Ammo HUD Port * These procs call to screen_objects.dm's respective procs. * All these do is manage the amount of huds on screen and set the HUD. - * CHOMPEdit: Commented out, just uncomment once Polaris merges + it comes down from VORE. */ -/* ///Add an ammo hud to the user informing of the ammo count of G /datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G) if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE) @@ -500,5 +498,4 @@ var/list/global_huds = list( ///Update the ammo hud related to the gun G /datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G) var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] - ammo_hud?.update_hud(user, G) -*/ \ No newline at end of file + ammo_hud?.update_hud(user, G) \ No newline at end of file diff --git a/code/_onclick/hud/hud_ch.dm b/code/_onclick/hud/hud_ch.dm deleted file mode 100644 index 84772f4a9f..0000000000 --- a/code/_onclick/hud/hud_ch.dm +++ /dev/null @@ -1,32 +0,0 @@ -/** - * CHOMP-Specific HUD override. This will be backported to Polaris if they want it. - * Comment this out once Polaris has it! - */ -///Add an ammo hud to the user informing of the ammo count of G -/datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G) - if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE) - return - var/obj/screen/ammo/ammo_hud = new - ammo_hud_list[G] = ammo_hud - ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[length(ammo_hud_list)] - ammo_hud.add_hud(user, G) - ammo_hud.update_hud(user, G) - -///Remove the ammo hud related to the gun G from the user -/datum/hud/proc/remove_ammo_hud(mob/living/user, obj/item/weapon/gun/G) - var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] - if(isnull(ammo_hud)) - return - ammo_hud.remove_hud(user, G) - qdel(ammo_hud) - ammo_hud_list -= G - var/i = 1 - for(var/key in ammo_hud_list) - ammo_hud = ammo_hud_list[key] - ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[i] - i++ - -///Update the ammo hud related to the gun G -/datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G) - var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] - ammo_hud?.update_hud(user, G) \ No newline at end of file diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 4b56821d01..4bf31a2747 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -452,7 +452,6 @@ //YAWNEDIT: Knockdown code end - // CHOMPEdit: TGMC Ammo HUD insertion: user.hud_used.update_ammo_hud(user, src) // Similar to the above proc, but does not require a user, which is ideal for things like turrets. @@ -778,9 +777,35 @@ var/datum/firemode/new_mode = firemodes[sel_mode] new_mode.apply_to(src) to_chat(user, "\The [src] is now set to [new_mode.name].") - user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD + user.hud_used.update_ammo_hud(user, src) return new_mode /obj/item/weapon/gun/attack_self(mob/user) switch_firemodes(user) + +/* TGMC Ammo HUD Port Begin */ +/obj/item/weapon/gun + var/hud_enabled = TRUE + +/obj/item/weapon/gun/proc/has_ammo_counter() + return FALSE + +/obj/item/weapon/gun/proc/get_ammo_type() + return FALSE + +/obj/item/weapon/gun/proc/get_ammo_count() + return FALSE + +/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible. + if(slot == slot_l_hand || slot == slot_r_hand) + user.hud_used.add_ammo_hud(user, src) + else + user.hud_used.remove_ammo_hud(user, src) + + return ..() + +/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti. + user.hud_used.remove_ammo_hud(user, src) + + ..() \ No newline at end of file diff --git a/code/modules/projectiles/gun_ch.dm b/code/modules/projectiles/gun_ch.dm index 61e657ae58..a27d87a878 100644 --- a/code/modules/projectiles/gun_ch.dm +++ b/code/modules/projectiles/gun_ch.dm @@ -1,28 +1,3 @@ /obj/item/weapon/gun var/holy = 0 //For Divinely blessed guns - -/* TGMC Ammo HUD Port Begin */ -/obj/item/weapon/gun - var/hud_enabled = TRUE - -/obj/item/weapon/gun/proc/has_ammo_counter() - return FALSE - -/obj/item/weapon/gun/proc/get_ammo_type() - return FALSE - -/obj/item/weapon/gun/proc/get_ammo_count() - return FALSE - -/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible. - if(slot == slot_l_hand || slot == slot_r_hand) - user.hud_used.add_ammo_hud(user, src) - else - user.hud_used.remove_ammo_hud(user, src) - - return ..() - -/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti. - user.hud_used.remove_ammo_hud(user, src) - - ..() \ No newline at end of file + \ No newline at end of file diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 6ed5194bc0..bbfe861305 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -55,8 +55,8 @@ if(handle_casings != HOLD_CASINGS) ammo_magazine.stored_ammo -= chambered - var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD - if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + var/mob/living/M = loc + if(istype(M)) M?.hud_used.update_ammo_hud(M, src) if (chambered) @@ -103,8 +103,8 @@ if(handle_casings != HOLD_CASINGS) chambered = null - var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD - if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + var/mob/living/M = loc + if(istype(M)) M?.hud_used.update_ammo_hud(M, src) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 5e59456251..a24acd21cd 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -139,6 +139,10 @@ var/impact_effect_type = null var/list/impacted_mobs = list() + + // TGMC Ammo HUD Port + var/hud_state = "unknown" // What HUD state we use when we have ammunition. + var/hud_state_empty = "unknown" // The empty state. DON'T USE _FLASH IN THE NAME OF THE EMPTY STATE STRING, THAT IS ADDED BY THE CODE. /obj/item/projectile/proc/Range() range-- diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index fb83c4bdcd..6931b0e4e7 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -72,33 +72,33 @@ /obj/item/projectile/bullet/pistol // 9mm pistols and most SMGs. Sacrifice power for capacity. fire_sound = 'sound/weapons/gunshot2.ogg' damage = 20 - hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting. - hud_state_empty = "pistol_empty" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol" + hud_state_empty = "pistol_empty" /obj/item/projectile/bullet/pistol/ap damage = 15 armor_penetration = 30 - hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_light_ap" /obj/item/projectile/bullet/pistol/hp damage = 25 armor_penetration = -50 - hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_ap" /obj/item/projectile/bullet/pistol/medium // .45 (and maybe .40 if it ever gets added) caliber security pistols. Balance between capacity and power. fire_sound = 'sound/weapons/gunshot3.ogg' // Snappier sound. damage = 25 - hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol" /obj/item/projectile/bullet/pistol/medium/ap damage = 20 armor_penetration = 15 - hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_light_ap" /obj/item/projectile/bullet/pistol/medium/hp damage = 30 armor_penetration = -50 - hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_ap" /obj/item/projectile/bullet/pistol/strong // .357 and .44 caliber stuff. High power pistols like the Mateba or Desert Eagle. Sacrifice capacity for power. fire_sound = 'sound/weapons/gunshot4.ogg' diff --git a/code/modules/projectiles/projectile_ch.dm b/code/modules/projectiles/projectile_ch.dm index 649673c772..a2af0b08be 100644 --- a/code/modules/projectiles/projectile_ch.dm +++ b/code/modules/projectiles/projectile_ch.dm @@ -1,8 +1,6 @@ /obj/item/projectile /// If this projectile is holy. Silver bullets, etc. Currently no effects. var/holy = 0 - var/hud_state = "unknown" // TGMC Ammo HUD Port - var/hud_state_empty = "unknown" // TGMC Ammo HUD Port /obj/item/projectile/bullet/pellet/shotgun/silver name = "shrapnel" diff --git a/vorestation.dme b/vorestation.dme index 55b0592e30..15474e7b5d 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -169,7 +169,6 @@ #include "code\_onclick\rig.dm" #include "code\_onclick\telekinesis.dm" #include "code\_onclick\hud\_defines.dm" -#include "code\_onclick\hud\_defines_ch.dm" #include "code\_onclick\hud\_defines_vr.dm" #include "code\_onclick\hud\ability_screen_objects.dm" #include "code\_onclick\hud\action.dm" @@ -181,7 +180,6 @@ #include "code\_onclick\hud\ghost.dm" #include "code\_onclick\hud\gun_mode.dm" #include "code\_onclick\hud\hud.dm" -#include "code\_onclick\hud\hud_ch.dm" #include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\map_popups.dm" #include "code\_onclick\hud\minihud.dm" From d3962b086b7a8ea5aacf64841799a2abac15d717 Mon Sep 17 00:00:00 2001 From: Rykka Date: Sun, 10 Apr 2022 09:11:46 -0600 Subject: [PATCH 11/11] Sets Vepr to laser_overcharge HUD state. --- code/modules/projectiles/projectile/energy_ch.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/projectile/energy_ch.dm b/code/modules/projectiles/projectile/energy_ch.dm index 60a6bd0b26..5376ff5c97 100644 --- a/code/modules/projectiles/projectile/energy_ch.dm +++ b/code/modules/projectiles/projectile/energy_ch.dm @@ -22,4 +22,5 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect hitsound_wall = 'sound/weapons/effects/searwall.ogg' hitsound = 'sound/weapons/sear.ogg' + hud_state = "laser_overcharge"