Fix hair, dick around with new game screen.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / creature / npc / NPC.as
blob573cc8c2b9eb233dd3494fae838889bb3aff351b
1 package org.sevenchan.dongs.creature.npc
3 import org.sevenchan.dongs.Creature;
4 import flash.net.*;
6 /**
7 * Automatically marks a class for serialization.
8 * @author Harbinger
9 */
10 public class NPC extends Creature
12 registerClassAlias("_NPC", NPC);
14 /**
15 * All NPCs in the world.
17 public static var instances:Object = {};
19 /**
20 * The unique ID of this particular NPC.
22 public var instanceID:String = "";
24 /**
25 * Create our NPC with a unique ID (AKA its fucking name).
26 * @param instanceID
28 public function NPC(instanceID:String)
30 super();
31 this.staticStats = true; // Because we're not autogen'd.
32 if (instances.hasOwnProperty(instanceID))
33 throw Error("YOU FUCKING IDIOT, " + instanceID + " IS ALREADY TAKEN");
34 this.instanceID = instanceID;
37 /**
38 * Store the NPC in the global community.
40 public final function save():void
42 onSave();
43 instances[instanceID] = this;
46 /**
47 * Load NPC from the global community.
49 public final function load():void
51 if (instances.hasOwnProperty(instanceID))
53 _abilities = (instances[instanceID] as Creature)._abilities;
54 _arms = (instances[instanceID] as Creature)._arms;
55 _assholes = (instances[instanceID] as Creature)._assholes;
56 _balls = (instances[instanceID] as Creature)._balls;
57 _breasts = (instances[instanceID] as Creature)._breasts;
58 _dicks = (instances[instanceID] as Creature)._dicks;
59 _eyes = (instances[instanceID] as Creature)._eyes;
60 _gender = (instances[instanceID] as Creature)._gender;
61 _gold = (instances[instanceID] as Creature)._gold;
62 _HP = (instances[instanceID] as Creature)._HP;
63 _intellect = (instances[instanceID] as Creature)._intellect;
64 _legs = (instances[instanceID] as Creature)._legs;
65 _level = (instances[instanceID] as Creature)._level;
66 _lust = (instances[instanceID] as Creature)._lust;
67 _mana = (instances[instanceID] as Creature)._mana;
68 _sensitivity = (instances[instanceID] as Creature)._sensitivity;
69 _speed = (instances[instanceID] as Creature)._speed;
70 _strength = (instances[instanceID] as Creature)._strength;
71 _vaginas = (instances[instanceID] as Creature)._vaginas;
72 _wings = (instances[instanceID] as Creature)._wings;
73 _XP = (instances[instanceID] as Creature)._XP;
74 build = (instances[instanceID] as Creature).build;
75 customized = (instances[instanceID] as Creature).customized;
76 enchantments = (instances[instanceID] as Creature).enchantments;
77 explored = (instances[instanceID] as Creature).explored;
78 hair = (instances[instanceID] as Creature).hair;
79 height = (instances[instanceID] as Creature).height;
80 inventory = (instances[instanceID] as Creature).inventory;
81 material = (instances[instanceID] as Creature).material;
82 ownName = (instances[instanceID] as Creature).ownName;
83 skin = (instances[instanceID] as Creature).skin;
85 else
86 onNewNPC();
87 onLoad(instances.hasOwnProperty(instanceID)?(instances[instanceID] as NPC):null);
90 /**
91 * The NPC is brand new, hasn't been stored yet.
93 public function onNewNPC():void
97 /**
98 * The NPC has been loaded (onNewNPC() called first)
99 * npc is null if NPC is new.
101 public function onLoad(npc:NPC):void
106 * About to save the NPC
108 public function onSave():void