public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]].units[msg.targetIndexes[0]]; var aoe = GetAffectedArea(target); foreach (var tile in aoe) { foreach (var unit in tile.units) { if (unit.silenced.current) { unit.DealCalculatedDamage(this, silenceDamage.current, damageType); } else { unit.DealCalculatedDamage(this, normalDamage.current, damageType); } if (unit.modifiers.Get <MarkOfPreyStatus>().Any()) { unit.modifiers.Get <MarkOfPreyStatus>().First().Remove(); } unit.SetTile(FindClosestTile(unit), true); } } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]]; var aoe = GetAffectedArea(target); foreach (var tile in aoe) { DoMove(tile); } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]].units[msg.targetIndexes[0]]; var aoe = GetAffectedArea(target); foreach (var tile in aoe) { foreach (var unit in tile.units) { DealDamage(unit, CalculateDamage(unit), damageType); } } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]].units[msg.targetIndexes[0]]; var aoe = GetAffectedArea(target); foreach (var tile in aoe) { foreach (var unit in tile.units) { unit.Heal(heal.current); } } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]].units[msg.targetIndexes[0]]; var aoe = GetAffectedArea(target); foreach (var tile in aoe) { foreach (var unit in tile.units) { DealDamage(unit, damage.current, damageType); Create(master, defenseReductionModifier); } } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]].units[msg.targetIndexes[0]]; var aoe = GetAffectedArea(target); foreach (var tile in aoe) { foreach (var unit in tile.units) { unit.energy.current.value += energyChange.current; unit.RefreshEnergy(); } } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]]; var modifier = (ShrapnelModifier)UnitModifier.Create(master, shrapnelModifier); modifier.target = target; modifier.creator = this; modifier.aoe = base.GetAffectedArea(target).ToList(); modifier.calculatedDamage = damage.current; modifier.damageType = damageType; CalculateDamage(ref modifier.calculatedDamage, ref modifier.damageType); })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var speed = unit.speed.current; var movement = unit.movement.current; var target = Game.grid.tiles[msg.targets[0]].units[msg.targetIndexes[0]]; var aoe = GetAffectedArea(target); var movementDamage = movement * movementDamageMultiplier.current; var totalDamage = speed * speedDamageMultiplier.current + movementDamage; foreach (var tile in aoe) { foreach (var unit in tile.units) { DealDamage(unit, totalDamage, damageType); Debug.Log("Raw Total Damage Dealt: " + totalDamage + " From Speed: " + speed * speedDamageMultiplier.current + " From Movement: " + movementDamage); } } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]]; // Central damage foreach (var unit in target.units) { DealDamage(unit, centerDamage.current, damageType); } // Outer damage var aoe = GetAffectedArea(target); foreach (var tile in aoe.Where(v => v != target)) { foreach (var unit in tile.units) { DealDamage(unit, outerDamage.current, damageType); } } })); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => { var target = Game.grid.tiles[msg.targets[0]].units[msg.targetIndexes[0]]; var aoe = GetAffectedArea(target); foreach (var tile in aoe) { foreach (var unit in tile.units) { var givenStatus = Create(unit, status); var gainedStatus = Create(this.unit, status); givenStatus.opponentStatus = gainedStatus; givenStatus.opponent = this.unit; gainedStatus.opponentStatus = givenStatus; gainedStatus.opponent = unit; gainedStatus.duelCaster = this; } } })); }
public override string CombatLog(GameEvents.Ability msg) { return($"{Lang.GetStr($"{unit.identifier}_DisplayName")} moved from {unit.tile.hex} to {new HexGrid.Hex(msg.targets.Last())}."); }
public override string CombatLog(GameEvents.Ability msg) { return($"{Lang.GetStr($"{unit.identifier}_DisplayName")} casted {Lang.GetStr($"{identifier}_DisplayName")} on {Lang.GetStr($"{Game.grid.GetTile(msg.targets[0]).units[0].identifier}_DisplayName")}."); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, (ability) => Create(unit, modifier))); }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new InstantAbilityHandler(msg, this, t => Game.rounds.NextTurn())); // 3 }
public override EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg) { return(new MoveAbilityHandler(msg, this)); }
/// <summary> Add entry to combat log. </summary> public abstract string CombatLog(GameEvents.Ability msg);
public abstract EventHandler <GameEvents.Ability> CreateHandler(GameEvents.Ability msg);
public override string CombatLog(GameEvents.Ability msg) { return($"{Lang.GetStr($"{unit.identifier}_DisplayName")} casted {Lang.GetStr($"{identifier}_DisplayName")} on some tiles..."); }