Files
Bubberstation/code/game/objects/structures/divine.dm
Jeremiah 8e3f635b98 Alt click refactor (#82656)
## About The Pull Request
Rewrites how alt click works. 
Based heavily on #82625. What a cool concept, it flows nicely with
#82533.

Fixes #81242 
(tm bugs fixed)
Fixes #82668

<details><summary>More info for devs</summary>

Handy regex used for alt click s&r:
`AltClick\((.*).*\)(\n\t.*\.\.\(\))?`
`click_alt($1)` (yes I am aware this only copies the first arg. there
are no other args!)

### Obj reskins
No reason for obj reskin to check on every single alt click for every
object. It applies to only a few items.
- Moved to obj/item
- Made into signal
- Added screentips

### Ventcrawling
Every single atmospherics machine checked for ventcrawling capability on
alt click despite only 3 objects needing that functionality. This has
been moved down to those individual items.
</details>

## Why It's Good For The Game
For players: 
- Alt clicking should work more logically, not causing double actions
like eject disk and open item window
- Added context menus for reskinnable items
- Removed adjacency restriction on loot panel

For devs:
- Makes alt click interactions easier to work with, no more click chain
nonsense and redundant guard clauses.
- OOP hell reduced
- Pascal Case reduced
- Glorious snake case

## Changelog
🆑
add: The lootpanel now works at range.
add: Screentips for reskinnable items.
fix: Alt click interactions have been refactored, which may lead to
unintentional changes to gameplay. Report any issues, please.
/🆑
2024-04-16 17:48:03 -06:00

52 lines
1.8 KiB
Plaintext

/obj/structure/sacrificealtar
name = "sacrificial altar"
desc = "An altar designed to perform blood sacrifice for a deity. Alt-click it to sacrifice a buckled creature."
icon = 'icons/obj/service/hand_of_god_structures.dmi'
icon_state = "sacrificealtar"
anchored = TRUE
density = FALSE
can_buckle = 1
/obj/structure/sacrificealtar/click_alt(mob/living/user)
if(!has_buckled_mobs())
return CLICK_ACTION_BLOCKING
var/mob/living/L = locate() in buckled_mobs
if(!L)
return CLICK_ACTION_BLOCKING
to_chat(user, span_notice("Invoking the sacred ritual, you sacrifice [L]."))
L.investigate_log("has been sacrificially gibbed on an altar.", INVESTIGATE_DEATHS)
L.gib(DROP_ALL_REMAINS)
message_admins("[ADMIN_LOOKUPFLW(user)] has sacrificed [key_name_admin(L)] on the sacrificial altar at [AREACOORD(src)].")
return CLICK_ACTION_SUCCESS
/obj/structure/healingfountain
name = "healing fountain"
desc = "A fountain containing the waters of life."
icon = 'icons/obj/service/hand_of_god_structures.dmi'
icon_state = "fountain"
anchored = TRUE
density = TRUE
var/time_between_uses = 1800
var/last_process = 0
/obj/structure/healingfountain/attack_hand(mob/living/user, list/modifiers)
. = ..()
if(.)
return
if(last_process + time_between_uses > world.time)
to_chat(user, span_notice("The fountain appears to be empty."))
return
last_process = world.time
to_chat(user, span_notice("The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards."))
user.reagents.add_reagent(/datum/reagent/medicine/omnizine/godblood,20)
update_appearance()
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom/, update_appearance)), time_between_uses)
/obj/structure/healingfountain/update_icon_state()
if(last_process + time_between_uses > world.time)
icon_state = "fountain"
else
icon_state = "fountain-red"
return ..()