/obj/machinery/computer/arcade name = "random arcade" desc = "random arcade machine." icon_state = "arcade" icon_keyboard = null icon_screen = "invaders" light_color = "#00FF00" var/prize = /obj/item/stack/tickets /obj/machinery/computer/arcade/proc/Reset() return /obj/machinery/computer/arcade/Initialize(mapload) . = ..() if(!circuit) var/choice = pick(subtypesof(/obj/machinery/computer/arcade)) var/obj/machinery/computer/arcade/chosen = new choice(loc) chosen.dir = dir return INITIALIZE_HINT_QDEL Reset() /obj/machinery/computer/arcade/proc/prizevend(score) if(!length(contents)) var/prize_amount if(score) prize_amount = score else prize_amount = rand(1, 10) new prize(get_turf(src), prize_amount) else var/atom/movable/prize = pick(contents) prize.loc = get_turf(src) /obj/machinery/computer/arcade/emp_act(severity) ..(severity) if(stat & (NOPOWER|BROKEN)) return var/num_of_prizes = 0 switch(severity) if(EMP_HEAVY) num_of_prizes = rand(1,4) if(EMP_LIGHT) num_of_prizes = rand(0,2) for(var/i = num_of_prizes; i > 0; i--) prizevend() explosion(get_turf(src), -1, 0, 1+num_of_prizes, flame_range = 1+num_of_prizes, cause = "EMP'd arcade machine") /obj/machinery/computer/arcade/battle name = "arcade machine" desc = "Does not support Pinball." icon_state = "battle_arcade" icon_screen = "battle" circuit = /obj/item/circuitboard/arcade/battle var/enemy_name = "Space Villain" /// event message for attack messages, etc var/previous_event = "Make your move!" /// Player health/attack points var/player_hp = 30 /// the highest amount of health that the player has held var/player_max_hp = 30 /// player magic points var/player_mp = 10 /// the highest amount of mana that the player has held var/player_max_mp = 10 /// Enemy health/attack points var/enemy_hp = 45 /// the highest amount of health that the enemy achieves - this never changes, but avoids magic numbers var/enemy_max_hp = 45 /// enemy magic points var/enemy_mp = 20 var/gameover = FALSE /// a counter of whether the last few player inputs were to heal, incurs a turtling penalty when emagged var/passive_streak = 0 COOLDOWN_DECLARE(spam_cooldown) /obj/machinery/computer/arcade/battle/proc/generate_name() var/name_action = pick("Defeat ", "Annihilate ", "Save ", "Strike ", "Stop ", "Destroy ", "Robust ", "Romance ", "Pwn ", "Own ", "Ban ") var/name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Cuban ", "the Evil ", "the Dread King ", "the Space ", "Lord ", "the Great ", "Duke ", "General ") var/name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "Slime", "Griefer", "ERPer", "Lizard Man", "Unicorn", "Bloopers") enemy_name = replacetext((name_part1 + name_part2), "the ", "") name = (name_action + name_part1 + name_part2) /obj/machinery/computer/arcade/battle/Reset() previous_event = initial(previous_event) player_hp = initial(player_hp) player_max_hp = initial(player_max_hp) player_mp = initial(player_mp) player_max_mp = initial(player_max_mp) enemy_hp = initial(enemy_hp) enemy_max_hp = initial(enemy_max_hp) enemy_mp = initial(enemy_mp) gameover = initial(gameover) passive_streak = initial(enemy_mp) /obj/machinery/computer/arcade/battle/Initialize(mapload) . = ..() generate_name() /obj/machinery/computer/arcade/battle/attack_hand(mob/user as mob) if(..()) return ui_interact(user) /obj/machinery/computer/arcade/battle/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) ui = new(user, src, "ArcadeBattle", name) ui.open() /obj/machinery/computer/arcade/battle/ui_data(mob/user) var/list/data = list() data["enemyName"] = enemy_name data["enemyHP"] = enemy_hp data["enemyMaxHP"] = enemy_max_hp data["playerHP"] = player_hp data["playerMaxHP"] = player_max_hp data["playerMP"] = player_mp data["playerMaxMP"] = player_max_mp data["onCooldown"] = !COOLDOWN_FINISHED(src, spam_cooldown) data["gameOver"] = gameover data["previousEvent"] = previous_event return data /obj/machinery/computer/arcade/battle/ui_act(action, params) if(..()) return if(!COOLDOWN_FINISHED(src, spam_cooldown)) return switch(action) if("attack") var/attack_amount = rand(2,6) enemy_hp -= attack_amount previous_event = "You attack for [attack_amount] damage!" if(passive_streak > 0) passive_streak-- playsound(loc, 'sound/arcade/hit.ogg', 50, TRUE) COOLDOWN_START(src, spam_cooldown, 1 SECONDS) addtimer(CALLBACK(src, PROC_REF(arcade_action)), 1 SECONDS) if("heal") var/heal_amount = rand(6,8) var/point_amount = rand(1,3) player_hp += heal_amount player_mp -= point_amount if(player_hp > player_max_hp) player_max_hp = player_hp previous_event = "You use [point_amount] magic to heal for [heal_amount] damage!" passive_streak++ playsound(loc, 'sound/arcade/heal.ogg', 50, TRUE) COOLDOWN_START(src, spam_cooldown, 1 SECONDS) addtimer(CALLBACK(src, PROC_REF(arcade_action)), 1 SECONDS) if("charge") var/charge_amount = rand(4,7) player_mp += charge_amount if(player_mp > player_max_mp) player_max_mp = player_mp previous_event = "You regain [charge_amount] points!" if(passive_streak > 0) passive_streak-- playsound(loc, 'sound/arcade/mana.ogg', 50, TRUE) COOLDOWN_START(src, spam_cooldown, 1 SECONDS) addtimer(CALLBACK(src, PROC_REF(arcade_action)), 1 SECONDS) if("newgame") //Reset everything if(emagged) emagged = FALSE generate_name() Reset() return TRUE /obj/machinery/computer/arcade/battle/proc/arcade_action() if((enemy_mp <= 0) || (enemy_hp <= 0)) gameover = TRUE previous_event = "[enemy_name] has fallen!" playsound(loc, 'sound/arcade/win.ogg', 50, TRUE) if(emagged) SSblackbox.record_feedback("tally", "arcade_status", 1, "win_emagged") new /obj/effect/spawner/newbomb/timer/syndicate(get_turf(src)) new /obj/item/clothing/head/collectable/petehat(get_turf(src)) message_admins("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.") log_game("[key_name(usr)] has outbombed Cuban Pete and been awarded a bomb.") Reset() generate_name() emagged = FALSE else SSblackbox.record_feedback("tally", "arcade_status", 1, "win_normal") prizevend(35) else if(emagged && (passive_streak >= 4)) var/boom_amount = rand(5,10) previous_event = "[enemy_name] throws a bomb, exploding you for [boom_amount] damage!" playsound(loc, 'sound/arcade/boom.ogg', 50, TRUE) player_hp -= boom_amount else if((enemy_mp <= 5) && (prob(70))) var/steal_amount = rand(2,3) previous_event = "[enemy_name] steals [steal_amount] of your power!" playsound(loc, 'sound/arcade/steal.ogg', 50, TRUE) player_mp -= steal_amount if(player_mp <= 0) gameover = TRUE previous_event = "You have been drained!" playsound(loc, 'sound/arcade/lose.ogg', 50, TRUE) if(emagged) SSblackbox.record_feedback("tally", "arcade_status", 1, "loss_mana_emagged") usr.gib() else SSblackbox.record_feedback("tally", "arcade_status", 1, "loss_mana_normal") else if((enemy_hp <= 10) && (enemy_mp > 4)) previous_event = "[enemy_name] heals for 4 health!" playsound(loc, 'sound/arcade/heal.ogg', 50, TRUE) enemy_hp += 4 enemy_mp -= 4 else var/attack_amount = rand(3,6) previous_event = "[enemy_name] attacks for [attack_amount] damage!" playsound(loc, 'sound/arcade/hit.ogg', 50, TRUE) player_hp -= attack_amount if((player_mp <= 0) || (player_hp <= 0)) gameover = TRUE previous_event = "You have been crushed!" playsound(loc, 'sound/arcade/lose.ogg', 50, TRUE) if(emagged) SSblackbox.record_feedback("tally", "arcade_status", 1, "loss_hp_emagged") usr.gib() else SSblackbox.record_feedback("tally", "arcade_status", 1, "loss_hp_normal") return /obj/machinery/computer/arcade/battle/emag_act(user as mob) if(!emagged) Reset() emagged = TRUE enemy_name = "Cuban Pete" name = "Outbomb Cuban Pete" previous_event = "If you die in the game, you die for real!" add_hiddenprint(user) return TRUE // *** THE ORION TRAIL ** // #define ORION_TRAIL_WINTURN 9 //Orion Trail Events #define ORION_TRAIL_RAIDERS "Raiders" #define ORION_TRAIL_FLUX "Interstellar Flux" #define ORION_TRAIL_ILLNESS "Illness" #define ORION_TRAIL_BREAKDOWN "Breakdown" #define ORION_TRAIL_LING "Changelings?" #define ORION_TRAIL_LING_ATTACK "Changeling Ambush" #define ORION_TRAIL_MALFUNCTION "Malfunction" #define ORION_TRAIL_COLLISION "Collision" #define ORION_TRAIL_SPACEPORT "Spaceport" #define ORION_TRAIL_BLACKHOLE "BlackHole" /obj/machinery/computer/arcade/orion_trail name = "The Orion Trail" desc = "Learn how our ancestors got to Orion, and have fun in the process!" icon_screen = "orion" circuit = /obj/item/circuitboard/arcade/orion_trail var/busy = FALSE //prevent clickspam that allowed people to ~speedrun~ the game. var/engine = 0 var/hull = 0 var/electronics = 0 var/food = 80 var/fuel = 60 var/turns = 4 var/playing = 0 var/gameover = 0 var/alive = 4 var/eventdat = null var/event = null var/list/settlers = list("Harry","Larry","Bob") var/list/events = list(ORION_TRAIL_RAIDERS = 3, ORION_TRAIL_FLUX = 1, ORION_TRAIL_ILLNESS = 3, ORION_TRAIL_BREAKDOWN = 2, ORION_TRAIL_LING = 3, ORION_TRAIL_MALFUNCTION = 2, ORION_TRAIL_COLLISION = 1, ORION_TRAIL_SPACEPORT = 2 ) var/list/stops = list() var/list/stopblurbs = list() var/lings_aboard = 0 var/spaceport_raided = 0 var/spaceport_freebie = 0 var/last_spaceport_action = "" /obj/machinery/computer/arcade/orion_trail/Reset() // Sets up the main trail stops = list("Pluto","Asteroid Belt","Proxima Centauri","Dead Space","Rigel Prime","Tau Ceti Beta","Black Hole","Space Outpost Beta-9","Orion Prime") stopblurbs = list( "Pluto, long since occupied with long-range sensors and scanners, stands ready to, and indeed continues to probe the far reaches of the galaxy.", "At the edge of the Sol system lies a treacherous asteroid belt. Many have been crushed by stray asteroids and misguided judgement.", "The nearest star system to Sol, in ages past it stood as a reminder of the boundaries of sub-light travel, now a low-population sanctuary for adventurers and traders.", "This region of space is particularly devoid of matter. Such low-density pockets are known to exist, but the vastness of it is astounding.", "Rigel Prime, the center of the Rigel system, burns hot, basking its planetary bodies in warmth and radiation.", "Tau Ceti Beta has recently become a waypoint for colonists headed towards Orion. There are many ships and makeshift stations in the vicinity.", "Sensors indicate that a black hole's gravitational field is affecting the region of space we were headed through. We could stay of course, but risk of being overcome by its gravity, or we could change course to go around, which will take longer.", "You have come into range of the first man-made structure in this region of space. It has been constructed not by travellers from Sol, but by colonists from Orion. It stands as a monument to the colonists' success.", "You have made it to Orion! Congratulations! Your crew is one of the few to start a new foothold for mankind!" ) /obj/machinery/computer/arcade/orion_trail/proc/newgame() // Set names of settlers in crew settlers = list() for(var/i = 1; i <= 3; i++) add_crewmember() add_crewmember("[usr]") // Re-set items to defaults engine = 1 hull = 1 electronics = 1 food = 80 fuel = 60 alive = 4 turns = 1 event = null playing = 1 gameover = 0 lings_aboard = 0 //spaceport junk spaceport_raided = 0 spaceport_freebie = 0 last_spaceport_action = "" /obj/machinery/computer/arcade/orion_trail/attack_hand(mob/user) if(..()) return if(fuel <= 0 || food <=0 || length(settlers) == 0) gameover = 1 event = null user.set_machine(src) var/dat = "" if(gameover) dat = "
Crew Management:
" //Buy crew if(food > 10 && fuel > 10) eventdat += "Hire a new Crewmember (-10FU,-10FO)
" else eventdat += "Cant afford a new Crewmember
" //Sell crew if(length(settlers) > 1) eventdat += "Sell crew for Fuel and Food (+7FU,+7FO)
" else eventdat += "Cant afford to sell a Crewmember
" //BUY/SELL STUFF eventdat += "Spare Parts:
" //Engine parts if(fuel > 5) eventdat += "" else eventdat += "Cant afford to buy Engine Parts" //Hull plates if(fuel > 5) eventdat += "
" else eventdat += "Cant afford to buy Hull Plates" //Electronics if(fuel > 5) eventdat += "
" else eventdat += "Cant afford to buy Spare Electronics" //Trade if(fuel > 5) eventdat += "
Trade Fuel for Food (-5FU,+5FO)
" else eventdat += "Cant afford to Trade Fuel for Food
5) eventdat += "Trade Food for Fuel (+5FU,-5FO)
" else eventdat += "Cant afford to Trade Food for Fuel
!! Raid Spaceport !!" eventdat += "" //Add Random/Specific crewmember /obj/machinery/computer/arcade/orion_trail/proc/add_crewmember(specific = "") var/newcrew = "" if(specific) newcrew = specific else if(prob(50)) newcrew = pick(GLOB.first_names_male) else newcrew = pick(GLOB.first_names_female) if(newcrew) settlers += newcrew alive++ return newcrew //Remove Random/Specific crewmember /obj/machinery/computer/arcade/orion_trail/proc/remove_crewmember(specific = "", dont_remove = "") var/list/safe2remove = settlers var/removed = "" if(dont_remove) safe2remove -= dont_remove if(specific && specific != dont_remove) safe2remove = list(specific) else if(length(safe2remove) >= 1) //need to make sure we even have anyone to remove removed = pick(safe2remove) if(removed) if(lings_aboard && prob(40*lings_aboard)) //if there are 2 lings you're twice as likely to get one, obviously lings_aboard = max(0,--lings_aboard) settlers -= removed alive-- return removed /obj/machinery/computer/arcade/orion_trail/proc/win() playing = 0 turns = 1 atom_say("Congratulations, you made it to Orion!") if(emagged) new /obj/item/orion_ship(get_turf(src)) message_admins("[key_name_admin(usr)] made it to Orion on an emagged machine and got an explosive toy ship.") log_game("[key_name(usr)] made it to Orion on an emagged machine and got an explosive toy ship.") else var/score = 10 * (alive - lings_aboard) + 5 * (engine + hull + electronics) prizevend(score) emagged = FALSE name = "The Orion Trail" desc = "Learn how our ancestors got to Orion, and have fun in the process!" /obj/machinery/computer/arcade/orion_trail/emag_act(mob/user) if(!emagged) to_chat(user, SPAN_NOTICE("You override the cheat code menu and skip to Cheat #[rand(1, 50)]: Realism Mode.")) name = "The Orion Trail: Realism Edition" desc = "Learn how our ancestors got to Orion, and try not to die in the process!" add_hiddenprint(user) newgame() emagged = TRUE return TRUE /mob/living/simple_animal/hostile/syndicate/ranged/orion name = "spaceport security" desc = "Premier corporate security forces for all spaceports found along the Orion Trail." faction = list("orion") loot = list() /obj/item/orion_ship name = "model settler ship" desc = "A model spaceship, it looks like those used back in the day when travelling to Orion! It even has a miniature FX-293 reactor, which was renowned for its instability and tendency to explode..." icon = 'icons/obj/toy.dmi' icon_state = "ship" w_class = WEIGHT_CLASS_SMALL var/active = FALSE //if the ship is on /obj/item/orion_ship/examine(mob/user) . = ..() if(in_range(user, src)) if(!active) . += SPAN_NOTICE("There's a little switch on the bottom. It's flipped down.") else . += SPAN_NOTICE("There's a little switch on the bottom. It's flipped up.") /obj/item/orion_ship/attack_self__legacy__attackchain(mob/user) //Minibomb-level explosion. Should probably be more because of how hard it is to survive the machine! Also, just over a 5-second fuse if(active) return message_admins("[key_name_admin(usr)] primed an explosive Orion ship for detonation.") log_game("[key_name(usr)] primed an explosive Orion ship for detonation.") to_chat(user, SPAN_WARNING("You flip the switch on the underside of [src].")) active = TRUE visible_message(SPAN_NOTICE("[src] softly beeps and whirs to life!")) playsound(loc, 'sound/machines/defib_saftyon.ogg', 25, TRUE) atom_say("This is ship ID #[rand(1,1000)] to Orion Port Authority. We're coming in for landing, over.") sleep(20) visible_message(SPAN_WARNING("[src] begins to vibrate...")) atom_say("Uh, Port? Having some issues with our reactor, could you check it out? Over.") sleep(30) atom_say("Oh, God! Code Eight! CODE EIGHT! IT'S GONNA BL-") playsound(loc, 'sound/machines/buzz-sigh.ogg', 25, TRUE) sleep(3.6) visible_message(SPAN_USERDANGER("[src] explodes!")) explosion(src.loc, 1,2,4, flame_range = 3, cause = "Orion Ship Minibomb") qdel(src) #undef ORION_TRAIL_WINTURN #undef ORION_TRAIL_RAIDERS #undef ORION_TRAIL_FLUX #undef ORION_TRAIL_ILLNESS #undef ORION_TRAIL_BREAKDOWN #undef ORION_TRAIL_LING #undef ORION_TRAIL_LING_ATTACK #undef ORION_TRAIL_MALFUNCTION #undef ORION_TRAIL_COLLISION #undef ORION_TRAIL_SPACEPORT #undef ORION_TRAIL_BLACKHOLE