summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--app/controllers/bazaar_controller.rb6
2 files changed, 9 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90bc394..6ef00d5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
+### General
+- You now receive an informative message when someone buys or sells items to you via one of your bazaar orders.
+
### Monsters
- Stalk beast
- Bash resistance 6 -> 4
diff --git a/app/controllers/bazaar_controller.rb b/app/controllers/bazaar_controller.rb
index 5ed8a59..d51a419 100644
--- a/app/controllers/bazaar_controller.rb
+++ b/app/controllers/bazaar_controller.rb
@@ -40,6 +40,9 @@ class BazaarController < ApplicationController
@bazaar_order.character.shift_item(@bazaar_order.item, quantity)
@bazaar_order.decrement(:quantity, quantity)
@bazaar_order.save!
+ Message.create(recipient: @bazaar_order.character, subject: "Bought #{quantity} #{@bazaar_order.item.name}",
+ body: "#{current_char.name} sold #{quantity} #{@bazaar_order.item.name} to you" \
+ " for #{profit} vg.")
flash[:notice] = "You sold #{quantity} #{@bazaar_order.item.name} and got #{profit} vg."
end
else
@@ -51,6 +54,9 @@ class BazaarController < ApplicationController
@bazaar_order.character.shift_item("vestige", cost)
@bazaar_order.decrement(:quantity, quantity)
@bazaar_order.save!
+ Message.create(recipient: @bazaar_order.character, subject: "Sold #{quantity} #{@bazaar_order.item.name}",
+ body: "#{current_char.name} bought #{quantity} #{@bazaar_order.item.name} from you" \
+ " for #{cost} vg.")
flash[:notice] = "You bought #{quantity} #{@bazaar_order.item.name} for #{cost} vg."
end
end