Exemplo n.º 1
0
        public void InitFightData()
        {
            List <FightHeroInfo> fightHeroInfoList = new List <FightHeroInfo>();

            for (int i = 0, count = heros.Count; i < count; i++)
            {
                FirstFightCharacterData ffcd = heros[i];
                if (ffcd.isRole)
                {
                    PlayerInfo playerInfo = new PlayerInfo((uint)ffcd.id);
                    playerInfo.advanceLevel = ffcd.starLevel;
                    PlayerFightProtoData pfpd = new PlayerFightProtoData();
                    pfpd.posIndex  = (int)ffcd.formationPosition;
                    pfpd.attr      = new HeroAttrProtoData();
                    pfpd.attr.hp   = (int)ffcd.hp;
                    pfpd.attr.hpUp = (int)ffcd.hp;
                    FightPlayerInfo fightPlayerInfo = new FightPlayerInfo(playerInfo, pfpd);
                    FightProxy.instance.SetFightPlayerInfo(fightPlayerInfo);
                }
                else
                {
                    HeroInfo heroInfo = new HeroInfo(ffcd.id);
                    heroInfo.advanceLevel = ffcd.starLevel;
                    HeroFightProtoData hfpd = new HeroFightProtoData();
                    hfpd.posIndex  = (int)ffcd.formationPosition;
                    hfpd.attr      = new HeroAttrProtoData();
                    hfpd.attr.hp   = (int)ffcd.hp;
                    hfpd.attr.hpUp = (int)ffcd.hp;
                    FightHeroInfo fightHeroInfo = new FightHeroInfo(heroInfo, hfpd);
                    fightHeroInfoList.Add(fightHeroInfo);
                }
            }
            FightProxy.instance.SetFightHeroInfoList(fightHeroInfoList);
            List <FightHeroInfo> enemyFightHeroInfoList = new List <FightHeroInfo>();

            for (int i = 0, count = enemies.Count; i < count; i++)
            {
                FirstFightCharacterData ffcd = enemies[i];
                HeroInfo heroInfo            = new HeroInfo(ffcd.id);
                heroInfo.advanceLevel = ffcd.starLevel;
                HeroFightProtoData hfpd = new HeroFightProtoData();
                hfpd.posIndex  = (int)ffcd.formationPosition;
                hfpd.attr      = new HeroAttrProtoData();
                hfpd.attr.hp   = (int)ffcd.hp;
                hfpd.attr.hpUp = (int)ffcd.hp;
                FightHeroInfo fightHeroInfo = new FightHeroInfo(heroInfo, hfpd);
                enemyFightHeroInfoList.Add(fightHeroInfo);
            }
            FightProxy.instance.SetEnemyFightHeroInfoList(enemyFightHeroInfoList);
        }
Exemplo n.º 2
0
 public FightHeroInfo(HeroInfo heroInfo, HeroFightProtoData pveHeroProtoData)
 {
     this.heroInfo         = heroInfo;
     this.pveHeroProtoData = pveHeroProtoData;
 }
Exemplo n.º 3
0
        public void ClickSkillDisplayHandler()
        {
            //			Logic.UI.Tips.View.CommonAutoDestroyTipsView.Open("暂未开放");
            //			return;
            Dictionary <RoleAttributeType, RoleAttribute> attrDic = RoleUtil.CalcRoleAttributesDic(_roleInfo);

            if (_roleInfo is PlayerInfo)
            {
                PlayerFightProtoData pfpd = new PlayerFightProtoData();
                pfpd.posIndex        = 5;
                pfpd.attr            = new HeroAttrProtoData();
                pfpd.attr.hpUp       = pfpd.attr.hp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                pfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                pfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                pfpd.attr.normal_def = pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                pfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                pfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                pfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                pfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                pfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                pfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                pfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                pfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                pfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                pfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                pfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                pfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                pfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //pfpd.attr.hit = 100;
                FightPlayerInfo fightPlayerInfo = new FightPlayerInfo(_roleInfo as PlayerInfo, pfpd);
                FightProxy.instance.SetFightPlayerInfo(fightPlayerInfo);
                FightProxy.instance.SetFightHeroInfoList(new List <FightHeroInfo>());
            }
            else
            {
                HeroFightProtoData hfpd = new HeroFightProtoData();
                hfpd.posIndex        = 5;
                hfpd.attr            = new HeroAttrProtoData();
                hfpd.attr.hp         = hfpd.attr.hpUp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                hfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                hfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                hfpd.attr.normal_def = hfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                hfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                hfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                hfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                hfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                hfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                hfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                hfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                hfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                hfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                hfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                hfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                hfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                hfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //hfpd.attr.hit = 100;
                FightHeroInfo        fightHeroInfo = new FightHeroInfo(_roleInfo as HeroInfo, hfpd);
                List <FightHeroInfo> heroInfoList  = new List <FightHeroInfo>();
                heroInfoList.Add(fightHeroInfo);
                FightProxy.instance.SetFightHeroInfoList(heroInfoList);
            }
            //enemy
            HeroInfo           enemyHero = new HeroInfo(HeroData.HeroDataDictionary.First().Key);
            HeroFightProtoData ehfpd     = new HeroFightProtoData();

            ehfpd.posIndex = 5;
            ehfpd.attr     = new HeroAttrProtoData();
            ehfpd.attr.hp  = ehfpd.attr.hpUp = 100000;
            //			ehfpd.attr.magic_atk = 1;
            //			ehfpd.attr.normal_atk = 1;
            ehfpd.attr.speed = 25;
            FightHeroInfo        efightHeroInfo = new FightHeroInfo(enemyHero, ehfpd);
            List <FightHeroInfo> eheroInfoList  = new List <FightHeroInfo>();

            eheroInfoList.Add(efightHeroInfo);
            FightProxy.instance.SetEnemyFightHeroInfoList(eheroInfoList);


            UI.UIMgr.instance.Close(Logic.UI.EUISortingLayer.MainUI);
            FightController.instance.fightType = Logic.Enums.FightType.SkillDisplay;
            Logic.UI.LoadGame.Controller.LoadGameController.instance.SetDelayTime(0.5f, LoadFinishedCallback);
        }
