diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm
index 64dc272d084..e165b51f680 100644
--- a/_maps/map_files/MetaStation/MetaStation.dmm
+++ b/_maps/map_files/MetaStation/MetaStation.dmm
@@ -60470,7 +60470,7 @@
pixel_y = 6
},
/obj/structure/table/wood,
-/obj/item/toy/AI{
+/obj/item/toy/talking/AI{
name = "NanoTrasen-brand toy AI";
pixel_y = 6
},
diff --git a/_maps/map_files/generic/z2.dmm b/_maps/map_files/generic/z2.dmm
index fda763709db..83ac1904f6a 100644
--- a/_maps/map_files/generic/z2.dmm
+++ b/_maps/map_files/generic/z2.dmm
@@ -2716,7 +2716,7 @@
/area/centcom/evac)
"io" = (
/obj/structure/table/reinforced,
-/obj/item/toy/AI,
+/obj/item/toy/talking/AI,
/obj/structure/window/reinforced{
dir = 4
},
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index 253a3c1c8d7..7f80531c354 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -1,1115 +1,1111 @@
-/obj/machinery/computer/arcade/
- name = "random arcade"
- desc = "random arcade machine"
- icon_state = "arcade"
- icon_keyboard = null
- icon_screen = "invaders"
- var/list/prizes = list( /obj/item/weapon/storage/box/snappops = 2,
- /obj/item/toy/AI = 2,
- /obj/item/toy/codex_gigas = 2,
- /obj/item/clothing/under/syndicate/tacticool = 2,
- /obj/item/toy/sword = 2,
- /obj/item/toy/gun = 2,
- /obj/item/weapon/gun/projectile/shotgun/toy/crossbow = 2,
- /obj/item/weapon/storage/box/fakesyndiesuit = 2,
- /obj/item/weapon/storage/crayons = 2,
- /obj/item/toy/spinningtoy = 2,
- /obj/item/toy/prize/ripley = 1,
- /obj/item/toy/prize/fireripley = 1,
- /obj/item/toy/prize/deathripley = 1,
- /obj/item/toy/prize/gygax = 1,
- /obj/item/toy/prize/durand = 1,
- /obj/item/toy/prize/honk = 1,
- /obj/item/toy/prize/marauder = 1,
- /obj/item/toy/prize/seraph = 1,
- /obj/item/toy/prize/mauler = 1,
- /obj/item/toy/prize/odysseus = 1,
- /obj/item/toy/prize/phazon = 1,
- /obj/item/toy/prize/reticence = 1,
- /obj/item/toy/cards/deck = 2,
- /obj/item/toy/nuke = 2,
- /obj/item/toy/minimeteor = 2,
- /obj/item/toy/carpplushie = 2,
- /obj/item/toy/foamblade = 2,
- /obj/item/toy/redbutton = 2,
- /obj/item/toy/talking/owl = 2,
- /obj/item/toy/talking/griffin = 2,
- /obj/item/weapon/coin/antagtoken = 2,
- /obj/item/stack/tile/fakespace/loaded = 2,
- /obj/item/toy/toy_xeno = 2,
- /obj/item/weapon/restraints/handcuffs/fake = 2
- )
-
-/obj/machinery/computer/arcade/New()
- ..()
- // If it's a generic arcade machine, pick a random arcade
- // circuit board for it and make the new machine
- if(!circuit)
- var/choice = pick(subtypesof(/obj/item/weapon/circuitboard/computer/arcade))
- var/obj/item/weapon/circuitboard/CB = new choice()
- new CB.build_path(loc, CB)
- qdel(src)
-
-/obj/machinery/computer/arcade/proc/prizevend()
- if(prob(0.0001)) //1 in a million
- new /obj/item/weapon/gun/energy/pulse(src)
-
- if(!contents.len)
- var/prizeselect = pickweight(prizes)
- new prizeselect(src.loc)
-
- if(istype(prizeselect, /obj/item/toy/gun)) //Ammo comes with the gun
- new /obj/item/toy/ammo/gun(src.loc)
-
- else if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit
- new /obj/item/clothing/head/syndicatefake(src.loc)
-
- else
- var/atom/movable/prize = pick(contents)
- prize.loc = src.loc
-
-/obj/machinery/computer/arcade/emp_act(severity)
- ..(severity)
-
- if(stat & (NOPOWER|BROKEN))
- 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--)
- empprize = pickweight(prizes)
- new empprize(src.loc)
- explosion(src.loc, -1, 0, 1+num_of_prizes, flame_range = 1+num_of_prizes)
-
-
-// ** BATTLE ** //
-
-
-/obj/machinery/computer/arcade/battle
- name = "arcade machine"
- desc = "Does not support Pinball."
- icon_state = "arcade"
- circuit = /obj/item/weapon/circuitboard/computer/arcade/battle
- var/enemy_name = "Space Villian"
- var/temp = "Winners don't use space drugs" //Temporary message, for attack messages, etc
- var/player_hp = 30 //Player health/attack points
- var/player_mp = 10
- var/enemy_hp = 45 //Enemy health/attack points
- var/enemy_mp = 20
- var/gameover = 0
- var/blocked = 0 //Player cannot attack/heal while set
- var/turtle = 0
-
-/obj/machinery/computer/arcade/battle/New()
- ..()
- var/name_action
- var/name_part1
- var/name_part2
-
- name_action = pick("Defeat ", "Annihilate ", "Save ", "Strike ", "Stop ", "Destroy ", "Robust ", "Romance ", "Pwn ", "Own ", "Ban ")
-
- name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Cuban ", "the Evil ", "the Dread King ", "the Space ", "Lord ", "the Great ", "Duke ", "General ")
- name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "slime", "Griefer", "ERPer", "Lizard Man", "Unicorn", "Bloopers")
-
- src.enemy_name = replacetext((name_part1 + name_part2), "the ", "")
- src.name = (name_action + name_part1 + name_part2)
-
-/obj/machinery/computer/arcade/battle/attack_hand(mob/user)
- if(..())
- return
- user.set_machine(src)
- var/dat = "Close"
- dat += "
[src.enemy_name]
"
-
- dat += "
[src.temp]
"
- dat += "
Health: [src.player_hp] | Magic: [src.player_mp] | Enemy Health: [src.enemy_hp]"
-
- if (src.gameover)
- dat += "New Game"
- else
- dat += "Attack | "
- dat += "Heal | "
- dat += "Recharge Power"
-
- dat += ""
-
- //user << browse(dat, "window=arcade")
- //onclose(user, "arcade")
- var/datum/browser/popup = new(user, "arcade", "Space Villian 2000")
- popup.set_content(dat)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
- return
-
-/obj/machinery/computer/arcade/battle/Topic(href, href_list)
- if(..())
- return
-
- if (!src.blocked && !src.gameover)
- if (href_list["attack"])
- src.blocked = 1
- var/attackamt = rand(2,6)
- src.temp = "You attack for [attackamt] damage!"
- playsound(src.loc, 'sound/arcade/Hit.ogg', 50, 1, extrarange = -3, falloff = 10)
- src.updateUsrDialog()
- if(turtle > 0)
- turtle--
-
- sleep(10)
- src.enemy_hp -= attackamt
- src.arcade_action()
-
- else if (href_list["heal"])
- src.blocked = 1
- var/pointamt = rand(1,3)
- var/healamt = rand(6,8)
- src.temp = "You use [pointamt] magic to heal for [healamt] damage!"
- playsound(src.loc, 'sound/arcade/Heal.ogg', 50, 1, extrarange = -3, falloff = 10)
- src.updateUsrDialog()
- turtle++
-
- sleep(10)
- src.player_mp -= pointamt
- src.player_hp += healamt
- src.blocked = 1
- src.updateUsrDialog()
- src.arcade_action()
-
- else if (href_list["charge"])
- src.blocked = 1
- var/chargeamt = rand(4,7)
- src.temp = "You regain [chargeamt] points"
- playsound(src.loc, 'sound/arcade/Mana.ogg', 50, 1, extrarange = -3, falloff = 10)
- src.player_mp += chargeamt
- if(turtle > 0)
- turtle--
-
- src.updateUsrDialog()
- sleep(10)
- src.arcade_action()
-
- if (href_list["close"])
- usr.unset_machine()
- usr << browse(null, "window=arcade")
-
- else if (href_list["newgame"]) //Reset everything
- temp = "New Round"
- player_hp = 30
- player_mp = 10
- enemy_hp = 45
- enemy_mp = 20
- gameover = 0
- turtle = 0
-
- if(emagged)
- src.New()
- emagged = 0
-
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- return
-
-/obj/machinery/computer/arcade/battle/proc/arcade_action()
- if ((src.enemy_mp <= 0) || (src.enemy_hp <= 0))
- if(!gameover)
- src.gameover = 1
- src.temp = "[src.enemy_name] has fallen! Rejoice!"
- playsound(src.loc, 'sound/arcade/Win.ogg', 50, 1, extrarange = -3, falloff = 10)
-
- if(emagged)
- feedback_inc("arcade_win_emagged")
- new /obj/effect/spawner/newbomb/timer/syndicate(src.loc)
- new /obj/item/clothing/head/collectable/petehat(src.loc)
- 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.")
- src.New()
- emagged = 0
- else
- feedback_inc("arcade_win_normal")
- prizevend()
-
- else if (emagged && (turtle >= 4))
- var/boomamt = rand(5,10)
- src.temp = "[src.enemy_name] throws a bomb, exploding you for [boomamt] damage!"
- playsound(src.loc, 'sound/arcade/Boom.ogg', 50, 1, extrarange = -3, falloff = 10)
- src.player_hp -= boomamt
-
- else if ((src.enemy_mp <= 5) && (prob(70)))
- var/stealamt = rand(2,3)
- src.temp = "[src.enemy_name] steals [stealamt] of your power!"
- playsound(src.loc, 'sound/arcade/Steal.ogg', 50, 1, extrarange = -3, falloff = 10)
- src.player_mp -= stealamt
- src.updateUsrDialog()
-
- if (src.player_mp <= 0)
- src.gameover = 1
- sleep(10)
- src.temp = "You have been drained! GAME OVER"
- playsound(src.loc, 'sound/arcade/Lose.ogg', 50, 1, extrarange = -3, falloff = 10)
- if(emagged)
- feedback_inc("arcade_loss_mana_emagged")
- usr.gib()
- else
- feedback_inc("arcade_loss_mana_normal")
-
- else if ((src.enemy_hp <= 10) && (src.enemy_mp > 4))
- src.temp = "[src.enemy_name] heals for 4 health!"
- playsound(src.loc, 'sound/arcade/Heal.ogg', 50, 1, extrarange = -3, falloff = 10)
- src.enemy_hp += 4
- src.enemy_mp -= 4
-
- else
- var/attackamt = rand(3,6)
- src.temp = "[src.enemy_name] attacks for [attackamt] damage!"
- playsound(src.loc, 'sound/arcade/Hit.ogg', 50, 1, extrarange = -3, falloff = 10)
- src.player_hp -= attackamt
-
- if ((src.player_mp <= 0) || (src.player_hp <= 0))
- src.gameover = 1
- src.temp = "You have been crushed! GAME OVER"
- playsound(src.loc, 'sound/arcade/Lose.ogg', 50, 1, extrarange = -3, falloff = 10)
- if(emagged)
- feedback_inc("arcade_loss_hp_emagged")
- usr.gib()
- else
- feedback_inc("arcade_loss_hp_normal")
-
- src.blocked = 0
- return
-
-
-/obj/machinery/computer/arcade/battle/emag_act(mob/user)
- if(!emagged)
- temp = "If you die in the game, you die for real!"
- player_hp = 30
- player_mp = 10
- enemy_hp = 45
- enemy_mp = 20
- gameover = 0
- blocked = 0
-
- emagged = 1
-
- enemy_name = "Cuban Pete"
- name = "Outbomb Cuban Pete"
-
-
- src.updateUsrDialog()
-
-
-
-// *** 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"
-
-#define ORION_STATUS_START 1
-#define ORION_STATUS_NORMAL 2
-#define ORION_STATUS_GAMEOVER 3
-#define ORION_STATUS_MARKET 4
-
-/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_state = "arcade"
- circuit = /obj/item/weapon/circuitboard/computer/arcade/orion_trail
- var/busy = 0 //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/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 = ""
- var/gameStatus = ORION_STATUS_START
- var/canContinueEvent = 0
-
-/obj/machinery/computer/arcade/orion_trail/New()
- ..()
- // 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
- gameStatus = ORION_STATUS_NORMAL
- 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 || settlers.len == 0)
- gameStatus = ORION_STATUS_GAMEOVER
- event = null
- user.set_machine(src)
- var/dat = ""
- if(gameStatus == ORION_STATUS_GAMEOVER)
- dat = "Game Over
"
- dat += "Like many before you, your crew never made it to Orion, lost to space...
Forever."
- if(settlers.len == 0)
- dat += "
Your entire crew died, your ship joins the fleet of ghost-ships littering the galaxy."
- else
- if(food <= 0)
- dat += "
You ran out of food and starved."
- if(emagged)
- user.nutrition = 0 //yeah you pretty hongry
- user << "Your body instantly contracts to that of one who has not eaten in months. Agonizing cramps seize you as you fall to the floor."
- if(fuel <= 0)
- dat += "
You ran out of fuel, and drift, slowly, into a star."
- if(emagged)
- var/mob/living/M = user
- M.adjust_fire_stacks(5)
- M.IgniteMob() //flew into a star, so you're on fire
- user << "You feel an immense wave of heat emanate from the arcade machine. Your skin bursts into flames."
- dat += "
OK...
"
-
- if(emagged)
- user << "You're never going to make it to Orion..."
- user.death()
- emagged = 0 //removes the emagged status after you lose
- gameStatus = ORION_STATUS_START
- name = "The Orion Trail"
- desc = "Learn how our ancestors got to Orion, and have fun in the process!"
-
- else if(event)
- dat = eventdat
- else if(gameStatus == ORION_STATUS_NORMAL)
- var/title = stops[turns]
- var/subtext = stopblurbs[turns]
- dat = "[title]
"
- dat += "[subtext]"
- dat += "Crew:
"
- dat += english_list(settlers)
- dat += "
Food: [food] | Fuel: [fuel]"
- dat += "
Engine Parts: [engine] | Hull Panels: [hull] | Electronics: [electronics]"
- if(turns == 7)
- dat += "Go Around Continue
"
- else
- dat += "Continue
"
- dat += "Kill a crewmember
"
- dat += "Close
"
- else
- dat = "The Orion Trail
"
- dat += "
Experience the journey of your ancestors!
"
- dat += "New Game"
- dat += "Close
"
- var/datum/browser/popup = new(user, "arcade", "The Orion Trail",400,700)
- popup.set_content(dat)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
- return
-
-/obj/machinery/computer/arcade/orion_trail/Topic(href, href_list)
- if(..())
- return
- if(href_list["close"])
- usr.unset_machine()
- usr << browse(null, "window=arcade")
-
- if(busy)
- return
- busy = 1
-
- if (href_list["continue"]) //Continue your travels
- if(gameStatus == ORION_STATUS_NORMAL && !event && turns != 7)
- if(turns >= ORION_TRAIL_WINTURN)
- win()
- else
- food -= (alive+lings_aboard)*2
- fuel -= 5
- if(turns == 2 && prob(30))
- event = ORION_TRAIL_COLLISION
- event()
- else if(prob(75))
- event = pickweight(events)
- if(lings_aboard)
- if(event == ORION_TRAIL_LING || prob(55))
- event = ORION_TRAIL_LING_ATTACK
- event()
- turns += 1
- if(emagged)
- var/mob/living/carbon/M = usr //for some vars
- switch(event)
- if(ORION_TRAIL_RAIDERS)
- if(prob(50))
- usr << "You hear battle shouts. The tramping of boots on cold metal. Screams of agony. The rush of venting air. Are you going insane?"
- M.hallucination += 30
- else
- usr << "Something strikes you from behind! It hurts like hell and feel like a blunt weapon, but nothing is there..."
- M.take_organ_damage(30)
- playsound(loc, 'sound/weapons/genhit2.ogg', 100, 1)
- if(ORION_TRAIL_ILLNESS)
- var/severity = rand(1,3) //pray to RNGesus. PRAY, PIGS
- if(severity == 1)
- M << "You suddenly feel slightly nauseous." //got off lucky
- if(severity == 2)
- usr << "You suddenly feel extremely nauseous and hunch over until it passes."
- M.Stun(3)
- if(severity >= 3) //you didn't pray hard enough
- M << "An overpowering wave of nausea consumes over you. You hunch over, your stomach's contents preparing for a spectacular exit."
- M.Stun(5)
- sleep(30)
- M.vomit(50)
- if(ORION_TRAIL_FLUX)
- if(prob(75))
- M.Weaken(3)
- say("A sudden gust of powerful wind slams [M] into the floor!")
- M.take_organ_damage(25)
- playsound(src.loc, 'sound/weapons/Genhit.ogg', 100, 1)
- else
- M << "A violent gale blows past you, and you barely manage to stay standing!"
- if(ORION_TRAIL_COLLISION) //by far the most damaging event
- if(prob(90))
- playsound(src.loc, 'sound/effects/bang.ogg', 100, 1)
- var/turf/open/floor/F
- for(F in orange(1, src))
- F.ChangeTurf(F.baseturf)
- say("Something slams into the floor around [src], exposing it to space!")
- if(hull)
- sleep(10)
- say("A new floor suddenly appears around [src]. What the hell?")
- playsound(src.loc, 'sound/weapons/Genhit.ogg', 100, 1)
- var/turf/open/space/T
- for(T in orange(1, src))
- T.ChangeTurf(/turf/open/floor/plating/)
- else
- say("Something slams into the floor around [src] - luckily, it didn't get through!")
- playsound(src.loc, 'sound/effects/bang.ogg', 50, 1)
- if(ORION_TRAIL_MALFUNCTION)
- playsound(src.loc, 'sound/effects/EMPulse.ogg', 50, 1)
- src.visible_message("[src] malfunctions, randomizing in-game stats!")
- var/oldfood = food
- var/oldfuel = fuel
- food = rand(10,80) / rand(1,2)
- fuel = rand(10,60) / rand(1,2)
- if(electronics)
- sleep(10)
- if(oldfuel > fuel && oldfood > food)
- src.audible_message("[src] lets out a somehow reassuring chime.")
- else if(oldfuel < fuel || oldfood < food)
- src.audible_message("[src] lets out a somehow ominous chime.")
- food = oldfood
- fuel = oldfuel
- playsound(src.loc, 'sound/machines/chime.ogg', 50, 1)
-
- else if(href_list["newgame"]) //Reset everything
- if(gameStatus == ORION_STATUS_START)
- newgame()
- else if(href_list["menu"]) //back to the main menu
- if(gameStatus == ORION_STATUS_GAMEOVER)
- gameStatus = ORION_STATUS_START
- event = null
- food = 80
- fuel = 60
- settlers = list("Harry","Larry","Bob")
- else if(href_list["slow"]) //slow down
- if(event == ORION_TRAIL_FLUX)
- food -= (alive+lings_aboard)*2
- fuel -= 5
- event = null
- else if(href_list["pastblack"]) //slow down
- if(turns == 7)
- food -= ((alive+lings_aboard)*2)*3
- fuel -= 15
- turns += 1
- event = null
- else if(href_list["useengine"]) //use parts
- if(event == ORION_TRAIL_BREAKDOWN)
- engine = max(0, --engine)
- event = null
- else if(href_list["useelec"]) //use parts
- if(event == ORION_TRAIL_MALFUNCTION)
- electronics = max(0, --electronics)
- event = null
- else if(href_list["usehull"]) //use parts
- if(event == ORION_TRAIL_COLLISION)
- hull = max(0, --hull)
- event = null
- else if(href_list["wait"]) //wait 3 days
- if(event == ORION_TRAIL_BREAKDOWN || event == ORION_TRAIL_MALFUNCTION || event == ORION_TRAIL_COLLISION)
- food -= ((alive+lings_aboard)*2)*3
- event = null
- else if(href_list["keepspeed"]) //keep speed
- if(event == ORION_TRAIL_FLUX)
- if(prob(75))
- event = "Breakdown"
- event()
- else
- event = null
- else if(href_list["blackhole"]) //keep speed past a black hole
- if(turns == 7)
- if(prob(75))
- event = ORION_TRAIL_BLACKHOLE
- event()
- if(emagged) //has to be here because otherwise it doesn't work
- playsound(src.loc, 'sound/effects/supermatter.ogg', 100, 1)
- say("A miniature black hole suddenly appears in front of [src], devouring [usr] alive!")
- usr.Stun(10) //you can't run :^)
- var/S = new /obj/singularity/academy(usr.loc)
- emagged = 0 //immediately removes emagged status so people can't kill themselves by sprinting up and interacting
- sleep(50)
- say("[S] winks out, just as suddenly as it appeared.")
- qdel(S)
- else
- event = null
- turns += 1
- else if(href_list["holedeath"])
- if(event == ORION_TRAIL_BLACKHOLE)
- gameStatus = ORION_STATUS_GAMEOVER
- event = null
- else if(href_list["eventclose"]) //end an event
- if(canContinueEvent)
- event = null
-
- else if(href_list["killcrew"]) //shoot a crewmember
- if(gameStatus == ORION_STATUS_NORMAL || event == ORION_TRAIL_LING)
- var/sheriff = remove_crewmember() //I shot the sheriff
- playsound(loc,'sound/weapons/Gunshot.ogg', 100, 1)
-
- if(settlers.len == 0 || alive == 0)
- say("The last crewmember [sheriff], shot themselves, GAME OVER!")
- if(emagged)
- usr.death(0)
- emagged = 0
- gameStatus = ORION_STATUS_GAMEOVER
- event = null
- else if(emagged)
- if(usr.name == sheriff)
- say("The crew of the ship chose to kill [usr.name]!")
- usr.death(0)
-
- if(event == ORION_TRAIL_LING) //only ends the ORION_TRAIL_LING event, since you can do this action in multiple places
- event = null
-
- //Spaceport specific interactions
- //they get a header because most of them don't reset event (because it's a shop, you leave when you want to)
- //they also call event() again, to regen the eventdata, which is kind of odd but necessary
- else if(href_list["buycrew"]) //buy a crewmember
- if(gameStatus == ORION_STATUS_MARKET)
- if(!spaceport_raided && food >= 10 && fuel >= 10)
- var/bought = add_crewmember()
- last_spaceport_action = "You hired [bought] as a new crewmember."
- fuel -= 10
- food -= 10
- event()
-
- else if(href_list["sellcrew"]) //sell a crewmember
- if(gameStatus == ORION_STATUS_MARKET)
- if(!spaceport_raided && settlers.len > 1)
- var/sold = remove_crewmember()
- last_spaceport_action = "You sold your crewmember, [sold]!"
- fuel += 7
- food += 7
- event()
-
- else if(href_list["leave_spaceport"])
- if(gameStatus == ORION_STATUS_MARKET)
- event = null
- gameStatus = ORION_STATUS_NORMAL
- spaceport_raided = 0
- spaceport_freebie = 0
- last_spaceport_action = ""
-
- else if(href_list["raid_spaceport"])
- if(gameStatus == ORION_STATUS_MARKET)
- if(!spaceport_raided)
- var/success = min(15 * alive,100) //default crew (4) have a 60% chance
- spaceport_raided = 1
-
- var/FU = 0
- var/FO = 0
- if(prob(success))
- FU = rand(5,15)
- FO = rand(5,15)
- last_spaceport_action = "You successfully raided the spaceport! you gained [FU] Fuel and [FO] Food! (+[FU]FU,+[FO]FO)"
- else
- FU = rand(-5,-15)
- FO = rand(-5,-15)
- last_spaceport_action = "You failed to raid the spaceport! you lost [FU*-1] Fuel and [FO*-1] Food in your scramble to escape! ([FU]FU,[FO]FO)"
-
- //your chance of lose a crewmember is 1/2 your chance of success
- //this makes higher % failures hurt more, don't get cocky space cowboy!
- if(prob(success*5))
- var/lost_crew = remove_crewmember()
- last_spaceport_action = "You failed to raid the spaceport! you lost [FU*-1] Fuel and [FO*-1] Food, AND [lost_crew] in your scramble to escape! ([FU]FI,[FO]FO,-Crew)"
- if(emagged)
- say("WEEWOO WEEWOO, Spaceport Security en route!")
- for(var/i, i<=3, i++)
- var/mob/living/simple_animal/hostile/syndicate/ranged/orion/O = new/mob/living/simple_animal/hostile/syndicate/ranged/orion(get_turf(src))
- O.target = usr
-
-
- fuel += FU
- food += FO
- event()
-
- else if(href_list["buyparts"])
- if(gameStatus == ORION_STATUS_MARKET)
- if(!spaceport_raided && fuel > 5)
- switch(text2num(href_list["buyparts"]))
- if(1) //Engine Parts
- engine++
- last_spaceport_action = "Bought Engine Parts"
- if(2) //Hull Plates
- hull++
- last_spaceport_action = "Bought Hull Plates"
- if(3) //Spare Electronics
- electronics++
- last_spaceport_action = "Bought Spare Electronics"
- fuel -= 5 //they all cost 5
- event()
-
- else if(href_list["trade"])
- if(gameStatus == ORION_STATUS_MARKET)
- if(!spaceport_raided)
- switch(text2num(href_list["trade"]))
- if(1) //Fuel
- if(fuel > 5)
- fuel -= 5
- food += 5
- last_spaceport_action = "Traded Fuel for Food"
- event()
- if(2) //Food
- if(food > 5)
- fuel += 5
- food -= 5
- last_spaceport_action = "Traded Food for Fuel"
- event()
-
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- busy = 0
- return
-
-
-/obj/machinery/computer/arcade/orion_trail/proc/event()
- eventdat = "[event]
"
- canContinueEvent = 0
- switch(event)
- if(ORION_TRAIL_RAIDERS)
- eventdat += "Raiders have come aboard your ship!"
- if(prob(50))
- var/sfood = rand(1,10)
- var/sfuel = rand(1,10)
- food -= sfood
- fuel -= sfuel
- eventdat += "
They have stolen [sfood] Food and [sfuel] Fuel."
- else if(prob(10))
- var/deadname = remove_crewmember()
- eventdat += "
[deadname] tried to fight back but was killed."
- else
- eventdat += "
Fortunately you fended them off without any trouble."
- eventdat += "Continue
"
- eventdat += "Close
"
- canContinueEvent = 1
-
- if(ORION_TRAIL_FLUX)
- eventdat += "This region of space is highly turbulent.
If we go slowly we may avoid more damage, but if we keep our speed we won't waste supplies."
- eventdat += "
What will you do?"
- eventdat += "Slow Down Continue
"
- eventdat += "Close
"
-
- if(ORION_TRAIL_ILLNESS)
- eventdat += "A deadly illness has been contracted!"
- var/deadname = remove_crewmember()
- eventdat += "
[deadname] was killed by the disease."
- eventdat += "Continue
"
- eventdat += "Close
"
- canContinueEvent = 1
-
- if(ORION_TRAIL_BREAKDOWN)
- eventdat += "Oh no! The engine has broken down!"
- eventdat += "
You can repair it with an engine part, or you can make repairs for 3 days."
- if(engine >= 1)
- eventdat += "Use PartWait
"
- else
- eventdat += "Wait
"
- eventdat += "Close
"
-
- if(ORION_TRAIL_MALFUNCTION)
- eventdat += "The ship's systems are malfunctioning!"
- eventdat += "
You can replace the broken electronics with spares, or you can spend 3 days troubleshooting the AI."
- if(electronics >= 1)
- eventdat += "Use PartWait
"
- else
- eventdat += "Wait
"
- eventdat += "Close
"
-
- if(ORION_TRAIL_COLLISION)
- eventdat += "Something hit us! Looks like there's some hull damage."
- if(prob(25))
- var/sfood = rand(5,15)
- var/sfuel = rand(5,15)
- food -= sfood
- fuel -= sfuel
- eventdat += "
[sfood] Food and [sfuel] Fuel was vented out into space."
- if(prob(10))
- var/deadname = remove_crewmember()
- eventdat += "
[deadname] was killed by rapid depressurization."
- eventdat += "
You can repair the damage with hull plates, or you can spend the next 3 days welding scrap together."
- if(hull >= 1)
- eventdat += "Use PartWait
"
- else
- eventdat += "Wait
"
- eventdat += "Close
"
-
- if(ORION_TRAIL_BLACKHOLE)
- eventdat += "You were swept away into the black hole."
- eventdat += "Oh...
"
- eventdat += "Close
"
- settlers = list()
-
- if(ORION_TRAIL_LING)
- eventdat += "Strange reports warn of changelings infiltrating crews on trips to Orion..."
- if(settlers.len <= 2)
- eventdat += "
Your crew's chance of reaching Orion is so slim the changelings likely avoided your ship..."
- eventdat += "Continue
"
- eventdat += "Close
"
- if(prob(10)) // "likely", I didn't say it was guaranteed!
- lings_aboard = min(++lings_aboard,2)
- else
- if(lings_aboard) //less likely to stack lings
- if(prob(20))
- lings_aboard = min(++lings_aboard,2)
- else if(prob(70))
- lings_aboard = min(++lings_aboard,2)
-
- eventdat += "Kill a crewmember
"
- eventdat += "Risk it
"
- eventdat += "Close
"
- canContinueEvent = 1
-
- if(ORION_TRAIL_LING_ATTACK)
- if(lings_aboard <= 0) //shouldn't trigger, but hey.
- eventdat += "Haha, fooled you, there are no changelings on board!"
- eventdat += "
(You should report this to a coder :S)"
- else
- var/ling1 = remove_crewmember()
- var/ling2 = ""
- if(lings_aboard >= 2)
- ling2 = remove_crewmember()
-
- eventdat += "Oh no, some of your crew are Changelings!"
- if(ling2)
- eventdat += "
[ling1] and [ling2]'s arms twist and contort into grotesque blades!"
- else
- eventdat += "
[ling1]'s arm twists and contorts into a grotesque blade!"
-
- var/chance2attack = alive*20
- if(prob(chance2attack))
- var/chancetokill = 30*lings_aboard-(5*alive) //eg: 30*2-(10) = 50%, 2 lings, 2 crew is 50% chance
- if(prob(chancetokill))
- var/deadguy = remove_crewmember()
- eventdat += "
The Changeling[ling2 ? "s":""] run[ling2 ? "":"s"] up to [deadguy] and capitulates them!"
- else
- eventdat += "
You valiantly fight off the Changeling[ling2 ? "s":""]!"
- eventdat += "
You cut the Changeling[ling2 ? "s":""] up into meat... Eww"
- if(ling2)
- food += 30
- lings_aboard = max(0,lings_aboard-2)
- else
- food += 15
- lings_aboard = max(0,--lings_aboard)
- else
- eventdat += "
The Changeling[ling2 ? "s":""] run[ling2 ? "":"s"] away, What wimps!"
- if(ling2)
- lings_aboard = max(0,lings_aboard-2)
- else
- lings_aboard = max(0,--lings_aboard)
-
- eventdat += "Continue
"
- eventdat += "Close
"
- canContinueEvent = 1
-
-
- if(ORION_TRAIL_SPACEPORT)
- gameStatus = ORION_STATUS_MARKET
- if(spaceport_raided)
- eventdat += "The Spaceport is on high alert! they wont let you dock since you tried to attack them!"
- if(last_spaceport_action)
- eventdat += "
Last Spaceport Action: [last_spaceport_action]"
- eventdat += "Depart Spaceport
"
- eventdat += "Close
"
- else
- eventdat += "You pull the ship up to dock at a nearby Spaceport, lucky find!"
- eventdat += "
This Spaceport is home to travellers who failed to reach Orion, but managed to find a different home..."
- eventdat += "
Trading terms: FU = Fuel, FO = Food"
- if(last_spaceport_action)
- eventdat += "
Last Spaceport Action: [last_spaceport_action]"
- eventdat += "Crew:
"
- eventdat += english_list(settlers)
- eventdat += "
Food: [food] | Fuel: [fuel]"
- eventdat += "
Engine Parts: [engine] | Hull Panels: [hull] | Electronics: [electronics]"
-
-
- //If your crew is pathetic you can get freebies (provided you haven't already gotten one from this port)
- if(!spaceport_freebie && (fuel < 20 || food < 20))
- spaceport_freebie++
- var/FU = 10
- var/FO = 10
- var/freecrew = 0
- if(prob(30))
- FU = 25
- FO = 25
-
- if(prob(10))
- add_crewmember()
- freecrew++
-
- eventdat += "
The traders of the spaceport take pitty on you, and give you some food and fuel (+[FU]FU,+[FO]FO)"
- if(freecrew)
- eventdat += "
You also gain a new crewmember!"
-
- fuel += FU
- food += FO
-
- //CREW INTERACTIONS
- eventdat += "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(settlers.len > 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 += "Buy Engine Parts (-5FU)
"
- else
- eventdat += "Cant afford to buy Engine Parts"
-
- //Hull plates
- if(fuel > 5)
- eventdat += "
Buy Hull Plates (-5FU)
"
- else
- eventdat += "Cant afford to buy Hull Plates"
-
- //Electronics
- if(fuel > 5)
- eventdat += "
Buy Spare Electronics (-5FU)
"
- 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 += "Depart Spaceport
"
-
-
-//Add Random/Specific crewmember
-/obj/machinery/computer/arcade/orion_trail/proc/add_crewmember(var/specific = "")
- var/newcrew = ""
- if(specific)
- newcrew = specific
- else
- if(prob(50))
- newcrew = pick(first_names_male)
- else
- newcrew = pick(first_names_female)
- if(newcrew)
- settlers += newcrew
- alive++
- return newcrew
-
-
-//Remove Random/Specific crewmember
-/obj/machinery/computer/arcade/orion_trail/proc/remove_crewmember(var/specific = "", var/dont_remove = "")
- var/list/safe2remove = settlers
- var/removed = ""
- if(dont_remove)
- safe2remove -= dont_remove
- if(specific && specific != dont_remove)
- safe2remove = list(specific)
- else
- 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()
- gameStatus = ORION_STATUS_START
- say("Congratulations, you made it to Orion!")
- if(emagged)
- new /obj/item/weapon/orion_ship(src.loc)
- 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
- prizevend()
- emagged = 0
- 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)
- user << "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!"
- newgame()
- emagged = 1
-
-/mob/living/simple_animal/hostile/syndicate/ranged/orion
- name = "Spaceport Security"
- desc = "The Premier security forces for all spaceports found along the Orion Trail."
- faction = list("orion")
- loot = list(/obj/effect/mob_spawn/human/corpse/orionsecurity,
- /obj/item/weapon/gun/projectile/automatic/c20r/unrestricted,
- /obj/item/weapon/shield/energy)
-
-/obj/effect/mob_spawn/human/corpse/orionsecurity
- name = "Spaceport Security"
- uniform = /obj/item/clothing/under/syndicate
- suit = /obj/item/clothing/suit/armor/vest
- shoes = /obj/item/clothing/shoes/combat
- gloves = /obj/item/clothing/gloves/combat
- radio = /obj/item/device/radio/headset
- mask = /obj/item/clothing/mask/gas
- helmet = /obj/item/clothing/head/helmet/swat
- back = /obj/item/weapon/storage/backpack
- has_id = 1
- id_job = "Officer"
- id_access = "Syndicate"
-
-/obj/item/weapon/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 = 2
- var/active = 0 //if the ship is on
-
-/obj/item/weapon/orion_ship/examine(mob/user)
- ..()
- if(!(in_range(user, src)))
- return
- if(!active)
- user << "There's a little switch on the bottom. It's flipped down."
- else
- user << "There's a little switch on the bottom. It's flipped up."
-
-/obj/item/weapon/orion_ship/attack_self(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.")
-
- user << "You flip the switch on the underside of [src]."
- active = 1
- src.visible_message("[src] softly beeps and whirs to life!")
- playsound(src.loc, 'sound/machines/defib_SaftyOn.ogg', 25, 1)
- say("This is ship ID #[rand(1,1000)] to Orion Port Authority. We're coming in for landing, over.")
- sleep(20)
- src.visible_message("[src] begins to vibrate...")
- say("Uh, Port? Having some issues with our reactor, could you check it out? Over.")
- sleep(30)
- say("Oh, God! Code Eight! CODE EIGHT! IT'S GONNA BL-")
- playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 25, 1)
- sleep(3.6)
- src.visible_message("[src] explodes!")
- explosion(src.loc, 2,4,8, flame_range = 16)
- 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
-
-#undef ORION_STATUS_START
-#undef ORION_STATUS_NORMAL
-#undef ORION_STATUS_GAMEOVER
-#undef ORION_STATUS_MARKET
+/obj/machinery/computer/arcade/
+ name = "random arcade"
+ desc = "random arcade machine"
+ icon_state = "arcade"
+ icon_keyboard = null
+ icon_screen = "invaders"
+ var/list/prizes = list(
+ /obj/item/weapon/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/weapon/gun/projectile/shotgun/toy/crossbow = 2,
+ /obj/item/weapon/storage/box/fakesyndiesuit = 2,
+ /obj/item/weapon/storage/crayons = 2,
+ /obj/item/toy/spinningtoy = 2,
+ /obj/item/toy/prize/ripley = 1,
+ /obj/item/toy/prize/fireripley = 1,
+ /obj/item/toy/prize/deathripley = 1,
+ /obj/item/toy/prize/gygax = 1,
+ /obj/item/toy/prize/durand = 1,
+ /obj/item/toy/prize/honk = 1,
+ /obj/item/toy/prize/marauder = 1,
+ /obj/item/toy/prize/seraph = 1,
+ /obj/item/toy/prize/mauler = 1,
+ /obj/item/toy/prize/odysseus = 1,
+ /obj/item/toy/prize/phazon = 1,
+ /obj/item/toy/prize/reticence = 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/toy/talking/skeleton = 2,
+ /obj/item/weapon/coin/antagtoken = 2,
+ /obj/item/stack/tile/fakespace/loaded = 2,
+ /obj/item/toy/toy_xeno = 2,
+ /obj/item/weapon/restraints/handcuffs/fake = 2)
+
+/obj/machinery/computer/arcade/New()
+ ..()
+ // If it's a generic arcade machine, pick a random arcade
+ // circuit board for it and make the new machine
+ if(!circuit)
+ var/choice = pick(subtypesof(/obj/item/weapon/circuitboard/computer/arcade))
+ var/obj/item/weapon/circuitboard/CB = new choice()
+ new CB.build_path(loc, CB)
+ qdel(src)
+
+/obj/machinery/computer/arcade/proc/prizevend()
+ if(prob(0.0001)) //1 in a million
+ new /obj/item/weapon/gun/energy/pulse(src)
+
+ if(!contents.len)
+ var/prizeselect = pickweight(prizes)
+ new prizeselect(src)
+
+ var/atom/movable/prize = pick(contents)
+ visible_message(
+ "[src] dispenses a [prize]!",
+ "You hear a chime and a clunk.")
+
+ prize.loc = src.loc
+
+/obj/machinery/computer/arcade/emp_act(severity)
+ ..(severity)
+
+ if(stat & (NOPOWER|BROKEN))
+ 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--)
+ empprize = pickweight(prizes)
+ new empprize(src.loc)
+ explosion(src.loc, -1, 0, 1+num_of_prizes, flame_range = 1+num_of_prizes)
+
+
+// ** BATTLE ** //
+
+
+/obj/machinery/computer/arcade/battle
+ name = "arcade machine"
+ desc = "Does not support Pinball."
+ icon_state = "arcade"
+ circuit = /obj/item/weapon/circuitboard/computer/arcade/battle
+ var/enemy_name = "Space Villian"
+ var/temp = "Winners don't use space drugs" //Temporary message, for attack messages, etc
+ var/player_hp = 30 //Player health/attack points
+ var/player_mp = 10
+ var/enemy_hp = 45 //Enemy health/attack points
+ var/enemy_mp = 20
+ var/gameover = 0
+ var/blocked = 0 //Player cannot attack/heal while set
+ var/turtle = 0
+
+/obj/machinery/computer/arcade/battle/New()
+ ..()
+ var/name_action
+ var/name_part1
+ var/name_part2
+
+ name_action = pick("Defeat ", "Annihilate ", "Save ", "Strike ", "Stop ", "Destroy ", "Robust ", "Romance ", "Pwn ", "Own ", "Ban ")
+
+ name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Cuban ", "the Evil ", "the Dread King ", "the Space ", "Lord ", "the Great ", "Duke ", "General ")
+ name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "slime", "Griefer", "ERPer", "Lizard Man", "Unicorn", "Bloopers")
+
+ src.enemy_name = replacetext((name_part1 + name_part2), "the ", "")
+ src.name = (name_action + name_part1 + name_part2)
+
+/obj/machinery/computer/arcade/battle/attack_hand(mob/user)
+ if(..())
+ return
+ user.set_machine(src)
+ var/dat = "Close"
+ dat += "[src.enemy_name]
"
+
+ dat += "
[src.temp]
"
+ dat += "
Health: [src.player_hp] | Magic: [src.player_mp] | Enemy Health: [src.enemy_hp]"
+
+ if (src.gameover)
+ dat += "New Game"
+ else
+ dat += "Attack | "
+ dat += "Heal | "
+ dat += "Recharge Power"
+
+ dat += ""
+
+ //user << browse(dat, "window=arcade")
+ //onclose(user, "arcade")
+ var/datum/browser/popup = new(user, "arcade", "Space Villian 2000")
+ popup.set_content(dat)
+ popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
+ popup.open()
+ return
+
+/obj/machinery/computer/arcade/battle/Topic(href, href_list)
+ if(..())
+ return
+
+ if (!src.blocked && !src.gameover)
+ if (href_list["attack"])
+ src.blocked = 1
+ var/attackamt = rand(2,6)
+ src.temp = "You attack for [attackamt] damage!"
+ playsound(src.loc, 'sound/arcade/Hit.ogg', 50, 1, extrarange = -3, falloff = 10)
+ src.updateUsrDialog()
+ if(turtle > 0)
+ turtle--
+
+ sleep(10)
+ src.enemy_hp -= attackamt
+ src.arcade_action()
+
+ else if (href_list["heal"])
+ src.blocked = 1
+ var/pointamt = rand(1,3)
+ var/healamt = rand(6,8)
+ src.temp = "You use [pointamt] magic to heal for [healamt] damage!"
+ playsound(src.loc, 'sound/arcade/Heal.ogg', 50, 1, extrarange = -3, falloff = 10)
+ src.updateUsrDialog()
+ turtle++
+
+ sleep(10)
+ src.player_mp -= pointamt
+ src.player_hp += healamt
+ src.blocked = 1
+ src.updateUsrDialog()
+ src.arcade_action()
+
+ else if (href_list["charge"])
+ src.blocked = 1
+ var/chargeamt = rand(4,7)
+ src.temp = "You regain [chargeamt] points"
+ playsound(src.loc, 'sound/arcade/Mana.ogg', 50, 1, extrarange = -3, falloff = 10)
+ src.player_mp += chargeamt
+ if(turtle > 0)
+ turtle--
+
+ src.updateUsrDialog()
+ sleep(10)
+ src.arcade_action()
+
+ if (href_list["close"])
+ usr.unset_machine()
+ usr << browse(null, "window=arcade")
+
+ else if (href_list["newgame"]) //Reset everything
+ temp = "New Round"
+ player_hp = 30
+ player_mp = 10
+ enemy_hp = 45
+ enemy_mp = 20
+ gameover = 0
+ turtle = 0
+
+ if(emagged)
+ src.New()
+ emagged = 0
+
+ src.add_fingerprint(usr)
+ src.updateUsrDialog()
+ return
+
+/obj/machinery/computer/arcade/battle/proc/arcade_action()
+ if ((src.enemy_mp <= 0) || (src.enemy_hp <= 0))
+ if(!gameover)
+ src.gameover = 1
+ src.temp = "[src.enemy_name] has fallen! Rejoice!"
+ playsound(src.loc, 'sound/arcade/Win.ogg', 50, 1, extrarange = -3, falloff = 10)
+
+ if(emagged)
+ feedback_inc("arcade_win_emagged")
+ new /obj/effect/spawner/newbomb/timer/syndicate(src.loc)
+ new /obj/item/clothing/head/collectable/petehat(src.loc)
+ 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.")
+ src.New()
+ emagged = 0
+ else
+ feedback_inc("arcade_win_normal")
+ prizevend()
+
+ else if (emagged && (turtle >= 4))
+ var/boomamt = rand(5,10)
+ src.temp = "[src.enemy_name] throws a bomb, exploding you for [boomamt] damage!"
+ playsound(src.loc, 'sound/arcade/Boom.ogg', 50, 1, extrarange = -3, falloff = 10)
+ src.player_hp -= boomamt
+
+ else if ((src.enemy_mp <= 5) && (prob(70)))
+ var/stealamt = rand(2,3)
+ src.temp = "[src.enemy_name] steals [stealamt] of your power!"
+ playsound(src.loc, 'sound/arcade/Steal.ogg', 50, 1, extrarange = -3, falloff = 10)
+ src.player_mp -= stealamt
+ src.updateUsrDialog()
+
+ if (src.player_mp <= 0)
+ src.gameover = 1
+ sleep(10)
+ src.temp = "You have been drained! GAME OVER"
+ playsound(src.loc, 'sound/arcade/Lose.ogg', 50, 1, extrarange = -3, falloff = 10)
+ if(emagged)
+ feedback_inc("arcade_loss_mana_emagged")
+ usr.gib()
+ else
+ feedback_inc("arcade_loss_mana_normal")
+
+ else if ((src.enemy_hp <= 10) && (src.enemy_mp > 4))
+ src.temp = "[src.enemy_name] heals for 4 health!"
+ playsound(src.loc, 'sound/arcade/Heal.ogg', 50, 1, extrarange = -3, falloff = 10)
+ src.enemy_hp += 4
+ src.enemy_mp -= 4
+
+ else
+ var/attackamt = rand(3,6)
+ src.temp = "[src.enemy_name] attacks for [attackamt] damage!"
+ playsound(src.loc, 'sound/arcade/Hit.ogg', 50, 1, extrarange = -3, falloff = 10)
+ src.player_hp -= attackamt
+
+ if ((src.player_mp <= 0) || (src.player_hp <= 0))
+ src.gameover = 1
+ src.temp = "You have been crushed! GAME OVER"
+ playsound(src.loc, 'sound/arcade/Lose.ogg', 50, 1, extrarange = -3, falloff = 10)
+ if(emagged)
+ feedback_inc("arcade_loss_hp_emagged")
+ usr.gib()
+ else
+ feedback_inc("arcade_loss_hp_normal")
+
+ src.blocked = 0
+ return
+
+
+/obj/machinery/computer/arcade/battle/emag_act(mob/user)
+ if(!emagged)
+ temp = "If you die in the game, you die for real!"
+ player_hp = 30
+ player_mp = 10
+ enemy_hp = 45
+ enemy_mp = 20
+ gameover = 0
+ blocked = 0
+
+ emagged = 1
+
+ enemy_name = "Cuban Pete"
+ name = "Outbomb Cuban Pete"
+
+
+ src.updateUsrDialog()
+
+
+
+// *** 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"
+
+#define ORION_STATUS_START 1
+#define ORION_STATUS_NORMAL 2
+#define ORION_STATUS_GAMEOVER 3
+#define ORION_STATUS_MARKET 4
+
+/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_state = "arcade"
+ circuit = /obj/item/weapon/circuitboard/computer/arcade/orion_trail
+ var/busy = 0 //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/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 = ""
+ var/gameStatus = ORION_STATUS_START
+ var/canContinueEvent = 0
+
+/obj/machinery/computer/arcade/orion_trail/New()
+ ..()
+ // 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
+ gameStatus = ORION_STATUS_NORMAL
+ 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 || settlers.len == 0)
+ gameStatus = ORION_STATUS_GAMEOVER
+ event = null
+ user.set_machine(src)
+ var/dat = ""
+ if(gameStatus == ORION_STATUS_GAMEOVER)
+ dat = "Game Over
"
+ dat += "Like many before you, your crew never made it to Orion, lost to space...
Forever."
+ if(settlers.len == 0)
+ dat += "
Your entire crew died, your ship joins the fleet of ghost-ships littering the galaxy."
+ else
+ if(food <= 0)
+ dat += "
You ran out of food and starved."
+ if(emagged)
+ user.nutrition = 0 //yeah you pretty hongry
+ user << "Your body instantly contracts to that of one who has not eaten in months. Agonizing cramps seize you as you fall to the floor."
+ if(fuel <= 0)
+ dat += "
You ran out of fuel, and drift, slowly, into a star."
+ if(emagged)
+ var/mob/living/M = user
+ M.adjust_fire_stacks(5)
+ M.IgniteMob() //flew into a star, so you're on fire
+ user << "You feel an immense wave of heat emanate from the arcade machine. Your skin bursts into flames."
+ dat += "
OK...
"
+
+ if(emagged)
+ user << "You're never going to make it to Orion..."
+ user.death()
+ emagged = 0 //removes the emagged status after you lose
+ gameStatus = ORION_STATUS_START
+ name = "The Orion Trail"
+ desc = "Learn how our ancestors got to Orion, and have fun in the process!"
+
+ else if(event)
+ dat = eventdat
+ else if(gameStatus == ORION_STATUS_NORMAL)
+ var/title = stops[turns]
+ var/subtext = stopblurbs[turns]
+ dat = "[title]
"
+ dat += "[subtext]"
+ dat += "Crew:
"
+ dat += english_list(settlers)
+ dat += "
Food: [food] | Fuel: [fuel]"
+ dat += "
Engine Parts: [engine] | Hull Panels: [hull] | Electronics: [electronics]"
+ if(turns == 7)
+ dat += "Go Around Continue
"
+ else
+ dat += "Continue
"
+ dat += "Kill a crewmember
"
+ dat += "Close
"
+ else
+ dat = "The Orion Trail
"
+ dat += "
Experience the journey of your ancestors!
"
+ dat += "New Game"
+ dat += "Close
"
+ var/datum/browser/popup = new(user, "arcade", "The Orion Trail",400,700)
+ popup.set_content(dat)
+ popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
+ popup.open()
+ return
+
+/obj/machinery/computer/arcade/orion_trail/Topic(href, href_list)
+ if(..())
+ return
+ if(href_list["close"])
+ usr.unset_machine()
+ usr << browse(null, "window=arcade")
+
+ if(busy)
+ return
+ busy = 1
+
+ if (href_list["continue"]) //Continue your travels
+ if(gameStatus == ORION_STATUS_NORMAL && !event && turns != 7)
+ if(turns >= ORION_TRAIL_WINTURN)
+ win()
+ else
+ food -= (alive+lings_aboard)*2
+ fuel -= 5
+ if(turns == 2 && prob(30))
+ event = ORION_TRAIL_COLLISION
+ event()
+ else if(prob(75))
+ event = pickweight(events)
+ if(lings_aboard)
+ if(event == ORION_TRAIL_LING || prob(55))
+ event = ORION_TRAIL_LING_ATTACK
+ event()
+ turns += 1
+ if(emagged)
+ var/mob/living/carbon/M = usr //for some vars
+ switch(event)
+ if(ORION_TRAIL_RAIDERS)
+ if(prob(50))
+ usr << "You hear battle shouts. The tramping of boots on cold metal. Screams of agony. The rush of venting air. Are you going insane?"
+ M.hallucination += 30
+ else
+ usr << "Something strikes you from behind! It hurts like hell and feel like a blunt weapon, but nothing is there..."
+ M.take_organ_damage(30)
+ playsound(loc, 'sound/weapons/genhit2.ogg', 100, 1)
+ if(ORION_TRAIL_ILLNESS)
+ var/severity = rand(1,3) //pray to RNGesus. PRAY, PIGS
+ if(severity == 1)
+ M << "You suddenly feel slightly nauseous." //got off lucky
+ if(severity == 2)
+ usr << "You suddenly feel extremely nauseous and hunch over until it passes."
+ M.Stun(3)
+ if(severity >= 3) //you didn't pray hard enough
+ M << "An overpowering wave of nausea consumes over you. You hunch over, your stomach's contents preparing for a spectacular exit."
+ M.Stun(5)
+ sleep(30)
+ M.vomit(50)
+ if(ORION_TRAIL_FLUX)
+ if(prob(75))
+ M.Weaken(3)
+ say("A sudden gust of powerful wind slams [M] into the floor!")
+ M.take_organ_damage(25)
+ playsound(src.loc, 'sound/weapons/Genhit.ogg', 100, 1)
+ else
+ M << "A violent gale blows past you, and you barely manage to stay standing!"
+ if(ORION_TRAIL_COLLISION) //by far the most damaging event
+ if(prob(90))
+ playsound(src.loc, 'sound/effects/bang.ogg', 100, 1)
+ var/turf/open/floor/F
+ for(F in orange(1, src))
+ F.ChangeTurf(F.baseturf)
+ say("Something slams into the floor around [src], exposing it to space!")
+ if(hull)
+ sleep(10)
+ say("A new floor suddenly appears around [src]. What the hell?")
+ playsound(src.loc, 'sound/weapons/Genhit.ogg', 100, 1)
+ var/turf/open/space/T
+ for(T in orange(1, src))
+ T.ChangeTurf(/turf/open/floor/plating/)
+ else
+ say("Something slams into the floor around [src] - luckily, it didn't get through!")
+ playsound(src.loc, 'sound/effects/bang.ogg', 50, 1)
+ if(ORION_TRAIL_MALFUNCTION)
+ playsound(src.loc, 'sound/effects/EMPulse.ogg', 50, 1)
+ src.visible_message("[src] malfunctions, randomizing in-game stats!")
+ var/oldfood = food
+ var/oldfuel = fuel
+ food = rand(10,80) / rand(1,2)
+ fuel = rand(10,60) / rand(1,2)
+ if(electronics)
+ sleep(10)
+ if(oldfuel > fuel && oldfood > food)
+ src.audible_message("[src] lets out a somehow reassuring chime.")
+ else if(oldfuel < fuel || oldfood < food)
+ src.audible_message("[src] lets out a somehow ominous chime.")
+ food = oldfood
+ fuel = oldfuel
+ playsound(src.loc, 'sound/machines/chime.ogg', 50, 1)
+
+ else if(href_list["newgame"]) //Reset everything
+ if(gameStatus == ORION_STATUS_START)
+ newgame()
+ else if(href_list["menu"]) //back to the main menu
+ if(gameStatus == ORION_STATUS_GAMEOVER)
+ gameStatus = ORION_STATUS_START
+ event = null
+ food = 80
+ fuel = 60
+ settlers = list("Harry","Larry","Bob")
+ else if(href_list["slow"]) //slow down
+ if(event == ORION_TRAIL_FLUX)
+ food -= (alive+lings_aboard)*2
+ fuel -= 5
+ event = null
+ else if(href_list["pastblack"]) //slow down
+ if(turns == 7)
+ food -= ((alive+lings_aboard)*2)*3
+ fuel -= 15
+ turns += 1
+ event = null
+ else if(href_list["useengine"]) //use parts
+ if(event == ORION_TRAIL_BREAKDOWN)
+ engine = max(0, --engine)
+ event = null
+ else if(href_list["useelec"]) //use parts
+ if(event == ORION_TRAIL_MALFUNCTION)
+ electronics = max(0, --electronics)
+ event = null
+ else if(href_list["usehull"]) //use parts
+ if(event == ORION_TRAIL_COLLISION)
+ hull = max(0, --hull)
+ event = null
+ else if(href_list["wait"]) //wait 3 days
+ if(event == ORION_TRAIL_BREAKDOWN || event == ORION_TRAIL_MALFUNCTION || event == ORION_TRAIL_COLLISION)
+ food -= ((alive+lings_aboard)*2)*3
+ event = null
+ else if(href_list["keepspeed"]) //keep speed
+ if(event == ORION_TRAIL_FLUX)
+ if(prob(75))
+ event = "Breakdown"
+ event()
+ else
+ event = null
+ else if(href_list["blackhole"]) //keep speed past a black hole
+ if(turns == 7)
+ if(prob(75))
+ event = ORION_TRAIL_BLACKHOLE
+ event()
+ if(emagged) //has to be here because otherwise it doesn't work
+ playsound(src.loc, 'sound/effects/supermatter.ogg', 100, 1)
+ say("A miniature black hole suddenly appears in front of [src], devouring [usr] alive!")
+ usr.Stun(10) //you can't run :^)
+ var/S = new /obj/singularity/academy(usr.loc)
+ emagged = 0 //immediately removes emagged status so people can't kill themselves by sprinting up and interacting
+ sleep(50)
+ say("[S] winks out, just as suddenly as it appeared.")
+ qdel(S)
+ else
+ event = null
+ turns += 1
+ else if(href_list["holedeath"])
+ if(event == ORION_TRAIL_BLACKHOLE)
+ gameStatus = ORION_STATUS_GAMEOVER
+ event = null
+ else if(href_list["eventclose"]) //end an event
+ if(canContinueEvent)
+ event = null
+
+ else if(href_list["killcrew"]) //shoot a crewmember
+ if(gameStatus == ORION_STATUS_NORMAL || event == ORION_TRAIL_LING)
+ var/sheriff = remove_crewmember() //I shot the sheriff
+ playsound(loc,'sound/weapons/Gunshot.ogg', 100, 1)
+
+ if(settlers.len == 0 || alive == 0)
+ say("The last crewmember [sheriff], shot themselves, GAME OVER!")
+ if(emagged)
+ usr.death(0)
+ emagged = 0
+ gameStatus = ORION_STATUS_GAMEOVER
+ event = null
+ else if(emagged)
+ if(usr.name == sheriff)
+ say("The crew of the ship chose to kill [usr.name]!")
+ usr.death(0)
+
+ if(event == ORION_TRAIL_LING) //only ends the ORION_TRAIL_LING event, since you can do this action in multiple places
+ event = null
+
+ //Spaceport specific interactions
+ //they get a header because most of them don't reset event (because it's a shop, you leave when you want to)
+ //they also call event() again, to regen the eventdata, which is kind of odd but necessary
+ else if(href_list["buycrew"]) //buy a crewmember
+ if(gameStatus == ORION_STATUS_MARKET)
+ if(!spaceport_raided && food >= 10 && fuel >= 10)
+ var/bought = add_crewmember()
+ last_spaceport_action = "You hired [bought] as a new crewmember."
+ fuel -= 10
+ food -= 10
+ event()
+
+ else if(href_list["sellcrew"]) //sell a crewmember
+ if(gameStatus == ORION_STATUS_MARKET)
+ if(!spaceport_raided && settlers.len > 1)
+ var/sold = remove_crewmember()
+ last_spaceport_action = "You sold your crewmember, [sold]!"
+ fuel += 7
+ food += 7
+ event()
+
+ else if(href_list["leave_spaceport"])
+ if(gameStatus == ORION_STATUS_MARKET)
+ event = null
+ gameStatus = ORION_STATUS_NORMAL
+ spaceport_raided = 0
+ spaceport_freebie = 0
+ last_spaceport_action = ""
+
+ else if(href_list["raid_spaceport"])
+ if(gameStatus == ORION_STATUS_MARKET)
+ if(!spaceport_raided)
+ var/success = min(15 * alive,100) //default crew (4) have a 60% chance
+ spaceport_raided = 1
+
+ var/FU = 0
+ var/FO = 0
+ if(prob(success))
+ FU = rand(5,15)
+ FO = rand(5,15)
+ last_spaceport_action = "You successfully raided the spaceport! you gained [FU] Fuel and [FO] Food! (+[FU]FU,+[FO]FO)"
+ else
+ FU = rand(-5,-15)
+ FO = rand(-5,-15)
+ last_spaceport_action = "You failed to raid the spaceport! you lost [FU*-1] Fuel and [FO*-1] Food in your scramble to escape! ([FU]FU,[FO]FO)"
+
+ //your chance of lose a crewmember is 1/2 your chance of success
+ //this makes higher % failures hurt more, don't get cocky space cowboy!
+ if(prob(success*5))
+ var/lost_crew = remove_crewmember()
+ last_spaceport_action = "You failed to raid the spaceport! you lost [FU*-1] Fuel and [FO*-1] Food, AND [lost_crew] in your scramble to escape! ([FU]FI,[FO]FO,-Crew)"
+ if(emagged)
+ say("WEEWOO WEEWOO, Spaceport Security en route!")
+ for(var/i, i<=3, i++)
+ var/mob/living/simple_animal/hostile/syndicate/ranged/orion/O = new/mob/living/simple_animal/hostile/syndicate/ranged/orion(get_turf(src))
+ O.target = usr
+
+
+ fuel += FU
+ food += FO
+ event()
+
+ else if(href_list["buyparts"])
+ if(gameStatus == ORION_STATUS_MARKET)
+ if(!spaceport_raided && fuel > 5)
+ switch(text2num(href_list["buyparts"]))
+ if(1) //Engine Parts
+ engine++
+ last_spaceport_action = "Bought Engine Parts"
+ if(2) //Hull Plates
+ hull++
+ last_spaceport_action = "Bought Hull Plates"
+ if(3) //Spare Electronics
+ electronics++
+ last_spaceport_action = "Bought Spare Electronics"
+ fuel -= 5 //they all cost 5
+ event()
+
+ else if(href_list["trade"])
+ if(gameStatus == ORION_STATUS_MARKET)
+ if(!spaceport_raided)
+ switch(text2num(href_list["trade"]))
+ if(1) //Fuel
+ if(fuel > 5)
+ fuel -= 5
+ food += 5
+ last_spaceport_action = "Traded Fuel for Food"
+ event()
+ if(2) //Food
+ if(food > 5)
+ fuel += 5
+ food -= 5
+ last_spaceport_action = "Traded Food for Fuel"
+ event()
+
+ src.add_fingerprint(usr)
+ src.updateUsrDialog()
+ busy = 0
+ return
+
+
+/obj/machinery/computer/arcade/orion_trail/proc/event()
+ eventdat = "[event]
"
+ canContinueEvent = 0
+ switch(event)
+ if(ORION_TRAIL_RAIDERS)
+ eventdat += "Raiders have come aboard your ship!"
+ if(prob(50))
+ var/sfood = rand(1,10)
+ var/sfuel = rand(1,10)
+ food -= sfood
+ fuel -= sfuel
+ eventdat += "
They have stolen [sfood] Food and [sfuel] Fuel."
+ else if(prob(10))
+ var/deadname = remove_crewmember()
+ eventdat += "
[deadname] tried to fight back but was killed."
+ else
+ eventdat += "
Fortunately you fended them off without any trouble."
+ eventdat += "Continue
"
+ eventdat += "Close
"
+ canContinueEvent = 1
+
+ if(ORION_TRAIL_FLUX)
+ eventdat += "This region of space is highly turbulent.
If we go slowly we may avoid more damage, but if we keep our speed we won't waste supplies."
+ eventdat += "
What will you do?"
+ eventdat += "Slow Down Continue
"
+ eventdat += "Close
"
+
+ if(ORION_TRAIL_ILLNESS)
+ eventdat += "A deadly illness has been contracted!"
+ var/deadname = remove_crewmember()
+ eventdat += "
[deadname] was killed by the disease."
+ eventdat += "Continue
"
+ eventdat += "Close
"
+ canContinueEvent = 1
+
+ if(ORION_TRAIL_BREAKDOWN)
+ eventdat += "Oh no! The engine has broken down!"
+ eventdat += "
You can repair it with an engine part, or you can make repairs for 3 days."
+ if(engine >= 1)
+ eventdat += "Use PartWait
"
+ else
+ eventdat += "Wait
"
+ eventdat += "Close
"
+
+ if(ORION_TRAIL_MALFUNCTION)
+ eventdat += "The ship's systems are malfunctioning!"
+ eventdat += "
You can replace the broken electronics with spares, or you can spend 3 days troubleshooting the AI."
+ if(electronics >= 1)
+ eventdat += "Use PartWait
"
+ else
+ eventdat += "Wait
"
+ eventdat += "Close
"
+
+ if(ORION_TRAIL_COLLISION)
+ eventdat += "Something hit us! Looks like there's some hull damage."
+ if(prob(25))
+ var/sfood = rand(5,15)
+ var/sfuel = rand(5,15)
+ food -= sfood
+ fuel -= sfuel
+ eventdat += "
[sfood] Food and [sfuel] Fuel was vented out into space."
+ if(prob(10))
+ var/deadname = remove_crewmember()
+ eventdat += "
[deadname] was killed by rapid depressurization."
+ eventdat += "
You can repair the damage with hull plates, or you can spend the next 3 days welding scrap together."
+ if(hull >= 1)
+ eventdat += "Use PartWait
"
+ else
+ eventdat += "Wait
"
+ eventdat += "Close
"
+
+ if(ORION_TRAIL_BLACKHOLE)
+ eventdat += "You were swept away into the black hole."
+ eventdat += "Oh...
"
+ eventdat += "Close
"
+ settlers = list()
+
+ if(ORION_TRAIL_LING)
+ eventdat += "Strange reports warn of changelings infiltrating crews on trips to Orion..."
+ if(settlers.len <= 2)
+ eventdat += "
Your crew's chance of reaching Orion is so slim the changelings likely avoided your ship..."
+ eventdat += "Continue
"
+ eventdat += "Close
"
+ if(prob(10)) // "likely", I didn't say it was guaranteed!
+ lings_aboard = min(++lings_aboard,2)
+ else
+ if(lings_aboard) //less likely to stack lings
+ if(prob(20))
+ lings_aboard = min(++lings_aboard,2)
+ else if(prob(70))
+ lings_aboard = min(++lings_aboard,2)
+
+ eventdat += "Kill a crewmember
"
+ eventdat += "Risk it
"
+ eventdat += "Close
"
+ canContinueEvent = 1
+
+ if(ORION_TRAIL_LING_ATTACK)
+ if(lings_aboard <= 0) //shouldn't trigger, but hey.
+ eventdat += "Haha, fooled you, there are no changelings on board!"
+ eventdat += "
(You should report this to a coder :S)"
+ else
+ var/ling1 = remove_crewmember()
+ var/ling2 = ""
+ if(lings_aboard >= 2)
+ ling2 = remove_crewmember()
+
+ eventdat += "Oh no, some of your crew are Changelings!"
+ if(ling2)
+ eventdat += "
[ling1] and [ling2]'s arms twist and contort into grotesque blades!"
+ else
+ eventdat += "
[ling1]'s arm twists and contorts into a grotesque blade!"
+
+ var/chance2attack = alive*20
+ if(prob(chance2attack))
+ var/chancetokill = 30*lings_aboard-(5*alive) //eg: 30*2-(10) = 50%, 2 lings, 2 crew is 50% chance
+ if(prob(chancetokill))
+ var/deadguy = remove_crewmember()
+ eventdat += "
The Changeling[ling2 ? "s":""] run[ling2 ? "":"s"] up to [deadguy] and capitulates them!"
+ else
+ eventdat += "
You valiantly fight off the Changeling[ling2 ? "s":""]!"
+ eventdat += "
You cut the Changeling[ling2 ? "s":""] up into meat... Eww"
+ if(ling2)
+ food += 30
+ lings_aboard = max(0,lings_aboard-2)
+ else
+ food += 15
+ lings_aboard = max(0,--lings_aboard)
+ else
+ eventdat += "
The Changeling[ling2 ? "s":""] run[ling2 ? "":"s"] away, What wimps!"
+ if(ling2)
+ lings_aboard = max(0,lings_aboard-2)
+ else
+ lings_aboard = max(0,--lings_aboard)
+
+ eventdat += "Continue
"
+ eventdat += "Close
"
+ canContinueEvent = 1
+
+
+ if(ORION_TRAIL_SPACEPORT)
+ gameStatus = ORION_STATUS_MARKET
+ if(spaceport_raided)
+ eventdat += "The Spaceport is on high alert! they wont let you dock since you tried to attack them!"
+ if(last_spaceport_action)
+ eventdat += "
Last Spaceport Action: [last_spaceport_action]"
+ eventdat += "Depart Spaceport
"
+ eventdat += "Close
"
+ else
+ eventdat += "You pull the ship up to dock at a nearby Spaceport, lucky find!"
+ eventdat += "
This Spaceport is home to travellers who failed to reach Orion, but managed to find a different home..."
+ eventdat += "
Trading terms: FU = Fuel, FO = Food"
+ if(last_spaceport_action)
+ eventdat += "
Last Spaceport Action: [last_spaceport_action]"
+ eventdat += "Crew:
"
+ eventdat += english_list(settlers)
+ eventdat += "
Food: [food] | Fuel: [fuel]"
+ eventdat += "
Engine Parts: [engine] | Hull Panels: [hull] | Electronics: [electronics]"
+
+
+ //If your crew is pathetic you can get freebies (provided you haven't already gotten one from this port)
+ if(!spaceport_freebie && (fuel < 20 || food < 20))
+ spaceport_freebie++
+ var/FU = 10
+ var/FO = 10
+ var/freecrew = 0
+ if(prob(30))
+ FU = 25
+ FO = 25
+
+ if(prob(10))
+ add_crewmember()
+ freecrew++
+
+ eventdat += "
The traders of the spaceport take pitty on you, and give you some food and fuel (+[FU]FU,+[FO]FO)"
+ if(freecrew)
+ eventdat += "
You also gain a new crewmember!"
+
+ fuel += FU
+ food += FO
+
+ //CREW INTERACTIONS
+ eventdat += "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(settlers.len > 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 += "Buy Engine Parts (-5FU)
"
+ else
+ eventdat += "Cant afford to buy Engine Parts"
+
+ //Hull plates
+ if(fuel > 5)
+ eventdat += "
Buy Hull Plates (-5FU)
"
+ else
+ eventdat += "Cant afford to buy Hull Plates"
+
+ //Electronics
+ if(fuel > 5)
+ eventdat += "
Buy Spare Electronics (-5FU)
"
+ 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 += "Depart Spaceport
"
+
+
+//Add Random/Specific crewmember
+/obj/machinery/computer/arcade/orion_trail/proc/add_crewmember(var/specific = "")
+ var/newcrew = ""
+ if(specific)
+ newcrew = specific
+ else
+ if(prob(50))
+ newcrew = pick(first_names_male)
+ else
+ newcrew = pick(first_names_female)
+ if(newcrew)
+ settlers += newcrew
+ alive++
+ return newcrew
+
+
+//Remove Random/Specific crewmember
+/obj/machinery/computer/arcade/orion_trail/proc/remove_crewmember(var/specific = "", var/dont_remove = "")
+ var/list/safe2remove = settlers
+ var/removed = ""
+ if(dont_remove)
+ safe2remove -= dont_remove
+ if(specific && specific != dont_remove)
+ safe2remove = list(specific)
+ else
+ 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()
+ gameStatus = ORION_STATUS_START
+ say("Congratulations, you made it to Orion!")
+ if(emagged)
+ new /obj/item/weapon/orion_ship(src.loc)
+ 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
+ prizevend()
+ emagged = 0
+ 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)
+ user << "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!"
+ newgame()
+ emagged = 1
+
+/mob/living/simple_animal/hostile/syndicate/ranged/orion
+ name = "Spaceport Security"
+ desc = "The Premier security forces for all spaceports found along the Orion Trail."
+ faction = list("orion")
+ loot = list(/obj/effect/mob_spawn/human/corpse/orionsecurity,
+ /obj/item/weapon/gun/projectile/automatic/c20r/unrestricted,
+ /obj/item/weapon/shield/energy)
+
+/obj/effect/mob_spawn/human/corpse/orionsecurity
+ name = "Spaceport Security"
+ uniform = /obj/item/clothing/under/syndicate
+ suit = /obj/item/clothing/suit/armor/vest
+ shoes = /obj/item/clothing/shoes/combat
+ gloves = /obj/item/clothing/gloves/combat
+ radio = /obj/item/device/radio/headset
+ mask = /obj/item/clothing/mask/gas
+ helmet = /obj/item/clothing/head/helmet/swat
+ back = /obj/item/weapon/storage/backpack
+ has_id = 1
+ id_job = "Officer"
+ id_access = "Syndicate"
+
+/obj/item/weapon/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 = 2
+ var/active = 0 //if the ship is on
+
+/obj/item/weapon/orion_ship/examine(mob/user)
+ ..()
+ if(!(in_range(user, src)))
+ return
+ if(!active)
+ user << "There's a little switch on the bottom. It's flipped down."
+ else
+ user << "There's a little switch on the bottom. It's flipped up."
+
+/obj/item/weapon/orion_ship/attack_self(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.")
+
+ user << "You flip the switch on the underside of [src]."
+ active = 1
+ src.visible_message("[src] softly beeps and whirs to life!")
+ playsound(src.loc, 'sound/machines/defib_SaftyOn.ogg', 25, 1)
+ say("This is ship ID #[rand(1,1000)] to Orion Port Authority. We're coming in for landing, over.")
+ sleep(20)
+ src.visible_message("[src] begins to vibrate...")
+ say("Uh, Port? Having some issues with our reactor, could you check it out? Over.")
+ sleep(30)
+ say("Oh, God! Code Eight! CODE EIGHT! IT'S GONNA BL-")
+ playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 25, 1)
+ sleep(3.6)
+ src.visible_message("[src] explodes!")
+ explosion(src.loc, 2,4,8, flame_range = 16)
+ 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
+
+#undef ORION_STATUS_START
+#undef ORION_STATUS_NORMAL
+#undef ORION_STATUS_GAMEOVER
+#undef ORION_STATUS_MARKET
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 67bff40c2ad..e9099c7141d 100755
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -457,50 +457,6 @@
icon_state = "reticenceprize"
quiet = 1
-/*
- * AI core prizes
- */
-/obj/item/toy/AI
- name = "toy AI"
- desc = "A little toy model AI core with real law announcing action!"
- icon = 'icons/obj/toy.dmi'
- icon_state = "AI"
- w_class = 2
- var/cooldown = 0
-
-/obj/item/toy/AI/attack_self(mob/user)
- if(!cooldown) //for the sanity of everyone
- var/message = generate_ion_law()
- user << "You press the button on [src]."
- playsound(user, 'sound/machines/click.ogg', 20, 1)
- src.loc.visible_message("\icon[src] [message]")
- cooldown = 1
- spawn(30) cooldown = 0
- return
- ..()
-
-/obj/item/toy/codex_gigas
- name = "Toy Codex Gigas"
- desc = "A tool to help you write fictional devils!"
- icon = 'icons/obj/library.dmi'
- icon_state = "demonomicon"
- w_class = 2
- var/cooldown = 0
-
-/obj/item/toy/codex_gigas/attack_self(mob/user)
- if(!cooldown)
- var/datum/devilinfo/devil = randomDevilInfo()
- user << "You press the button on [src]."
- cooldown = 1
- playsound(user, 'sound/machines/click.ogg', 20, 1)
- src.loc.visible_message("\icon[src]Some fun facts about: [devil.truename]")
- src.loc.visible_message("[lawlorify[LORE][devil.bane]]")
- src.loc.visible_message("[lawlorify[LORE][devil.obligation]]")
- src.loc.visible_message("[lawlorify[LORE][devil.ban]]")
- src.loc.visible_message("[lawlorify[LORE][devil.banish]]")
- spawn(60) cooldown = 0
- return
- ..()
/obj/item/toy/talking
name = "talking action figure"
@@ -508,37 +464,192 @@
icon = 'icons/obj/toy.dmi'
icon_state = "owlprize"
w_class = 2
- var/cooldown = 0
+ var/cooldown = FALSE
var/messages = list("I'm super generic!", "Mathematics class is of variable difficulty!")
var/span = "danger"
var/recharge_time = 30
+ var/chattering = FALSE
+ var/phomeme
+
+// Talking toys are language universal, and thus all species can use them
+/obj/item/toy/talking/attack_alien(mob/user)
+ . = attack_hand(user)
+
/obj/item/toy/talking/attack_self(mob/user)
if(!cooldown)
- var/message = pick(messages)
- user << "You pull the string on the [src]."
- toy_talk(user, message)
- cooldown = 1
- spawn(recharge_time) cooldown = 0
+ var/list/messages = generate_messages()
+ activation_message(user)
+ playsound(loc, 'sound/machines/click.ogg', 20, 1)
+
+ spawn(0)
+ for(var/message in messages)
+ toy_talk(user, message)
+ sleep(10)
+
+ cooldown = TRUE
+ spawn(recharge_time)
+ cooldown = FALSE
return
..()
-/obj/item/toy/talking/proc/toy_talk(user, message)
- playsound(user, 'sound/machines/click.ogg', 20, 1)
- src.loc.visible_message("\icon[src] [message]")
+/obj/item/toy/talking/proc/activation_message(mob/user)
+ user.visible_message(
+ "[user] pulls the string on \the [src].",
+ "You pull the string on \the [src].",
+ "You hear a string being pulled.")
+
+/obj/item/toy/talking/proc/generate_messages()
+ return list(pick(messages))
+
+/obj/item/toy/talking/proc/toy_talk(mob/user, message)
+ user.loc.visible_message("\icon[src] [message]")
+ if(chattering)
+ chatter(message, phomeme, user)
+
+/*
+ * AI core prizes
+ */
+/obj/item/toy/talking/AI
+ name = "toy AI"
+ desc = "A little toy model AI core with real law announcing action!"
+ icon_state = "AI"
+
+/obj/item/toy/talking/AI/generate_messages()
+ return list(generate_ion_law())
+
+/obj/item/toy/talking/codex_gigas
+ name = "Toy Codex Gigas"
+ desc = "A tool to help you write fictional devils!"
+ icon = 'icons/obj/library.dmi'
+ icon_state = "demonomicon"
+ w_class = 2
+ recharge_time = 60
+
+/obj/item/toy/talking/codex_gigas/activation_message(mob/user)
+ user.visible_message(
+ "[user] presses the button on \the [src].",
+ "You press the button on \the [src].",
+ "You hear a soft click.")
+
+/obj/item/toy/talking/codex_gigas/generate_messages()
+ var/datum/devilinfo/devil = randomDevilInfo()
+ var/list/messages = list()
+ messages += "Some fun facts about: [devil.truename]"
+ messages += "[lawlorify[LORE][devil.bane]]"
+ messages += "[lawlorify[LORE][devil.obligation]]"
+ messages += "[lawlorify[LORE][devil.ban]]"
+ messages += "[lawlorify[LORE][devil.banish]]"
+ return messages
/obj/item/toy/talking/owl
name = "owl action figure"
desc = "An action figure modeled after 'The Owl', defender of justice."
icon_state = "owlprize"
messages = list("You won't get away this time, Griffin!", "Stop right there, criminal!", "Hoot! Hoot!", "I am the night!")
+ chattering = TRUE
+ phomeme = "owl"
/obj/item/toy/talking/griffin
name = "griffin action figure"
desc = "An action figure modeled after 'The Griffin', criminal mastermind."
icon_state = "griffinprize"
messages = list("You can't stop me, Owl!", "My plan is flawless! The vault is mine!", "Caaaawwww!", "You will never catch me!")
+ chattering = TRUE
+ phomeme = "griffin"
+/obj/item/toy/talking/skeleton
+ name = "skeleton action figure"
+ desc = "An action figure modeled after 'Oh-cee', the original content \
+ skeleton.\nNot suitable for infants or assistants under 36 months \
+ of age."
+ icon_state = "skeletonprize"
+ attack_verb = list("boned", "dunked on", "worked down to the bone")
+ chattering = TRUE
+
+ var/list/papyrus_messages = list(
+ "That's the disposal bin. Feel free to visit it at any time.",
+ "I can't just let anyone ERP with me, I'm a skeleton with standards!",
+ "Sorry. Can't talk. I'm busy being popular on a video game.",
+ "You can't spell 'robust' without several letters from my name!!!")
+ var/list/sans_messages = list(
+ "You feel your redtext crawling on your back.",
+ "On days like these, references like this should be BURNING IN HELL.",
+ "I've gotten a ton of work done today. A skele-ton.")
+ var/list/regular_messages = list(
+ "Why was the skeleton such a bad liar? \
+ Because you can see right through him!",
+ "When does a skeleton laugh? When something tickles his funny bone!",
+ "Why couldn't the skeleton win the beauty contest? \
+ Because he had no body!",
+ "What do you call a skeleton in the winter? A numbskull!",
+ "What did the skeleton say before eating? Bone appetit!",
+ "What type of art do skeletons like? Skulltures!",
+ "What instrument do skeletons play? The trom-bone!",
+ "Why are skeletons always so calm? \
+ Because nothing gets under their skin!",
+ "How did the skeleton know it was going to rain? \
+ He could feel it in his bones.",
+ "Why did the skeleton go to the hospital? \
+ To get his ghoul stones removed.",
+ "Why can't skeletons play music in churches? \
+ Because they have no organs.",
+ "There's a skeleton inside everyone! Except slime people I guess...",
+ "The birds are too busy to notice me acting in the shadows!",
+ "Giraffes have the same number of bones in their necks as humans. \
+ You should never trust a giraffe.",
+ "When I meet a dog in the street, I always offer it a bone!",
+ "In corsetry, a bone is one of the rigid parts of a corset that \
+ forms its frame and gives it rigidity.",
+ "A person who plays the trombone is called a trombonist or \
+ trombone player.",
+ "Remember, compromise is for those without backbones!",
+ "If you go up to the captain and say the word 'bone' repeatedly, \
+ eventually he'll brig you.",
+ "Yo ho ho, shiver me bones!",
+ "So what you're saying is, you only love me for my legs?",
+ "You will never again find socks that match!",
+ "BONES! BONES! BONES!",
+ "Bones absorb x-rays, which is why radiation gives you superpowers.",
+ "Oh-cee! The ORIGINAL CONTENT SKELETON. Suitable for ages 36 months \
+ and up.",
+ "I just don't have the heart to judge you.",
+ "I don't have the stomach for this.",
+ "I'm a fighter, not a liver.",
+ "How can I see without eyeballs?",
+ "Ask your parents about 'boning', before you get pregnant.",
+ "Remember, a dog is for life, not just for christmas.")
+
+/obj/item/toy/talking/skeleton/suicide_act(mob/user)
+ user.visible_message("[user] is trying to commit \
+ suicide with \the [src].")
+
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ H.set_species(/datum/species/skeleton)
+
+ phomeme = "sans"
+ toy_talk(user, "You feel like you're going to have a bad time.")
+
+ user.Stun(5)
+ sleep(20)
+ return OXYLOSS
+
+/obj/item/toy/talking/skeleton/generate_messages()
+ return list(pick(papyrus_messages + sans_messages + regular_messages))
+
+/obj/item/toy/talking/skeleton/toy_talk(user, message)
+ // change spans dynamically depending on the message
+ // If message isn't in the defined lists, just use whatever was set last
+ if(sans_messages.Find(message))
+ phomeme = "sans"
+ if(papyrus_messages.Find(message))
+ phomeme = "papyrus"
+ if(regular_messages.Find(message))
+ phomeme = pick("sans", "papyrus")
+
+ span = "danger [phomeme]"
+ ..()
/*
|| A Deck of Cards for playing various games of chance ||
diff --git a/code/modules/cargo/packs.dm b/code/modules/cargo/packs.dm
index e99827f9ca7..11e7e46ff87 100644
--- a/code/modules/cargo/packs.dm
+++ b/code/modules/cargo/packs.dm
@@ -1356,9 +1356,10 @@
contains = list(/obj/item/toy/spinningtoy,
/obj/item/toy/sword,
/obj/item/toy/foamblade,
- /obj/item/toy/AI,
+ /obj/item/toy/talking/AI,
/obj/item/toy/talking/owl,
/obj/item/toy/talking/griffin,
+ /obj/item/toy/talking/skeleton,
/obj/item/toy/nuke,
/obj/item/toy/minimeteor,
/obj/item/toy/carpplushie,
diff --git a/code/modules/chatter/chatter.dm b/code/modules/chatter/chatter.dm
new file mode 100644
index 00000000000..25226c07c12
--- /dev/null
+++ b/code/modules/chatter/chatter.dm
@@ -0,0 +1,57 @@
+/proc/chatter(message, phomeme, atom/A)
+ // We want to transform any message into a list of numbers
+ // and punctuation marks
+ // For example:
+ // "Hi." -> [2, '.']
+ // "HALP GEROGE MELLONS, that swine, is GRIFFIN ME!"
+ // -> [4, 6, 7, ',', 4, 5, ',', '2', 7, 2, '!']
+ // "fuck,thissentenceissquashed" -> [4, ',', 21]
+
+ var/list/punctuation = list(",",":",";",".","?","!","\'","-")
+ var/regex/R = regex("(\[\\l\\d]*)(\[^\\l\\d\\s])?", "g")
+ var/list/letter_count = list()
+ while(R.next <= length(message))
+ R.Find(message)
+ if(R.group[1])
+ letter_count += length(R.group[1])
+ if(R.group[2])
+ letter_count += R.group[2]
+
+ spawn(0)
+ for(var/item in letter_count)
+ if (item in punctuation)
+ // simulate pausing in talking
+ // ignore semi-colons because of their use in HTML escaping
+ if (item in list(",", ":"))
+ sleep(3)
+ if (item in list("!", "?", "."))
+ sleep(6)
+ continue
+
+ if(isnum(item))
+ var/length = min(item, 10)
+ if (length == 0)
+ // "verbalise" long spaces
+ sleep(1)
+ chatter_speak_word(A.loc, phomeme, length)
+
+/proc/chatter_speak_word(loc, phomeme, length)
+ var/path = "sound/chatter/[phomeme]_[length].ogg"
+
+ playsound(loc, path,
+ vol = 40, vary = 0, extrarange = 3, falloff = FALSE, surround = 1)
+
+ sleep((length + 1) * chatter_get_sleep_multiplier(phomeme))
+
+/proc/chatter_get_sleep_multiplier(phomeme)
+ // These values are tenths of seconds, so 0.5 == 0.05seconds
+ . = 1
+ switch(phomeme)
+ if("papyrus")
+ . = 0.5
+ if("griffin")
+ . = 0.5
+ if("sans")
+ . = 0.7
+ if("owl")
+ . = 0.7
diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm
index dbaaed335fb..1b47c0172f6 100644
--- a/code/modules/surgery/organs/organ_internal.dm
+++ b/code/modules/surgery/organs/organ_internal.dm
@@ -370,7 +370,7 @@
say_mod = "rattles"
attack_verb = list("bitten", "chattered", "chomped", "enamelled", "boned")
- var/chatter = FALSE
+ var/chattering = FALSE
var/phomeme_type = "sans"
var/list/phomeme_types = list("sans", "papyrus")
@@ -381,9 +381,9 @@
/obj/item/organ/tongue/bone/TongueSpeech(var/message)
. = message
- if(chatter)
+ if(chattering)
//Annoy everyone nearby with your chattering.
- return
+ chatter(message, phomeme_type, usr)
/obj/item/organ/tongue/bone/get_spans()
. = ..()
@@ -396,7 +396,7 @@
/obj/item/organ/tongue/bone/chatter
name = "chattering bone \"tongue\""
- chatter = TRUE
+ chattering = TRUE
/obj/item/organ/appendix
name = "appendix"
diff --git a/icons/obj/toy.dmi b/icons/obj/toy.dmi
index 5d3b690b1b8..29fa57fe523 100644
Binary files a/icons/obj/toy.dmi and b/icons/obj/toy.dmi differ
diff --git a/sound/chatter/griffin_1.ogg b/sound/chatter/griffin_1.ogg
new file mode 100644
index 00000000000..32e1333588d
Binary files /dev/null and b/sound/chatter/griffin_1.ogg differ
diff --git a/sound/chatter/griffin_10.ogg b/sound/chatter/griffin_10.ogg
new file mode 100644
index 00000000000..0d161ee5edb
Binary files /dev/null and b/sound/chatter/griffin_10.ogg differ
diff --git a/sound/chatter/griffin_2.ogg b/sound/chatter/griffin_2.ogg
new file mode 100644
index 00000000000..4ae4de2595f
Binary files /dev/null and b/sound/chatter/griffin_2.ogg differ
diff --git a/sound/chatter/griffin_3.ogg b/sound/chatter/griffin_3.ogg
new file mode 100644
index 00000000000..28b65b852a6
Binary files /dev/null and b/sound/chatter/griffin_3.ogg differ
diff --git a/sound/chatter/griffin_4.ogg b/sound/chatter/griffin_4.ogg
new file mode 100644
index 00000000000..2d6612c7c00
Binary files /dev/null and b/sound/chatter/griffin_4.ogg differ
diff --git a/sound/chatter/griffin_5.ogg b/sound/chatter/griffin_5.ogg
new file mode 100644
index 00000000000..61258463922
Binary files /dev/null and b/sound/chatter/griffin_5.ogg differ
diff --git a/sound/chatter/griffin_6.ogg b/sound/chatter/griffin_6.ogg
new file mode 100644
index 00000000000..43520cddf2a
Binary files /dev/null and b/sound/chatter/griffin_6.ogg differ
diff --git a/sound/chatter/griffin_7.ogg b/sound/chatter/griffin_7.ogg
new file mode 100644
index 00000000000..b3ce436e4e5
Binary files /dev/null and b/sound/chatter/griffin_7.ogg differ
diff --git a/sound/chatter/griffin_8.ogg b/sound/chatter/griffin_8.ogg
new file mode 100644
index 00000000000..bbf51f98774
Binary files /dev/null and b/sound/chatter/griffin_8.ogg differ
diff --git a/sound/chatter/griffin_9.ogg b/sound/chatter/griffin_9.ogg
new file mode 100644
index 00000000000..806c67de2f4
Binary files /dev/null and b/sound/chatter/griffin_9.ogg differ
diff --git a/sound/chatter/owl_1.ogg b/sound/chatter/owl_1.ogg
new file mode 100644
index 00000000000..3d41497d44b
Binary files /dev/null and b/sound/chatter/owl_1.ogg differ
diff --git a/sound/chatter/owl_10.ogg b/sound/chatter/owl_10.ogg
new file mode 100644
index 00000000000..97f45d43378
Binary files /dev/null and b/sound/chatter/owl_10.ogg differ
diff --git a/sound/chatter/owl_2.ogg b/sound/chatter/owl_2.ogg
new file mode 100644
index 00000000000..4937ee09fe3
Binary files /dev/null and b/sound/chatter/owl_2.ogg differ
diff --git a/sound/chatter/owl_3.ogg b/sound/chatter/owl_3.ogg
new file mode 100644
index 00000000000..7c8524e933d
Binary files /dev/null and b/sound/chatter/owl_3.ogg differ
diff --git a/sound/chatter/owl_4.ogg b/sound/chatter/owl_4.ogg
new file mode 100644
index 00000000000..c1e8ee7635b
Binary files /dev/null and b/sound/chatter/owl_4.ogg differ
diff --git a/sound/chatter/owl_5.ogg b/sound/chatter/owl_5.ogg
new file mode 100644
index 00000000000..1210b05ac39
Binary files /dev/null and b/sound/chatter/owl_5.ogg differ
diff --git a/sound/chatter/owl_6.ogg b/sound/chatter/owl_6.ogg
new file mode 100644
index 00000000000..b965678688d
Binary files /dev/null and b/sound/chatter/owl_6.ogg differ
diff --git a/sound/chatter/owl_7.ogg b/sound/chatter/owl_7.ogg
new file mode 100644
index 00000000000..fc330687a11
Binary files /dev/null and b/sound/chatter/owl_7.ogg differ
diff --git a/sound/chatter/owl_8.ogg b/sound/chatter/owl_8.ogg
new file mode 100644
index 00000000000..e350b5be811
Binary files /dev/null and b/sound/chatter/owl_8.ogg differ
diff --git a/sound/chatter/owl_9.ogg b/sound/chatter/owl_9.ogg
new file mode 100644
index 00000000000..ec195a222f8
Binary files /dev/null and b/sound/chatter/owl_9.ogg differ
diff --git a/sound/chatter/papyrus_1.ogg b/sound/chatter/papyrus_1.ogg
new file mode 100644
index 00000000000..ee595949684
Binary files /dev/null and b/sound/chatter/papyrus_1.ogg differ
diff --git a/sound/chatter/papyrus_10.ogg b/sound/chatter/papyrus_10.ogg
new file mode 100644
index 00000000000..8e1599ff905
Binary files /dev/null and b/sound/chatter/papyrus_10.ogg differ
diff --git a/sound/chatter/papyrus_2.ogg b/sound/chatter/papyrus_2.ogg
new file mode 100644
index 00000000000..6c22cb17847
Binary files /dev/null and b/sound/chatter/papyrus_2.ogg differ
diff --git a/sound/chatter/papyrus_3.ogg b/sound/chatter/papyrus_3.ogg
new file mode 100644
index 00000000000..799f78adc6b
Binary files /dev/null and b/sound/chatter/papyrus_3.ogg differ
diff --git a/sound/chatter/papyrus_4.ogg b/sound/chatter/papyrus_4.ogg
new file mode 100644
index 00000000000..8c401d3ec9d
Binary files /dev/null and b/sound/chatter/papyrus_4.ogg differ
diff --git a/sound/chatter/papyrus_5.ogg b/sound/chatter/papyrus_5.ogg
new file mode 100644
index 00000000000..a6070313f91
Binary files /dev/null and b/sound/chatter/papyrus_5.ogg differ
diff --git a/sound/chatter/papyrus_6.ogg b/sound/chatter/papyrus_6.ogg
new file mode 100644
index 00000000000..dade77ce1ab
Binary files /dev/null and b/sound/chatter/papyrus_6.ogg differ
diff --git a/sound/chatter/papyrus_7.ogg b/sound/chatter/papyrus_7.ogg
new file mode 100644
index 00000000000..6fb3d9c943c
Binary files /dev/null and b/sound/chatter/papyrus_7.ogg differ
diff --git a/sound/chatter/papyrus_8.ogg b/sound/chatter/papyrus_8.ogg
new file mode 100644
index 00000000000..11f602756cc
Binary files /dev/null and b/sound/chatter/papyrus_8.ogg differ
diff --git a/sound/chatter/papyrus_9.ogg b/sound/chatter/papyrus_9.ogg
new file mode 100644
index 00000000000..cd0c03525ea
Binary files /dev/null and b/sound/chatter/papyrus_9.ogg differ
diff --git a/sound/chatter/sans_1.ogg b/sound/chatter/sans_1.ogg
new file mode 100644
index 00000000000..795ee2aab2c
Binary files /dev/null and b/sound/chatter/sans_1.ogg differ
diff --git a/sound/chatter/sans_10.ogg b/sound/chatter/sans_10.ogg
new file mode 100644
index 00000000000..916dfc05ca4
Binary files /dev/null and b/sound/chatter/sans_10.ogg differ
diff --git a/sound/chatter/sans_2.ogg b/sound/chatter/sans_2.ogg
new file mode 100644
index 00000000000..6a1ba578176
Binary files /dev/null and b/sound/chatter/sans_2.ogg differ
diff --git a/sound/chatter/sans_3.ogg b/sound/chatter/sans_3.ogg
new file mode 100644
index 00000000000..98d6016cda9
Binary files /dev/null and b/sound/chatter/sans_3.ogg differ
diff --git a/sound/chatter/sans_4.ogg b/sound/chatter/sans_4.ogg
new file mode 100644
index 00000000000..878bee1f667
Binary files /dev/null and b/sound/chatter/sans_4.ogg differ
diff --git a/sound/chatter/sans_5.ogg b/sound/chatter/sans_5.ogg
new file mode 100644
index 00000000000..a59781f6364
Binary files /dev/null and b/sound/chatter/sans_5.ogg differ
diff --git a/sound/chatter/sans_6.ogg b/sound/chatter/sans_6.ogg
new file mode 100644
index 00000000000..9bad5fc6d52
Binary files /dev/null and b/sound/chatter/sans_6.ogg differ
diff --git a/sound/chatter/sans_7.ogg b/sound/chatter/sans_7.ogg
new file mode 100644
index 00000000000..172d253ab61
Binary files /dev/null and b/sound/chatter/sans_7.ogg differ
diff --git a/sound/chatter/sans_8.ogg b/sound/chatter/sans_8.ogg
new file mode 100644
index 00000000000..e786f597caf
Binary files /dev/null and b/sound/chatter/sans_8.ogg differ
diff --git a/sound/chatter/sans_9.ogg b/sound/chatter/sans_9.ogg
new file mode 100644
index 00000000000..3901a032185
Binary files /dev/null and b/sound/chatter/sans_9.ogg differ
diff --git a/tgstation.dme b/tgstation.dme
index 786ab440ca6..d2affc0e6c8 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -954,6 +954,7 @@
#include "code\modules\cargo\exports\sheets.dm"
#include "code\modules\cargo\exports\tools.dm"
#include "code\modules\cargo\exports\weapons.dm"
+#include "code\modules\chatter\chatter.dm"
#include "code\modules\client\asset_cache.dm"
#include "code\modules\client\client defines.dm"
#include "code\modules\client\client procs.dm"