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)); } } }
public Spell ConstructSpell() { Spell s = new Spell(this.Owner,spells); s.Creator = this; foreach (var cond in conditionList) { s.SetTargetCondition(cond.Key, cond.Value); } return s; }
protected override void OnSpellEffect(Spell spell) { var targetPos = spell.Controller.Hero.PositionAs<TilePosition>(); Point[] area = new Point[] { new Point(1,1), new Point(-1,-1), new Point(-1,1), new Point(1,-1), 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) target.Module<AttackModule>().Damage += 2; } }
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())); }
//public Transform CreateGraphic(TextureAnimation animation) //{ // var graphicsObj = (Transform)Instantiate(UnitTemplate); // //} public void TransformCardToSpell(GameObject cardObj, Spell spell) { CardInformation cinfo = cardObj.GetComponent<CardInformation>(); this.gameobjLookUp.Remove(cinfo.Card); var components = cardObj.GetComponents<MonoBehaviour>(); foreach (var component in components) { component.enabled = false; } this.gameobjLookUp.Add(spell, cardObj); var spellinfo = cardObj.AddComponent<SpellInformation>(); spellinfo.Spell = spell; cardObj.AddComponent<GuiSpellViewHandler>(); }
public SpellGraphics CreateSpellGraphic(Spell spell) { var graphic = (SpellGraphics)GraphicFactory.ConstuctGraphic(spell.Creator.GetType()); graphic.Spell = spell; graphic.Initialize(this); return graphic; }
protected override void OnSpellEffect(Spell spell) { Owner.Draw(2); }
protected abstract void OnSpellEffect(Spell spell);
protected override void OnSpellEffect(Spell spell) { var target = (UnitEntity)spell.Targets[0][0]; spell.RunAction(target,new DealDamageToUnitAction(target, 2)); }