[MIRROR] Fixes arcade cabinets being un-hittable (#26609)

* Fixes arcade cabinets being un-hittable (#81620)

## About The Pull Request

What if we put all of our item based interactions in the same function
that attacks are handled? Great idea, I'm sure no one will ever forget
to call parent

Fixes that.

Also cleans up ticket code.

Also renames the base type so mappers stop mapping it in.

## Changelog

🆑 Melbert
fix: You can now take our your anger upon arcade cabinets upon losing
(they can be hit again)
/🆑

* Fixes arcade cabinets being un-hittable

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-02-23 05:29:40 +01:00
committed by GitHub
parent c169833aff
commit 4dfa62aa3b
2 changed files with 19 additions and 26 deletions
+18 -15
View File
@@ -71,8 +71,9 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
/obj/item/storage/box/party_poppers = 2))
/obj/machinery/computer/arcade
name = "random arcade"
desc = "random arcade machine"
name = "\proper the arcade cabinet which shouldn't exist"
desc = "This arcade cabinet has no games installed, and in fact, should not exist. \
Report the location of this machine to your local diety."
icon_state = "arcade"
icon_keyboard = null
icon_screen = "invaders"
@@ -136,19 +137,21 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
new empprize(loc)
explosion(src, devastation_range = -1, light_impact_range = 1+num_of_prizes, flame_range = 1+num_of_prizes)
/obj/machinery/computer/arcade/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/stack/arcadeticket))
var/obj/item/stack/arcadeticket/T = O
var/amount = T.get_amount()
if(amount <2)
to_chat(user, span_warning("You need 2 tickets to claim a prize!"))
return
prizevend(user)
T.pay_tickets()
T.update_appearance()
O = T
to_chat(user, span_notice("You turn in 2 tickets to the [src] and claim a prize!"))
return
/obj/machinery/computer/arcade/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking)
. = ..()
if(. & ITEM_INTERACT_ANY_BLOCKER)
return .
if(!istype(tool, /obj/item/stack/arcadeticket))
return .
var/obj/item/stack/arcadeticket/tickets = tool
if(!tickets.use(2))
balloon_alert(user, "need 2 tickets!")
return ITEM_INTERACT_BLOCKING
prizevend(user)
balloon_alert(user, "prize claimed")
return ITEM_INTERACT_SUCCESS
// ** BATTLE ** //
/obj/machinery/computer/arcade/battle
+1 -11
View File
@@ -8,14 +8,9 @@
max_amount = 30
merge_type = /obj/item/stack/arcadeticket
/obj/item/stack/arcadeticket/Initialize(mapload, new_amount, merge = TRUE, list/mat_override=null, mat_amt=1)
. = ..()
update_appearance()
/obj/item/stack/arcadeticket/update_icon_state()
. = ..()
var/amount = get_amount()
switch(amount)
switch(get_amount())
if(12 to INFINITY)
icon_state = "arcade-ticket_4"
if(6 to 12)
@@ -25,10 +20,5 @@
else
icon_state = "arcade-ticket"
/obj/item/stack/arcadeticket/proc/pay_tickets()
amount -= 2
if (amount == 0)
qdel(src)
/obj/item/stack/arcadeticket/thirty
amount = 30