Fix hair, dick around with new game screen.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / bodyparts / Wing.as
blob2b03493d0b183f9d0ac2a80398f23d7a9cc5481e
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;
8 /**
9 * ...
10 * @author Harbinger
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)
22 this._value = value;
23 this.species = species;
24 this.reptilian = reptilian;
25 descriptor = _descr;
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
38 return _value;
41 public function get category():String
43 return "wings";
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
53 return species;
56 public function getShortDescr(withModifier:Boolean = false):String
58 var t:String = "wing";
59 if (withModifier)
60 t = name + " " + t;
61 return t;
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
75 return _location;
78 private var _weapon:IWeapon = null;
80 public function get weapon():IWeapon
82 return _weapon;
85 public function tryEquip(weap:IWeapon):Boolean
87 if (weap.canEquipOn(this))
89 _weapon = weap;
90 return true;
92 return false;
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_);
100 if (c != null)
101 return (c.type.obscures.indexOf(category) > -1);
102 else
103 return false;