Example #1
0
 public void Place(ILocation targetLocation, Point targetPos)
 {
     _layer = targetLocation.Tilemap.Creatures;
     _layer.SetMappable(this, targetPos);
     Location = targetLocation;
     Position = targetPos;
 }
Example #2
0
 public void Place(ILocation targetLocation, Point targetPos)
 {
     _layer = targetLocation.Tilemap.Items;
     _layer.Set(this, targetPos);
     Location = targetLocation;
     Position = targetPos;
 }
Example #3
0
        public Player(ILocation location, Point position)
        {
            if (location != null)
            {
                _layer = location.Tilemap.Creatures;
                Place(location, position);
                location.Tilemap.UpdateFogOfWar(this);
                location.Tilemap.UpdateFieldOfVisibility(this);
            }
            else
            {
                throw new ArgumentNullException();
            }

            Name         = "hero";
            Symbol       = '@';
            MaxHealth    = 50;
            Health       = MaxHealth;
            MaxExertion  = 50;
            Lvl          = 1;
            Exp          = 0;
            ExpToNextLvl = 100;

            StartingWeapon = new WeaponType("dagger", 'D', 3, 3, 20);
            CurrentWeapon  = new Weapon(null, null, StartingWeapon, null);
        }
Example #4
0
        public HealingPlant(ILocation location, Point position)
        {
            if (location != null)
            {
                _layer = location.Tilemap.Creatures;
                Place(location, position);
            }

            Name   = "healing plant";
            Symbol = '\u2663';
        }
Example #5
0
        public Monster(ILocation location, Point position, MonsterType type, MonsterModifier modifier)
        {
            if (location != null)
            {
                _layer = location.Tilemap.Creatures;
                Place(location, position);
            }

            Type     = type;
            Modifier = modifier;
            Health   = MaxHealth;
        }
Example #6
0
        public Tilemap(ILocation location)
        {
            if (location != null)
            {
                Location = location;
            }
            else
            {
                throw new ArgumentNullException();
            }

            ToUpdate          = new List <IMappable>();
            Width             = Location.Bounds.Width;
            Height            = Location.Bounds.Height;
            Bounds            = new Rectangle(0, 0, Width, Height);
            Tiles             = new Tile[Width, Height];
            FogOfWar          = new bool[Width, Height];
            FieldOfVisibility = new bool[Width, Height];
            Creatures         = new TilemapLayer(this);
            Items             = new TilemapLayer(this);
        }