Skip to content

Commit

Permalink
Goon Port tgstation#1: Stock Market
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewJacksonThe2nd committed Mar 5, 2016
1 parent f7bd1fe commit afd0a20
Show file tree
Hide file tree
Showing 13 changed files with 1,442 additions and 125 deletions.
14 changes: 6 additions & 8 deletions code/controllers/subsystem/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ var/datum/subsystem/shuttle/SSshuttle
//supply shuttle stuff
var/obj/docking_port/mobile/supply/supply
var/ordernum = 1 //order number given to next order
var/points = 50 //number of trade-points we have
var/points_per_decisecond = 0.005 //points gained every decisecond
var/points_per_manifest = 2 //points gained per manifest returned
var/points_per_crate = 5 //points gained per crate returned
var/points_per_intel = 250 //points gained per intel returned
var/points_per_plasma = 5 //points gained per plasma returned
var/points_per_design = 25 //points gained per max reliability research design returned (only for initilally unreliable designs)
var/points = 5000 //number of trade-points we have
var/points_per_manifest = 200 //points gained per manifest returned
var/points_per_crate = 500 //points gained per crate returned
var/points_per_intel = 25000 //points gained per intel returned
var/points_per_plasma = 500 //points gained per plasma returned
var/points_per_design = 2500 //points gained per max reliability research design returned (only for initilally unreliable designs)
var/centcom_message = "" //Remarks from Centcom on how well you checked the last order.
var/list/discoveredPlants = list() //Typepaths for unusual plants we've already sent CentComm, associated with their potencies
var/list/techLevels = list()
Expand Down Expand Up @@ -63,7 +62,6 @@ var/datum/subsystem/shuttle/SSshuttle


/datum/subsystem/shuttle/fire()
points += points_per_decisecond * wait
for(var/thing in mobile)
if(thing)
var/obj/docking_port/mobile/P = thing
Expand Down
16 changes: 16 additions & 0 deletions code/controllers/subsystem/stock_market.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var/datum/subsystem/stock_market/SSstockmarket

/datum/subsystem/stock_market
name = "Stock Market"
wait = 15
priority = 16
display = 6

can_fire = 0 // This needs to fire before round start.

/datum/subsystem/stock_market/New()
NEW_SS_GLOBAL(SSstockmarket)

/datum/subsystem/stock_market/fire()
if(stockExchange)
stockExchange.process()
14 changes: 14 additions & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ var/datum/subsystem/ticker/ticker
var/obj/screen/cinematic = null //used for station explosion cinematic

var/maprotatechecked = 0
var/round_elapsed_ticks = 0
var/round_time_check = 0


/datum/subsystem/ticker/New()
Expand Down Expand Up @@ -104,6 +106,7 @@ var/datum/subsystem/ticker/ticker
mode.process(wait * 0.1)
check_queue()
check_maprotate()
update_round_ticks()

if(!mode.explosion_in_progress && mode.check_finished() || force_ending)
current_state = GAME_STATE_FINISHED
Expand Down Expand Up @@ -174,6 +177,7 @@ var/datum/subsystem/ticker/ticker
if(!config.ooc_during_round)
toggle_ooc(0) // Turn it off
round_start_time = world.time
round_time_check = world.timeofday

start_landmarks_list = shuffle(start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left
create_characters() //Create player characters and transfer them
Expand Down Expand Up @@ -207,6 +211,16 @@ var/datum/subsystem/ticker/ticker

return 1

/datum/subsystem/ticker/proc/update_round_ticks()
if(round_time_check)
var/elapsed = world.timeofday - round_time_check
round_time_check = world.timeofday

if (round_time_check == 0) // on the slim chance that this happens exactly on a timeofday rollover
round_time_check = 1 // make it nonzero so it doesn't quit updating

if (elapsed > 0)
round_elapsed_ticks += elapsed

//Plus it provides an easy way to make cinematics for other events. Just use this as a template
/datum/subsystem/ticker/proc/station_explosion_cinematic(station_missed=0, override = null)
Expand Down
Loading

0 comments on commit afd0a20

Please sign in to comment.