Example #1
0
        /** 反馈--战斗结束 */
        void S_BattleEnd_0x830(S_BattleEnd_0x830 msg)
        {
            War.endProto = msg;
            WarOverData overData = new WarOverData();

            foreach (ProtoRoleFightResult info in msg.fight_result)
            {
                LegionData legionData = War.GetLegionDataByRoleId(info.roleId);

                WarOverLegionData result = new WarOverLegionData();
                result.roleId     = info.roleId;
                result.legionId   = legionData.legionId;
                result.starCount  = info.star;
                result.buildCount = info.build_count;
                result.buildTotal = info.build_total;
                result.overType   = (OverType)info.end_type;

                if (result.legionId == War.ownLegionID)
                {
                    overData.overType = result.overType;
                }

                overData.legionDatas.Add(result);
            }

            War.S_Over(overData);
        }
 static int S_Over(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 1);
     Games.Module.Wars.WarOverData arg0 = (Games.Module.Wars.WarOverData)LuaScriptMgr.GetNetObject(L, 1, typeof(Games.Module.Wars.WarOverData));
     Games.Module.Wars.War.S_Over(arg0);
     return(0);
 }
Example #3
0
 public void SetWarOverData(WarOverData overData)
 {
     if (winProcessor != null)
     {
         winProcessor.SetWarOverData(overData);
     }
 }
Example #4
0
        public void Save(WarOverData overData)
        {
            if (War.recordManager == null)
            {
                return;
            }

            War.recordManager.timeLineData.overData  = overData;
            War.recordManager.timeLineData.enterData = War.enterData;
            byte[] videoData = War.recordManager.timeLineData.GetBytes();

            ProtoBattleVideoInfo video = new ProtoBattleVideoInfo();

            video.war_version = War.version;
            video.stageId     = War.enterData.stageId;
            video.video_data  = videoData;
            video.create_time = DateTimeUtils.CurrentTimestamp;
            GenerateProtoBattleVideoRoleInfoList(overData, video.fight_roles);

            Goo.save.record.SaveVideo(video, info);

            Debug.Log("War.endProto.video_type=" + War.endProto.video_type + " 视频类型: 0.普通视频   1.精选视频 ");

            // 视频类型: 0.普通视频   1.精选视频
            if (War.endProto != null && War.endProto.video_type == 1)
            {
                // 1.公会分享   2.精选上传   99.私人上传
                Upload(video, 2, -1);
            }
        }
Example #5
0
        /** 游戏结束 */
        public void ExeGameOver(WarOverData overData)
        {
//			Debug.Log ("timeLineDatastarCount WarExe ExeGameOver War.isGameing=" + War.isGameing);
            if (War.isGameing)
            {
                War.S_Over(overData);
            }
        }
 static int Save(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 2);
     Games.Module.Wars.WarRecordIO obj  = (Games.Module.Wars.WarRecordIO)LuaScriptMgr.GetNetObjectSelf(L, 1, "Games.Module.Wars.WarRecordIO");
     Games.Module.Wars.WarOverData arg0 = (Games.Module.Wars.WarOverData)LuaScriptMgr.GetNetObject(L, 2, typeof(Games.Module.Wars.WarOverData));
     obj.Save(arg0);
     return(0);
 }
Example #7
0
        /** 打开战斗结束面板 */
        internal static void OpenEndPanel()
        {
            WarOverData menuData = new WarOverData();

            menuData.overType = overType;

            if (War.isRecord)
            {
                menuData = War.timeLineData.overData;
            }
            manager.StartCoroutine(DelayOpenEndPanel(menuData));
        }
Example #8
0
        internal static WarOverData GetWarOverData()
        {
            WarOverData menuData = new WarOverData();

            menuData.overType    = overType;
            menuData.legionDatas = War.starPVPManager.GetOverData();
            menuData.stageId     = sceneData.id;
            menuData.time        = (int)War.time;
            menuData.isOverTime  = War.isOverTime;
            menuData.vsmode      = War.enterData.vsmode;
            menuData.enterData   = War.enterData;

            return(menuData);
        }
Example #9
0
        internal static IEnumerator DelayOpenEndPanel(WarOverData overData)
        {
            float t = Time.time - War.endTime;

            t = 1.5f - t;
            if (t < 0)
            {
                t = 0.001f;
            }
            yield return(new WaitForSeconds(t));

            if (overData.legionDatas.Count == 0)
            {
                overData.legionDatas = War.starPVPManager.GetOverData();
            }
            OpenEndPanel(overData);
        }
Example #10
0
    static int _CreateGames_Module_Wars_WarOverData(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            Games.Module.Wars.WarOverData obj = new Games.Module.Wars.WarOverData();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Games.Module.Wars.WarOverData.New");
        }

        return(0);
    }
