Example #1
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     if (xAtPhase.xStats.bNonDamaging)
     {
         return;
     }
     Program.GetTheGame();
     this.xBaseStats.iHP -= 30;
     Random knark = Program.GetTheGame().randomInVisual;
     Vector2 v2Orig = this.xTransform.v2Pos;
     for (int i = 0; i < 6; i++)
     {
         Vector2 v2RandDir = new Vector2(-1f + (float)knark.NextDouble() * 2f, -1f + (float)knark.NextDouble() * 2f);
         if (v2RandDir == Vector2.Zero)
         {
             v2RandDir = new Vector2(1f, 0f);
         }
         v2RandDir.Normalize();
         float fRandGrade = (float)knark.NextDouble();
         SortedAnimated eff = Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Orig, SortedAnimated.SortedAnimatedEffects._HitEffect_SlimeParticle, v2RandDir * (0.5f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 2f), 35 + (int)(25f * fRandGrade), 25, 0.9f)) as SortedAnimated;
         eff.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
         (eff.xRenderComponent as AnimatedRenderComponent).fAnimationTimeWarp = 0.7f + fRandGrade * 0.6f;
     }
     this.iShakeCountDown = 14;
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     if (this.bReflectableOnPerfectGuard && xAtColData.bShielded && xBaseStats.iPerfectGuardBonus > 0)
     {
         Vector2 v2NewDir = this.v2Direction * -1f;
         v2NewDir.Normalize();
         base.SendClientInstruction(0, new float[]
         {
             v2NewDir.X,
             v2NewDir.Y
         });
         this.xAttackPhaseEnemy.lenLayers.Remove(Collider.ColliderLayers.Players);
         this.xAttackPhaseEnemy.lenLayers.Remove(Collider.ColliderLayers.Neutrals);
         this.xAttackPhaseEnemy.lenLayers.Add(Collider.ColliderLayers.Enemies);
         this.xAttackPhaseEnemy.lenLayers.Add(Collider.ColliderLayers.DynamicEnvironment);
         this.xAttackPhaseEnemy.xStats.iBaseDamage *= 5;
         if (xBaseStats.xOwner.enEntityType == IEntity.EntityType.Player && (xBaseStats.xOwner as PlayerEntity).Owner.xEquipment.lenActiveEquipmentEffects.Contains(EquipmentInfo.SpecialEffect._Unique_WispShield_BetterProjectileReflect))
         {
             this.xAttackPhaseEnemy.xStats.iBaseDamage = (int)((float)this.xAttackPhaseEnemy.xStats.iBaseDamage * 1.5f);
         }
         this.v2Direction = v2NewDir;
         this.xOwner = xBaseStats.xOwner;
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     if (xAtColData.bShielded && xBaseStats.iPerfectGuardBonus > 0)
     {
         Vector2 v2Normal = Utility.AnimationDirectionToVector2((int)(xBaseStats.xOwner as PlayerEntity).byAnimationDirection);
         (this.v2Direction - 2f * (Vector2.Dot(this.v2Direction, v2Normal) * v2Normal)).Normalize();
         this.xAttackPhasePlayer.xStats.sAttackHandle = "PGTest";
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Players);
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Neutrals);
         this.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.DynamicEnvironment);
         this.xAttackPhasePlayer.xStats.iBaseDamage *= 3;
         this.v2Direction *= -1f;
         this.xOwner = xBaseStats.xOwner;
         this.xRenderComponent.fScale = 0.2f;
         this.xRenderComponent.cColor = Color.Aqua;
         this.xRenderComponent.fAlpha = 0.5f;
         this.xChallengePG.ShotGuarded();
         return;
     }
     this.bToBeDestroyed = true;
     if (this.xAttackPhasePlayer.xStats.sAttackHandle != "PGTest")
     {
         this.xChallengePG.Fail();
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats == null)
     {
         this.bToBeDestroyed = true;
     }
 }
