Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] New Battle Arcade #2812

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions code/__DEFINES/arcades.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
///Goes in the Weapon slot.
#define WEAPON_SLOT "Weapon"
///Goes in the Armor slot.
#define ARMOR_SLOT "Armor"

//Worlds found in Battle Arcade
#define BATTLE_WORLD_ONE "The Plains"
#define BATTLE_WORLD_TWO "The Forest"
#define BATTLE_WORLD_THREE "The Mountains"
#define BATTLE_WORLD_FOUR "The Desert"
#define BATTLE_WORLD_FIVE "The Swamp"
#define BATTLE_WORLD_SIX "The Ocean"
#define BATTLE_WORLD_SEVEN "The Sky"
#define BATTLE_WORLD_EIGHT "The Moon"
#define BATTLE_WORLD_NINE "The Void"
73 changes: 73 additions & 0 deletions code/_globalvars/arcade.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
///List of all things that can be dispensed by an arcade cabinet and the weight of them being picked.
GLOBAL_LIST_INIT(arcade_prize_pool, list(
/obj/item/storage/box/snappops = 2,
/obj/item/toy/talking/ai = 2,
/obj/item/toy/talking/codex_gigas = 2,
/obj/item/clothing/under/syndicate/tacticool = 2,
/obj/item/toy/sword = 2,
/obj/item/toy/gun = 2,
/obj/item/gun/ballistic/shotgun/toy/crossbow = 2,
/obj/item/storage/box/fakesyndiesuit = 2,
/obj/item/storage/crayons = 2,
/obj/item/toy/spinningtoy = 2,
/obj/item/toy/spinningtoy/dark_matter = 1,
/obj/item/toy/balloon/arrest = 2,
/obj/item/toy/mecha/ripley = 1,
/obj/item/toy/mecha/ripleymkii = 1,
/obj/item/toy/mecha/hauler = 1,
/obj/item/toy/mecha/clarke = 1,
/obj/item/toy/mecha/odysseus = 1,
/obj/item/toy/mecha/gygax = 1,
/obj/item/toy/mecha/durand = 1,
/obj/item/toy/mecha/savannahivanov = 1,
/obj/item/toy/mecha/phazon = 1,
/obj/item/toy/mecha/honk = 1,
/obj/item/toy/mecha/darkgygax = 1,
/obj/item/toy/mecha/mauler = 1,
/obj/item/toy/mecha/darkhonk = 1,
/obj/item/toy/mecha/deathripley = 1,
/obj/item/toy/mecha/reticence = 1,
/obj/item/toy/mecha/marauder = 1,
/obj/item/toy/mecha/seraph = 1,
/obj/item/toy/mecha/firefighter = 1,
/obj/item/toy/cards/deck = 2,
/obj/item/toy/nuke = 2,
/obj/item/toy/minimeteor = 2,
/obj/item/toy/redbutton = 2,
/obj/item/toy/talking/owl = 2,
/obj/item/toy/talking/griffin = 2,
/obj/item/coin/antagtoken = 2,
/obj/item/stack/tile/fakepit/loaded = 2,
/obj/item/stack/tile/eighties/loaded = 2,
/obj/item/toy/toy_xeno = 2,
/obj/item/storage/box/actionfigure = 1,
/obj/item/restraints/handcuffs/fake = 2,
/obj/item/grenade/chem_grenade/glitter/pink = 1,
/obj/item/grenade/chem_grenade/glitter/blue = 1,
/obj/item/grenade/chem_grenade/glitter/white = 1,
/obj/item/toy/eightball = 2,
/obj/item/toy/windup_toolbox = 2,
/obj/item/toy/clockwork_watch = 2,
/obj/item/toy/toy_dagger = 2,
/obj/item/extendohand/acme = 1,
/obj/item/hot_potato/harmless/toy = 1,
/obj/item/card/emagfake = 1,
/obj/item/clothing/shoes/wheelys = 2,
/obj/item/clothing/shoes/kindle_kicks = 2,
/obj/item/toy/plush/goatplushie = 2,
/obj/item/toy/plush/moth = 2,
/obj/item/toy/plush/pkplush = 2,
/obj/item/toy/plush/rouny = 2,
/obj/item/toy/plush/abductor = 2,
/obj/item/toy/plush/abductor/agent = 2,
/obj/item/toy/plush/shark = 2,
/obj/item/storage/belt/military/snack/full = 2,
/obj/item/toy/brokenradio = 2,
/obj/item/toy/braintoy = 2,
/obj/item/toy/eldritch_book = 2,
/obj/item/storage/box/heretic_box = 1,
/obj/item/toy/foamfinger = 2,
/obj/item/clothing/glasses/trickblindfold = 2,
/obj/item/clothing/mask/party_horn = 2,
/obj/item/storage/box/party_poppers = 2,
))
8 changes: 4 additions & 4 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ SUBSYSTEM_DEF(ticker)