Example #11
0
        public static void S_Over(WarOverData overData)
        {
            Debug.Log("S_Over");

            // 战斗流程状态
            War.processState = WarProcessState.GameOver;

            if (War.scene != null)
            {
                War.scene.MaskVisiable = true;
                manager.StartCoroutine(DelayOpenEndPanel(overData));
                War.signal.DoGameOver();
            }
            else
            {
                OpenEndPanel(overData);
            }
        }
Example #12
0
        /** 打开战斗结束面板 */
        internal static void OpenEndPanel(WarOverData menuData)
        {
            Debug.Log("====OpenEndPanel===");
            Coo.soundManager.ChangeMusicBg("none");
//            Coo.soundManager.PlaySound(isWin ? "effect_btl_win" : "effect_btl_fail");


//			Debug.Log ("timeLineDatastarCount OpenEndPanel 1=" + menuData.legionDatas[0].starCount + "  buildCount=" + menuData.legionDatas[0].buildCount);
//			Debug.Log ("timeLineDatastarCount OpenEndPanel 2=" + menuData.legionDatas[1].starCount + "  buildCount=" + menuData.legionDatas[1].buildCount);


            if (War.isRecord)
            {
                menuData          = War.timeLineData.overData;
                menuData.isRecord = true;
            }
            else
            {
                menuData.isRecord   = War.isRecord;
                menuData.stageId    = sceneData.id;
                menuData.time       = (int)War.time;
                menuData.isOverTime = War.isOverTime;
                menuData.vsmode     = War.enterData.vsmode;
                menuData.enterData  = War.enterData;
            }

            Time.timeScale = 1;

            Coo.menuManager.OpenMenu(War.enterData.overMenuId, menuData);

            //War.record.timeLineData.overData = menuData;
            //War.record.timeLineData.SaveJSON ();

            if (War.isRecord == false && War.vsmode == VSMode.PVP)
            {
                War.record.Save(menuData);
            }
        }
Example #13
0
    static int set_stageId(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WarOverData obj = (Games.Module.Wars.WarOverData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name stageId");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index stageId on a nil value");
            }
        }

        obj.stageId = (int)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
Example #14
0
    static int set_vsmode(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WarOverData obj = (Games.Module.Wars.WarOverData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name vsmode");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index vsmode on a nil value");
            }
        }

        obj.vsmode = (Games.Module.Wars.VSMode)LuaScriptMgr.GetNetObject(L, 3, typeof(Games.Module.Wars.VSMode));
        return(0);
    }
Example #15
0
    static int set_isOverTime(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WarOverData obj = (Games.Module.Wars.WarOverData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name isOverTime");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index isOverTime on a nil value");
            }
        }

        obj.isOverTime = LuaScriptMgr.GetBoolean(L, 3);
        return(0);
    }
Example #16
0
    static int set_legionDatas(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WarOverData obj = (Games.Module.Wars.WarOverData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name legionDatas");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index legionDatas on a nil value");
            }
        }

        obj.legionDatas = (List <Games.Module.Wars.WarOverLegionData>)LuaScriptMgr.GetNetObject(L, 3, typeof(List <Games.Module.Wars.WarOverLegionData>));
        return(0);
    }
Example #17
0
    static int get_enterData(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WarOverData obj = (Games.Module.Wars.WarOverData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name enterData");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index enterData on a nil value");
            }
        }

        LuaScriptMgr.PushObject(L, obj.enterData);
        return(1);
    }