Example #5
0
		public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
		{
			foreach (DeligateEntity.OnAttackHitDelegate x in this.lxOnAttackHitDelegates)
			{
				x(xAtColData, xBaseStats);
			}
		}
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     if (xAtColData.bShielded && xBaseStats.bPerfectGuardedThisFrame)
     {
         Vector2 v2Normal = Utility.AnimationDirectionToVector2((int)(xBaseStats.xOwner as PlayerEntity).byAnimationDirection);
         (this.v2Direction - 2f * (Vector2.Dot(this.v2Direction, v2Normal) * v2Normal)).Normalize();
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Players);
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Neutrals);
         this.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.Enemies);
         this.v2Direction *= -1f;
         this.xAttackPhasePlayer.xStats.v2KnockbackDirectionOverride = this.v2Direction;
         this.xAttackPhasePlayer.xStats.iBaseDamage *= 5;
         this.xOwner = xBaseStats.xOwner;
         if (xBaseStats.xOwner.enEntityType == IEntity.EntityType.Player && (xBaseStats.xOwner as PlayerEntity).Owner.xEquipment.lenActiveEquipmentEffects.Contains(EquipmentInfo.SpecialEffect._Unique_WispShield_BetterProjectileReflect))
         {
             this.xAttackPhasePlayer.xStats.iBaseDamage = (int)((float)this.xAttackPhasePlayer.xStats.iBaseDamage * 1.5f);
             return;
         }
     }
     else
     {
         this.bToBeDestroyed = true;
     }
 }
Example #7
0
		public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
		{
			foreach (DeligateEntity.OnHitByAttackDelegate x in this.lxOnHitByAttackDelegates)
			{
				x(xAtColData, xAtPhase);
			}
		}
 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;
 }
Example #9
0
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (this.xOwnerEnemy != null)
     {
         return;
     }
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     if (xBaseStats == null || !(xBaseStats.xOwner is PlayerEntity))
     {
         this.v2Direction *= -1f;
         this.fCurrentRot += 3.14159274f;
         return;
     }
     if (this.iCooldown > 0)
     {
         return;
     }
     this.iCooldown = 60;
     PlayerEntity xCaughtPlayer = xBaseStats.xOwner as PlayerEntity;
     TornadoedPlayer xLol = (TornadoedPlayer)Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.Debuff_TornadoCatch, Vector2.Zero);
     xLol.SetPlayer(xCaughtPlayer, this);
     this.xAttackPhaseEnvironment.lxCurrentColliders[0].ibitLayers |= xCaughtPlayer.xCollisionComponent.ibitCurrentColliderLayer;
     this.xCurrentCaught = xCaughtPlayer;
 }
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     if (xAtPhase.xStats.sAttackHandle != "2HBasic" && xAtPhase.xStats.sAttackHandle != "1HBasic")
     {
         return;
     }
     Vector2 v2MosPos = xAtPhase.xOwner.xTransform.v2Pos;
     Vector2 v2Local = v2MosPos - this.xTransform.v2Pos;
     if (v2Local.X < 21f)
     {
         this.ClockHit(0);
         this.xLeftClock.xRenderComponent.AsAnimated().SwitchAnimation(1);
     }
     else if (v2Local.X < 45f)
     {
         this.ClockHit(1);
         this.xMidClock.xRenderComponent.AsAnimated().SwitchAnimation(1);
     }
     else if (v2Local.X < 69f)
     {
         this.ClockHit(2);
         this.xRightClock.xRenderComponent.AsAnimated().SwitchAnimation(1);
     }
     if (this.xRenderComponent.iActiveAnimation == 0)
     {
         this.xRenderComponent.SwitchAnimation(1, Animation.CancelOptions.RestartIfPlaying, 0.75f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 0.5f);
         Program.GetTheGame()._DynamicEnvironment_SendOnHit(this.iID);
     }
     if (this.sSoundOnHit != "")
     {
         Program.GetTheGame().xSoundSystem.PlayCue(this.sSoundOnHit, this.xTransform.v2Pos);
     }
 }
Example #11
0
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     base.OnAttackHit(xAtColData, xBaseStats);
     if (xAtColData.bShielded)
     {
         this.xOwner.xRenderComponent.SwitchAnimation((ushort)(this.xOwner.xRenderComponent.GetCurrentAnimation().byAnimationDirection + 22), Animation.CancelOptions.UseAnimationDefault);
     }
 }
Example #12
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     base.OnHitByAttack(xAtColData, xAtPhase);
     if (xAtPhase.xStats.enAttackElement == AttackStats.Element.Fire && (this.xOwner.xRenderComponent.iActiveAnimation < 8 || this.xOwner.xRenderComponent.iActiveAnimation > 11))
     {
         this.xOwner.xRenderComponent.SwitchAnimation(this.xOwner.aiHitAnimation[(int)this.xOwner.xRenderComponent.GetCurrentAnimation().byAnimationDirection], Animation.CancelOptions.RestartIfPlaying);
     }
 }
Example #13
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     if (this.iCounter < this.iExplodeAt - 5)
     {
         this.iCounter = this.iExplodeAt - 5;
     }
     int arg_2B_0 = this.iTimesHit;
     int arg_2A_0 = this.iTimesToHitBeforeDestroy;
 }
