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

Experiment: PB Cooldown #4394

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define DEFAULT_MESSAGE_RANGE 7

#define BAYONET_DRAW_DELAY (1 SECONDS)
#define POINTBLANK_COOLDOWN_TIME (2 SECONDS)

//Predator decloak multpliers based on the standard.
#define DECLOAK_STANDARD (10 SECONDS)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
var/image/attack_icon = null //the image used as overlay on the things we attack.

COOLDOWN_DECLARE(zoom_cooldown) //Cooldown on using zooming items, to limit spam
COOLDOWN_DECLARE(pointblank_cooldown) //Cooldown on PB attacks in an effort to prevent bypassing delays.

var/do_bump_delay = 0 // Flag to tell us to delay movement because of being bumped

Expand Down
4 changes: 4 additions & 0 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,9 @@ and you're good to go.
if(!(flags_gun_features & GUN_CAN_POINTBLANK)) // If it can't point blank, you can't suicide and such.
return ..()

if(!COOLDOWN_FINISHED(user, pointblank_cooldown))
return ..()

if(attacked_mob == user && user.zone_selected == "mouth" && ishuman(user))
var/mob/living/carbon/human/HM = user
if(!able_to_fire(user))
Expand Down Expand Up @@ -1392,6 +1395,7 @@ and you're good to go.
if(bullets_fired == 1) //First shot gives the PB message.
user.visible_message(SPAN_DANGER("[user] fires [src] point blank at [attacked_mob]!"),
SPAN_WARNING("You fire [src] point blank at [attacked_mob]!"), null, null, CHAT_TYPE_WEAPON_USE)
COOLDOWN_START(user, pointblank_cooldown, POINTBLANK_COOLDOWN_TIME)

user.track_shot(initial(name))
apply_bullet_effects(projectile_to_fire, user, bullets_fired) //We add any damage effects that we need.
Expand Down
Loading