Example #1
0
 public void ProcessEnterTile(CChar c, MTile t)
 {
     switch (t.Type)
     {
     case (ETile.Water): { this.CreateWaterParticles(c, t); } break;
     }
 }
Example #2
0
        public MTile GetPushTile(MTile target)
        {
            var logic = new HexTileLogic();
            var tile  = logic.GetPushTile(this, target);

            if (tile != null && tile.GetCurrentOccupant() == null)
            {
                return(tile as MTile);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        // TODO: Move particle creation to load from .xml files
        private void CreateWaterParticles(CChar c, MTile t)
        {
            var controller = new ParticleController();
            var path       = StringUtil.PathBuilder(
                CombatGUIParams.EFFECTS_PATH,
                "Water",
                CombatGUIParams.PARTICLES_EXTENSION);
            var particles = controller.CreateParticle(path);

            if (particles != null)
            {
                controller.AttachParticle(t.Controller.Handle, particles);
            }
            var script = particles.AddComponent <SDestroyByLifetime>();

            script.Init(particles, 5f);
        }
Example #4
0
        public int GetTravelCost(MTile tile)
        {
            var adjacent = this.GetAdjacent().Find(x => x.Equals(tile));

            if (adjacent != null)
            {
                double cost       = tile.GetCost();
                int    heightDiff = Math.Abs(this._height - tile.GetHeight());
                if (heightDiff > 0)
                {
                    cost *= (heightDiff + 0.5);
                }
                return((int)Math.Ceiling(cost));
            }
            else
            {
                return(int.MaxValue); // Sentinel value
            }
        }
Example #5
0
 public void SetNW(MTile t)
 {
     this._adjacent.Add(t); this._nw = t;
 }
Example #6
0
 public void SetSW(MTile t)
 {
     this._adjacent.Add(t); this._sw = t;
 }
Example #7
0
 public void SetSE(MTile t)
 {
     this._adjacent.Add(t); this._se = t;
 }
Example #8
0
 public void SetNE(MTile t)
 {
     this._adjacent.Add(t); this._ne = t;
 }
Example #9
0
        public List <MTile> GetArcTiles(MTile target)
        {
            var logic = new HexTileLogic();

            return(this.ConvertIHexToMTile(logic.GetArcTiles(this, target)));
        }