Example #14
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     base.OnHitByAttack(xAtColData, xAtPhase);
     this.xRenderComponent.AsAnimated().SwitchAnimation(3, Animation.CancelOptions.IgnoreIfPlaying);
     if (this.iTimesHit >= this.iTimesToHitBeforeDestroy && this.xAttackPhase != null)
     {
         this.xAttackPhase.UnregisterCurrent();
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     this.bToBeDestroyed = true;
     base.SendClientInstruction(0, new float[0]);
 }
Example #16
0
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (!xAtColData.bShielded && Program.GetTheGame().bEffectsOn)
     {
         IEffect kaktus = Program.GetTheGame()._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);
     }
 }
Example #17
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     base.OnHitByAttack(xAtColData, xAtPhase);
     this.v2RandMoveDir = Vector2.Zero;
     this.iNextHardUpdate = 0;
     this.bAggro = true;
     this.iDowned = 0;
     this.iShieldKnockLol = 0;
     this.iWannaCircleBaby = 180;
 }
Example #18
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     Game1 xLol = Program.GetTheGame();
     if (this.enHitEffect != SortedAnimated.SortedAnimatedEffects.None)
     {
         xLol._EffectMaster_AddEffect(new SortedAnimated(this.xTransform.v2Pos, this.enHitEffect));
     }
     if (this.bDestroyOnHit)
     {
         this.bToBeDestroyed = true;
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (this.iPowerLevel == 5)
     {
         return;
     }
     this.bToBeDestroyed = true;
     SortedAnimated xDestroy = new SortedAnimated(this.xTransform.v2Pos + this.xRenderComponent.v2OffsetRenderPos, SortedAnimated.SortedAnimatedEffects._SpellEffects_Fire_FireballImpact);
     xDestroy.xRenderComponent.fVirtualHeight = this.xRenderComponent.fVirtualHeight + 10f;
     Program.GetTheGame()._EffectMaster_AddEffect(xDestroy);
     base.SendClientInstruction(0, new float[0]);
 }
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     if (xAtPhase != null && xAtPhase.xStats.sAttackHandle == "Arrow")
     {
         this.bToBeDestroyed = true;
         this.AddZeArrow(xAtColData.v2PointOfImpact);
         base.SendNetworkInstruction(new float[]
         {
             0f,
             xAtColData.v2PointOfImpact.X,
             xAtColData.v2PointOfImpact.Y
         });
         Program.game.xSoundSystem.PlayInterfaceCue("puzzle_solved_fanfare");
     }
 }
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     if (xAtPhase != null)
     {
         IEntity mos = xAtPhase.xOwner.GetTrueOwner();
         if (mos.enEntityType != IEntity.EntityType.Enemy)
         {
             return;
         }
         if ((mos as Enemy).enType == EnemyCodex.EnemyTypes.Boar && xAtPhase.xStats.sAttackHandle == "BoarCharge")
         {
             this.bToBeDestroyed = true;
             ((mos as Enemy).xBehaviour as BoarAI).BounceBack();
         }
     }
 }
Example #22
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     this.iTimesHit++;
     if (xAtPhase != null)
     {
         this.iTimesHit += xAtPhase.xStats.iBreakingPower / 2;
     }
     if (this.iTimesHit >= this.iTimesToHitBeforeDestroy)
     {
         this.Destroy();
         return;
     }
     this.xRenderComponent.SwitchAnimation(1, Animation.CancelOptions.RestartIfPlaying);
     Program.GetTheGame()._DynamicEnvironment_SendOnHit(this.iID);
     if (this.sOnHitSound != "")
     {
         Program.GetTheGame().xSoundSystem.PlayCue(this.sOnHitSound, this.xTransform.v2Pos);
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     if (this.bReflectableOnPerfectGuard && xAtColData.bShielded && xBaseStats.iPerfectGuardBonus > 0)
     {
         Vector2 v2Normal = Utility.AnimationDirectionToVector2((int)(xBaseStats.xOwner as PlayerEntity).byAnimationDirection);
         (this.v2Direction - 2f * (Vector2.Dot(this.v2Direction, v2Normal) * v2Normal)).Normalize();
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Players);
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Neutrals);
         this.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.DynamicEnvironment);
         this.xAttackPhasePlayer.xStats.iBaseDamage *= 3;
         this.v2Direction *= -1f;
         this.xOwner = xBaseStats.xOwner;
         return;
     }
     this.bToBeDestroyed = true;
 }
