Exemplo n.º 1
0
        public virtual void BeingHit(AttackResult attackResult, BeHitEffect beHitEffect, uint sourceID)
        {
            bool doSteerToHitForward = false;
            bool targetLockSource    = false;

            if ((attackResult.hitEffect > AttackResult.AnimatorHitEffect.Light) && (attackResult.hitCollision.hitDir != Vector3.zero))
            {
                doSteerToHitForward = true;
            }
            if ((Singleton <AvatarManager> .Instance.IsLocalAvatar(base.runtimeID) && (this.avatar.AttackTarget == null)) && (this.avatar.IsAnimatorInTag(AvatarData.AvatarTagGroup.AllowTriggerInput) && (Singleton <RuntimeIDManager> .Instance.ParseCategory(sourceID) == 4)))
            {
                BaseMonoMonster monster = Singleton <MonsterManager> .Instance.TryGetMonsterByRuntimeID(sourceID);

                if ((monster != null) && !monster.denySelect)
                {
                    targetLockSource = true;
                }
            }
            if ((this._paralyzeState == ParalyzeState.ParalyzeFreezed) && (attackResult.hitEffect > AttackResult.AnimatorHitEffect.Light))
            {
                this.avatar.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx, 1f);
                this._paralyzeTimer.timespan = 0.35f;
                this._paralyzeTimer.Reset(true);
                this._paralyzeState = ParalyzeState.ParalyzeHitResuming;
            }
            if (base.abilityState.ContainsState(AbilityState.Frozen))
            {
                doSteerToHitForward = false;
                if (attackResult.hitEffect > AttackResult.AnimatorHitEffect.Light)
                {
                    attackResult.hitEffect = AttackResult.AnimatorHitEffect.Light;
                }
            }
            this.avatar.BeHit(attackResult.frameHalt, attackResult.hitEffect, attackResult.hitEffectAux, attackResult.killEffect, beHitEffect, attackResult.aniDamageRatio, attackResult.hitCollision.hitDir, attackResult.retreatVelocity, sourceID, targetLockSource, doSteerToHitForward);
        }
Exemplo n.º 2
0
 protected override void OnAbilityStateAdd(AbilityState state, bool muteDisplayEffect)
 {
     base.OnAbilityStateAdd(state, muteDisplayEffect);
     if (state == AbilityState.Stun)
     {
         this.monster.SetLocomotionBool("BuffStun", true, false);
         this.monster.SetCountedMuteControl(true);
     }
     else if (state == AbilityState.Paralyze)
     {
         this.monster.SetLocomotionBool("BuffParalyze", true, false);
         this._paralyzeAnimatorSpeedIx = this.monster.PushProperty("Animator_OverallSpeedRatioMultiplied", 1f);
         this._paralyzeTimer.Reset(true);
         this._paralyzeTimer.timespan = 0.35f;
         this._paralyzeState          = ParalyzeState.ParalyzeHitResuming;
         this.monster.SetCountedMuteControl(true);
     }
     else if (state == AbilityState.Frozen)
     {
         if (this.monster.IsAnimatorInTag(MonsterData.MonsterTagGroup.Throw))
         {
             this._frozenAnmatorSpeedIx = this.monster.PushProperty("Animator_OverallSpeedRatioMultiplied", 1f);
             this._frozenState          = FrozenState.WaitingForGrounded;
         }
         else
         {
             this._frozenAnmatorSpeedIx = this.monster.PushProperty("Animator_OverallSpeedRatioMultiplied", 0f);
             this._frozenState          = FrozenState.FrozenFreezed;
         }
         this.monster.SetCountedMuteControl(true);
     }
     Singleton <EventManager> .Instance.FireEvent(new EvtBuffAdd(base.runtimeID, state), MPEventDispatchMode.Normal);
 }
