1 package org
.sevenchan
.dongs
.bodyparts
3 import flash
.net
.registerClassAlias
;
4 import org
.sevenchan
.dongs
.*;
5 import org
.sevenchan
.dongs
.clothing
.Clothing
;
6 import org
.sevenchan
.dongs
.weapons
.IWeapon
;
12 public class Wing
implements IBodyPart
14 registerClassAlias
("P_Wing", Wing
);
15 private var descriptor
:String;
16 private var species
:String;
17 private var reptilian
:Boolean;
18 private var wingspan
:Number;
20 public function Wing
(species
:String = "", reptilian
:Boolean = false, _descr
:String = "", wingspan
:Number = 0, value
:Number = 0)
23 this.species
= species
;
24 this.reptilian
= reptilian
;
26 this.wingspan
= wingspan
;
29 public function get sellDesc
():String
31 return getShortDescr
(true);
34 private var _value
:Number;
36 public function get value
():Number
41 public function get category
():String
46 public function getDescr
(num
:Number, host
:Creature
):String
48 return num
+ " " + descriptor
+ " " + (reptilian
? "leathery" : "feathered") + " " + species
+ " wing" + (num
> 1 ? "s" : "");
51 public function get name
():String
56 public function getShortDescr
(withModifier
:Boolean = false):String
58 var t
:String = "wing";
64 public function onFailedAttack
(from
:Creature
, to
:Creature
):void
68 public function onGoodAttack
(from
:Creature
, to
:Creature
):void
71 public var _location
:String = "right where it should be";
73 public function get location
():String
78 private var _weapon
:IWeapon
= null;
80 public function get weapon
():IWeapon
85 public function tryEquip
(weap
:IWeapon
):Boolean
87 if (weap
.canEquipOn
(this))
95 public function isConcealedBy
(host
:Creature
, clothing
:Vector
.<Clothing
>):Boolean
97 return clothing
.some
(function(c_
:Object, index
:int, vector
:Vector
.<Clothing
>):Boolean
99 var c
:Clothing
= Clothing
(c_
);
101 return (c
.type
.obscures
.indexOf
(category
) > -1);