Example #24
0
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xAtColData.bShielded)
     {
         ushort kaktus = 0;
         if (this.xOwner.xRenderComponent.GetCurrentAnimation().byAnimationDirection == 3)
         {
             kaktus = 1;
         }
         this.xOwner.xRenderComponent.SwitchAnimation(Convert.ToUInt16(kaktus + 8), Animation.CancelOptions.UseAnimationDefault);
         this.iShieldKnockLol = 10;
         this.iDowned = 180 - 30 * GameSessionData.iBaseDifficulty;
         if (xBaseStats.bPerfectStance)
         {
             this.iDowned *= 3;
         }
         this.xOwner.bAutoSwitchToHitAnimation = false;
         base.SendClientInstruction(0, new float[0]);
         Program.GetTheGame().xGameSessionData.henActiveFlags.Add(FlagCodex.FlagID._BagTips_BlockedBee);
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Client)
     {
         return;
     }
     if (this.bToBeDestroyed)
     {
         return;
     }
     if (xBaseStats == null || xBaseStats.xOwner == null)
     {
         this.bToBeDestroyed = true;
         if (this.xTravelingEntity is Enemy)
         {
             Enemy x = this.xTravelingEntity as Enemy;
             Program.game._Enemy_TakeArbitraryDamage(x, Program.game._AttackStats_CalculateDefenseReduction(this.iDamageAtCollide, x.xBaseStats, 0f, false), 0, this.xAttackPhaseEnemy);
             if (Program.game.xCamera.recViewRec.Contains(Utility.Vector2ToPoint(this.xTravelingEntity.xTransform.v2Pos)))
             {
                 Program.game.xCamera.SetShake((int)(5 + (int)x.xBaseStats.enSize * (int)(BaseStats.BodySize)15));
                 return;
             }
         }
     }
     else if (xBaseStats.xOwner is Enemy)
     {
         if (xBaseStats.enSize > this.xTravelingEntity.xBaseStats.enSize)
         {
             this.v2TravelDir = Utility.DirectionBetweenVectors(xBaseStats.xOwner.xTransform.v2Pos, this.xTravelingEntity.xTransform.v2Pos);
             base.SendClientInstruction(0, new float[]
             {
                 this.xTravelingEntity.xTransform.v2Pos.X,
                 this.xTravelingEntity.xTransform.v2Pos.Y,
                 this.v2TravelDir.X,
                 this.v2TravelDir.Y
             });
         }
         Program.game._EffectMaster_AddEffect(new SortedAnimated(xBaseStats.xOwner.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects._HitEffect_SmashOnHitWall01));
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     float fEpiLol = this.fEpicenter;
     if (this.iChargeLevel == 3)
     {
         fEpiLol = 12f;
     }
     if (this.iChargeLevel > 1 && xBaseStats != null && xBaseStats.bCanBeKnockedUp && xBaseStats.xOwner.enEntityType == IEntity.EntityType.Enemy)
     {
         Enemy xEn = xBaseStats.xOwner as Enemy;
         if (Vector2.Distance(xAtColData.v2PointOfImpact, this.xTransform.v2Pos) < fEpiLol && xBaseStats.iHP > 0)
         {
             Game1 master = Program.GetTheGame();
             float fKnockupSpeed = 3f;
             float fSpeedFalloff = 0.15f;
             if (this.iChargeLevel == 3)
             {
                 fKnockupSpeed = 4f;
             }
             master._EntityMaster_AddWatcher(new EnemyKnockupWatcher(xEn, fKnockupSpeed, fSpeedFalloff));
             xEn.xRenderComponent.SwitchAnimation((ushort)((int)xEn.byAnimationDirection + 40000), Animation.CancelOptions.IgnoreIfPlaying);
             if (master.xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server)
             {
                 foreach (PlayerView xOtherView in master.dixPlayers.Values)
                 {
                     if (xOtherView != master.xLocalPlayer && xOtherView.bInitializedToServer)
                     {
                         NetOutgoingMessage om = master.xNetworkInfo.server.CreateMessage();
                         om.Write(255);
                         om.Write(7);
                         om.Write(xEn.iID);
                         om.Write(fKnockupSpeed);
                         om.Write(fSpeedFalloff);
                         master.xNetworkInfo.server.SendMessage(om, xOtherView.netConnection, NetDeliveryMethod.ReliableUnordered);
                     }
                 }
             }
         }
     }
 }
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     if (this.iPhase == 0 && xAtColData.bShielded && xBaseStats.iPerfectGuardBonus > 0)
     {
         Utility.AnimationDirectionToVector2((int)(xBaseStats.xOwner as PlayerEntity).byAnimationDirection);
         this.iDestroyAt = 120;
         this.xAttackPhasePlayer.xStats.sAttackHandle = "SupahPhase";
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Players);
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Neutrals);
         this.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.Enemies);
         this.xAttackPhasePlayer.xStats.iBaseDamage *= 3;
         this.fVelocity = 4f;
         this.v2Direction *= -1f;
         this.xOwner = xBaseStats.xOwner;
         base.SendClientInstruction(1, new float[]
         {
             this.v2Direction.X,
             this.v2Direction.Y
         });
         if (xBaseStats.xOwner.enEntityType == IEntity.EntityType.Player && (xBaseStats.xOwner as PlayerEntity).Owner.xEquipment.lenActiveEquipmentEffects.Contains(EquipmentInfo.SpecialEffect._Unique_WispShield_BetterProjectileReflect))
         {
             this.xAttackPhasePlayer.xStats.iBaseDamage = (int)((float)this.xAttackPhasePlayer.xStats.iBaseDamage * 1.5f);
             return;
         }
     }
     else
     {
         IEntity xOwn = this.xOwner.GetTrueOwner();
         if (xOwn.enEntityType == IEntity.EntityType.Enemy && (xOwn as Enemy).xBehaviour is RoguePhasemanAI)
         {
             ((xOwn as Enemy).xBehaviour as RoguePhasemanAI).BulletShieldedNotPG();
         }
         this.bToBeDestroyed = true;
     }
 }
