Esempio n. 1
0
 public void SetEffectData(EffectModel model)
 {
     _strBufferLabel.Init(model);
     SetCorrectionData(model);
     SetPosition(model.Command);
     _uiWithdrawalAcceptance.text = ((model.Command != BattleCommand.Ridatu) ? string.Empty : ((!model.Withdrawal) ? "失敗" : "成功"));
 }
        private bool InitCommandBuffer(object data)
        {
            if (_nCurrentShellingCnt == _listCmdActionList.Count)
            {
                OnShellingPhaseFinished();
                return(false);
            }
            _isFriendActionExit = false;
            _isEnemyActionExit  = false;
            EffectModel effectModel = BattleTaskManager.GetBattleManager().GetEffectData(_nCurrentShellingCnt);

            if (effectModel != null)
            {
                BattleTaskManager.GetPrefabFile().prodBattleCommandBuffer = ProdBattleCommandBuffer.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdBattleCommandBuffer).GetComponent <ProdBattleCommandBuffer>(), BattleTaskManager.GetStage(), effectModel, _nCurrentShellingCnt);
                BattleTaskManager.GetPrefabFile().prodBattleCommandBuffer.Play(delegate
                {
                    if (effectModel.Withdrawal)
                    {
                        BattleTaskManager.ReqPhase(BattlePhase.WithdrawalDecision);
                    }
                    else
                    {
                        CheckNextAction();
                    }
                });
            }
            else
            {
                CheckNextAction();
            }
            return(false);
        }
Esempio n. 3
0
 /// <summary>
 /// 分析技能效果 转换为处理对象
 /// </summary>
 /// <param name="key"></param>
 /// <param name="skill"></param>
 private SkillHandler[] ParseSkill(SkillModel skill)
 {
     // 创建处理对象数组 保存不同的等级
     SkillHandler[] skillHandlers = new SkillHandler[skill.LvData.Length];
     for (int i = 0; i < skillHandlers.Length; i++)
     {
         // 创建每一级的处理对象
         SkillHandler  skillHandler = new SkillHandler(skill.Id);
         EffectModel[] effects      = skill.LvData[i].EffectData;
         skillHandler.Effects = new EffectModel[effects.Length];
         // 遍历技能效果
         for (int j = 0; j < effects.Length; j++)
         {
             EffectModel effect = effects[j];
             skillHandler.Effects[j] = effect;
             // 判断效果类型 将相应的处理添加到委托里
             EffectHandler handler = SkillHandlerData.HandlerDict.ExTryGet(effect.Type);
             if (handler != null)
             {
                 skillHandler.Handler += handler;
             }
         }
         skillHandlers[i] = skillHandler;
     }
     return(skillHandlers);
 }
Esempio n. 4
0
        protected EffectViewModel(MainManager mainManager, EffectModel effectModel)
        {
            MainManager    = mainManager;
            EffectModel    = effectModel;
            EffectSettings = effectModel.Settings;

            MainManager.OnEnabledChangedEvent += MainManagerOnOnEnabledChangedEvent;
            MainManager.EffectManager.OnEffectChangedEvent += EffectManagerOnOnEffectChangedEvent;
        }
        private bool Init(EffectModel model, int nBufferCnt)
        {
            _nBufferCnt = nBufferCnt;
            ProdBufferEffect prodBufferEffect = BattleTaskManager.GetPrefabFile().prodBufferEffect;

            prodBufferEffect.Init();
            prodBufferEffect.SetEffectData(model);
            _clsEffectModel = model;
            BufferObjectDeployment();
            return(true);
        }
