Esempio n. 1
0
 public Entity(Map.Nod start, Map.Spawn pSpawn, byte type)
 {
     this.mySpawn    = pSpawn;
     this.myNode     = start;
     this.entityType = type;
     this.uniqueID   = Interlocked.Increment(ref nextID);
 }
Esempio n. 2
0
 public Entity(Map.Nod start, Map.Spawn pSpawn, byte type, int id)
 {
     this.mySpawn    = pSpawn;
     this.myNode     = start;
     this.entityType = type;
     this.uniqueID   = id;
 }
Esempio n. 3
0
 public Mob(Map.Nod start, Map.Spawn pSpawn, byte type) : base(start, pSpawn, type)
 {
     Map.Nod nod = GameServer.world.GetPositionAtTile(start.X, start.Y);
     PosX      = (int)nod.X;
     PosY      = (int)nod.Y;
     cSM       = new CoreStateMachine();
     ActHealth = 1000;
 }
Esempio n. 4
0
 public GameEntity(Map.Nod start, Map.Spawn spawn)
     : base(start, spawn)
 {
     //this.uniqueID = World.GetID();
     this.charPosition    = new Map.Nod();
     this.charStats       = new Stats();
     this.charResistances = new Resistances();
 }
Esempio n. 5
0
 public Entity(Map.Nod start, Map.Spawn pSpawn, byte type)
 {
     this.mySpawn = pSpawn;
     this.myNode  = start;
     if (myNode != null)
     {
         this.oldNode = new Map.Nod(myNode.X, myNode.Y);
     }
     else
     {
         this.oldNode = new Map.Nod(0, 0);
     }
     this.entityType = type;
     this.uniqueID   = Interlocked.Increment(ref nextID);
 }
Esempio n. 6
0
 public Entity(Map.Nod start, Map.Spawn pSpawn, byte type, int id)
 {
     this.mySpawn = pSpawn;
     this.myNode  = start;
     if (myNode != null)
     {
         this.oldNode = new Map.Nod(myNode.X, myNode.Y);
     }
     else
     {
         this.oldNode = new Map.Nod(0, 0);
     }
     this.entityType = type;
     this.uniqueID   = id;
 }
Esempio n. 7
0
        public MapData LoadMap(string map, World world)
        {
            this.mapData = new Bitmap(map + ".png");
            md           = new MapData(this.mapData, world);
            IniFile configMapFile = new IniFile(map + ".ini");

            Map.SpawnArea sa;
            Map.Spawn     sp;
            int           secX     = 0;
            int           secY     = 0;
            int           secW     = 0;
            int           secH     = 0;
            int           mCount   = 0;
            int           mType    = 0;
            int           mRespawn = 0;

            foreach (string sec in configMapFile.Sections)
            {
                secX     = configMapFile.GetInteger(sec, "spawn_x", 0);
                secY     = configMapFile.GetInteger(sec, "spawn_y", 0);
                secW     = configMapFile.GetInteger(sec, "spawn_width", 0);
                secH     = configMapFile.GetInteger(sec, "spawn_height", 0);
                mCount   = configMapFile.GetInteger(sec, "mob_count", 0);
                mType    = configMapFile.GetInteger(sec, "mob_type", 0);
                mRespawn = configMapFile.GetInteger(sec, "mob_resp_time", 0);
                if (secX < 0 || secX > md.realX || secY < 0 || secY > md.realY || secW == 0 || secH == 0 || mCount == 0)
                {
                    Output.WriteLine("Error initialize spawn: " + sec);
                    Output.WriteLine("     X: " + secX.ToString() + " Y: " + secY.ToString() + " W: " + secW.ToString() + " H: " + secH.ToString() + " Type: " + mType.ToString() + " Count: " + mCount.ToString());
                }
                else
                {
                    sa = new Map.SpawnArea(secX, secY, secW, secH, md.mapa);
                    sp = new Map.Spawn(mCount, mType, mRespawn, sa, world);
                    spawns.Add(sp);
                }
            }
            return(md);
        }
Esempio n. 8
0
 public Entity(Map.Nod start, Map.Spawn spawn)
 {
     this.start    = start;
     this.spawn    = spawn;
     this.uniqueID = Interlocked.Increment(ref nextID);
 }