diff --git a/code/__DEFINES/~skyrat_defines/factions.dm b/code/__DEFINES/~skyrat_defines/factions.dm
index 7b055154df4..96ad6c15c1a 100644
--- a/code/__DEFINES/~skyrat_defines/factions.dm
+++ b/code/__DEFINES/~skyrat_defines/factions.dm
@@ -1,4 +1,9 @@
+// Black Mesa away mission factions
+
#define FACTION_XEN "xen"
#define FACTION_HECU "hecu"
#define FACTION_BLACKOPS "blackops"
#define FACTION_BLACKMESA "blackmesa"
+
+// ERT faction
+#define FACTION_ERT "ert"
diff --git a/code/__DEFINES/~skyrat_defines/signals.dm b/code/__DEFINES/~skyrat_defines/signals.dm
index 3cfa7414dcd..5386e470264 100644
--- a/code/__DEFINES/~skyrat_defines/signals.dm
+++ b/code/__DEFINES/~skyrat_defines/signals.dm
@@ -68,3 +68,6 @@
/// From mob/living/*/set_combat_mode(): (new_state)
#define COMSIG_LIVING_COMBAT_MODE_TOGGLE "living_combat_mode_toggle"
+
+/// To chambered round on gun's `process_fire()`: (list/iff_factions)
+#define COMSIG_CHAMBERED_BULLET_FIRE "chambered_bullet_fire"
diff --git a/code/modules/antagonists/ert/ert.dm b/code/modules/antagonists/ert/ert.dm
index 04bf5772075..8730093c417 100644
--- a/code/modules/antagonists/ert/ert.dm
+++ b/code/modules/antagonists/ert/ert.dm
@@ -32,6 +32,7 @@
forge_objectives()
if(equip_ert)
equipERT()
+ owner?.current.faction |= FACTION_ERT //SKYRAT ADDITION
. = ..()
/datum/antagonist/ert/get_team()
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 61158fe042e..d73e5ed171e 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -182,6 +182,11 @@
var/static/list/projectile_connections = list(
COMSIG_ATOM_ENTERED = .proc/on_entered,
)
+ //SKYRAT ADDITION START
+ /// If this should be able to hit the target even on direct firing when `ignored_factions` applies
+ var/ignore_direct_target = FALSE
+ //SKYRAT ADDITION END
+
/// If true directly targeted turfs can be hit
var/can_hit_turfs = FALSE
@@ -505,7 +510,7 @@
var/mob/M = firer
if((target == firer) || ((target == firer.loc) && ismecha(firer.loc)) || (target in firer.buckled_mobs) || (istype(M) && (M.buckled == target)))
return FALSE
- if(ignored_factions?.len && ismob(target) && !direct_target)
+ if(ignored_factions?.len && ismob(target) && (!direct_target || ignore_direct_target)) //SKYRAT EDIT: ignore_direct_target
var/mob/target_mob = target
if(faction_check(target_mob.faction, ignored_factions))
return FALSE
diff --git a/modular_skyrat/master_files/code/modules/mod/modules/_module.dm b/modular_skyrat/master_files/code/modules/mod/modules/_module.dm
index 65b9a2f3cfe..6bb910ff83f 100644
--- a/modular_skyrat/master_files/code/modules/mod/modules/_module.dm
+++ b/modular_skyrat/master_files/code/modules/mod/modules/_module.dm
@@ -46,6 +46,7 @@
add_overlay = FALSE
if(add_overlay)
+ icon_to_use = overlay_icon_file
var/mutable_appearance/module_icon = mutable_appearance(icon_to_use, icon_state_to_use, layer = standing.layer + 0.1) // Just changed the raw icon path to icon_to_use and the used_overlay to icon_state_to_use
module_icon.appearance_flags |= RESET_COLOR
. += module_icon
diff --git a/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_guns.dmi b/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_guns.dmi
index 97ba89bed08..2146e292682 100644
Binary files a/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_guns.dmi and b/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_guns.dmi differ
diff --git a/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_lefthand.dmi b/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_lefthand.dmi
index c722960545d..e9ba5873a5f 100644
Binary files a/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_lefthand.dmi and b/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_lefthand.dmi differ
diff --git a/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_righthand.dmi b/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_righthand.dmi
index 6e561a279b7..c673bc2ba20 100644
Binary files a/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_righthand.dmi and b/modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_righthand.dmi differ
diff --git a/modular_skyrat/modules/marines/code/gear.dm b/modular_skyrat/modules/marines/code/gear.dm
new file mode 100644
index 00000000000..b2ff5c0bcbf
--- /dev/null
+++ b/modular_skyrat/modules/marines/code/gear.dm
@@ -0,0 +1,115 @@
+/obj/item/gun/ballistic/automatic/ar/modular/m44a
+ name = "\improper NT M44A Pulse Rifle"
+ desc = "A specialized Nanotrasen-produced ballistic pulse rifle that uses compressed magazines to output absurd firepower in a compact package."
+ icon_state = "m44a"
+ inhand_icon_state = "m44a"
+ icon = 'modular_skyrat/modules/marines/icons/m44a.dmi'
+ righthand_file = 'modular_skyrat/modules/marines/icons/m44a_r.dmi'
+ lefthand_file = 'modular_skyrat/modules/marines/icons/m44a_l.dmi'
+ fire_sound = 'modular_skyrat/modules/marines/sound/m44a.ogg'
+ fire_delay = 1
+ burst_size = 3
+ spread = 6
+ pin = /obj/item/firing_pin/implant/mindshield
+ can_suppress = FALSE
+ emp_damageable = FALSE
+ can_bayonet = FALSE
+ realistic = FALSE
+ mag_display = TRUE
+ mag_display_ammo = FALSE
+ mag_type = /obj/item/ammo_box/magazine/m44a
+ w_class = WEIGHT_CLASS_BULKY
+ slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_OCLOTHING
+ company_flag = COMPANY_NANOTRASEN
+
+/obj/item/ammo_box/magazine/m44a
+ name = "m44a magazine (.300 compressed)"
+ desc = "This magazine uses a bluespace compression chamber to hold a maximum of ninety-nine .300 caliber caseless rounds for the M44A pulse rifle."
+ icon = 'modular_skyrat/modules/marines/icons/m44a.dmi'
+ icon_state = "300compressed"
+ max_ammo = 99
+ multiple_sprites = AMMO_BOX_FULL_EMPTY_BASIC
+ ammo_type = /obj/item/ammo_casing/caseless/c300
+ caliber = "300comp"
+
+/obj/item/ammo_casing/caseless/c300
+ name = ".300 caseless round"
+ desc = "A .300 caseless round for proprietary Nanotrasen firearms."
+ caliber = "300comp"
+ projectile_type = /obj/projectile/bullet/a300
+
+/obj/projectile/bullet/a300
+ name = ".300 caseless bullet"
+ damage = 13
+ armour_penetration = 30 //gonna actually kill the brit that made this var require a U in armor
+ embedding = null
+ shrapnel_type = null
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/scoped
+ name = "\improper NT M44AS Pulse Rifle"
+ desc = "A specialized Nanotrasen-produced ballistic pulse rifle that uses compressed magazines to output absurd firepower in a compact package. This one's fitted with a long-range scope."
+ icon_state = "m44a_s"
+ inhand_icon_state = "m44a_s"
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/scoped/Initialize()
+ . = ..()
+ AddComponent(/datum/component/scope, range_modifier = 2.2)
+
+/obj/item/gun/ballistic/shotgun/automatic/as2/ubsg
+ name = "\improper M2 auto-shotgun underbarrel"
+ desc = "This shouldn't be heeere!"
+ can_suppress = FALSE
+ has_gun_safety = FALSE
+ mag_type = /obj/item/ammo_box/magazine/internal/shot/as2/ubsg
+
+/obj/item/ammo_box/magazine/internal/shot/as2/ubsg
+ max_ammo = 3
+ ammo_type = /obj/item/ammo_casing/shotgun/buckshot
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/shotgun
+ name = "\improper NT M44ASG Pulse Rifle"
+ desc = "A specialized Nanotrasen-produced ballistic pulse rifle that uses compressed magazines to output absurd firepower in a compact package. This one's fitted with a two-round semi-automatic underbarrel 12 gauge shotgun."
+ icon_state = "m44a_sg"
+ inhand_icon_state = "m44a_sg"
+ /// Reference to the underbarrel shotgun
+ var/obj/item/gun/ballistic/shotgun/automatic/as2/ubsg/underbarrel
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/shotgun/Initialize()
+ . = ..()
+ underbarrel = new /obj/item/gun/ballistic/shotgun/automatic/as2/ubsg(src)
+ update_appearance()
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/shotgun/afterattack_secondary(atom/target, mob/living/user, flag, params)
+ underbarrel.afterattack(target, user, flag, params)
+ return SECONDARY_ATTACK_CONTINUE_CHAIN
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/shotgun/attackby(obj/item/attacking_item, mob/user, params)
+ if(!istype(attacking_item, /obj/item/ammo_casing))
+ ..()
+ if(istype(attacking_item, underbarrel.magazine.ammo_type))
+ underbarrel.attack_self(user)
+ underbarrel.attackby(attacking_item, user, params)
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/grenadelauncher
+ name = "\improper NT M44AGL Pulse Rifle"
+ desc = "A specialized Nanotrasen-produced ballistic pulse rifle that uses compressed magazines to output absurd firepower in a compact package. This one's fitted with an underbarrel grenade launcher, and a red dot scope to help align it. Compensating for something?"
+ icon_state = "m44a_gl"
+ inhand_icon_state = "m44a_gl"
+ /// Underbarrel grenade launcher reference
+ var/obj/item/gun/ballistic/revolver/grenadelauncher/underbarrel
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/grenadelauncher/Initialize()
+ . = ..()
+ underbarrel = new /obj/item/gun/ballistic/revolver/grenadelauncher/unrestricted(src)
+ update_appearance()
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/grenadelauncher/afterattack_secondary(atom/target, mob/living/user, flag, params)
+ underbarrel.afterattack(target, user, flag, params)
+ return SECONDARY_ATTACK_CONTINUE_CHAIN
+
+/obj/item/gun/ballistic/automatic/ar/modular/m44a/grenadelauncher/attackby(obj/item/attacking_item, mob/user, params)
+ if(!istype(attacking_item, /obj/item/ammo_casing))
+ ..()
+ if(istype(attacking_item, underbarrel.magazine.ammo_type))
+ underbarrel.attack_self(user)
+ underbarrel.attackby(attacking_item, user, params)
diff --git a/modular_skyrat/modules/marines/code/miscellaneous.dm b/modular_skyrat/modules/marines/code/miscellaneous.dm
deleted file mode 100644
index 51eb7f589da..00000000000
--- a/modular_skyrat/modules/marines/code/miscellaneous.dm
+++ /dev/null
@@ -1,16 +0,0 @@
-// 1 2 3 4 marine corps marine corps
-//parent type already has EMP protection and stuff
-
-/obj/item/storage/backpack/ert/marine
- name = "marine backpack"
- desc = "A spacious backpack with lots of pockets and a magnetic latching mechanism to attach to whatever gear one might wear."
- icon = 'modular_skyrat/master_files/icons/obj/clothing/backpacks.dmi'
- worn_icon = 'modular_skyrat/master_files/icons/mob/clothing/back.dmi'
- icon_state = "marine"
- inhand_icon_state = "securitypack"
- resistance_flags = FIRE_PROOF
-
-/obj/item/storage/backpack/ert/marine/ComponentInitialize()
- . = ..()
- var/datum/component/storage/STR = GetComponent(/datum/component/storage)
- STR.max_combined_w_class = 30
diff --git a/modular_skyrat/modules/marines/code/mod.dm b/modular_skyrat/modules/marines/code/mod.dm
new file mode 100644
index 00000000000..4c74b667268
--- /dev/null
+++ b/modular_skyrat/modules/marines/code/mod.dm
@@ -0,0 +1,91 @@
+// 1 2 3 4 marine corps marine corps
+
+/datum/mod_theme/marines
+ name = "marine"
+ desc = "Developed by Nanotrasen in collaboration with multiple high-profile contractors, this specialized suit is made for high-intensity combat."
+ extended_desc = "A black and blue suit of Nanotrasen design made to be utilized by corporate space marines \
+ in active combat situations where standard gear won't cut it. Lightweight composite armor plating over \
+ a strong exoskeleton ensures that no speed is sacrificed for protection, and a variety of unique \
+ modules keep the wearer efficient during active combat situations. When response teams fail, \
+ you're the backup's backup - the desperate measures."
+ default_skin = "marine"
+ armor = list(MELEE = 50, BULLET = 50, LASER = 50, ENERGY = 50, BOMB = 50, BIO = 100, FIRE = 100, ACID = 50, WOUND = 20) //honestly quite incredible
+ atom_flags = PREVENT_CONTENTS_EXPLOSION_1
+ resistance_flags = FIRE_PROOF|ACID_PROOF
+ max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
+ siemens_coefficient = 0
+ slowdown_inactive = 0.5
+ slowdown_active = 0
+ complexity_max = DEFAULT_MAX_COMPLEXITY + 10 //drr drr drr
+ allowed_suit_storage = list(
+ /obj/item/flashlight,
+ /obj/item/tank/internals,
+ /obj/item/ammo_box,
+ /obj/item/ammo_casing,
+ /obj/item/restraints/handcuffs,
+ /obj/item/assembly/flash,
+ /obj/item/melee/baton,
+ /obj/item/gun/ballistic,
+ /obj/item/melee/hammer,
+ )
+ skins = list(
+ "marine" = list(
+ MOD_ICON_OVERRIDE = 'modular_skyrat/modules/marines/icons/mod.dmi',
+ MOD_WORN_ICON_OVERRIDE = 'modular_skyrat/modules/marines/icons/wornmod.dmi',
+ HELMET_FLAGS = list(
+ UNSEALED_LAYER = NECK_LAYER,
+ UNSEALED_CLOTHING = SNUG_FIT,
+ SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE|BLOCK_GAS_SMOKE_EFFECT|FLASH_PROTECTION_WELDER,
+ UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
+ SEALED_INVISIBILITY = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
+ SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
+ ),
+ CHESTPLATE_FLAGS = list(
+ UNSEALED_CLOTHING = THICKMATERIAL,
+ SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
+ SEALED_INVISIBILITY = HIDEJUMPSUIT|HIDETAIL,
+ ),
+ GAUNTLETS_FLAGS = list(
+ UNSEALED_CLOTHING = THICKMATERIAL,
+ SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
+ CAN_OVERSLOT = TRUE,
+ ),
+ BOOTS_FLAGS = list(
+ UNSEALED_CLOTHING = THICKMATERIAL,
+ SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
+ CAN_OVERSLOT = TRUE,
+ ),
+ ),
+ )
+
+/obj/item/mod/control/pre_equipped/marine
+ theme = /datum/mod_theme/marines
+ applied_cell = /obj/item/stock_parts/cell/bluespace
+ initial_modules = list(
+ /obj/item/mod/module/storage/large_capacity,
+ /obj/item/mod/module/emp_shield,
+ /obj/item/mod/module/magnetic_harness,
+ /obj/item/mod/module/holster,
+ /obj/item/mod/module/flashlight,
+ /obj/item/mod/module/jetpack,
+ /obj/item/mod/module/noslip,
+ /obj/item/mod/module/power_kick,
+ /obj/item/mod/module/megaphone,
+ /obj/item/mod/module/springlock/contractor,
+ /obj/item/mod/module/dna_lock, //in lieu of req_access
+ /obj/item/mod/module/visor/sechud, //for identifying teammates also in suits
+ )
+
+/obj/item/mod/control/pre_equipped/marine/engineer //smartgunner version of modsuit, with less versatile modules but the ALMIGHTY SMARTGUN
+ theme = /datum/mod_theme/marines
+ applied_cell = /obj/item/stock_parts/cell/bluespace
+ initial_modules = list(
+ /obj/item/mod/module/storage/large_capacity,
+ /obj/item/mod/module/emp_shield/advanced,
+ /obj/item/mod/module/flashlight,
+ /obj/item/mod/module/jetpack,
+ /obj/item/mod/module/noslip,
+ /obj/item/mod/module/dna_lock,
+ /obj/item/mod/module/visor/sechud,
+ /obj/item/mod/module/smartgun/marines,
+ )
diff --git a/modular_skyrat/modules/marines/code/modsuit_modules.dm b/modular_skyrat/modules/marines/code/modsuit_modules.dm
new file mode 100644
index 00000000000..7200056f9c4
--- /dev/null
+++ b/modular_skyrat/modules/marines/code/modsuit_modules.dm
@@ -0,0 +1,32 @@
+/obj/item/mod/module/smartgun
+ name = "MOD smartgun module"
+ desc = "A bulky module that attahces to the back of a MODsuit, this \
+ module is comprised of two parts, a holster and the M63A4 \"Smartgun\". \
+ The holster works as storage for a gun that would be otherwise uncarryable, \
+ and the gun itself fires at a blistering rate of fire, capable of suppressing enemies \
+ without hurting teammates thanks to IFF technology."
+ icon_state = "smartgun"
+ icon = 'modular_skyrat/modules/marines/icons/items/module.dmi'
+ overlay_icon_file = 'modular_skyrat/modules/marines/icons/mobs/mod_modules.dmi'
+ module_type = MODULE_ACTIVE
+ complexity = 3
+ active_power_cost = DEFAULT_CHARGE_DRAIN * 0.3
+ device = /obj/item/gun/ballistic/automatic/smart_machine_gun
+ incompatible_modules = list(/obj/item/mod/module/smartgun)
+ cooldown_time = 0.5 SECONDS
+ overlay_state_inactive = "module_smartgun_off" //appears on back when it's off
+ overlay_state_active = "module_smartgun_on"
+ /// Power consumed per bullet fired
+ var/power_per_bullet = 25
+
+/obj/item/mod/module/smartgun/on_activation()
+ . = ..()
+ RegisterSignal(device, COMSIG_GUN_FIRED, .proc/consume_energy)
+
+/obj/item/mod/module/smartgun/proc/consume_energy(mob/user, atom/target, params, zone_override)
+ SIGNAL_HANDLER
+
+ drain_power(power_per_bullet)
+
+/obj/item/mod/module/smartgun/marines
+ removable = FALSE //no stealing!!
diff --git a/modular_skyrat/modules/marines/code/smartgun.dm b/modular_skyrat/modules/marines/code/smartgun.dm
new file mode 100644
index 00000000000..f38ee3ec073
--- /dev/null
+++ b/modular_skyrat/modules/marines/code/smartgun.dm
@@ -0,0 +1,148 @@
+/obj/item/gun/ballistic/automatic/smart_machine_gun
+ name = "\improper M63A4 \"Smartgun\""
+ desc = "A weapon with a blistering rate of fire, so heavy that it needs to be mounted on a modsuit to wield. \
+ It's equipped with IFF technology, allowing the bullets to intentionally miss friendly targets."
+ icon = 'modular_skyrat/modules/marines/icons/items/guns.dmi'
+ lefthand_file = 'modular_skyrat/modules/marines/icons/mobs/guns_l.dmi'
+ righthand_file = 'modular_skyrat/modules/marines/icons/mobs/guns_r.dmi'
+ worn_icon = 'modular_skyrat/modules/marines/icons/mobs/mod_modules.dmi'
+ icon_state = "smartgun"
+ worn_icon_state = "module_smartgun_off" // just in case. You shouldn't be able to do this, though
+ inhand_icon_state = "smartgun"
+ fire_sound = 'modular_skyrat/modules/gunsgalore/sound/guns/fire/mg34_fire.ogg'
+ rack_sound = 'sound/weapons/gun/l6/l6_rack.ogg'
+ suppressed_sound = 'sound/weapons/gun/general/heavy_shot_suppressed.ogg'
+ fire_sound_volume = 70
+ fire_select_modes = list(SELECT_SEMI_AUTOMATIC, SELECT_FULLY_AUTOMATIC)
+ weapon_weight = WEAPON_HEAVY
+ slot_flags = ITEM_SLOT_BACK
+ w_class = WEIGHT_CLASS_HUGE
+ spread = 18
+ mag_type = /obj/item/ammo_box/magazine/smartgun_drum
+ can_suppress = FALSE
+ fire_delay = 0.5
+ realistic = FALSE
+ bolt_type = BOLT_TYPE_OPEN
+ show_bolt_icon = FALSE
+ tac_reloads = FALSE
+ burst_size = 1
+ pin = /obj/item/firing_pin/implant/mindshield
+ mag_display_ammo = FALSE
+ mag_display = FALSE
+ /// If the gun's dustcover is open or not
+ var/cover_open = FALSE
+ /// Factions that the gun cannot shoot under any circumstances
+ var/list/iff_factions = list("ert")
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0)
+ . = ..()
+ if(chambered)
+ SEND_SIGNAL(chambered, COMSIG_CHAMBERED_BULLET_FIRE, iff_factions)
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/examine(mob/user)
+ . = ..()
+ . += "RMB with an empty hand to [cover_open ? "close" : "open"] the dust cover."
+ if(cover_open && magazine)
+ . += span_notice("It seems like you could use an empty hand to remove the magazine.")
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/attack_hand_secondary(mob/user, list/modifiers)
+ if(!user.canUseTopic(src))
+ return
+ cover_open = !cover_open
+ to_chat(user, span_notice("You [cover_open ? "open" : "close"] [src]'s cover."))
+ playsound(src, 'sound/weapons/gun/l6/l6_door.ogg', 60, TRUE)
+ update_appearance()
+ return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/can_shoot()
+ if(cover_open)
+ balloon_alert_to_viewers("cover open!")
+ return FALSE
+ return chambered
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/eject_magazine(mob/user, display_message = TRUE, obj/item/ammo_box/magazine/tac_load = null)
+ if(!cover_open)
+ to_chat(user, span_warning("The cover is closed! Open it before ejecting the magazine!"))
+ return
+ return ..()
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/attackby(obj/item/attack_item, mob/user, params)
+ if(!cover_open && istype(attack_item, mag_type))
+ to_chat(user, span_warning("[src]'s dust cover prevents a magazine from being fit."))
+ return
+ ..()
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/update_overlays()
+ . = ..()
+ . += "[base_icon_state]_door_open"
+
+/obj/item/gun/ballistic/automatic/smart_machine_gun/unrestricted
+ pin = /obj/item/firing_pin
+// Magazine itself
+
+/obj/item/ammo_box/magazine/smartgun_drum
+ name = "smartgun drum (10x28mm caseless)"
+ icon = 'modular_skyrat/modules/marines/icons/items/ammo.dmi'
+ icon_state = "smartgun_drum"
+ ammo_type = /obj/item/ammo_casing/smart/caseless/a10x28
+ caliber = "a10x28"
+ max_ammo = 500
+ multiple_sprites = AMMO_BOX_FULL_EMPTY
+ w_class = WEIGHT_CLASS_NORMAL
+
+// Smart ammo casings
+
+/obj/item/ammo_casing/smart
+ icon = 'modular_skyrat/modules/gunsgalore/icons/ammo/ammo.dmi'
+
+/obj/item/ammo_casing/smart/Initialize(mapload)
+ . = ..()
+ RegisterSignal(src, COMSIG_CHAMBERED_BULLET_FIRE, .proc/iff_transfer)
+
+/obj/item/ammo_casing/smart/proc/iff_transfer(datum/source, list/iff_factions)
+ SIGNAL_HANDLER
+
+ if(istype(loaded_projectile, /obj/projectile/bullet/smart))
+ var/obj/projectile/bullet/smart/smart_proj = loaded_projectile
+ smart_proj.ignored_factions = iff_factions.Copy()
+
+/obj/item/ammo_casing/smart/caseless
+ firing_effect_type = null
+ heavy_metal = FALSE
+
+/obj/item/ammo_casing/smart/caseless/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread, atom/fired_from)
+ if (!..()) //failed firing
+ return FALSE
+ if(istype(fired_from, /obj/item/gun))
+ var/obj/item/gun/shot_from = fired_from
+ if(shot_from.chambered == src)
+ shot_from.chambered = null //Nuke it. Nuke it now.
+ qdel(src)
+ return TRUE
+
+/obj/item/ammo_casing/smart/caseless/update_icon_state()
+ . = ..()
+ icon_state = "[initial(icon_state)]"
+
+/obj/item/ammo_casing/smart/caseless/a10x28
+ name = "10x28mm bullet"
+ desc = "A 10x28m caseless bullet."
+ icon_state = "792x57-casing"
+ caliber = "a10x28"
+ projectile_type = /obj/projectile/bullet/smart/a10x28
+
+// Smart bullets
+
+/obj/projectile/bullet/smart
+ ignore_direct_target = TRUE
+
+/obj/projectile/bullet/smart/a10x28
+ name = "10x28mm bullet"
+ damage = 12
+ armour_penetration = 5
+ wound_bonus = 15
+ wound_falloff_tile = 1
diff --git a/modular_skyrat/modules/marines/icons/items/ammo.dmi b/modular_skyrat/modules/marines/icons/items/ammo.dmi
new file mode 100644
index 00000000000..b2932bacdd5
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/items/ammo.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/items/guns.dmi b/modular_skyrat/modules/marines/icons/items/guns.dmi
new file mode 100644
index 00000000000..be2425192b5
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/items/guns.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/items/module.dmi b/modular_skyrat/modules/marines/icons/items/module.dmi
new file mode 100644
index 00000000000..79cf11a3603
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/items/module.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/m44a.dmi b/modular_skyrat/modules/marines/icons/m44a.dmi
new file mode 100644
index 00000000000..dd22e31779d
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/m44a.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/m44a_l.dmi b/modular_skyrat/modules/marines/icons/m44a_l.dmi
new file mode 100644
index 00000000000..83a5d2aab45
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/m44a_l.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/m44a_r.dmi b/modular_skyrat/modules/marines/icons/m44a_r.dmi
new file mode 100644
index 00000000000..8db10306b6e
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/m44a_r.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/mobs/guns_l.dmi b/modular_skyrat/modules/marines/icons/mobs/guns_l.dmi
new file mode 100644
index 00000000000..28e2ed89066
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/mobs/guns_l.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/mobs/guns_r.dmi b/modular_skyrat/modules/marines/icons/mobs/guns_r.dmi
new file mode 100644
index 00000000000..dbfd40ac628
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/mobs/guns_r.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/mobs/mod_modules.dmi b/modular_skyrat/modules/marines/icons/mobs/mod_modules.dmi
new file mode 100644
index 00000000000..cbd396e077d
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/mobs/mod_modules.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/mod.dmi b/modular_skyrat/modules/marines/icons/mod.dmi
new file mode 100644
index 00000000000..f273df36885
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/mod.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/smartgun.dmi b/modular_skyrat/modules/marines/icons/smartgun.dmi
new file mode 100644
index 00000000000..f3c19135191
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/smartgun.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/smartgun_back.dmi b/modular_skyrat/modules/marines/icons/smartgun_back.dmi
new file mode 100644
index 00000000000..dad573eaa48
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/smartgun_back.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/smartgun_l.dmi b/modular_skyrat/modules/marines/icons/smartgun_l.dmi
new file mode 100644
index 00000000000..e5b3709c5d4
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/smartgun_l.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/smartgun_module.dmi b/modular_skyrat/modules/marines/icons/smartgun_module.dmi
new file mode 100644
index 00000000000..79cf11a3603
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/smartgun_module.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/smartgun_r.dmi b/modular_skyrat/modules/marines/icons/smartgun_r.dmi
new file mode 100644
index 00000000000..5f665165e6e
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/smartgun_r.dmi differ
diff --git a/modular_skyrat/modules/marines/icons/wornmod.dmi b/modular_skyrat/modules/marines/icons/wornmod.dmi
new file mode 100644
index 00000000000..8b17fecdbd8
Binary files /dev/null and b/modular_skyrat/modules/marines/icons/wornmod.dmi differ
diff --git a/modular_skyrat/modules/marines/sound/m44a.ogg b/modular_skyrat/modules/marines/sound/m44a.ogg
new file mode 100644
index 00000000000..7f41ffa1671
Binary files /dev/null and b/modular_skyrat/modules/marines/sound/m44a.ogg differ
diff --git a/modular_skyrat/modules/modular_ert/code/marine_override/modified_equipment.dm b/modular_skyrat/modules/modular_ert/code/marine_override/modified_equipment.dm
index ad958c7e655..d4157eb2479 100644
--- a/modular_skyrat/modules/modular_ert/code/marine_override/modified_equipment.dm
+++ b/modular_skyrat/modules/modular_ert/code/marine_override/modified_equipment.dm
@@ -1,9 +1,54 @@
-/datum/outfit/centcom/ert/marine
- suit_store = /obj/item/gun/ballistic/automatic/cmg
- belt = /obj/item/storage/belt/military/assault/full/cmg
-
-/datum/outfit/centcom/ert/marine/medic
- suit_store = /obj/item/storage/belt/holster/detective/full/ert/skyrat
-
-/datum/outfit/centcom/ert/marine/engineer
- suit_store = /obj/item/gun/ballistic/shotgun/automatic/as2
+/datum/outfit/centcom/ert/marine //commander
+ suit_store = /obj/item/gun/ballistic/automatic/ar/modular/m44a/grenadelauncher
+ belt = /obj/item/storage/belt/military/assault/full/m44a
+ back = /obj/item/mod/control/pre_equipped/marine
+ backpack_contents = list(
+ /obj/item/storage/box/survival/engineer/marine = 1,
+ /obj/item/melee/baton/security/loaded = 1,
+ /obj/item/storage/box/handcuffs = 1,
+ /obj/item/ammo_box/a40mm = 2, //gods must be strong
+ )
+ l_hand = null
+ r_hand = null
+
+/datum/outfit/centcom/ert/marine/security //generic and/or heavy
+ suit_store = /obj/item/gun/ballistic/automatic/ar/modular/m44a/shotgun
+ belt = /obj/item/storage/belt/military/assault/full/m44a
+ back = /obj/item/mod/control/pre_equipped/marine
+ backpack_contents = list(
+ /obj/item/storage/box/survival/engineer/marine = 1,
+ /obj/item/melee/baton/security/loaded = 1,
+ /obj/item/storage/box/handcuffs = 1,
+ /obj/item/ammo_box/advanced/s12gauge/buckshot/marine = 2,
+ )
+ l_hand = null
+ r_hand = null
+
+/datum/outfit/centcom/ert/marine/medic //medic
+ suit_store = /obj/item/gun/ballistic/automatic/ar/modular/m44a/scoped
+ belt = /obj/item/storage/belt/military/assault/full/m44a
+ back = /obj/item/mod/control/pre_equipped/marine
+ backpack_contents = list(
+ /obj/item/storage/box/survival/engineer/marine = 1,
+ /obj/item/reagent_containers/hypospray/combat = 1,
+ /obj/item/storage/medkit/regular = 1,
+ /obj/item/storage/medkit/advanced = 1,
+ /obj/item/sensor_device = 1,
+ /obj/item/pinpointer/crew/prox = 1,
+ /obj/item/stack/medical/gauze/twelve = 1,
+ /obj/item/reagent_containers/syringe = 1,
+ /obj/item/reagent_containers/glass/bottle/formaldehyde = 1,
+ /obj/item/stack/sticky_tape/surgical = 1,
+ )
+ l_hand = /obj/item/gun/medbeam
+ r_hand = null
+
+/datum/outfit/centcom/ert/marine/engineer //engineer
+ suit_store = /obj/item/melee/hammer //doesn't need a rifle
+ back = /obj/item/mod/control/pre_equipped/marine/engineer
+ backpack_contents = list(
+ /obj/item/storage/box/survival/engineer/marine = 1,
+ /obj/item/ammo_box/magazine/smartgun_drum = 4, //AND WE'LL ALL STAY FREE
+ )
+ l_hand = null
+ r_hand = null
diff --git a/modular_skyrat/modules/modular_ert/code/marine_override/modified_gear.dm b/modular_skyrat/modules/modular_ert/code/marine_override/modified_gear.dm
index 0a19d762998..048f24ee35f 100644
--- a/modular_skyrat/modules/modular_ert/code/marine_override/modified_gear.dm
+++ b/modular_skyrat/modules/modular_ert/code/marine_override/modified_gear.dm
@@ -1,12 +1,19 @@
-/obj/item/storage/belt/holster/detective/full/ert/skyrat
+/obj/item/storage/belt/military/assault/full/m44a
-/obj/item/storage/belt/holster/detective/full/ert/skyrat/PopulateContents()
+/obj/item/storage/belt/military/assault/full/m44a/PopulateContents()
generate_items_inside(list(
- /obj/item/gun/ballistic/automatic/pistol/firefly = 1,
- /obj/item/ammo_box/magazine/multi_sprite/firefly = 2,
+ /obj/item/ammo_box/magazine/m44a = 6,
), src)
-/obj/item/storage/belt/military/assault/full/cmg/PopulateContents()
- generate_items_inside(list(
- /obj/item/ammo_box/magazine/multi_sprite/cmg/lethal = 6,
- ), src)
+/obj/item/ammo_box/advanced/s12gauge/buckshot/marine
+ w_class = WEIGHT_CLASS_NORMAL
+
+/obj/item/storage/box/survival/engineer/marine
+ name = "military survival box"
+ desc = "A box issued to Nanotrasen space marines, containing field essentials. This one is labelled to contain an extended-capacity tank."
+ illustration = "extendedtank"
+ internal_type = /obj/item/tank/internals/emergency_oxygen/engi
+
+/obj/item/storage/box/survival/engineer/marine/PopulateContents()
+ ..()
+ new /obj/item/storage/crayons(src) //absolutely required
diff --git a/tgstation.dme b/tgstation.dme
index f63239e8fab..27e1b011b07 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -5497,7 +5497,10 @@
#include "modular_skyrat\modules\mapping\code\turnstile.dm"
#include "modular_skyrat\modules\mapping\code\vgdecals.dm"
#include "modular_skyrat\modules\mapping\code\wardrobes.dm"
-#include "modular_skyrat\modules\marines\code\miscellaneous.dm"
+#include "modular_skyrat\modules\marines\code\gear.dm"
+#include "modular_skyrat\modules\marines\code\mod.dm"
+#include "modular_skyrat\modules\marines\code\modsuit_modules.dm"
+#include "modular_skyrat\modules\marines\code\smartgun.dm"
#include "modular_skyrat\modules\medical\code\bodypart.dm"
#include "modular_skyrat\modules\medical\code\bodypart_aid.dm"
#include "modular_skyrat\modules\medical\code\carbon_defense.dm"