Esempio n. 6
0
 /// <summary>
 ///     Disables the given game
 /// </summary>
 /// <param name="activeEffect"></param>
 public void DisableGame(EffectModel activeEffect)
 {
     _logger.Debug("Disabling game: {0}", activeEffect?.Name);
     if (GetLastEffect() == null)
     {
         ClearEffect();
     }
     else
     {
         ChangeEffect(GetLastEffect());
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 移速buff/debuff
        /// </summary>
        /// <param name="room"></param>
        /// <param name="skillId"></param>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <param name="effect"></param>
        /// <returns></returns>
        public static void SpeedDouble(RoomBase <MobaPeer> room, int skillId, DtoMinion from, DtoMinion[] to,
                                       EffectModel effect)
        {
            // 增加移速
            double value = from.Speed * (effect.EffectValue - 1);

            from.Speed += value;
            // 恢复移速
            room.StartSchedule(DateTime.UtcNow.AddSeconds(effect.Duration), () =>
            {
                from.Speed -= value;
            });
        }
Esempio n. 8
0
        public static void AttakSpeedDouble(RoomBase <MobaPeer> room, int skillId, DtoMinion from, DtoMinion[] to,
                                            EffectModel effect)
        {
            double original = from.AttackInterval;

            // 增加攻速 1/攻击间隔 转换为每秒攻击次数 再乘以倍数
            from.AttackInterval = 1 / (1 / from.AttackInterval * (effect.EffectValue - 1));
            // 恢复攻速
            room.StartSchedule(DateTime.UtcNow.AddSeconds(effect.Duration), () =>
            {
                from.AttackInterval = original;
            });
        }
Esempio n. 9
0
        /// <summary>
        ///     Get all profiles matching the provided game
        /// </summary>
        /// <param name="game">The game to match</param>
        /// <param name="keyboard">The keyboard to match</param>
        /// <returns>All profiles matching the provided game</returns>
        public static List <ProfileModel> GetAll(EffectModel game, KeyboardProvider keyboard)
        {
            if (game == null)
            {
                throw new ArgumentNullException(nameof(game));
            }
            if (keyboard == null)
            {
                throw new ArgumentNullException(nameof(keyboard));
            }

            return(GetAll().Where(g => g.GameName.Equals(game.Name) && g.KeyboardSlug.Equals(keyboard.Slug)).ToList());
        }
Esempio n. 10
0
        private void DeviceManagerOnOnKeyboardChangedEvent(object sender, KeyboardChangedEventArgs e)
        {
            _deviceManager.OnKeyboardChangedEvent -= DeviceManagerOnOnKeyboardChangedEvent;
            _logger.Debug("Resuming effect change");

            var effect = _waitEffect;

            _waitEffect = null;
            var loopManager = _waitLoopManager;

            _waitLoopManager = null;

            ChangeEffect(effect, loopManager);
        }
Esempio n. 11
0
    void AddEffect()
    {
        //add effect to pokemon list
        pokemon = isPlayer ? fightManager.currentPlayerPokemon : fightManager.currentEnemyPokemon;
        EffectModel effect = pokemon.AddEffect(fightManager.ItemUsed.itemData.Effect);

        previousHealth = pokemon.CurrentHealth;

        //apply effect
        string effectDescription;

        effect.ApplyEffect(pokemon, isPlayer, out effectDescription);

        //show effect description
        fightManager.FightUIManager.SetDescription(effectDescription, CheckLife);
    }
Esempio n. 12
0
        public ProfileEditorViewModel(IEventAggregator events, MainManager mainManager, EffectModel gameModel,
                                      ProfileViewModel profileViewModel, MetroDialogService dialogService, string lastProfile,
                                      ILayerEditorVmFactory layerEditorVmFactory)
        {
            _mainManager          = mainManager;
            _gameModel            = gameModel;
            _layerEditorVmFactory = layerEditorVmFactory;

            Profiles         = new BindableCollection <ProfileModel>();
            Layers           = new BindableCollection <LayerModel>();
            ProfileViewModel = profileViewModel;
            DialogService    = dialogService;
            LastProfile      = lastProfile;

            events.Subscribe(this);

            ProfileViewModel.PropertyChanged += PropertyChangeHandler;
            PropertyChanged += PropertyChangeHandler;
            LoadProfiles();
        }
Esempio n. 13
0
        public void LoadDefaults()
        {
            PermissionSetting = new PermissionConfig()
            {
                AllowAdmins       = false,
                permissionsConfig = new PermissionsConfig()
                {
                    CommandSupport = "chear.destek",

                    CommandList = "chear.destek.liste",

                    CommandGo = "chear.destek.git",

                    CommandRemove = "chear.destek.sil",

                    CommandInformation = "chear.destek.bilgi",

                    CommandNotification = "chear.destek.bildirimler"
                }
            };

            EffectSettings = new EffectModel()
            {
                Id = 1200,
                MinimumTextLimit  = 5,
                effectSoundsModel = new EffectSoundsModel()
                {
                    GettingId = 1201,
                    SendingId = 1202
                },
                effectButtonsModel = new EffectButtonsModel()
                {
                    BugName       = "BugBildirmeButton",
                    QuestionName  = "GenelSoruButton",
                    CheatingName  = "HileSikayetButton",
                    InsultingName = "HakaretButton",
                    OtherName     = "DigerButton",
                    ReportBoxName = "ReportTextBox"
                }
            };
        }
Esempio n. 14
0
        /// <summary>
        /// Gets effect object.
        /// </summary>
        /// <param name="effect">
        /// Model of effect to get.
        /// </param>
        public async Task <EffectModel> Get(EffectModel effect)
        {
            var effectProt = new EffectProt
            {
                EffectType = effect.Type
            };

            //get an effect with a given type
            effectProt = await _protDataAccess.Get(effectProt);

            var result = new EffectModel
            {
                Damage  = effectProt.Damage,
                Defence = effectProt.Defence,
                Hp      = effectProt.HP,
                MaxHp   = effectProt.MaxHP,
                Price   = effectProt.Price,
                Type    = effectProt.EffectType,
            };

            return(result);
        }
Esempio n. 15
0
        public ProfileEditorViewModel(MainManager mainManager, EffectModel gameModel, ProfileViewModel profileViewModel,
                                      MetroDialogService dialogService, string lastProfile, ILayerEditorVmFactory layerEditorVmFactory)
        {
            _mainManager          = mainManager;
            _gameModel            = gameModel;
            _layerEditorVmFactory = layerEditorVmFactory;

            Profiles         = new BindableCollection <ProfileModel>();
            Layers           = new BindableCollection <LayerModel>();
            ProfileViewModel = profileViewModel;
            DialogService    = dialogService;
            LastProfile      = lastProfile;

            PropertyChanged += EditorStateHandler;
            ProfileViewModel.PropertyChanged += LayerSelectedHandler;
            mainManager.DeviceManager.OnKeyboardChangedEvent += DeviceManagerOnOnKeyboardChangedEvent;

            _saveTimer          = new Timer(5000);
            _saveTimer.Elapsed += ProfileSaveHandler;

            LoadProfiles();
        }
Esempio n. 16
0
 /// <summary>
 /// 分析技能效果 转换为处理对象
 /// </summary>
 /// <param name="key"></param>
 /// <param name="skill"></param>
 private SkillHandler[] ParseSkill(SkillModel skill)
 {
     // 创建处理对象数组 保存不同的等级
     SkillHandler[] skillHandlers = new SkillHandler[skill.LvData.Length];
     for (int i = 0; i < skillHandlers.Length; i++)
     {
         // 创建每一级的处理对象
         SkillHandler skillHandler = new SkillHandler();
         skillHandler.SkillId = skill.Id;
         EffectModel[] effects = skill.LvData[i].EffectData;
         skillHandler.Data = new EffectModel[effects.Length];
         // 遍历技能效果
         for (int j = 0; j < effects.Length; j++)
         {
             EffectModel effect = effects[j];
             skillHandler.Data[j] = effect;
             // 判断效果类型 将相应的处理添加到委托里
             if (effect.Type.StartsWith(SkillData.DamageType))
             {
                 DamageHandler handler = SkillHandlerData.DamageDict.ExTryGet(effect.Type);
                 if (handler != null)
                 {
                     skillHandler.Damage += handler;
                 }
             }
             else if (effect.Type.StartsWith(SkillData.EffectType))
             {
                 EffectHandler handler = SkillHandlerData.EffectDict.ExTryGet(effect.Type);
                 if (handler != null)
                 {
                     skillHandler.Effect += handler;
                 }
             }
         }
         skillHandlers[i] = skillHandler;
     }
     return(skillHandlers);
 }
Esempio n. 17
0
        /// <summary>
        /// 攻击buff/debuff
        /// </summary>
        /// <param name="room"></param>
        /// <param name="skillId"></param>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <param name="effect"></param>
        /// <returns></returns>
        public static void AttackDouble(RoomBase <MobaPeer> room, int skillId, DtoMinion from, DtoMinion[] to,
                                        EffectModel effect)
        {
            // 增加攻击
            double value = from.Attack * (effect.EffectValue - 1);

            from.Attack += (int)value;
            string timerKey = ServerConfig.GetEffectKey(from.Id, skillId, effect.Type);

            MobaServer.LogInfo(">>>>>>>>>>> value:" + value);
            MobaServer.LogInfo(">>>>>>>>>> attack : " + from.Attack);
            // 恢复攻击
            Action action = () =>
            {
                from.Attack -= (int)value;
                MobaServer.LogInfo(">>>>>>>>>> attack : " + from.Attack);
                // 移除延时处理
                TimerDict.Remove(timerKey);
            };
            Guid guid = room.Timer.AddAction(DateTime.UtcNow.AddSeconds(effect.Duration), action);

            // 添加到延时处理
            TimerDict.Add(timerKey, new TimerAction(guid, action));
        }
Esempio n. 18
0
    /// <summary>
    /// Add effect to the list
    /// </summary>
    public EffectModel AddEffect(EffectData effect)
    {
        //if no effect, return null
        if (effect == null)
        {
            return(null);
        }

        //if already in the list, remove it
        foreach (EffectModel e in ActiveEffects)
        {
            if (e.effectData == effect)
            {
                ActiveEffects.Remove(e);
                break;
            }
        }

        //remove from removed effects too
        foreach (EffectModel e in RemovedEffects)
        {
            if (e.effectData == effect)
            {
                RemovedEffects.Remove(e);
                break;
            }
        }

        //insert at start
        EffectModel newEffect = new EffectModel(effect);

        ActiveEffects.Insert(0, newEffect);

        //return added effect
        return(newEffect);
    }
Esempio n. 19
0
        private bool InitCommandBuffer(object data)
        {
            EffectModel effectModel = BattleTaskManager.GetBattleManager().GetOpeningEffectData();

            if (effectModel != null)
            {
                BattleTaskManager.GetPrefabFile().prodBattleCommandBuffer = ProdBattleCommandBuffer.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdBattleCommandBuffer).GetComponent <ProdBattleCommandBuffer>(), BattleTaskManager.GetStage(), effectModel, 0);
                BattleTaskManager.GetPrefabFile().prodBattleCommandBuffer.Play(delegate
                {
                    if (effectModel.Withdrawal)
                    {
                        OnCommandBufferFinished2Withdrawal();
                    }
                    else
                    {
                        OnCommandBufferFinished();
                    }
                });
                _prodBattleCommandSelect.DiscardAfterFadeIn().setOnComplete((Action) delegate
                {
                    Mem.DelComponentSafe(ref _prodBattleCommandSelect);
                });
            }
            else
            {
                OnCommandBufferFinished();
                Observable.TimerFrame(20, FrameCountType.EndOfFrame).Subscribe(delegate
                {
                    _prodBattleCommandSelect.DiscardAfterFadeIn().setOnComplete((Action) delegate
                    {
                        Mem.DelComponentSafe(ref _prodBattleCommandSelect);
                    });
                });
            }
            return(false);
        }
