diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index d980b469f94..99fdee15ca7 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -1,24 +1,15 @@ -/obj/machinery/computer/arcade - name = "arcade machine" - desc = "Does not support Pin ball." +/obj/machinery/computer/arcade/ + name = "random arcade" + desc = "random arcade machine" icon = 'icons/obj/computer.dmi' icon_state = "arcade" - circuit = "/obj/item/weapon/circuitboard/arcade" - var/enemy_name = "Space Villian" - var/temp = "Winners Don't Use Spacedrugs" //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/list/prizes = list( /obj/item/weapon/storage/box/snappops = 2, - /obj/item/toy/blink = 2, /obj/item/clothing/under/syndicate/tacticool = 2, + /obj/item/toy/blink = 2, + /obj/item/clothing/suit/syndicatefake = 2, /obj/item/toy/sword = 2, /obj/item/toy/gun = 2, /obj/item/toy/crossbow = 2, - /obj/item/clothing/suit/syndicatefake = 2, /obj/item/weapon/storage/fancy/crayons = 2, /obj/item/toy/spinningtoy = 2, /obj/item/toy/prize/ripley = 1, @@ -34,11 +25,62 @@ /obj/item/toy/prize/phazon = 1 ) -/obj/machinery/computer/arcade - var/turtle = 0 - /obj/machinery/computer/arcade/New() ..() + var/choice = pick(typesof(/obj/machinery/computer/arcade) - /obj/machinery/computer/arcade) + new choice(loc) + del(src) + +/obj/machinery/computer/arcade/proc/prizevend() + 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) + if(stat & (NOPOWER|BROKEN)) + ..(severity) + 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(num_of_prizes; num_of_prizes > 0; num_of_prizes--) + empprize = pickweight(prizes) + new empprize(src.loc) + + ..(severity) + + +/obj/machinery/computer/arcade/battle + name = "arcade machine" + desc = "Does not support Pinball." + icon = 'icons/obj/computer.dmi' + icon_state = "arcade" + circuit = /obj/item/weapon/circuitboard/arcade + var/enemy_name = "Space Villian" + var/temp = "Winners Don't Use Spacedrugs" //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 @@ -51,14 +93,7 @@ src.enemy_name = replacetext((name_part1 + name_part2), "the ", "") src.name = (name_action + name_part1 + name_part2) - -/obj/machinery/computer/arcade/attack_ai(mob/user as mob) - return src.attack_hand(user) - -/obj/machinery/computer/arcade/attack_paw(mob/user as mob) - return src.attack_hand(user) - -/obj/machinery/computer/arcade/attack_hand(mob/user as mob) +/obj/machinery/computer/arcade/battle/attack_hand(mob/user as mob) if(..()) return user.set_machine(src) @@ -77,11 +112,15 @@ dat += "" - user << browse(dat, "window=arcade") - onclose(user, "arcade") + //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/Topic(href, href_list) +/obj/machinery/computer/arcade/battle/Topic(href, href_list) if(..()) return @@ -146,7 +185,7 @@ src.updateUsrDialog() return -/obj/machinery/computer/arcade/proc/arcade_action() +/obj/machinery/computer/arcade/battle/proc/arcade_action() if ((src.enemy_mp <= 0) || (src.enemy_hp <= 0)) if(!gameover) src.gameover = 1 @@ -160,21 +199,9 @@ log_game("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.") src.New() emagged = 0 - else if(!contents.len) - feedback_inc("arcade_win_normal") - 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 feedback_inc("arcade_win_normal") - var/atom/movable/prize = pick(contents) - prize.loc = src.loc + prizevend() else if (emagged && (turtle >= 4)) var/boomamt = rand(5,10) @@ -220,7 +247,7 @@ return -/obj/machinery/computer/arcade/attackby(I as obj, user as mob) +/obj/machinery/computer/arcade/battle/attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/card/emag) && !emagged) temp = "If you die in the game, you die for real!" player_hp = 30 @@ -237,40 +264,285 @@ src.updateUsrDialog() - else if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/arcade/M = new /obj/item/weapon/circuitboard/arcade( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.anchored = 1 + else + ..() + return - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - new /obj/item/weapon/shard( src.loc ) - A.state = 3 - A.icon_state = "3" - else - user << "\blue You disconnect the monitor." - A.state = 4 - A.icon_state = "4" - del(src) -/obj/machinery/computer/arcade/emp_act(severity) - if(stat & (NOPOWER|BROKEN)) - ..(severity) + + + +/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 = 'icons/obj/computer.dmi' + icon_state = "arcade" + circuit = /obj/item/weapon/circuitboard/arcade/orion_trail + var/engine = 0 + var/hull = 0 + var/electronics = 0 + var/food = 80 + var/fuel = 60 + var/turns = 4 + var/playing = 0 + var/gameover = 0 + var/alive = 4 + var/eventdat = null + var/event = null + var/list/settlers = list("Harry","Larry","Bob") + var/list/events = list("Raiders" = 3, + "Interstellar Flux" = 1, + "Illness" = 3, + "Breakdown" = 2, + "Malfunction" = 2, + "Collision" = 1 + ) + var/list/stops = list() + var/list/stopblurbs = list() + +/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 miss-guided judgement.", + "The nearest star system to Sol, in ages past it stood as a reminder of the boundaries of sub-light travel, now it is a low-population sanctuary for adventureres 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 it's planetary bodies in warmth and radiation.", + "Tau Ceti Beta has recently become a way-point for colonists headed towards Orion. There are many ships and makeshift stations in the viscinity.", + "Sensors indicate a black-hole's gravitational field is affecting the region of space we were headed through. We could stay the course, but risk being over-come by it's 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 colonist's success.", + "You have made it to Orion! Congratulations! Your crew is one of the few to start a new foothold for man-kind!" + ) + +/obj/machinery/computer/arcade/orion_trail/proc/newgame() + // Set names of settlers in crew + settlers = list() + var/choice = null + for(var/i = 1; i <= 3; i++) + if(prob(50)) + choice = pick(first_names_male) + else + choice = pick(first_names_female) + settlers += choice + settlers += "[usr]" + // Re-set items to defaults + engine = 1 + hull = 1 + electronics = 1 + food = 80 + fuel = 60 + alive = 4 + turns = 1 + event = null + playing = 1 + gameover = 0 + +/obj/machinery/computer/arcade/orion_trail/attack_hand(mob/user as mob) + if(fuel <= 0 || food <=0 || settlers.len == 0) + gameover = 1 + event = null + user.set_machine(src) + var/dat = "" + if(gameover) + dat = "