From 4c96893a114059dc4e748307c6d046ec1faa778f Mon Sep 17 00:00:00 2001
From: David Gay You have <%= @hearth.available_planting_spots %> available planting spots. Ripens in <%= distance_of_time_in_words_to_now(hp.ripens_at) %>Loamspire
+
+<%= hp.item.name %>
+ <% if hp.ripens_at > Time.now %>
+
You constructed <%= result[:hearth_amenity].name %>.
+ <% when "hearth_planting" %> +You planted <%= link_to result[:hearth_planting].item.name, + item_path(result[:hearth_planting].item) %> in the loam.
<% when "activity" %>You realized how to <%= result[:activity].name %>!
<% when "monster" %> diff --git a/config/routes.rb b/config/routes.rb index 88d75ef..4dea419 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,6 +33,7 @@ Rails.application.routes.draw do post "/activate", to: "titles#activate" end get "/hearth", to: "hearth#index" + get "/hearth/loamspire", to: "hearth/hearth_plantings#index" end end diff --git a/data/activities.yml b/data/activities.yml index 8208d26..7ab2413 100644 --- a/data/activities.yml +++ b/data/activities.yml @@ -203,6 +203,220 @@ construct_loamspire_level2: - type: "hearth_amenity" gid: "loamspire" level: 2 +plant_mudtub_seed: + name: "Plant Mudtub Seed" + description: "Plant a mudtub seed." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + duration: + base: 120 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "item" + gid: "mudtub_seed" + results: + - type: "hearth_planting" + gid: "mudtub_seed" +harvest_mudtub: + name: "Harvest Mudtub" + description: "Harvest a mudtub." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + duration: + base: 120 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "hearth_planting" + gid: "mudtub_seed" + results: + - type: "item" + gid: "mudtub" + xp: + - gid: "magiculture" + value: 10 +plant_midorias_seed: + name: "Plant Midorias Seed" + description: "Plant a midorias seed." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + - type: "skill" + gid: "magiculture" + level: 2 + duration: + base: 130 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "item" + gid: "midorias_seed" + results: + - type: "hearth_planting" + gid: "midorias_seed" +harvest_midorias: + name: "Harvest Midorias" + description: "Harvest a midorias." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + - type: "skill" + gid: "magiculture" + level: 2 + duration: + base: 130 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "hearth_planting" + gid: "midorias_seed" + results: + - type: "item" + gid: "midorias" + xp: + - gid: "magiculture" + value: 15 +plant_templis_seed: + name: "Plant Templis Seed" + description: "Plant a templis seed." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + - type: "skill" + gid: "magiculture" + level: 4 + duration: + base: 140 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "item" + gid: "templis_seed" + results: + - type: "hearth_planting" + gid: "templis_seed" +harvest_templis: + name: "Harvest Templis" + description: "Harvest a templis." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + - type: "skill" + gid: "magiculture" + level: 4 + duration: + base: 140 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "hearth_planting" + gid: "templis_seed" + results: + - type: "item" + gid: "templis" + xp: + - gid: "magiculture" + value: 30 +plant_enzon_seed: + name: "Plant Enzon Seed" + description: "Plant an enzon seed." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + - type: "skill" + gid: "magiculture" + level: 7 + duration: + base: 150 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "item" + gid: "enzon_seed" + results: + - type: "hearth_planting" + gid: "enzon_seed" +harvest_enzon: + name: "Harvest Enzon" + description: "Harvest an enzon." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "loamspire" + level: 1 + - type: "skill" + gid: "magiculture" + level: 7 + duration: + base: 150 + scaling: + - type: "skill" + gid: "magiculture" + scale_value: 1 + - type: "stat" + gid: "magiculture_speed" + scale_value: 1 + cost: + - type: "hearth_planting" + gid: "enzon_seed" + results: + - type: "item" + gid: "enzon" + xp: + - gid: "magiculture" + value: 45 craft_pig_iron_ingot: name: "Smelt Pig Iron Ingot" description: "Smelt a pig iron ingot." @@ -777,6 +991,37 @@ craft_iron_axe: xp: - gid: "otherforge" value: 15 +craft_iron_spade: + name: "Craft Iron Spade" + description: "Craft an iron spade." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "forge" + level: 1 + duration: + base: 120 + minimum: 35 + scaling: + - type: "skill" + gid: "otherforge" + scale_value: 1 + - type: "stat" + gid: "otherforge_speed" + scale_value: 1 + cost: + - type: "item" + gid: "iron_ingot" + quantity: 3 + - type: "item" + gid: "wood" + quantity: 2 + results: + - type: "item" + gid: "iron_spade" + xp: + - gid: "otherforge" + value: 15 craft_arcanite_pickaxe: name: "Craft Arcanite Pickaxe" description: "Craft an arcanite pickaxe." @@ -845,6 +1090,40 @@ craft_arcanite_axe: xp: - gid: "otherforge" value: 30 +craft_arcanite_spade: + name: "Craft Arcanite Spade" + description: "Craft an arcanite spade." + whatnot: + requirements: + - type: "hearth_amenity" + gid: "forge" + level: 2 + - type: "skill" + gid: "otherforge" + level: 10 + duration: + base: 140 + minimum: 35 + scaling: + - type: "skill" + gid: "otherforge" + scale_value: 1 + - type: "stat" + gid: "otherforge_speed" + scale_value: 1 + cost: + - type: "item" + gid: "arcanite_ingot" + quantity: 3 + - type: "item" + gid: "wood" + quantity: 2 + results: + - type: "item" + gid: "arcanite_spade" + xp: + - gid: "otherforge" + value: 30 craft_onus_of_vision: name: "Craft onus of vision" description: "Craft an onus of vision." @@ -1351,6 +1630,24 @@ wealdreap_twil_woods: xp: - gid: "wealdreap" value: 50 + - type: "item" + chance: 0.02 + table: + - gid: "mudtub_seed" + score: 0 + xp: + - gid: "wealdreap" + value: 10 + - gid: "midorias_seed" + score: 0.45 + xp: + - gid: "wealdreap" + value: 15 + - gid: "templis_seed" + score: 0.90 + xp: + - gid: "wealdreap" + value: 30 wealdreap_twil_grove: name: "Reap Twil Grove" description: "Wealdreap within the hidden woodways of the Twil Woods Grove." @@ -1394,6 +1691,29 @@ wealdreap_twil_grove: xp: - gid: "wealdreap" value: 85 + - type: "item" + chance: 0.02 + table: + - gid: "mudtub_seed" + score: 0 + xp: + - gid: "wealdreap" + value: 10 + - gid: "midorias_seed" + score: 0.30 + xp: + - gid: "wealdreap" + value: 15 + - gid: "templis_seed" + score: 0.60 + xp: + - gid: "wealdreap" + value: 30 + - gid: "enzon_seed" + score: 0.90 + xp: + - gid: "wealdreap" + value: 45 manatrawl_sor_well: name: "Trawl Sor Well" description: "Manatrawl within Sor Well." @@ -1555,12 +1875,17 @@ wildscour_crumbling_ruins: chance: 1 table: - gid: "vestige" - score: 0.45 + score: 0.35 max_quantity: 5 xp: - gid: "wildscour" value: 2 - gid: "aethermesh" + score: 0.50 + xp: + - gid: "wildscour" + value: 4 + - gid: "stone_spade" score: 0.60 xp: - gid: "wildscour" diff --git a/data/hearth_amenities.yml b/data/hearth_amenities.yml index bb60d3f..9d6aeb3 100644 --- a/data/hearth_amenities.yml +++ b/data/hearth_amenities.yml @@ -62,3 +62,12 @@ loamspire: gid: "construct_loamspire_level1" - level: 2 gid: "construct_loamspire_level2" + effects: + - type: "stat_change" + level: 1 + gid: "planting_spots" + modifier: 5 + - type: "stat_change" + level: 2 + gid: "planting_spots" + modifier: 5 diff --git a/data/items.yml b/data/items.yml index df2def6..6dc187a 100644 --- a/data/items.yml +++ b/data/items.yml @@ -386,9 +386,56 @@ granite_ring: - type: "stat_change" gid: "block" modifier: 1 +mudtub_seed: + name: "mudtub seed" + description: "The seed of a mudtub plant." + whatnot: + tags: + - "seed" + ripen_duration: + base: 28800 # 8 hours + harvest_activity: "harvest_mudtub" +midorias_seed: + name: "midorias seed" + description: "The seed of a midorias plant." + whatnot: + tags: + - "seed" + ripen_duration: + base: 36000 # 10 hours + harvest_activity: "harvest_midorias" +templis_seed: + name: "templis seed" + description: "The seed of a templis plant." + whatnot: + tags: + - "seed" + ripen_duration: + base: 43200 # 12 hours + harvest_activity: "harvest_templis" enzon_seed: name: "enzon seed" description: "The seed of an enzon plant." + whatnot: + tags: + - "seed" + ripen_duration: + base: 50400 # 14 hours + harvest_activity: "harvest_enzon" +mudtub: + name: "mudtub" + description: "A bulbous, brown tuber that smells terrible and tastes like nothing." +midoras: + name: "midoras" + description: "A dark green vegetable with massive leaves many times the size of its stalk." +templis: + name: "templis" + description: "A plant consisting of thin stems from which dangle small, yellow, oblong peppers." +enzon: + name: "enzon" + description: >- + A huge, black vegetable that grows from a vine. Looks like a giant seed, but its insides contain white, meaty + flesh. iron_lockpicks: name: "iron lockpicks" description: "Tools for getting into places other people -- or things -- don't want you to be." @@ -427,6 +474,22 @@ stone_axe: - type: "stat_change" gid: "power" modifier: 1 +stone_spade: + name: "stone spade" + description: "An old spade found in some ruins." + whatnot: + equip_slots: + - "mainhand" + equip_effects: + - type: "stat_change" + gid: "magiculture_speed" + modifier: 60 + - type: "stat_change" + gid: "accuracy" + modifier: 0 + - type: "stat_change" + gid: "power" + modifier: 1 iron_pickaxe: name: "iron pickaxe" description: "A pickaxe made of iron." @@ -459,6 +522,22 @@ iron_axe: - type: "stat_change" gid: "power" modifier: 2 +iron_spade: + name: "iron spade" + description: "A spade made of iron." + whatnot: + equip_slots: + - "mainhand" + equip_effects: + - type: "stat_change" + gid: "magiculture_speed" + modifier: 80 + - type: "stat_change" + gid: "accuracy" + modifier: 1 + - type: "stat_change" + gid: "power" + modifier: 2 arcanite_pickaxe: name: "arcanite pickaxe" description: "A pickaxe made of arcanite." @@ -499,6 +578,26 @@ arcanite_axe: - type: "stat_change" gid: "power" modifier: 3 +arcanite_spade: + name: "arcanite spade" + description: "A spade made of arcanite." + whatnot: + equip_slots: + - "mainhand" + equip_requirements: + - type: "skill" + gid: "magiculture" + level: 10 + equip_effects: + - type: "stat_change" + gid: "magiculture_speed" + modifier: 100 + - type: "stat_change" + gid: "accuracy" + modifier: 2 + - type: "stat_change" + gid: "power" + modifier: 3 aethermesh: name: "aethermesh" description: "A tool for manatrawl." diff --git a/db/migrate/20210602225942_create_hearth_plantings.rb b/db/migrate/20210602225942_create_hearth_plantings.rb new file mode 100644 index 0000000..b5d0adb --- /dev/null +++ b/db/migrate/20210602225942_create_hearth_plantings.rb @@ -0,0 +1,10 @@ +class CreateHearthPlantings < ActiveRecord::Migration[6.1] + def change + create_table :hearth_plantings do |t| + t.references :hearth, null: false, foreign_key: true + t.references :item, null: false, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 2a0b30a..9e20579 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_05_31_192205) do +ActiveRecord::Schema.define(version: 2021_06_02_225942) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -140,6 +140,15 @@ ActiveRecord::Schema.define(version: 2021_05_31_192205) do t.index ["gid"], name: "index_hearth_amenities_on_gid" end + create_table "hearth_plantings", force: :cascade do |t| + t.bigint "hearth_id", null: false + t.bigint "item_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["hearth_id"], name: "index_hearth_plantings_on_hearth_id" + t.index ["item_id"], name: "index_hearth_plantings_on_item_id" + end + create_table "hearths", force: :cascade do |t| t.bigint "character_id", null: false t.datetime "created_at", precision: 6, null: false @@ -265,6 +274,8 @@ ActiveRecord::Schema.define(version: 2021_05_31_192205) do add_foreign_key "chat_messages", "chat_rooms" add_foreign_key "equipment", "characters" add_foreign_key "equipment", "items" + add_foreign_key "hearth_plantings", "hearths" + add_foreign_key "hearth_plantings", "items" add_foreign_key "hearths", "characters" add_foreign_key "learned_activities", "activities" add_foreign_key "learned_activities", "characters" diff --git a/test/fixtures/hearth_plantings.yml b/test/fixtures/hearth_plantings.yml new file mode 100644 index 0000000..3bdbb5d --- /dev/null +++ b/test/fixtures/hearth_plantings.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + hearth: one + item: one + +two: + hearth: two + item: two diff --git a/test/models/hearth_planting_test.rb b/test/models/hearth_planting_test.rb new file mode 100644 index 0000000..ccfbb79 --- /dev/null +++ b/test/models/hearth_planting_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class HearthPlantingTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end -- cgit v1.2.3