private void RegisterCallbacks()
 {
     this.ClearCallbacks();
     this._playerDeath   = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.OnHeroDead), this.UniqueId);
     this._playerRebirth = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRebirthAgain, null, new TriggerAction(this.OnHeroRelive), this.UniqueId);
     MobaMessageManager.RegistMessage((ClientMsg)25043, new MobaMessageFunc(this.OnHeroEquipChanged));
 }
 public override void InitTargets()
 {
     base.InitTargets();
     this.m_Owner.AddSearchingCallback(new Callback(this.OnSearchPath), new Callback(this.OnStopPath));
     this.buffSpawnTrigger   = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSpawn, null, new TriggerAction(this.SpawnBuffTarget), this.m_Owner.teamType, "BuffItem");
     this.buffDespawnTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDespawn, null, new TriggerAction(this.DespawnBuffTarget), this.m_Owner.teamType, "BuffItem");
 }
    public void StartAchieve()
    {
        if (!this._isActive)
        {
            return;
        }
        AchieveManager._mGameState = GamePhaseState.Phase1;
        Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.BattlePhase1);

        Units player = PlayerControlMgr.Instance.GetPlayer();

        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.KillHero), -1, "Hero"));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.KillHero), -1, "Player"));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.MonsterKilling), -1, "Monster"));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.TowerDestroyed), -1, "Building"));
        Units home = MapManager.Instance.GetHome(TeamType.BL);

        if (home != null)
        {
            this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.HomeDestroyed), home.unique_id));
        }
        IList <Units> tower = MapManager.Instance.GetTower(TeamType.LM);

        if (tower != null && tower.Count > 0)
        {
            this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.TowerDestroyed), 0, "Building"));
        }
        this._tr1 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.HeroDeath), -1, "Hero");
        this._triggerList.Add(this._tr1);
        this._tr2 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.MonsterDeath), -1, "Monster");
        this._triggerList.Add(this._tr2);
    }
Beispiel #4
0
 private void RegistgerBuffTrigger(Units player)
 {
     if (player != null)
     {
         this.AddbuffTrigger    = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitAddBuff, null, new TriggerAction(this.UpdateBuffView), player.unique_id);
         this.RemovebuffTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRemoveBuff, null, new TriggerAction(this.UpdateBuffView), player.unique_id);
     }
 }
Beispiel #5
0
        public override void OnInit()
        {
            this.m_preloadCmdMove       = new CmdMove();
            this.m_preloadCmdSkill      = new CmdSkill();
            this.m_cmdRunningController = this.self.mCmdRunningController;
            VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.OnUnitDeath), this.self.unique_id);

            this.listTrigger.Add(item);
        }
 protected override void StartHighEff()
 {
     this.isRebirth      = false;
     this.rebirthTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRebirth, null, new TriggerAction(this.doReBirth), this.targetUnit.unique_id);
     this.targetUnit.CanRebirth.Add();
     if (this.skill != null && !this.skill.IsCDTimeOver)
     {
         this.skill.StartCDTime(-1f, false);
     }
 }
Beispiel #7
0
 private void OnHeroSpawned(Units hero, EntityVo entityVo)
 {
     if (hero != null)
     {
         VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.RespawnHero), hero.unique_id);
         this._respawnTriggers.Add(item);
     }
     if (this._onSpawnAction != null)
     {
         this._onSpawnAction(hero, entityVo);
     }
 }
        public override void OnInit()
        {
            base.OnInit();
            VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillOver, null, new TriggerAction(this.OnSkillOver), this.self.unique_id);

            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillFailed, null, new TriggerAction(this.OnSkillFailed), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.OnUnitDeath), this.self.unique_id);
            this.listTrigger.Add(item);
            this.self.ClearBornPowerObjSkillData();
        }
    public void RegisterPlayerEvent()
    {
        Units player = PlayerControlMgr.Instance.GetPlayer();

        this._watchTarget = player;
        this.ReSetMiniMapTapEvent();
        if (player != null)
        {
            this.deathTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id);
            TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.ChangePlayer));
        }
        this.SetRoleObj(player, true);
    }
        public override void OnInit()
        {
            base.OnInit();
            VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdShowPointer, null, new TriggerAction(this.OnShowPointer), this.self.unique_id);

            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdHidePointer, null, new TriggerAction(this.OnHidePointer), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdDragPointer, null, new TriggerAction(this.OnDragPointer), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillControlReset, null, new TriggerAction(this.OnReset), this.self.unique_id);
            this.listTrigger.Add(item);
        }