round_start_time = world.time //otherwise round_start_time would be 0 for the signals
SEND_SIGNAL(src, COMSIG_TICKER_ROUND_STARTING, world.time)
real_round_start_time = REALTIMEOFDAY //NOVA EDIT ADDITION
SSautotransfer.new_shift(real_round_start_time) //NOVA EDIT ADDITION
real_round_start_time = REALTIMEOFDAY // NOVA EDIT ADDITION
SSautotransfer.new_shift(real_round_start_time) // NOVA EDIT ADDITION

log_world("Game start took [(world.timeofday - init_start)/10]s")
INVOKE_ASYNC(SSdbcore, TYPE_PROC_REF(/datum/controller/subsystem/dbcore,SetRoundStart))

to_chat(world, span_notice("<B>Welcome to [station_name()], enjoy your stay!</B>"))
alert_sound_to_playing(sound(SSstation.announcer.get_rand_welcome_sound())) //NOVA EDIT CHANGE
to_chat(world, span_notice(span_bold("Welcome to [station_name()], enjoy your stay!")))
alert_sound_to_playing(sound(SSstation.announcer.get_rand_welcome_sound())) // NOVA EDIT CHANGE - ORIGINAL: SEND_SOUND(world, sound(SSstation.announcer.get_rand_welcome_sound()))

current_state = GAME_STATE_PLAYING
Master.SetRunLevel(RUNLEVEL_GAME)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
update_last_used(user)
. = ..()

/obj/machinery/ui_act(action, list/params)
/obj/machinery/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
add_fingerprint(usr)
update_last_used(usr)
if(HAS_AI_ACCESS(usr) && !GLOB.cameranet.checkTurfVis(get_turf(src))) //We check if they're an AI specifically here, so borgs can still access off-camera stuff.
Expand Down
104 changes: 104 additions & 0 deletions code/game/machinery/computer/arcade/_arcade.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/obj/machinery/computer/arcade
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"
light_color = LIGHT_COLOR_GREEN
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_REQUIRES_LITERACY

///If set, will dispense these as prizes instead of the default GLOB.arcade_prize_pool
///Like prize pool, it must be a list of the prize and the weight of being selected.
var/list/prize_override

/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))
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

if(istype(tool, /obj/item/key/displaycase) || istype(tool, /obj/item/access_key))
var/static/list/radial_menu_options
if(!radial_menu_options)
radial_menu_options = list(
"Reset Cabinet" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_reset"),
"Cancel" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_close"),
)
var/radial_reset_menu = show_radial_menu(user, src, radial_menu_options, require_near = TRUE)
if(radial_reset_menu != "Reset Cabinet")
return ITEM_INTERACT_BLOCKING
playsound(loc, 'sound/items/rattling_keys.ogg', 25, TRUE)
if(!do_after(user, 10 SECONDS, src))
return ITEM_INTERACT_BLOCKING
balloon_alert(user, "cabinet reset")
reset_cabinet(user)
return ITEM_INTERACT_SUCCESS

/obj/machinery/computer/arcade/screwdriver_act(mob/living/user, obj/item/I)
//you can't stop playing when you start.
if(obj_flags & EMAGGED)
return ITEM_INTERACT_BLOCKING
return ..()

///Performs a factory reset of the cabinet and wipes all its stats.
/obj/machinery/computer/arcade/proc/reset_cabinet(mob/living/user)
SHOULD_CALL_PARENT(TRUE)
obj_flags &= ~EMAGGED
SStgui.update_uis(src)

/obj/machinery/computer/arcade/emp_act(severity)
. = ..()
if((machine_stat & (NOPOWER|BROKEN)) || (. & EMP_PROTECT_SELF))
return

var/empprize = null
var/num_of_prizes = 0
switch(severity)
if(1)
num_of_prizes = rand(1,4)
if(2)
num_of_prizes = rand(0,2)
for(var/i = num_of_prizes; i > 0; i--)
if(prize_override)
empprize = pick_weight(prize_override)
else
empprize = pick_weight(GLOB.arcade_prize_pool)
new empprize(loc)
explosion(src, devastation_range = -1, light_impact_range = 1 + num_of_prizes, flame_range = 1 + num_of_prizes)

