1 package org
.sevenchan
.dongs
3 import flash
.utils
.Dictionary;
4 import flash
.utils
.getQualifiedClassName
;
5 import org
.sevenchan
.AdventureController
;
6 import org
.sevenchan
.dongs
.bodyparts
.Gender
;
7 import org
.sevenchan
.dongs
.creature
.Human
;
8 import org
.sevenchan
.dongs
.creature
.Player
;
9 import org
.sevenchan
.dongs
.screens
.InfoScreen
;
10 import org
.sevenchan
.dongs
.screens
.Shop
;
11 import org
.sevenchan
.dongs
.towns
.*;
17 public class Town
extends Screen
19 // Explore, Shop, Rest (10G), Leave, Fap
20 private var context
:Array = [];
22 public var text
:String = "";
24 public static var knownTowns
:Object = {};
26 public var shops
:Object = null;
31 public var ID
:String = "";
36 public var name
:String = "";
39 * IDs of connected towns to list when exiting.
41 public var connectedTowns
:Array = [];
44 * Is this town actually a Wilds?
46 public var isWilds
:Boolean = false;
49 * Does this town have free room and board?
51 public var freeRest
:Boolean = false;
54 * What kinds of creatures inhabit this town? (Hostile and otherwise)
56 * TYPE => CHANCE (0-1)
58 public var inhabitants
:Dictionary = new Dictionary();
60 private var menu
:String = "main";
62 public var biome
:Biome
= Biome
.WOODS
;
64 public static function setup
():void
67 knownTowns
= {barn
: new TownBarn
(), banala
: new TownBanala
(), damned
: new TownDamned
(), haara
: new WildsHaaraWastes
(), harpycabin
: new TownHarpyCabin
(), horus
: new WildsHorusSpine
(), lake
: new WildsLake
()};
70 public function Town
()
72 this.appearanceButton
= true;
73 this.debugMenuButton
= true;
74 this.exportGameButton
= false;
75 this.loadOrSaveButton
= true;
76 this.newGameButton
= false;
77 this.importGameButton
= false;
82 public function onShopBuyMenu
():String
85 return "<p>"So, what interests you today, buddy?" The shopkeeper asks, watching you (and your money-bag) with great intensity.</p>";
88 public function onShopSellMenu
():String
91 return "<p>"All right, let's see what you got, chief."</p>";
94 public function onShopWelcome
():String
97 return "<p>The shopkeeper is, as usual, mopping the old, dirty floor with an equally old and dirty mop when he notices you enter. His piggish face brightens a bit.</p>" + "<p>"Oh great. My favorite customer." He mutters sarcastically, continuing to mop. "So, do you wanna buy, or sell?"</p>";
100 override public function processButtonPress
(id
:int):Boolean
105 if (!main
.player
.getExplored
(ID
))
109 main
.player
.setExplored
(ID
);
113 text
+= "You cannot enter this area... Yet.";
122 setButton
(0, "Explore");
126 setButton
(1, "Shop");
128 setButton
(2, "Rest");
130 setButton
(2, "Rest (10G)");
132 setButton
(3, "Leave");
133 setButton
(4, "Masturbate");
134 setButton
(5, "Inventory");
146 var c
:Creature
= getRandomInhabitant
();
149 if (c
.getHostile
(main
.player
))
151 main
.startCombat
(this, c
);
156 var encounter
:Boolean = c
.onEncounter
(main
.player
)
167 setButton
(0, "Back");
169 text
= "<h2>Shop</h2><p>You look around cautiously for a place to buy some wares. After a cursory examination of your surroundings, you find the following places of commerce:</p><ul>";
171 for (var shopName
:String in shops
)
174 setButton
(i
, shopName
);
175 context
.push
(shopName
);
176 text
+= "<li><b>" + shopName
+ "</b> - " + (shops
[shopName
] as Shop
).description
+ "</li>";
184 if (main
.player
.gold
>= 10 || freeRest
)
188 main
.player
.gold
-= 10;
190 main
.player
.HP
= main
.player
.maxHP
;
199 setButton
(NEXT_BUTTON
, "Next");
206 setButton
(0, "CANCEL");
207 text
= "<p>You peer at the roadsigns in the middle of town and try to make out the destinations.</p>";
208 if (connectedTowns
.length
== 0)
210 text
+= "<p>However, you cannot make them out (bug; connectedTowns=[]).</p>";
215 for (var j
:int = 0; j
< connectedTowns
.length
; j
++)
217 var t
:Town
= Town
.knownTowns
[connectedTowns
[j
]];
218 setButton
(j
+ 1, t
.ID
);
220 text
+= "<li><b>" + t
.ID
+ "</b> - " + t
.name
+ " (Wilds)</li>";
222 text
+= "<li><b>" + t
.ID
+ "</b> - " + t
.name
+ "</li>";
230 setButton
(NEXT_BUTTON
, "NEXT");
231 text
= "<h2>Masturbate</h2>";
232 if (main
.player
.currentTown
.isWilds
)
234 getWildsMasturbation
();
238 text
+= getShelteredMasturbation
();
240 var propText
:String = getPropositioned
();
241 if (propText
.length
> 0)
243 // Let the system handle it
246 text
+= "<p>The yearning for release drives you on, pushing you to ";
247 if (main
.player
.gender
.hasDick
)
249 if (main
.player
.gender
.hasDick
&& main
.player
.gender
.hasVag
)
251 if (main
.player
.gender
.hasVag
)
253 text
+= " as fast as you can. Grimacing in sheer delight, you moan out in ecstasy. With feverish need, ";
254 text
+= "you bring yourself to the point of no return and groan in primal bliss as your orgasm";
255 if (main
.player
.gender
.hasDick
)
257 text
+= " works its way up your " + Utils
.pluralize
(main
.player
.dicks
.length
, "cock") + ".";
258 //TODO: Need to get clarification on these, as cum amount is determined by the testicles.
260 if (main
.player
.balls
.length
>= 2 && main
.player
.balls
.length
< 4)
262 text
+= "Your "+Utils
.pluralize
(main
.player
._dicks
.length
,"prick erupts","pricks erupt")+" with thin strands of semen that arc through the air, landing on ";
263 text
+= "the ground before you."
266 if (main
.player
.balls
.length
>= 4 && main
.player
.balls
.length
< 8)
268 text
+= "Drooling with lust, your "+Utils
.pluralize
(main
.player
._dicks
.length
,"cock unleashes its","cocks unleash their")+" liberal payload ";
269 text
+= "against the ground, coating it in thick strands of your pent up arousal.";
272 if (main
.player
.balls
.length
>= 8)
274 text
+= "Release is fast and furious, as your "+Utils
.pluralize
(main
.player
._dicks
.length
,"member explodes and rains its","members explode and rain their")+" copious juices all over the immediate area, dosing you in jism while you twitch uncontrollably.";
277 else if (main
.player
.gender
.hasVag
)
279 var vagDescr
:String = main
.player
.vaginas
[0].getDescr
(1, main
.player
);
280 //text += "ic excitement throbs through your " + ;
281 // Reword this, makes the PC sound like a fucking werewolf.
282 text
+= " gushes forth from your " + vagDescr
+ "; the culmination of your sexual talent and pent up lust bringing forth a noisy series of howls from your mouth.";
286 text
+= " hits your body like a runaway oxcart.";
289 text
+= "<p>Spent, you lie against the ground, breathing heavily as you pant from the exhaustive efforts. ";
290 text
+= "You decide that laying there for a bit doesn’t sound like a bad idea, you think to yourself, ";
291 text
+= "still high on the rush of orgasm as you rest.</p>";
292 text
+= "<p>Once your strength returns, you grab a hold of your clothing and proceed to don it once more, ";
293 text
+= "eager to set out and stop the Demon menace that ravages both these lands.</p>";
294 main
.player
.lust
= 0;
299 main
.showInventory
();
309 processButtonPress
(-1);
312 AdventureController
.screenQueue
.write
(shops
[context
[id
- 1]] as Shop
);
316 processButtonPress
(-1);
321 processButtonPress
(-1);
324 main
.setTown
(knownTowns
[connectedTowns
[id
- 1]]);
335 public function getWildsMasturbation
():String
338 t
+= "<p>The lust boiling in your loins is too much to ignore anymore as you nervously look around ";
339 t
+= "for other signs of life; you don’t want some sex crazed Demon or creature to get the drop on ";
340 t
+= "you while you tend to your urges. ";
341 if ((main
.player
as Player
).baseType
is Human
)
343 t
+= "Or worse, by some stroke of chance having a survivor from your unit stumble upon you as you ";
344 t
+= "relieve a little "tension".";
347 t
+= "Spotting only the harmless landscape, you deem that its safe enough to find someplace private ";
348 t
+= "and get intimately acquainted with your body.</p>";
350 var gbody
:String = (main
.player
.gender
== Gender
.ASEXUAL
) ? "body" : "genitalia";
352 switch (main
.player
.currentTown
.biome
)
355 t
+= "<p>Ducking into a secluded bush, you endeavor to work yourself free of your ";
356 t
+= "clothing and free your ";
357 switch (main
.player
.gender
)
360 t
+= Utils
.pluralize
(main
.player
.vaginas
.length
, "vagina");
366 t
+= Utils
.pluralize
(main
.player
.dicks
.length
, "cock");
374 var sexes
:String = (main
.player
.gender
== Gender
.ASEXUAL
) ? "body" : Utils
.pluralize
(main
.player
.vaginas
.length
+ main
.player
.dicks
.length
, "sex", "sexes");
375 t
+= "<p>Concealing yourself in between a pair of boulders, you finally indulge the ";
376 t
+= "ceaseless lamentations of your " + sexes
+ " and free ";
377 switch (main
.player
.gender
)
380 t
+= "your " + Utils
.pluralize
(main
.player
.vaginas
.length
, "vagina");
383 t
+= "your genitalia";
386 t
+= "your " + Utils
.pluralize
(main
.player
.dicks
.length
, "cock");
392 t
+= " of your clothing</p>";
395 t
+= "<p>Finding a nice, out of way spot on the hot sand, you eagerly strip down and ";
396 t
+= "expose your " + gbody
+ " to the brisk air that blows over the tranquil environment.</p>";
399 t
+= "<p>Working your way up the humid, slippery trunk of a tree, you manage to perch ";
400 t
+= "yourself on a stable branch that’s high enough off the ground to give you some advance ";
403 case Biome
.MOUNTAINS
:
404 t
+= "<p>Shielded from the whipping winds of this plateau by welcome rockface, you ";
405 t
+= "breath a sigh of relief and take in the feeling of solid ground under your body; ";
406 t
+= "something that's been sorely lacking as you’ve explored these mountains. Now filled ";
407 t
+= "with a sense of security, you work to remove your clothing and bring your " + gbody
+ " to attention.</p>";
410 t
+= "<p>After scoping out and wiping down a well hidden hole in the cavernous ";
411 t
+= "tunnels, you climb inside and quickly undo your pant buckles. Even in the darkness, you ";
412 t
+= "instinctively know where ";
413 if (main
.player
.gender
== Gender
.ASEXUAL
)
415 t
+= "your " + gbody
+ " are, reaching down and taking a firm hold on ";
416 t
+= Utils
.pluralize
(main
.player
.vaginas
.length
+ main
.player
.dicks
.length
, "it", "them") + ".";
420 t
+= "you need to touch, trying your best to trigger a body shuddering spasm of joyful gratification.";
427 public function getShelteredMasturbation
():String
429 var t
:String = "<p>Your physical arousal no longer deniable, you find your hands taking to your ";
430 if (main
.player
.gender
.hasDick
)
431 t
+= Utils
.stripA
(main
.player
.getDickDescr
());
432 else if (main
.player
.gender
.hasVag
)
433 t
+= Utils
.stripA
(main
.player
.getVagDescr
());
436 t
+= " with a primal need, ";
437 if (main
.player
.gender
.hasDick
)
438 t
+= "stroking the sensitive features of your flaring head";
440 t
+= "caressing your tender skin";
441 t
+= " with such tantalizing efforts that only you know how to achieve. Closing your eyes, you allow";
442 t
+= " the physical touch of your efforts to resonate through your body; your hunger for sexual";
443 t
+= " stimulation at long last being sated as ";
444 if (main
.player
.gender
.hasDick
)
445 t
+= "the rise and fall of your palm against your flesh causes you to groan in satisfaction. ";
447 t
+= "the sensation of your delicate fingers solicits a whimper from your pursed mouth. ";
448 t
+= "Physically flushed with pleasure you power onwards, ";
449 if (main
.player
.gender
.hasDick
)
450 t
+= "pumping your " + Utils
.pluralize
(main
.player
.dicks
.length
, "cock") + " with ever increasing ferocity";
452 t
+= "taking to your pussy like a succulent pastery as you work your fingers into your honey pot, the surprise jolt of intense euphoria teasing your mind.";
457 public function getPropositioned
():String
460 //Check to see if PC is propositioned by a passer-by (monster girl, etc) or attacked
461 var c
:Creature
= this.getRandomInhabitant
();
464 if (!isWilds
&& c
.getInterested
(main
.player
))
466 t
+= "<p>"H-hey!" A voice rings out, startling you as you snap back to reality.</p>";
467 t
+= "<p>Expecting the worst, ";
468 if (main
.player
.hasAnyWeapon
())
470 t
+= "you reach for your weapon";
474 t
+= "ready yourself for battle";
476 t
+= ". "Whoa, WHOA! Take it easy!" The " + c
.getTypeName
() + " exclaims, palms facing you in a defensive gesture.";
477 t
+= " "I heard you... tending to yourself and was coming to see who it was...” %SUB% states, before looking you up";
478 t
+= " and down. "Mhmmm... and whether they wanted to give up playing with themselves and spend some time with me instead."";
481 t
+= "<p>Your visitor is " + c
.getDescription
() + "</p>";
482 t
+= "<p>"Full disclosure: <b>I'm actually a " + c
.gender
.label
+ "</b>," %CSUB% blushes beet red with the revelation.</p>";
484 t
+= "<p>Do you want to forego masturbation and indulge the " + c
.getTypeName
() + ", or would you rather not?</p>";
485 t
= c
.getApparentGender
().doReplace
(t
);
488 if (isWilds
&& c
.getHostile
(main
.player
))
490 t
+= "The sounds of something moving around your hiding spot ";
491 t
+= "draws you from the realm of carnal gratification and into the real world. Cautiously, you ";
492 if (main
.player
.hasAnyWeapon
())
493 t
+= "reach for your " + main
.player
.getFirstWeapon
().name
;
495 t
+= "ready yourself for a fight."
496 t
+= ""I can smell your excitement in the air! Why don’t you come on out here and let me have a little fun with you..."";
497 t
+= "The unknown entity calls out. "I’d <i>hate</i> to have to hurt you if you resist; I doubt you can take me when I’ve ";
498 t
+= "caught you with your ";
499 if (main
.player
.gender
.hasDick
)
500 t
+= "dick in your hand";
504 t
+= "<p><i>Great, no time to suit back up</i>, you think to yourself. Your musings and disappointment in being found are ";
505 t
+= "shattered as a pair of eyes dart towards your face. "Gotcha!" The " + c
.getTypeName
() + " cries out, grinning like a ";
506 if (c
.getApparentGender
().hasDick
)
510 t
+= " possessed at the "bounty" %SUB% has happened upon.";
511 t
= c
.getApparentGender
().doReplace
(t
);
512 //leads to a butt naked fight.
514 // Detach all clothing.
515 main
.player
.inventory
.push
(main
.player
.clothing
);
516 main
.player
.clothing
.splice
(0, main
.player
.clothing
.length
);
517 main
.startCombat
(null, c
, false);
523 //Being found isn’t triggered
525 //Haven't implemented anything for this yet.
528 //Sexual stimulation certainly can be difficult when you lack the proper “equipment” to do so, but you are determined to rid yourself of all this pent up lust. As you strip down to your birthday suit you begin to caress at your body, allowing your digits to teasingly slide across your chest and stomach.
530 //PC is at level 0 Massage: It’s hard to properly stimulate yourself when you have so little
531 //experience with this sort of thing, but you trudge on regardless as...
533 //PC is at level 1 Massage: What little experience you possess allows for a more sensual rub down, but you definitely have much to learn if you are to properly manage your lust in your current state.
535 //PC is at level 2-3 Massage: Now possessing some experience at getting yourself off to your own soft tough, you are much more adept at releasing sexual tension, and you eagerly look forward to improving on your technique.
537 //PC is at level 4-5 Massage: Stimulating your sexless body has become as natural as breathing, and you crave the near orgasmic state you can bring yourself to now as...
539 //!!Check for interruption at this point!! Display standard interruption dialouge for whatever gets triggered; proposition or attacked
541 //Your hands busily explore your sexless body, sweeping along your [breast descript] and [nipple descript] before darting down to your [thigh descript], massaging the sensitive contours of your lower torso. You
543 //PC is at level 0-1: attempt to derive what little pleasure you can from your unco-ordinated and ultimately blinded efforts to stimulate yourself, frustratingly deprived of the release you so crave.
545 //PC is at level 2-3 bask in the satisfying embrace of your hands, eager to further your
546 //skills as you feel yourself coming so close to “release”.
548 //PC is at level 4-5: can’t help but twitch like a bug under a magnifying glass, the supple
549 //touch of your fingers along your [skin] simply too much to bear as you fall over in “orgasm”, unleashing a series of distorted moans as you surrender yourself to sensual bliss.
551 //Endings for all except levels 4-5
553 //With some time and effort you manage to slate some of your pent up lust, rising to your feet and breathing a final, heavy sigh of relief. It hasn’t dissipated completely, but it’s better than the state you you were in when you started. Eager to get back to your adventure you reach down and grab your [armor], hopping along as you work yourself back into your attire.
555 //Ending for levels 4-5
557 //“Normal” people might place a lot of importance on having genitalia or the ability to “orgasm”; they can have them! you think to yourself, still reeling from your body shaking spasm of sensual pleasure. You’ll get your (armor) back on soon enough; right now you just want to lay back, smile, and enjoy the fruits of your labor.
559 override public function getScreenText
():String
565 * omg new town what's it like
567 public function onRevelation
():Boolean
573 public function onExplore
(bumpedInto
:Creature
):void
578 public function onEnter
():void
583 public function onFailedRest
():void
588 public function onSuccessfulRest
():void
590 text
= "SUCCESSFULREST";
593 public function getRandomInhabitant
():Creature
595 for (var type
:Object in inhabitants
)
597 var c
:Creature
= type
as Creature
;
598 var rnd
:Number = Math.random
();
599 trace
("CRND", getQualifiedClassName
(c
), rnd
);
600 if (inhabitants
[type
] > rnd
)