One can now specify a name when creating a character.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / screens / encounters / HaaraRevelationEncounter.as
blob173349be78ee7013dd74529ab584a4508c5c3375
1 package org.sevenchan.dongs.screens.encounters
3 import org.sevenchan.dongs.ActionNode;
4 import org.sevenchan.dongs.Creature;
5 import org.sevenchan.dongs.enchantment.Hunger;
6 import org.sevenchan.dongs.MenuNode;
7 import org.sevenchan.dongs.screens.Encounter;
8 import org.sevenchan.AdventureController;
9 import org.sevenchan.dongs.Town;
11 /**
12 * ...
13 * @author Harbinger
15 public class HaaraRevelationEncounter extends Encounter
17 public static function push():void
19 AdventureController.screenQueue.write(new HaaraRevelationEncounter(null));
21 public function HaaraRevelationEncounter(target:Creature)
23 super(target);
24 lustCost = 0;
25 currentItem.content = <![CDATA[
26 <p>
27 For some reason, you get it into your thick skull to wander out into the desert surrounding Banala
28 (which - according to the grouchy Innkeeper, anyway - is called the Haara Wastes, after the demon
29 general who led his army into it and was never heard from again). Since you're not completely
30 braindead, you bring enough water to allow you to survive in the blinding desert for a couple of
31 weeks, provided you ration it carefully.
32 </p>
33 <p>
34 Unfortunately, the desert has other plans.
35 </p>
36 <p>
37 The first day into your journey, you are horrified to discover that the goatskin bag containing your
38 main water supply has come apart at the bottom, and most of the water has already leaked out. You
39 begin to head back to Banala, but the rapidly setting sun and the fact that you have no idea where
40 you are gives you pause.
41 </p>
42 ]]>.toString();
43 currentItem.canGoBack = false;
44 currentItem.pushAction("Banala", -1, "Head back to Banala.", onBanala, null);
45 var mnuCamp:MenuNode = currentItem.pushMenu("Camp", "Set up camp.");
47 mnuCamp.content = <![CDATA[
48 <p>You sigh, check your spare goatskin, and set up camp for the night.</p>
49 <p>
50 Your sleep is fitful. You dream of the shifting sands, and the mysterious creatures that might inhabit the Wastes.
51 </p>
52 <p>
53 You then dream of a beautiful woman, dressed in long, sand - colored robes, rising from the desert. She approaches you, lays a hand on your cheek, and whispers your name into your ear.
54 </p>
55 <p>
56 You awaken to a golden flask, lightly dusted with sand, propped up next to you. Startled, you jump to your feet and look around the camp quickly, but find no one. Wondering what the hell is going on, you peer into the flask, and find a clear fluid at the bottom.
57 </p>
59 ]]>.toString();
61 /* Menu: Drink/Don’t Drink */
62 mnuCamp.canGoBack = false;
63 mnuCamp.pushAction("Drink", -1, "Drink the contents.", onDrink);
64 mnuCamp.pushAction("Don't drink", -1, "Leave it sealed.", onNoDrink);
68 public function onNoDrink(ply:Creature, node:ActionNode, o:*):Boolean {
69 //If player selects Don’t Drink*
71 text=<![CDATA[
72 <p>
73 Suspicious, you ignore the mysterious flask and begin packing your belongings for the journey
74 back to Banala. As you leave, you give a single glance back to the flask, but only see swirling sands.
75 </p>
76 <p>
77 The walk back is arduous, and you begin to wish you had taken a chance and drunk from the flask. By
78 the time you finally find the road leading back to Banala, your throat is painfully parched.
79 </p>
80 ]]>.toString();
81 //Player loses some HP, but not as much as they would if they had not camped in the desert.
82 main.player.HP = main.player.HP / 8;
83 return true;
86 public function onDrink(ply:Creature, node:ActionNode, o:*):Boolean
88 text=<![CDATA[
89 <p>
90 You raise the flask to your lips cautiously, and taste the liquid within.
91 </p>
92 ]]>.toString();
93 // Game randomly selects the flask’s contents.
94 var possibilities:Array = new Array(
95 "water",
96 "pink potion",
97 "gold potion"
100 //CONSEQUENCES
101 var result:String = String(MathUtils.getRandomArrayEntry(possibilities));
103 // If flask contents are water
104 if (result == "water")
106 text+=<![CDATA[
108 Water? But how did...? A surprisingly large flood of water of pours into your mouth, and you hungrily drink.
109 </p>
110 ]]>.toString();
112 //If flask contents are pink potion
113 if (result == "pink potion")
115 text+=<![CDATA[
117 The flask’s warm liquid rushes down your throat. It tastes almost like warm milk, but sweeter. A strange
118 warmth spreads over your chest, and you drop the flask in surprise as your [breast description] begin
119 to expand.
120 </p>
121 ]]>.toString()
122 .replace("[breast description]", main.player.getBreastDescr());
124 // Player’s breast size increases
125 if (main.player.breasts.length == 0) {
126 trace(main.player,"doesn't have boobs, adding.");
127 main.player.addBreast();
128 main.player.addBreast();
129 } else {
130 for (var i:int = 0; i < main.player.breasts.length;i++)
131 main.player.breasts[i].bigger();
133 var lastPart:String = <![CDATA[
135 Pulling open your [clothing description], you curiously squeeze your new [breast description]. You
136 attempt to stand and stagger slightly, unused to the new, heavy weight on your chest.
137 </p>
138 ]]>.toString()
139 .replace("[breast description]", main.player.getBreastDescr())
140 .replace("[clothing description]", main.player.getClothingDescr()); // TODO: Use ClothingType.Top or something.
142 // If flask contents are gold potion
143 if (result == "gold potion")
145 var effects:String = "";
146 // If player has less than max HP
147 if (main.player.HP < main.player.maxHP)
149 effects += "All the scrapes and bruises you’ve accumulated disappear.";
150 main.player.HP = main.player.maxHP;
152 //If player has a deadly enchantment
153 if (main.player.hasEnchantment("hunger")) {
154 delete main.player.enchantments["hunger"];
155 if (effects.length > 0)
156 effects += " ";
157 effects += "You are no longer afflicted with hunger.";
159 text+=<![CDATA[
161 The liquid is pleasantly sweet. As you continue to drink from the flask, a feeling of calmness
162 overtakes you, and warmth spreads through your body. [effects]
163 </p>
164 ]]>.toString()
165 .replace("[effects]", effects);
167 text+=<![CDATA[
169 After quenching your thirst, you are surprised to notice the flask is the same weight as when you
170 first picked it up. Shaking your head in abject wonder, you begin the task of packing up your dusty
171 belongings to continue your exploration of the desert, sans one goatskin bag.
172 </p>
174 Once your belongings are packed, you go to retrieve the flask. However, all you see is swirling sand;
175 You attempt to dig around for the flask, but find nothing. Sighing, you begin to trudge back towards Banala.
176 </p>
177 ]]>.toString();
178 node.content = text;
179 return true;
182 public function onBanala(ply:Creature, node:ActionNode,o:*):Boolean
184 text = <![CDATA[
186 Despite the darkening sky and your lack of direction, you resolutely continue your journey back to Banala.
187 You strike out in a random direction, hoping it leads back to civilization.
188 </p>
190 Night swiftly falls, and the darkness makes you even more lost. You wander about the desert for the entire night,
191 and only stumble into Banala the following day, thirsty and worn.
192 </p>
193 ]]>.toString();
194 main.player.HP = main.player.HP / 4;
195 main.player.currentTown = Town.knownTowns.banala;
196 node.content = text;
197 return true;