diff --git a/code/modules/projectiles/targeting/targeting_client.dm b/code/modules/projectiles/targeting/targeting_client.dm index 42a0e3e6a1c..92eff7b2ced 100644 --- a/code/modules/projectiles/targeting/targeting_client.dm +++ b/code/modules/projectiles/targeting/targeting_client.dm @@ -1,12 +1,12 @@ //These are called by the on-screen buttons, adjusting what the victim can and cannot do. /client/proc/add_gun_icons() - if(!usr) return 1 // This can runtime if someone manages to throw a gun out of their hand before the proc is called. - screen |= usr.item_use_icon - screen |= usr.gun_move_icon - screen |= usr.radio_use_icon + if(!mob) return 1 // This can runtime if someone manages to throw a gun out of their hand before the proc is called. + screen |= mob.item_use_icon + screen |= mob.gun_move_icon + screen |= mob.radio_use_icon /client/proc/remove_gun_icons() - if(!usr) return 1 // Runtime prevention on N00k agents spawning with SMG - screen -= usr.item_use_icon - screen -= usr.gun_move_icon - screen -= usr.radio_use_icon + if(!mob) return 1 // Runtime prevention on N00k agents spawning with SMG + screen -= mob.item_use_icon + screen -= mob.gun_move_icon + screen -= mob.radio_use_icon \ No newline at end of file diff --git a/code/modules/projectiles/targeting/targeting_mob.dm b/code/modules/projectiles/targeting/targeting_mob.dm index 0994769363c..66c21ad8bd0 100644 --- a/code/modules/projectiles/targeting/targeting_mob.dm +++ b/code/modules/projectiles/targeting/targeting_mob.dm @@ -5,7 +5,6 @@ set name = "Toggle Gun Mode" set desc = "Begin or stop aiming." set category = "IC" - if(isliving(src)) var/mob/living/M = src if(!M.aiming) diff --git a/code/modules/projectiles/targeting/targeting_overlay.dm b/code/modules/projectiles/targeting/targeting_overlay.dm index 40b1234805e..4b8ceab51dc 100644 --- a/code/modules/projectiles/targeting/targeting_overlay.dm +++ b/code/modules/projectiles/targeting/targeting_overlay.dm @@ -17,7 +17,7 @@ var/lock_time = 0 // When -will- we lock on? var/active = 0 // Is our owner intending to take hostages? var/target_permissions = 0 // Permission bitflags. - + var/aimcooldown // How long untill we can re-aim? /obj/aiming_overlay/New(var/newowner) ..() owner = newowner @@ -133,6 +133,8 @@ obj/aiming_overlay/proc/update_aiming_deferred() owner.set_dir(get_dir(get_turf(owner), get_turf(src))) /obj/aiming_overlay/proc/aim_at(var/mob/target, var/obj/thing) + if (aimcooldown > world.time) + return if(!owner) return @@ -175,6 +177,9 @@ obj/aiming_overlay/proc/update_aiming_deferred() moved_event.register(aiming_at, src, /obj/aiming_overlay/proc/target_moved) destroyed_event.register(aiming_at, src, /obj/aiming_overlay/proc/cancel_aiming) +/obj/aiming_overlay/proc/aim_cooldown(var/seconds) + aimcooldown = world.time + seconds SECONDS + /obj/aiming_overlay/update_icon() if(locked) icon_state = "locked" @@ -222,3 +227,4 @@ obj/aiming_overlay/proc/update_aiming_deferred() /obj/aiming_overlay/proc/target_moved() update_aiming() trigger(TARGET_CAN_MOVE) + diff --git a/code/modules/projectiles/targeting/targeting_triggers.dm b/code/modules/projectiles/targeting/targeting_triggers.dm index e493f6e1e66..dd523a8e7be 100644 --- a/code/modules/projectiles/targeting/targeting_triggers.dm +++ b/code/modules/projectiles/targeting/targeting_triggers.dm @@ -20,7 +20,12 @@ var/obj/item/weapon/gun/G = aiming_with if(istype(G)) G.Fire(aiming_at, owner) - + cancel_aiming()//if you can't remove it, nerf it + aim_cooldown(3) + toggle_active() + if (owner.client) + owner.client.remove_gun_icons() + /mob/living/ClickOn(var/atom/A, var/params) . = ..() trigger_aiming(TARGET_CAN_CLICK) diff --git a/html/changelogs/pacman-aim.yml b/html/changelogs/pacman-aim.yml new file mode 100644 index 00000000000..df4c152e809 --- /dev/null +++ b/html/changelogs/pacman-aim.yml @@ -0,0 +1,38 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +################################# + +# Your name. +author: Pacmandevil + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - balance: "Whenever you shoot someone while aiming at them, the aim is Dropped" + - balance: "There is now a cooldown to re-aiming after you shoot, this is currently 3 seconds."