1 package org
.sevenchan
.dongs
4 import org
.sevenchan
.AdventureController
;
5 import org
.sevenchan
.dongs
.bodyparts
.*;
6 import org
.sevenchan
.dongs
.clothing
.Clothing
;
7 import org
.sevenchan
.dongs
.clothing
.ClothingType
;
8 import org
.sevenchan
.dongs
.creature
.*;
9 import org
.sevenchan
.dongs
.enchantment
.*;
10 import org
.sevenchan
.dongs
.enchantment
.events
.*;
11 import org
.sevenchan
.dongs
.screens
.*;
12 import org
.sevenchan
.dongs
.weapons
.IWeapon
;
20 registerClassAlias
("ECreature", Creature
);
23 public var customized
:Boolean = false;
24 public var ownName
:String = "Blah Blah"; // Who am I?
25 public var height
:Number = 0.0; // How tall am I?
26 public var build
:Build
= Build
.AVG
; // How fat am I?
27 public var material
:Material
= Material
.NO_MATERIAL_MODIFIER
; // What am I made of?
28 public var _hair
:Hair
= new Hair
("bald",""); // His/her/hir hair is...
29 public var skin
:Skin
= new Skin
("human"); // His/her/hir hair is...
30 public var _gender
:Gender
= Gender
.ASEXUAL
; // Boy, Girl, Neither, Both?
31 public var sexualPreference
:SexualPreference
= SexualPreference
.ASEXUAL
; // Straight, Gay, ASexual, Bi?
33 private var mGenderInitialized
:Boolean = false;
35 // Stats (CACHED VALUES)
36 public var _level
:int = 0; // In comparison to standard human being. No attacking rats for 20 levels.
37 private var d_level
:int = 0; // Delta
38 public var _strength
:int = 1; // Damage caused in case of a successful attack.
39 public var _speed
:int = 1; // Chance of dodging [0-1]. defending.speed-attacking.speed = relative chance of dodging.
40 public var _intellect
:int = 1; // Smartness. Opens dialog trees and gives hints.
41 public var _lust
:int = 1; // Slowly increases over time, eliminated by masturbation or smecks. Some battles are nonsexual and will not affect lust, others will slightly increase it based on ((number of balls x ball hormone output)+(number of vaginas * vagina hormone output)* sensitivity).
42 public var _sensitivity
:Number = 0; // 0-1, 0 being not sensitive
43 public var _HP
:int = 100; //100*(level*0.02)
44 public var _XP
:int = 0; // 50*(level*0.5)
45 public var _mana
:int = 0; // Magic shit, increases over time, especially near relaxing places.
46 public var _gold
:int = 0; // Currency
50 // What magic/techniques can I use?
51 public var _abilities
:Object = new Object();
52 // How many, and what type of assholes do I possess?
53 public var _assholes
:Vector
.<Asshole
> = new Vector
.<Asshole
>();
54 // Needed to attack. Tentacles are ok.
55 public var _arms
:Vector
.<Arm
> = new Vector
.<Arm
>();
56 // Testes (Cum and pregnancy options)
57 public var _balls
:Vector
.<Testicle
> = new Vector
.<Testicle
>();
59 public var _breasts
:Vector
.<Breast
> = new Vector
.<Breast
>();
60 // Penises (Pleasure options, testes required for preggo/cum stuff)
61 public var _dicks
:Vector
.<Penis
> = new Vector
.<Penis
>();
62 // What kinds of effects am I suffering/benefiting from?
63 public var enchantments
:Object = new Object();
64 // How many/what kinds of eyes do I have?
65 public var _eyes
:Vector
.<Eye
> = new Vector
.<Eye
>();
66 // What stuff am I carrying?
67 public var inventory
:Vector
.<Item
> = new Vector
.<Item
>();
68 // Legs or locomotive tentacles or some other propulsion. (NONE = CAN'T MOVE OR DODGE)
69 public var _legs
:Vector
.<Leg
> = new Vector
.<Leg
>();
70 // Places to put babies if the "father" has a penis and doesn't know the FALCON PUNCH. Anal pregnancy is okay but only with dicks with that flag.
71 public var _vaginas
:Vector
.<Vagina
> = new Vector
.<Vagina
>();
73 public var _wings
:Vector
.<Wing
> = new Vector
.<Wing
>();
75 public var explored
:Vector
.<String> = new Vector
.<String>();
77 public var clothing
:Vector
.<Clothing
> = new Vector
.<Clothing
>();
80 * Do stats scale with the PC (false) or stay the same (true)?
81 * Mostly useful for bosses.
83 public var staticStats
:Boolean = false;
85 public var main
:AdventureController
= null;
87 protected var abilityUseProbability
:Number = 1;
88 protected var turnsToLose
:int = 0;
90 public function Creature
()
92 trace
("Creature.init()");
93 clearFuckingEverything
();
95 _gold
= MathUtils
.rand
(0, 50);
100 * IF YOU ADD ANY NEW VARIABLES TO THIS CLASS, RESET THEM TO DEFAULT VALUES HERE!
102 private function clearFuckingEverything
():void {
103 _level
= 0; // In comparison to standard human being. No attacking rats for 20 levels.
104 d_level
= 0; // Delta
105 _strength
= 1; // Damage caused in case of a successful attack.
106 _speed
= 1; // Chance of dodging [0-1]. defending.speed-attacking.speed = relative chance of dodging.
107 _intellect
= 1; // Smartness. Opens dialog trees and gives hints.
108 _lust
= 1; // Slowly increases over time, eliminated by masturbation or smecks. Some battles are nonsexual and will not affect lust, others will slightly increase it based on ((number of balls x ball hormone output)+(number of vaginas * vagina hormone output)* sensitivity).
109 _sensitivity
= 0; // 0-1, 0 being not sensitive
110 _HP
= 100; //100*(level*0.02)
111 _XP
= 0; // 50*(level*0.5)
112 _mana
= 0; // Magic shit, increases over time, especially near relaxing places.
113 _gold
= 0; // Currency
115 _abilities
= new Object();
116 _assholes
= new Vector
.<Asshole
>();
117 _arms
= new Vector
.<Arm
>();
118 _balls
= new Vector
.<Testicle
>();
119 _breasts
= new Vector
.<Breast
>();
120 _dicks
= new Vector
.<Penis
>();
121 enchantments
= new Object();
122 _eyes
= new Vector
.<Eye
>();
123 inventory
= new Vector
.<Item
>();
124 _legs
= new Vector
.<Leg
>();
125 _vaginas
= new Vector
.<Vagina
>();
126 _wings
= new Vector
.<Wing
>();
127 explored
= new Vector
.<String>();
128 clothing
= new Vector
.<Clothing
>();
131 public function addBreast
():Breast
133 trace
("USING CREATURE.ADDBREAST INSTEAD OF OVERRIDING");
139 * @return What the gender LOOKS like, given what you can see with clothing.
141 public function getApparentGender
():Gender
143 var canSeeDick
:Boolean = false;
144 var canSeeBalls
:Boolean = false;
145 var canSeeBoobs
:Boolean = false;
146 var canSeeVag
:Boolean = false;
148 for each (var d
:Penis
in dicks
)
152 if (!d
.isConcealedBy
(this, clothing
))
154 trace
(d
.getDescr
(1, this), "gave", getTypeName
(), "away");
160 for each (var t
:Testicle
in balls
)
164 if (!t
.isConcealedBy
(this, clothing
))
166 trace
(t
.getDescr
(1, this), "gave", getTypeName
(), "away");
172 for each (var b
:Breast
in breasts
)
176 if (!b
.isConcealedBy
(this, clothing
))
178 trace
(b
.getDescr
(1, this), "gave", getTypeName
(), "away");
184 for each (var v
:Vagina
in vaginas
)
188 if (!v
.isConcealedBy
(this, clothing
))
190 trace
(v
.getDescr
(1, this), "gave", getTypeName
(), "away");
195 var masc
:Boolean = canSeeDick
|| canSeeBalls
;
196 var fem
:Boolean = canSeeBoobs
|| canSeeVag
;
202 return Gender
.FEMALE
;
206 public function breastDelta
(delta
:Number, mult
:Boolean):void
208 for (var i
:int = 0; i
< _breasts
.length
; i
++)
210 _breasts
[i
].size
+= (delta
);
215 public function dickDelta
(delta
:Number, mult
:Boolean):void
217 for (var i
:int = 0; i
< _dicks
.length
; i
++)
219 _dicks
[i
].sizeMult
+= (delta
);
221 _dicks
[i
].size
+= (delta
);
224 public function testicleDelta
(delta
:Number, mult
:Boolean):void
226 for (var i
:int = 0; i
< _balls
.length
; i
++)
228 _balls
[i
].loadMult
+= (delta
);
230 _balls
[i
].normalLoad
+= (delta
);
233 public function addEnchantment
(ench
:Enchantment
):String
235 var story
:String = ench
.onInit
(this);
236 if (!ench
.cancelAddition
)
237 this.enchantments
[ench
.getID
()] = ench
;
241 public function setupBody
():void
243 initialGenderSetup
();
246 if (this._arms
.length
== 0)
247 trace
("[WARNING] ", this.getTypeName
(), " has no arms!");
248 if (this._assholes
.length
== 0)
249 trace
("[WARNING] ", this.getTypeName
(), " has no anuses!");
250 if (this._gender
.hasDick
&& this._balls
.length
== 0)
251 trace
("[WARNING] ", this.getTypeName
(), " has no balls!");
252 if (this._breasts
.length
== 0)
253 trace
("[WARNING] ", this.getTypeName
(), " has no breasts!");
254 if (this._gender
.hasDick
&& this._dicks
.length
== 0)
255 trace
("[WARNING] ", this.getTypeName
(), " has no dick!");
256 if (this._eyes
.length
== 0)
257 trace
("[WARNING] ", this.getTypeName
(), " has no eyes!");
258 if (this._legs
.length
== 0)
259 trace
("[WARNING] ", this.getTypeName
(), " has no legs!");
260 if (this._gender
.hasVag
&& this._vaginas
.length
== 0)
261 trace
("[WARNING] ", this.getTypeName
(), " has no vag!");
265 public function initialGenderSetup
():void
267 mGenderInitialized
= true;
270 public function yourMove
(cs
:CombatScreen
, ply
:Creature
):void
272 if ((turnsToLose
> 0) || notifyEnchantments
(new CombatTurnEvent
(cs
, ply
)))
274 InfoScreen
.push
("<p>The " + getTypeName
() + " cannot attack!</p>");
281 if (MathUtils
.lengthOf
(abilities
) > 0 && MathUtils
.rand
(0, abilityUseProbability
) == 0)
283 var ab
:Ability
= Ability
(MathUtils
.getRandomObjectEntry
(abilities
));
284 if (this.mana
< ab
.manaCost
)
286 InfoScreen
.push
("<p>The " + getTypeName
() + " tried to use " + ab
.name
+ " but is too exhausted!</p>");
289 if (ab
.activate
(this, ply
))
291 this.mana
-= ab
.manaCost
295 cs
.tryAttack
(this, ply
);
299 public function addDick
(type
:String = "default"):Penis
304 public function addLust
(amt
:Number = 1):void
306 var adding2Lust
:int = (amt
* getLustMult
());
307 trace
("Adding to lust ", adding2Lust
);
308 lust
+= Math.ceil
(adding2Lust
);
311 private function getLustMult
():Number
313 var numballs
:Number = balls
.length
;
314 var loadMultSum
:Number = 0;
315 for (var i
:int = 0; i
< balls
.length
; i
++)
317 loadMultSum
+= (balls
[i
] as Testicle
).loadMult
* 0.5;
322 public function takeFromInventory
(item
:Item
):void
324 for (var i
:int = 0; i
< inventory
.length
; i
++)
326 if ((inventory
[i
] as Item
).id
== item
.id
)
328 (inventory
[i
] as Item
).amount
-= item
.amount
;
329 if ((inventory
[i
] as Item
).amount
<= 0)
330 inventory
.splice
(i
, 1);
336 public function addToInventory
(item
:Item
):void
338 for (var i
:int = 0; i
< inventory
.length
; i
++)
340 if ((inventory
[i
] as Item
).id
== item
.id
)
342 (inventory
[i
] as Item
).amount
+= item
.amount
;
346 if (inventory
.length
< 11)
348 inventory
.push
(item
);
353 main
.showInventory
(item
);
357 public function combatDescr
(subj
:Creature
):String
359 if (getInterested
(subj
))
363 var o
:String = "<p>" + Utils
.A
(getTypeName
(), true) + " " + getTypeName
() + " leaps from the bushes and attacks!</p><p>Your attacker is ";
364 o
+= getDescription
();
369 public function onEncounter
(ply
:Creature
):Boolean
374 public function onWin
(ply
:Creature
):Boolean
380 * Override this and return true to override the default "YOU WHIN TEH PRIZE!!!!" screen
384 public function onLose
(ply
:Creature
):Boolean
389 protected function genName
():void
391 var firstNames
:Array = ["Andrew", "Alex", "Boris", "Charles", "Alexei", "Drew", "Scruffy", "Gonnadi", "Adolf", "Albert", "Bruno", "Frederick", "Ray"];
393 var lastNames
:Array = ["Lenin", "Hitler", "Jenkins", "Balboa", "Nelson", "O'Reilly", "McDonald", "Charles", "Rubin", "Schwarzeneggar"];
394 ownName
= MathUtils
.getRandomArrayEntry
(firstNames
) + " " + MathUtils
.getRandomArrayEntry
(lastNames
);
398 public function recalcGender
():void
400 if (balls
.length
> 0)
402 if (vaginas
.length
> 0)
404 gender
= Gender
.HERM
;
408 gender
= Gender
.MALE
;
413 if (vaginas
.length
> 0)
415 gender
= Gender
.FEMALE
;
419 gender
= Gender
.ASEXUAL
;
426 * @return String Whatever it's called
428 public function getTypeName
():String
430 throw new Error("SOME DUMBASS DIDN'T GIVE THIS CREATURE A NAME");
431 return "NOT FUCKING NAMED YET";
435 * Do I have the option to run?
436 * @return Button visibility
438 public function canRun
():Boolean
443 public function areAnyConcealed
(parts
:Vector
.<IBodyPart
>):Boolean
445 var yes
:Boolean = false;
446 for each (var p
:IBodyPart
in parts
)
448 if (p
!= null && p
.isConcealedBy
(this, clothing
))
454 public function isHeadConcealed
():Boolean
456 var wat
:Function = function(c_
:Object, index
:int, vector
:Vector
.<Clothing
>):Boolean
458 var c
:Clothing
= Clothing
(c_
);
460 return (c
.type
.obscures
.indexOf
("head") > -1);
464 return clothing
.some
(wat
);
467 public function isWearing
(ct
:ClothingType
):Boolean
469 var wat
:Function = function(c_
:Object, index
:int, vector
:Vector
.<Clothing
>):Boolean
471 var c
:Clothing
= Clothing
(c_
);
473 return (c
.type
== ct
);
477 return clothing
.some
(wat
);
480 public function areEyesConcealed
():Boolean
482 return areAnyConcealed
(Vector
.<IBodyPart
>(eyes
));
485 public function getDescription
():String
487 var descr
:String = "";
488 // a gay human male of average height and build. He also possesses a long, flowing mane of golden hair,
489 // which contrasts nicely with your blue eyes and light skin.
491 // In the equipment department, you're not too odd. You have two human testicles swinging between your legs, paired with
492 // a single, 5.5" human schlong. Your breasts are flat, but well-sculpted human pecs, and you have a standard-issue male
493 // ass with a standard-issue virgin male asshole between its buns. You've got two human arms, two human legs.
495 // In other words, you're an average human, which probably won't last long down here.
498 // NOW WITH ENEMY TRAPS
499 var aGender
:Gender
= getApparentGender
();
500 descr
= Utils
.A
(sexualPreference
.label
) + " " + aGender
.label
+ " " + getTypeName
() + ", who " + build
.getDescription
();
502 if (!isHeadConcealed
())
506 descr
+= ", %POS% glistening scalp";
507 if (!areEyesConcealed
())
508 descr
+= " distracting from %POS%";
512 descr
+= ". %CSUB% has " + hair
;
513 if (!areEyesConcealed
())
514 descr
+= ", which constrasts nicely with %POS%";
519 descr
+= ", and has";
521 if (!areEyesConcealed
())
523 if (eyes
.length
== 0)
525 if (isHeadConcealed
())
527 descr
+= " complete lack of eyes";
530 descr
+= getEyesDescr
();
534 descr
+= skin
.getDescr
(0, this);
537 descr
+= "<p>In the equipment department, ";
538 var wearingPants
:Boolean = isWearing
(ClothingType
.PANTS
);
539 var haveBalls
:Boolean = (balls
.length
> 0 && !wearingPants
);
540 var haveDicks
:Boolean = (dicks
.length
> 0 && !wearingPants
);
541 var haveVags
:Boolean = (vaginas
.length
> 0 && !wearingPants
);
542 if (haveBalls
&& haveDicks
)
543 descr
+= "%SUB% has " + getTesticleDescr
() + " swinging between %POS% legs, paired with " + getDickDescr
() + ".";
544 if (!haveBalls
&& haveDicks
)
545 descr
+= "no testicles rub between %POS% thighs when %SUB% walks, but %SUB% does have " + getDickDescr
() + ".";
546 if (haveBalls
&& !haveDicks
)
547 descr
+= "%SUB% doesn't have a dick, but %SUB% does have " + getTesticleDescr
() + ". %SUB% seems to get more horny as time passes.";
550 descr
+= " %CPOS% body possesses " + getVagDescr
() + ".";
552 if (!haveBalls
&& !haveDicks
&& !haveVags
)
554 descr
+= " You can't see any dangly parts, nor anything else between %POS% legs.";
555 if (breasts
.length
> 0)
556 descr
+= " However, ";
559 if (breasts
.length
> 0)
561 descr
+= " %CSUB% has " + getBreastDescr
();
562 if (assholes
.length
> 0 && !areAnyConcealed
(Vector
.<IBodyPart
>(assholes
)))
564 descr
+= ", and also has " + getAssDescr
() + ".";
573 descr
+= " %CSUB% doesn't have any breasts";
574 if (assholes
.length
> 0 && !areAnyConcealed
(Vector
.<IBodyPart
>(assholes
)))
576 descr
+= ", but does have " + getAssDescr
() + ".";
586 descr
+= " %CSUB% has " + getArmsDescr
() + ", ";
588 descr
+= " %CSUB% doesn't have any arms, ";
592 if (arms
.length
== 0)
593 descr
+= "but %SUB% DOES have ";
596 descr
+= getLegsDescr
() + ".";
599 descr
+= "and no legs.";
601 if (wings
.length
> 0)
603 descr
+= " %CSUB% also has " + getWingsDescr
() + ".";
608 descr
+= "<p>%CSUB% is wearing " + ((clothing
.length
> 0) ? "a " + getClothingDescr
() : "nothing") + ".</p>";
609 if (aGender
.label
!= gender
.label
)
610 descr
+= "<p><small>DEBUG: %CSUB% is actually a " + gender
.label
+ " with " + getDickDescr
() + "/" + getTesticleDescr
() + "/" + getVagDescr
() + ". TEE HEE.</small></p>";
612 return aGender
.doReplace
(descr
);
615 public function hasEnchantment
(name
:String):Boolean
617 return Utils
.objHas
(enchantments
, name
);
620 public function levelUp
(firstOne
:Boolean = false):void
624 InfoScreen
.push
("<h2>Levelled up!</h2><p>You are now at level " + level
+ "!</p>");
627 public function onCombatInit
(ply
:Player
):void
632 public function get maxMana
():int
634 return 100 + ((level
- 1) * 10);
637 public function get maxHP
():int
639 return 100 + ((level
- 1) * 10);
642 public function get maxXP
():int
644 return Math.max
(1, 50 * (_level
* 0.5));
647 public function getExplored
(loc
:String):Boolean
649 for (var i
:int = 0; i
< explored
.length
; i
++)
651 if (explored
[i
] == loc
)
657 public function setExplored
(loc
:String):void
659 if (getExplored
(loc
))
664 public function getEffectivenessMultiplier
(defender
:Creature
):Number
666 var a
:Number = strength
;
667 var e
:Number = defender
.strength
;
668 return (a
* (100 - e
)) / 10000;
672 * Calculation from http://www.gamedev.net/topic/183822-rpg-combat-formula-question/
675 public function speedCheckAgainst
(attacker
:Creature
):Boolean
677 // C = A * (100% - E)
680 // A = Attacker's accuracy (speed, in our case)
681 // E = Defender's evasion rate (speed, again)
682 var a
:Number = attacker
.speed
;
683 var e
:Number = speed
;
684 return Math.random
() <= (a
* (100 - e
)) / 10000;
688 * Calculation from http://www.gamedev.net/topic/183822-rpg-combat-formula-question/
691 public function strengthCheckAgainst
(attacker
:Creature
):Boolean
693 var a
:Number = attacker
.strength
;
694 var e
:Number = strength
;
695 // C = A * (100% - E)
698 // A = Attacker's accuracy (strength, in our case)
699 // E = Defender's evasion rate (strength, again)
700 return Math.random
() <= (a
* (100 - e
)) / 10000;
704 * Figure out how much shit we're going to wreck.
706 * @param weapon or null
709 public function damageAgainst
(attacker
:Creature
, weapon
:IWeapon
):Number
712 // TODO: Probably need to factor in speed or something at some point. I ain't a math guy.
713 var a
:Number = attacker
.strength
;
714 var e
:Number = strength
;
715 var weaponDamage
:Number = 0;
717 weaponDamage
= weapon
.calcDamage
(this, attacker
);
718 var dmg
:Number = (MathUtils
.rand
(0, 1, false) + level
+ (strength
/ 50) + weaponDamage
) - (MathUtils
.rand
(0, 1, false) + attacker
.level
+ (attacker
.strength
/ 50));
720 return Math.ceil
((dmg
> 0) ? dmg
: 1); // Keep above 1 (no negatives, no 0-damage attacks.)
723 public function get strength
():int
728 public function set strength
(str
:int):void
734 public function get speed
():int
739 public function set speed
(spd
:int):void
745 public function get lust
():int
750 public function set lust
(lst
:int):void
758 public function get gold
():int
763 public function set gold
(value
:int):void
771 public function get intellect
():int
776 public function set intellect
(i
:int):void
782 public function get mana
():int
787 public function set mana
(i
:int):void
793 public function get sensitivity
():int
798 public function set sensitivity
(i
:int):void
804 public function get assholes
():Vector
.<Asshole
>
806 return this._assholes
;
809 public function set assholes
(balls
:Vector
.<Asshole
>):void
811 this._assholes
= balls
;
815 public function hasItem
(id
:int):Boolean
817 for each (var item
:Item
in this.inventory
)
825 public function get breasts
():Vector
.<Breast
>
827 return this._breasts
;
830 public function set breasts
(balls
:Vector
.<Breast
>):void
832 this._breasts
= balls
;
836 public function get eyes
():Vector
.<Eye
>
841 public function set eyes
(balls
:Vector
.<Eye
>):void
847 public function get vaginas
():Vector
.<Vagina
>
849 return this._vaginas
;
852 public function set vaginas
(balls
:Vector
.<Vagina
>):void
854 this._vaginas
= balls
;
858 public function get arms
():Vector
.<Arm
>
863 public function set arms
(arr
:Vector
.<Arm
>):void
869 public function get legs
():Vector
.<Leg
>
874 public function set legs
(arr
:Vector
.<Leg
>):void
880 public function get wings
():Vector
.<Wing
>
885 public function set wings
(arr
:Vector
.<Wing
>):void
891 public function get balls
():Vector
.<Testicle
>
896 public function set balls
(balls
:Vector
.<Testicle
>):void
902 public function get dicks
():Vector
.<Penis
>
907 public function set dicks
(aaa
:Vector
.<Penis
>):void
913 public function get abilities
():Object
918 public function set abilities
(arr
:Object):void
923 public function get gender
():Gender
928 public function set gender
(value
:Gender
):void
934 public function get HP
():int
939 public function set HP
(value
:int):void
945 public function get XP
():int
950 public function set XP
(value
:int):void
952 //trace("XP", value);
962 public function setMain
(main
:AdventureController
):void
967 private function doStatsUpdate
():void
976 if (_eyes
.length
== 0)
977 _speed
= 0.1; // 1/10 chance of hitting when blind
981 public function get level
():int
986 private function getBodyPartDesc
(collection
:Vector
.<IBodyPart
>, singular
:String):String
989 if (collection
.length
== 0)
991 return "no " + Utils
.pluralize
(2, singular
);
994 var varying
:Boolean = false;
995 var types
:Object = new Object();
996 var lname
:String = "";
997 var numtypes
:Number = 0;
998 for each (var i
:*in collection
)
1000 var t
:IBodyPart
= i
as IBodyPart
;
1005 if (!(lname
in types
))
1014 for each (t
in collection
)
1016 if (t
.name
== lname
)
1017 return t
.getDescr
(types
[lname
], this);
1023 for (var ot
:*in types
)
1025 var gotdescr
:Boolean = false;
1026 for each (t
in collection
)
1032 out
+= ", " + t
.getDescr
(types
[ot
] as Number, this);
1039 return collection
.length
+ " " + singular
+ "s of varying types (" + out
.substr
(2) + ")";
1044 public function notifyEnchantments
(e
:*):Boolean
1046 var collection
:Array = [];
1047 for (var eID
:String in enchantments
)
1049 var ench
:Enchantment
= enchantments
[eID
];
1050 if (e
is CombatStartEvent
)
1052 ench
.onCombatInit
(e
.other
);
1054 if (e
is CombatEndEvent
)
1056 ench
.onCombatComplete
(e
.won
, e
.other
);
1058 if (e
is CombatTurnEvent
)
1060 return ench
.onMyCombatTurn
(e
.screen
, e
.other
);
1066 public function inventoryUpdate
(item
:Item
, received
:Boolean):Boolean
1068 var actionToTake
:int = -1;
1069 for (var eID
:String in enchantments
)
1071 var act
:int = enchantments
[eID
].onInventoryReceived
(item
);
1072 if (act
!= Enchantment
.INTERCEPT_ACTION_NONE
)
1078 switch (actionToTake
)
1080 case Enchantment
.INTERCEPT_ACTION_TOSS
:
1081 // Do nothing, we're already tossing.
1083 case Enchantment
.INTERCEPT_ACTION_USE
:
1089 return actionToTake
== Enchantment
.INTERCEPT_ACTION_NONE
;
1092 public function getTesticleDescr
():String
1094 return getBodyPartDesc
(Vector
.<IBodyPart
>(balls
), "ball");
1097 public function getBulgesInPants
():String
1099 var numBulge
:int = 0;
1100 var peeks
:Vector
.<Penis
> = new Vector
.<Penis
>();
1101 for each (var p
:Penis
in dicks
)
1105 if (!p
.isConcealedBy
(this, clothing
))
1107 for each (var c
:Clothing
in clothing
)
1111 var bsize
:Number = p
.getBulgeSize
(this, c
);
1112 trace
(p
.getDescr
(1, this), "bsize=" + bsize
.toString
());
1127 if (numBulge
== 0 && peeks
.length
== 0)
1129 var fo
:String = " (which has ";
1132 fo
+= numBulge
+ " " + Utils
.pluralize
(numBulge
, "bulge", "bulges");
1134 if (numBulge
> 0 && peeks
.length
> 0)
1138 if (peeks
.length
> 0)
1140 fo
+= getBodyPartDesc
(Vector
.<IBodyPart
>(peeks
), "dick") + " peeking over %POS% waistband";
1145 public function getDickDescr
():String
1147 return getBodyPartDesc
(Vector
.<IBodyPart
>(dicks
), "dick");
1150 public function getVagDescr
():String
1152 return getBodyPartDesc
(Vector
.<IBodyPart
>(vaginas
), "vag");
1155 public function getBreastDescr
():String
1157 return getBodyPartDesc
(Vector
.<IBodyPart
>(breasts
), "boob");
1160 public function getAssDescr
():String
1162 return getBodyPartDesc
(Vector
.<IBodyPart
>(assholes
), "asshole");
1165 public function getArmsDescr
():String
1167 return getBodyPartDesc
(Vector
.<IBodyPart
>(arms
), "arm");
1170 public function getEyesDescr
():String
1172 return getBodyPartDesc
(Vector
.<IBodyPart
>(eyes
), "eye");
1175 public function getLegsDescr
():String
1177 return getBodyPartDesc
(Vector
.<IBodyPart
>(legs
), "leg");
1180 public function getWingsDescr
():String
1182 return getBodyPartDesc
(Vector
.<IBodyPart
>(wings
), "wing");
1185 public function getClothingDescr
():String
1187 var desc
:String = "";
1189 for (var i
:int = 0; i
< clothing
.length
; i
++)
1191 var item
:Clothing
= clothing
[i
];
1193 desc
+= item
.getDescr
(this);
1197 case ClothingType
.HEADGEAR
:
1198 desc
+= " as a hat";
1200 case ClothingType
.TOP
:
1201 desc
+= " as a shirt";
1203 case ClothingType
.FOOTWEAR
:
1204 desc
+= " as shoes";
1206 case ClothingType
.PANTS
:
1207 desc
+= " as trousers" + getBulgesInPants
();
1211 if (i
< (clothing
.length
- 3))
1215 else if (i
== (clothing
.length
- 2))
1229 * +---------------+---+---+
1231 * +---------------+---+---+
1236 * +---------------+---+---+
1238 public function getInterested
(subj
:Creature
):Boolean
1240 return sexualPreference
.isOppositeGender
(gender
, subj
.getApparentGender
()); // trollface.jpg
1244 * By default, only allow rape if health == 0 or paralyzed.
1245 * @param rapist WHO BE RAPIN ME
1248 public function tryRape
(rapist
:Creature
):Boolean
1250 return (HP
== 0 || Paralyze
.isParalyzed
(this));
1254 public function getHostile
(subj
:Creature
):Boolean
1259 public function performConversion
(oldMe
:Creature
):void
1264 public function changeFrom
(f
:Creature
):void
1266 this.performConversion
(f
);
1269 public function loseTurns
(numturns
:int):void
1271 turnsToLose
+= numturns
;
1274 public function getRapable
():Boolean
1276 return canRun
() && HP
< (maxHP
/ 3);
1280 * Alter the rape menu to fit your needs.
1284 public function onRape
(ply
:Creature
, rape
:Rape
):void
1290 * Does this character have any weapons?
1293 public function hasAnyWeapon
():Boolean {
1294 for (var i
:int = 0; i
< arms
.length
; i
++) {
1295 if (arms
[0].weapon
!= null)
1302 * Find any equipped weapon.
1305 public function getFirstWeapon
():IWeapon
{
1306 for (var i
:int = 0; i
< arms
.length
; i
++) {
1307 if (arms
[0].weapon
!= null)
1308 return arms
[0].weapon
;
1313 public function get hair
():Hair
{ return _hair
; }
1314 public function set hair
(value
:Hair
):void { _hair
=value
; }