Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attachment obliteration #4217

Merged
merged 4 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
#define ATTACH_IGNORE_EMPTY (1<<5)
/// This attachment should activate if you attack() with it attached.
#define ATTACH_MELEE (1<<6)
/// Override for attachies so you can fire them with a single hand . ONLY FOR PROJECTILES!!
#define ATTACH_WIELD_OVERRIDE (1<<7)

//Ammo magazine defines, for flags_magazine

Expand Down
8 changes: 6 additions & 2 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ and you're good to go.
if(!(active_attachable.flags_attach_features & ATTACH_PROJECTILE)) //If it's unique projectile, this is where we fire it.
if((active_attachable.current_rounds <= 0) && !(active_attachable.flags_attach_features & ATTACH_IGNORE_EMPTY))
click_empty(user) //If it's empty, let them know.
to_chat(user, SPAN_WARNING("[active_attachable] is empty!"))
to_chat(user, SPAN_WARNING("[active_attachable] is empty !"))
Diegoflores31 marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, SPAN_NOTICE("You disable [active_attachable]."))
active_attachable.activate_attachment(src, null, TRUE)
else
Expand Down Expand Up @@ -1503,7 +1503,11 @@ not all weapons use normal magazines etc. load_into_chamber() itself is designed
if(flags_gun_features & GUN_TRIGGER_SAFETY)
to_chat(user, SPAN_WARNING("The safety is on!"))
return

if(active_attachable)
if(active_attachable && active_attachable.flags_attach_features & ATTACH_PROJECTILE)
Diegoflores31 marked this conversation as resolved.
Show resolved Hide resolved
if(!(active_attachable.flags_attach_features & ATTACH_WIELD_OVERRIDE) && !(flags_item & WIELDED))
to_chat(user, SPAN_WARNING("You must wield \the [src] to fire \the [active_attachable]!"))
Diegoflores31 marked this conversation as resolved.
Show resolved Hide resolved
return
if((flags_gun_features & GUN_WIELDED_FIRING_ONLY) && !(flags_item & WIELDED)) //If we're not holding the weapon with both hands when we should.
to_chat(user, SPAN_WARNING("You need a more secure grip to fire this weapon!"))
return
Expand Down
5 changes: 4 additions & 1 deletion code/modules/projectiles/gun_attachables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,9 @@ Defined in conflicts.dm of the #defines folder.
/obj/item/attachable/attached_gun/extinguisher/fire_attachment(atom/target, obj/item/weapon/gun/gun, mob/living/user)
if(!internal_extinguisher)
return
if(!(gun.flags_item & WIELDED))
to_chat(user, SPAN_WARNING("You must wield \the [gun] to fire \the [src]!"))
Diegoflores31 marked this conversation as resolved.
Show resolved Hide resolved
return
if(..())
return internal_extinguisher.afterattack(target, user)

Expand Down Expand Up @@ -2467,7 +2470,7 @@ Defined in conflicts.dm of the #defines folder.
return

if((gun.flags_gun_features & GUN_WIELDED_FIRING_ONLY) && !(gun.flags_item & WIELDED))
to_chat(user, SPAN_WARNING("You need a more secure grip to fire this weapon!"))
to_chat(user, SPAN_WARNING("You must wield \the [gun] to fire \the [src]!"))
Diegoflores31 marked this conversation as resolved.
Show resolved Hide resolved
return

if(gun.flags_gun_features & GUN_TRIGGER_SAFETY)
Expand Down
Loading