1 package org
.sevenchan
.dongs
.clothing
3 import org
.sevenchan
.dongs
.bodyparts
.IBodyPart
;
4 import org
.sevenchan
.dongs
.Creature
;
5 import org
.sevenchan
.dongs
.Item
;
6 import org
.sevenchan
.dongs
.Screen;
7 import org
.sevenchan
.dongs
.screens
.InfoScreen
;
9 * An article of clothing or armor, is also an item.
12 public class Clothing
extends Item
14 public var HP
:Number = 0;
15 public var maxHP
:Number = 5;
16 public var type
:ClothingType
= ClothingType
.HEADGEAR
; // Determines what is obscured.
17 public var opaque
:Boolean = true;
18 public var isArmor
:Boolean = false;
20 public function Clothing
(num
:uint=0)
26 * Used by the body part to determine if it's being hidden.
29 public function isObscuring
(part
:IBodyPart
):Boolean {
30 return opaque
&& type
.obscures
.some
(function(o
:*):Boolean {
31 return part
.category
== (o
as String);
35 public function getDescr
(host
:Creature
):String {
36 return "[LOL NO GetDescr()!]";
39 override public function Use
(host
:Creature
):Boolean
41 if ((HP
/ maxHP
) < 0.1){
42 InfoScreen
.push
("This " + this.getDescr
(host
) + " is too damaged to be worn.");
47 case ClothingType
.FOOTWEAR
:
48 if (host
.legs
.length
== 0){
49 InfoScreen
.push
("You cannot wear this item, as you have no legs with feet on which to wear them.");
52 text
= "You drop the " + this.getDescr
(host
) + " onto the ground and slide your feet into them, finding them nice and snug";
54 text
+= ", despite the holes";
55 else if (HP
/ maxHP
< 0.7)
56 text
+= ", despite the obvious wear";
59 case ClothingType
.HEADGEAR
:
60 text
= "You place the " + this.getDescr
(host
) + " onto your head, knowing that you now look";
62 text
+= " like a peasant on his way to a soup kitchen.";
63 else if (HP
/ maxHP
< 0.7)
64 text
+= " like an old gentleman, the item being as worn as it is.";
66 text
+= " very dapper.";
68 case ClothingType
.PANTS
:
69 if (host
.legs
.length
== 0){
70 InfoScreen
.push
("You cannot wear this item, as you have no legs to wear them on.");
73 text
= "You find a nice secluded area and slip into your " + this.getDescr
(host
);
75 text
+= ", being mindful of the huge holes slashed into the garment";
76 else if (HP
/ maxHP
< 0.7)
77 text
+= ", aware of the worn knees and scratches.";
79 case ClothingType
.TOP
:
80 text
= "Ensuring no one's around to catch you off-guard, you slip the " + this.getDescr
(host
) + " over your head";
82 text
+= ", peeking through the holes and cuts to be sure no one sneaks up on you.";
83 else if (HP
/ maxHP
< 0.7)
84 text
+= ", ignoring the scratches and loose fibers.";
87 InfoScreen
.push
(text
);
88 host
.clothing
.push
(this);