1 package org
.sevenchan
.dongs
.creature
3 import org
.sevenchan
.AdventureController
;
4 import com
.adobe
.serialization
.json
.*;
5 import flash
.events
.Event;
7 import org
.sevenchan
.dongs
.ability
.Instawin
;
8 import org
.sevenchan
.dongs
.bodyparts
.*;
9 import org
.sevenchan
.dongs
.*;
11 import org
.sevenchan
.dongs
.enchantment
.Enchantment
;
12 import org
.sevenchan
.dongs
.screens
.CombatScreen
;
17 public class Player
extends Creature
19 private var f
:FileReference = new FileReference();
20 private var baseType
:Creature
= new Human
();
21 private var saveFile
:FileReference = null;
22 private var waitingForLoad
:Boolean = false;
23 private var cancelled
:Boolean = false;
24 public var currentTown
:Town
= Town
.knownTowns
["barn"];
25 public var main
:AdventureController
;
27 public function Player
(main
:AdventureController
)
30 trace
("Player.init()");
33 public function changeTo
(t
:Creature
):void {
34 var tmp
:Creature
= baseType
;
36 baseType
._speed
= tmp
._speed
;
37 baseType
._strength
= tmp
._strength
;
38 baseType
.abilities
= tmp
.abilities
;
39 baseType
.enchantments
= tmp
.enchantments
;
40 baseType
.explored
= tmp
.explored
;
41 baseType
.gender
= tmp
.gender
;
42 baseType
.gold
= tmp
.gold
;
43 baseType
.height
= tmp
.height
;
44 baseType
.HP
= tmp
.maxHP
;
45 baseType
.ownName
= tmp
.ownName
;
46 baseType
.sensitivity
= tmp
.sensitivity
;
47 baseType
.sexualPreference
= tmp
.sexualPreference
;
48 baseType
.inventory
= tmp
.inventory
;
50 baseType
.performConversion
(tmp
);
55 override public function getExplored
(loc
:String):Boolean {
56 for (var i
:int = 0; i
< baseType
.explored
.length
; i
++) {
57 if (baseType
.explored
[i
] == loc
)
63 override public function setExplored
(loc
:String):void {
64 if (getExplored
(loc
)) return;
65 baseType
.explored
.push
(loc
);
68 public function save
():void {
69 var f
:FileReference = new FileReference();
70 var ba
:ByteArray = new ByteArray();
73 currentTown
: currentTown
.ID
,
77 f
.save
(ba
, "save.dat");
80 public function load
():Boolean {
82 waitingForLoad
= true;
83 f
.addEventListener
(Event.SELECT
, onFileSelected
);
84 f
.addEventListener
(Event.CANCEL
, onFileCancelled
);
85 if (!f
.browse
([new FileFilter("Saves","*.dat")]))
90 private function onFileSelected
(e
:Event):void {
91 f
.addEventListener
(Event.COMPLETE
, onFileLoaded
);
95 private function onFileLoaded
(e
:Event):void {
96 var saveData
:Object = f
.data
.readObject
();
97 this.currentTown
= Town
.knownTowns
[saveData
.currentTown
];
98 this.baseType
= saveData
.body
;
99 main
.onPlayerLoaded
();
102 private function onFileCancelled
(e
:Event):void {
105 override public function initialGenderSetup
():void
107 baseType
.initialGenderSetup
();
110 override public function yourMove
(cs
:CombatScreen
, ply
:Creature
):void
114 public override function getDescription
():String {
115 var descr
:String = "<h2>Appearance</h2>";
116 // You, Charles Cockhammer, are a gay human male of average height and build. You also possess a long, flowing mane of golden hair,
117 // which contrasts nicely with your blue eyes and light skin.
119 // In the equipment department, you're not too odd. You have two human testicles swinging between your legs, paired with
120 // a single, 5.5" human schlong. Your breasts are flat, but well-sculpted human pecs, and you have a standard-issue male
121 // ass with a standard-issue virgin male asshole between its buns. You've got two human arms, two human legs.
123 // In other words, you're an average human, which probably won't last long down here.
125 descr
+= "<p>You, " + baseType
.ownName
+ ", are " + Utils
.A
(baseType
.sexualPreference
.label
) + " " + baseType
.gender
.label
+ " " + baseType
.getTypeName
() + " " + baseType
.build
.getDescription
()
126 +" You also possess " + baseType
.hair
.getDescription
();
128 if (baseType
.hair
== Hair
.BALD
)
129 descr
+= ", your glistening scalp distracting from your ";
131 descr
+= ", which constrasts nicely with your ";
132 if(baseType
.eyes
.length
== 0)
133 descr
+= " complete lack of eyes (<b>and resulting blindness</b>)";
135 descr
+= baseType
.getEyesDescr
();
137 descr
+= " and " + baseType
.skin
.getDescr
(0, this);
140 descr
+= "<p>In the equipment department, ";
141 //if (baseType.customized)
142 // descr += "you're a bit different from the average bear. ";
144 descr
+= "you're not too odd, compared to other "+baseType
.getTypeName
()+"s. ";
145 var haveBalls
:Boolean = (baseType
.balls
.length
> 0);
146 var haveDicks
:Boolean = (baseType
.dicks
.length
> 0);
147 var haveVags
:Boolean = (baseType
.vaginas
.length
> 0);
148 if (haveBalls
&& haveDicks
)
149 descr
+= "You have " + baseType
.getTesticleDescr
() + " swinging between your legs, paired with " + baseType
.getDickDescr
() + ".";
150 if (!haveBalls
&& haveDicks
)
151 descr
+= "No testicles rub between your thighs when you walk, but you do have " + baseType
.getDickDescr
() + ".";
152 if (haveBalls
&& !haveDicks
)
153 descr
+= "You don't have a dick, but you do have " + baseType
.getTesticleDescr
() + ". <b>Because of a lack of an outlet for semen, you cannot masturbate, so your balls fill with semen, out of control.</b>";
156 descr
+= "Your body possesses " + baseType
.getVagDescr
() + ".";
158 if (!haveBalls
&& !haveDicks
&& !haveVags
)
159 descr
+= "You don't have any sexual organs, so you can't masturbate. On the bright side, you won't get horny, either.";
162 if (baseType
.breasts
.length
> 0)
163 descr
+= "You have " + baseType
.getBreastDescr
() + ", and you wear ";
165 descr
+= "You don't have any breasts, but you do have ";
166 descr
+= baseType
.getAssDescr
() + ".";
168 if (baseType
.arms
.length
> 0)
169 descr
+= "You have "+baseType
.getArmsDescr
()+", ";
171 descr
+= "You don't have any arms (<b>and therefore can't attack</b>), ";
173 if (baseType
.legs
.length
> 0) {
174 if (baseType
.arms
.length
== 0)
175 descr
+= "but you DO have ";
178 descr
+= baseType
.getLegsDescr
()+".";
180 descr
+= "and no legs (<b>so you can't dodge attacks</b>).";
183 return baseType
.gender
.doReplace
(descr
);
186 override public function getTypeName
():String
188 return baseType
.getTypeName
();
191 override public function levelUp
(firstTime
:Boolean=false):void
193 baseType
.levelUp
(firstTime
);
196 override public function recalcStrength
():void
198 baseType
.recalcStrength
();
201 public function setBaseType
(base
:Creature
):void {
203 baseType
.abilities
["instawin"] = new Instawin
();
207 override public function hasEnchantment
(name
:String):Boolean {
208 return baseType
.hasEnchantment
(name
);
211 override public function addEnchantment
(ench
:Enchantment
):String
213 return baseType
.addEnchantment
(ench
);
215 override public function notifyEnchantments
(e
:*):Boolean
217 return baseType
.notifyEnchantments
(e
);
220 override public function get vaginas
():Array { return baseType
._vaginas
; }
221 override public function set vaginas
(balls
:Array):void { baseType
._vaginas
=balls
;
224 override public function get dicks
():Array { return baseType
._dicks
; }
225 override public function set dicks
(balls
:Array):void { baseType
._dicks
=balls
;
228 override public function get assholes
():Array { return baseType
._assholes
; }
229 override public function set assholes
(balls
:Array):void { baseType
._assholes
=balls
;
232 override public function get arms
():Array { return baseType
._arms
; }
233 override public function set arms
(balls
:Array):void { baseType
._arms
=balls
;
236 override public function get breasts
():Array { return baseType
._breasts
; }
237 override public function set breasts
(balls
:Array):void { baseType
._breasts
=balls
;
240 override public function get eyes
():Array { return baseType
._eyes
; }
241 override public function set eyes
(balls
:Array):void { baseType
._eyes
=balls
;
244 override public function get legs
():Array { return baseType
._legs
; }
245 override public function set legs
(balls
:Array):void { baseType
._legs
=balls
;
249 override public function get wings
():Array { return baseType
._wings
; }
250 override public function set wings
(balls
:Array):void { baseType
._wings
=balls
;
253 public override function get strength
():int { return baseType
.strength
; }
254 public override function set strength
(value
:int):void { baseType
.strength
= value
; }
256 public override function get mana
():int { return baseType
.mana
; }
257 public override function set mana
(value
:int):void { baseType
.mana
= value
; }
259 public override function get speed
():int { return baseType
.speed
; }
260 public override function set speed
(value
:int):void { baseType
.speed
=value
; }
262 public override function get balls
():Array { return baseType
.balls
; }
263 public override function set balls
(balls
:Array):void { baseType
.balls
=balls
; }
265 public override function get intellect
():int { return baseType
.intellect
; }
266 public override function set intellect
(value
:int):void { baseType
.intellect
= value
; }
268 public override function get sensitivity
():int { return baseType
.sensitivity
; }
269 public override function set sensitivity
(value
:int):void { baseType
.sensitivity
= value
; }
271 public override function get abilities
():Object { return baseType
.abilities
; }
272 public override function set abilities
(arr
:Object):void{ baseType
.abilities
=arr
; }
274 public override function get gender
():Gender
{ return baseType
.gender
; }
275 public override function set gender
(arr
:Gender
):void { baseType
.gender
= arr
; }
277 public override function get level
():int{ return baseType
.level
; }
279 public override function get HP
():int{ return baseType
.HP
; }
280 public override function get maxHP
():int{ return baseType
.maxHP
; }
281 public override function set HP
(value
:int):void { baseType
.HP
= value
; main
.refreshStats
(); }
283 public override function get XP
():int{ return baseType
.XP
; }
284 public override function get maxXP
():int { trace
("maxXP", baseType
.maxXP
); return baseType
.maxXP
; }
285 public override function set XP
(value
:int):void { baseType
.XP
= value
; main
.refreshStats
(); }
287 override public function get gold
():int
289 return baseType
.gold
;
292 override public function set gold
(value
:int):void
294 baseType
.gold
= value
;