Example #28
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     if (this.bImmortal || this.iToDestroy > 0)
     {
         return;
     }
     if (xAtPhase != null && xAtPhase.xStats.sAttackHandle == "Arrow")
     {
         this.xRenderComponent.SwitchAnimation(Convert.ToUInt16(this.xRenderComponent.iActiveAnimation + 1), Animation.CancelOptions.IgnoreIfPlaying);
         this.iToDestroy = 1;
         this.iDir = 0;
         this.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All);
         xAtPhase.xStats.sAttackHandle = "";
         int iValue = this.xOwnerBagman.HitTarget(this.iTier);
         base.SendNetworkInstruction(new float[]
         {
             0f,
             (float)iValue
         });
         Program.GetTheGame().xSoundSystem.PlayCue("Itemdrop", this.xTransform.v2Pos);
         Program.GetTheGame()._EffectMaster_AddEffect(new DamageNumbers(this.xTransform.v2Pos + new Vector2(0f, -12f), iValue, false, NoticeNumbers.NumberTileset.GreenNumbers));
     }
 }
Example #29
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     Game1 master = Program.GetTheGame();
     this.xBaseStats.iHP -= 10;
     Random knark = Program.GetTheGame().randomInVisual;
     Vector2 v2Orig = this.xTransform.v2Pos;
     for (int i = 0; i < 6; i++)
     {
         Vector2 v2RandDir = new Vector2(-1f + (float)knark.NextDouble() * 2f, -1f + (float)knark.NextDouble() * 2f);
         if (v2RandDir == Vector2.Zero)
         {
             v2RandDir = new Vector2(1f, 0f);
         }
         v2RandDir.Normalize();
         float fRandGrade = (float)knark.NextDouble();
         SortedAnimated eff = Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Orig, SortedAnimated.SortedAnimatedEffects._HitEffect_SlimeParticle, v2RandDir * (0.5f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 2f), 35 + (int)(25f * fRandGrade), 25, 0.9f)) as SortedAnimated;
         eff.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
         (eff.xRenderComponent as AnimatedRenderComponent).fAnimationTimeWarp = 0.7f + fRandGrade * 0.6f;
     }
     if (master.xNetworkInfo.enCurrentRole != NetworkHelperInterface.NetworkRole.Client)
     {
         this.xStuckPlayer.xRenderComponent.SwitchAnimation(72, Animation.CancelOptions.RestartIfPlaying);
     }
     if (master.xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server)
     {
         if (this.xStuckPlayer != master.xLocalPlayer.xEntity)
         {
             NetOutgoingMessage om = master.xNetworkInfo.server.CreateMessage();
             om.Write(49);
             om.Write(72);
             master.xNetworkInfo.server.SendMessage(om, this.xStuckPlayer.Owner.netConnection, NetDeliveryMethod.ReliableUnordered);
         }
         Program.GetTheGame()._DynamicEnvironment_SendOnHit(this.iID);
     }
     master._EffectMaster_AddEffect(new DamageNumbers(this.xTransform.v2Pos + new Vector2(0f, -12f), 5, false, NoticeNumbers.NumberTileset.RedNumbers));
 }
Example #30
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     base.OnHitByAttack(xAtColData, xAtPhase);
     this.v2RandMoveDir = Vector2.Zero;
     this.bAggro = true;
     this.iWannaCircleBaby = 180;
 }