Guardian support and a refactor. Also damned.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / towns / TownHarpyCabin.as
blob13d4351dfd4dc3f9b6bac1c52e5040832b82407f
1 package org.sevenchan.dongs.towns
3 import org.sevenchan.dongs.Creature;
4 import org.sevenchan.dongs.Item;
5 import org.sevenchan.dongs.items.DarkHarpyEgg;
6 import org.sevenchan.dongs.screens.ShopScreen;
7 import org.sevenchan.dongs.Town;
9 /**
10 * ...
11 * @author N3X15
13 public class TownHarpyCabin extends Town
16 public function TownHarpyCabin()
18 ID = "harpycabin";
19 name = "Harpy Cabin";
20 inhabitants = [];
21 isWilds = false;
22 freeRest = true;
23 connectedTowns = [
24 "horus"
28 override public function onRevelation():Boolean
30 text = "Whoops, I forgot this one. WIP.";
32 return true;
35 override public function onEnter():void
37 text = "<p>The cabin is warm, despite the falling snow and ice outside. </p>";
40 override public function onExplore(bumpedInto:Creature):void
42 text = "<p>You expected the cabin to be a bunch of sticks, but it's constructed out of solid timber and has a stone fireplace held together with mortar. The place is kept very tidy, as well. Not a single feather to be found (except in the bedroom, of course).</p>";
45 override public function onShopBuyMenu():String
47 return "";
50 override public function onSuccessfulRest():void
52 text = "You slip into bed beside her. After a wild night, you awaken feeling fully rested.";
53 var eggs:int = 0;
54 var gold:int = 0;
55 for each(var itm:Item in main.player.inventory) {
56 if (itm is DarkHarpyEgg) {
57 eggs++;
58 var item:Item = itm.copy();
59 var price:int = item.value + 5;
60 gold += price;
61 item.amount = 1;
62 main.player.takeFromInventory(item);
63 main.player.gold += price;
64 main.refreshStats();
67 if (eggs > 0) {
68 text += "You also notice that your collection of " + eggs + "Dark Harpy Eggs is missing, ";
69 text += "and your gold supply is "+gold+" coins larger. </p><p>You enjoy breakfast with her, especially ";
70 text += "with your new earplugs.</p>";