Exemple #1
0
    // 更新战友模型相关信息
    void UpdateHelperModel()
    {
        Helper helper = User.Singleton.HelperList.LookupHelper(StageMenu.Singleton.m_curHelperGuid);

        if (null != helper)
        {
            AddHelperModel(helper.m_cardId);

            HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(helper.m_cardId);
            if (null != heroInfo)
            {
                m_helperCardName.text  = heroInfo.StrName;
                m_helperCardLevel.text = Localization.Get("CardLevel") + helper.m_cardLevel;
                RaceInfo raceInfo = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type);
                m_helperCardRace.text = raceInfo.m_name;
                OccupationInfo occInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation);
                m_helperCardOcc.text = occInfo.m_name;

                AttrRatioInfo rarityInfo = GameTable.attrRatioTableAsset.LookUp(heroInfo.Occupation, heroInfo.Rarity);
                // 计算生命值
                int hp = (int)((heroInfo.FHPMax + rarityInfo.m_hPMaxAdd * (helper.m_cardLevel - 1)) * rarityInfo.m_hpMutiply);

                m_helperHP.text = hp.ToString();


                // 计算物理攻击力
                int attack = BattleFormula.GetPhyAttack(helper.m_cardId, 1);
                m_helperPhyAttack.text = attack.ToString();

                // 魔法攻击力
                attack = BattleFormula.GetMagAttack(helper.m_cardId, 1);
                m_helperMagAttack.text = attack.ToString();
            }
        }
    }
    public static int ComputeDamangeNumberType_s(IntPtr l)
    {
        int result;

        try
        {
            ConfigDataSkillInfo skillInfo;
            LuaObject.checkType <ConfigDataSkillInfo>(l, 1, out skillInfo);
            bool isCritical;
            LuaObject.checkType(l, 2, out isCritical);
            ArmyRelationData armyRelation;
            LuaObject.checkValueType <ArmyRelationData>(l, 3, out armyRelation);
            bool isSameTeam;
            LuaObject.checkType(l, 4, out isSameTeam);
            DamageNumberType e = BattleFormula.ComputeDamangeNumberType(skillInfo, isCritical, armyRelation, isSameTeam);
            LuaObject.pushValue(l, true);
            LuaObject.pushEnum(l, (int)e);
            result = 2;
        }
        catch (Exception e2)
        {
            result = LuaObject.error(l, e2);
        }
        return(result);
    }
    public static int ComputeHealValue_s(IntPtr l)
    {
        int result;

        try
        {
            BattleProperty attackerProperty;
            LuaObject.checkType <BattleProperty>(l, 1, out attackerProperty);
            BattleProperty targetProperty;
            LuaObject.checkType <BattleProperty>(l, 2, out targetProperty);
            int skillPower;
            LuaObject.checkType(l, 3, out skillPower);
            bool isPercent;
            LuaObject.checkType(l, 4, out isPercent);
            bool useAttackAsMagic;
            LuaObject.checkType(l, 5, out useAttackAsMagic);
            Fix64 fix = BattleFormula.ComputeHealValue(attackerProperty, targetProperty, skillPower, isPercent, useAttackAsMagic);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, fix);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int ComputeBuffHealValue_s(IntPtr l)
    {
        int result;

        try
        {
            int value;
            LuaObject.checkType(l, 1, out value);
            int value2;
            LuaObject.checkType(l, 2, out value2);
            int applyerBuff_HealMul;
            LuaObject.checkType(l, 3, out applyerBuff_HealMul);
            int targetBuff_HealReceiveMul;
            LuaObject.checkType(l, 4, out targetBuff_HealReceiveMul);
            int i = BattleFormula.ComputeBuffHealValue(value, value2, applyerBuff_HealMul, targetBuff_HealReceiveMul);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, i);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    private void NextRound()
    {
        BattleFormula bf = new BattleFormula();

        if (enemyTurn == false)
        {
            enemyTurn = true;
            bf.Attack(player, monster);
            //Debug.Log(player.name + " 的 Hp : " + player.hp + monster.name + " 的 Hp : " + monster.hp);

            if (monster.Live() == false)
            {
                Debug.LogWarning(player.name + " 獲勝了!");
                CancelInvoke();
            }
        }
        else
        {
            enemyTurn = false;
            bf.Attack(monster, player);
            //Debug.Log(player.name + " 的 Hp : " + player.hp + monster.name + " 的 Hp : " + monster.hp);

            if (player.Live() == false)
            {
                Debug.LogWarning(monster.name + " 獲勝了!");
                CancelInvoke();
            }
        }
    }
    void Start()
    {
        //Player player = new Player("克蘇魯", 50, 10, 5, 3);
        //Monster monster = new Monster("派大星", 30, 6, 10, 5);
        player  = new Player("克蘇魯", 50, 9, 5, 3);
        monster = new Monster("派大星", 46, 8, 7, 5);
        LegendMonster lMonster = new LegendMonster("巨神兵", 100, 20, 10, 1);

        Debug.Log(monster.Hi() + monster.CatchState());
        Debug.Log(lMonster.Hi() + lMonster.CatchState());
        Debug.Log("............" + player.Hi() + " 準備戰鬥!");

        BattleFormula bf = new BattleFormula();

        if (bf.playerFirstHand(player, monster))
        {
            enemyTurn = true;
            bf.Attack(player, monster);
        }
        else
        {
            enemyTurn = false;
            bf.Attack(monster, player);
            //Debug.Log(player.name + " 的 Hp : " + player.hp + monster.name + " 的 Hp : " + monster.hp);
        }

        InvokeRepeating("NextRound", 0, 1);
    }
    public static int ComputeSoldierBattlePower_s(IntPtr l)
    {
        int result;

        try
        {
            ConfigDataSoldierInfo soldierInfo;
            LuaObject.checkType <ConfigDataSoldierInfo>(l, 1, out soldierInfo);
            int hp;
            LuaObject.checkType(l, 2, out hp);
            int at;
            LuaObject.checkType(l, 3, out at);
            int df;
            LuaObject.checkType(l, 4, out df);
            int magicDf;
            LuaObject.checkType(l, 5, out magicDf);
            int skillBattlePower;
            LuaObject.checkType(l, 6, out skillBattlePower);
            int i = BattleFormula.ComputeSoldierBattlePower(soldierInfo, hp, at, df, magicDf, skillBattlePower);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, i);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int ComputeSoldierBattleProperty_s(IntPtr l)
    {
        int result;

        try
        {
            int soldierBase;
            LuaObject.checkType(l, 1, out soldierBase);
            int soldierUp;
            LuaObject.checkType(l, 2, out soldierUp);
            int heroLevel;
            LuaObject.checkType(l, 3, out heroLevel);
            int heroCmdMul;
            LuaObject.checkType(l, 4, out heroCmdMul);
            int growMul;
            LuaObject.checkType(l, 5, out growMul);
            int growAdd;
            LuaObject.checkType(l, 6, out growAdd);
            int buffMul;
            LuaObject.checkType(l, 7, out buffMul);
            int buffAdd;
            LuaObject.checkType(l, 8, out buffAdd);
            int i = BattleFormula.ComputeSoldierBattleProperty(soldierBase, soldierUp, heroLevel, heroCmdMul, growMul, growAdd, buffMul, buffAdd);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, i);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #9
0
    void Start()
    {
        int c = 0;

        for (int i = 0; i < 10000; i++)
        {
            if (BattleFormula.CheckRate(rate))
            {
                c++;
            }
        }
        Debug.Log(c);
    }
Exemple #10
0
    private IEnumerator PhysicalAttack(PhysicalAttackEffect physicalAttackEffect, BattleCharacter owner, BattleCharacter target)
    {
        float damageRate = physicalAttackEffect.damageRate;
        int   damage     = BattleFormula.PhysicalAttackDamage(owner.status, target.status);

        damage = (int)(damage * damageRate);

        directionExecution.Hit();

        target.ReceiveDamage(damage);
        yield return(StartCoroutine(message.ShowAuto(target.CharacterName + "は" + damage + "うけた")));

        yield break;
    }
    public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            BattleFormula o = new BattleFormula();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public override void Use(BattleCharacter owner, BattleCharacter target)
    {
        logic = BattleDirectorController.Instance;

        //成功判定
        bool m_success = BattleFormula.CheckRate(successRate);

        if (!m_success)
        {
            //失敗メッセージを表示
            logic.Message(target.CharacterName + failureMessage);
            return;
        }

        //命中
        bool m_hit = BattleFormula.CheckRate(hitRate);

        if (!m_hit)
        {
            //Miss
            logic.Miss(target);
            return;
        }

        int damage = BattleFormula.PhysicalAttackDamage(owner.status, target.status);

        damage = Mathf.RoundToInt(damage * damageRate);

        //クリティカル
        bool m_critical = BattleFormula.CheckRate(1);

        if (m_critical)
        {
            damage = Mathf.RoundToInt(damage * 1.5f);
        }

        //成功メッセージを表示
        if (successMessage != string.Empty)
        {
            logic.Message(owner.CharacterName + successMessage);
        }
        logic.DamageLogic(target, damage, m_critical);
    }
    public static int ComputeSkillHpModifyValue_s(IntPtr l)
    {
        int result;

        try
        {
            BattleProperty attackerProperty;
            LuaObject.checkType <BattleProperty>(l, 1, out attackerProperty);
            BattleProperty targetProperty;
            LuaObject.checkType <BattleProperty>(l, 2, out targetProperty);
            ArmyRelationData armyRelation;
            LuaObject.checkValueType <ArmyRelationData>(l, 3, out armyRelation);
            ConfigDataSkillInfo skillInfo;
            LuaObject.checkType <ConfigDataSkillInfo>(l, 4, out skillInfo);
            bool isCritical;
            LuaObject.checkType(l, 5, out isCritical);
            bool isBuffForceMagicDamage;
            LuaObject.checkType(l, 6, out isBuffForceMagicDamage);
            bool isBanMeleePunish;
            LuaObject.checkType(l, 7, out isBanMeleePunish);
            ConfigDataTerrainInfo targetTerrain;
            LuaObject.checkType <ConfigDataTerrainInfo>(l, 8, out targetTerrain);
            int gridDistance;
            LuaObject.checkType(l, 9, out gridDistance);
            bool isSameTeam;
            LuaObject.checkType(l, 10, out isSameTeam);
            RandomNumber randomNumber;
            LuaObject.checkType <RandomNumber>(l, 11, out randomNumber);
            IConfigDataLoader configDataLoader;
            LuaObject.checkType <IConfigDataLoader>(l, 12, out configDataLoader);
            int i = BattleFormula.ComputeSkillHpModifyValue(attackerProperty, targetProperty, armyRelation, skillInfo, isCritical, isBuffForceMagicDamage, isBanMeleePunish, targetTerrain, gridDistance, isSameTeam, randomNumber, configDataLoader);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, i);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int ComputeBuffExchangeValue_s(IntPtr l)
    {
        int result;

        try
        {
            int value;
            LuaObject.checkType(l, 1, out value);
            int value2;
            LuaObject.checkType(l, 2, out value2);
            int i = BattleFormula.ComputeBuffExchangeValue(value, value2);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, i);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int ComputeEquipmentPropertyAdd_s(IntPtr l)
    {
        int result;

        try
        {
            int baseValue;
            LuaObject.checkType(l, 1, out baseValue);
            int levelUpValue;
            LuaObject.checkType(l, 2, out levelUpValue);
            int level;
            LuaObject.checkType(l, 3, out level);
            int i = BattleFormula.ComputeEquipmentPropertyAdd(baseValue, levelUpValue, level);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, i);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int ComputeHealFinalValue_s(IntPtr l)
    {
        int result;

        try
        {
            Fix64 baseHeal;
            LuaObject.checkValueType <Fix64>(l, 1, out baseHeal);
            int attackerBuff_HealMul;
            LuaObject.checkType(l, 2, out attackerBuff_HealMul);
            int targetBuff_HealReceiveMul;
            LuaObject.checkType(l, 3, out targetBuff_HealReceiveMul);
            Fix64 fix = BattleFormula.ComputeHealFinalValue(baseHeal, attackerBuff_HealMul, targetBuff_HealReceiveMul);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, fix);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #17
0
 // 获得当前魔法攻击力
 public int GetMagAttack()
 {
     return(BattleFormula.GetMagAttack(m_id, Level));
 }
Exemple #18
0
 public int GetHp()
 {
     return(BattleFormula.GetHp(m_id, Level));
 }
Exemple #19
0
 public bool IsAvoidance(BattleCharacter character)
 {
     //敵の回避率を参照
     return(BattleFormula.CheckRate(1));
 }
Exemple #20
0
 // 获得当前物理防御力
 public int GetPhyDefend()
 {
     return(BattleFormula.GetPhyDefend(m_id, Level));
 }
Exemple #21
0
    //更新荣誉戒指商店界面
    void UpDateRingOfHonorShopUI()
    {
        int ring = User.Singleton.UserProps.GetProperty_Int32(UserProperty.ring);

        int index = 1;

        foreach (RingOfHonorInfo item in ShopProp.Singleton.m_ringOfHonorList)
        {
            UIDragScrollView copy = GameObject.Instantiate(m_ringItem) as UIDragScrollView;
            copy.GetComponent <Parma>().m_id   = item.m_infoId;
            copy.GetComponent <Parma>().m_type = item.m_cardId;
            copy.transform.Find("Exchange").GetComponent <UIButton>().transform.Find("RingNum").GetComponent <UILabel>().text = item.m_price.ToString();
            //如果戒指数量不足 按钮为灰色
            if (ring < item.m_price)
            {
                copy.transform.Find("Exchange").GetComponent <UIButton>().enabled = false;
            }


            //设置卡牌显示 兑换时间
            RingExchangeTableInfo info = GameTable.RingExchangeTableAsset.Lookup(item.m_infoId);
            UISlider timeSlider        = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("ExchangeTime").GetComponent <UISlider>();
            timeSlider.transform.Find("StartTime").GetComponent <UILabel>().text = info.startDate + "~";
            timeSlider.transform.Find("EndTime").GetComponent <UILabel>().text   = info.endDate;

            //获得卡牌信息
            HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.m_cardId);
            //设置卡牌名字
            copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("Name").GetComponent <UILabel>().text = heroInfo.StrName;
            copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("Name").GetComponent <UILabel>().text = heroInfo.StrName;
            //设置种族职业
            UISlider typeSlider = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("TypePanel").GetComponent <UISlider>();
            typeSlider.transform.Find("Type").GetComponent <UILabel>().text = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type).m_name;
            UISlider occupationSlider = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("OccupationPanel").GetComponent <UISlider>();
            occupationSlider.transform.Find("Occupation").GetComponent <UILabel>().text = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation).m_name;
            UITexture occupationSprite = occupationSlider.transform.Find("Texture").GetComponent <UITexture>();
            //设置职业图标
            OccupationInfo occInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation);
            IconInfomation occicon = GameTable.IconInfoTableAsset.Lookup(occInfo.m_iconId);
            occupationSprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(occicon.dirName);
            //设置星级
            UISlider raritySlider = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("RarityPanel").GetComponent <UISlider>();

            RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity);
            IconInfomation     icon       = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);
            raritySlider.transform.Find("Rarity").GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);

            icon = GameTable.IconInfoTableAsset.Lookup(heroInfo.ImageId);
            //设置卡牌图片
            copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("Card").GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);


            //设置魔法攻击力
            UISlider magicSlider = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("MaxMagAttackPanel").GetComponent <UISlider>();
//            RarityRelativeInfo rarityRelative = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity);
            magicSlider.transform.Find("MagAttackNum").GetComponent <UILabel>().text = BattleFormula.GetMagAttack(item.m_cardId, 1) + "";

            UISlider phySlider = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("MaxPhyAttackPanel").GetComponent <UISlider>();
            phySlider.transform.Find("PhyAttackNum").GetComponent <UILabel>().text = BattleFormula.GetPhyAttack(item.m_cardId, 1) + "";
            //设置生命值
            UISlider hpSlider = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("MaxHpPanel").GetComponent <UISlider>();
            hpSlider.transform.Find("MaxHpNum").GetComponent <UILabel>().text = BattleFormula.GetHp(item.m_cardId, 1) + "";

            //设置卡牌编号
            UILabel cardNum = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("CardNumText").GetComponent <UILabel>();
            cardNum.text = string.Format(Localization.Get("MercenaryNum"), heroInfo.CardId);


            copy.transform.parent = FindChildComponent <UIGrid>("CardGridList").transform;
            // 设置大小
            copy.transform.localScale = m_ringItem.transform.localScale;
            copy.gameObject.SetActive(true);

            //设置主动技能
            IconInfomation iconInfo    = null;
            SkillInfo      skillInfo   = null;
            int            skillIndex  = 1;
            List <int>     skillIDList = heroInfo.GetAllSkillIDList();
            foreach (int skillId in skillIDList)
            {
                skillInfo = GameTable.SkillTableAsset.Lookup(skillId);
                if (0 == skillInfo.SkillType)
                {
                    UITexture copySkillItem = GameObject.Instantiate(m_skillItem) as UITexture;
                    copySkillItem.GetComponent <Parma>().m_id = skillId;
                    copySkillItem.transform.localScale        = m_skillItem.transform.lossyScale;
                    copySkillItem.gameObject.SetActive(true);
                    iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon);
                    copySkillItem.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);
                    copySkillItem.name        = copySkillItem.name + skillIndex;

                    copySkillItem.transform.parent = copy.transform.Find("CardDetail").transform.Find("Skill").transform;
                    EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onPress, OnShowTips);
                    EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onClick, OnHideTips);
                    //AddChildMouseClickEvent(copySkillItem.name, OnHideTips);
                }
                skillIndex++;
            }
            m_skillGirdList.Reposition();
            //设置被动技能
            int passiveIndex = 1;
            foreach (int skillId in heroInfo.PassiveSkillIDList)
            {
                skillInfo = GameTable.SkillTableAsset.Lookup(skillId);
                if (0 == skillInfo.SkillType)
                {
                    UISprite copySkillItem = m_skillItem.gameObject.AddComponent <UISprite>();
                    copySkillItem.GetComponent <Parma>().m_id = skillId;
                    copySkillItem.transform.localScale        = m_skillItem.transform.lossyScale;
                    copySkillItem.gameObject.SetActive(true);
                    iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon);
                    copySkillItem.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);
                    copySkillItem.name        = copySkillItem.name + skillIndex;

                    copySkillItem.transform.parent = copy.transform.Find("CardDetail").transform.Find("PassiveSkill").transform;
                    EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onPress, OnShowTips);
                    EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onClick, OnHideTips);
                    //AddChildMouseClickEvent(copySkillItem.name, OnHideTips);
                }
                passiveIndex++;
            }



            m_ringHonorGridList.Add(index, copy);
            AddMouseClickEvent(copy.transform.Find("Exchange").gameObject, OnBuyRingCardButton);
            index++;
        }
        for (; index < m_ringHonorGridList.Count; index++)
        {
            m_ringHonorGridList[index].gameObject.SetActive(false);
            m_ringHonorGridList[index].GetComponent <Parma>().m_id   = 0;
            m_ringHonorGridList[index].GetComponent <Parma>().m_type = 0;
        }
        m_cardGridList.Reposition();
    }
