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
= 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
49 // What magic/techniques can I use?
50 public var _abilities
:Object = new Object();
51 // How many, and what type of assholes do I possess?
52 public var _assholes
:Vector
.<Asshole
> = new Vector
.<Asshole
>();
53 // Needed to attack. Tentacles are ok.
54 public var _arms
:Vector
.<Arm
> = new Vector
.<Arm
>();
55 // Testes (Cum and pregnancy options)
56 public var _balls
:Vector
.<Testicle
> = new Vector
.<Testicle
>();
58 public var _breasts
:Vector
.<Breast
> = new Vector
.<Breast
>();
59 // Penises (Pleasure options, testes required for preggo/cum stuff)
60 public var _dicks
:Vector
.<Penis
> = new Vector
.<Penis
>();
61 // What kinds of effects am I suffering/benefiting from?
62 public var enchantments
:Object = new Object();
63 // How many/what kinds of eyes do I have?
64 public var _eyes
:Vector
.<Eye
> = new Vector
.<Eye
>();
65 // What stuff am I carrying?
66 public var inventory
:Vector
.<Item
> = new Vector
.<Item
>();
67 // Legs or locomotive tentacles or some other propulsion. (NONE = CAN'T MOVE OR DODGE)
68 public var _legs
:Vector
.<Leg
> = new Vector
.<Leg
>();
69 // 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.
70 public var _vaginas
:Vector
.<Vagina
> = new Vector
.<Vagina
>();
72 public var _wings
:Vector
.<Wing
> = new Vector
.<Wing
>();
74 public var explored
:Vector
.<String> = new Vector
.<String>();
76 public var clothing
:Vector
.<Clothing
> = new Vector
.<Clothing
>();
79 * Do stats scale with the PC (false) or stay the same (true)?
80 * Mostly useful for bosses.
82 public var staticStats
:Boolean = false;
84 public var main
:AdventureController
= null;
86 protected var abilityUseProbability
:Number = 1;
87 protected var turnsToLose
:int = 0;
89 public function Creature
()
91 trace
("Creature.init()");
92 clearFuckingEverything
();
94 _gold
= MathUtils
.rand
(0, 50);
99 * IF YOU ADD ANY NEW VARIABLES TO THIS CLASS, RESET THEM TO DEFAULT VALUES HERE!
101 private function clearFuckingEverything
():void {
102 _level
= 0; // In comparison to standard human being. No attacking rats for 20 levels.
103 d_level
= 0; // Delta
104 _strength
= 1; // Damage caused in case of a successful attack.
105 _speed
= 1; // Chance of dodging [0-1]. defending.speed-attacking.speed = relative chance of dodging.
106 _intellect
= 1; // Smartness. Opens dialog trees and gives hints.
107 _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).
108 _sensitivity
= 0; // 0-1, 0 being not sensitive
109 _HP
= 100; //100*(level*0.02)
110 _XP
= 0; // 50*(level*0.5)
111 _mana
= 0; // Magic shit, increases over time, especially near relaxing places.
112 _gold
= 0; // Currency
114 _abilities
= new Object();
115 _assholes
= new Vector
.<Asshole
>();
116 _arms
= new Vector
.<Arm
>();
117 _balls
= new Vector
.<Testicle
>();
118 _breasts
= new Vector
.<Breast
>();
119 _dicks
= new Vector
.<Penis
>();
120 enchantments
= new Object();
121 _eyes
= new Vector
.<Eye
>();
122 inventory
= new Vector
.<Item
>();
123 _legs
= new Vector
.<Leg
>();
124 _vaginas
= new Vector
.<Vagina
>();
125 _wings
= new Vector
.<Wing
>();
126 explored
= new Vector
.<String>();
127 clothing
= new Vector
.<Clothing
>();
130 public function addBreast
():Breast
132 trace
("USING CREATURE.ADDBREAST INSTEAD OF OVERRIDING");
138 * @return What the gender LOOKS like, given what you can see with clothing.
140 public function getApparentGender
():Gender
142 var canSeeDick
:Boolean = false;
143 var canSeeBalls
:Boolean = false;
144 var canSeeBoobs
:Boolean = false;
145 var canSeeVag
:Boolean = false;
147 for each (var d
:Penis
in dicks
)
151 if (!d
.isConcealedBy
(this, clothing
))
153 trace
(d
.getDescr
(1, this), "gave", getTypeName
(), "away");
159 for each (var t
:Testicle
in balls
)
163 if (!t
.isConcealedBy
(this, clothing
))
165 trace
(t
.getDescr
(1, this), "gave", getTypeName
(), "away");
171 for each (var b
:Breast
in breasts
)
175 if (!b
.isConcealedBy
(this, clothing
))
177 trace
(b
.getDescr
(1, this), "gave", getTypeName
(), "away");
183 for each (var v
:Vagina
in vaginas
)
187 if (!v
.isConcealedBy
(this, clothing
))
189 trace
(v
.getDescr
(1, this), "gave", getTypeName
(), "away");
194 var masc
:Boolean = canSeeDick
|| canSeeBalls
;
195 var fem
:Boolean = canSeeBoobs
|| canSeeVag
;
201 return Gender
.FEMALE
;
205 public function breastDelta
(delta
:Number, mult
:Boolean):void
207 for (var i
:int = 0; i
< _breasts
.length
; i
++)
209 _breasts
[i
].size
+= (delta
);
214 public function dickDelta
(delta
:Number, mult
:Boolean):void
216 for (var i
:int = 0; i
< _dicks
.length
; i
++)
218 _dicks
[i
].sizeMult
+= (delta
);
220 _dicks
[i
].size
+= (delta
);
223 public function testicleDelta
(delta
:Number, mult
:Boolean):void
225 for (var i
:int = 0; i
< _balls
.length
; i
++)
227 _balls
[i
].loadMult
+= (delta
);
229 _balls
[i
].normalLoad
+= (delta
);
232 public function addEnchantment
(ench
:Enchantment
):String
234 var story
:String = ench
.onInit
(this);
235 if (!ench
.cancelAddition
)
236 this.enchantments
[ench
.getID
()] = ench
;
240 public function setupBody
():void
242 initialGenderSetup
();
245 if (this._arms
.length
== 0)
246 trace
("[WARNING] ", this.getTypeName
(), " has no arms!");
247 if (this._assholes
.length
== 0)
248 trace
("[WARNING] ", this.getTypeName
(), " has no anuses!");
249 if (this._gender
.hasDick
&& this._balls
.length
== 0)
250 trace
("[WARNING] ", this.getTypeName
(), " has no balls!");
251 if (this._breasts
.length
== 0)
252 trace
("[WARNING] ", this.getTypeName
(), " has no breasts!");
253 if (this._gender
.hasDick
&& this._dicks
.length
== 0)
254 trace
("[WARNING] ", this.getTypeName
(), " has no dick!");
255 if (this._eyes
.length
== 0)
256 trace
("[WARNING] ", this.getTypeName
(), " has no eyes!");
257 if (this._legs
.length
== 0)
258 trace
("[WARNING] ", this.getTypeName
(), " has no legs!");
259 if (this._gender
.hasVag
&& this._vaginas
.length
== 0)
260 trace
("[WARNING] ", this.getTypeName
(), " has no vag!");
264 public function initialGenderSetup
():void
266 mGenderInitialized
= true;
269 public function yourMove
(cs
:CombatScreen
, ply
:Creature
):void
271 if ((turnsToLose
> 0) || notifyEnchantments
(new CombatTurnEvent
(cs
, ply
)))
273 InfoScreen
.push
("<p>The " + getTypeName
() + " cannot attack!</p>");
280 if (MathUtils
.lengthOf
(abilities
) > 0 && MathUtils
.rand
(0, abilityUseProbability
) == 0)
282 var ab
:Ability
= Ability
(MathUtils
.getRandomObjectEntry
(abilities
));
283 if (this.mana
< ab
.manaCost
)
285 InfoScreen
.push
("<p>The " + getTypeName
() + " tried to use " + ab
.name
+ " but is too exhausted!</p>");
288 if (ab
.activate
(this, ply
))
290 this.mana
-= ab
.manaCost
294 cs
.tryAttack
(this, ply
);
298 public function addDick
(type
:String = "default"):Penis
303 public function addLust
(amt
:Number = 1):void
305 var adding2Lust
:int = (amt
* getLustMult
());
306 trace
("Adding to lust ", adding2Lust
);
307 lust
+= Math.ceil
(adding2Lust
);
310 private function getLustMult
():Number
312 var numballs
:Number = balls
.length
;
313 var loadMultSum
:Number = 0;
314 for (var i
:int = 0; i
< balls
.length
; i
++)
316 loadMultSum
+= (balls
[i
] as Testicle
).loadMult
* 0.5;
321 public function takeFromInventory
(item
:Item
):void
323 for (var i
:int = 0; i
< inventory
.length
; i
++)
325 if ((inventory
[i
] as Item
).id
== item
.id
)
327 (inventory
[i
] as Item
).amount
-= item
.amount
;
328 if ((inventory
[i
] as Item
).amount
<= 0)
329 inventory
.splice
(i
, 1);
335 public function addToInventory
(item
:Item
):void
337 for (var i
:int = 0; i
< inventory
.length
; i
++)
339 if ((inventory
[i
] as Item
).id
== item
.id
)
341 (inventory
[i
] as Item
).amount
+= item
.amount
;
345 if (inventory
.length
< 11)
347 inventory
.push
(item
);
352 main
.showInventory
(item
);
356 public function combatDescr
(subj
:Creature
):String
358 if (getInterested
(subj
))
362 var o
:String = "<p>" + Utils
.A
(getTypeName
(), true) + " " + getTypeName
() + " leaps from the bushes and attacks!</p><p>Your attacker is ";
363 o
+= getDescription
();
368 public function onEncounter
(ply
:Creature
):Boolean
373 public function onWin
(ply
:Creature
):Boolean
379 * Override this and return true to override the default "YOU WHIN TEH PRIZE!!!!" screen
383 public function onLose
(ply
:Creature
):Boolean
388 protected function genName
():void
390 var firstNames
:Array = ["Andrew", "Alex", "Boris", "Charles", "Alexei", "Drew", "Scruffy", "Gonnadi", "Adolf", "Albert", "Bruno", "Frederick", "Ray"];
392 var lastNames
:Array = ["Lenin", "Hitler", "Jenkins", "Balboa", "Nelson", "O'Reilly", "McDonald", "Charles", "Rubin", "Schwarzeneggar"];
393 ownName
= MathUtils
.getRandomArrayEntry
(firstNames
) + " " + MathUtils
.getRandomArrayEntry
(lastNames
);
397 public function recalcGender
():void
399 if (balls
.length
> 0)
401 if (vaginas
.length
> 0)
403 gender
= Gender
.HERM
;
407 gender
= Gender
.MALE
;
412 if (vaginas
.length
> 0)
414 gender
= Gender
.FEMALE
;
418 gender
= Gender
.ASEXUAL
;
425 * @return String Whatever it's called
427 public function getTypeName
():String
429 throw new Error("SOME DUMBASS DIDN'T GIVE THIS CREATURE A NAME");
430 return "NOT FUCKING NAMED YET";
434 * Do I have the option to run?
435 * @return Button visibility
437 public function canRun
():Boolean
442 public function areAnyConcealed
(parts
:Vector
.<IBodyPart
>):Boolean
444 var yes
:Boolean = false;
445 for each (var p
:IBodyPart
in parts
)
447 if (p
!= null && p
.isConcealedBy
(this, clothing
))
453 public function isHeadConcealed
():Boolean
455 var wat
:Function = function(c_
:Object, index
:int, vector
:Vector
.<Clothing
>):Boolean
457 var c
:Clothing
= Clothing
(c_
);
459 return (c
.type
.obscures
.indexOf
("head") > -1);
463 return clothing
.some
(wat
);
466 public function isWearing
(ct
:ClothingType
):Boolean
468 var wat
:Function = function(c_
:Object, index
:int, vector
:Vector
.<Clothing
>):Boolean
470 var c
:Clothing
= Clothing
(c_
);
472 return (c
.type
== ct
);
476 return clothing
.some
(wat
);
479 public function areEyesConcealed
():Boolean
481 return areAnyConcealed
(Vector
.<IBodyPart
>(eyes
));
484 public function getDescription
():String
486 var descr
:String = "";
487 // a gay human male of average height and build. He also possesses a long, flowing mane of golden hair,
488 // which contrasts nicely with your blue eyes and light skin.
490 // In the equipment department, you're not too odd. You have two human testicles swinging between your legs, paired with
491 // a single, 5.5" human schlong. Your breasts are flat, but well-sculpted human pecs, and you have a standard-issue male
492 // ass with a standard-issue virgin male asshole between its buns. You've got two human arms, two human legs.
494 // In other words, you're an average human, which probably won't last long down here.
497 // NOW WITH ENEMY TRAPS
498 var aGender
:Gender
= getApparentGender
();
499 descr
= Utils
.A
(sexualPreference
.label
) + " " + aGender
.label
+ " " + getTypeName
() + ", who " + build
.getDescription
();
501 if (!isHeadConcealed
())
503 if (hair
== Hair
.BALD
)
505 descr
+= ", %POS% glistening scalp";
506 if (!areEyesConcealed
())
507 descr
+= " distracting from %POS%";
511 descr
+= ". %CSUB% has " + hair
;
512 if (!areEyesConcealed
())
513 descr
+= ", which constrasts nicely with %POS%";
518 descr
+= ", and has";
520 if (!areEyesConcealed
())
522 if (eyes
.length
== 0)
524 if (isHeadConcealed
())
526 descr
+= " complete lack of eyes";
529 descr
+= getEyesDescr
();
533 descr
+= skin
.getDescr
(0, this);
536 descr
+= "<p>In the equipment department, ";
537 var wearingPants
:Boolean = isWearing
(ClothingType
.PANTS
);
538 var haveBalls
:Boolean = (balls
.length
> 0 && !wearingPants
);
539 var haveDicks
:Boolean = (dicks
.length
> 0 && !wearingPants
);
540 var haveVags
:Boolean = (vaginas
.length
> 0 && !wearingPants
);
541 if (haveBalls
&& haveDicks
)
542 descr
+= "%SUB% has " + getTesticleDescr
() + " swinging between %POS% legs, paired with " + getDickDescr
() + ".";
543 if (!haveBalls
&& haveDicks
)
544 descr
+= "no testicles rub between %POS% thighs when %SUB% walks, but %SUB% does have " + getDickDescr
() + ".";
545 if (haveBalls
&& !haveDicks
)
546 descr
+= "%SUB% doesn't have a dick, but %SUB% does have " + getTesticleDescr
() + ". %SUB% seems to get more horny as time passes.";
549 descr
+= " %CPOS% body possesses " + getVagDescr
() + ".";
551 if (!haveBalls
&& !haveDicks
&& !haveVags
)
553 descr
+= " You can't see any dangly parts, nor anything else between %POS% legs.";
554 if (breasts
.length
> 0)
555 descr
+= " However, ";
558 if (breasts
.length
> 0)
560 descr
+= " %CSUB% has " + getBreastDescr
();
561 if (assholes
.length
> 0 && !areAnyConcealed
(Vector
.<IBodyPart
>(assholes
)))
563 descr
+= ", and also has " + getAssDescr
() + ".";
572 descr
+= " %CSUB% doesn't have any breasts";
573 if (assholes
.length
> 0 && !areAnyConcealed
(Vector
.<IBodyPart
>(assholes
)))
575 descr
+= ", but does have " + getAssDescr
() + ".";
585 descr
+= " %CSUB% has " + getArmsDescr
() + ", ";
587 descr
+= " %CSUB% doesn't have any arms, ";
591 if (arms
.length
== 0)
592 descr
+= "but %SUB% DOES have ";
595 descr
+= getLegsDescr
() + ".";
598 descr
+= "and no legs.";
600 if (wings
.length
> 0)
602 descr
+= " %CSUB% also has " + getWingsDescr
() + ".";
607 descr
+= "<p>%CSUB% is wearing " + ((clothing
.length
> 0) ? "a " + getClothingDescr
() : "nothing") + ".</p>";
608 if (aGender
.label
!= gender
.label
)
609 descr
+= "<p><small>DEBUG: %CSUB% is actually a " + gender
.label
+ " with " + getDickDescr
() + "/" + getTesticleDescr
() + "/" + getVagDescr
() + ". TEE HEE.</small></p>";
611 return aGender
.doReplace
(descr
);
614 public function hasEnchantment
(name
:String):Boolean
616 return Utils
.objHas
(enchantments
, name
);
619 public function levelUp
(firstOne
:Boolean = false):void
623 InfoScreen
.push
("<h2>Levelled up!</h2><p>You are now at level " + level
+ "!</p>");
626 public function onCombatInit
(ply
:Player
):void
631 public function get maxMana
():int
633 return 100 + ((level
- 1) * 10);
636 public function get maxHP
():int
638 return 100 + ((level
- 1) * 10);
641 public function get maxXP
():int
643 return Math.max
(1, 50 * (_level
* 0.5));
646 public function getExplored
(loc
:String):Boolean
648 for (var i
:int = 0; i
< explored
.length
; i
++)
650 if (explored
[i
] == loc
)
656 public function setExplored
(loc
:String):void
658 if (getExplored
(loc
))
663 public function getEffectivenessMultiplier
(defender
:Creature
):Number
665 var a
:Number = strength
;
666 var e
:Number = defender
.strength
;
667 return (a
* (100 - e
)) / 10000;
671 * Calculation from http://www.gamedev.net/topic/183822-rpg-combat-formula-question/
674 public function speedCheckAgainst
(attacker
:Creature
):Boolean
676 // C = A * (100% - E)
679 // A = Attacker's accuracy (speed, in our case)
680 // E = Defender's evasion rate (speed, again)
681 var a
:Number = attacker
.speed
;
682 var e
:Number = speed
;
683 return Math.random
() <= (a
* (100 - e
)) / 10000;
687 * Calculation from http://www.gamedev.net/topic/183822-rpg-combat-formula-question/
690 public function strengthCheckAgainst
(attacker
:Creature
):Boolean
692 var a
:Number = attacker
.strength
;
693 var e
:Number = strength
;
694 // C = A * (100% - E)
697 // A = Attacker's accuracy (strength, in our case)
698 // E = Defender's evasion rate (strength, again)
699 return Math.random
() <= (a
* (100 - e
)) / 10000;
703 * Figure out how much shit we're going to wreck.
705 * @param weapon or null
708 public function damageAgainst
(attacker
:Creature
, weapon
:IWeapon
):Number
711 // TODO: Probably need to factor in speed or something at some point. I ain't a math guy.
712 var a
:Number = attacker
.strength
;
713 var e
:Number = strength
;
714 var weaponDamage
:Number = 0;
716 weaponDamage
= weapon
.calcDamage
(this, attacker
);
717 var dmg
:Number = (MathUtils
.rand
(0, 1, false) + level
+ (strength
/ 50) + weaponDamage
) - (MathUtils
.rand
(0, 1, false) + attacker
.level
+ (attacker
.strength
/ 50));
719 return Math.ceil
((dmg
> 0) ? dmg
: 1); // Keep above 1 (no negatives, no 0-damage attacks.)
722 public function get strength
():int
727 public function set strength
(str
:int):void
733 public function get speed
():int
738 public function set speed
(spd
:int):void
744 public function get lust
():int
749 public function set lust
(lst
:int):void
757 public function get gold
():int
762 public function set gold
(value
:int):void
770 public function get intellect
():int
775 public function set intellect
(i
:int):void
781 public function get mana
():int
786 public function set mana
(i
:int):void
792 public function get sensitivity
():int
797 public function set sensitivity
(i
:int):void
803 public function get assholes
():Vector
.<Asshole
>
805 return this._assholes
;
808 public function set assholes
(balls
:Vector
.<Asshole
>):void
810 this._assholes
= balls
;
814 public function hasItem
(id
:int):Boolean
816 for each (var item
:Item
in this.inventory
)
824 public function get breasts
():Vector
.<Breast
>
826 return this._breasts
;
829 public function set breasts
(balls
:Vector
.<Breast
>):void
831 this._breasts
= balls
;
835 public function get eyes
():Vector
.<Eye
>
840 public function set eyes
(balls
:Vector
.<Eye
>):void
846 public function get vaginas
():Vector
.<Vagina
>
848 return this._vaginas
;
851 public function set vaginas
(balls
:Vector
.<Vagina
>):void
853 this._vaginas
= balls
;
857 public function get arms
():Vector
.<Arm
>
862 public function set arms
(arr
:Vector
.<Arm
>):void
868 public function get legs
():Vector
.<Leg
>
873 public function set legs
(arr
:Vector
.<Leg
>):void
879 public function get wings
():Vector
.<Wing
>
884 public function set wings
(arr
:Vector
.<Wing
>):void
890 public function get balls
():Vector
.<Testicle
>
895 public function set balls
(balls
:Vector
.<Testicle
>):void
901 public function get dicks
():Vector
.<Penis
>
906 public function set dicks
(aaa
:Vector
.<Penis
>):void
912 public function get abilities
():Object
917 public function set abilities
(arr
:Object):void
922 public function get gender
():Gender
927 public function set gender
(value
:Gender
):void
933 public function get HP
():int
938 public function set HP
(value
:int):void
944 public function get XP
():int
949 public function set XP
(value
:int):void
951 //trace("XP", value);
961 public function setMain
(main
:AdventureController
):void
966 private function doStatsUpdate
():void
975 if (_eyes
.length
== 0)
976 _speed
= 0.1; // 1/10 chance of hitting when blind
980 public function get level
():int
985 private function getBodyPartDesc
(collection
:Vector
.<IBodyPart
>, singular
:String):String
988 if (collection
.length
== 0)
990 return "no " + Utils
.pluralize
(2, singular
);
993 var varying
:Boolean = false;
994 var types
:Object = new Object();
995 var lname
:String = "";
996 var numtypes
:Number = 0;
997 for each (var i
:*in collection
)
999 var t
:IBodyPart
= i
as IBodyPart
;
1004 if (!(lname
in types
))
1013 for each (t
in collection
)
1015 if (t
.name
== lname
)
1016 return t
.getDescr
(types
[lname
], this);
1022 for (var ot
:*in types
)
1024 var gotdescr
:Boolean = false;
1025 for each (t
in collection
)
1031 out
+= ", " + t
.getDescr
(types
[ot
] as Number, this);
1038 return collection
.length
+ " " + singular
+ "s of varying types (" + out
.substr
(2) + ")";
1043 public function notifyEnchantments
(e
:*):Boolean
1045 var collection
:Array = [];
1046 for (var eID
:String in enchantments
)
1048 var ench
:Enchantment
= enchantments
[eID
];
1049 if (e
is CombatStartEvent
)
1051 ench
.onCombatInit
(e
.other
);
1053 if (e
is CombatEndEvent
)
1055 ench
.onCombatComplete
(e
.won
, e
.other
);
1057 if (e
is CombatTurnEvent
)
1059 return ench
.onMyCombatTurn
(e
.screen
, e
.other
);
1065 public function inventoryUpdate
(item
:Item
, received
:Boolean):Boolean
1067 var actionToTake
:int = -1;
1068 for (var eID
:String in enchantments
)
1070 var act
:int = enchantments
[eID
].onInventoryReceived
(item
);
1071 if (act
!= Enchantment
.INTERCEPT_ACTION_NONE
)
1077 switch (actionToTake
)
1079 case Enchantment
.INTERCEPT_ACTION_TOSS
:
1080 // Do nothing, we're already tossing.
1082 case Enchantment
.INTERCEPT_ACTION_USE
:
1088 return actionToTake
== Enchantment
.INTERCEPT_ACTION_NONE
;
1091 public function getTesticleDescr
():String
1093 return getBodyPartDesc
(Vector
.<IBodyPart
>(balls
), "ball");
1096 public function getBulgesInPants
():String
1098 var numBulge
:int = 0;
1099 var peeks
:Vector
.<Penis
> = new Vector
.<Penis
>();
1100 for each (var p
:Penis
in dicks
)
1104 if (!p
.isConcealedBy
(this, clothing
))
1106 for each (var c
:Clothing
in clothing
)
1110 var bsize
:Number = p
.getBulgeSize
(this, c
);
1111 trace
(p
.getDescr
(1, this), "bsize=" + bsize
.toString
());
1126 if (numBulge
== 0 && peeks
.length
== 0)
1128 var fo
:String = " (which has ";
1131 fo
+= numBulge
+ " " + Utils
.pluralize
(numBulge
, "bulge", "bulges");
1133 if (numBulge
> 0 && peeks
.length
> 0)
1137 if (peeks
.length
> 0)
1139 fo
+= getBodyPartDesc
(Vector
.<IBodyPart
>(peeks
), "dick") + " peeking over %POS% waistband";
1144 public function getDickDescr
():String
1146 return getBodyPartDesc
(Vector
.<IBodyPart
>(dicks
), "dick");
1149 public function getVagDescr
():String
1151 return getBodyPartDesc
(Vector
.<IBodyPart
>(vaginas
), "vag");
1154 public function getBreastDescr
():String
1156 return getBodyPartDesc
(Vector
.<IBodyPart
>(breasts
), "boob");
1159 public function getAssDescr
():String
1161 return getBodyPartDesc
(Vector
.<IBodyPart
>(assholes
), "asshole");
1164 public function getArmsDescr
():String
1166 return getBodyPartDesc
(Vector
.<IBodyPart
>(arms
), "arm");
1169 public function getEyesDescr
():String
1171 return getBodyPartDesc
(Vector
.<IBodyPart
>(eyes
), "eye");
1174 public function getLegsDescr
():String
1176 return getBodyPartDesc
(Vector
.<IBodyPart
>(legs
), "leg");
1179 public function getWingsDescr
():String
1181 return getBodyPartDesc
(Vector
.<IBodyPart
>(wings
), "wing");
1184 public function getClothingDescr
():String
1186 var desc
:String = "";
1188 for (var i
:int = 0; i
< clothing
.length
; i
++)
1190 var item
:Clothing
= clothing
[i
];
1192 desc
+= item
.getDescr
(this);
1196 case ClothingType
.HEADGEAR
:
1197 desc
+= " as a hat";
1199 case ClothingType
.TOP
:
1200 desc
+= " as a shirt";
1202 case ClothingType
.FOOTWEAR
:
1203 desc
+= " as shoes";
1205 case ClothingType
.PANTS
:
1206 desc
+= " as trousers" + getBulgesInPants
();
1210 if (i
< (clothing
.length
- 3))
1214 else if (i
== (clothing
.length
- 2))
1228 * +---------------+---+---+
1230 * +---------------+---+---+
1235 * +---------------+---+---+
1237 public function getInterested
(subj
:Creature
):Boolean
1239 return sexualPreference
.isOppositeGender
(gender
, subj
.getApparentGender
()); // trollface.jpg
1243 * By default, only allow rape if health == 0 or paralyzed.
1244 * @param rapist WHO BE RAPIN ME
1247 public function tryRape
(rapist
:Creature
):Boolean
1249 return (HP
== 0 || Paralyze
.isParalyzed
(this));
1253 public function getHostile
(subj
:Creature
):Boolean
1258 public function performConversion
(oldMe
:Creature
):void
1263 public function changeFrom
(f
:Creature
):void
1265 this.performConversion
(f
);
1268 public function loseTurns
(numturns
:int):void
1270 turnsToLose
+= numturns
;
1273 public function getRapable
():Boolean
1275 return canRun
() && HP
< (maxHP
/ 3);
1279 * Alter the rape menu to fit your needs.
1283 public function onRape
(ply
:Creature
, rape
:Rape
):void
1289 * Does this character have any weapons?
1292 public function hasAnyWeapon
():Boolean {
1293 for (var i
:int = 0; i
< arms
.length
; i
++) {
1294 if (arms
[0].weapon
!= null)
1301 * Find any equipped weapon.
1304 public function getFirstWeapon
():IWeapon
{
1305 for (var i
:int = 0; i
< arms
.length
; i
++) {
1306 if (arms
[0].weapon
!= null)
1307 return arms
[0].weapon
;