Commit d3549419 authored by Joe Libipl's avatar Joe Libipl
Browse files

Plot points.

parent 2f003ae9
Pipeline #10825979 passed with stage
in 1 minute and 10 seconds
......@@ -110,6 +110,15 @@ class SMSBeholder < Sinatra::Base
puts "returning selections: #{selections}"
selections
end
def self.plot_points(state)
if @states[state] && @states[state].key?('plotPoint')
@states[state]['plotPoint']
else
{}
end
end
end
player_data = {}
......@@ -176,6 +185,11 @@ class SMSBeholder < Sinatra::Base
response += "\n#{index + 1}) #{selection.first}"
end
GameStates.plot_points(state).each_pair do |key, value|
player[key] = value
puts "Plot point set player key #{key} to #{value}, and now player is #{player}"
end
# Fill in values in response
player.keys.each do |key|
puts "Filling in key #{key}"
......
......@@ -185,6 +185,13 @@ describe SMSBeholder do
expect(last_response.body).to include("Hehe. You're such a nerd")
end
it 'sets conditions at plot points' do
get '/', From: @dude, SkipToState: 'D1S307'
get '/', From: @dude, SkipToState: 'S02'
expect(last_response.body).to include("hang out by the dumpster.")
end
it 'can be played all the way through' do
get '/', From: @dude
Timeout::timeout(10) do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment