Fix hair, dick around with new game screen.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / Item.as
blobe0d0a1da50bc611b73096038fadc6eccb0c68a85
1 package org.sevenchan.dongs
3 import adobe.utils.CustomActions;
4 import org.sevenchan.dongs.clothing.*;
5 import org.sevenchan.dongs.items.*;
6 import org.sevenchan.dongs.screens.InfoScreen;
8 /**
9 * ...
10 * @author Harbinger
12 public class Item
14 public static var Registry:Object = { };
15 public static var IDs:Array = new Array();
17 public var id:int = 0;
18 public var name:String = "";
19 public var descr:String = "";
20 public var value:int = 0;
21 public var amount:uint = 0;
22 public var isSexuallyTransmitted:Boolean = false;
24 public function Item(num:uint = 0)
26 amount = num;
29 public function copy():Item
31 return null;
34 public static function fillRegistry():void
36 Registry = {
37 berry_white: new WhiteBerries(),
38 harpy_tincture: new HarpyTincture(),
39 spider_venom: new SpiderVenomSac(),
40 darkharpyegg: new DarkHarpyEgg(),
41 potion_pink: new PinkPotion(),
42 potion_gold: new GoldPotion(),
43 spider_egg: new SpiderEgg(),
44 gas_mask: new GasMask(),
45 milk: new Milk(),
46 spider_gonad: new SpiderGonad(),
47 anchor_stone: new AnchorStone(),
48 tunic: new Tunic(),
49 pants: new Pants()
51 for each (var i:Item in Registry)
53 trace(i.name+"\t"+i.id);
54 if (IDs[i.id] != null)
55 throw new Error(i.name + " has duplicate ID! Conflicts with " + (IDs[i.id] as Item).name);
56 IDs[i.id] = i;
60 public static function findByID(id:int):Item
62 trace("Asked to find", id);
63 for each (var item:Item in Registry)
65 trace(item.name, item.id);
66 if (item.id == id)
67 return item.copy();
69 return null;
72 public function Use(host:Creature):Boolean
74 InfoScreen.push("<h2>Use Item</h2><p>Nothing happens.</p>");
75 return false;