diff options
author | David Gay <david@davidgay.org> | 2021-07-11 17:40:14 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-07-11 17:40:40 -0400 |
commit | 943e49eb877ab0aaaba6e876e3ca7aef5688e158 (patch) | |
tree | 1032d608f2bded6c1171eda7e7c1b5114ea8c819 | |
parent | 0fba923dda9440a7817e4dfa191bc242e5e0eb76 (diff) |
Second worldcall spell: Project Thought
-rw-r--r-- | app/lib/activity_processor.rb | 5 | ||||
-rw-r--r-- | app/views/application/_results.html.erb | 2 | ||||
-rw-r--r-- | data/activities/worldcall.yml | 32 |
3 files changed, 39 insertions, 0 deletions
diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index 3f62d28..4ba3609 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -115,6 +115,11 @@ class ActivityProcessor location = @character.hearth&.location || Location.find_by_gid("floret") @character.update(location: location) @results.push({ type: type, location: location }) + when "create_monster_spawn" + next if rand > (result[:chance] || 1) + monster = Monster.find_by_gid(result[:gid]) + MonsterSpawn.create(monster: monster, location: @character.location) + @results.push({ type: type, monster: monster }) else raise "Invalid result type (#{type})" # TODO: Improve this. end diff --git a/app/views/application/_results.html.erb b/app/views/application/_results.html.erb index d1ec927..71d6992 100644 --- a/app/views/application/_results.html.erb +++ b/app/views/application/_results.html.erb @@ -26,6 +26,8 @@ <% when "monster_spawn" %> <p>You found the <%= result[:monster_spawn].monster.name %>!</p> <p class="text-xs italic"><%= result[:monster_spawn].monster.description %></p> + <% when "create_monster_spawn" %> + <p>You've called a <%= result[:monster].name %>!</p> <% when "xp" %> <p class="text-xs">You gained <%= result[:xp] %> <%= result[:skill].name %> XP.</p> <% when "title" %> diff --git a/data/activities/worldcall.yml b/data/activities/worldcall.yml index c5ea3e4..bec622f 100644 --- a/data/activities/worldcall.yml +++ b/data/activities/worldcall.yml @@ -31,3 +31,35 @@ worldcall_hearth_passage: - type: "xp" gid: "worldcall" base: 4 +worldcall_project_thought: + name: "Cast Project Thought" + description: "Open brief, faint rifts to random places at your current location, possibly attracting a balgoloth." + whatnot: + tags: + - "spell" + - "worldcall" + requirements: + - type: "skill" + gid: "worldcall" + level: 5 + cost: + - type: "item" + gid: "gem_dust" + quantity: 1 + duration: + base: 62 + minimum: 35 + scaling: + - type: "skill" + gid: "worldcall" + scale_value: 0.5 + - type: "stat" + gid: "worldcall_speed" + scale_value: 1 + results: + - type: "create_monster_spawn" + gid: "balgoloth" + chance: 0.04 + - type: "xp" + gid: "worldcall" + base: 6 |