Ejemplo n.º 1
0
        public static void MomentBuff(Unit target, int grid_x, int grid_y, EffectCheckTimings chk_timing = EffectCheckTimings.Moment)
        {
            if (target == null)
            {
                return;
            }
            TrickData trickData = TrickData.SearchEffect(grid_x, grid_y);

            if (trickData == null || !trickData.checkTarget(target, false) || !trickData.checkTiming(chk_timing))
            {
                return;
            }
            trickData.actionBuff(target, chk_timing, (RandXorshift)null);
        }
Ejemplo n.º 2
0
        public static void ActionEffect(eTrickActionTiming action_timing, Unit target, int grid_x, int grid_y, RandXorshift rand, LogMapTrick log_mt = null)
        {
            if (target == null)
            {
                return;
            }
            TrickData trick_data = TrickData.SearchEffect(grid_x, grid_y);

            if (trick_data == null || !trick_data.checkTarget(target, false) || target.IsJump)
            {
                return;
            }
            if (log_mt != null)
            {
                log_mt.TrickData = trick_data;
                log_mt.TargetInfoLists.Clear();
            }
            List <Unit> target_lists = new List <Unit>();

            if (trick_data.checkTarget(target, true))
            {
                target_lists.Add(target);
            }
            TrickData.addTargetAreaEff(grid_x, grid_y, trick_data, target_lists);
            switch (action_timing)
            {
            case eTrickActionTiming.TURN_START:
                trick_data.actionEffectTurnStart(target_lists, rand);
                break;

            case eTrickActionTiming.TURN_END:
                trick_data.actionEffectTurnEnd(target_lists, rand, log_mt);
                trick_data.decActionCount();
                break;
            }
        }
Ejemplo n.º 3
0
        private static void addTargetAreaEff(int grid_x, int grid_y, TrickData trick_data, List <Unit> target_lists)
        {
            if (trick_data == null || target_lists == null)
            {
                return;
            }
            TrickParam mTrickParam = trick_data.mTrickParam;

            if (!mTrickParam.IsAreaEff)
            {
                return;
            }
            SceneBattle instance = SceneBattle.Instance;

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instance))
            {
                return;
            }
            BattleCore battle = instance.Battle;

            if (battle == null)
            {
                return;
            }
            GridMap <bool> scopeGridMap = battle.CreateScopeGridMap(grid_x, grid_y, mTrickParam.EffShape, (int)mTrickParam.EffScope, (int)mTrickParam.EffHeight);

            if (scopeGridMap == null)
            {
                return;
            }
            for (int x = 0; x < scopeGridMap.w; ++x)
            {
                for (int y = 0; y < scopeGridMap.h; ++y)
                {
                    if (scopeGridMap.get(x, y))
                    {
                        Unit unitAtGrid = battle.FindUnitAtGrid(x, y);
                        if (unitAtGrid != null && !target_lists.Contains(unitAtGrid) && trick_data.checkTarget(unitAtGrid, true))
                        {
                            target_lists.Add(unitAtGrid);
                        }
                    }
                }
            }
        }