Exemplo n.º 3
0
 protected override void OnAbilityStateRemove(AbilityState state)
 {
     base.OnAbilityStateRemove(state);
     if (state == AbilityState.Stun)
     {
         this.monster.SetLocomotionBool("BuffStun", false, false);
         this.monster.SetCountedMuteControl(false);
     }
     else if (state == AbilityState.Paralyze)
     {
         this.monster.SetLocomotionBool("BuffParalyze", false, false);
         this.monster.PopProperty("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx);
         this.monster.SetCountedMuteControl(false);
         this._paralyzeState = ParalyzeState.Idle;
     }
     else if (state == AbilityState.Frozen)
     {
         this.monster.PopProperty("Animator_OverallSpeedRatioMultiplied", this._frozenAnmatorSpeedIx);
         this._frozenState = FrozenState.Idle;
         this.monster.SetCountedMuteControl(false);
     }
     Singleton <EventManager> .Instance.FireEvent(new EvtBuffRemove(base.runtimeID, state), MPEventDispatchMode.Normal);
 }
Exemplo n.º 4
0
 public virtual void BeingHit(AttackResult attackResult, BeHitEffect beHitEffect)
 {
     if ((this._paralyzeState == ParalyzeState.ParalyzeFreezed) && (attackResult.hitEffect > AttackResult.AnimatorHitEffect.Light))
     {
         this.monster.PopProperty("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx);
         this._paralyzeAnimatorSpeedIx = this.monster.PushProperty("Animator_OverallSpeedRatioMultiplied", 1f);
         this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx, 1f);
         if ((attackResult.hitEffect == AttackResult.AnimatorHitEffect.ThrowUp) || (attackResult.hitEffect == AttackResult.AnimatorHitEffect.ThrowUpBlow))
         {
             this._paralyzeTimer.timespan = 0.5f;
         }
         else
         {
             this._paralyzeTimer.timespan = 0.35f;
         }
         this._paralyzeTimer.Reset(true);
         this._paralyzeState = ParalyzeState.ParalyzeHitResuming;
     }
     if (base.abilityState.ContainsState(AbilityState.Frozen) && (attackResult.hitEffect > AttackResult.AnimatorHitEffect.Light))
     {
         attackResult.hitEffect = AttackResult.AnimatorHitEffect.Light;
     }
     this.monster.BeHit(attackResult.frameHalt, attackResult.hitEffect, attackResult.hitEffectAux, attackResult.killEffect, beHitEffect, attackResult.aniDamageRatio, attackResult.hitCollision.hitDir, attackResult.retreatVelocity);
 }
Exemplo n.º 5
0
        public override void Init(BaseMonoEntity entity)
        {
            this.monster         = (BaseMonoMonster)entity;
            base.runtimeID       = this.monster.GetRuntimeID();
            this.uniqueMonsterID = this.monster.uniqueMonsterID;
            string configType = string.Empty;

            if (this.uniqueMonsterID != 0)
            {
                configType = MonsterData.GetUniqueMonsterMetaData(this.uniqueMonsterID).configType;
            }
            this.config       = MonsterData.GetMonsterConfig(this.monster.MonsterName, this.monster.TypeName, configType);
            base.commonConfig = this.config.CommonConfig;
            this.metaConfig   = MonsterData.GetMonsterConfigMetaData(this.monster.MonsterName, this.monster.TypeName);
            base.Init(entity);
            Singleton <EventManager> .Instance.FireEvent(new EvtMonsterCreated(base.runtimeID), MPEventDispatchMode.Normal);

            this._paralyzeTimer = new EntityTimer();
            this._paralyzeTimer.SetActive(false);
            this._paralyzeState = ParalyzeState.Idle;
            base.AddPlugin(new MonsterAIPlugin(this));
            this.InitAbilityStateImmune();
            this.InitDebuffDurationRatio();
        }
Exemplo n.º 6
0
 private void UpdateAbilityState()
 {
     if (this._paralyzeState == ParalyzeState.WaitingForGrounded)
     {
         if (this.monster.IsAnimatorInTag(MonsterData.MonsterTagGroup.Grounded))
         {
             if (base.abilityState.ContainsState(AbilityState.SlowWhenFrozenOrParalyze))
             {
                 this.monster.PopProperty("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx);
                 this._paralyzeAnimatorSpeedIx = this.monster.PushProperty("Animator_OverallSpeedRatioMultiplied", 1f);
                 this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx, 0.1f);
             }
             else
             {
                 this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx, 0f);
             }
             this._paralyzeState = ParalyzeState.ParalyzeFreezed;
         }
     }
     else if ((this._paralyzeState != ParalyzeState.ParalyzeFreezed) && (this._paralyzeState == ParalyzeState.ParalyzeHitResuming))
     {
         this._paralyzeTimer.Core(1f);
         if (!this.monster.IsAnimatorInTag(MonsterData.MonsterTagGroup.Grounded))
         {
             this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx, 1f);
             this._paralyzeTimer.Reset(false);
             this._paralyzeState = ParalyzeState.WaitingForGrounded;
         }
         else if (this._paralyzeTimer.isTimeUp)
         {
             if (base.abilityState.ContainsState(AbilityState.SlowWhenFrozenOrParalyze))
             {
                 this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx, 0.1f);
             }
             else
             {
                 this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._paralyzeAnimatorSpeedIx, 0f);
             }
             this._paralyzeTimer.Reset(false);
             this._paralyzeState = ParalyzeState.ParalyzeFreezed;
         }
     }
     if (this._frozenState == FrozenState.WaitingForGrounded)
     {
         if (this.monster.IsAnimatorInTag(MonsterData.MonsterTagGroup.Grounded))
         {
             if (base.abilityState.ContainsState(AbilityState.SlowWhenFrozenOrParalyze))
             {
                 this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._frozenAnmatorSpeedIx, 0.1f);
             }
             else
             {
                 this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._frozenAnmatorSpeedIx, 0f);
             }
             this._frozenState = FrozenState.FrozenFreezed;
         }
     }
     else if (this._frozenState == FrozenState.FrozenFreezed)
     {
         if (base.abilityState.ContainsState(AbilityState.SlowWhenFrozenOrParalyze))
         {
             this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._frozenAnmatorSpeedIx, 0.1f);
         }
         else
         {
             this.monster.SetPropertyByStackIndex("Animator_OverallSpeedRatioMultiplied", this._frozenAnmatorSpeedIx, 0f);
         }
     }
 }