protected override void OnSpellEffect(Spell spell)
        {
            var targetPos = (TilePosition)((TerrainEntity)spell.Targets[0][0]).Position;

            Point[] area = new Point[]
            {
                new Point(1,1),
                new Point(-1,-1),
                new Point(-1,1),
                new Point(1,-1),
                new Point(0,0),
                new Point(0,1),
                new Point(0,-1),
                new Point(1,0),
                new Point(-1,0)
            };
            TilePosition[] tileArea = area.Select(pos => new TilePosition(targetPos.Point + pos)).ToArray();
            foreach (TilePosition tile in tileArea)
            {
                var targets = this.World.GetEntities(tile).OfType<UnitEntity>();
                foreach (UnitEntity target in targets)
                    if (target.Module<HealthModule>().IsDead())
                    {
                        if (targets.Count() == 1)
                        {
                            var unit = new ZombieUnit(this.Owner);
                            spell.RunAction(new AddEntityAction(unit, tile.GenerateSpawn()));
                        }
                        spell.RunAction(new RemoveEntityAction(target));
                    }
            }
        }
Exemple #2
0
 protected override void OnSpellEffect(Spell spell)
 {
     var target = (TerrainEntity)spell.Targets[0][0];
     var unit = new BruteUnit(this.Owner);
     spell.RunAction(new AddEntityAction(unit, target.Position.GenerateSpawn()));
 }
 protected override void OnSpellEffect(Spell spell)
 {
     var target = (UnitEntity)spell.Targets[0][0];
     spell.RunAction(target,new DealDamageToUnitAction(target, 2));
 }