mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Adds a new verb that allows users to toggle the requiring help intent to fire weapons on or off
This commit is contained in:
@@ -131,6 +131,12 @@ var/list/_client_preferences_by_type
|
|||||||
key = "SHOW_PROGRESS"
|
key = "SHOW_PROGRESS"
|
||||||
enabled_description = "Show"
|
enabled_description = "Show"
|
||||||
disabled_description = "Hide"
|
disabled_description = "Hide"
|
||||||
|
|
||||||
|
/datum/client_preference/safefiring
|
||||||
|
description = "Safe gun firing."
|
||||||
|
key = "SAFE_FIRING"
|
||||||
|
enabled_description = "Safe"
|
||||||
|
disabled_description = "Dangerous"
|
||||||
/********************
|
/********************
|
||||||
* Staff Preferences *
|
* Staff Preferences *
|
||||||
********************/
|
********************/
|
||||||
|
|||||||
@@ -179,6 +179,19 @@
|
|||||||
|
|
||||||
feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
|
|
||||||
|
/client/verb/toggle_safe_firing()
|
||||||
|
set name = "Toggle Safe Firearms Firing"
|
||||||
|
set category = "Preferences"
|
||||||
|
set desc = "Toggles between safe and dangerous firing. Safe requires a non-help intent to fire, dangerous can be fired on help intent."
|
||||||
|
|
||||||
|
var/pref_path = /datum/client_preference/safefiring
|
||||||
|
toggle_preference(pref_path)
|
||||||
|
prefs.save_preferences()
|
||||||
|
|
||||||
|
src << "You will now use [(is_preference_enabled(/datum/client_preference/safefiring)) ? "safe" : "dangerous"] firearms firing."
|
||||||
|
|
||||||
|
feedback_add_details("admin_verb","TFiringMode") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
|
|
||||||
//Toggles for Staff
|
//Toggles for Staff
|
||||||
//Developers
|
//Developers
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@
|
|||||||
PreFire(A,user,params) //They're using the new gun system, locate what they're aiming at.
|
PreFire(A,user,params) //They're using the new gun system, locate what they're aiming at.
|
||||||
return
|
return
|
||||||
|
|
||||||
if(user && user.a_intent == I_HELP) //regardless of what happens, refuse to shoot if help intent is on
|
if(user && user.a_intent == I_HELP && user.is_preference_enabled(/datum/client_preference/safefiring)) //regardless of what happens, refuse to shoot if help intent is on
|
||||||
user << "<span class='warning'>You refrain from firing your [src] as your intent is set to help.</span>"
|
user << "<span class='warning'>You refrain from firing your [src] as your intent is set to help.</span>"
|
||||||
else
|
else
|
||||||
Fire(A,user,params) //Otherwise, fire normally.
|
Fire(A,user,params) //Otherwise, fire normally.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
if(!owner.canClick())
|
if(!owner.canClick())
|
||||||
return
|
return
|
||||||
owner.setClickCooldown(5) // Spam prevention, essentially.
|
owner.setClickCooldown(5) // Spam prevention, essentially.
|
||||||
if(owner.a_intent == I_HELP)
|
if(owner.a_intent == I_HELP && owner.is_preference_enabled(/datum/client_preference/safefiring))
|
||||||
owner << "<span class='warning'>You refrain from firing \the [aiming_with] as your intent is set to help.</span>"
|
owner << "<span class='warning'>You refrain from firing \the [aiming_with] as your intent is set to help.</span>"
|
||||||
return
|
return
|
||||||
owner.visible_message("<span class='danger'>\The [owner] pulls the trigger reflexively!</span>")
|
owner.visible_message("<span class='danger'>\The [owner] pulls the trigger reflexively!</span>")
|
||||||
|
|||||||
Reference in New Issue
Block a user