Esempio n. 20
0
 public bool Init(EffectModel model)
 {
     SetLabel(model.Command);
     return(true);
 }
Esempio n. 21
0
 private void SetCorrectionData(EffectModel model)
 {
     _listBufferEffects[0].Init(new BufferCorrection(BufferCorrectionType.AttackHitFactor, model.MeichuBuff));
     _listBufferEffects[1].Init(new BufferCorrection(BufferCorrectionType.HitAvoianceFactor, model.KaihiBuff));
     _listBufferEffects[2].Init(new BufferCorrection(BufferCorrectionType.TorpedoHitFactor, model.RaiMeichuBuff));
 }
Esempio n. 22
0
 protected EffectViewModel(MainManager mainManager, EffectModel effectModel)
 {
     MainManager = mainManager;
     EffectModel = effectModel;
 }
Esempio n. 23
0
 public EffectChangedEventArgs(EffectModel effect)
 {
     Effect = effect;
 }
Esempio n. 24
0
        public void __createCacheDataAfterCommand__()
        {
            if (_phase != 0 || !IsTakeCommand())
            {
                return;
            }
            _cache_opening_effect = null;
            if (_battleData.DayBattle.OpeningProduction != null)
            {
                _cache_opening_effect = new __EffectModel__(_battleData.DayBattle.OpeningProduction);
            }
            _cache_kouku = null;
            if (_battleData.DayBattle.AirBattle != null)
            {
                int count  = _battleData.DayBattle.AirBattle.F_PlaneFrom.Count;
                int count2 = _battleData.DayBattle.AirBattle.E_PlaneFrom.Count;
                if (count > 0 || count2 > 0)
                {
                    _cache_kouku = new KoukuuModel(_ships_f, _ships_e, _battleData.DayBattle.AirBattle);
                }
            }
            _cache_shien = null;
            if (_battleData.DayBattle.SupportAtack != null)
            {
                SupportAtack supportAtack = _battleData.DayBattle.SupportAtack;
                int          deck_Id      = supportAtack.Deck_Id;
                DeckModel    deck         = base.UserInfo.GetDeck(deck_Id);
                switch (supportAtack.SupportType)
                {
                case BattleSupportKinds.AirAtack:
                    _cache_shien = new ShienModel_Air(deck, _ships_f, _ships_e, supportAtack);
                    break;

                case BattleSupportKinds.Hougeki:
                    _cache_shien = new ShienModel_Hou(deck, _ships_f, _ships_e, supportAtack);
                    break;

                case BattleSupportKinds.Raigeki:
                    _cache_shien = new ShienModel_Rai(deck, _ships_f, _ships_e, supportAtack);
                    break;
                }
            }
            _cache_kaimaku = null;
            if (_battleData.DayBattle.OpeningAtack != null)
            {
                _cache_kaimaku = new RaigekiModel(_ships_f, _ships_e, _battleData.DayBattle.OpeningAtack);
                if (_cache_kaimaku.Count_f == 0 && _cache_kaimaku.Count_e == 0)
                {
                    _cache_kaimaku = null;
                }
            }
            _cache_cmd_actions = null;
            if (_battleData.DayBattle.FromMiddleDayBattle != null)
            {
                _cache_cmd_actions = new List <CmdActionPhaseModel>();
                Dictionary <int, ShipModel_BattleAll> ships = _GetShipsDic();
                for (int i = 0; i < _battleData.DayBattle.FromMiddleDayBattle.Count; i++)
                {
                    FromMiddleBattleDayData data = _battleData.DayBattle.FromMiddleDayBattle[i];
                    CmdActionPhaseModel     item = new CmdActionPhaseModel(data, ships);
                    _cache_cmd_actions.Add(item);
                }
                if (_cache_cmd_actions.TrueForAll((CmdActionPhaseModel model) => model == null || !model.HasAction()))
                {
                    _cache_cmd_actions = null;
                }
                else if (_cache_cmd_actions.Count == 0)
                {
                    _cache_cmd_actions = null;
                }
            }
            _cache_raigeki = null;
            if (_battleData.DayBattle.Raigeki != null)
            {
                _cache_raigeki = new RaigekiModel(_ships_f, _ships_e, _battleData.DayBattle.Raigeki);
                if (_cache_raigeki.Count_f == 0 && _cache_raigeki.Count_e == 0)
                {
                    _cache_raigeki = null;
                }
            }
            _cache_kouku2 = null;
            if (_battleData.DayBattle.AirBattle2 != null)
            {
                int count3 = _battleData.DayBattle.AirBattle2.F_PlaneFrom.Count;
                int count4 = _battleData.DayBattle.AirBattle2.E_PlaneFrom.Count;
                if (count3 > 0 || count4 > 0)
                {
                    _cache_kouku2 = new KoukuuModel(_ships_f, _ships_e, _battleData.DayBattle.AirBattle2);
                }
            }
            if (_cache_opening_effect != null)
            {
                ShipModel_Battle nextActionShip = _GetFirstActionShip(0);
                ((__EffectModel__)_cache_opening_effect).SetNextActionShip(nextActionShip);
            }
            if (_cache_cmd_actions == null)
            {
                return;
            }
            for (int j = 0; j < _cache_cmd_actions.Count; j++)
            {
                CmdActionPhaseModel cmdActionPhaseModel = _cache_cmd_actions[j];
                if (cmdActionPhaseModel != null && cmdActionPhaseModel.Effect != null)
                {
                    ShipModel_Battle nextActionShip = _GetFirstActionShip(j + 1);
                    ((__EffectModel__)cmdActionPhaseModel.Effect).SetNextActionShip(nextActionShip);
                }
            }
        }
 public void __createCacheDataAfterCommand__()
 {
     if (this._phase != CombatPhase.DAY)
     {
         return;
     }
     if (!this.IsTakeCommand())
     {
         return;
     }
     this._cache_opening_effect = null;
     if (this._battleData.DayBattle.OpeningProduction != null)
     {
         this._cache_opening_effect = new __EffectModel__(this._battleData.DayBattle.OpeningProduction);
     }
     this._cache_kouku = null;
     if (this._battleData.DayBattle.AirBattle != null)
     {
         int count  = this._battleData.DayBattle.AirBattle.F_PlaneFrom.get_Count();
         int count2 = this._battleData.DayBattle.AirBattle.E_PlaneFrom.get_Count();
         if (count > 0 || count2 > 0)
         {
             this._cache_kouku = new KoukuuModel(this._ships_f, this._ships_e, this._battleData.DayBattle.AirBattle);
         }
     }
     this._cache_shien = null;
     if (this._battleData.DayBattle.SupportAtack != null)
     {
         SupportAtack       supportAtack = this._battleData.DayBattle.SupportAtack;
         int                deck_Id      = supportAtack.Deck_Id;
         DeckModel          deck         = base.UserInfo.GetDeck(deck_Id);
         BattleSupportKinds supportType  = supportAtack.SupportType;
         if (supportType == BattleSupportKinds.AirAtack)
         {
             this._cache_shien = new ShienModel_Air(deck, this._ships_f, this._ships_e, supportAtack);
         }
         else if (supportType == BattleSupportKinds.Hougeki)
         {
             this._cache_shien = new ShienModel_Hou(deck, this._ships_f, this._ships_e, supportAtack);
         }
         else if (supportType == BattleSupportKinds.Raigeki)
         {
             this._cache_shien = new ShienModel_Rai(deck, this._ships_f, this._ships_e, supportAtack);
         }
     }
     this._cache_kaimaku = null;
     if (this._battleData.DayBattle.OpeningAtack != null)
     {
         this._cache_kaimaku = new RaigekiModel(this._ships_f, this._ships_e, this._battleData.DayBattle.OpeningAtack);
         if (this._cache_kaimaku.Count_f == 0 && this._cache_kaimaku.Count_e == 0)
         {
             this._cache_kaimaku = null;
         }
     }
     this._cache_cmd_actions = null;
     if (this._battleData.DayBattle.FromMiddleDayBattle != null)
     {
         this._cache_cmd_actions = new List <CmdActionPhaseModel>();
         Dictionary <int, ShipModel_BattleAll> ships = this._GetShipsDic();
         for (int i = 0; i < this._battleData.DayBattle.FromMiddleDayBattle.get_Count(); i++)
         {
             FromMiddleBattleDayData data = this._battleData.DayBattle.FromMiddleDayBattle.get_Item(i);
             CmdActionPhaseModel     cmdActionPhaseModel = new CmdActionPhaseModel(data, ships);
             this._cache_cmd_actions.Add(cmdActionPhaseModel);
         }
         if (this._cache_cmd_actions.TrueForAll((CmdActionPhaseModel model) => model == null || !model.HasAction()))
         {
             this._cache_cmd_actions = null;
         }
         else if (this._cache_cmd_actions.get_Count() == 0)
         {
             this._cache_cmd_actions = null;
         }
     }
     this._cache_raigeki = null;
     if (this._battleData.DayBattle.Raigeki != null)
     {
         this._cache_raigeki = new RaigekiModel(this._ships_f, this._ships_e, this._battleData.DayBattle.Raigeki);
         if (this._cache_raigeki.Count_f == 0 && this._cache_raigeki.Count_e == 0)
         {
             this._cache_raigeki = null;
         }
     }
     this._cache_kouku2 = null;
     if (this._battleData.DayBattle.AirBattle2 != null)
     {
         int count3 = this._battleData.DayBattle.AirBattle2.F_PlaneFrom.get_Count();
         int count4 = this._battleData.DayBattle.AirBattle2.E_PlaneFrom.get_Count();
         if (count3 > 0 || count4 > 0)
         {
             this._cache_kouku2 = new KoukuuModel(this._ships_f, this._ships_e, this._battleData.DayBattle.AirBattle2);
         }
     }
     if (this._cache_opening_effect != null)
     {
         ShipModel_Battle nextActionShip = this._GetFirstActionShip(0);
         ((__EffectModel__)this._cache_opening_effect).SetNextActionShip(nextActionShip);
     }
     if (this._cache_cmd_actions != null)
     {
         for (int j = 0; j < this._cache_cmd_actions.get_Count(); j++)
         {
             CmdActionPhaseModel cmdActionPhaseModel2 = this._cache_cmd_actions.get_Item(j);
             if (cmdActionPhaseModel2 != null && cmdActionPhaseModel2.Effect != null)
             {
                 ShipModel_Battle nextActionShip = this._GetFirstActionShip(j + 1);
                 ((__EffectModel__)cmdActionPhaseModel2.Effect).SetNextActionShip(nextActionShip);
             }
         }
     }
 }
