From f8c8d0bc269c480ba768b1d923be74ef072cfe82 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Sat, 3 Apr 2021 18:20:25 +0100 Subject: [PATCH] Gun huds V2 [NOW WITH COMPONENTS!] (#4333) * start * Update tgstation.dme * Update human.dm * aaa * aaaaaa * Advanced shit here. * NEXT GEN FPS * Update gun_hud.dm * Update gun_safety.dm * Update ballistic.dm * Delete gun_safety.dm * Create gun_safety.dm * eeee * WAKE THE FUCK UP SAMURAI * aaaa * aaaa * v2.3 * aa * Update gun_hud_component.dm * aaaaaaaa * aaaaaaaaaa * Update gun_hud_component.dm * Update weldingtool.dm * Update gun_hud_component.dm * aaaaa * aaa * JAMMED" * Update gun_hud_component.dm * Update gun_hud_component.dm * Update gun_hud_component.dm * Fullauto stack tracing added * aaaaaa * TICK TEST * Update fullauto.dm * Update fullauto.dm * REVERT THIS MAYBE * Update fullauto.dm * Update fullauto.dm * Update fullauto.dm * Update fullauto.dm * WORK YOU BITCH * Update fullauto.dm * a * Update gun_hud_upgrades.dm * aaaa * aaaaaaaaa * aaaaa * Update gun_hud_component.dm * Update gun_hud_component.dm --- code/__DEFINES/atom_hud.dm | 3 + code/__DEFINES/~skyrat_defines/signals.dm | 2 + code/_onclick/hud/_defines.dm | 3 + code/_onclick/hud/hud.dm | 2 + code/_onclick/hud/human.dm | 6 + code/game/objects/items/tools/weldingtool.dm | 3 + code/modules/projectiles/guns/ballistic.dm | 2 + code/modules/projectiles/guns/energy.dm | 2 + .../master_files/code/_onclick/hud/readme.md | 4 + .../code/datums/components/fullauto.dm | 24 ++- .../code/modules/projectiles/guns/gun.dm | 5 + .../modules/gunhud/code/gun_hud_component.dm | 165 ++++++++++++++++++ .../modules/gunhud/code/hud/gun_hud.dm | 86 +++++++++ .../modules/gunhud/icons/hud/gun_hud.dmi | Bin 0 -> 7385 bytes modular_skyrat/modules/gunhud/readme.md | 26 +++ .../modules/gunsgalore/code/guns/master.dm | 1 + tgstation.dme | 2 + 17 files changed, 327 insertions(+), 9 deletions(-) create mode 100644 modular_skyrat/master_files/code/_onclick/hud/readme.md create mode 100644 modular_skyrat/modules/gunhud/code/gun_hud_component.dm create mode 100644 modular_skyrat/modules/gunhud/code/hud/gun_hud.dm create mode 100644 modular_skyrat/modules/gunhud/icons/hud/gun_hud.dmi create mode 100644 modular_skyrat/modules/gunhud/readme.md diff --git a/code/__DEFINES/atom_hud.dm b/code/__DEFINES/atom_hud.dm index 6495c88136e..669ec8c4134 100644 --- a/code/__DEFINES/atom_hud.dm +++ b/code/__DEFINES/atom_hud.dm @@ -46,6 +46,9 @@ #define ANTAG_HUD "23" // for fans to identify pins #define FAN_HUD "24" +//SKYRAT EDIT ADDITION - GUNHUD +// ammo of guns +#define AMMO_HUD "25" //by default everything in the hud_list of an atom is an image //a value in hud_list with one of these will change that behavior diff --git a/code/__DEFINES/~skyrat_defines/signals.dm b/code/__DEFINES/~skyrat_defines/signals.dm index 10ed986cb62..59e62107691 100644 --- a/code/__DEFINES/~skyrat_defines/signals.dm +++ b/code/__DEFINES/~skyrat_defines/signals.dm @@ -17,3 +17,5 @@ #define COMSIG_GUN_AUTOFIRE_DESELECTED "gun_autofire_deselected" ///The gun needs to update the gun hud! #define COMSIG_UPDATE_AMMO_HUD "update_ammo_hud" +///The gun has jammed. +#define COMSIG_GUN_JAMMED "gun_jammed" diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index bee229fa21c..514e5beddbe 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -181,3 +181,6 @@ //Families #define ui_wanted_lvl "NORTH,11" + +//SKYRAT HUD DEFINES BELOW +#define ui_ammocounter "EAST-1:28,CENTER-5:9" diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index ce9be78fe4b..4c28a6c189d 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -29,6 +29,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list( var/atom/movable/screen/ling/chems/lingchemdisplay var/atom/movable/screen/ling/sting/lingstingdisplay + var/atom/movable/screen/ammo_counter //SKYRAT EDIT ADDITION + var/atom/movable/screen/blobpwrdisplay var/atom/movable/screen/alien_plasma_display diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 572220dc3bc..f9ecdce76e8 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -315,6 +315,12 @@ combo_display = new /atom/movable/screen/combo() infodisplay += combo_display + //SKYRAT EDIT ADDITION + ammo_counter = new /atom/movable/screen/ammo_counter() + ammo_counter.hud = src + infodisplay += ammo_counter + //SKYRAT EDIT END + for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory)) if(inv.slot_id) inv.hud = src diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 746133c2201..a8704c50ab8 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -79,6 +79,7 @@ damtype = BRUTE update_appearance() if(!can_off_process) + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) //SKYRAT EDIT ADDITION STOP_PROCESSING(SSobj, src) return //Welders left on now use up fuel, but lets not have them run out quite that fast @@ -88,6 +89,7 @@ burned_fuel_for += delta_time if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL) use(1) + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) //SKYRAT EDIT ADDITION update_appearance() //This is to start fires. process() is only called if the welder is on. @@ -208,6 +210,7 @@ . = welding welding = new_value set_light_on(welding) + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) //SKYRAT EDIT ADDITION //Turns off the welder if there is no more fuel (does this really need to be its own proc?) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 5d52c8e2916..55c960100ca 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -257,6 +257,7 @@ if (bolt_type == BOLT_TYPE_OPEN && !bolt_locked) chamber_round(TRUE) update_appearance() + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) return TRUE else to_chat(user, "You cannot seem to get \the [src] out of your hands!") @@ -285,6 +286,7 @@ if (display_message) to_chat(user, "You pull the [magazine_wording] out of \the [src].") update_appearance() + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) /obj/item/gun/ballistic/can_shoot() return chambered diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 51533ec5bad..21615cefb1d 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -81,6 +81,7 @@ cell.give(100) if(!chambered) //if empty chamber we try to charge a new shot recharge_newshot(TRUE) + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) //SKYRAT EDIT ADDITION update_appearance() /obj/item/gun/energy/attack_self(mob/living/user as mob) @@ -138,6 +139,7 @@ chambered = null recharge_newshot(TRUE) update_appearance() + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) //SKYRAT EDIT ADDITION return /obj/item/gun/energy/update_icon_state() diff --git a/modular_skyrat/master_files/code/_onclick/hud/readme.md b/modular_skyrat/master_files/code/_onclick/hud/readme.md new file mode 100644 index 00000000000..428e5d56227 --- /dev/null +++ b/modular_skyrat/master_files/code/_onclick/hud/readme.md @@ -0,0 +1,4 @@ +This is the directory for any hud additions, please add them appropriately and log them in this file. + +Current huds: +- Gun hud - Gunhud diff --git a/modular_skyrat/master_files/code/datums/components/fullauto.dm b/modular_skyrat/master_files/code/datums/components/fullauto.dm index 7286e1d36de..9fea4581358 100644 --- a/modular_skyrat/master_files/code/datums/components/fullauto.dm +++ b/modular_skyrat/master_files/code/datums/components/fullauto.dm @@ -21,6 +21,7 @@ RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/wake_up) RegisterSignal(parent, COMSIG_GUN_AUTOFIRE_SELECTED, .proc/wake_up) RegisterSignal(parent, list(COMSIG_PARENT_PREQDELETED, COMSIG_ITEM_DROPPED, COMSIG_GUN_AUTOFIRE_DESELECTED), .proc/autofire_off) + RegisterSignal(parent, COMSIG_GUN_JAMMED, .proc/stop_autofiring) if(_autofire_shot_delay) autofire_shot_delay = _autofire_shot_delay if(ismob(gun.loc)) @@ -29,7 +30,8 @@ /datum/component/automatic_fire/Destroy() - UnregisterSignal(parent, list(COMSIG_PARENT_PREQDELETED, COMSIG_ITEM_DROPPED, COMSIG_GUN_AUTOFIRE_DESELECTED)) + UnregisterSignal(parent, list(COMSIG_PARENT_PREQDELETED, COMSIG_ITEM_DROPPED, COMSIG_GUN_AUTOFIRE_DESELECTED, COMSIG_GUN_JAMMED, \ + COMSIG_GUN_AUTOFIRE_SELECTED, COMSIG_ITEM_EQUIPPED)) autofire_off() return ..() @@ -45,7 +47,6 @@ /datum/component/automatic_fire/proc/wake_up(datum/source, mob/user, slot) SIGNAL_HANDLER - if(autofire_stat & (AUTOFIRE_STAT_ALERT)) return //We've updated the firemode. No need for more. if(autofire_stat & AUTOFIRE_STAT_FIRING) @@ -94,8 +95,9 @@ if(!QDELETED(shooter)) UnregisterSignal(shooter, COMSIG_MOB_LOGOUT) shooter = null - parent.UnregisterSignal(parent, COMSIG_AUTOFIRE_SHOT) parent.UnregisterSignal(src, COMSIG_AUTOFIRE_ONMOUSEDOWN) + parent.UnregisterSignal(parent, COMSIG_AUTOFIRE_SHOT) + /datum/component/automatic_fire/proc/on_client_login(mob/source) SIGNAL_HANDLER @@ -151,6 +153,7 @@ /datum/component/automatic_fire/proc/start_autofiring() if(autofire_stat == AUTOFIRE_STAT_FIRING) return //Already pew-pewing. + autofire_stat = AUTOFIRE_STAT_FIRING clicker.mouse_override_icon = 'icons/effects/mouse_pointers/weapon_pointer.dmi' @@ -259,12 +262,15 @@ if(clicker.mob.get_active_held_item() != src) return COMPONENT_AUTOFIRE_ONMOUSEDOWN_BYPASS - /obj/item/gun/proc/do_autofire(datum/source, atom/target, mob/living/shooter, params) - SIGNAL_HANDLER_DOES_SLEEP - if(!can_shoot()) - shoot_with_empty_chamber(shooter) - return NONE + SIGNAL_HANDLER + if(!can_shoot()) + shoot_with_empty_chamber(shooter) + return FALSE + INVOKE_ASYNC(src, .proc/do_autofire_shot, source, target, shooter, params) + return COMPONENT_AUTOFIRE_SHOT_SUCCESS + +/obj/item/gun/proc/do_autofire_shot(datum/source, atom/target, mob/living/shooter, params) var/obj/item/gun/akimbo_gun = shooter.get_inactive_held_item() var/bonus_spread = 0 if(istype(akimbo_gun) && weapon_weight < WEAPON_MEDIUM) @@ -272,7 +278,7 @@ bonus_spread = dual_wield_spread addtimer(CALLBACK(akimbo_gun, /obj/item/gun.proc/process_fire, target, shooter, TRUE, params, null, bonus_spread), 1) process_fire(target, shooter, TRUE, params, null, bonus_spread) - return COMPONENT_AUTOFIRE_SHOT_SUCCESS //All is well, we can continue shooting. + #undef AUTOFIRE_MOUSEUP #undef AUTOFIRE_MOUSEDOWN diff --git a/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm b/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm index c23bafac9a4..333f97b2fb8 100644 --- a/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm +++ b/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm @@ -239,6 +239,7 @@ update_appearance() firemode_action.button_icon_state = "fireselect_[fire_select]" firemode_action.UpdateButtonIcon() + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) return TRUE //called after the gun has successfully fired its chambered ammo. @@ -384,6 +385,7 @@ playsound(src, 'sound/weapons/empty.ogg', 100, TRUE) user.visible_message("[user] toggles [src]'s safety [safety ? "ON" : "OFF"].", "You toggle [src]'s safety [safety ? "ON" : "OFF"].") + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) /obj/item/gun/proc/handle_pins(mob/living/user) if(pin) @@ -434,6 +436,7 @@ return FALSE process_chamber() update_appearance() + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) return TRUE /obj/item/gun/proc/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0) @@ -488,6 +491,8 @@ user.update_inv_hands() SSblackbox.record_feedback("tally", "gun_fired", 1, type) + SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) + return TRUE /obj/item/gun/proc/reset_semicd() diff --git a/modular_skyrat/modules/gunhud/code/gun_hud_component.dm b/modular_skyrat/modules/gunhud/code/gun_hud_component.dm new file mode 100644 index 00000000000..9a6810c58c2 --- /dev/null +++ b/modular_skyrat/modules/gunhud/code/gun_hud_component.dm @@ -0,0 +1,165 @@ +/datum/component/ammo_hud + var/atom/movable/screen/ammo_counter/hud + +/datum/component/ammo_hud/Initialize() + . = ..() + if(!istype(parent, /obj/item/gun) && !istype(parent, /obj/item/weldingtool)) + return COMPONENT_INCOMPATIBLE + RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/wake_up) + +/datum/component/ammo_hud/Destroy() + turn_off() + return ..() + +/datum/component/ammo_hud/proc/wake_up(datum/source, mob/user, slot) + SIGNAL_HANDLER + + RegisterSignal(parent, list(COMSIG_PARENT_PREQDELETED, COMSIG_ITEM_DROPPED), .proc/turn_off) + + if(ishuman(user)) + var/mob/living/carbon/human/H = user + if(H.is_holding(parent)) + if(H.hud_used) + hud = H.hud_used.ammo_counter + turn_on() + else + turn_off() + +/datum/component/ammo_hud/proc/turn_on() + SIGNAL_HANDLER + + RegisterSignal(parent, COMSIG_UPDATE_AMMO_HUD, .proc/update_hud) + + hud.turn_on() + update_hud() + +/datum/component/ammo_hud/proc/turn_off() + SIGNAL_HANDLER + + UnregisterSignal(parent, list(COMSIG_PARENT_PREQDELETED, COMSIG_ITEM_DROPPED, COMSIG_UPDATE_AMMO_HUD)) + + if(hud) + hud.turn_off() + hud = null + +/datum/component/ammo_hud/proc/update_hud() + SIGNAL_HANDLER + if(istype(parent, /obj/item/gun/ballistic)) + var/obj/item/gun/ballistic/pew = parent + hud.maptext = null + hud.icon_state = "backing" + var/backing_color = COLOR_CYAN + if(!pew.magazine) + hud.set_hud(backing_color, "oe", "te", "he", "no_mag") + return + if(!pew.get_ammo()) + hud.set_hud(backing_color, "oe", "te", "he", "empty_flash") + return + + var/indicator + var/rounds = num2text(pew.get_ammo(TRUE)) + var/oth_o + var/oth_t + var/oth_h + + switch(pew.fire_select) + if(SELECT_SEMI_AUTOMATIC) + indicator = "semi" + if(SELECT_BURST_SHOT) + indicator = "burst" + if(SELECT_FULLY_AUTOMATIC) + indicator = "auto" + + if(pew.safety) + indicator = "safe" + + if(pew.jammed) + indicator = "jam" + + switch(length(rounds)) + if(1) + oth_o = "o[rounds[1]]" + if(2) + oth_o = "o[rounds[2]]" + oth_t = "t[rounds[1]]" + if(3) + oth_o = "o[rounds[3]]" + oth_t = "t[rounds[2]]" + oth_h = "h[rounds[1]]" + else + oth_o = "o9" + oth_t = "t9" + oth_h = "h9" + hud.set_hud(backing_color, oth_o, oth_t, oth_h, indicator) + + else if(istype(parent, /obj/item/gun/energy)) + var/obj/item/gun/energy/pew = parent + hud.icon_state = "eammo_counter" + hud.cut_overlays() + hud.maptext_x = -12 + var/obj/item/ammo_casing/energy/shot = pew.ammo_type[pew.select] + var/batt_percent = FLOOR(clamp(pew.cell.charge / pew.cell.maxcharge, 0, 1) * 100, 1) + var/shot_cost_percent = FLOOR(clamp(shot.e_cost / pew.cell.maxcharge, 0, 1) * 100, 1) + if(batt_percent > 99 || shot_cost_percent > 99) + hud.maptext_x = -12 + else + hud.maptext_x = -8 + if(!pew.can_shoot()) + hud.icon_state = "eammo_counter_empty" + hud.maptext = "
[batt_percent]%
[shot_cost_percent]%
" + return + if(batt_percent <= 25) + hud.maptext = "
[batt_percent]%
[shot_cost_percent]%
" + return + hud.maptext = "
[batt_percent]%
[shot_cost_percent]%
" + + else if(istype(parent, /obj/item/weldingtool)) + var/obj/item/weldingtool/welder = parent + hud.maptext = null + var/backing_color = COLOR_TAN_ORANGE + hud.icon_state = "backing" + + if(welder.get_fuel() < 1) + hud.set_hud(backing_color, "oe", "te", "he", "empty_flash") + return + + var/indicator + var/fuel = num2text(welder.get_fuel()) + var/oth_o + var/oth_t + var/oth_h + + if(welder.welding) + indicator = "flame_on" + else + indicator = "flame_off" + + fuel = num2text(welder.get_fuel()) + + switch(length(fuel)) + if(1) + oth_o = "o[fuel[1]]" + if(2) + oth_o = "o[fuel[2]]" + oth_t = "t[fuel[1]]" + if(3) + oth_o = "o[fuel[3]]" + oth_t = "t[fuel[2]]" + oth_h = "h[fuel[1]]" + else + oth_o = "o9" + oth_t = "t9" + oth_h = "h9" + hud.set_hud(backing_color, oth_o, oth_t, oth_h, indicator) + +/obj/item/gun/ballistic/ComponentInitialize() + . = ..() + AddComponent(/datum/component/ammo_hud) + +/obj/item/gun/energy/ComponentInitialize() + . = ..() + AddComponent(/datum/component/ammo_hud) + +/obj/item/weldingtool/ComponentInitialize() + . = ..() + AddComponent(/datum/component/ammo_hud) diff --git a/modular_skyrat/modules/gunhud/code/hud/gun_hud.dm b/modular_skyrat/modules/gunhud/code/hud/gun_hud.dm new file mode 100644 index 00000000000..a282af67369 --- /dev/null +++ b/modular_skyrat/modules/gunhud/code/hud/gun_hud.dm @@ -0,0 +1,86 @@ +///////////////////////// +//Customizable ammo hud// +///////////////////////// + +/* +This hud is controlled namely by the ammo_hud component. Generally speaking this is inactive much like all other hud components until it's needed. +It does not do any calculations of it's own, you must do this externally. +If you wish to use this hud, use the ammo_hud component or create another one which interacts with it via the below procs. +proc/turn_off +proc/turn_on +proc/set_hud +Check the gun_hud.dmi for all available icons you can use. +*/ + +/atom/movable/screen/ammo_counter + name = "ammo counter" + icon = 'modular_skyrat/modules/gunhud/icons/hud/gun_hud.dmi' + icon_state = "backing" + screen_loc = ui_ammocounter + invisibility = INVISIBILITY_ABSTRACT + + ///This is the color assigned to the OTH backing, numbers and indicator. + var/backing_color = COLOR_RED + ///This is the "backlight" of the numbers, and only the numbers. Generally you should leave this alone if you aren't making some mutant project. + var/oth_backing = "oth_light" + + //Below are the OTH numbers, these are assigned by oX, tX and hX, x being the number you wish to display(0-9) + ///OTH position X00 + var/oth_o + ///OTH position 0X0 + var/oth_t + ///OTH position 00X + var/oth_h + ///This is the custom indicator sprite that will appear in the box at the bottom of the ammo hud, use this for something like semi/auto toggle on a gun. + var/indicator + +///This proc simply resets the hud to standard and removes it from the players visible hud. +/atom/movable/screen/ammo_counter/proc/turn_off() + invisibility = INVISIBILITY_ABSTRACT + maptext = null + backing_color = COLOR_RED + oth_backing = "" + oth_o = "" + oth_t = "" + oth_h = "" + indicator = "" + update_appearance() + +///This proc turns the hud on, but does not set it to anything other than the currently set values +/atom/movable/screen/ammo_counter/proc/turn_on() + invisibility = 0 + +///This is the main proc for altering the hud's appeareance, it controls the setting of the overlays. Use the OTH and below variables to set it accordingly. +/atom/movable/screen/ammo_counter/proc/set_hud(_backing_color, _oth_o, _oth_t, _oth_h, _indicator, _oth_backing = "oth_light") + backing_color = _backing_color + oth_backing = _oth_backing + oth_o = _oth_o + oth_t = _oth_t + oth_h = _oth_h + indicator = _indicator + + update_appearance() + +/atom/movable/screen/ammo_counter/update_overlays() + . = ..() + if(oth_backing) + var/mutable_appearance/oth_backing_overlay = mutable_appearance(icon, oth_backing) + oth_backing_overlay.color = backing_color + . += oth_backing_overlay + if(oth_o) + var/mutable_appearance/o_overlay = mutable_appearance(icon, oth_o) + o_overlay.color = backing_color + . += o_overlay + if(oth_t) + var/mutable_appearance/t_overlay = mutable_appearance(icon, oth_t) + t_overlay.color = backing_color + . += t_overlay + if(oth_h) + var/mutable_appearance/h_overlay = mutable_appearance(icon, oth_h) + h_overlay.color = backing_color + . += h_overlay + if(indicator) + var/mutable_appearance/indicator_overlay = mutable_appearance(icon, indicator) + indicator_overlay.color = backing_color + . += indicator_overlay + diff --git a/modular_skyrat/modules/gunhud/icons/hud/gun_hud.dmi b/modular_skyrat/modules/gunhud/icons/hud/gun_hud.dmi new file mode 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HYh`6U)-O3UheogRtC3~ZQ@&WT~v-WaLk{B+O1AAxJR+x(&$sL zk`l)pF#{5=^q6Sb8xxeI-4KYkMJ%8b`!ghCz4P%67A{Z!j4I&rMR>Km(L@pZ`uaw0 zUO~x6I!OJ~6P0#8{*4rn<9BuI5I6vMKB9`gAH#h>aASJMSmW}S45#1dq8I$$$W+BF zX42x%*S}nP7d^(THQ>mW$mmQ-N7CILlvHA52UnB~KpS-tC)L<*1Y6B^u z@sqmKfP%)OY!XMg&(*CTFDo}z+v-L*iwUvIGUchPb({wGc1 z?Gm`V+TNeL`c(KN;m$4FRq)({FFucdfES-1dfIFrUGjwSPWHB2!h*hn_#ci${KNP@ zMAFYl=xSiLjbWbmVunUOEabnryeUtYs@_f%*J9QR0{$gMZngrO7#AkwrAe|6bv8X=X6ZgvUfPbquZe!2cxTuap$A7F6i3HcpDhJd%v3bXB`q zUa!vYdg}DgZ;YNZ9eOnbLNA`sF^MPbOiO$cMl{NPlDPUiHtJte0<(*ud?GBz-;#s0 olP)J)w9R9zY5Ofw1=rdu#{d8T literal 0 HcmV?d00001 diff --git a/modular_skyrat/modules/gunhud/readme.md b/modular_skyrat/modules/gunhud/readme.md new file mode 100644 index 00000000000..e580d96643a --- /dev/null +++ b/modular_skyrat/modules/gunhud/readme.md @@ -0,0 +1,26 @@ +## Title: Gunpoint + +MODULE ID: GUNHUD + +### Description: + +Adds a dynamic hud system for energy and some ballistics guns. + +### TG Proc Changes: +- N/A +### Defines: + +.code\__DEFINES\atom_hud.dm > #define AMMO_HUD "25" + +.code\modules\projectiles\guns\ballistic.dm > /obj/item/gun/ballistic/examine(mob/user) + +### Master file additions + +- Hud directory > _defines.dm, human.dm, hud.dm + +### Included files that are not contained in this module: + +- N/A + +### Credits: +Gandalf2k15 - OG creation. diff --git a/modular_skyrat/modules/gunsgalore/code/guns/master.dm b/modular_skyrat/modules/gunsgalore/code/guns/master.dm index d08239e5389..da0910adf0b 100644 --- a/modular_skyrat/modules/gunsgalore/code/guns/master.dm +++ b/modular_skyrat/modules/gunsgalore/code/guns/master.dm @@ -81,6 +81,7 @@ jammed = TRUE playsound(src, 'sound/effects/stall.ogg', 60, TRUE) to_chat(user, "The [src] jams!") + SEND_SIGNAL(src, COMSIG_GUN_JAMMED) else if(jammed) to_chat(user, "You start to unjam the bolt!") if(do_after(user, unjam_time)) diff --git a/tgstation.dme b/tgstation.dme index 194fb6c4241..ff55a2581b8 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3908,6 +3908,8 @@ #include "modular_skyrat\modules\ghostcafe\code\game\objects\structures\ghost_role_spawners.dm" #include "modular_skyrat\modules\ghostcafe\code\game\objects\structures\stackspawner_machine.dm" #include "modular_skyrat\modules\ghostcafe\code\modules\mob\living\silicon\robot\robot_ghostcafe.dm" +#include "modular_skyrat\modules\gunhud\code\gun_hud_component.dm" +#include "modular_skyrat\modules\gunhud\code\hud\gun_hud.dm" #include "modular_skyrat\modules\gunpoint\code\datum\gunpoint\gunpoint.dm" #include "modular_skyrat\modules\gunpoint\code\datum\gunpoint\gunpoint_datum.dm" #include "modular_skyrat\modules\gunpoint\code\datum\gunpoint\gunpoint_radial.dm"