forked from zinc-collective/convene
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start inking in the line-of-action for the middle gameplay loop
- Loading branch information
Showing
14 changed files
with
148 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Slipvector | ||
class CrewmatePolicy < ApplicationPolicy | ||
alias_method :crewmate, :object | ||
|
||
def create? | ||
person&.operator? || current_person.surveyor == crewmate.surveyor | ||
end | ||
|
||
alias_method :update?, :create? | ||
|
||
class Scope < ApplicationScope | ||
def resolve | ||
scope.all | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<%= render CardComponent.new do |card| %> | ||
<h3>Captain Darvin</h3> | ||
<p>Welcome, <%= crewmate.surveyor.name %>!</p> | ||
|
||
<p>It seems like you're interested in joining us on our survey of | ||
<%= survey.star_system.name %>!</p> | ||
|
||
<p>I know, quite a mouthful! Don't worry, if we find anything interesting | ||
we'll give it an easier name!</p> | ||
|
||
<p>I'm Captain Darvin, and my job is to make sure we arrive and return | ||
safely.</p> | ||
|
||
<p>Your job is to collect observations.</p> | ||
|
||
<p>Ready?</p> | ||
|
||
<%- card.with_footer(variant: :action_bar) do %> | ||
<a href="<%= href_to(surveyors_guild) %>" | ||
class="button --secondary w-1/2">Wait a sec, I'm not ready...</a> | ||
|
||
<%= button_to "Let's Go!", survey.location(child: :crewmates), form_class: "w-1/2", class: "w-full --primary" %> | ||
<%- end %> | ||
<%- end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Slipvector | ||
class CrewmatesController < Controller | ||
expose :crewmate, scope: -> { policy_scope(survey.crewmates) }, model: Crewmate, | ||
build: ->(params, scope) { scope.new(params.merge(surveyor: current_surveyor)) } | ||
expose :survey, scope: -> { policy_scope(surveyors_guild.surveys.seeking_crew) }, model: Survey | ||
|
||
def new | ||
authorize(crewmate) | ||
end | ||
|
||
def create | ||
authorize(crewmate) | ||
if crewmate.save | ||
redirect_to survey.location, notice: t(".success") | ||
else | ||
render :new, status: :unprocessable_entity | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
space = if Space.exists?(name: "Slipvector Demo") | ||
Space.find_by(name: "Slipvector Demo") | ||
else | ||
FactoryBot.create(:space, :with_entrance, name: "Slipvector Demo") | ||
FactoryBot.create(:space, name: "Slipvector Demo") | ||
end | ||
|
||
sol_system = if space.rooms.exists?(name: "Sol System") | ||
space.rooms.find_by(name: "Sol System") | ||
else | ||
FactoryBot.create(:room, name: "Sol System", space:) | ||
end | ||
|
||
space.update(entrance: sol_system) | ||
|
||
unless space.entrance.gizmos.exists?(furniture_kind: :slipvector_surveyors_guild) | ||
FactoryBot.create(:slipvector_surveyors_guild, room: space.entrance) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
<%- breadcrumb :slipvector_surveyor, surveyor %> | ||
<div class="my-4"> | ||
<%= link_to("⬅️ Back to #{surveyors_guild.room.name}", surveyors_guild.location) %> | ||
</div> | ||
|
||
<%= render surveyor %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
<%- breadcrumb :slipvector_survey, survey %> | ||
<div class="my-4"> | ||
<%= link_to("⬅️ Back to #{star_system.name}", survey.star_system.location) %> | ||
</div> | ||
<%= render CardComponent.new do |card| %> | ||
<%- card.with_header do %> | ||
<h2><%= survey.id %></h2> | ||
<p class="text-sm">Surveying <%= survey.star_system.name %></p> | ||
<%- end %> | ||
<p>Gathered... | ||
<ul> | ||
<%- survey.results.each do |result| %> | ||
<li><%= result.xp %> <%= result.label %></li> | ||
<%- end %> | ||
</ul> | ||
<%- if !survey.preparing? %> | ||
|
||
<p>Gathered... | ||
<ul> | ||
<%- survey.results.each do |result| %> | ||
<li><%= result.xp %> <%= result.label %></li> | ||
<%- end %> | ||
</ul> | ||
<%- end %> | ||
<%- card.with_footer(variant: :action_bar) do %> | ||
<%- if survey.active? %> | ||
<%= button_to("Complete Survey", survey.location, form_class: "w-full", class: "w-full", params: { survey: { status: :complete } })%> | ||
<%= button_to("Complete Survey", survey.location, form_class: "w-full", class: "w-full --primary", params: { survey: { status: :complete } })%> | ||
<%- elsif survey.preparing? %> | ||
<%= link_to("Mmmm, one sec...", surveyors_guild.location, class: "button w-1/2") %> | ||
<%= button_to("Embark", survey.location, form_class: "w-1/2", class: "w-full --primary", params: { survey: { status: :active } })%> | ||
<%- end %> | ||
<%- end %> | ||
<%- end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters