mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Minor deadchat control improvements (#21162)
* Add resist, improves attack * Make emotes intentional too * fix a qdel loop * Add "help" command, start deadchat control with existing followers as well * Minor messaging improvements
This commit is contained in:
@@ -47,7 +47,12 @@
|
||||
if(!ismob(parent) && !(parent in GLOB.poi_list))
|
||||
GLOB.poi_list |= parent
|
||||
generated_point_of_interest = TRUE
|
||||
message_admins("[parent] has been given deadchat control in [deadchat_mode == DEADCHAT_ANARCHY_MODE ? "anarchy" : "democracy"] mode with a cooldown of [input_cooldown SECONDS] second\s.")
|
||||
message_admins("[parent] has been given deadchat control in [deadchat_mode == DEADCHAT_ANARCHY_MODE ? "anarchy" : "democracy"] mode with a cooldown of [input_cooldown] second\s.")
|
||||
|
||||
var/atom/A = parent
|
||||
for(var/mob/dead/observer/ghost in A.get_orbiters())
|
||||
// get started with anyone who's already following
|
||||
orbit_begin(A, ghost)
|
||||
|
||||
/datum/component/deadchat_control/Destroy(force, silent)
|
||||
var/message = "<span class='deadsay italics bold'>[parent] is no longer controllable.</span>"
|
||||
@@ -145,6 +150,8 @@
|
||||
to_chat(O, "<span class='deadsay'>You have deadchat muted, and as such will not receive messages related to, nor be able to participate in, controlling this object.</span>")
|
||||
to_chat(O, "<span class='notice'>If you would like to participate, unmute deadchat and follow this object again.</span>")
|
||||
return
|
||||
else
|
||||
to_chat(O, "<span class='deadsay'>[parent] is deadchat-controllable! Examine [parent] to see possible commands you can use while orbiting [parent.p_them()] to control [parent.p_their()] behavior!</span>")
|
||||
|
||||
RegisterSignal(orbiter, COMSIG_MOB_DEADSAY, PROC_REF(deadchat_react))
|
||||
RegisterSignal(orbiter, COMSIG_MOB_AUTOMUTE_CHECK, PROC_REF(waive_automute))
|
||||
@@ -190,6 +197,11 @@
|
||||
examine_list += "<span class='deadsay'>As you have deadchat disabled, you will not see vote messages, nor be able to participate in voting.</span>"
|
||||
return
|
||||
|
||||
if(!(user in orbiters))
|
||||
examine_list += "<span class='deadsay bold'>Orbit [A.p_them()] and examine [A.p_them()] again to see the list of possible commands.</span>"
|
||||
return
|
||||
|
||||
|
||||
if(deadchat_mode & DEADCHAT_DEMOCRACY_MODE)
|
||||
examine_list += "<span class='notice'>Type a command into chat to vote on an action. This happens once every [input_cooldown * 0.1] second\s.</span>"
|
||||
else if(deadchat_mode & DEADCHAT_ANARCHY_MODE)
|
||||
@@ -197,8 +209,7 @@
|
||||
|
||||
var/extended_examine = "<span class='notice'>Command list:"
|
||||
|
||||
for(var/possible_input in inputs)
|
||||
extended_examine += " [possible_input]"
|
||||
extended_examine += english_list(inputs)
|
||||
|
||||
extended_examine += ".</span>"
|
||||
|
||||
|
||||
@@ -639,7 +639,8 @@
|
||||
/// Easy way to remove the component when the fun has been played out
|
||||
/atom/movable/proc/stop_deadchat_plays()
|
||||
var/datum/component/deadchat_control/comp = GetComponent(/datum/component/deadchat_control)
|
||||
qdel(comp)
|
||||
if(!QDELETED(comp))
|
||||
qdel(comp)
|
||||
|
||||
/atom/movable/vv_get_dropdown()
|
||||
. = ..()
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/datum/emote/living/carbon/clap/get_sound(mob/living/user)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(!H?.mind.miming)
|
||||
if(!H?.mind?.miming)
|
||||
return pick(
|
||||
'sound/misc/clap1.ogg',
|
||||
'sound/misc/clap2.ogg',
|
||||
|
||||
@@ -2070,22 +2070,44 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
|
||||
/mob/living/carbon/human/proc/dchat_emote()
|
||||
var/list/possible_emotes = list("scream", "clap", "snap", "crack", "dap", "burp")
|
||||
emote(pick(possible_emotes))
|
||||
emote(pick(possible_emotes), intentional = TRUE)
|
||||
|
||||
/mob/living/carbon/human/proc/dchat_attack()
|
||||
/mob/living/carbon/human/proc/dchat_attack(intent)
|
||||
var/turf/ahead = get_turf(get_step(src, dir))
|
||||
var/mob/living/victim = locate(/mob/living) in ahead
|
||||
var/in_hand = get_active_hand()
|
||||
if(victim)
|
||||
victim.attacked_by(in_hand, src, BODY_ZONE_CHEST)
|
||||
var/atom/victim = locate(/mob/living) in ahead
|
||||
var/obj/item/in_hand = get_active_hand()
|
||||
var/implement = "[isnull(in_hand) ? "[p_their()] fists" : in_hand]"
|
||||
if(!victim)
|
||||
victim = locate(/obj/structure) in ahead
|
||||
if(!victim)
|
||||
switch(intent)
|
||||
if(INTENT_HARM)
|
||||
visible_message("<span class='warning'>[src] swings [implement] wildly!</span>")
|
||||
if(INTENT_HELP)
|
||||
visible_message("<span class='notice'>[src] seems to take a deep breath.</span>")
|
||||
return
|
||||
var/obj/structure/other_victim = locate(/obj/structure) in ahead
|
||||
if(other_victim)
|
||||
do_attack_animation(other_victim, used_item = in_hand)
|
||||
other_victim.attacked_by(in_hand, src)
|
||||
if(isLivingSSD(victim))
|
||||
visible_message("<span class='notice'>[src] [intent == INTENT_HARM ? "reluctantly " : ""]lowers [p_their()] [implement].</span>")
|
||||
return
|
||||
|
||||
visible_message("<span class='warning'>[src] swings [isnull(in_hand) ? "[p_their()] fists" : in_hand] wildly!")
|
||||
var/original_intent = a_intent
|
||||
a_intent = intent
|
||||
if(in_hand)
|
||||
in_hand.melee_attack_chain(src, victim)
|
||||
else
|
||||
UnarmedAttack(victim, TRUE)
|
||||
a_intent = original_intent
|
||||
|
||||
/mob/living/carbon/human/proc/dchat_resist()
|
||||
if(!can_resist())
|
||||
visible_message("<span class='warning'>[src] seems to be unable to do anything!</span>")
|
||||
return
|
||||
if(!restrained())
|
||||
visible_message("<span class='notice'>[src] seems to be doing nothing in particular.</span>")
|
||||
return
|
||||
|
||||
visible_message("<span class='warning'>[src] is trying to break free!</span>")
|
||||
resist()
|
||||
|
||||
/mob/living/carbon/human/proc/dchat_pickup()
|
||||
var/turf/ahead = get_step(src, dir)
|
||||
@@ -2138,10 +2160,12 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
/mob/living/carbon/human/deadchat_plays(mode = DEADCHAT_DEMOCRACY_MODE, cooldown = 7 SECONDS)
|
||||
var/list/inputs = list(
|
||||
"emote" = CALLBACK(src, PROC_REF(dchat_emote)),
|
||||
"attack" = CALLBACK(src, PROC_REF(dchat_attack)),
|
||||
"attack" = CALLBACK(src, PROC_REF(dchat_attack), INTENT_HARM),
|
||||
"help" = CALLBACK(src, PROC_REF(dchat_attack), INTENT_HELP),
|
||||
"pickup" = CALLBACK(src, PROC_REF(dchat_pickup)),
|
||||
"throw" = CALLBACK(src, PROC_REF(dchat_throw)),
|
||||
"disarm" = CALLBACK(src, PROC_REF(dchat_shove)),
|
||||
"resist" = CALLBACK(src, PROC_REF(dchat_resist)),
|
||||
)
|
||||
|
||||
AddComponent(/datum/component/deadchat_control/cardinal_movement, mode, inputs, cooldown)
|
||||
|
||||
Reference in New Issue
Block a user