Example #1
0
    public CHARKIND_ATTACKINFO GetSoldierAttackInfo(int solindex)
    {
        NkSoldierInfo soldierInfo = this.GetSoldierInfo(solindex);

        if (soldierInfo == null)
        {
            return(null);
        }
        return(soldierInfo.GetAttackInfo());
    }
Example #2
0
    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);
                    }
                }
            }
        }
    }
    public void SetSeleteSol(long nSolID)
    {
        NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

        NkSoldierInfo soldierInfoFromSolID = nrCharUser.GetPersonInfo().GetSoldierInfoFromSolID(nSolID);

        if (soldierInfoFromSolID == null)
        {
            base.SetShowLayer(1, true);
            base.SetShowLayer(2, false);
        }
        else
        {
            base.SetShowLayer(1, false);
            base.SetShowLayer(2, true);
            string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("567");

            string empty = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                textFromInterface,
                "targetname",
                soldierInfoFromSolID.GetName(),
                "count",
                soldierInfoFromSolID.GetLevel().ToString()
            });

            string         text         = string.Empty;
            NrCharKindInfo charKindInfo = soldierInfoFromSolID.GetCharKindInfo();
            if (charKindInfo != null)
            {
                if (charKindInfo.GetCHARKIND_ATTACKINFO().ATTACKTYPE == soldierInfoFromSolID.GetAttackInfo().ATTACKTYPE)
                {
                    text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(charKindInfo.GetCHARKIND_INFO().SoldierSpec1);
                }
                else
                {
                    text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(charKindInfo.GetCHARKIND_INFO().SoldierSpec2);
                }
            }
            string textFromInterface2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("992");

            string empty2 = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[]
            {
                textFromInterface2,
                "type",
                text
            });

            int    num   = 0;
            string text2 = string.Empty;
            List <BATTLESKILL_TRAINING> battleSkillTrainingGroup = NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillTrainingGroup(soldierInfoFromSolID);

            if (battleSkillTrainingGroup != null)
            {
                foreach (BATTLESKILL_TRAINING current in battleSkillTrainingGroup)
                {
                    int nSkillUnique = current.m_nSkillUnique;
                    BATTLESKILL_BASE battleSkillBase = NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillBase(nSkillUnique);

                    if (battleSkillBase != null)
                    {
                        if (!soldierInfoFromSolID.IsCostumeEquip() || this.IsCostumeSkill(soldierInfoFromSolID, nSkillUnique))
                        {
                            num   = soldierInfoFromSolID.GetBattleSkillLevel(current.m_nSkillUnique);
                            text2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(battleSkillBase.m_strTextKey);

                            break;
                        }
                    }
                }
            }
            string textFromInterface3 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1292");

            string empty3 = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty3, new object[]
            {
                textFromInterface3,
                "skillname",
                text2,
                "skilllevel",
                num.ToString()
            });

            this.m_lCharName.Text  = empty;
            this.m_lCharType.Text  = empty2;
            this.m_lSkillInfo.Text = empty3;
        }
        this.GuildBossBattleUserName();
    }