///Dispenses the proper prizes and gives them a positive mood event. If valid, has a small chance to give a pulse rifle.
/obj/machinery/computer/arcade/proc/prizevend(mob/living/user, prizes = 1)
SEND_SIGNAL(src, COMSIG_ARCADE_PRIZEVEND, user, prizes)
if(user.mind?.get_skill_level(/datum/skill/gaming) >= SKILL_LEVEL_LEGENDARY && HAS_TRAIT(user, TRAIT_GAMERGOD))
visible_message("<span class='notice'>[user] inputs an intense cheat code!",\
span_notice("You hear a flurry of buttons being pressed."))
say("CODE ACTIVATED: EXTRA PRIZES.")
prizes *= 2
for(var/i in 1 to prizes)
user.add_mood_event("arcade", /datum/mood_event/arcade)
if(prob(0.0001)) //1 in a million
new /obj/item/gun/energy/pulse/prize(src)
visible_message(span_notice("[src] dispenses.. woah, a gun! Way past cool."), span_notice("You hear a chime and a shot."))
user.client.give_award(/datum/award/achievement/misc/pulse, user)
continue

var/prizeselect
if(prize_override)
prizeselect = pick_weight(prize_override)
else
prizeselect = pick_weight(GLOB.arcade_prize_pool)
var/atom/movable/the_prize = new prizeselect(get_turf(src))
playsound(src, 'sound/machines/machine_vend.ogg', 50, TRUE, extrarange = -3)
visible_message(span_notice("[src] dispenses [the_prize]!"), span_notice("You hear a chime and a clunk."))


47 changes: 47 additions & 0 deletions code/game/machinery/computer/arcade/amputation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/obj/machinery/computer/arcade/amputation
name = "Mediborg's Amputation Adventure"
desc = "A picture of a blood-soaked medical cyborg flashes on the screen. \
The mediborg has a speech bubble that says, \"Put your hand in the machine if you aren't a <b>coward!</b>\""
icon_state = "arcade"
circuit = /obj/item/circuitboard/computer/arcade/amputation
interaction_flags_machine = NONE //borgs can't play, but the illiterate can.

/obj/machinery/computer/arcade/amputation/attack_tk(mob/user)
return //that's a pretty damn big guillotine

/obj/machinery/computer/arcade/amputation/attack_hand(mob/user, list/modifiers)
. = ..()
if(!iscarbon(user))
return
to_chat(user, span_warning("You move your hand towards the machine, and begin to hesitate as a bloodied guillotine emerges from inside of it..."))
user.played_game()
var/obj/item/bodypart/chopchop = user.get_active_hand()
if(do_after(user, 5 SECONDS, target = src, extra_checks = CALLBACK(src, PROC_REF(do_they_still_have_that_hand), user, chopchop)))
playsound(src, 'sound/weapons/slice.ogg', 25, TRUE, -1)
to_chat(user, span_userdanger("The guillotine drops on your arm, and the machine sucks it in!"))
chopchop.dismember()
qdel(chopchop)
user.mind?.adjust_experience(/datum/skill/gaming, 100)
user.won_game()
playsound(src, 'sound/arcade/win.ogg', 50, TRUE)
new /obj/item/stack/arcadeticket((get_turf(src)), rand(6,10))
to_chat(user, span_notice("[src] dispenses a handful of tickets!"))
return
if(!do_they_still_have_that_hand(user, chopchop))
to_chat(user, span_warning("The guillotine drops, but your hand seems to be gone already!"))
playsound(src, 'sound/weapons/slice.ogg', 25, TRUE, -1)
else
to_chat(user, span_notice("You (wisely) decide against putting your hand in the machine."))
user.lost_game()

///Makes sure the user still has their starting hand, preventing the user from pulling the arm out and still getting prizes.
/obj/machinery/computer/arcade/amputation/proc/do_they_still_have_that_hand(mob/user, obj/item/bodypart/chopchop)
if(QDELETED(chopchop) || chopchop.owner != user)
return FALSE
return TRUE

///Dispenses wrapped gifts instead of arcade prizes, also known as the ancap christmas tree
/obj/machinery/computer/arcade/amputation/festive
name = "Mediborg's Festive Amputation Adventure"
desc = "A picture of a blood-soaked medical cyborg wearing a Santa hat flashes on the screen. The mediborg has a speech bubble that says, \"Put your hand in the machine if you aren't a <b>coward!</b>\""
prize_override = list(/obj/item/gift/anything = 1)
Loading
Loading