public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     PlayerEntity xPlayer;
     if ((xPlayer = (xBaseStats.xOwner as PlayerEntity)) != null)
     {
         if (!Utility.IsWithinRange((int)xPlayer.xRenderComponent.iActiveAnimation, 2600, 2603))
         {
             FrozenPlayer xMos = (FrozenPlayer)Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.Debuff_Freeze, xPlayer.xTransform.v2Pos);
             xMos.SetPlayer(xPlayer);
         }
         float fDuration = 300f;
         float fSlowFactor = 0.7f;
         xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.Chilled, (int)fDuration);
         xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.SlowLv1, (int)fDuration);
         if (!xBaseStats.bSlowImmunity)
         {
             xBaseStats.AddPercentageMoveSpeedDeBuff(new BaseStats.BuffFloat((int)fDuration, fSlowFactor));
         }
     }
     this.bToBeDestroyed = true;
 }
Esempio n. 2
0
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (this.enCurrentAction == YetiAI.Action.IceBreath_Blow)
     {
         if (xBaseStats.xOwner is PlayerEntity)
         {
             PlayerEntity xPlayer = xBaseStats.xOwner as PlayerEntity;
             if (xAtColData.bShielded)
             {
                 Program.game._Player_TakeDamage(xPlayer.Owner, 3 + CAS.DifficultyModifier, 1);
             }
             else if (!Utility.IsWithinRange((int)xPlayer.xRenderComponent.iActiveAnimation, 2600, 2603))
             {
                 FrozenPlayer xMos = (FrozenPlayer)Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.Debuff_Freeze, xPlayer.xTransform.v2Pos);
                 xMos.SetPlayer(xPlayer);
             }
             float fDuration = 300f;
             float fSlowFactor = 0.7f;
             xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.Chilled, (int)fDuration);
             xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.SlowLv1, (int)fDuration);
             if (!xBaseStats.bSlowImmunity)
             {
                 xBaseStats.AddPercentageMoveSpeedDeBuff(new BaseStats.BuffFloat((int)fDuration, fSlowFactor));
             }
         }
         return;
     }
     if (!xAtColData.bShielded && Program.game.bEffectsOn)
     {
         IEffect kaktus = Program.game._EffectMaster_AddEffect(new SortedAnimated(xAtColData.v2PointOfImpact, SortedAnimated.SortedAnimatedEffects._HitEffect_Pang1));
         kaktus.xRenderComponent.fVirtualHeight += this.xOwner.xRenderComponent.fVirtualHeight;
         kaktus.xRenderComponent.xTransform = xBaseStats.xOwner.xTransform;
         kaktus.xRenderComponent.v2OffsetRenderPos = new Vector2(0f, -10f);
     }
 }