public void SetBossDead(Coop_Model_RoomExploreBossDead model) { if (bossStatus == null) { bossStatus = new ExploreBossStatus(); } bossStatus.UpdateStatus(model); }
public void SendExploreBossDead(Enemy boss, List <ExplorePlayerStatus> statuses) { Coop_Model_RoomExploreBossDead coop_Model_RoomExploreBossDead = new Coop_Model_RoomExploreBossDead(); coop_Model_RoomExploreBossDead.id = 1001; coop_Model_RoomExploreBossDead.downCount = boss.downCount; coop_Model_RoomExploreBossDead.breakIds = boss.GetBreakRegionIDList(); if (statuses != null) { int i = 0; for (int count = statuses.Count; i < count; i++) { coop_Model_RoomExploreBossDead.AddTotalDamageFromExplorePlayerStatus(statuses[i]); } } MonoBehaviourSingleton <CoopNetworkManager> .I.SendBroadcast(coop_Model_RoomExploreBossDead, true, null, null); }
public void UpdateStatus(Coop_Model_RoomExploreBossDead model) { hp = 0; isDead = true; downCount = model.downCount; if (regionWorks == null) { int num = 0; foreach (int breakId in model.breakIds) { if (num < breakId) { num = breakId; } } regionWorks = new EnemyRegionWork[num + 1]; for (int i = 0; i <= num; i++) { EnemyRegionWork enemyRegionWork = new EnemyRegionWork(); regionWorks[i] = enemyRegionWork; } } if (model.breakIds != null) { foreach (int breakId2 in model.breakIds) { if (regionWorks.Length > breakId2) { EnemyRegionWork enemyRegionWork2 = regionWorks[breakId2]; if (enemyRegionWork2 != null) { enemyRegionWork2.hp = 0; enemyRegionWork2.isBroke = true; } } } } if ((int)hpMax <= 0) { foreach (Coop_Model_RoomExploreBossDead.TotalDamage dmg in model.dmgs) { hpMax = (int)hpMax + dmg.dmg; } } }
public bool OnRecvExploreBossDead(Coop_Model_RoomExploreBossDead model) { MonoBehaviourSingleton <QuestManager> .I.SetExploreBossDead(model); if (model.dmgs != null) { foreach (Coop_Model_RoomExploreBossDead.TotalDamage dmg in model.dmgs) { MonoBehaviourSingleton <QuestManager> .I.UpdateExploreTotalDamageToBoss(dmg.uid, dmg.dmg); } } if (MonoBehaviourSingleton <QuestManager> .I.IsExploreBossMap() && MonoBehaviourSingleton <CoopManager> .I.coopMyClient.IsBattleStart()) { return(true); } CoopStage coopStage = MonoBehaviourSingleton <CoopManager> .I.coopStage; if (coopStage.bossBreakIDLists == null) { coopStage.InitBossBreakIdList(); } int index = 0; if (QuestManager.IsValidInGame()) { index = (int)MonoBehaviourSingleton <QuestManager> .I.currentQuestSeriesIndex; } MonoBehaviourSingleton <CoopManager> .I.coopStage.bossBreakIDLists[index] = model.breakIds; if (!MonoBehaviourSingleton <InGameProgress> .IsValid()) { return(false); } foreach (MissionCheckBase item in MonoBehaviourSingleton <InGameProgress> .I.missionCheck) { (item as MissionCheckDownCount)?.SetCount(model.downCount); } if (!MonoBehaviourSingleton <InGameProgress> .I.BattleComplete(false)) { MonoBehaviourSingleton <CoopManager> .I.coopStage.SetQuestClose(true); } return(true); }
protected override bool HandleCoopEvent(CoopPacket packet) { bool result = false; switch (packet.packetType) { case PACKET_TYPE.ROOM_SYNC_ALL_PORTAL_POINT: { Coop_Model_RoomSyncAllPortalPoint model16 = packet.GetModel <Coop_Model_RoomSyncAllPortalPoint>(); coopRoom.OnRecvSyncAllPortalPoint(model16); result = true; break; } case PACKET_TYPE.ROOM_UPDATE_PORTAL_POINT: { Coop_Model_RoomUpdatePortalPoint model15 = packet.GetModel <Coop_Model_RoomUpdatePortalPoint>(); coopRoom.OnRecvRoomUpdatePortalPoint(model15); result = true; break; } case PACKET_TYPE.ROOM_SYNC_EXPLORE_BOSS: { Coop_Model_RoomSyncExploreBoss model14 = packet.GetModel <Coop_Model_RoomSyncExploreBoss>(); coopRoom.OnRecvSyncExploreBoss(model14); result = true; break; } case PACKET_TYPE.ROOM_SYNC_EXPLORE_BOSS_MAP: { Coop_Model_RoomSyncExploreBossMap model13 = packet.GetModel <Coop_Model_RoomSyncExploreBossMap>(); coopRoom.OnRecvSyncExploreBossMap(model13); result = true; break; } case PACKET_TYPE.ROOM_EXPLORE_BOSS_DAMAGE: { Coop_Model_RoomExploreBossDamage model12 = packet.GetModel <Coop_Model_RoomExploreBossDamage>(); coopRoom.OnRecvExploreBossDamage(packet.fromClientId, model12); result = true; break; } case PACKET_TYPE.ROOM_EXPLORE_ALIVE: { Coop_Model_RoomExploreAlive model11 = packet.GetModel <Coop_Model_RoomExploreAlive>(); coopRoom.OnRecvExploreAlive(); result = true; break; } case PACKET_TYPE.ROOM_EXPLORE_ALIVE_REQUEST: { Coop_Model_RoomExploreAliveRequest model10 = packet.GetModel <Coop_Model_RoomExploreAliveRequest>(); coopRoom.OnRecvExploreAliveRequest(); result = true; break; } case PACKET_TYPE.ROOM_EXPLORE_BOSS_DEAD: { Coop_Model_RoomExploreBossDead model9 = packet.GetModel <Coop_Model_RoomExploreBossDead>(); result = coopRoom.OnRecvExploreBossDead(model9); break; } case PACKET_TYPE.ROOM_NOTIFY_ENCOUNTER_BOSS: { Coop_Model_RoomNotifyEncounterBoss model8 = packet.GetModel <Coop_Model_RoomNotifyEncounterBoss>(); coopRoom.OnRecvNotifyEncounterBoss(packet.fromClientId, model8); result = true; break; } case PACKET_TYPE.ROOM_SYNC_PLAYER_STATUS: { Coop_Model_RoomSyncPlayerStatus model7 = packet.GetModel <Coop_Model_RoomSyncPlayerStatus>(); coopRoom.OnRecvSyncPlayerStatus(packet.fromClientId, model7); result = true; break; } case PACKET_TYPE.ROOM_CHAT_STAMP: { Coop_Model_RoomChatStamp model6 = packet.GetModel <Coop_Model_RoomChatStamp>(); coopRoom.OnRecvChatStamp(packet.fromClientId, model6); result = true; break; } case PACKET_TYPE.ROOM_MOVE_FIELD: { Coop_Model_RoomMoveField model5 = packet.GetModel <Coop_Model_RoomMoveField>(); coopRoom.OnRecvMoveField(model5); result = true; break; } case PACKET_TYPE.ROOM_RUSH_REQUEST: { Coop_Model_RushRequest model4 = packet.GetModel <Coop_Model_RushRequest>(); coopRoom.OnRecvRushRequest(packet.fromClientId, model4); result = true; break; } case PACKET_TYPE.ROOM_RUSH_REQUESTED: { Coop_Model_RushRequested model3 = packet.GetModel <Coop_Model_RushRequested>(); coopRoom.OnRecvRushRequested(model3); result = true; break; } case PACKET_TYPE.ROOM_SYNC_DEFENSE_BATTLE: { Coop_Model_RoomSyncDefenseBattle model2 = packet.GetModel <Coop_Model_RoomSyncDefenseBattle>(); coopRoom.OnRecvSyncDefenseBattle(model2); result = true; break; } case PACKET_TYPE.ROOM_NOTIFY_TRACE_BOSS: { Coop_Model_RoomNotifyTraceBoss model = packet.GetModel <Coop_Model_RoomNotifyTraceBoss>(); coopRoom.OnRecvNotifyTraceBoss(packet.fromClientId, model); result = true; break; } } return(result); }