blob: c115abbbb80fbfa71ac8ad5e929264840f7a7e58 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
class ActivitiesController < ApplicationController
def show
@activity = Activity.find(params[:id])
end
def start
@activity = Activity.find(params[:id])
if current_char.start_activity(@activity, queued_actions: params[:queued_actions])
redirect_to look_path
else
message = "You can't do that."
message += " (requires #{@activity.requirements&.join(", ")})" if @activity.requirements.any?
message += " (costs #{@activity.costs&.join(", ")})" if @activity.costs.any?
flash[:alert] = message
redirect_back(fallback_location: character_path(current_char))
end
end
end
|