summaryrefslogtreecommitdiff
path: root/npc/items/valentine.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/items/valentine.txt')
-rw-r--r--npc/items/valentine.txt33
1 files changed, 21 insertions, 12 deletions
diff --git a/npc/items/valentine.txt b/npc/items/valentine.txt
index 259b4fcb3..2bb56ab26 100644
--- a/npc/items/valentine.txt
+++ b/npc/items/valentine.txt
@@ -4,19 +4,28 @@
// Description:
// Valentine eating
-// Create a random card, with rares
+// Eats chocolate, returns bad ones if requested
+// EatValentineChocolate()
function script EatValentineChocolate {
- if ($EVENT$ != "Valentine" || #VALENTINE_OPENED >= #VALENTINE_RECEIVED) {
- dispbottom l("Past due date.");
- } else {
- // I know technically this is wrong grammar, but I want fixed width
- #VALENTINE_OPENED=#VALENTINE_OPENED+1;
- #VALENTINE_POINTS=#VALENTINE_POINTS+1;
- if (rand(0,1))
- dispbottom l("It's tasty ^.^");
- else
- dispbottom l("It's yummy ^.^");
- }
+ if ($EVENT$ != "Valentine") {
+ dispbottom l("Past due date.");
+ } else if (#VALENTINE_OPENED >= #VALENTINE_RECEIVED) {
+ dispbottom l("This is not meant for me.");
+ getitem BoxOfChocolates, 1;
+ } else {
+ .@pts=1;
+ if (!GSET_VALENTINE_EATONE) {
+ .@pts=(#VALENTINE_RECEIVED-#VALENTINE_OPENED);
+ delitem BoxOfChocolates, .@pts-1;
+ }
+ // I know technically this is wrong grammar, but I want fixed width
+ #VALENTINE_OPENED=#VALENTINE_OPENED+.@pts;
+ #VALENTINE_POINTS=#VALENTINE_POINTS+.@pts;
+ if (rand2(0,1))
+ dispbottom l("It's tasty ^.^");
+ else
+ dispbottom l("It's yummy ^.^");
+ }
return;
}