summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/001-11/Demure.txt63
1 files changed, 63 insertions, 0 deletions
diff --git a/npc/001-11/Demure.txt b/npc/001-11/Demure.txt
index 8e14066b3..7c00f9e1a 100644
--- a/npc/001-11/Demure.txt
+++ b/npc/001-11/Demure.txt
@@ -32,10 +32,73 @@
mesn;
mesq l("How many chocolate do you want to send? You currenly have: @@", countitem(BoxOfChocolates));
input @Val_Ammo;
+ mes "";
+
if (@Val_Ammo > countitem(BoxOfChocolates)) {
mesc l("You don't have that many!");
return;
}
+
+ do {
+ mesn;
+ mesq l("To whom you want to send @@ boxes? Cannot be yourself!", @Val_Ammo);
+ mesc l("Leave blank to abort.");
+ input .@ref$;
+ //debugmes "Sending chocolate to: "+.@ref$;
+ mes "";
+ if (.@ref$ != "") {
+ .@ref=gf_accid(strip(.@ref$));
+ if (.@ref > 0) {
+ if (.@ref == getcharid(3)) {
+ mesn;
+ mesq l("I said it cannot be yourself... </3");
+ next;
+ } else {
+ // Now we do the magic, first of, delete the chocolate and the text input
+ delitem BoxOfChocolates, @Val_Ammo;
+ .@ref$="";
+
+ // Send the Chocolate
+ .@m = htget($@VALENTINE_GIFTSTACKS, .@ref);
+ if (!.@m)
+ htput $@VALENTINE_GIFTSTACKS, .@ref, @Val_Ammo;
+ else
+ htput $@VALENTINE_GIFTSTACKS, .@ref, .@m+@Val_Ammo;
+
+ // Get 1 Point per sent box
+ #VALENTINE_POINTS+=1;
+
+ // Handle Love Letter
+ if (countitem(LoveLetter) {
+ mesn;
+ mesq l("Should I attach a love letter?");
+ next;
+ if (askyesno() == ASK_YES) {
+ delitem LoveLetter, 1;
+
+ // Register your name on love letter
+ .@s$ = htget($@VALENTINE_LOVELETTER, .@ref);
+ if (.@s$ == "")
+ htput $@VALENTINE_LOVELETTER, .@ref, strip(strcharinfo(0));
+ else
+ htput $@VALENTINE_LOVELETTER, .@ref, .@s$+", "+strip(strcharinfo(0));
+
+ // Get the bonus: 1 point for 2 boxes, capped at 25 and minimum 1 extra point
+ // Sending over 50 boxes at once won't give bonus, give another Love Letter.
+ #VALENTINE_POINTS+=min(25, max(1, @Val_Ammo/2));
+
+ } // Love Letter OK
+ } // Not yourself
+ } // Valid Person
+ } else {
+ mesn;
+ mesq l("Oops, there is nobody known as @@ on this game.", .@ref$);
+ mesq l("Could you try again? There could be a typo!");
+ next;
+ } // Invalid Input
+ } // Non void input
+ } while (.@ref$ != "");
+ return;
}
function GetGift {
.@m = htget($@VALENTINE_GIFTSTACKS, getcharid(3));