1 package org
.sevenchan
.dongs
.bodyparts
3 import org
.sevenchan
.dongs
.*;
4 import org
.sevenchan
.dongs
.creature
.*;
5 import org
.sevenchan
.dongs
.screens
.InfoScreen
;
6 import flash
.net
.registerClassAlias
;
7 import org
.sevenchan
.dongs
.weapons
.IWeapon
;
8 import org
.sevenchan
.dongs
.clothing
.Clothing
;
14 public class Leg
implements IBodyPart
16 registerClassAlias
("P_Leg", Leg
);
18 private var _name
:String;
19 private var _location
:String = "";
20 private var _value
:Number;
22 public function Leg
(value
:Number = 0, name
:String = "")
28 public function get value
():Number
33 public function get category
():String
38 public function get name
():String
43 public function get location
():String
48 public function getDescr
(num
:Number, host
:Creature
):String
50 var o
:String = num
+ " " + name
+ " leg" + ((num
> 1) ? "s" : "");
51 if (_location
.length
> 0)
52 o
+= " growing out of %POS% " + location
;
56 public function get sellDesc
():String
58 return getShortDescr
(true);
61 public function onFailedAttack
(from
:Creature
, to
:Creature
):void
64 InfoScreen
.push
(to
.gender
.doReplace
("<p>You attempt to kick the " + to
.getTypeName
() + ", but %SUB% moves too quickly and evades the attack!</p>"));
66 InfoScreen
.push
(from
.gender
.doReplace
("<p>%CSUB% attempts to kick you, but you move too quickly and evade the attack!</p>"));
69 public function onGoodAttack
(from
:Creature
, to
:Creature
):void
72 return onGoodAttack
(from
, to
);
73 var dmg
:Number = from
.damageAgainst
(to
,weapon
);
77 txt
= MathUtils
.getRandomArrayEntry
(["You deliver a powerful round kick to the " + to
.getTypeName
(), "You kick the " + to
.getTypeName
(), "The " + to
.getTypeName
() + " gets a foot to the face",]);
78 InfoScreen
.push
(to
.gender
.doReplace
("<p>" + txt
+ ", dealing " + dmg
+ " damage!</p>"));
82 txt
= MathUtils
.getRandomArrayEntry
(["%CSUB% kicks you", "You discover how " + from
.getTypeName
() + " feet taste", "One of %POS%'s kicks find your face",]);
83 InfoScreen
.push
(from
.gender
.doReplace
("<p>" + txt
+ ", causing " + dmg
+ " damage!</p>"));
88 public function getShortDescr
(withModifier
:Boolean = false):String
96 private var _weapon
:IWeapon
= null;
97 public function get weapon
():IWeapon
{ return _weapon
; }
98 public function tryEquip
(weap
:IWeapon
):Boolean
100 if (weap
.canEquipOn
(this)){
107 public function isConcealedBy
(host
:Creature
, clothing
:Vector
.<Clothing
>):Boolean
109 return clothing
.some
(function(c_
:Object, index
:int, vector
:Vector
.<Clothing
>):Boolean
111 var c
:Clothing
= Clothing
(c_
);
113 return (c
.type
.obscures
.indexOf
(category
) > -1);