blob: 4bbbf530723bcc1eab1bf2cd9b6e4d3d52d84c12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
class GameController < ApplicationController
def toggle_resting
if current_char.resting?
if current_char.stop_resting
flash[:notice] = "You stop resting. You now have #{current_char.rested_duration} seconds of rest."
else
flash[:alert] = "Failed to stop resting. Are you sure you're resting?"
end
else
if current_char.start_resting
flash[:notice] = "You are now resting."
else
flash[:alert] = "Failed to start resting. Are you already resting?"
end
end
redirect_to character_path(current_char)
end
def stop_activity
current_char.stop_activity
redirect_to look_path
end
def finish_activity
@results = ActivityProcessor.new(current_char).results
end
end
|