Beispiel #11
0
 public override void OnStart()
 {
     this.AssinPersonalData();
     if (this.startCount == 0)
     {
         TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRebirthAgain, null, new TriggerAction(this.OnUnitRebirthAgain), this.self.unique_id);
     }
     else if (this.startCount > 0)
     {
         this.ShowReBirthEffect();
         this.ShowBodyEffect();
     }
     this.startCount++;
 }
        public override void OnInit()
        {
            this.m_moveController  = this.self.moveController;
            this.m_cmdRunningMove  = new CmdRunningMove();
            this.m_cmdRunningSkill = new CmdRunningSkill();
            VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdStart, null, new TriggerAction(this.OnSkillStart), this.self.unique_id);

            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdEnd, null, new TriggerAction(this.OnSkillEnd), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdOver, null, new TriggerAction(this.OnSkillOver), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdFailed, null, new TriggerAction(this.OnSkillFailed), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.OnUnitDeath), this.self.unique_id);
            this.listTrigger.Add(item);
        }
Beispiel #13
0
 private void RegisterTrigger()
 {
     if (this.PlayerDeath != null)
     {
         TriggerManager.DestroyTrigger(this.PlayerDeath);
     }
     if (this.PlayerReBrith != null)
     {
         TriggerManager.DestroyTrigger(this.PlayerReBrith);
     }
     if (this.PlayerTimer != null)
     {
         TriggerManager.DestroyTrigger(this.PlayerTimer);
     }
     this.PlayerDeath   = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.GrayHeroHead), this.player_unique_id);
     this.PlayerReBrith = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRebirthAgain, null, new TriggerAction(this.NormalHeroHead), this.player_unique_id);
     this.PlayerTimer   = TriggerManager.CreateUnitEventTrigger(UnitEvent.HeroDeathTimer, null, new TriggerAction(this.DeathTimer), this.player_unique_id);
 }
        public override void OnInit()
        {
            base.OnInit();
            VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdReady, null, new TriggerAction(this.OnSkillReady), this.self.unique_id);

            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdStart, null, new TriggerAction(this.OnSkillStart), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdFailed, null, new TriggerAction(this.OnSkillFailed), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdEnd, null, new TriggerAction(this.OnSkillFailed), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdOver, null, new TriggerAction(this.OnSkillFailed), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillControlReset, null, new TriggerAction(this.OnReset), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdShowPointer, null, new TriggerAction(this.OnShowPointer), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdHidePointer, null, new TriggerAction(this.OnHidePointer), this.self.unique_id);
            this.listTrigger.Add(item);
            item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdCrazyPointer, null, new TriggerAction(this.OnCrazyPointer), this.self.unique_id);
            this.listTrigger.Add(item);
        }
    private void ChangePlayer()
    {
        if (this.deathTrigger != null)
        {
            TriggerManager.DestroyTrigger(this.deathTrigger);
            this.deathTrigger = null;
        }
        Units player = PlayerControlMgr.Instance.GetPlayer();

        this._watchTarget = player;
        if (player != null && player.isLive)
        {
            this.deathTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id);
            this.PlayerRespawn();
        }
        if (this.tapMiniMapDownTrigger == null)
        {
            this.tapMiniMapDownTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.TapMiniMapDown, null, new TriggerAction(this.SetTouchMiniMapPosition));
        }
        if (this.tapMiniMapUpTrigger == null)
        {
            this.tapMiniMapUpTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.TapMiniMapUp, null, new TriggerAction(this.RestoreCameraController));
        }
    }
