protected override bool InternalApply() { foreach (var actor in GetAffectedActors()) { var monster = MonsterManager.Instance.GetMonsterGrade(Dice.DiceNum, Dice.DiceFace); if (monster == null) { return(false); } actor.Die(Caster); var summon = new SummonedMonster(Fight.GetNextContextualId(), Caster.Team, Caster, monster, actor.Cell) { SummoningEffect = this }; ActionsHandler.SendGameActionFightSummonMessage(Fight.Clients, summon); Caster.AddSummon(summon); if (Effect.EffectId == EffectsEnum.Effect_KillAndSummon_2796 && Caster is CharacterFighter) { summon.SetController(Caster as CharacterFighter); } Caster.Team.AddFighter(summon); Fight.TriggerMarks(summon.Cell, summon, TriggerType.MOVE); } return(true); }
protected override bool InternalApply() { var monster = MonsterManager.Instance.GetMonsterGrade(Dice.DiceNum, Dice.DiceFace); if (monster == null) { logger.Error("Cannot summon monster {0} grade {1} (not found)", Dice.DiceNum, Dice.DiceFace); return(false); } if (monster.Template.UseSummonSlot && !Caster.CanSummon()) { return(false); } SummonedFighter summon; if (monster.Template.Id == (int)MonsterIdEnum.HARPONNEUSE_3287 || monster.Template.Id == (int)MonsterIdEnum.GARDIENNE_3288 || monster.Template.Id == (int)MonsterIdEnum.TACTIRELLE_3289) { summon = new SummonedTurret(Fight.GetNextContextualId(), Caster, monster, Spell, TargetedCell) { SummoningEffect = this } } ; else if (monster.Template.Id == (int)MonsterIdEnum.COFFRE_ANIME_285) { summon = new LivingChest(Fight.GetNextContextualId(), Caster.Team, Caster, monster, TargetedCell) { SummoningEffect = this } } ; else { summon = new SummonedMonster(Fight.GetNextContextualId(), Caster.Team, Caster, monster, TargetedCell) { SummoningEffect = this } }; if (Effect.Id == (short)EffectsEnum.Effect_SummonSlave && Caster is CharacterFighter) { summon.SetController(Caster as CharacterFighter); } ActionsHandler.SendGameActionFightSummonMessage(Fight.Clients, summon); Caster.AddSummon(summon); Caster.Team.AddFighter(summon); Fight.TriggerMarks(summon.Cell, summon, TriggerType.MOVE); return(true); } }
protected override bool InternalApply() { var summon = new SummonedClone(Fight.GetNextContextualId(), Caster, TargetedCell) { SummoningEffect = this }; Caster.AddSummon(summon); Caster.Team.AddFighter(summon); ActionsHandler.SendGameActionFightSummonMessage(Fight.Clients, summon); Fight.TriggerMarks(summon.Cell, summon, TriggerType.MOVE); return(true); }
protected override bool InternalApply() { var distance = CastPoint.ManhattanDistanceTo(TargetedPoint); var direction = CastPoint.OrientationTo(TargetedPoint, false); var isEven = (short)direction % 2 == 0; Caster.Position.Cell = TargetedCell; Caster.SetInvisibilityState(GameActionFightInvisibilityStateEnum.INVISIBLE); Fight.ForEach(entry => ActionsHandler.SendGameActionFightTeleportOnSameMapMessage(entry.Client, Caster, Caster, entry.Fighter.IsFriendlyWith(Caster) ? TargetedCell : new Cell { Id = -1 }), false); foreach (var dir in (DirectionsEnum[])Enum.GetValues(typeof(DirectionsEnum))) { if (isEven != ((short)dir % 2 == 0)) { continue; } var cell = CastPoint.GetCellInDirection(dir, (short)distance); if (cell == null) { continue; } var dstCell = Map.GetCell(cell.CellId); if (dstCell == null) { continue; } if ((!Fight.IsCellFree(dstCell) && dstCell != TargetedCell) || !dstCell.Walkable) { continue; } var summon = new SummonedImage(Fight.GetNextContextualId(), Caster, dstCell) { SummoningEffect = this }; foreach (var character in Fight.GetAllCharacters(true)) { if (direction != dir || character.Fighter == null || !character.Fighter.IsFriendlyWith(Caster)) { ActionsHandler.SendGameActionFightSummonMessage(character.Client, summon); } } Caster.AddSummon(summon); Caster.Team.AddFighter(summon); Fight.TriggerMarks(summon.Cell, summon, TriggerType.MOVE); } return(true); }