示例#1
0
        private void SetupTransition()
        {
            Service.UXController.HUD.Visible = false;
            if (this.battleData.BattleType == BattleType.PveDefend)
            {
                List <IAssetVO> battleProjectileAssets = ProjectileUtils.GetBattleProjectileAssets(Service.CurrentPlayer.Map, this.battleData.BattleVO, this.battleData.AttackerDeployableData, null, null, null, null, this.battleData.AttackerEquipment, this.battleData.DefenderEquipment);
                Service.SpecialAttackController.PreloadSpecialAttackMiscAssets();
                Service.ProjectileViewManager.LoadProjectileAssetsAndCreatePools(battleProjectileAssets);
                Service.GameStateMachine.SetState(this);
                this.OnWorldLoadComplete();
                Service.EventManager.SendEvent(EventId.BattleLoadedForDefend, this.battleData);
                this.OnWorldTransitionComplete();
                return;
            }
            IMapDataLoader mapDataLoader;

            if (this.battleData.PvpTarget != null)
            {
                mapDataLoader = Service.PvpMapDataLoader;
                ((PvpMapDataLoader)mapDataLoader).Initialize(this.battleData);
            }
            else if (this.battleData.MemberWarData != null)
            {
                mapDataLoader = Service.WarBaseMapDataLoader;
                ((WarBaseMapDataLoader)mapDataLoader).Initialize(this.battleData);
            }
            else
            {
                mapDataLoader = Service.NpcMapDataLoader;
                bool isPveBuffBase = this.battleData.BattleType == BattleType.PveBuffBase;
                ((NpcMapDataLoader)mapDataLoader).Initialize(this.battleData, isPveBuffBase);
            }
            EventManager eventManager = Service.EventManager;

            eventManager.RegisterObserver(this, EventId.MapDataProcessingStart, EventPriority.Default);
            eventManager.RegisterObserver(this, EventId.WorldLoadComplete, EventPriority.Default);
            WorldTransitioner worldTransitioner = Service.WorldTransitioner;

            if (worldTransitioner.IsSoftWiping())
            {
                worldTransitioner.ContinueWipe(this, mapDataLoader, new TransitionCompleteDelegate(this.OnWorldTransitionComplete));
            }
            else if (this.battleData.BattleType == BattleType.PvpAttackSquadWar || this.battleData.BattleType == BattleType.PveBuffBase)
            {
                worldTransitioner.StartTransition(new WarboardToWarbaseTransition(this, mapDataLoader, new TransitionCompleteDelegate(this.OnWorldTransitionComplete), false, false));
            }
            else
            {
                worldTransitioner.StartTransition(new WorldToWorldTransition(this, mapDataLoader, new TransitionCompleteDelegate(this.OnWorldTransitionComplete), false, false));
            }
        }
示例#2
0
        public List <IAssetVO> GetProjectilePreloads(Map map)
        {
            List <string> attackerWarBuffs = null;
            List <string> defenderWarBuffs = null;
            Squad         currentSquad     = Service.SquadController.StateManager.GetCurrentSquad();

            if (currentSquad != null)
            {
                SquadWarManager warManager = Service.SquadController.WarManager;
                attackerWarBuffs = warManager.GetBuffBasesOwnedBySquad(currentSquad.SquadID);
                defenderWarBuffs = warManager.GetBuffBasesOwnedBySquad(this.squadId);
            }
            return(ProjectileUtils.GetBattleProjectileAssets(map, null, null, attackerWarBuffs, defenderWarBuffs, this.defenderSquadTroops, this.defenderChampions, this.battleData.AttackerEquipment, this.battleData.DefenderEquipment));
        }
示例#3
0
        public List <IAssetVO> GetProjectilePreloads(Map map)
        {
            List <string> attackerWarBuffs = null;
            List <string> defenderWarBuffs = null;

            if (this.isPveBuffBase)
            {
                Squad currentSquad = Service.Get <SquadController>().StateManager.GetCurrentSquad();
                if (currentSquad != null)
                {
                    SquadWarManager warManager = Service.Get <SquadController>().WarManager;
                    attackerWarBuffs = warManager.GetBuffBasesOwnedBySquad(currentSquad.SquadID);
                }
            }
            List <string> attackerEquipment = null;
            List <string> defenderEquipment = null;

            if (this.battleData != null)
            {
                attackerEquipment = this.battleData.AttackerEquipment;
                defenderEquipment = this.battleData.DefenderEquipment;
            }
            return(ProjectileUtils.GetBattleProjectileAssets(map, this.battle, null, attackerWarBuffs, defenderWarBuffs, null, null, attackerEquipment, defenderEquipment));
        }
示例#4
0
 public List <IAssetVO> GetProjectilePreloads(Map map)
 {
     return(ProjectileUtils.GetBattleProjectileAssets(map, null, null, null, null, this.pvpTarget.GuildDonatedTroops, this.pvpTarget.Champions, this.battleData.AttackerEquipment, this.pvpTarget.Equipment));
 }