Esempio n. 26
0
    public static void AttackSpeedDouble(int skillId, int level, AIBaseCtrl from, AIBaseCtrl[] to, EffectModel effect)
    {
        // 计时器键值
        string timeKey = ServerConfig.GetEffectKey(from.Model.Id, skillId, effect.Type);

        // 添加buff
        from.AddBuff(effect.Type, timeKey);
        float original = (float)from.Model.AttackInterval;

        // 增加攻速 1/攻击间隔 转换为每秒攻击次数 再乘以倍数
        from.Model.AttackInterval = 1 / (1 / from.Model.AttackInterval * effect.EffectValue);
        from.AnimeCtrl.SetAttackSpeed((float)from.Model.AttackInterval);
        // 恢复攻速
        TimerManager.Instance.AddTimer(timeKey, (float)effect.Duration, () =>
        {
            from.Model.AttackInterval = original;
            from.AnimeCtrl.SetAttackSpeed(original);
            // 移除buff
            from.RemoveBuff(effect.Type);
        });
    }
Esempio n. 27
0
    /// <summary>
    /// 移速加倍 直到时间结束
    /// </summary>
    /// <param name="skillId"></param>
    /// <param name="level"></param>
    /// <param name="from"></param>
    /// <param name="to"></param>
    /// <param name="effect"></param>
    public static void SpeedDouble(int skillId, int level, AIBaseCtrl from, AIBaseCtrl[] to, EffectModel effect)
    {
        // 计时器键值
        string timeKey = ServerConfig.GetEffectKey(from.Model.Id, skillId, effect.Type);

        // 添加buff
        from.AddBuff(effect.Type, timeKey);
        // 增加移速
        float value = from.Speed * (float)(effect.EffectValue - 1);

        from.Speed += value;
        // 恢复移速
        TimerManager.Instance.AddTimer(timeKey, (float)effect.Duration, () =>
        {
            from.Speed -= value;
            // 移除buff
            from.RemoveBuff(effect.Type);
        });
    }
