Пример #1
0
        public override int ApplyEffect(ref int DamageValue, EffectCast DamageInfos = null)
        {
            if (!DamageInfos.IsCAC)
            {
                return(-1);
            }

            DamageValue = 0; // Annihilation des dommages;

            var SubInfos  = new EffectCast(EffectEnum.PushBack, 0, 0, 0, 0, 0, 0, 0, DamageInfos.Caster, null);
            var Direction = Pathfinder.GetDirection(Target.Fight.Map, DamageInfos.Caster.CellId, Target.CellId);

            // Application du push
            return(EffectPush.ApplyPush(SubInfos, this.Target, Direction, 1, true));
        }
Пример #2
0
        public override int ApplyEffect(EffectCast CastInfos)
        {
            foreach (var Target in CastInfos.Targets)
            {
                if (Target.ObjectType == FightObjectType.OBJECT_STATIC)
                {
                    continue;
                }

                int Direction = 0;

                switch (CastInfos.EffectType)
                {
                case EffectEnum.PushBack:
                    if (Pathfinder.InLine(Target.Fight.Map, CastInfos.CellId, Target.CellId) && CastInfos.CellId != Target.CellId)
                    {
                        Direction = Pathfinder.GetDirection(Target.Fight.Map, CastInfos.CellId, Target.CellId);
                    }
                    else if (Pathfinder.InLine(Target.Fight.Map, CastInfos.Caster.CellId, Target.CellId))
                    {
                        Direction = Pathfinder.GetDirection(Target.Fight.Map, CastInfos.Caster.CellId, Target.CellId);
                    }
                    else
                    {
                        continue;
                    }
                    break;

                case EffectEnum.PushFront:
                    Direction = Pathfinder.GetDirection(Target.Fight.Map, Target.CellId, CastInfos.Caster.CellId);
                    break;
                }

                if (EffectPush.ApplyPush(CastInfos, Target, Direction, CastInfos.Value1) == -3)
                {
                    return(-3);
                }
            }

            return(-1);
        }
Пример #3
0
        public override int ApplyEffect(EffectCast CastInfos)
        {
            int  Direction = 0;
            char d         = Pathfinder.getDirBetweenTwoCase(CastInfos.Caster.CellId, CastInfos.CellId, CastInfos.Caster.Fight.Map, true);
            int  tcellID   = Pathfinder.DirToCellID(CastInfos.Caster.CellId, d, CastInfos.Caster.Fight.Map, true);

            var cell = CastInfos.Caster.Fight.GetCell(tcellID);

            Logger.Error("Cell => " + cell);
            if (cell == null)
            {
                return(-1);
            }

            if (!cell.HasGameObject(FightObjectType.OBJECT_FIGHTER))
            {
                return(-1);
            }

            var Target = cell.GetObjects <Fighter>().FirstOrDefault();

            if (Target.ObjectType == FightObjectType.OBJECT_STATIC)
            {
                return(-1);
            }
            Logger.Error("TargetName => " + Target.Name);

            Direction = Pathfinder.GetDirection(Target.Fight.Map, CastInfos.Caster.CellId, Target.CellId);
            Logger.Error("Direction => " + Direction);

            if (EffectPush.ApplyPush(CastInfos, Target, Direction, Pathfinder.GoalDistance(Target.Fight.Map, Target.CellId, CastInfos.CellId)) == -3)
            {
                return(-3);
            }

            return(-1);
        }