Files
Bubberstation/code/modules/buildmode/submodes/smite.dm
SkyratBot eaf6c62f02 [MIRROR] Build Mode Preview + better help text [MDB IGNORE] (#22023)
* Build Mode Preview + better help text (#76095)

## About The Pull Request
Gives `Adv Build Mode` and `Fill` an item preview, and puts the help
text for build mode modes into an examine block.

https://github.com/tgstation/tgstation/assets/66640614/6751c721-6ddd-4761-8311-fb002ea905ac

![image](https://github.com/tgstation/tgstation/assets/66640614/3f6fe986-1767-4639-94d3-523f1039c947)

![image](https://github.com/tgstation/tgstation/assets/66640614/a7eae938-a575-46bd-b00e-865f04e0de20)

## Why It's Good For The Game
It's good to see what you're doing.

## Changelog
🆑 Tattle
admin: build mode help text is in an examine block
admin: adv build mode and fill now have item previews
/🆑

---------

Co-authored-by: tattle <article.disaster@ gmail.com>
Co-authored-by: san7890 <the@ san7890.com>

* Build Mode Preview + better help text

---------

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: tattle <article.disaster@ gmail.com>
Co-authored-by: san7890 <the@ san7890.com>
2023-07-01 16:17:31 -04:00

41 lines
1.1 KiB
Plaintext

/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/builder)
to_chat(builder, span_purple(examine_block(
"[span_bold("Select smite to use")] -> Right Mouse Button on buildmode button\n\
[span_bold("Smite the mob")] -> Left Mouse Button on mob/living"))
)
/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, object)
var/list/modifiers = params2list(params)
if (!check_rights(R_ADMIN | R_FUN))
return
if (!LAZYACCESS(modifiers, LEFT_CLICK))
return
if (!isliving(object))
return
if (selected_smite == null)
to_chat(user, span_notice("No smite selected."))
return
selected_smite.effect(user, object)