summaryrefslogtreecommitdiff
path: root/app/lib
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-07-11 17:40:14 -0400
committerDavid Gay <david@davidgay.org>2021-07-11 17:40:40 -0400
commit943e49eb877ab0aaaba6e876e3ca7aef5688e158 (patch)
tree1032d608f2bded6c1171eda7e7c1b5114ea8c819 /app/lib
parent0fba923dda9440a7817e4dfa191bc242e5e0eb76 (diff)
Second worldcall spell: Project Thought
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activity_processor.rb5
1 files changed, 5 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