public int[] GetIndex(E_ATTACK_GRID_TYPE type, int Start, int xMax, int yMax) { Vector2 index = NrGridData.Convert(Start, xMax); NrGridData grid = this.GetGrid((int)type); if (grid != null) { return(grid.GetIndex(index, xMax, yMax)); } return(null); }
public void ActiveBattleSkillGrid(eBATTLE_ALLY Ally, short nStartPosIndex, int TargetIndex, int skillUnique) { NkBattleChar currentSelectChar = Battle.BATTLE.GetCurrentSelectChar(); if (currentSelectChar != null) { if (this.preTargetIndex == TargetIndex) { return; } this.preTargetIndex = TargetIndex; BATTLESKILL_BASE battleSkillBase = NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillBase(skillUnique); if (battleSkillBase == null) { return; } E_ATTACK_GRID_TYPE nSkillGridType = (E_ATTACK_GRID_TYPE)battleSkillBase.m_nSkillGridType; Vector2 size = this.GetSize(Ally, nStartPosIndex); int xMax = (int)size.x; int yMax = (int)size.y; int[] index = BASE_BATTLE_GridData_Manager.GetInstance().GetIndex(nSkillGridType, TargetIndex, xMax, yMax); if (index != null) { List <NmBattleGrid> battleGridList = this.GetBattleGridList(Ally, nStartPosIndex); foreach (NmBattleGrid current in battleGridList) { if (current.BUID != -1) { current.SetMode(E_RENDER_MODE.NORMAL); } else { current.SetMode(E_RENDER_MODE.DISABLE); } } int[] array = index; for (int i = 0; i < array.Length; i++) { int index2 = array[i]; if (NrGridData.IndexAccessAble(index2, xMax, yMax)) { battleGridList[index2].SetMode(E_RENDER_MODE.ATTACK); } } } } }
public void ActiveAttack(eBATTLE_ALLY Ally, short nStartPosIndex, int TargetIndex, NkBattleChar pkTarget) { NkBattleChar currentSelectChar = Battle.BATTLE.GetCurrentSelectChar(); if (currentSelectChar != null) { if (this.preTargetIndex == TargetIndex) { return; } this.preTargetIndex = TargetIndex; short num = 0; if (pkTarget != null && currentSelectChar.CanAttack(pkTarget, (short)TargetIndex, Vector3.zero, ref num) == -1) { return; } NkSoldierInfo soldierInfo = currentSelectChar.GetSoldierInfo(); E_ATTACK_GRID_TYPE aTTACKGRID = (E_ATTACK_GRID_TYPE)soldierInfo.GetAttackInfo().ATTACKGRID; Vector2 size = this.GetSize(Ally, nStartPosIndex); int xMax = (int)size.x; int yMax = (int)size.y; int[] index = BASE_BATTLE_GridData_Manager.GetInstance().GetIndex(aTTACKGRID, TargetIndex, xMax, yMax); if (index != null) { List <NmBattleGrid> battleGridList = this.GetBattleGridList(Ally, nStartPosIndex); foreach (NmBattleGrid current in battleGridList) { if (current.BUID != -1) { current.SetMode(E_RENDER_MODE.NORMAL); } else { current.SetMode(E_RENDER_MODE.DISABLE); } } int[] array = index; for (int i = 0; i < array.Length; i++) { int index2 = array[i]; if (NrGridData.IndexAccessAble(index2, xMax, yMax)) { battleGridList[index2].SetMode(E_RENDER_MODE.ATTACK); } } } } }