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
.creature
.*;
9 import org
.sevenchan
.dongs
.enchantment
.*;
10 import org
.sevenchan
.dongs
.enchantment
.events
.*;
11 import org
.sevenchan
.dongs
.screens
.*;
18 registerClassAlias
("ECreature", Creature
);
20 public static var CreatureRegistry
:Object = null;
22 public static var BodyPartRegistry
:Object = {
24 human
:new Asshole
("human"),
25 demon
:new Asshole
("demon"),
26 arachnid
:new Abdomen
("Arachnid")
29 human
: new Arm
("human", null, null)
32 arachnid
: new Testicle
("internal testes", 3785, null, null, "hot, thick mixture of semen and eggs"),
33 demon
: new Testicle
("demon nut",38,new Corruption
(10),null,"boiling-hot, sticky black substance"),
34 human
: new Testicle
("human testicle", 17, null, null, "hot, stringy, off-white seed")
37 demon
: new Breast
("demon"),
38 human
: new Breast
("human")
41 arachnid
: new Penis
("Arachnid"),
42 demon
: new Penis
("demon",10,new Corruption
(1),null),
43 human
: new Penis
("human", 5, null, null)
46 human_blue
: new Eye
("human", "blue", "round"),
47 human_brown
: new Eye
("human", "brown", "round"),
48 human_green
: new Eye
("human", "green", "round"),
49 human_red
: new Eye
("human", "red", "round"),
50 arachnid_big
: new Eye
("human-ish Arachnid", "red", "round"),
51 arachnid_small
: new Eye
("small Arachnid", "black", "segment"),
52 harpy_light
: new Eye
("harpy", "amber", "slit"),
53 harpy_dark
: new Eye
("darkharpy", "red", "slit"),
54 demon
: new Eye
("demon", "amber", "slit")
57 arachnid
: new Leg
("Arachnid"),
58 harpy
: new Leg
("long, birdlike harpy"),
59 human
: new Leg
("human")
62 arachnid
: new Vagina
("Arachnid"),
63 demon
: new Vagina
("demon"),
64 human
: new Vagina
("human")
67 harpy
: new Wing
("harpy", false, "brown and white", 10),
68 harpy_dark
: new Wing
("darkharpy", false, "black and violet", 10)
73 public var customized
:Boolean = false;
74 public var ownName
:String = "Blah Blah"; // Who am I?
75 public var height
:Number = 0.0; // How tall am I?
76 public var build
:Build
= Build
.AVG
; // How fat am I?
77 public var material
:Material
= Material
.NO_MATERIAL_MODIFIER
; // What am I made of?
78 public var hair
:Hair
= Hair
.BALD
; // His/her/hir hair is...
79 public var skin
:Skin
= new Skin
("human"); // His/her/hir hair is...
80 public var _gender
:Gender
= Gender
.ASEXUAL
; // Boy, Girl, Neither, Both?
81 public var sexualPreference
:SexualPreference
= SexualPreference
.ASEXUAL
; // Straight, Gay, ASexual, Bi?
83 // Stats (CACHED VALUES)
84 public var _level
:int = 0; // In comparison to standard human being. No attacking rats for 20 levels.
85 private var d_level
:int = 0; // Delta
86 public var _strength
:int = 1; // Damage caused in case of a successful attack.
87 public var _speed
:int = 1; // Chance of dodging. defending.speed-attacking.speed = relative chance of dodging.
88 public var _intellect
:int = 1; // Smartness. Opens dialog trees and gives hints.
89 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).
90 public var _sensitivity
:Number = 0; // 0-1, 0 being not sensitive
91 public var _HP
:int = 100; //100*(level*0.02)
92 public var _XP
:int = 0; // 50*(level*0.5)
93 public var _mana
:int = 0; // Magic shit, increases over time, especially near relaxing places.
94 public var _gold
:int = 0; // Currency
97 public var _abilities
:Object = new Object(); // What magic/techniques can I use?
98 public var _assholes
:Array = new Array(); // How many, and what type of assholes do I possess?
99 public var _arms
:Array = new Array(); // Needed to attack. Tentacles are ok.
100 public var _balls
:Array = new Array(); // Testes (Cum and pregnancy options)
101 public var _breasts
:Array = new Array(); // Boobs (fuckable)
102 public var _dicks
:Array = new Array(); // Penises (Pleasure options, testes required for preggo/cum stuff)
103 public var enchantments
:Object = new Object(); // What kinds of effects am I suffering/benefiting from?
104 public var _eyes
:Array = new Array(); // How many/what kinds of eyes do I have?
105 public var inventory
:Array = new Array(); // What stuff am I carrying?
106 public var _legs
:Array = new Array(); // Legs or locomotive tentacles or some other propulsion. (NONE = CAN'T MOVE OR DODGE)
107 public var _vaginas
:Array = new Array(); // 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.
108 public var _wings
:Array = new Array(); // For flight.
109 public var explored
:Array = new Array();
111 private var main
:AdventureController
= null;
112 protected var abilityUseProbability
:Number = 1;
114 public static function init_creatures
():void {
116 arachnid
: new Arachnid
(false),
117 arachnid_pregnant
: new Arachnid
(true),
118 harpy
: new Harpy
(false),
119 harpy_dark
: new Harpy
(true),
122 oldspace
: new SandNigger
()
125 public function Creature
()
127 trace
("Creature.init()");
128 _gold
= MathUtils
.rand
(0, 50);
132 public function addEnchantment
(ench
:Enchantment
):String {
133 var story
:String = ench
.onInit
(this);
134 if(!ench
.cancelAddition
)
135 this.enchantments
[ench
.getID
()] = ench
;
139 public function initialGenderSetup
():void { }
141 public function yourMove
(cs
:CombatScreen
, ply
:Creature
):void {
142 if (notifyEnchantments
(new CombatTurnEvent
(ply
))) {
143 InfoScreen
.push
("<p>The " + getTypeName
() + " cannot attack!</p>");
146 if (MathUtils
.lengthOf
(abilities
) > 0 && MathUtils
.rand
(0,abilityUseProbability
) == 0) {
147 var ab
:Ability
= Ability
(MathUtils
.getRandomObjectEntry
(abilities
));
148 if(ab
.activate
(this, ply
))
151 cs
.tryAttack
(this, ply
);
154 public function addDick
(type
:String="human"):void {
157 public function addLust
(amt
:Number=1):void {
158 lust
+= (amt
* getLustMult
());
161 private function getLustMult
():Number {
162 var numballs
:Number = balls
.length
;
163 var loadMultSum
:Number = 0;
164 for (var i
:int = 0; i
< balls
.length
; i
++) {
165 loadMultSum
+= (balls
[i
] as Testicle
).loadMult
;
167 return (numballs
* (loadMultSum
/ numballs
))*0.5;
170 public function takeFromInventory
(item
:Item
):void {
171 for (var i
:int = 0; i
< inventory
.length
; i
++) {
172 if ((inventory
[i
] as Item
).id
== item
.id
) {
173 (inventory
[i
] as Item
).amount
-= item
.amount
;
174 if ((inventory
[i
] as Item
).amount
<= 0)
175 inventory
.splice
(i
, 1);
181 public function addToInventory
(item
:Item
):void {
182 for (var i
:int = 0; i
< inventory
.length
; i
++) {
183 if ((inventory
[i
] as Item
).id
== item
.id
) {
184 (inventory
[i
] as Item
).amount
+= item
.amount
;
188 if(inventory
.length
<11) {
189 inventory
.push
(item
);
192 main
.showInventory
(item
);
196 public function combatDescr
(subj
:Creature
):String {
197 if (getInterested
(subj
)) {
200 var o
:String = "<p>" + Utils
.A
(getTypeName
(),true) + " "+getTypeName
()+" leaps from the bushes and attacks!</p><p>Your attacker is ";
201 o
+= getDescription
();
206 public function onEncounter
(ply
:Creature
):Boolean { return false; }
208 public function onWin
(ply
:Creature
):Boolean { return false; }
209 public function onLose
(ply
:Creature
):Boolean { return false; }
211 protected function genName
():void {
212 var firstNames
:Array = [
228 var lastNames
:Array = [
240 ownName
= MathUtils
.getRandomEntry
(firstNames
) + " " + MathUtils
.getRandomEntry
(lastNames
);
246 * @return String Whatever it's called
248 public function getTypeName
():String {
249 return "NOT FUCKING NAMED YET";
252 public function getDescription
():String {
253 var descr
:String = "";
254 // a gay human male of average height and build. He also possesses a long, flowing mane of golden hair,
255 // which contrasts nicely with your blue eyes and light skin.
257 // In the equipment department, you're not too odd. You have two human testicles swinging between your legs, paired with
258 // a single, 5.5" human schlong. Your breasts are flat, but well-sculpted human pecs, and you have a standard-issue male
259 // ass with a standard-issue virgin male asshole between its buns. You've got two human arms, two human legs.
261 // In other words, you're an average human, which probably won't last long down here.
263 descr
= Utils
.A
(sexualPreference
.label
)+" "+sexualPreference
.label
+ " " + gender
.label
+ " " + getTypeName
() + ", who " + build
.getDescription
()
264 +" %CSUB% also possesses " + hair
.getDescription
();
266 if (hair
== Hair
.BALD
)
267 descr
+= ", %POS% glistening scalp distracting from %POS% ";
269 descr
+= ", which constrasts nicely with %POS% ";
271 descr
+= " complete lack of eyes (<b>and resulting blindness</b>)";
273 descr
+= getEyesDescr
();
275 descr
+= " and " + skin
.getDescr
(0, this);
278 descr
+= "<p>In the equipment department, ";
279 var haveBalls
:Boolean = (balls
.length
> 0);
280 var haveDicks
:Boolean = (dicks
.length
> 0);
281 var haveVags
:Boolean = (vaginas
.length
> 0);
282 if (haveBalls
&& haveDicks
)
283 descr
+= "%SUB% has " + getTesticleDescr
() + " swinging between %POS% legs, paired with " + getDickDescr
() + ".";
284 if (!haveBalls
&& haveDicks
)
285 descr
+= "no testicles rub between %POS% thighs when %SUB% walks, but %SUB% does have " + getDickDescr
() + ".";
286 if (haveBalls
&& !haveDicks
)
287 descr
+= "%SUB% doesn't have a dick, but %SUB% does have " + getTesticleDescr
() + ". %SUB% seems to get more horny as time passes.";
290 descr
+= " %CPOS% body possesses " + getVagDescr
() + ".";
292 if (!haveBalls
&& !haveDicks
&& !haveVags
)
293 descr
+= " %CSUB% doesn't have any sexual organs. At least you won't get raped.";
296 if (breasts
.length
> 0)
297 descr
+= " %CSUB% has " + getBreastDescr
() + ", and wears ";
299 descr
+= " %CSUB% doesn't have any breasts, but does have ";
300 descr
+= getAssDescr
() + ".";
303 descr
+= " %CSUB% has "+getArmsDescr
()+", ";
305 descr
+= " %CSUB% doesn't have any arms (<b>and therefore can't attack</b>), ";
307 if (legs
.length
> 0) {
308 if (arms
.length
== 0)
309 descr
+= "but %SUB% DOES have ";
312 descr
+= getLegsDescr
()+".";
314 descr
+= "and no legs (<b>so %SUB% can't dodge attacks</b>).";
316 if (wings
.length
> 0) {
317 descr
+= " %CSUB% also has " + getWingsDescr
() + ".";
321 return gender
.doReplace
(descr
);
324 public function hasEnchantment
(name
:String):Boolean {
325 return Utils
.objHas
(enchantments
,name
);
328 public function levelUp
(firstOne
:Boolean = false):void {
331 InfoScreen
.push
("<h2>Levelled up!</h2><p>You are now level " + level
+ "!</p>");
336 public function onCombatInit
():void {
340 public function get maxHP
():int {
341 return 100 + ((level
-1) * 5);
344 public function get maxXP
():int {
345 trace
("_level", _level
);
346 trace
("_strength", _strength
);
347 return Math.max
(1,50*(_level
* 0.5));
350 public function getExplored
(loc
:String):Boolean {
351 for (var i
:int = 0; i
< explored
.length
; i
++) {
352 if (explored
[i
] == loc
)
358 public function setExplored
(loc
:String):void {
359 if (getExplored
(loc
)) return;
363 public function recalcStrength
():void {
364 //trace("height:", height);
365 var weight
:Number = build
.calculateWeight
(height
, 0.5)
366 //trace("weight:",weight);
367 var A
:Number = Math.ceil
((Math.pow
(level
, 2) * 0.01) - (Math.abs
(17.5 - (weight
* 0.1))) + 8);
370 var B
:Number = Math.ceil
((Math.pow
(level
-1,2) * 0.01) - (Math.abs
(17.5 - (weight
* 0.1))) + 8);
371 _strength
= _strength
+ (A
- B
);
374 public function get strength
():int { return _strength
; }
375 public function set strength
(str
:int):void {
380 public function get speed
():int { return _speed
; }
381 public function set speed
(spd
:int):void {
386 public function get lust
():int { return _lust
; }
387 public function set lust
(lst
:int):void
394 public function get gold
():int { return _gold
; }
395 public function set gold
(value
:int):void
402 public function get intellect
():int { return _intellect
; }
403 public function set intellect
(i
:int):void
408 public function get mana
():int { return _mana
; }
409 public function set mana
(i
:int):void
414 public function get sensitivity
():int { return _sensitivity
; }
415 public function set sensitivity
(i
:int):void
421 public function get assholes
():Array { return this._assholes
; }
422 public function set assholes
(balls
:Array):void { this._assholes
=balls
;
427 public function get breasts
():Array { return this._breasts
; }
428 public function set breasts
(balls
:Array):void { this._breasts
=balls
;
431 public function get eyes
():Array { return this._eyes
; }
432 public function set eyes
(balls
:Array):void { this._eyes
=balls
;
435 public function get vaginas
():Array { return this._vaginas
; }
436 public function set vaginas
(balls
:Array):void { this._vaginas
=balls
;
439 public function get arms
():Array { return _arms
; }
440 public function set arms
(arr
:Array):void {
445 public function get legs
():Array { return _legs
; }
446 public function set legs
(arr
:Array):void { _legs
= arr
;
449 public function get wings
():Array { return _wings
; }
450 public function set wings
(arr
:Array):void { _wings
= arr
;
453 public function get balls
():Array { return _balls
; }
454 public function set balls
(balls
:Array):void { _balls
=balls
;
457 public function get dicks
():Array { return _dicks
; }
458 public function set dicks
(balls
:Array):void { _dicks
=balls
;
461 public function get abilities
():Object { return _abilities
; }
462 public function set abilities
(arr
:Object):void{ _abilities
=arr
; }
464 public function get gender
():Gender
{ return _gender
; }
465 public function set gender
(value
:Gender
):void { _gender
=value
;
468 public function get HP
():int { return _HP
; }
469 public function set HP
(value
:int):void {
473 public function get XP
():int { return _XP
; }
474 public function set XP
(value
:int):void {
475 //trace("XP", value);
485 public function setMain
(main
:AdventureController
):void {
489 private function doStatsUpdate
():void {
495 public function get level
():int {
499 private function getBodyPartDesc
(collection
:Array, singular
:String):String {
501 if (collection
.length
== 0) {
502 return "no "+singular
+"s";
505 var varying
:Boolean = false;
506 var types
:Object = new Object();
507 var lname
:String = "";
508 var numtypes
:Number = 0;
509 for each (var i
:* in collection
) {
510 var t
:IBodyPart
= i
as IBodyPart
;
515 if(!(lname
in types
)) {
521 for (var k
:String in types
) {
522 trace
(k
+ " = " + types
[k
]);
525 for each (t
in collection
) {
527 return t
.getDescr
(types
[lname
], this);
531 for (var ot
:* in types
) {
532 var gotdescr
:Boolean = false;
533 for each (t
in collection
) {
536 out
+= ", " + t
.getDescr
(types
[ot
] as Number, this);
543 return collection
.length
+ " "+singular
+"s of varying types ("+out
.substr
(2)+")";
548 public function notifyEnchantments
(e
:*):Boolean {
549 var collection
:Array = [];
550 for (var eID
:String in enchantments
) {
551 var ench
:Enchantment
= enchantments
[eID
];
552 if (e
is CombatStartEvent
) {
553 ench
.onCombatInit
(e
.other
);
555 if (e
is CombatEndEvent
) {
556 ench
.onCombatComplete
(e
.won
, e
.other
);
558 if (e
is CombatTurnEvent
) {
559 return ench
.onMyCombatTurn
(e
.other
);
565 public function getTesticleDescr
():String {
566 return getBodyPartDesc
(balls
,"ball");
569 public function getDickDescr
():String {
570 return getBodyPartDesc
(dicks
,"dick");
573 public function getVagDescr
():String {
574 return getBodyPartDesc
(vaginas
,"vag");
577 public function getBreastDescr
():String {
578 return getBodyPartDesc
(breasts
, "boob");
581 public function getAssDescr
():String {
582 return getBodyPartDesc
(assholes
,"asshole");
585 public function getArmsDescr
():String {
586 return getBodyPartDesc
(arms
, "arm");
589 public function getEyesDescr
():String {
590 return getBodyPartDesc
(eyes
, "eye");
593 public function getLegsDescr
():String {
594 return getBodyPartDesc
(legs
, "leg");
597 public function getWingsDescr
():String {
598 return getBodyPartDesc
(wings
, "wing");
606 * +---------------+---+---+
608 * +---------------+---+---+
613 * +---------------+---+---+
615 public function getInterested
(subj
:Creature
):Boolean {
616 return sexualPreference
.isOppositeGender
(gender
, subj
.gender
);
619 public function getHostile
(subj
:Creature
):Boolean {
623 public function performConversion
(oldMe
:Creature
):void {
627 public function changeFrom
(f
:Creature
):void {
628 this._speed
= f
._speed
;
629 this._strength
= f
._strength
;
630 this.abilities
= f
.abilities
;
631 this.enchantments
= f
.enchantments
;
632 this.explored
= f
.explored
;
633 this.gender
= f
.gender
;
635 this.height
= f
.height
;
637 this.ownName
= f
.ownName
;
638 this.sensitivity
= f
.sensitivity
;
639 this.sexualPreference
= f
.sexualPreference
;
640 this.inventory
= f
.inventory
;
642 this.performConversion
(f
);