NPC loading and saving!
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / creature / Demon.as
bloba6f58076ee26d2bbd4cce1b722204a4075053f84
1 package org.sevenchan.dongs.creature
3 import org.sevenchan.dongs.Creature;
4 import org.sevenchan.dongs.bodyparts.*;
5 import org.sevenchan.dongs.enchantment.Corruption;
6 import org.sevenchan.dongs.screens.InfoScreen;
7 import org.sevenchan.dongs.StringTools;
8 import flash.net.registerClassAlias;
9 /**
10 * Demons are basically magically corrupted humans, so many of the features should remain the same.
11 * @author Harbinger
13 public class Demon extends Creature
15 // For serialization
16 registerClassAlias("EDemon", Demon);
18 // Body part pool
19 private static var SKIN:Skin = new Skin("demon", "red", "smooth, yet leathery");
20 private static var HAIR:Hair = new Hair("straight, long, and black hair");
22 public function Demon()
24 trace("Demon.init()");
25 super();
26 height = Math.random() * 1.5 + 5;
27 this.sexualPreference = SexualPreference.BISEXUAL; // Promiscuous.
30 this.build = Build.AVG;
31 this.hair = HAIR;
33 this.arms.push(
34 BodyPartRegistry.human_arm,
35 BodyPartRegistry.human_arm
37 this.legs.push(
38 BodyPartRegistry.human_leg,
39 BodyPartRegistry.human_leg
41 this.assholes.push(
42 BodyPartRegistry.demon_anus
44 skin = SKIN;
45 eyes.push(BodyPartRegistry.demon_eye, BodyPartRegistry.demon_eye);
48 override public function getTypeName():String
50 return "demon";
53 override public function getHostile(subj:Creature):Boolean
55 return true;
58 override public function getInterested(subj:Creature):Boolean
60 return true;
63 override public function performConversion(oldMe:Creature):void
65 var i:int = 0;
66 for (i = 0; i < balls.length; i++) {
67 balls[i] = BodyPartRegistry.demon_testicle;
69 for (i = 0; i < dicks.length; i++) {
70 dicks[i] = getNewDick();
72 for (i = 0; i < breasts.length; i++) {
73 breasts[i] = BodyPartRegistry.demon_breast;
75 for (i = 0; i < vaginas.length; i++) {
76 vaginas[i] = BodyPartRegistry.demon_vagina;
78 for (i = 0; i < eyes.length; i++) {
79 eyes[i] = BodyPartRegistry.demon_eye;
81 for (i = 0; i < assholes.length; i++) {
82 assholes[i] = BodyPartRegistry.demon_anus;
84 InfoScreen.push("<h2>PARADIGM SHIFT</h2><p>No John, you are the demons.</p>");
87 override public function addBreast():Breast
89 var boob:Breast = BodyPartRegistry.human_breast;
90 boob.size = MathUtils.rand(0, 3);
91 breasts.push(boob);
92 return boob;
95 override public function onWin(ply:Creature):Boolean
97 if (getInterested(ply) && gender.hasDick) {
98 // Do rape
99 var enchTxt:String = "";
100 var asshole:Boolean = false;
101 var amtCum:Number = 0;
103 for (var i:int = 0; i < balls.length; i++) {
104 var t:Testicle = balls[i];
105 enchTxt += ply.addEnchantment(t.targetFX) + " ";
107 for (var idx:int = 0; idx < ply.vaginas.length; idx++) {
108 if (ply.assholes[idx].pregnantWith == null) {
109 ply.assholes[idx].impregnate(balls);
110 asshole = true;
113 var text:String = "<h2>YOU LOSE.</h2>";
114 text += "<p>The demon grins, still panting from the heat of the battle,";
115 text += " %POS% red skin glistening under the eternal glaring sun.  You slowly roll over,";
116 text += " spit out a few teeth, and look up at %OBJ% warily, feeling faint from the blood";
117 text += " loss. <i>Well, shit.</i>  You consider your options, but never get the chance";
118 text += " to use them.</p>";
120 text += "<p>\"Don't you just love how you can't die here, bitch?\"  %CSUB% gloats, giving you a kick";
121 text += " with %POS% foot, knocking you onto your side. \"I guess you and I can have a";
122 text += " little fun;  After all, I’ve got a full load.\"  The grin widens, and %POS% large,";
123 text += " rock-hard cock dribbles a dark fluid onto the ground as it throbs in the air,";
124 text += " making %POS% intentions clear.  You look at %POS% balls, and are suddenly terrified";
125 text += " to see something moving inside them, as though full of worms. They seem to";
126 text += " swell with anticipation, almost straining the skin in their need to be";
127 text += " released.  %SUB% notices your gaze, and teasingly traces a finger around %POS%";
128 text += " swollen orbs, keeping you pinned with a foot.";
130 if(ply.gender.hasDick || ply.gender.hasVag)
131 text +="  A surge of unwanted arousal surges through you, and you turn away, bile rising in the back of your throat.</p>";
133 text += "<p>You manage moan in feeble protest as %SUB% rolls your limp body onto your stomach,";
134 text += " and then hunches down, rubbing %POS% sweaty, leaky cock between your supple buns, pinning";
135 text += " you firmly to the floor. %CSUB% shudders like a crack addict anticipating a fix.";
136 text += " Then, seemingly without any effort aside from an assertive grunt, %SUB% rams %POS%";
137 text += " red, veiny dick deep into your ass.  You scream as your asshole is suddenly";
138 text += " stretched wide painfully, but no one is around to help.</p>";
140 text += "<p>Now on autopilot, the demon grips you and viciously thrusts";
141 text += " into you, the scalding-hot precum eliciting more painful screams as %POS% hot,";
142 text += " rank breath rolls over your back. One final thrust, and %SUB%’s finished, filling";
143 text += " your bowels with "+MathUtils.fmtMilliLiters(amtCum)+" of boiling-hot black semen.  %SUB% pulls out of your destroyed ass with a";
144 text += " sickeningly wet pop, %POS% burning hot, black seed spilling to the floor.";
146 if(ply.gender.hasDick || ply.gender.hasVag) {
147 text += "Unable to help yourself, you ";
148 if (ply.gender.hasDick)
149 text += ", too, spurt your cum onto the floor, forming a puddle.  ";
150 else if (ply.gender.hasVag)
151 text += "cum uncontrollably, spasming beneath the demon. ";
154 text += "You can feel the acrid smoke from %POS% jizz curling up from your asshole.</p>";
156 text += "<p><b>"+enchTxt+"</b></p>";
158 text += "<p>Satisfied, the demon stands up, squirts a last bit of hot tar onto your back, and then kicks you in the head, knocking you";
159 text += "unconscious.</p>";
161 InfoScreen.push(gender.doReplace(text));
162 return true;
163 } else {
164 return false;
168 override public function initialGenderSetup():void
170 var gi:int = MathUtils.rand(0, 5);
171 switch(gi) {
172 case 0:
173 case 1:
174 this.gender = Gender.MALE;
175 break;
176 case 2:
177 case 3:
178 this.gender = Gender.FEMALE;
179 break;
180 case 4:
181 case 5:
182 this.gender = Gender.HERM;
183 break;
185 this.balls = new Vector.<Testicle>();
186 this._dicks = new Vector.<Penis>();
187 this.breasts = new Vector.<Breast>();
188 this.vaginas = new Vector.<Vagina>();
189 if(gender.hasDick) {
190 this.balls.push(
191 BodyPartRegistry.demon_testicle,
192 BodyPartRegistry.demon_testicle
194 this.dicks.push(
195 getNewDick()
198 if (gender.hasVag) {
199 this.vaginas.push(
200 BodyPartRegistry.demon_vagina
202 this.breasts.push(
203 BodyPartRegistry.demon_breast,
204 BodyPartRegistry.demon_breast
207 // Cionflip to get mutations or not
208 if(MathUtils.rand(0,1)==0)
209 doMutations();
212 private function getNewDick():Penis {
213 var wang:Penis = BodyPartRegistry.demon_penis
214 wang.size += MathUtils.rand(1, 3, false);
215 return wang;
218 private const mutationLocations:Array = new Array(
219 "a leg",
220 "%POS% chin",
221 "", // the normal spot
222 "an arm",
223 "%POS% face"
225 private function doMutations():void {
226 var i:int = 0;
228 // Dick & Balls
229 if(gender.hasDick) {
230 for (i = 0; i < MathUtils.rand(0, 2); i++) {
231 var p:Penis = null;
232 switch(MathUtils.rand(0, 2))
234 case 0:
235 p = BodyPartRegistry.human_penis;
236 case 1:
237 p = BodyPartRegistry.arachnid_penis;
238 case 2:
239 p = BodyPartRegistry.demon_penis;
241 p._location = MathUtils.getRandomArrayEntry(mutationLocations);
242 p.size = MathUtils.rand(1, 24, false);
243 this.dicks.push(t);
245 for (i = 0; i < MathUtils.rand(0, 3); i++) {
246 var t:Testicle = null;
247 switch(MathUtils.rand(0, 3))
249 case 0:
250 t = BodyPartRegistry.human_testicle;
251 case 1:
252 t = BodyPartRegistry.demon_testicle;
253 case 2:
254 t = BodyPartRegistry.arachnid_testicle;
255 case 3:
256 t = BodyPartRegistry.manticore_testicle;
258 t._location = MathUtils.getRandomArrayEntry(mutationLocations);
259 t.normalLoad = MathUtils.rand(1, 1000, false);
260 t.loadMult = MathUtils.rand(1, 200, false);
261 this.balls.push(t);
265 // Vags & Boobs
266 if(gender.hasVag) {
267 for (i = 0; i < MathUtils.rand(0, 2); i++) {
268 var v:Vagina = null;
269 switch(MathUtils.rand(0, 2))
271 case 0:
272 v = BodyPartRegistry.human_vagina;
273 case 1:
274 v = BodyPartRegistry.demon_vagina;
275 case 2:
276 v = BodyPartRegistry.arachnid_vagina;
278 v._location = MathUtils.getRandomArrayEntry(mutationLocations);
279 this.vaginas.push(v);
281 for (i = 0; i < MathUtils.rand(0, 2); i++) {
282 this.breasts.push(BodyPartRegistry.demon_breast);