1 package org
.sevenchan
.dongs
.bodyparts
3 import org
.sevenchan
.dongs
.clothing
.Clothing
;
4 import org
.sevenchan
.dongs
.Creature
;
5 import org
.sevenchan
.dongs
.creature
.Player
;
6 import org
.sevenchan
.dongs
.enchantment
.*;
7 import flash
.net
.registerClassAlias
;
8 import org
.sevenchan
.dongs
.screens
.InfoScreen
;
9 import org
.sevenchan
.dongs
.weapons
.IWeapon
;
15 public class Arm
implements IBodyPart
17 registerClassAlias
("P_Arm", Arm
);
19 private var _name
:String;
20 public var _location
:String = "";
22 public function get location
():String
27 public function Arm
(value
:Number = 0, name
:String = "human", atkEnch
:Enchantment
= null, defEnch
:Enchantment
= null)
33 private var _value
:Number;
35 public function get value
():Number
40 public function get name
():String
45 public function get category
():String
50 public function get sellDesc
():String
52 return getShortDescr
(true);
55 public function getDescr
(num
:Number, host
:Creature
):String
57 var o
:String = num
+ " " + Utils
.pluralize
(num
, getShortDescr
(true));
58 if (location
.length
> 0)
59 o
+= " growing out of %POS% " + location
;
63 public function getShortDescr
(withModifier
:Boolean = false):String
71 public function onFailedAttack
(from
:Creature
, to
:Creature
):void
74 InfoScreen
.push
(to
.gender
.doReplace
("<p>You attempt to strike the " + to
.getTypeName
() + " with your fist, but %SUB% moves too quickly and evades the attack!</p>"));
76 InfoScreen
.push
(from
.gender
.doReplace
("<p>%VSUB% attempts to strike you with %POS% fist, but you move too quickly and evade the attack!</p>"));
79 public function onGoodAttack
(from
:Creature
, to
:Creature
):void
81 var dmg
:Number = from
.damageAgainst
(to
, weapon
);
83 InfoScreen
.push
(to
.gender
.doReplace
("<p>You smash the " + to
.getTypeName
() + " in the face with your fist, dealing " + dmg
+ " damage!</p>"));
85 InfoScreen
.push
(from
.gender
.doReplace
("<p>%CSUB% punches you with %POS% fist, dealing " + dmg
+ " damage!</p>"));
86 //trace("["+getDescr(1,from)+"] BEFORE: "+to.HP);
88 //trace("["+getDescr(1,from)+"] AFTER: "+to.HP);
91 public function isConcealedBy
(host
:Creature
, clothing
:Vector
.<Clothing
>):Boolean
93 return clothing
.some
(function(c_
:Object, index
:int, vector
:Vector
.<Clothing
>):Boolean
95 var c
:Clothing
= Clothing
(c_
);
97 return (c
.type
.obscures
.indexOf
(category
) > -1);
103 private var _weapon
:IWeapon
= null;
105 public function get weapon
():IWeapon
110 public function tryEquip
(weap
:IWeapon
):Boolean
112 if (weap
.canEquipOn
(this))