Exemplo n.º 4
0
        public static void ClickIllustrationSkillDisplayHandler(LuaTable roleInfoLuaTable, bool isPlayer)
        {
            RoleInfo _roleInfo = null;

            if (isPlayer)
            {
                _roleInfo = new PlayerInfo(roleInfoLuaTable);
            }
            else
            {
                _roleInfo = new HeroInfo(roleInfoLuaTable);
            }
            Dictionary <RoleAttributeType, RoleAttribute> attrDic = RoleUtil.CalcRoleAttributesDic(_roleInfo);

            if (_roleInfo is PlayerInfo)
            {
                PlayerFightProtoData pfpd = new PlayerFightProtoData();
                pfpd.posIndex        = 5;
                pfpd.attr            = new HeroAttrProtoData();
                pfpd.attr.hpUp       = pfpd.attr.hp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                pfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                pfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                pfpd.attr.normal_def = pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                pfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                pfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                pfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                pfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                pfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                pfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                pfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                pfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                pfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                pfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                pfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                pfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                pfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //pfpd.attr.hit = 100;
                FightPlayerInfo fightPlayerInfo = new FightPlayerInfo(_roleInfo as PlayerInfo, pfpd);
                FightProxy.instance.SetFightPlayerInfo(fightPlayerInfo);
                FightProxy.instance.SetFightHeroInfoList(new List <FightHeroInfo>());
            }
            else
            {
                HeroFightProtoData hfpd = new HeroFightProtoData();
                hfpd.posIndex        = 5;
                hfpd.attr            = new HeroAttrProtoData();
                hfpd.attr.hp         = hfpd.attr.hpUp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                hfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                hfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                hfpd.attr.normal_def = hfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                hfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                hfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                hfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                hfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                hfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                hfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                hfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                hfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                hfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                hfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                hfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                hfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                hfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //hfpd.attr.hit = 100;
                FightHeroInfo        fightHeroInfo = new FightHeroInfo(_roleInfo as HeroInfo, hfpd);
                List <FightHeroInfo> heroInfoList  = new List <FightHeroInfo>();
                heroInfoList.Add(fightHeroInfo);
                FightProxy.instance.SetFightHeroInfoList(heroInfoList);
            }
            //enemy
            HeroInfo           enemyHero = new HeroInfo(HeroData.HeroDataDictionary.First().Key);
            HeroFightProtoData ehfpd     = new HeroFightProtoData();

            ehfpd.posIndex = 5;
            ehfpd.attr     = new HeroAttrProtoData();
            ehfpd.attr.hp  = ehfpd.attr.hpUp = 100000;
            //			ehfpd.attr.magic_atk = 1;
            //			ehfpd.attr.normal_atk = 1;
            ehfpd.attr.speed = 25;
            FightHeroInfo        efightHeroInfo = new FightHeroInfo(enemyHero, ehfpd);
            List <FightHeroInfo> eheroInfoList  = new List <FightHeroInfo>();

            eheroInfoList.Add(efightHeroInfo);
            FightProxy.instance.SetEnemyFightHeroInfoList(eheroInfoList);


            UIMgr.instance.CloseLayerBelow(Logic.UI.EUISortingLayer.FlyWord);
            FightController.instance.fightType = Logic.Enums.FightType.SkillDisplay;
            Logic.UI.LoadGame.Controller.LoadGameController.instance.SetDelayTime(0.5f, () =>
            {
                FightController.instance.ReadyFight();
            });
        }