mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Migrate cardboard cutouts to the new attack chain. (#32230)
* Migrate cardboard cutouts to the new attack chain. * Update messages in the spirit of CRUNCH revew. * Add fingerprints.
This commit is contained in:
@@ -11,17 +11,19 @@
|
||||
"Deathsquad Commando", "Ian", "Slaughter Demon",
|
||||
"Laughter Demon", "Xenomorph Maid", "Security Officer", "Terror Spider",
|
||||
"Changeling", "Vampire", "Abductor", "Zombie", "Soviet Marine", "Federation Marine")
|
||||
/// If the cutout is pushed over and has to be righted
|
||||
/// If the cutout is pushed over and has to be righted.
|
||||
var/pushed_over = FALSE
|
||||
/// If the cutout actually appears as what it portray and not a discolored version
|
||||
/// If the cutout actually appears as what it portray and not a discolored version.
|
||||
var/deceptive = FALSE
|
||||
materials = list(MAT_CARDBOARD = 10000)
|
||||
new_attack_chain = TRUE
|
||||
|
||||
/obj/item/cardboard_cutout/attack_hand(mob/living/user)
|
||||
if(user.a_intent == INTENT_HELP || pushed_over)
|
||||
return ..()
|
||||
user.visible_message(SPAN_WARNING("[user] pushes over [src]!"), SPAN_DANGER("You push over [src]!"))
|
||||
playsound(src, 'sound/weapons/genhit.ogg', 50, 1)
|
||||
add_fingerprint(user)
|
||||
push_over()
|
||||
|
||||
/obj/item/cardboard_cutout/proc/push_over()
|
||||
@@ -33,37 +35,44 @@
|
||||
alpha = initial(alpha)
|
||||
pushed_over = TRUE
|
||||
|
||||
/obj/item/cardboard_cutout/attack_self__legacy__attackchain(mob/living/user)
|
||||
/obj/item/cardboard_cutout/activate_self(mob/living/user)
|
||||
if(..())
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
if(!pushed_over)
|
||||
return
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
to_chat(user, SPAN_NOTICE("You right [src]."))
|
||||
desc = initial(desc)
|
||||
icon = initial(icon)
|
||||
icon_state = initial(icon_state) //This resets a cutout to its blank state - this is intentional to allow for resetting
|
||||
icon_state = initial(icon_state) // This resets a cutout to its blank state - this is intentional to allow for resetting.
|
||||
pushed_over = FALSE
|
||||
add_fingerprint(user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/cardboard_cutout/attackby__legacy__attackchain(obj/item/I, mob/living/user, params)
|
||||
if(istype(I, /obj/item/toy/crayon))
|
||||
change_appearance(I, user)
|
||||
return
|
||||
/obj/item/cardboard_cutout/item_interaction(mob/living/user, obj/item/used, list/modifiers)
|
||||
if(istype(used, /obj/item/toy/crayon))
|
||||
change_appearance(used, user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
// Why yes, this does closely resemble mob and object attack code.
|
||||
if(I.flags & NOBLUDGEON)
|
||||
return
|
||||
if(!I.force)
|
||||
if(used.flags & NOBLUDGEON)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
if(!used.force)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', 20, TRUE, -1)
|
||||
else if(I.hitsound)
|
||||
playsound(loc, I.hitsound, 20, TRUE, -1)
|
||||
else if(used.hitsound)
|
||||
playsound(loc, used.hitsound, 20, TRUE, -1)
|
||||
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
|
||||
if(I.force)
|
||||
user.visible_message("<span class='danger'>[user] has hit \
|
||||
[src] with [I]!</span>", "<span class='danger'>You hit [src] \
|
||||
with [I]!</span>")
|
||||
if(used.force)
|
||||
user.visible_message(
|
||||
SPAN_DANGER("[user] hits [src] with [used]!"),
|
||||
SPAN_DANGER("You hit [src] with [used]!"),
|
||||
SPAN_HEAR("You hear something slap a sheet of cardboard.")
|
||||
)
|
||||
|
||||
if(prob(I.force))
|
||||
if(prob(used.force))
|
||||
push_over()
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/cardboard_cutout/bullet_act(obj/projectile/P)
|
||||
visible_message(SPAN_DANGER("[src] is hit by [P]!"))
|
||||
@@ -93,7 +102,12 @@
|
||||
return
|
||||
if(!do_after(user, 10, FALSE, src, TRUE))
|
||||
return
|
||||
user.visible_message(SPAN_NOTICE("[user] gives [src] a new look."), SPAN_NOTICE("Voila! You give [src] a new look."))
|
||||
user.visible_message(
|
||||
SPAN_NOTICE("[user] gives [src] a new look."),
|
||||
SPAN_NOTICE("Voila! You give [src] a new look."),
|
||||
SPAN_HEAR("You hear a crayon scribbling on cardboard.")
|
||||
)
|
||||
add_fingerprint(user)
|
||||
alpha = 255
|
||||
icon = initial(icon)
|
||||
if(!deceptive)
|
||||
@@ -212,7 +226,7 @@
|
||||
desc = "A cardboard cutout of a vampire."
|
||||
icon_state = "cutout_vampire"
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/cardboard_cutout/setDir()
|
||||
dir = SOUTH
|
||||
|
||||
Reference in New Issue
Block a user