From 941d049bdd8456ecbcfb50efcba6d20c7267154e Mon Sep 17 00:00:00 2001 From: martianPhenotype <196676379+martianPhenotype@users.noreply.github.com> Date: Sat, 14 Mar 2026 14:14:17 -0400 Subject: [PATCH] First chunk of modular karlization Co-Authored-By: MelNye <77447558+l3lb0t@users.noreply.github.com> --- code/modules/projectiles/gun.dm | 7 +-- mods/content/bosniation/_bosniation.dm | 4 ++ mods/content/bosniation/hitscan_ballistics.dm | 2 + mods/content/bosniation/screen_health.dm | 57 +++++++++++++++++++ mods/content/bosniation/tacticool_reload.dm | 8 +++ 5 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 mods/content/bosniation/_bosniation.dm create mode 100644 mods/content/bosniation/hitscan_ballistics.dm create mode 100644 mods/content/bosniation/screen_health.dm create mode 100644 mods/content/bosniation/tacticool_reload.dm diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 13b739cf041..fc506027cf9 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -341,7 +341,7 @@ pointblank = 0 //update timing - var/delay = max(fire_delay, burst_delay + 1, DEFAULT_QUICK_COOLDOWN) + var/delay = max(fire_delay, burst_delay + 1, (DEFAULT_QUICK_COOLDOWN)*!autofire_enabled) // Bosniation12 override if(delay && istype(user)) user.setClickCooldown(delay) next_fire_time = world.time + delay @@ -480,10 +480,7 @@ if(isliving(firer)) var/mob/living/user = firer //Not keeping gun active will throw off aim (for non-Masters) - if(user.skill_check(SKILL_WEAPONS, SKILL_PROF)) - stood_still = min(user.l_move_time, last_handled) - else - stood_still = max(user.l_move_time, last_handled) + stood_still = max(user.l_move_time, last_handled) /// Bosniation12 override stood_still = max(0,round((world.time - stood_still)/10) - 1) if(stood_still) diff --git a/mods/content/bosniation/_bosniation.dm b/mods/content/bosniation/_bosniation.dm new file mode 100644 index 00000000000..04851ad4d91 --- /dev/null +++ b/mods/content/bosniation/_bosniation.dm @@ -0,0 +1,4 @@ +// others are DME but that's just clerical afaik ~10sc. + +#include "screen_health.dm" +#include "tacticool_reload.dm" diff --git a/mods/content/bosniation/hitscan_ballistics.dm b/mods/content/bosniation/hitscan_ballistics.dm new file mode 100644 index 00000000000..7ce8db7bd13 --- /dev/null +++ b/mods/content/bosniation/hitscan_ballistics.dm @@ -0,0 +1,2 @@ +/obj/item/projectile/bullet + hitscan = TRUE diff --git a/mods/content/bosniation/screen_health.dm b/mods/content/bosniation/screen_health.dm new file mode 100644 index 00000000000..c217b485095 --- /dev/null +++ b/mods/content/bosniation/screen_health.dm @@ -0,0 +1,57 @@ +// This override adds body damage overlays to the health doll. +/obj/screen/health/organs/on_update_icon() + + var/mob/living/human/owner = owner_ref?.resolve() + if(!istype(owner)) + return + + cut_overlays() + + // We don't check can_feel_pain() here, otherwise FBP don't get variable health indicators. + if(owner.has_chemical_effect(CE_PAINKILLER, 100)) + icon_state = "health_numb" + compile_overlays() + return + + icon_state = "blank" + + // Generate a by-limb health display. + var/no_damage = 1 + var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators. + + var/decl/species/my_species = owner.get_species() + var/decl/bodytype/body = owner.get_bodytype() + trauma_val = max(owner.shock_stage, owner.get_shock())/ (my_species.total_health-100) + + for(var/obj/item/organ/external/E in owner.get_external_organs()) + if(no_damage && (E.brute_dam || E.burn_dam)) + no_damage = 0 + var/damage_image = E.get_damage_hud_image() + if(damage_image) + add_overlay(damage_image) + if(E.damage_state == "00") + continue + var/icon/doll_wounds = new /icon(body.get_damage_overlays(src), E.damage_state) + doll_wounds.Blend(get_limb_mask_for(E), ICON_MULTIPLY) + doll_wounds.Blend((BP_IS_ROBOTIC(E) ? SYNTH_BLOOD_COLOR : owner.get_blood_color(src)), ICON_MULTIPLY) + add_overlay(doll_wounds) + add_overlay(image(body.bandages_icon, "[E.icon_state][E.bandage_level()]")) + + // Apply a fire overlay if we're burning. + var/crit_markers = get_ui_icon(owner.client?.prefs?.UI_style, HUD_CRIT_MARKER) + if(crit_markers) + if(owner.is_on_fire()) + add_overlay(image(crit_markers, "burning")) + // Show a general pain/crit indicator if needed. + if(owner.is_asystole()) + add_overlay(image(crit_markers, "hardcrit")) + else if(trauma_val) + if(trauma_val > 0.7) + add_overlay(image(crit_markers, "softcrit")) + if(trauma_val >= 1) + add_overlay(image(crit_markers, "hardcrit")) + else if(no_damage) + add_overlay(image(crit_markers, "fullhealth")) + + + compile_overlays() diff --git a/mods/content/bosniation/tacticool_reload.dm b/mods/content/bosniation/tacticool_reload.dm new file mode 100644 index 00000000000..3f9181caf83 --- /dev/null +++ b/mods/content/bosniation/tacticool_reload.dm @@ -0,0 +1,8 @@ +/obj/item/ammo_magazine/bash(obj/item/used_item, mob/user) + //Masters can reload one-handed guns one-handed. + if (istype(used_item, /obj/item/gun/projectile) && (used_item.loc == user || used_item.loc.loc == user)) //Get around bags, webbing, etc + var/obj/item/gun/projectile/held_gun = used_item + if (user.skill_check(SKILL_WEAPONS, SKILL_PROF)) + if (held_gun.one_hand_penalty < 3) + held_gun.load_ammo(src, user) + . = ..()