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.
- Loading branch information
Showing
14 changed files
with
124 additions
and
20 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
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,8 @@ | ||
class Slipvector | ||
ELMOS = { | ||
energy: "⚡️ Energy", | ||
life: "🧬 Life", | ||
matter: "⚛️ Matter", | ||
oddities: "⁉️ Oddity" | ||
} | ||
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class Slipvector | ||
class StarSystem::Experience | ||
include StoreModel::Model | ||
|
||
attribute :energy, :integer, default: 0 | ||
attribute :energy_level, :integer, default: 1 | ||
attribute :life, :integer, default: 0 | ||
attribute :life_level, :integer, default: 1 | ||
attribute :matter, :integer, default: 0 | ||
attribute :matter_level, :integer, default: 1 | ||
attribute :oddities, :integer, default: 0 | ||
attribute :oddities_level, :integer, default: 1 | ||
|
||
def bump(result) | ||
assign_attributes({result.elmo => attribute(result.elmo) + result.xp}) | ||
end | ||
|
||
def pools | ||
@experience ||= [ | ||
Level.new(elmo: :energy, xp: energy, level: energy_level), | ||
Level.new(elmo: :life, xp: life, level: life_level), | ||
Level.new(elmo: :matter, xp: matter, level: matter_level), | ||
Level.new(elmo: :oddities, xp: oddities, level: oddities_level) | ||
] | ||
end | ||
|
||
class Level < DataLevel | ||
attribute :level, :integer, default: 0 | ||
|
||
def next_level_xp | ||
level * 125 | ||
end | ||
|
||
def ready_for_level_up? | ||
xp > next_level_xp | ||
end | ||
|
||
end | ||
end | ||
end |
21 changes: 19 additions & 2 deletions
21
app/furniture/slipvector/star_systems/_star_system.html.erb
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
1 change: 1 addition & 0 deletions
1
app/furniture/slipvector/surveyors_guilds/_surveyors_guild.html.erb
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,3 +0,0 @@ | ||
<div> | ||
<h3><%= survey.id %></h3> | ||
</div> | ||
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