mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] Refactors smiting, adds smite build mode (#2126)
* Refactors smiting, adds smite build mode (#55327) Refactors smiting out from being a large switch/case into datums. Adds a new smite option to build mode. This lets you choose a smite and rapidly apply it to a lot of people, presumably for EORG. Requested for by...one of the admins, I forget which. * Refactors smiting, adds smite build mode Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/datum/buildmode_mode/smite
|
||||
key = "smite"
|
||||
var/datum/smite/selected_smite
|
||||
|
||||
/datum/buildmode_mode/smite/Destroy()
|
||||
selected_smite = null
|
||||
return ..()
|
||||
|
||||
/datum/buildmode_mode/smite/show_help(client/user)
|
||||
to_chat(user, "<span class='notice'>***********************************************************\n\
|
||||
Right Mouse Button on buildmode button = Select smite to use.\n\
|
||||
Left Mouse Button on mob/living = Smite the mob.\n\
|
||||
***********************************************************</span>")
|
||||
|
||||
/datum/buildmode_mode/smite/change_settings(client/user)
|
||||
var/punishment = input(user, "Choose a punishment", "DIVINE SMITING") as null|anything in GLOB.smites
|
||||
var/smite_path = GLOB.smites[punishment]
|
||||
var/datum/smite/picking_smite = new smite_path
|
||||
var/configuration_success = picking_smite.configure(user)
|
||||
if (configuration_success == FALSE)
|
||||
return
|
||||
selected_smite = picking_smite
|
||||
|
||||
/datum/buildmode_mode/smite/handle_click(client/user, params_string, object)
|
||||
var/list/params = params2list(params_string)
|
||||
|
||||
if (!check_rights(R_ADMIN | R_FUN))
|
||||
return
|
||||
|
||||
if (!params.Find("left"))
|
||||
return
|
||||
|
||||
if (!isliving(object))
|
||||
return
|
||||
|
||||
if (selected_smite == null)
|
||||
to_chat(user, "<span class='notice'>No smite selected.</span>")
|
||||
return
|
||||
|
||||
selected_smite.effect(user, object)
|
||||
Reference in New Issue
Block a user