diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 1c03ecac2ee..a309c76ecfe 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -138,6 +138,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Prevents plasmamen from self-igniting if only their helmet is missing #define TRAIT_NOSELFIGNITION_HEAD_ONLY "no_selfignition_head_only" #define TRAIT_NOGUNS "no_guns" +///Can toss a guns like a badass, causing additional damage/effect to their enemies +#define TRAIT_TOSS_GUN_HARD "toss_gun_hard" /// Species with this trait are genderless #define TRAIT_AGENDER "agender" /// Species with this trait have a blood clan mechanic diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 6022f830acb..01f3b05baed 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -337,6 +337,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_NOFIRE_SPREAD" = TRAIT_NOFIRE_SPREAD, "TRAIT_NOFLASH" = TRAIT_NOFLASH, "TRAIT_NOGUNS" = TRAIT_NOGUNS, + "TRAIT_TOSS_GUN_HARD" = TRAIT_TOSS_GUN_HARD, "TRAIT_NOHARDCRIT" = TRAIT_NOHARDCRIT, "TRAIT_NOHUNGER" = TRAIT_NOHUNGER, "TRAIT_NOLIMBDISABLE" = TRAIT_NOLIMBDISABLE, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index 25766e5bc69..a0ec9987015 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -155,6 +155,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_NOFIRE" = TRAIT_NOFIRE, "TRAIT_NOFLASH" = TRAIT_NOFLASH, "TRAIT_NOGUNS" = TRAIT_NOGUNS, + "TRAIT_TOSS_GUN_HARD" = TRAIT_TOSS_GUN_HARD, "TRAIT_NOHARDCRIT" = TRAIT_NOHARDCRIT, "TRAIT_NOHUNGER" = TRAIT_NOHUNGER, "TRAIT_NOLIMBDISABLE" = TRAIT_NOLIMBDISABLE, diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 8116084127e..cd8065a72a3 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -9,7 +9,7 @@ help_verb = /mob/living/proc/sleeping_carp_help display_combos = TRUE /// List of traits applied to users of this martial art. - var/list/scarp_traits = list(TRAIT_NOGUNS, TRAIT_HARDLY_WOUNDED, TRAIT_NODISMEMBER, TRAIT_HEAVY_SLEEPER) + var/list/scarp_traits = list(TRAIT_NOGUNS, TRAIT_TOSS_GUN_HARD, TRAIT_HARDLY_WOUNDED, TRAIT_NODISMEMBER, TRAIT_HEAVY_SLEEPER) /datum/martial_art/the_sleeping_carp/on_teach(mob/living/new_holder) . = ..() diff --git a/code/modules/antagonists/highlander/highlander.dm b/code/modules/antagonists/highlander/highlander.dm index 077bd2158b8..a1c31241e0b 100644 --- a/code/modules/antagonists/highlander/highlander.dm +++ b/code/modules/antagonists/highlander/highlander.dm @@ -12,6 +12,7 @@ TRAIT_NODISMEMBER, TRAIT_NOFIRE, TRAIT_NOGUNS, + TRAIT_TOSS_GUN_HARD, TRAIT_SHOCKIMMUNE, ) diff --git a/code/modules/antagonists/pirate/pirate_roles.dm b/code/modules/antagonists/pirate/pirate_roles.dm index 78a3d3fd12a..d9db29d6250 100644 --- a/code/modules/antagonists/pirate/pirate_roles.dm +++ b/code/modules/antagonists/pirate/pirate_roles.dm @@ -208,7 +208,7 @@ /obj/effect/mob_spawn/ghost_role/human/pirate/medieval/special(mob/living/carbon/spawned_mob) . = ..() if(rank == "Footsoldier") - ADD_TRAIT(spawned_mob, TRAIT_NOGUNS, INNATE_TRAIT) + spawned_mob.add_traits(list(TRAIT_NOGUNS, TRAIT_TOSS_GUN_HARD), INNATE_TRAIT) spawned_mob.AddComponent(/datum/component/unbreakable) var/datum/action/cooldown/mob_cooldown/dash/dodge = new(spawned_mob) dodge.Grant(spawned_mob) diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index 6dfc8cfe40c..2dacdc97622 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -772,7 +772,7 @@ user.physiology.brute_mod *= 0.5 user.next_move_modifier *= BERSERK_ATTACK_SPEED_MODIFIER user.add_atom_colour(COLOR_BUBBLEGUM_RED, TEMPORARY_COLOUR_PRIORITY) - ADD_TRAIT(user, TRAIT_NOGUNS, BERSERK_TRAIT) + user.add_traits(list(TRAIT_NOGUNS, TRAIT_TOSS_GUN_HARD), BERSERK_TRAIT) ADD_TRAIT(src, TRAIT_NODROP, BERSERK_TRAIT) berserk_active = TRUE START_PROCESSING(SSobj, src) @@ -790,7 +790,7 @@ user.physiology.brute_mod *= 2 user.next_move_modifier /= BERSERK_ATTACK_SPEED_MODIFIER user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, COLOR_BUBBLEGUM_RED) - REMOVE_TRAIT(user, TRAIT_NOGUNS, BERSERK_TRAIT) + user.remove_traits(list(TRAIT_NOGUNS, TRAIT_TOSS_GUN_HARD), BERSERK_TRAIT) REMOVE_TRAIT(src, TRAIT_NODROP, BERSERK_TRAIT) STOP_PROCESSING(SSobj, src) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 35e15cc0453..bd02476e56e 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -174,6 +174,8 @@ power_throw++ if(neckgrab_throw) power_throw++ + if(HAS_TRAIT(src, TRAIT_TOSS_GUN_HARD) && isgun(thrown_thing)) + power_throw++ if(isitem(thrown_thing)) var/obj/item/thrown_item = thrown_thing frequency_number = 1-(thrown_item.w_class-3)/8 //At normal weight, the frequency is at 1. For tiny, it is 1.25. For huge, it is 0.75. diff --git a/code/modules/mod/modules/modules_ninja.dm b/code/modules/mod/modules/modules_ninja.dm index 0e0de691e03..518e3683abf 100644 --- a/code/modules/mod/modules/modules_ninja.dm +++ b/code/modules/mod/modules/modules_ninja.dm @@ -177,10 +177,10 @@ var/accepted_type = /obj/item/energy_katana /obj/item/mod/module/weapon_recall/on_suit_activation() - ADD_TRAIT(mod.wearer, TRAIT_NOGUNS, MOD_TRAIT) + mod.wearer.add_traits(list(TRAIT_NOGUNS, TRAIT_TOSS_GUN_HARD), MOD_TRAIT) /obj/item/mod/module/weapon_recall/on_suit_deactivation(deleting = FALSE) - REMOVE_TRAIT(mod.wearer, TRAIT_NOGUNS, MOD_TRAIT) + mod.wearer.remove_traits(list(TRAIT_NOGUNS, TRAIT_TOSS_GUN_HARD), MOD_TRAIT) /obj/item/mod/module/weapon_recall/on_use() if(!linked_weapon) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index f1df323609d..1452d879799 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -126,6 +126,21 @@ suppressed = null update_appearance() +/obj/item/gun/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) + . = ..() + if(isliving(hit_atom)) + var/mob/living/thrower = throwingdatum?.get_thrower() + toss_gun_hard(thrower, hit_atom) + +/obj/item/gun/proc/toss_gun_hard(mob/living/thrower, mob/living/target) //throw a gun at them. They don't expect it. + if(isnull(thrower)) + return FALSE + if(!HAS_TRAIT(thrower, TRAIT_TOSS_GUN_HARD)) + return FALSE + target.Knockdown(0.5 SECONDS) + target.apply_damage(damage = max(w_class * 5 - throwforce, 10), damagetype = BRUTE, def_zone = thrower.zone_selected, wound_bonus = CANT_WOUND, attacking_item = src) + return TRUE + /obj/item/gun/examine(mob/user) . = ..() if(!pinless) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 361d68123f5..d009cabd1a9 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -735,6 +735,24 @@ GLOBAL_LIST_INIT(gun_saw_types, typecacheof(list( chamber_round() update_appearance() +/obj/item/gun/ballistic/toss_gun_hard(mob/living/carbon/thrower, mob/living/target) + . = ..() + if(!.) + return + switch(bolt_type) + if(BOLT_TYPE_NO_BOLT) //emptying the revolver cylinder + attack_self() + return + if(BOLT_TYPE_OPEN) //emptying the chamber of an automatic weapon, because rack() doesn't do this to it + handle_chamber(chamber_next_round = FALSE) + if(!internal_magazine && magazine) //if a magazine is attached to the weapon, we remove it and throw it aside + magazine.forceMove(drop_location()) + magazine.throw_at(get_edge_target_turf(src, pick(GLOB.alldirs)), 1, 1) + magazine = null + update_icon() //updating the sprite of weapons without a magazine + if(!isnull(chambered)) //if there is a cartridge in the chamber, we remove it + rack() + /obj/item/suppressor name = "suppressor" desc = "A syndicate small-arms suppressor for maximum espionage." diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm index 8604e21b325..16b7f855e99 100644 --- a/code/modules/projectiles/guns/ballistic/rifle.dm +++ b/code/modules/projectiles/guns/ballistic/rifle.dm @@ -279,7 +279,7 @@ /obj/item/gun/ballistic/rifle/boltaction/pipegun/add_bayonet_point() AddComponent(/datum/component/bayonet_attachable, offset_x = 35, offset_y = 10) -/obj/item/gun/ballistic/rifle/boltaction/pipegun/handle_chamber() +/obj/item/gun/ballistic/rifle/boltaction/pipegun/handle_chamber(empty_chamber = TRUE, from_firing = TRUE, chamber_next_round = TRUE) . = ..() do_sparks(1, TRUE, src) diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 792edbeaa16..4b2ae93b1a2 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -202,7 +202,7 @@ else . += "[icon_state]_no_secondary_mag" -/obj/item/gun/ballistic/shotgun/bulldog/handle_chamber() +/obj/item/gun/ballistic/shotgun/bulldog/handle_chamber(empty_chamber = TRUE, from_firing = TRUE, chamber_next_round = TRUE) if(!secondary_magazine) return ..() var/secondary_shells_left = LAZYLEN(secondary_magazine.stored_ammo) diff --git a/code/modules/projectiles/guns/ballistic/toy.dm b/code/modules/projectiles/guns/ballistic/toy.dm index 237d7cbbb10..cb90438f56b 100644 --- a/code/modules/projectiles/guns/ballistic/toy.dm +++ b/code/modules/projectiles/guns/ballistic/toy.dm @@ -47,7 +47,7 @@ pb_knockback = 0 gun_flags = TOY_FIREARM_OVERLAY | NOT_A_REAL_GUN -/obj/item/gun/ballistic/shotgun/toy/handle_chamber() +/obj/item/gun/ballistic/shotgun/toy/handle_chamber(empty_chamber = TRUE, from_firing = TRUE, chamber_next_round = TRUE) . = ..() if(chambered && !chambered.loaded_projectile) qdel(chambered)