1 package org
.sevenchan
.dongs
3 import flash
.media
.ID3Info;
4 import org
.sevenchan
.AdventureController
;
6 import org
.sevenchan
.dongs
.bodyparts
.*;
7 import org
.sevenchan
.dongs
.bodyparts
.asshole
.Abdomen
;
8 import org
.sevenchan
.dongs
.bodyparts
.eye
.GhostEye
;
9 import org
.sevenchan
.dongs
.creature
.*;
10 import org
.sevenchan
.dongs
.enchantment
.*;
11 import org
.sevenchan
.dongs
.enchantment
.events
.*;
12 import org
.sevenchan
.dongs
.screens
.*;
19 registerClassAlias
("ECreature", Creature
);
21 public static var CreatureRegistry
:Object = null;
23 public static var BodyPartRegistry
:Object = {
25 human
:new Asshole
("human"),
26 demon
:new Asshole
("demon"),
27 arachnid
:new Abdomen
("Arachnid")
30 human
: new Arm
("human", null, null)
33 arachnid
: new Testicle
("internal testes", 3785, null, null, "hot, thick mixture of semen and eggs"),
34 demon
: new Testicle
("demon nut",38,new Corruption
(10),null,"boiling-hot, sticky black substance"),
35 human
: new Testicle
("human testicle", 17, null, null, "hot, stringy, off-white seed")
38 demon
: new Breast
("demon"),
39 human
: new Breast
("human")
42 arachnid
: new Penis
("Arachnid"),
43 demon
: new Penis
("demon",10,new Corruption
(1),null),
44 human
: new Penis
("human", 5, null, null)
47 ghost_yellow
: new GhostEye
("ghost", "yellow"),
48 human_blue
: new Eye
("human", "blue", "round"),
49 human_brown
: new Eye
("human", "brown", "round"),
50 human_green
: new Eye
("human", "green", "round"),
51 human_red
: new Eye
("human", "red", "round"),
52 arachnid_big
: new Eye
("human-ish Arachnid", "red", "round"),
53 arachnid_small
: new Eye
("small Arachnid", "black", "segment"),
54 harpy_light
: new Eye
("harpy", "amber", "slit"),
55 harpy_dark
: new Eye
("darkharpy", "red", "slit"),
56 demon
: new Eye
("demon", "amber", "slit")
59 arachnid
: new Leg
("Arachnid"),
60 harpy
: new Leg
("long, birdlike harpy"),
61 human
: new Leg
("human")
64 arachnid
: new Vagina
("Arachnid"),
65 demon
: new Vagina
("demon"),
66 human
: new Vagina
("human")
69 harpy
: new Wing
("harpy", false, "brown and white", 10),
70 harpy_dark
: new Wing
("darkharpy", false, "black and violet", 10)
75 public var customized
:Boolean = false;
76 public var ownName
:String = "Blah Blah"; // Who am I?
77 public var height
:Number = 0.0; // How tall am I?
78 public var build
:Build
= Build
.AVG
; // How fat am I?
79 public var material
:Material
= Material
.NO_MATERIAL_MODIFIER
; // What am I made of?
80 public var hair
:Hair
= Hair
.BALD
; // His/her/hir hair is...
81 public var skin
:Skin
= new Skin
("human"); // His/her/hir hair is...
82 public var _gender
:Gender
= Gender
.ASEXUAL
; // Boy, Girl, Neither, Both?
83 public var sexualPreference
:SexualPreference
= SexualPreference
.ASEXUAL
; // Straight, Gay, ASexual, Bi?
85 // Stats (CACHED VALUES)
86 public var _level
:int = 0; // In comparison to standard human being. No attacking rats for 20 levels.
87 private var d_level
:int = 0; // Delta
88 public var _strength
:int = 1; // Damage caused in case of a successful attack.
89 public var _speed
:int = 1; // Chance of dodging. defending.speed-attacking.speed = relative chance of dodging.
90 public var _intellect
:int = 1; // Smartness. Opens dialog trees and gives hints.
91 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).
92 public var _sensitivity
:Number = 0; // 0-1, 0 being not sensitive
93 public var _HP
:int = 100; //100*(level*0.02)
94 public var _XP
:int = 0; // 50*(level*0.5)
95 public var _mana
:int = 0; // Magic shit, increases over time, especially near relaxing places.
96 public var _gold
:int = 0; // Currency
99 // What magic/techniques can I use?
100 public var _abilities
:Object = new Object();
101 // How many, and what type of assholes do I possess?
102 public var _assholes
:Vector
.<Asshole
> = new Vector
.<Asshole
>();
103 // Needed to attack. Tentacles are ok.
104 public var _arms
:Vector
.<Arm
> = new Vector
.<Arm
>();
105 // Testes (Cum and pregnancy options)
106 public var _balls
:Vector
.<Testicle
> = new Vector
.<Testicle
>();
108 public var _breasts
:Vector
.<Breast
> = new Vector
.<Breast
>();
109 // Penises (Pleasure options, testes required for preggo/cum stuff)
110 public var _dicks
:Vector
.<Penis
> = new Vector
.<Penis
>();
111 // What kinds of effects am I suffering/benefiting from?
112 public var enchantments
:Object = new Object();
113 // How many/what kinds of eyes do I have?
114 public var _eyes
:Vector
.<Eye
> = new Vector
.<Eye
>();
115 // What stuff am I carrying?
116 public var inventory
:Vector
.<Item
> = new Vector
.<Item
>();
117 // Legs or locomotive tentacles or some other propulsion. (NONE = CAN'T MOVE OR DODGE)
118 public var _legs
:Vector
.<Leg
> = new Vector
.<Leg
>();
119 // 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.
120 public var _vaginas
:Vector
.<Vagina
> = new Vector
.<Vagina
>();
122 public var _wings
:Vector
.<Wing
> = new Vector
.<Wing
>();
123 // Explored locations
124 public var explored
:Vector
.<String> = new Vector
.<String>();
126 private var main
:AdventureController
= null;
127 protected var abilityUseProbability
:Number = 1;
128 protected var turnsToLose
:int = 0;
130 public static function init_creatures
():void {
133 arachnid
: new Arachnid
(false),
134 arachnid_pregnant
: new Arachnid
(true),
135 harpy
: new Harpy
(false),
136 harpy_dark
: new Harpy
(true),
139 oldspace
: new SandNigger
()
142 public function Creature
()
144 trace
("Creature.init()");
145 _gold
= MathUtils
.rand
(0, 50);
149 public function addBoob
():void { trace
("USING CREATURE.ADDBOOB INSTEAD OF OVERRIDING"); }
151 public function addEnchantment
(ench
:Enchantment
):String {
152 var story
:String = ench
.onInit
(this);
153 if(!ench
.cancelAddition
)
154 this.enchantments
[ench
.getID
()] = ench
;
158 public function initialGenderSetup
():void { }
160 public function yourMove
(cs
:CombatScreen
, ply
:Creature
):void {
161 if ((turnsToLose
>0)||notifyEnchantments
(new CombatTurnEvent
(ply
))) {
162 InfoScreen
.push
("<p>The " + getTypeName
() + " cannot attack!</p>");
165 if (turnsToLose
> 0) {
168 if (MathUtils
.lengthOf
(abilities
) > 0 && MathUtils
.rand
(0,abilityUseProbability
) == 0) {
169 var ab
:Ability
= Ability
(MathUtils
.getRandomObjectEntry
(abilities
));
170 if (this.mana
< ab
.manaCost
)
172 InfoScreen
.push
("<p>The " + getTypeName
() + " tried to use " + ab
.name
+ " but is too exhausted!</p>");
175 if (ab
.activate
(this, ply
)) {
176 this.mana
-= ab
.manaCost
180 cs
.tryAttack
(this, ply
);
183 public function addDick
(type
:String="human"):void {
186 public function addLust
(amt
:Number=1):void {
187 var adding2Lust
:Number = (amt
* getLustMult
());
188 trace
("Adding to lust ", adding2Lust
);
189 lust
+= Math.ceil
(adding2Lust
);
192 private function getLustMult
():Number {
193 var numballs
:Number = balls
.length
;
194 var loadMultSum
:Number = 0;
195 for (var i
:int = 0; i
< balls
.length
; i
++) {
196 loadMultSum
+= (balls
[i
] as Testicle
).loadMult
/10;
198 return (numballs
* (loadMultSum
/numballs
));
201 public function takeFromInventory
(item
:Item
):void {
202 for (var i
:int = 0; i
< inventory
.length
; i
++) {
203 if ((inventory
[i
] as Item
).id
== item
.id
) {
204 (inventory
[i
] as Item
).amount
-= item
.amount
;
205 if ((inventory
[i
] as Item
).amount
<= 0)
206 inventory
.splice
(i
, 1);
212 public function addToInventory
(item
:Item
):void {
213 for (var i
:int = 0; i
< inventory
.length
; i
++) {
214 if ((inventory
[i
] as Item
).id
== item
.id
) {
215 (inventory
[i
] as Item
).amount
+= item
.amount
;
219 if(inventory
.length
<11) {
220 inventory
.push
(item
);
223 main
.showInventory
(item
);
227 public function combatDescr
(subj
:Creature
):String {
228 if (getInterested
(subj
)) {
231 var o
:String = "<p>" + Utils
.A
(getTypeName
(),true) + " "+getTypeName
()+" leaps from the bushes and attacks!</p><p>Your attacker is ";
232 o
+= getDescription
();
237 public function onEncounter
(ply
:Creature
):Boolean { return false; }
239 public function onWin
(ply
:Creature
):Boolean { return false; }
240 public function onLose
(ply
:Creature
):Boolean { return false; }
242 protected function genName
():void {
243 var firstNames
:Array = [
259 var lastNames
:Array = [
271 ownName
= MathUtils
.getRandomArrayEntry
(firstNames
) + " " + MathUtils
.getRandomArrayEntry
(lastNames
);
277 * @return String Whatever it's called
279 public function getTypeName
():String {
280 throw new Error("SOME DUMBASS DIDN'T GIVE THIS CREATURE A NAME");
281 return "NOT FUCKING NAMED YET";
285 * Do I have the option to run?
286 * @return Button visibility
288 public function canRun
():Boolean { return true; }
290 public function getDescription
():String {
291 var descr
:String = "";
292 // a gay human male of average height and build. He also possesses a long, flowing mane of golden hair,
293 // which contrasts nicely with your blue eyes and light skin.
295 // In the equipment department, you're not too odd. You have two human testicles swinging between your legs, paired with
296 // a single, 5.5" human schlong. Your breasts are flat, but well-sculpted human pecs, and you have a standard-issue male
297 // ass with a standard-issue virgin male asshole between its buns. You've got two human arms, two human legs.
299 // In other words, you're an average human, which probably won't last long down here.
301 descr
= Utils
.A
(sexualPreference
.label
)+" "+sexualPreference
.label
+ " " + gender
.label
+ " " + getTypeName
() + ", who " + build
.getDescription
()
302 +" %CSUB% also possesses " + hair
.getDescription
();
304 if (hair
== Hair
.BALD
)
305 descr
+= ", %POS% glistening scalp distracting from %POS% ";
307 descr
+= ", which constrasts nicely with %POS% ";
309 descr
+= " complete lack of eyes (<b>and resulting blindness</b>)";
311 descr
+= getEyesDescr
();
313 descr
+= " and " + skin
.getDescr
(0, this);
316 descr
+= "<p>In the equipment department, ";
317 var haveBalls
:Boolean = (balls
.length
> 0);
318 var haveDicks
:Boolean = (dicks
.length
> 0);
319 var haveVags
:Boolean = (vaginas
.length
> 0);
320 if (haveBalls
&& haveDicks
)
321 descr
+= "%SUB% has " + getTesticleDescr
() + " swinging between %POS% legs, paired with " + getDickDescr
() + ".";
322 if (!haveBalls
&& haveDicks
)
323 descr
+= "no testicles rub between %POS% thighs when %SUB% walks, but %SUB% does have " + getDickDescr
() + ".";
324 if (haveBalls
&& !haveDicks
)
325 descr
+= "%SUB% doesn't have a dick, but %SUB% does have " + getTesticleDescr
() + ". %SUB% seems to get more horny as time passes.";
328 descr
+= " %CPOS% body possesses " + getVagDescr
() + ".";
330 if (!haveBalls
&& !haveDicks
&& !haveVags
)
331 descr
+= " %CSUB% doesn't have any sexual organs. At least you won't get raped.";
334 if (breasts
.length
> 0)
335 descr
+= " %CSUB% has " + getBreastDescr
() + ", and wears ";
337 descr
+= " %CSUB% doesn't have any breasts, but does have ";
338 descr
+= getAssDescr
() + ".";
341 descr
+= " %CSUB% has "+getArmsDescr
()+", ";
343 descr
+= " %CSUB% doesn't have any arms (<b>and therefore can't attack</b>), ";
345 if (legs
.length
> 0) {
346 if (arms
.length
== 0)
347 descr
+= "but %SUB% DOES have ";
350 descr
+= getLegsDescr
()+".";
352 descr
+= "and no legs (<b>so %SUB% can't dodge attacks</b>).";
354 if (wings
.length
> 0) {
355 descr
+= " %CSUB% also has " + getWingsDescr
() + ".";
359 return gender
.doReplace
(descr
);
362 public function hasEnchantment
(name
:String):Boolean {
363 return Utils
.objHas
(enchantments
,name
);
366 public function levelUp
(firstOne
:Boolean = false):void {
369 InfoScreen
.push
("<h2>Levelled up!</h2><p>You are now level " + level
+ "!</p>");
374 public function onCombatInit
():void {
378 public function get maxMana
():int {
379 return 100 + ((level
-1) * 10);
382 public function get maxHP
():int {
383 return 100 + ((level
-1) * 10);
386 public function get maxXP
():int {
387 return Math.max
(1,50*(_level
* 0.5));
390 public function getExplored
(loc
:String):Boolean {
391 for (var i
:int = 0; i
< explored
.length
; i
++) {
392 if (explored
[i
] == loc
)
398 public function setExplored
(loc
:String):void {
399 if (getExplored
(loc
)) return;
403 public function recalcStrength
():void {
404 //trace("height:", height);
405 var weight
:Number = build
.calculateWeight
(height
, 0.5)
406 //trace("weight:",weight);
407 var A
:Number = Math.ceil
((Math.pow
(level
, 2) * 0.01) - (Math.abs
(17.5 - (weight
* 0.1))) + 8);
410 var B
:Number = Math.ceil
((Math.pow
(level
-1,2) * 0.01) - (Math.abs
(17.5 - (weight
* 0.1))) + 8);
411 _strength
= _strength
+ (A
- B
);
414 public function get strength
():int { return _strength
; }
415 public function set strength
(str
:int):void {
420 public function get speed
():int { return _speed
; }
421 public function set speed
(spd
:int):void {
426 public function get lust
():int { return _lust
; }
427 public function set lust
(lst
:int):void
434 public function get gold
():int { return _gold
; }
435 public function set gold
(value
:int):void
442 public function get intellect
():int { return _intellect
; }
443 public function set intellect
(i
:int):void
448 public function get mana
():int { return _mana
; }
449 public function set mana
(i
:int):void
454 public function get sensitivity
():int { return _sensitivity
; }
455 public function set sensitivity
(i
:int):void
461 public function get assholes
():Vector
.<Asshole
> { return this._assholes
; }
462 public function set assholes
(balls
:Vector
.<Asshole
>):void { this._assholes
=balls
;
465 public function get breasts
():Vector
.<Breast
> { return this._breasts
; }
466 public function set breasts
(balls
:Vector
.<Breast
>):void { this._breasts
=balls
;
469 public function get eyes
():Vector
.<Eye
> { return this._eyes
; }
470 public function set eyes
(balls
:Vector
.<Eye
>):void { this._eyes
=balls
;
473 public function get vaginas
():Vector
.<Vagina
> { return this._vaginas
; }
474 public function set vaginas
(balls
:Vector
.<Vagina
>):void { this._vaginas
=balls
;
477 public function get arms
():Vector
.<Arm
> { return _arms
; }
478 public function set arms
(arr
:Vector
.<Arm
>):void {
483 public function get legs
():Vector
.<Leg
>{ return _legs
; }
484 public function set legs
(arr
:Vector
.<Leg
>):void { _legs
= arr
;
487 public function get wings
():Vector
.<Wing
> { return _wings
; }
488 public function set wings
(arr
:Vector
.<Wing
>):void { _wings
= arr
;
491 public function get balls
():Vector
.<Testicle
> { return _balls
; }
492 public function set balls
(balls
:Vector
.<Testicle
>):void { _balls
=balls
;
495 public function get dicks
():Vector
.<Penis
> { return _dicks
; }
496 public function set dicks
(balls
:Vector
.<Penis
>):void { _dicks
=balls
;
499 public function get abilities
():Object { return _abilities
; }
500 public function set abilities
(arr
:Object):void{ _abilities
=arr
; }
502 public function get gender
():Gender
{ return _gender
; }
503 public function set gender
(value
:Gender
):void { _gender
=value
;
506 public function get HP
():int { return _HP
; }
507 public function set HP
(value
:int):void {
511 public function get XP
():int { return _XP
; }
512 public function set XP
(value
:int):void {
513 //trace("XP", value);
523 public function setMain
(main
:AdventureController
):void {
527 private function doStatsUpdate
():void {
533 public function get level
():int {
537 private function getBodyPartDesc
(collection
:Vector
.<IBodyPart
>, singular
:String):String {
539 if (collection
.length
== 0) {
540 return "no "+singular
+"s";
543 var varying
:Boolean = false;
544 var types
:Object = new Object();
545 var lname
:String = "";
546 var numtypes
:Number = 0;
547 for each (var i
:* in collection
) {
548 var t
:IBodyPart
= i
as IBodyPart
;
553 if(!(lname
in types
)) {
559 for (var k
:String in types
) {
560 trace
(k
+ " = " + types
[k
]);
563 for each (t
in collection
) {
565 return t
.getDescr
(types
[lname
], this);
569 for (var ot
:* in types
) {
570 var gotdescr
:Boolean = false;
571 for each (t
in collection
) {
574 out
+= ", " + t
.getDescr
(types
[ot
] as Number, this);
581 return collection
.length
+ " "+singular
+"s of varying types ("+out
.substr
(2)+")";
586 public function notifyEnchantments
(e
:*):Boolean {
587 var collection
:Array = [];
588 for (var eID
:String in enchantments
) {
589 var ench
:Enchantment
= enchantments
[eID
];
590 if (e
is CombatStartEvent
) {
591 ench
.onCombatInit
(e
.other
);
593 if (e
is CombatEndEvent
) {
594 ench
.onCombatComplete
(e
.won
, e
.other
);
596 if (e
is CombatTurnEvent
) {
597 return ench
.onMyCombatTurn
(e
.other
);
603 public function getTesticleDescr
():String {
604 return getBodyPartDesc
(Vector
.<IBodyPart
>(balls
),"ball");
607 public function getDickDescr
():String {
608 return getBodyPartDesc
(Vector
.<IBodyPart
>(dicks
),"dick");
611 public function getVagDescr
():String {
612 return getBodyPartDesc
(Vector
.<IBodyPart
>(vaginas
),"vag");
615 public function getBreastDescr
():String {
616 return getBodyPartDesc
(Vector
.<IBodyPart
>(breasts
), "boob");
619 public function getAssDescr
():String {
620 return getBodyPartDesc
(Vector
.<IBodyPart
>(assholes
),"asshole");
623 public function getArmsDescr
():String {
624 return getBodyPartDesc
(Vector
.<IBodyPart
>(arms
), "arm");
627 public function getEyesDescr
():String {
628 return getBodyPartDesc
(Vector
.<IBodyPart
>(eyes
), "eye");
631 public function getLegsDescr
():String {
632 return getBodyPartDesc
(Vector
.<IBodyPart
>(legs
), "leg");
635 public function getWingsDescr
():String {
636 return getBodyPartDesc
(Vector
.<IBodyPart
>(wings
), "wing");
644 * +---------------+---+---+
646 * +---------------+---+---+
651 * +---------------+---+---+
653 public function getInterested
(subj
:Creature
):Boolean {
654 return sexualPreference
.isOppositeGender
(gender
, subj
.gender
);
657 public function getHostile
(subj
:Creature
):Boolean {
661 public function performConversion
(oldMe
:Creature
):void {
665 public function changeFrom
(f
:Creature
):void {
666 this._speed
= f
._speed
;
667 this._strength
= f
._strength
;
668 this.abilities
= f
.abilities
;
669 this.enchantments
= f
.enchantments
;
670 this.explored
= f
.explored
;
671 this.gender
= f
.gender
;
673 this.height
= f
.height
;
675 this.mana
= f
.maxMana
;
676 this.ownName
= f
.ownName
;
677 this.sensitivity
= f
.sensitivity
;
678 this.sexualPreference
= f
.sexualPreference
;
679 this.inventory
= f
.inventory
;
681 this.performConversion
(f
);
684 public function loseTurns
(numturns
:int):void {
685 turnsToLose
+= numturns
;