Files
Bubberstation/code/modules/admin/smites/ghost_control.dm
John Willard ef352ca731 minor changes to living and mob vars (#77820)
## About The Pull Request

Renames m_intent to move_intent and moves it to the living level
renames tod to station_timestamp_timeofdeath
removes stun_absorption and see_override as one was unused and the other
was never actually implemented

## Why It's Good For The Game

Many vars on the mob and living level were intended to be on the living
and carbon level, but weren't for one reason or another. Generally it
was out of laziness to ensure the mobs being checked for these vars were
the intended mobs, and there's some todo comments on how they want it
changed in the future, though it never happened.
I'm hoping to get these all down in the future, I originally wanted to
move ``stat`` from mob to living but it had hundreds of errors so I
didn't want to do it all here.

## Changelog

Nothing player-facing.
2023-08-26 02:24:15 +01:00

52 lines
2.2 KiB
Plaintext

/datum/smite/ghost_control
name = "Ghost Control"
/datum/smite/ghost_control/effect(client/user, mob/living/target)
target.AddComponent(/datum/component/deadchat_control/cardinal_movement, ANARCHY_MODE, list(
"clap" = CALLBACK(target, TYPE_PROC_REF(/mob, emote), "clap"),
"cry" = CALLBACK(target, TYPE_PROC_REF(/mob, emote), "cry"),
"flip" = CALLBACK(target, TYPE_PROC_REF(/mob, emote), "flip"),
"laugh" = CALLBACK(target, TYPE_PROC_REF(/mob, emote), "laugh"),
"scream" = CALLBACK(target, TYPE_PROC_REF(/mob, emote), "scream"),
"spin" = CALLBACK(target, TYPE_PROC_REF(/mob, emote), "spin"),
"swear" = CALLBACK(target, TYPE_PROC_REF(/mob, emote), "swear"),
"drop" = CALLBACK(target, TYPE_PROC_REF(/mob, drop_all_held_items)),
"fall" = CALLBACK(target, TYPE_PROC_REF(/mob/living, Knockdown), 1 SECONDS),
"stand" = CALLBACK(target, TYPE_PROC_REF(/mob/living, resist_buckle)),
"throw" = CALLBACK(target, TYPE_PROC_REF(/mob, throw_item), get_edge_target_turf(target, pick(GLOB.alldirs))),
"shove" = CALLBACK(src, PROC_REF(ghost_shove), target),
"sit" = CALLBACK(src, PROC_REF(ghost_sit), target),
"run" = CALLBACK(src, PROC_REF(ghost_speed), target, MOVE_INTENT_RUN),
"walk" = CALLBACK(src, PROC_REF(ghost_speed), target, MOVE_INTENT_WALK),
), 7 SECONDS)
to_chat(target, span_revenwarning("You feel a ghastly presence!!!"))
/datum/smite/ghost_control/proc/ghost_shove(mob/living/carbon/target)
if(!istype(target) || target.get_active_held_item())
return
var/list/shoveables = list()
for(var/mob/living/victim in orange(1, target))
shoveables += victim
if(!length(shoveables))
return
var/mob/living/shove_me = pick(shoveables)
target.UnarmedAttack(shove_me, proximity_flag = TRUE, modifiers = list("right" = TRUE))
/datum/smite/ghost_control/proc/ghost_sit(mob/living/target)
if(HAS_TRAIT(target, TRAIT_IMMOBILIZED))
return
var/list/chairs = list()
for(var/obj/structure/chair/possible_chair in range(1, target))
chairs += possible_chair
if(!length(chairs))
return
var/obj/structure/chair/sitting_chair = pick(chairs)
sitting_chair.buckle_mob(target, check_loc = FALSE)
/datum/smite/ghost_control/proc/ghost_speed(mob/living/target, new_speed)
if(target.move_intent == new_speed)
return
target.toggle_move_intent()