Exemple #22
0
    static public void LoadTable()
    {
        if (null == QTESequenceTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("QTESequenceTable");
            QTESequenceTableAsset = new QTESequenceTable();
            QTESequenceTableAsset.Load(asset.bytes);
        }
        if (null == FlyingItemTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("FlyingObjBehaviorTable");
            FlyingItemTableAsset = new FlyingItemTable();
            FlyingItemTableAsset.Load(asset.bytes);
        }
        if (null == StageTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("StageTable");
            StageTableAsset = new StageTable();
            StageTableAsset.Load(asset.bytes);
        }
        if (null == RoomAttrTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("RoomAttrTable");
            RoomAttrTableAsset = new RoomAttrTable();
            RoomAttrTableAsset.Load(asset.bytes);
        }
        if (null == SkillTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("SkillTable");
            SkillTableAsset = new SkillTable();
            SkillTableAsset.Load(asset.bytes);
        }
        if (null == VocationTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("VocationTable");
            VocationTableAsset = new VocationTable();
            VocationTableAsset.Load(asset.bytes);
        }
        if (null == NPCInfoTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("NPCInfoTable");
            NPCInfoTableAsset = new NPCInfoTable();
            NPCInfoTableAsset.Load(asset.bytes);
        }
        if (null == TrapInfoTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("TrapInfoTable");
            TrapInfoTableAsset = new TrapInfoTable();
            TrapInfoTableAsset.Load(asset.bytes);
        }

        if (null == HeroInfoTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("HeroInfoTable");
            HeroInfoTableAsset = new HeroInfoTable();
            HeroInfoTableAsset.Load(asset.bytes);
        }
        //if (null == AnimWeightTableAsset)
        //{
        //    TextAsset asset = GameData.LoadConfig<TextAsset>("AnimWeight");
        //    AnimWeightTableAsset = new AnimWeightTable();
        //    AnimWeightTableAsset.Load(asset.bytes);
        //}
        if (null == SceneInfoTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("SceneInfoTable");
            SceneInfoTableAsset = new SceneInfoTable();
            SceneInfoTableAsset.Load(asset.bytes);
        }
        //if (null == DungeonInfoTableAsset)
        //{
        //    TextAsset asset = GameData.LoadConfig<TextAsset>("DungeonInfoTable");
        //    DungeonInfoTableAsset = new DungeonInfoTable();
        //    DungeonInfoTableAsset.Load(asset.bytes);
        //}
        if (null == SkillResultTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("SkillResultTable");
            SkillResultTableAsset = new SkillResultTable();
            SkillResultTableAsset.Load(asset.bytes);
        }
        if (null == AnimationTownAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("AnimationTown");
            AnimationTownAsset = new AnimationTable();
            AnimationTownAsset.Load(asset.bytes);
        }
        if (null == AnimationFightAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("AnimationFight");
            AnimationFightAsset = new AnimationTable();
            AnimationFightAsset.Load(asset.bytes);
        }
        AnimationTableAsset = AnimationFightAsset;
        if (null == ActionRelationTableAsset)
        {
            TextAsset asset = GameData.LoadConfig <TextAsset>("ActionRelation");
            ActionRelationTableAsset = new ActionRelationTable();
            ActionRelationTableAsset.Load(asset.bytes);
        }
        if (null == EquipTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("EquipBaseData");
            EquipTableAsset = new EquipTable();
            EquipTableAsset.Load(obj.bytes);
        }
        if (null == ModelInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("ModelInfoTable");
            ModelInfoTableAsset = new ModelInfoTable();
            ModelInfoTableAsset.Load(obj.bytes);
        }
        if (null == WeaponInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("WeaponInfoTable");
            WeaponInfoTableAsset = new WeaponInfoTable();
            WeaponInfoTableAsset.Load(obj.bytes);
        }
        if (null == UILoadInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("UILoadInfoTable");
            UILoadInfoTableAsset = new UILoadInfoTable();
            UILoadInfoTableAsset.Load(obj.bytes);
        }
        if (null == IconTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("IconTable");
            IconTableAsset = new IconTable();
            IconTableAsset.Load(obj.bytes);
        }
        if (null == BuffTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("Buff");
            BuffTableAsset = new BuffTable();
            BuffTableAsset.Load(obj.bytes);
        }
        if (null == BuffRelationTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("BuffReplaceRelation");
            BuffRelationTableAsset = new BuffRelationTable();
            BuffRelationTableAsset.Load(obj.bytes);
        }
        if (null == BuffEffectTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("BuffEffect");
            BuffEffectTableAsset = new BuffEffectTable();
            BuffEffectTableAsset.Load(obj.bytes);
        }
        //if (null == CheckInfoTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("Checkinfo");
        //    CheckInfoTableAsset = new CheckInfoTable();
        //    CheckInfoTableAsset.Load(obj.bytes);
        //}
        //if (null == NpcSayTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("NpcSay");
        //    NpcSayTableAsset = new NpcSayTable();
        //    NpcSayTableAsset.Load(obj.bytes);
        //}

        //if (null == ShopTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("NpcShop");
        //    ShopTableAsset = new ShopTable();
        //    ShopTableAsset.Load(obj.bytes);
        //}

        if (null == MissionTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("Task");
            MissionTableAsset = new MissionTable();
            MissionTableAsset.Load(obj.bytes);
        }

        if (null == AptitudeTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("Aptitude");
            AptitudeTableAsset = new AptitudeTable();
            AptitudeTableAsset.Load(obj.bytes);
        }

        if (null == StringTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("StringTable");
            StringTableAsset = new StringTable();
            StringTableAsset.Load(obj.bytes);
        }


        if (null == WorldParamTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("WorldParamTable");
            WorldParamTableAsset = new WorldParamTable();
            WorldParamTableAsset.Load(obj.bytes);
        }
        if (null == CDTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("CDTable");
            CDTableAsset = new CDTable();
            CDTableAsset.Load(obj.bytes);
        }
        //if (null == ServerTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("Servers");
        //    ServerTableAsset = new ServerTable();
        //    ServerTableAsset.Load(obj.bytes);
        //}
        //if (null == SceneMapNumericTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("Coordinate");
        //    SceneMapNumericTableAsset = new SceneMapNumericTable();
        //    SceneMapNumericTableAsset.Load(obj.bytes);
        //}
        //if (null == EquipExpMoneyTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("EquipExpMoney");
        //    EquipExpMoneyTableAsset = new EquipExpMoneyTable();
        //    EquipExpMoneyTableAsset.Load(obj.bytes);
        //}
        //if (null == ShakeTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("Shake");
        //    ShakeTableAsset = new ShakeTable();
        //    ShakeTableAsset.Load(obj.bytes);
        //}
        //if (null == PlayerGuideTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("PlayerGuide");
        //    PlayerGuideTableAsset = new PlayerGuideTable();
        //    PlayerGuideTableAsset.Load(obj.bytes);
        //}
        //if (null == IllumeTableAsset)
        //{
        //     TextAsset obj = GameData.LoadConfig<TextAsset>("Illume");
        //     IllumeTableAsset = new IllumeTable();
        //     IllumeTableAsset.Load(obj.bytes);
        //}
        //if (null == BossTableAsset)
        //{
        //     TextAsset obj = GameData.LoadConfig<TextAsset>("BOSS");
        //     BossTableAsset = new BossTable();
        //     BossTableAsset.Load(obj.bytes);
        //}
        //if (null == SandTableInfoTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("SandTableInfoTable");
        //     SandTableInfoTableAsset = new SandTableInfoTable();
        //     SandTableInfoTableAsset.Load(obj.bytes);
        //}

        if (null == LevelUpTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("LvUpExp");
            LevelUpTableAsset = new LevelUpTable();
            LevelUpTableAsset.Load(obj.bytes);
        }

        //if (null == DungeonEventTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("DungeonEvent");
        //    DungeonEventTableAsset = new DungeonEventTable();
        //    DungeonEventTableAsset.Load(obj.bytes);
        //}

        //if (null == DungeonEventResultTableAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("DungeonEventResult");
        //    DungeonEventResultTableAsset = new DungeonEventResultTable();
        //    DungeonEventResultTableAsset.Load(obj.bytes);
        //}

        //if (null == DungeonFilesAsset)
        //{
        //    TextAsset obj = GameData.LoadConfig<TextAsset>("DungeonFiles");
        //    DungeonFilesAsset = new DungeonFiles();
        //    DungeonFilesAsset.Load(obj.bytes);
        //}
        if (null == RarityRelativeAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("RarityRelative");
            RarityRelativeAsset = new RarityRelativeTable();
            RarityRelativeAsset.Load(obj.bytes);
        }
        if (null == OccupationInfoAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("OccupationInfoTable");
            OccupationInfoAsset = new OccupationInfoTable();
            OccupationInfoAsset.Load(obj.bytes);
        }

        if (null == PlayerRandomNameAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("PlayerRandomName");
            PlayerRandomNameAsset = new PlayerRandomNameTable();
            PlayerRandomNameAsset.Load(obj.bytes);
        }

        if (null == ZoneInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("ZoneInfo");
            ZoneInfoTableAsset = new ZoneInfoTable();
            ZoneInfoTableAsset.Load(obj.bytes);
        }

        if (null == StageInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("StageInfo");
            StageInfoTableAsset = new StageInfoTable();
            StageInfoTableAsset.Load(obj.bytes);
        }

        if (null == FloorInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("FloorInfo");
            FloorInfoTableAsset = new FloorInfoTable();
            FloorInfoTableAsset.Load(obj.bytes);
        }

        if (null == ItemTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("Item");
            ItemTableAsset = new ItemTable();
            ItemTableAsset.Load(obj.bytes);
        }

        if (null == floorRankTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("FloorRankTable");
            floorRankTableAsset = new FloorRankTable();
            floorRankTableAsset.Load(obj.bytes);
        }

        if (null == ScoreParamTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("ScoreParamTable");
            ScoreParamTableAsset = new ScoreParamTable();
            ScoreParamTableAsset.Load(obj.bytes);
        }

        if (null == BagTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("BagTable");
            BagTableAsset = new BagTable();
            BagTableAsset.Load(obj.bytes);
        }

        if (null == RaceInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("RaceInfoTable");
            RaceInfoTableAsset = new RaceInfoTable();
            RaceInfoTableAsset.Load(obj.bytes);
        }

        if (null == EquipmentTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("Equipment");
            EquipmentTableAsset = new EquipmentTable();
            EquipmentTableAsset.Load(obj.bytes);
        }

        if (null == playerAttrTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("PlayerAttrTable");
            playerAttrTableAsset = new PlayerAttrTable();
            playerAttrTableAsset.Load(obj.bytes);
        }
        if (null == loadingTipsAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("LoadingTips");
            loadingTipsAsset = new LoadingTipsTable();
            loadingTipsAsset.Load(obj.bytes);
        }

        if (null == MagicStoneTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("MagicStonePrice");
            MagicStoneTableAsset = new MagicStoneTable();
            MagicStoneTableAsset.Load(obj.bytes);
        }

        if (null == RingExchangeTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("RingExchangeTable");
            RingExchangeTableAsset = new RingExchangeTable();
            RingExchangeTableAsset.Load(obj.bytes);
        }

//         if (null == SceneRoomTableAsset)
//         {
//             TextAsset obj = GameData.LoadConfig<TextAsset>("SceneRoomTable");
//             SceneRoomTableAsset = new SceneRoomTable();
//             SceneRoomTableAsset.Load(obj.bytes);
//         }
//         if (null == SceneBridgeTableAsset)
//         {
//             TextAsset obj = GameData.LoadConfig<TextAsset>("SceneBridgeTable");
//             SceneBridgeTableAsset = new SceneBridgeTable();
//             SceneBridgeTableAsset.Load(obj.bytes);
//         }
//         if (null == SceneGateTableAsset)
//         {
//             TextAsset obj = GameData.LoadConfig<TextAsset>("SceneGateTable");
//             SceneGateTableAsset = new SceneGateTable();
//             SceneGateTableAsset.Load(obj.bytes);
//         }
//         if (null == SceneTeleportTableAsset)
//         {
//             TextAsset obj = GameData.LoadConfig<TextAsset>("SceneTeleportTable");
//             SceneTeleportTableAsset = new SceneTeleportTable();
//             SceneTeleportTableAsset.Load(obj.bytes);
//         }
        if (null == MessageRespondTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("MessageRespondTable");
            MessageRespondTableAsset = new MessageRespondTable();
            MessageRespondTableAsset.Load(obj.bytes);
        }

        if (null == IconInfoTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("Icon");
            IconInfoTableAsset = new IconInfoTable();
            IconInfoTableAsset.Load(obj.bytes);
        }

        if (null == attrRatioTableAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("AttrRatioTable");
            attrRatioTableAsset = new AttrRatioTable();
            attrRatioTableAsset.Load(obj.bytes);
        }

        if (null == ComboSwordSoulAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("ComboSwordSoulTable");
            ComboSwordSoulAsset = new ComboSwordSoulTable();
            ComboSwordSoulAsset.Load(obj.bytes);
        }

        if (null == eventItemAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("EventItem");
            eventItemAsset = new EventItemTable();
            eventItemAsset.Load(obj.bytes);
        }

        if (null == gradeUpRequireAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("GradeUpRequireTable");
            gradeUpRequireAsset = new GradeUpRequireTable();
            gradeUpRequireAsset.Load(obj.bytes);
        }

        if (null == qualityRelativeAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("QualityRelativeTable");
            qualityRelativeAsset = new QualityRelativeTable();
            qualityRelativeAsset.Load(obj.bytes);
        }


        if (null == cardTypeVariationAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("CardTypeVariationTable");
            cardTypeVariationAsset = new CardTypeVariationTable();
            cardTypeVariationAsset.Load(obj.bytes);
        }

        if (null == cardLevelVariationAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("CardLevelupVariationTable");
            cardLevelVariationAsset = new CardLevelVariationTable();
            cardLevelVariationAsset.Load(obj.bytes);
        }

        if (null == yellowPointParamAsset)
        {
            TextAsset obj = GameData.LoadConfig <TextAsset>("YellowPointParam");
            yellowPointParamAsset = new YellowPointParamTable();
            yellowPointParamAsset.Load(obj.bytes);
        }
        //加载随机地图相关表数据
        LoadRandMapTableData();

        int id        = 70;
        int level     = 12;
        int yellow    = 3;
        int hp        = BattleFormula.GetHp(id, level, yellow);
        int phyAttack = BattleFormula.GetPhyAttack(id, level, yellow);
        int magAttack = BattleFormula.GetMagAttack(id, level, yellow);
        int magDefend = BattleFormula.GetMagDefend(id, level, yellow);
        int phyDEFEND = BattleFormula.GetPhyDefend(id, level, yellow);

        Debug.Log("magDefend:" + magDefend);
        Debug.Log("magAttack:" + magAttack);
        Debug.Log("phyDEFEND:" + phyDEFEND);
        Debug.Log("phyAttack:" + phyAttack);
        Debug.Log("hp:" + hp);
    }