Esempio n. 28
0
    /// <summary>
    /// 攻击加倍效果 直到时间结束或进行一次普通攻击
    /// </summary>
    /// <param name="skillId"></param>
    /// <param name="level"></param>
    /// <param name="from"></param>
    /// <param name="to"></param>
    /// <param name="effect"></param>
    public static void AttackDouble(int skillId, int level, AIBaseCtrl from, AIBaseCtrl[] to, EffectModel effect)
    {
        // 计时器键值
        string timeKey = ServerConfig.GetEffectKey(from.Model.Id, skillId, effect.Type);

        // 添加buff
        from.AddBuff(effect.Type, timeKey);
        // 增加攻击
        int value = from.Model.Attack * ((int)effect.EffectValue - 1);

        from.Model.Attack += value;
        // 更新ui
        if (from.Model.Id == GameData.HeroData.Id)
        {
            (UIManager.Instance.GetPanel(UIPanelType.Battle) as BattlePanel).UpdateView();
        }

        // 恢复攻击
        TimerManager.Instance.AddTimer(timeKey, (float)effect.Duration, () =>
        {
            from.Model.Attack -= value;
            // 移除buff
            from.RemoveBuff(effect.Type);
            // 更新ui
            if (from.Model.Id == GameData.HeroData.Id)
            {
                (UIManager.Instance.GetPanel(UIPanelType.Battle) as BattlePanel).UpdateView();
            }
        });
    }
Esempio n. 29
0
    /// <summary>
    /// 普通攻击
    /// </summary>
    /// <param name="skillId"></param>
    /// <param name="level"></param>
    /// <param name="from"></param>
    /// <param name="to"></param>
    /// <param name="effect"></param>
    public static void NormalAttack(int skillId, int level, AIBaseCtrl from, AIBaseCtrl[] to, EffectModel effect)
    {
        if (from == null || to == null)
        {
            return;
        }

        // 调用攻击方法
        from.AttackResponse(to);
    }
 private void SetCorrectionData(EffectModel model)
 {
     this._listBufferEffects.get_Item(0).Init(new BufferCorrection(BufferCorrectionType.AttackHitFactor, model.MeichuBuff));
     this._listBufferEffects.get_Item(1).Init(new BufferCorrection(BufferCorrectionType.HitAvoianceFactor, model.KaihiBuff));
     this._listBufferEffects.get_Item(2).Init(new BufferCorrection(BufferCorrectionType.TorpedoHitFactor, model.RaiMeichuBuff));
 }