Adds a new App for Modular Computers, the NTOS Arcade. (#47862)
Hey you, punk Are you hip with modular computers? ...What's that, you think there's nothing to do on that old tablet of yours? Whoah brochacho, don't dump that tablet in the trash, and check out the new gaming app that's sweeping the station!
@@ -118,6 +118,19 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
|
||||
new empprize(loc)
|
||||
explosion(loc, -1, 0, 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 class='warning'>You need 2 tickets to claim a prize!</span>")
|
||||
return
|
||||
prizevend(user)
|
||||
T.pay_tickets()
|
||||
T.update_icon()
|
||||
O = T
|
||||
to_chat(user, "<span class='notice'>You turn in 2 tickets to the [src] and claim a prize!</span>")
|
||||
return
|
||||
|
||||
// ** BATTLE ** //
|
||||
|
||||
|
||||
31
code/game/objects/items/stacks/tickets.dm
Normal file
@@ -0,0 +1,31 @@
|
||||
/obj/item/stack/arcadeticket
|
||||
name = "arcade tickets"
|
||||
desc = "Wow! With enough of these, you could buy a bike! ...Pssh, yeah right."
|
||||
singular_name = "arcade ticket"
|
||||
icon_state = "arcade-ticket"
|
||||
item_state = "tickets"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
max_amount = 30
|
||||
|
||||
/obj/item/stack/arcadeticket/Initialize(mapload, new_amount, merge = TRUE)
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/stack/arcadeticket/update_icon()
|
||||
var/amount = get_amount()
|
||||
if((amount >= 12) && (amount > 0))
|
||||
icon_state = "arcade-ticket_4"
|
||||
else if((amount >= 6) && (amount > 0))
|
||||
icon_state = "arcade-ticket_3"
|
||||
else if((amount >= 2) && (amount > 0))
|
||||
icon_state = "arcade-ticket_2"
|
||||
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
|
||||
@@ -587,6 +587,16 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
"none_button.png" = 'html/none_button.png',
|
||||
)
|
||||
|
||||
/datum/asset/simple/arcade
|
||||
assets = list(
|
||||
"boss1.gif" = 'icons/UI_Icons/Arcade/boss1.gif',
|
||||
"boss2.gif" = 'icons/UI_Icons/Arcade/boss2.gif',
|
||||
"boss3.gif" = 'icons/UI_Icons/Arcade/boss3.gif',
|
||||
"boss4.gif" = 'icons/UI_Icons/Arcade/boss4.gif',
|
||||
"boss5.gif" = 'icons/UI_Icons/Arcade/boss5.gif',
|
||||
"boss6.gif" = 'icons/UI_Icons/Arcade/boss6.gif',
|
||||
)
|
||||
|
||||
/datum/asset/spritesheet/simple/achievements
|
||||
name ="achievements"
|
||||
assets = list(
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
if (!ui)
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
|
||||
assets.send(user)
|
||||
assets = get_asset_datum(/datum/asset/simple/arcade)
|
||||
assets.send(user)
|
||||
ui = new(user, src, ui_key, "ntos_main", "NtOS Main menu", 400, 500, master_ui, state)
|
||||
ui.open()
|
||||
ui.set_autoupdate(state = 1)
|
||||
|
||||
@@ -77,3 +77,4 @@
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
|
||||
hard_drive.store_file(new/datum/computer_file/program/chatclient())
|
||||
hard_drive.store_file(new/datum/computer_file/program/nttransfer())
|
||||
hard_drive.store_file(new/datum/computer_file/program/arcade())
|
||||
|
||||
174
code/modules/modular_computers/file_system/programs/arcade.dm
Normal file
@@ -0,0 +1,174 @@
|
||||
/datum/computer_file/program/arcade
|
||||
filename = "arcade"
|
||||
filedesc = "Nanotrasen Micro Arcade"
|
||||
program_icon_state = "arcade"
|
||||
extended_desc = "This port of the classic game 'Outbomb Cuban Pete', redesigned to run on tablets, with thrilling graphics and chilling storytelling."
|
||||
requires_ntnet = FALSE
|
||||
network_destination = "arcade network"
|
||||
size = 6
|
||||
tgui_id = "ntos_arcade"
|
||||
ui_x = 450
|
||||
ui_y = 350
|
||||
|
||||
var/game_active = TRUE //Checks to see if a game is in progress.
|
||||
var/pause_state = FALSE //This disables buttons in order to prevent multiple actions before the opponent's actions.
|
||||
var/boss_hp = 45
|
||||
var/boss_mp = 15
|
||||
var/player_hp = 30
|
||||
var/player_mp = 10
|
||||
var/ticket_count = 0
|
||||
var/heads_up = "Nanotrasen says, winners make us money."//Shows the active display text for the app
|
||||
var/boss_name = "Cuban Pete's Minion"
|
||||
var/boss_id = 1
|
||||
|
||||
/datum/computer_file/program/arcade/proc/game_check(mob/user)
|
||||
sleep(5)
|
||||
if(boss_hp <= 0)
|
||||
heads_up = "You have crushed [boss_name]! Rejoice!"
|
||||
playsound(computer.loc, 'sound/arcade/win.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
game_active = FALSE
|
||||
program_icon_state = "arcade_off"
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
ticket_count += 1
|
||||
sleep(10)
|
||||
return
|
||||
else if(player_hp <= 0 || player_mp <= 0)
|
||||
heads_up = "You have been defeated... how will the station survive?"
|
||||
playsound(computer.loc, 'sound/arcade/lose.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
game_active = FALSE
|
||||
program_icon_state = "arcade_off"
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
sleep(10)
|
||||
return
|
||||
return
|
||||
|
||||
/datum/computer_file/program/arcade/proc/enemy_check(mob/user)
|
||||
var/boss_attackamt = 0 //Spam protection from boss attacks as well.
|
||||
var/boss_mpamt = 0
|
||||
var/bossheal = 0
|
||||
if(pause_state == TRUE)
|
||||
boss_attackamt = rand(3,6)
|
||||
boss_mpamt = rand (2,4)
|
||||
bossheal = rand (4,6)
|
||||
if(game_active == FALSE)
|
||||
return
|
||||
if (boss_mp <= 5)
|
||||
heads_up = "[boss_mpamt] magic power has been stolen from you!"
|
||||
playsound(computer.loc, 'sound/arcade/steal.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_mp -= boss_mpamt
|
||||
boss_mp += boss_mpamt
|
||||
pause_state = FALSE
|
||||
game_check()
|
||||
return
|
||||
else if(boss_mp > 5 && boss_hp <12)
|
||||
heads_up = "[boss_name] heals for [bossheal] health!"
|
||||
playsound(computer.loc, 'sound/arcade/heal.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
boss_hp += bossheal
|
||||
boss_mp -= boss_mpamt
|
||||
pause_state = FALSE
|
||||
game_check()
|
||||
return
|
||||
else
|
||||
heads_up = "[boss_name] attacks you for [boss_attackamt] damage!"
|
||||
playsound(computer.loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_hp -= boss_attackamt
|
||||
pause_state = FALSE
|
||||
game_check()
|
||||
return
|
||||
return
|
||||
|
||||
/datum/computer_file/program/arcade/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/arcade)
|
||||
assets.send(user)
|
||||
|
||||
/datum/computer_file/program/arcade/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["Hitpoints"] = boss_hp
|
||||
data["PlayerHitpoints"] = player_hp
|
||||
data["PlayerMP"] = player_mp
|
||||
data["TicketCount"] = ticket_count
|
||||
data["GameActive"] = game_active
|
||||
data["PauseState"] = pause_state
|
||||
data["Status"] = heads_up
|
||||
data["BossID"] = "boss[boss_id].gif"
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/arcade/ui_act(action, params, mob/user)
|
||||
if(..())
|
||||
return TRUE
|
||||
var/obj/item/computer_hardware/printer/printer
|
||||
if(computer)
|
||||
printer = computer.all_components[MC_PRINT]
|
||||
|
||||
switch(action)
|
||||
if("Attack")
|
||||
var/attackamt = 0 //Spam prevention.
|
||||
if(pause_state == FALSE)
|
||||
attackamt = rand(2,6)
|
||||
pause_state = TRUE
|
||||
heads_up = "You attack for [attackamt] damage."
|
||||
playsound(computer.loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
boss_hp -= attackamt
|
||||
sleep(10)
|
||||
game_check()
|
||||
enemy_check()
|
||||
return TRUE
|
||||
if("Heal")
|
||||
var/healamt = 0 //More Spam Prevention.
|
||||
var/healcost = 0
|
||||
if(pause_state == FALSE)
|
||||
healamt = rand(6,8)
|
||||
healcost = rand(1,3)
|
||||
pause_state = TRUE
|
||||
heads_up = "You heal for [healamt] damage."
|
||||
playsound(computer.loc, 'sound/arcade/heal.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_hp += healamt
|
||||
player_mp -= healcost
|
||||
sleep(10)
|
||||
game_check()
|
||||
enemy_check()
|
||||
return TRUE
|
||||
if("Recharge_Power")
|
||||
var/rechargeamt = 0 //As above.
|
||||
if(pause_state == FALSE)
|
||||
rechargeamt = rand(4,7)
|
||||
pause_state = TRUE
|
||||
heads_up = "You regain [rechargeamt] magic power."
|
||||
playsound(computer.loc, 'sound/arcade/mana.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_mp += rechargeamt
|
||||
sleep(10)
|
||||
game_check()
|
||||
enemy_check()
|
||||
return TRUE
|
||||
if("Dispense_Tickets")
|
||||
if(!printer)
|
||||
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to redeem tickets.</span>")
|
||||
return
|
||||
if(printer.stored_paper <= 0)
|
||||
to_chat(usr, "<span class='notice'>Hardware error: Printer is out of paper.</span>")
|
||||
return
|
||||
else
|
||||
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
|
||||
if(ticket_count >= 1)
|
||||
new /obj/item/stack/arcadeticket((get_turf(computer)), 1)
|
||||
to_chat(user, "<span class='notice'>[src] dispenses a ticket!</span>")
|
||||
ticket_count -= 1
|
||||
printer.stored_paper -= 1
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You don't have any stored tickets!</span>")
|
||||
return TRUE
|
||||
if("Start_Game")
|
||||
game_active = TRUE
|
||||
boss_hp = 45
|
||||
player_hp = 30
|
||||
player_mp = 10
|
||||
heads_up = "You stand before [boss_name]! Prepare for battle!"
|
||||
program_icon_state = "arcade"
|
||||
boss_id = rand(1,6)
|
||||
pause_state = FALSE
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
BIN
icons/UI_Icons/Arcade/boss1.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
icons/UI_Icons/Arcade/boss2.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
icons/UI_Icons/Arcade/boss3.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
icons/UI_Icons/Arcade/boss4.gif
Normal file
|
After Width: | Height: | Size: 922 B |
BIN
icons/UI_Icons/Arcade/boss5.gif
Normal file
|
After Width: | Height: | Size: 568 B |
BIN
icons/UI_Icons/Arcade/boss6.gif
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 45 KiB |
@@ -1031,6 +1031,7 @@
|
||||
#include "code\game\objects\items\stacks\rods.dm"
|
||||
#include "code\game\objects\items\stacks\stack.dm"
|
||||
#include "code\game\objects\items\stacks\telecrystal.dm"
|
||||
#include "code\game\objects\items\stacks\tickets.dm"
|
||||
#include "code\game\objects\items\stacks\wrap.dm"
|
||||
#include "code\game\objects\items\stacks\sheets\glass.dm"
|
||||
#include "code\game\objects\items\stacks\sheets\leather.dm"
|
||||
@@ -2322,6 +2323,7 @@
|
||||
#include "code\modules\modular_computers\file_system\program_events.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\airestorer.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\alarm.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\arcade.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\card.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\configurator.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\file_browser.dm"
|
||||
|
||||
111
tgui-next/packages/tgui/interfaces/NtosArcade.js
Normal file
@@ -0,0 +1,111 @@
|
||||
import { act } from '../byond';
|
||||
import { AnimatedNumber, Box, Button, Grid, LabeledList, ProgressBar, Section } from '../components';
|
||||
|
||||
export const NtosArcade = props => {
|
||||
const { state } = props;
|
||||
const { config, data } = state;
|
||||
const { ref } = config;
|
||||
return (
|
||||
<Section title="Outbomb Cuban Pete Ultra"
|
||||
textAlign="center">
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Column size={2}>
|
||||
<Box m={1} />
|
||||
<LabeledList>
|
||||
<LabeledList.Item
|
||||
label="Player Health">
|
||||
<ProgressBar
|
||||
value={data.PlayerHitpoints}
|
||||
minValue={0}
|
||||
maxValue={30}
|
||||
ranges={{
|
||||
olive: [31, Infinity],
|
||||
good: [20, 31],
|
||||
average: [10, 20],
|
||||
bad: [-Infinity, 10],
|
||||
}}>
|
||||
{data.PlayerHitpoints}HP
|
||||
</ProgressBar>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item
|
||||
label="Player Magic">
|
||||
<ProgressBar
|
||||
value={data.PlayerMP}
|
||||
minValue={0}
|
||||
maxValue={10}
|
||||
ranges={{
|
||||
purple: [11, Infinity],
|
||||
violet: [3, 11],
|
||||
bad: [-Infinity, 3],
|
||||
}}>
|
||||
{data.PlayerMP}MP
|
||||
</ProgressBar>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
<Box my={1} mx={4} />
|
||||
<Section backgroundColor={(data.PauseState === 1) ? "#1b3622" : "#471915"}>
|
||||
{data.Status}
|
||||
</Section>
|
||||
</Grid.Column>
|
||||
<Grid.Column>
|
||||
<ProgressBar
|
||||
value={data.Hitpoints/45}
|
||||
color={(data.Hitpoints <= 5) ? "bad" : data.Hitpoints >= 30 ? "good" : "average"}>
|
||||
<AnimatedNumber value={data.Hitpoints} />
|
||||
HP
|
||||
</ProgressBar>
|
||||
<Box my={1} mx={1} />
|
||||
<Section
|
||||
inline
|
||||
width={26}
|
||||
textAlign="center">
|
||||
<img src={data.BossID} />
|
||||
</Section>
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
<Box my={1} mx={4} />
|
||||
<Button
|
||||
icon="fist-raised"
|
||||
tooltip="Go in for the kill!"
|
||||
tooltipPosition="top"
|
||||
disabled={data.GameActive === 0 || data.PauseState === 1}
|
||||
onClick={() => act(ref, 'Attack')}
|
||||
content="Attack!" />
|
||||
<Button
|
||||
icon="band-aid"
|
||||
tooltip="Heal yourself!"
|
||||
tooltipPosition="top"
|
||||
disabled={data.GameActive === 0 || data.PauseState === 1}
|
||||
onClick={() => act(ref, 'Heal')}
|
||||
content="Heal!" />
|
||||
<Button
|
||||
icon="magic"
|
||||
tooltip="Recharge your magic!"
|
||||
tooltipPosition="top"
|
||||
disabled={data.GameActive === 0 || data.PauseState === 1}
|
||||
onClick={() => act(ref, 'Recharge_Power')}
|
||||
content="Recharge!" />
|
||||
</Box>
|
||||
<Box>
|
||||
<Button
|
||||
icon="sync-alt"
|
||||
tooltip="One more game couldn't hurt."
|
||||
tooltipPosition="top"
|
||||
disabled={data.GameActive === 1}
|
||||
onClick={() => act(ref, 'Start_Game')}
|
||||
content="Begin Game?" />
|
||||
<Button
|
||||
icon="ticket-alt"
|
||||
tooltip="Redeem your arcade tickets! (Claim at your local Arcade Computer for Prizes!)"
|
||||
tooltipPosition="top"
|
||||
disabled={data.GameActive === 1}
|
||||
onClick={() => act(ref, 'Dispense_Tickets')}
|
||||
content="Claim Tickets" />
|
||||
</Box>
|
||||
<Box color={data.TicketCount >= 1 ? "good" : "normal"}>
|
||||
Earned Tickets: {data.TicketCount}
|
||||
</Box>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -9,6 +9,7 @@ const PROGRAM_ICONS = {
|
||||
smmonitor: 'radiation',
|
||||
alarmmonitor: 'bell',
|
||||
cardmod: 'id-card',
|
||||
arcade: 'gamepad',
|
||||
ntnrc_client: 'comment-alt',
|
||||
nttransfer: 'exchange-alt',
|
||||
powermonitor: 'plug',
|
||||
|
||||
@@ -40,6 +40,7 @@ import { LanguageMenu } from './interfaces/LanguageMenu';
|
||||
import { MechBayPowerConsole } from './interfaces/MechBayPowerConsole';
|
||||
import { MedicalKiosk } from './interfaces/MedicalKiosk';
|
||||
import { Mint } from './interfaces/Mint';
|
||||
import { NtosArcade } from './interfaces/NtosArcade';
|
||||
import { NtosMain } from './interfaces/NtosMain';
|
||||
import { NtosNetDownloader } from './interfaces/NtosNetDownloader';
|
||||
import { NtosSupermatterMonitor } from './interfaces/NtosSupermatterMonitor';
|
||||
@@ -253,6 +254,12 @@ const ROUTES = {
|
||||
scrollable: true,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_arcade: {
|
||||
component: () => NtosArcade,
|
||||
wrapper: () => NtosWrapper,
|
||||
scrollable: false,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_power_monitor: {
|
||||
component: () => PowerMonitor,
|
||||
wrapper: () => NtosWrapper,
|
||||
|
||||