mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
* Standardizes Adding Datum Actions into a proc/define (Bonus AI Support) (Bonus Useless Code Cleanup) * Update ooze.dm * Modular audit - no more creating actions in nullspace * Update drone.dm --------- Co-authored-by: san7890 <the@san7890.com> Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
24 lines
744 B
Plaintext
24 lines
744 B
Plaintext
/datum/preference/toggle/soulcatcher_join_action
|
|
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
|
savefile_identifier = PREFERENCE_PLAYER
|
|
savefile_key = "soulcatcher_join_action"
|
|
default_value = TRUE
|
|
|
|
/datum/preference/toggle/soulcatcher_join_action/apply_to_client(client/client, value)
|
|
var/mob/dead/observer/ghost = client.mob
|
|
if(!istype(ghost))
|
|
return FALSE
|
|
|
|
var/datum/action/innate/join_soulcatcher/join_action = locate(/datum/action/innate/join_soulcatcher) in ghost.actions
|
|
if((!join_action && !value) || (join_action && value))
|
|
return TRUE
|
|
|
|
if(join_action && !value)
|
|
join_action.Remove(ghost)
|
|
return TRUE
|
|
|
|
var/datum/action/innate/join_soulcatcher/new_join_action = new(ghost)
|
|
new_join_action.Grant(ghost)
|
|
return TRUE
|
|
|