refactors some gun things (#4036)

* wow

* wack

* fix

* fix

* fuck you

* i am declaring war on gun devs

* fix

* fix

Co-authored-by: fake_vm_user <fake_vm_user>
This commit is contained in:
silicons
2022-05-12 14:41:29 -07:00
committed by GitHub
co-authored by fake_vm_user <fake_vm_user>
parent eada4cef69
commit e88f63cd33
94 changed files with 463 additions and 418 deletions
@@ -7,11 +7,13 @@
#define CATEGORY_ROBOT "ROBOT"
#define CATEGORY_MISC "MISC"
#define CATEGORY_MOVEMENT "MOVEMENT"
#define CATEGORY_ITEM "ITEMS"
#define WEIGHT_HIGHEST 0
#define WEIGHT_ADMIN 10
#define WEIGHT_CLIENT 20
#define WEIGHT_ROBOT 30
#define WEIGHT_ITEM 35
#define WEIGHT_MOB 40
#define WEIGHT_LIVING 50
#define WEIGHT_DEAD 60
-15
View File
@@ -37,18 +37,3 @@
var/mob/living/carbon/human/H = user.mob
H.smart_equipbag()
return TRUE
/datum/keybinding/human/toggle_gun_safety
hotkey_keys = list("C")
name = "toggle_gun_safety"
full_name = "Toggle Gun Safety"
description = "Toggle the safety of a gun in your hand"
/datum/keybinding/human/toggle_gun_safety/down(client/user)
var/mob/living/carbon/human/H = user.mob
if(H)
var/obj/item/gun/G = H.get_active_hand()
if(!G)
G = H.get_inactive_hand() //We'll try both hands just in case
if(G)
G.toggle_safety_verb()
+23
View File
@@ -0,0 +1,23 @@
/datum/keybinding/item
weight = WEIGHT_ITEM
category = CATEGORY_ITEM
/datum/keybinding/item/can_use(client/user)
return TRUE
/datum/keybinding/item/unique_action
name = "unique_action"
full_name = "Unique Action"
description = "Triggers an unique action, based on whichever item you're holding."
hotkey_keys = list("C")
/datum/keybinding/item/toggle_gun_safety
hotkey_keys = list()
name = "toggle_gun_safety"
full_name = "Toggle Gun Safety"
description = "Toggle the safety of a gun in your hand"
/datum/keybinding/human/toggle_gun_safety/down(client/user)
var/obj/item/gun/G = locate() in user.mob.get_all_held_items()
if(G)
G.toggle_safety(user)