1 package org
.sevenchan
.dongs
3 import org
.sevenchan
.AdventureController
;
5 import org
.sevenchan
.dongs
.bodyparts
.*;
6 import org
.sevenchan
.dongs
.bodyparts
.asshole
.Abdomen
;
7 import org
.sevenchan
.dongs
.creature
.*;
8 import org
.sevenchan
.dongs
.enchantment
.*;
9 import org
.sevenchan
.dongs
.enchantment
.events
.*;
10 import org
.sevenchan
.dongs
.screens
.*;
17 registerClassAlias
("ECreature", Creature
);
19 public static var BodyPartRegistry
:Object = {
21 human
:new Asshole
("human"),
22 demon
:new Asshole
("demon"),
23 arachnid
:new Abdomen
("Arachnid")
26 human
: new Arm
("human", null, null)
29 arachnid
: new Testicle
("internal testes", 3785, null, null, "hot, thick mixture of semen and eggs"),
30 demon
: new Testicle
("demon nut",38,new Corruption
(10),null,"boiling-hot, sticky black substance"),
31 human
: new Testicle
("human testicle", 17, null, null, "hot, stringy, off-white seed")
34 demon
: new Breast
("demon"),
35 human
: new Breast
("human")
38 arachnid
: new Penis
("Arachnid"),
39 demon
: new Penis
("demon",10,new Corruption
(1),null),
40 human
: new Penis
("human", 5, null, null)
43 human_blue
: new Eye
("human", "blue", "round"),
44 human_brown
: new Eye
("human", "brown", "round"),
45 human_green
: new Eye
("human", "green", "round"),
46 human_red
: new Eye
("human", "red", "round"),
47 arachnid_big
: new Eye
("human-ish Arachnid", "red", "round"),
48 arachnid_small
: new Eye
("small Arachnid", "black", "segment"),
49 harpy_light
: new Eye
("harpy", "amber", "slit"),
50 harpy_dark
: new Eye
("darkharpy", "red", "slit"),
51 demon
: new Eye
("demon", "amber", "slit")
54 arachnid
: new Leg
("Arachnid"),
55 harpy
: new Leg
("long, birdlike harpy"),
56 human
: new Leg
("human")
59 arachnid
: new Vagina
("Arachnid"),
60 demon
: new Vagina
("demon"),
61 human
: new Vagina
("human")
64 harpy
: new Wing
("harpy", false, "brown and white", 10),
65 harpy_dark
: new Wing
("darkharpy", false, "black and violet", 10)
69 public static var CreatureRegistry
:Object = {
70 arachnid
: new Arachnid
(false),
71 arachnid_pregnant
: new Arachnid
(true),
72 harpy
: new Harpy
(false),
73 harpy_dark
: new Harpy
(true),
76 oldspace
: new SandNigger
()
80 public var customized
:Boolean = false;
81 public var ownName
:String = "Blah Blah"; // Who am I?
82 public var height
:Number = 0.0; // How tall am I?
83 public var build
:Build
= Build
.AVG
; // How fat am I?
84 public var material
:Material
= Material
.NO_MATERIAL_MODIFIER
; // What am I made of?
85 public var hair
:Hair
= Hair
.BALD
; // His/her/hir hair is...
86 public var skin
:Skin
= new Skin
("human"); // His/her/hir hair is...
87 public var _gender
:Gender
= Gender
.ASEXUAL
; // Boy, Girl, Neither, Both?
88 public var sexualPreference
:SexualPreference
= SexualPreference
.ASEXUAL
; // Straight, Gay, ASexual, Bi?
90 // Stats (CACHED VALUES)
91 public var _level
:int = 0; // In comparison to standard human being. No attacking rats for 20 levels.
92 private var d_level
:int = 0; // Delta
93 public var _strength
:int = 1; // Damage caused in case of a successful attack.
94 public var _speed
:int = 1; // Chance of dodging. defending.speed-attacking.speed = relative chance of dodging.
95 public var _intellect
:int = 1; // Smartness. Opens dialog trees and gives hints.
96 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).
97 public var _sensitivity
:Number = 0; // 0-1, 0 being not sensitive
98 public var _HP
:int = 100; //100*(level*0.02)
99 public var _XP
:int = 0; // 50*(level*0.5)
100 public var _mana
:int = 0; // Magic shit, increases over time, especially near relaxing places.
101 public var _gold
:int = 0; // Currency
104 public var _abilities
:Object = new Object(); // What magic/techniques can I use?
105 public var _assholes
:Array = new Array(); // How many, and what type of assholes do I possess?
106 public var _arms
:Array = new Array(); // Needed to attack. Tentacles are ok.
107 public var _balls
:Array = new Array(); // Testes (Cum and pregnancy options)
108 public var _breasts
:Array = new Array(); // Boobs (fuckable)
109 public var _dicks
:Array = new Array(); // Penises (Pleasure options, testes required for preggo/cum stuff)
110 public var enchantments
:Object = new Object(); // What kinds of effects am I suffering/benefiting from?
111 public var _eyes
:Array = new Array(); // How many/what kinds of eyes do I have?
112 public var inventory
:Array = new Array(); // What stuff am I carrying?
113 public var _legs
:Array = new Array(); // Legs or locomotive tentacles or some other propulsion. (NONE = CAN'T MOVE OR DODGE)
114 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.
115 public var _wings
:Array = new Array(); // For flight.
116 public var explored
:Array = new Array();
118 private var main
:AdventureController
= null;
119 public function Creature
()
121 trace
("Creature.init()");
122 _gold
= MathUtils
.rand
(0, 50);
126 public function addEnchantment
(ench
:Enchantment
):String {
127 var story
:String = ench
.onInit
(this);
128 if(!ench
.cancelAddition
)
129 this.enchantments
[ench
.getID
()] = ench
;
133 public function initialGenderSetup
():void { }
135 public function yourMove
(cs
:CombatScreen
, ply
:Creature
):void {
136 if (notifyEnchantments
(new CombatTurnEvent
(ply
))) {
137 InfoScreen
.push
("<p>The " + getTypeName
() + " cannot attack!</p>");
140 if (MathUtils
.lengthOf
(abilities
) > 0 && MathUtils
.rand
(0,1) == 0) {
141 var ab
:Ability
= Ability
(MathUtils
.getRandomObjectEntry
(abilities
));
142 if(ab
.activate
(this, ply
))
145 cs
.tryAttack
(this, ply
);
148 public function addDick
(type
:String="human"):void {
151 public function addLust
(amt
:Number=1):void {
152 lust
+= (amt
* getLustMult
());
155 private function getLustMult
():Number {
156 var numballs
:Number = balls
.length
;
157 var loadMultSum
:Number = 0;
158 for (var i
:int = 0; i
< balls
.length
; i
++) {
159 loadMultSum
+= (balls
[i
] as Testicle
).loadMult
;
161 return (numballs
* (loadMultSum
/ numballs
))*0.5;
164 public function addToInventory
(item
:Item
):void {
165 for (var i
:int = 0; i
< inventory
.length
; i
++) {
166 if ((inventory
[i
] as Item
).id
== item
.id
) {
167 (inventory
[i
] as Item
).amount
+= item
.amount
;
171 if(inventory
.length
<11) {
172 inventory
.push
(item
);
175 main
.showInventory
(item
);
179 public function combatDescr
(subj
:Creature
):String {
180 if (getInterested
(subj
)) {
183 var o
:String = "<p>" + Utils
.A
(getTypeName
(),true) + " "+getTypeName
()+" leaps from the bushes and attacks!</p><p>Your attacker is ";
184 o
+= getDescription
();
189 public function onEncounter
(ply
:Creature
):Boolean { return false; }
191 public function onWin
(ply
:Creature
):Boolean { return false; }
192 public function onLose
(ply
:Creature
):Boolean { return false; }
194 protected function genName
():void {
195 var firstNames
:Array = [
211 var lastNames
:Array = [
223 ownName
= MathUtils
.getRandomEntry
(firstNames
) + " " + MathUtils
.getRandomEntry
(lastNames
);
229 * @return String Whatever it's called
231 public function getTypeName
():String {
232 return "NOT FUCKING NAMED YET";
235 public function getDescription
():String {
236 var descr
:String = "";
237 // a gay human male of average height and build. He also possesses a long, flowing mane of golden hair,
238 // which contrasts nicely with your blue eyes and light skin.
240 // In the equipment department, you're not too odd. You have two human testicles swinging between your legs, paired with
241 // a single, 5.5" human schlong. Your breasts are flat, but well-sculpted human pecs, and you have a standard-issue male
242 // ass with a standard-issue virgin male asshole between its buns. You've got two human arms, two human legs.
244 // In other words, you're an average human, which probably won't last long down here.
246 descr
= Utils
.A
(sexualPreference
.label
)+" "+sexualPreference
.label
+ " " + gender
.label
+ " " + getTypeName
() + ", who " + build
.getDescription
()
247 +" %CSUB% also possesses " + hair
.getDescription
();
249 if (hair
== Hair
.BALD
)
250 descr
+= ", %POS% glistening scalp distracting from %POS% ";
252 descr
+= ", which constrasts nicely with %POS% ";
254 descr
+= " complete lack of eyes (<b>and resulting blindness</b>)";
256 descr
+= getEyesDescr
();
258 descr
+= " and " + skin
.getDescr
(0, this);
261 descr
+= "<p>In the equipment department, ";
262 var haveBalls
:Boolean = (balls
.length
> 0);
263 var haveDicks
:Boolean = (dicks
.length
> 0);
264 var haveVags
:Boolean = (vaginas
.length
> 0);
265 if (haveBalls
&& haveDicks
)
266 descr
+= "%SUB% has " + getTesticleDescr
() + " swinging between %POS% legs, paired with " + getDickDescr
() + ".";
267 if (!haveBalls
&& haveDicks
)
268 descr
+= "no testicles rub between %POS% thighs when %SUB% walks, but %SUB% does have " + getDickDescr
() + ".";
269 if (haveBalls
&& !haveDicks
)
270 descr
+= "%SUB% doesn't have a dick, but %SUB% does have " + getTesticleDescr
() + ". %SUB% seems to get more horny as time passes.";
273 descr
+= " %CPOS% body possesses " + getVagDescr
() + ".";
275 if (!haveBalls
&& !haveDicks
&& !haveVags
)
276 descr
+= " %CSUB% doesn't have any sexual organs. At least you won't get raped.";
279 if (breasts
.length
> 0)
280 descr
+= " %CSUB% has " + getBreastDescr
() + ", and wears ";
282 descr
+= " %CSUB% doesn't have any breasts, but does have ";
283 descr
+= getAssDescr
() + ".";
286 descr
+= " %CSUB% has "+getArmsDescr
()+", ";
288 descr
+= " %CSUB% doesn't have any arms (<b>and therefore can't attack</b>), ";
290 if (legs
.length
> 0) {
291 if (arms
.length
== 0)
292 descr
+= "but %SUB% DOES have ";
295 descr
+= getLegsDescr
()+".";
297 descr
+= "and no legs (<b>so %SUB% can't dodge attacks</b>).";
299 if (wings
.length
> 0) {
300 descr
+= " %CSUB% also has " + getWingsDescr
() + ".";
304 return gender
.doReplace
(descr
);
307 public function hasEnchantment
(name
:String):Boolean {
308 return Utils
.objHas
(enchantments
,name
);
311 public function levelUp
(firstOne
:Boolean = false):void {
314 InfoScreen
.push
("<h2>Levelled up!</h2><p>You are now level " + level
+ "!</p>");
319 public function onCombatInit
():void {
323 public function get maxHP
():int {
324 return 100 + ((level
-1) * 5);
327 public function get maxXP
():int {
328 trace
("_level", _level
);
329 trace
("_strength", _strength
);
330 return Math.max
(1,50*(_level
* 0.5));
333 public function getExplored
(loc
:String):Boolean {
334 for (var i
:int = 0; i
< explored
.length
; i
++) {
335 if (explored
[i
] == loc
)
341 public function setExplored
(loc
:String):void {
342 if (getExplored
(loc
)) return;
346 public function recalcStrength
():void {
347 //trace("height:", height);
348 var weight
:Number = build
.calculateWeight
(height
, 0.5)
349 //trace("weight:",weight);
350 var A
:Number = Math.ceil
((Math.pow
(level
, 2) * 0.01) - (Math.abs
(17.5 - (weight
* 0.1))) + 8);
353 var B
:Number = Math.ceil
((Math.pow
(level
-1,2) * 0.01) - (Math.abs
(17.5 - (weight
* 0.1))) + 8);
354 _strength
= _strength
+ (A
- B
);
357 public function get strength
():int { return _strength
; }
358 public function set strength
(str
:int):void {
363 public function get speed
():int { return _speed
; }
364 public function set speed
(spd
:int):void {
369 public function get lust
():int { return _lust
; }
370 public function set lust
(lst
:int):void
377 public function get gold
():int { return _gold
; }
378 public function set gold
(value
:int):void
385 public function get intellect
():int { return _intellect
; }
386 public function set intellect
(i
:int):void
391 public function get mana
():int { return _mana
; }
392 public function set mana
(i
:int):void
397 public function get sensitivity
():int { return _sensitivity
; }
398 public function set sensitivity
(i
:int):void
404 public function get assholes
():Array { return this._assholes
; }
405 public function set assholes
(balls
:Array):void { this._assholes
=balls
;
410 public function get breasts
():Array { return this._breasts
; }
411 public function set breasts
(balls
:Array):void { this._breasts
=balls
;
414 public function get eyes
():Array { return this._eyes
; }
415 public function set eyes
(balls
:Array):void { this._eyes
=balls
;
418 public function get vaginas
():Array { return this._vaginas
; }
419 public function set vaginas
(balls
:Array):void { this._vaginas
=balls
;
422 public function get arms
():Array { return _arms
; }
423 public function set arms
(arr
:Array):void {
428 public function get legs
():Array { return _legs
; }
429 public function set legs
(arr
:Array):void { _legs
= arr
;
432 public function get wings
():Array { return _wings
; }
433 public function set wings
(arr
:Array):void { _wings
= arr
;
436 public function get balls
():Array { return _balls
; }
437 public function set balls
(balls
:Array):void { _balls
=balls
;
440 public function get dicks
():Array { return _dicks
; }
441 public function set dicks
(balls
:Array):void { _dicks
=balls
;
444 public function get abilities
():Object { return _abilities
; }
445 public function set abilities
(arr
:Object):void{ _abilities
=arr
; }
447 public function get gender
():Gender
{ return _gender
; }
448 public function set gender
(value
:Gender
):void { _gender
=value
;
451 public function get HP
():int { return _HP
; }
452 public function set HP
(value
:int):void {
456 public function get XP
():int { return _XP
; }
457 public function set XP
(value
:int):void {
458 //trace("XP", value);
468 public function setMain
(main
:AdventureController
):void {
472 private function doStatsUpdate
():void {
478 public function get level
():int {
482 private function getBodyPartDesc
(collection
:Array, singular
:String):String {
484 if (collection
.length
== 0) {
485 return "no "+singular
+"s";
488 var varying
:Boolean = false;
489 var types
:Object = new Object();
490 var lname
:String = "";
491 var numtypes
:Number = 0;
492 for each (var i
:* in collection
) {
493 var t
:IBodyPart
= i
as IBodyPart
;
498 if(!(lname
in types
)) {
504 for (var k
:String in types
) {
505 trace
(k
+ " = " + types
[k
]);
508 for each (t
in collection
) {
510 return t
.getDescr
(types
[lname
], this);
514 for (var ot
:* in types
) {
515 var gotdescr
:Boolean = false;
516 for each (t
in collection
) {
519 out
+= ", " + t
.getDescr
(types
[ot
] as Number, this);
526 return collection
.length
+ " "+singular
+"s of varying types ("+out
.substr
(2)+")";
531 public function notifyEnchantments
(e
:*):Boolean {
532 var collection
:Array = [];
533 for (var eID
:String in enchantments
) {
534 var ench
:Enchantment
= enchantments
[eID
];
535 if (e
is CombatStartEvent
) {
536 ench
.onCombatInit
(e
.other
);
538 if (e
is CombatEndEvent
) {
539 ench
.onCombatComplete
(e
.won
, e
.other
);
541 if (e
is CombatTurnEvent
) {
542 return ench
.onMyCombatTurn
(e
.other
);
548 public function getTesticleDescr
():String {
549 return getBodyPartDesc
(balls
,"ball");
552 public function getDickDescr
():String {
553 return getBodyPartDesc
(dicks
,"dick");
556 public function getVagDescr
():String {
557 return getBodyPartDesc
(vaginas
,"vag");
560 public function getBreastDescr
():String {
561 return getBodyPartDesc
(breasts
, "boob");
564 public function getAssDescr
():String {
565 return getBodyPartDesc
(assholes
,"asshole");
568 public function getArmsDescr
():String {
569 return getBodyPartDesc
(arms
, "arm");
572 public function getEyesDescr
():String {
573 return getBodyPartDesc
(eyes
, "eye");
576 public function getLegsDescr
():String {
577 return getBodyPartDesc
(legs
, "leg");
580 public function getWingsDescr
():String {
581 return getBodyPartDesc
(wings
, "wing");
589 * +---------------+---+---+
591 * +---------------+---+---+
596 * +---------------+---+---+
598 public function getInterested
(subj
:Creature
):Boolean {
599 return sexualPreference
.isOppositeGender
(gender
, subj
.gender
);
602 public function getHostile
(subj
:Creature
):Boolean {
606 public function performConversion
(oldMe
:Creature
):void {
610 public function changeFrom
(f
:Creature
):void {
611 this._speed
= f
._speed
;
612 this._strength
= f
._strength
;
613 this.abilities
= f
.abilities
;
614 this.enchantments
= f
.enchantments
;
615 this.explored
= f
.explored
;
616 this.gender
= f
.gender
;
618 this.height
= f
.height
;
620 this.ownName
= f
.ownName
;
621 this.sensitivity
= f
.sensitivity
;
622 this.sexualPreference
= f
.sexualPreference
;
623 this.inventory
= f
.inventory
;
625 this.performConversion
(f
);