Beispiel #16
0
 protected override void StartHighEff()
 {
     base.StartHighEff();
     TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitAttack, null, new TriggerAction(this.RemoveSelf), this.targetUnit.unique_id);
     TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitConjure, null, new TriggerAction(this.RemoveSelf), this.targetUnit.unique_id);
 }
Beispiel #17
0
 private void RegisterListeners()
 {
     this._towerDefendTrigger   = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDefendTower, null, new TriggerAction(this.DefendTower), -1, "Home");
     this._heroAvoidenceTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.HeroAvoidence, null, new TriggerAction(this.HeroAvoidence), -1, "Hero");
 }
 public override void OnCreate()
 {
     base.OnCreate();
     this.triggerHandle = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitBeJifei, null, new TriggerAction(this.OnJifeiTrigger), -1, "Hero");
 }
Beispiel #19
0
    protected void DoHighEffectHandler(HighEffVo h)
    {
        if (h == null)
        {
            return;
        }
        switch (h.data.config.higheff_trigger)
        {
        case 0:
            if (!this.mForeverActions.Contains(h.data))
            {
                this.StartHighEffect(h);
                this.mForeverActions.Add(h.data);
            }
            break;

        case 1:
            this.StartHighEffect(h);
            break;

        case 2:
        {
            VTrigger vTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitHit, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger.trigger_id);
            }
            break;
        }

        case 3:
        {
            VTrigger vTrigger2 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitAttack, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger2 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger2.trigger_id);
            }
            break;
        }

        case 4:
        {
            VTrigger vTrigger3 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitConjure, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger3 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger3.trigger_id);
            }
            break;
        }

        case 5:
        {
            VTrigger vTrigger4 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitConjureR, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger4 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger4.trigger_id);
            }
            break;
        }

        case 6:
        {
            VTrigger vTrigger5 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitKillTarget, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger5 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger5.trigger_id);
            }
            break;
        }

        case 8:
        {
            VTrigger vTrigger6 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitAttackHitOther, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger6 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger6.trigger_id);
            }
            break;
        }

        case 9:
        {
            VTrigger vTrigger7 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitPrognosisDeath, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger7 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger7.trigger_id);
            }
            break;
        }

        case 10:
        {
            VTrigger vTrigger8 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitUnderGroud, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger8 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger8.trigger_id);
            }
            break;
        }

        case 11:
        {
            VTrigger vTrigger9 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitPreConjure, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger9 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger9.trigger_id);
            }
            break;
        }

        case 13:
        {
            VTrigger vTrigger10 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitPreAttack, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger10 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger10.trigger_id);
            }
            break;
        }

        case 14:
        {
            VTrigger vTrigger11 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitTriggerEnter, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger11 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger11.trigger_id);
            }
            break;
        }

        case 15:
        {
            VTrigger vTrigger12 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDespawn, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger12 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger12.trigger_id);
            }
            break;
        }

        case 16:
        {
            VTrigger vTrigger13 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillHitOther, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger13 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger13.trigger_id);
            }
            break;
        }

        case 17:
        {
            VTrigger vTrigger14 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitBeAttackHit, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger14 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger14.trigger_id);
            }
            break;
        }

        case 18:
        {
            VTrigger vTrigger15 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitBeSkillHit, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger15 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger15.trigger_id);
            }
            break;
        }

        case 19:
        {
            VTrigger vTrigger16 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitConjureQWE_HitOther, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger16 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger16.trigger_id);
            }
            break;
        }

        case 21:
        {
            VTrigger vTrigger17 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitKillAndAssist, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger17 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger17.trigger_id);
            }
            break;
        }

        case 22:
        {
            VTrigger vTrigger18 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitCrit, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger18 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger18.trigger_id);
            }
            break;
        }

        case 23:
        {
            VTrigger vTrigger19 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitHitProp, null, new TriggerAction(this.doHighEffect), this.self.unique_id);
            if (vTrigger19 != null)
            {
                this.AddTrigger(h.higheff_id, vTrigger19.trigger_id);
            }
            break;
        }
        }
    }