Example #18
0
        public void SetWarOverData(WarOverData overData)
        {
//			for(int i = 1; i < 3; i ++)
//			{
//				bool isLose = i == 1 ? !overData.isWin : overData.isWin ;
//
//				LegionData legionData = War.GetLegionData(i);
//				if(isLose)
//				{
//					if(legionData.expeditionLeftHP<=0)
//					{
//						if(legionData.expeditionTotalHP < 6)
//						{
//							legionData.expeditionTotalHP = 0;
//						}
//					}
//				}
//
//				WarOverLegionData overLegionData = new WarOverLegionData();
//				overLegionData.legionId = legionData.legionId;
//				overLegionData.marale = Mathf.FloorToInt(legionData.mage);
//
//				if(War.isOverTime)
//				{
//					overLegionData.troops_lose = Mathf.FloorToInt(legionData.expeditionInitHP);
//					overLegionData.troops_add = 0;
//				}
//				else
//				{
//					if(legionData.expeditionTotalHP <= legionData.expeditionInitHP)
//					{
//						overLegionData.troops_lose = Mathf.FloorToInt(legionData.expeditionInitHP - legionData.expeditionTotalHP);
//					}
//					else
//					{
//						overLegionData.troops_add = Mathf.FloorToInt(legionData.expeditionTotalHP - legionData.expeditionInitHP);
//					}
//				}
//
//				List<int> fight_heros = new List<int>();
//				List<int> dead_heros = new List<int>();
//				foreach(KeyValuePair<int, HeroData> kvp in legionData.heroDatas)
//				{
//					fight_heros.Add(kvp.Value.heroId);
//
//					if(War.isOverTime)
//					{
//						dead_heros.Add(kvp.Value.heroId);
//					}
//					else
//					{
//						if(isLose)
//						{
//							dead_heros.Add(kvp.Value.heroId);
//						}
//						else if(kvp.Value.state == HeroState.Backstage)
//						{
//							dead_heros.Add(kvp.Value.heroId);
//						}
//					}
//				}
//				overLegionData.fight_heros = fight_heros.ToArray();
//				overLegionData.dead_heros = dead_heros.ToArray();
//
//
//				if(i == 1)
//				{
//					overData.attacker = overLegionData;
//				}
//				else
//				{
//					overData.defender = overLegionData;
//				}
//			}
        }
Example #19
0
        public override void SetWarOverData(WarOverData overData)
        {
//			overData.parameter = new float[]{(int)hp};
//			overData.enemySoliderAvatarId = enemySoliderAvatarId;
        }
Example #20
0
 virtual public void SetWarOverData(WarOverData overData)
 {
 }
Example #21
0
        void GenerateProtoBattleVideoRoleInfoList(WarOverData overData, List <ProtoBattleVideoRoleInfo> fight_roles)
        {
            Dictionary <int, ProtoFightRoleInfo> fightRoleInfoDict = new Dictionary <int, ProtoFightRoleInfo> ();
            int ownChangePrize = 0;

            if (War.endProto != null)
            {
                foreach (ProtoFightRoleInfo roleInfo in War.endProto.fight_roles)
                {
                    Debug.Log("roleInfo.role_info.roleId=" + roleInfo.role_info.roleId);
                    fightRoleInfoDict.Add(roleInfo.role_info.roleId, roleInfo);
                }

                ownChangePrize = War.endProto.prize - fightRoleInfoDict [War.ownLegionData.roleId].role_info.prize;
            }

            foreach (WarOverLegionData overLegionData in overData.legionDatas)
            {
                WarEnterLegionData enterLegionData = overData.enterData.GetEnterLegionData(overLegionData.legionId);

                if (enterLegionData == null)
                {
                    Debug.LogFormat("<color=red>生成录像信息时 legionId={0} enterLegionData=null</color>", overLegionData.legionId);
                    continue;
                }

                ProtoBattleVideoRoleInfo videoRole = new ProtoBattleVideoRoleInfo();
                videoRole.end_type     = (int)overLegionData.overType;
                videoRole.final_house  = overLegionData.buildCount;
                videoRole.final_star   = overLegionData.starCount;
                videoRole.change_prize = enterLegionData.legionId == War.ownLegionID ? ownChangePrize : -ownChangePrize;

                if (fightRoleInfoDict.ContainsKey(enterLegionData.roleId))
                {
                    ProtoFightRoleInfo protoFightRoleInfo = fightRoleInfoDict [enterLegionData.roleId];
                    videoRole.role_info   = protoFightRoleInfo.role_info;
                    videoRole.battle_info = protoFightRoleInfo.battle_info;
                    videoRole.league_info = protoFightRoleInfo.league_info;
                    videoRole.rank        = protoFightRoleInfo.rank;

                    protoFightRoleInfo.role_info.name = enterLegionData.name;
                }
                else
                {
                    ProtoRoleBaseInfo roleBase = videoRole.role_info = new ProtoRoleBaseInfo();
                    roleBase.roleId = enterLegionData.roleId;
                    roleBase.name   = enterLegionData.name;
                    roleBase.icon   = enterLegionData.headAvatarId;



                    ProtoRoleBattleInfo roleBattle = videoRole.battle_info = new ProtoRoleBattleInfo();
                    roleBattle.battle_soldier = enterLegionData.solider.avatarId;
                    foreach (WarEnterHeroData enterHeroData in enterLegionData.heroList)
                    {
                        ProtoCardInfo card = new ProtoCardInfo();
                        card.card_id = enterHeroData.heroId;
                        card.level   = enterHeroData.level;

                        roleBattle.battle_cards.Add(card);
                    }
                }

                fight_roles.Add(videoRole);
            }
        }
Example #22
0
        public override void SetWarOverData(WarOverData overData)
        {
//			overData.parameter = new float[]{(int)War.time};
        }