mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Adds a new rock-paper-scissors emote (#25300)
* adds rock paper scissors mechanics * better icon * Cleans up the last bit of the implementation * use barber scissors instead * minor cleanups * Apply suggestions from code review Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com> * Update code/datums/status_effects/neutral.dm Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com> --------- Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com> Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
This commit is contained in:
@@ -375,6 +375,8 @@
|
||||
cooldown = 5 SECONDS
|
||||
/// Status effect to apply when this emote is used. Should be a subtype
|
||||
var/status = STATUS_EFFECT_HIGHFIVE
|
||||
/// title override, used for the re-use message.
|
||||
var/action_name
|
||||
|
||||
/datum/emote/living/carbon/human/highfive/can_run_emote(mob/user, status_check, intentional)
|
||||
. = ..()
|
||||
@@ -382,12 +384,17 @@
|
||||
if(user_carbon.restrained())
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/carbon/human/highfive/proc/set_status(mob/living/carbon/user)
|
||||
return user.apply_status_effect(status)
|
||||
|
||||
/datum/emote/living/carbon/human/highfive/run_emote(mob/user, params, type_override, intentional)
|
||||
var/mob/living/carbon/user_carbon = user
|
||||
if(user_carbon.has_status_effect(status))
|
||||
user.visible_message("[user.name] shakes [user.p_their()] hand around slightly, impatiently waiting for someone to [key].")
|
||||
user.visible_message("[user.name] shakes [user.p_their()] hand around slightly, impatiently waiting for someone to [!isnull(action_name) ? action_name : key].")
|
||||
return TRUE
|
||||
var/datum/result = set_status(user)
|
||||
if(QDELETED(result))
|
||||
return TRUE
|
||||
user_carbon.apply_status_effect(status)
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -401,6 +408,39 @@
|
||||
key_third_person = "handshakes"
|
||||
status = STATUS_EFFECT_HANDSHAKE
|
||||
|
||||
/datum/emote/living/carbon/human/highfive/rps
|
||||
key = "rps"
|
||||
param_desc = "r,p,s"
|
||||
hands_use_check = TRUE
|
||||
status = STATUS_EFFECT_RPS
|
||||
action_name = "play rock-paper-scissors with"
|
||||
target_behavior = EMOTE_TARGET_BHVR_IGNORE
|
||||
/// If the user used parameters, the move that will be made.
|
||||
var/move
|
||||
|
||||
/datum/emote/living/carbon/human/highfive/rps/run_emote(mob/user, emote_arg, type_override, intentional)
|
||||
switch(lowertext(emote_arg))
|
||||
if("r", "rock")
|
||||
move = RPS_EMOTE_ROCK
|
||||
if("p", "paper")
|
||||
move = RPS_EMOTE_PAPER
|
||||
if("s", "scissors")
|
||||
move = RPS_EMOTE_SCISSORS
|
||||
|
||||
// if it's an invalid emote param, just fall through and let them select
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/emote/living/carbon/human/highfive/rps/set_status(mob/living/carbon/user)
|
||||
if(!isnull(move))
|
||||
// if they supplied a valid parameter, use that for the move
|
||||
return user.apply_status_effect(status, move)
|
||||
return user.apply_status_effect(status)
|
||||
|
||||
/datum/emote/living/carbon/human/highfive/rps/reset_emote()
|
||||
..()
|
||||
move = initial(move)
|
||||
|
||||
/datum/emote/living/carbon/human/snap
|
||||
key = "snap"
|
||||
key_third_person = "snaps"
|
||||
@@ -453,7 +493,6 @@
|
||||
mob_type_allowed_typecache = list(/mob/living/carbon/human)
|
||||
hands_use_check = TRUE
|
||||
|
||||
|
||||
/////////
|
||||
// Species-specific emotes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user