コード例 #1
0
ファイル: PlayerEntity.cs プロジェクト: ancientgods/SoG
 public override void Update()
 {
     this.iFrameUpdates++;
     this.iTimeSinceLatestNetworkUpdate += 1u;
     Game1 master = Program.GetTheGame();
     if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client)
     {
         float fHPPcnt = (float)this.xBaseStats.iHP / (float)this.xBaseStats.iMaxHP;
         if (this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_LastStand) > 0 && fHPPcnt < SpellVariable.Get(SpellVariable.Handle.Talent_LastStand_HPPercentThreshold) / 100f)
         {
             float fBuffFactor = SpellVariable.Get(SpellVariable.Handle.Talent_LastStand_DEFIncreasePercentPL) * (float)this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_LastStand) / 100f;
             this.xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.Talent_LastStand, new BaseStats.EBuffFloat(10, fBuffFactor, EquipmentInfo.StatEnum.DEFMultiplier, false));
         }
         if (this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_LastBreath) > 0 && fHPPcnt < SpellVariable.Get(SpellVariable.Handle.Talent_LastBreath_HPPercentThreshold) / 100f)
         {
             float fBuffFactor2 = SpellVariable.Get(SpellVariable.Handle.Talent_LastBreath_ATKIncrease) * (float)this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_LastBreath) / 100f;
             this.xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.Talent_LastBreath, new BaseStats.EBuffFloat(10, fBuffFactor2, EquipmentInfo.StatEnum.ATKMultiplier, false));
         }
         if (this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_LastSpark) > 0 && fHPPcnt < SpellVariable.Get(SpellVariable.Handle.Talent_LastSpark_HPPercentThreshold) / 100f)
         {
             float fBuffFactor3 = SpellVariable.Get(SpellVariable.Handle.Talent_LastSpark_MATKIncrease) * (float)this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_LastSpark) / 100f;
             this.xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.Talent_LastSpark, new BaseStats.EBuffFloat(10, fBuffFactor3, EquipmentInfo.StatEnum.MATKMultiplier, false));
         }
         float fEPPcnt = (float)this.xBaseStats.iEP / (float)this.xBaseStats.iMaxEP;
         if (this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_Manaburn) > 0 && fEPPcnt < SpellVariable.Get(SpellVariable.Handle.Talent_Manaburn_EPPercentThreshold) / 100f)
         {
             float fBuffFactor4 = SpellVariable.Get(SpellVariable.Handle.Talent_Manaburn_MATKIncrease) * (float)this.Owner.xViewStats.GetSkillLevel(SpellCodex.SpellTypes._Talent_Manaburn) / 100f;
             this.xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.Talent_Manaburn, new BaseStats.EBuffFloat(10, fBuffFactor4, EquipmentInfo.StatEnum.MATKMultiplier, false));
         }
     }
     if (this.iCancelPerfectGuardIn > 0)
     {
         this.iCancelPerfectGuardIn--;
         if (this.iCancelPerfectGuardIn == 0)
         {
             this.xBaseStats.bPerfectGuard = false;
         }
     }
     this.xCatchMode.Update();
     if (this.iArrowQueryDelay > 0)
     {
         this.iArrowQueryDelay--;
         if (this.iArrowQueryDelay == 0)
         {
             this.bCanPickupArrows = false;
         }
     }
     if (this.Owner.xViewStats.denfHPOfSummons.ContainsKey(SpellCodex.SpellTypes._Magic_Ice_FrostyFriend) && CAS.GameMode != StateMaster.GameModes.RogueLike)
     {
         ISummonInstance.RegisterSummonHP(this.Owner, SpellCodex.SpellTypes._Magic_Ice_FrostyFriend, this.Owner.xViewStats.denfHPOfSummons[SpellCodex.SpellTypes._Magic_Ice_FrostyFriend] + 0.001f, false);
     }
     if (this.byLightShiftDir == 6)
     {
         if (this.xLightPlate == null)
         {
             this.SetWhateverFlash(60, 10);
             this.xLightShiftReassembleEffect = null;
             this.xTransform.v2Pos = this.xTransform.v2ServerPos;
             this.byLightShiftDir = 10;
         }
         else if (Vector2.Distance(this.xTransform.v2Pos, this.xLightPlate.xTransform.v2Pos) >= 10f)
         {
             this.xTransform.v2Pos += Vector2.Normalize(this.xLightPlate.xTransform.v2Pos - this.xTransform.v2Pos) * 6f;
         }
         else if (this.xLightShiftReassembleEffect == null || this.xLightShiftReassembleEffect.bFirstIn || this.xLightShiftReassembleEffect.bToBeDestroyed)
         {
             this.SetWhateverFlash(60, 10);
             this.xLightShiftReassembleEffect = null;
             this.xTransform.v2Pos = this.xLightPlate.xTransform.v2Pos;
             this.byLightShiftDir = 10;
             this.xRenderComponent.SwitchAnimation((ushort)this.xLightPlate.xRenderComponent.GetCurrentAnimation().byAnimationDirection, Animation.CancelOptions.IgnoreIfPlaying);
         }
     }
     else if (this.byLightShiftDir < 4)
     {
         Program.GetTheGame()._EffectMaster_AddEffect(new VFX_PlayerGhostImage(this.Owner));
     }
     else if (this.byLightShiftDir >= 10)
     {
         this.byLightShiftDir += 1;
         if (this.byLightShiftDir < 30)
         {
             this.xRenderComponent.fAlpha = (float)(this.byLightShiftDir - 10) / 20f;
             this.xRenderComponent.fScale = (float)(this.byLightShiftDir - 10) / 20f;
         }
         else if (this.byLightShiftDir == 30)
         {
             if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client)
             {
                 this.ExitLightShift();
             }
             this.byLightShiftDir = 30;
             this.xRenderComponent.fAlpha = 1f;
             this.xRenderComponent.fScale = 1f;
         }
         else if (this.byLightShiftDir < 40)
         {
             this.xRenderComponent.SetEffect(master.dsxEffects["FlashWhite"], 2);
             if (this.xRenderComponent.xEffectWrapper == master.dsxEffects["FlashWhite"])
             {
                 float fWhiteGrade = 1f - (float)(this.byLightShiftDir - 30) / 10f;
                 this.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = fWhiteGrade;
             }
         }
         else if (this.byLightShiftDir == 40)
         {
             this.xRenderComponent.ClearEffect();
             this.byLightShiftDir = 4;
         }
     }
     if (this.xJumpDown != null)
     {
         this.iJumpOrClimbProgress++;
         if (this.iJumpOrClimbProgress >= 8)
         {
             TransformComponent expr_567_cp_0 = this.xTransform;
             expr_567_cp_0.v2Pos.Y = expr_567_cp_0.v2Pos.Y + 1f;
         }
         if (this.iJumpOrClimbProgress == 8)
         {
             NPC xPet = Program.game._Pet_FindPetInstanceOfOwner(this.Owner);
             if (xPet != null)
             {
                 (xPet.xBehaviour as PetAI).TurnInvisible();
             }
             this.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All);
             Random knark = Program.GetTheGame().randomInVisual;
             for (int i = 0; i < 2; i++)
             {
                 float fRotDir = 3.14159274f * (float)i + (float)knark.NextDouble() * 3.14159274f;
                 Vector2 v2Dir = Utility.RadiansToVector2(fRotDir);
                 float fModO = (float)knark.NextDouble();
                 _Effect_MovingAnimated eff = Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(this.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.Particle_DustCloudSmall01, v2Dir * (0.5f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 0.75f), 20 + (int)(5f * fModO), 10, 0.9f)) as _Effect_MovingAnimated;
                 eff.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
                 (eff.xRenderComponent as AnimatedRenderComponent).fAnimationTimeWarp = 1.3f;
                 eff.fRotationMod = (float)knark.NextDouble() * 0.5f - 0.25f;
             }
             for (int j = 0; j < 2; j++)
             {
                 float fRotDir2 = 3.14159274f * (float)j + (float)knark.NextDouble() * 3.14159274f;
                 Vector2 v2Dir2 = Utility.RadiansToVector2(fRotDir2);
                 float fModO2 = (float)knark.NextDouble();
                 _Effect_MovingAnimated eff2 = Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(this.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.Particle_DustCloudSmall02, v2Dir2 * (0.5f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 0.75f), 20 + (int)(5f * fModO2), 10, 0.9f)) as _Effect_MovingAnimated;
                 eff2.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
                 (eff2.xRenderComponent as AnimatedRenderComponent).fAnimationTimeWarp = 1.3f;
                 eff2.fRotationMod = (float)knark.NextDouble() * 0.5f - 0.25f;
             }
         }
         if (this.iJumpOrClimbProgress >= 8)
         {
             if (this.iJumpOrClimbProgress < 28)
             {
                 PlayerRenderComponent expr_7BA_cp_0 = this.xRenderComponent;
                 expr_7BA_cp_0.v2OffsetRenderPos.Y = expr_7BA_cp_0.v2OffsetRenderPos.Y - (float)(20 - (this.iJumpOrClimbProgress - 8)) / 8f;
             }
             else if (this.iJumpOrClimbProgress < 48)
             {
                 PlayerRenderComponent expr_7F2_cp_0 = this.xRenderComponent;
                 expr_7F2_cp_0.v2OffsetRenderPos.Y = expr_7F2_cp_0.v2OffsetRenderPos.Y + (float)(this.iJumpOrClimbProgress - 28) / 8f;
             }
             else
             {
                 this.xRenderComponent.v2OffsetRenderPos.Y = 0f;
                 TransformComponent expr_833_cp_0 = this.xTransform;
                 expr_833_cp_0.v2Pos.Y = expr_833_cp_0.v2Pos.Y + 4f;
                 if (this.iJumpOrClimbProgress == 50)
                 {
                     this.xRenderComponent.fVirtualHeight += this.xJumpDown.fVirtualHeightDifference;
                 }
                 if (this.xTransform.v2Pos.Y >= this.xJumpDown.fTargetY)
                 {
                     this.xTransform.v2Pos.Y = this.xJumpDown.fTargetY;
                     if (this.iJumpOrClimbProgress < 50)
                     {
                         this.xRenderComponent.fVirtualHeight += this.xJumpDown.fVirtualHeightDifference;
                     }
                     this.xCollisionComponent.ChangeColliderLayer(this.xJumpDown.ibitTargetLayer);
                     this.xJumpDown = null;
                     this.iJumpOrClimbProgress = 0;
                     if (!this.Owner.xViewStats.bIsDead)
                     {
                         this.xRenderComponent.SwitchAnimation(87, Animation.CancelOptions.IgnoreIfPlaying);
                         this.xCollisionComponent.ActivateGroup(CollisionComponent.ColliderGroup.All);
                     }
                     else
                     {
                         this.xCollisionComponent.ActivateGroup(CollisionComponent.ColliderGroup.Movement);
                     }
                     NPC xPet2 = Program.game._Pet_FindPetInstanceOfOwner(this.Owner);
                     if (xPet2 != null)
                     {
                         (xPet2.xBehaviour as PetAI).HardRelocate();
                     }
                     if (this.HardRelocateEvent != null)
                     {
                         this.HardRelocateEvent(this, this.e);
                     }
                     Random knark2 = Program.GetTheGame().randomInVisual;
                     for (int k = 0; k < 8; k++)
                     {
                         float fRotDir3 = 0.7853982f * (float)k + (float)knark2.NextDouble() * 0.7853982f;
                         Vector2 v2Dir3 = Utility.RadiansToVector2(fRotDir3);
                         float fModO3 = (float)knark2.NextDouble();
                         _Effect_MovingAnimated eff3 = Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(this.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.Particle_DustCloudSmall01, v2Dir3 * (1f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 0.75f), 30 + (int)(5f * fModO3), 10, 0.9f)) as _Effect_MovingAnimated;
                         eff3.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
                         (eff3.xRenderComponent as AnimatedRenderComponent).fAnimationTimeWarp = 1.3f;
                         eff3.fRotationMod = (float)knark2.NextDouble() * 0.5f - 0.25f;
                     }
                     for (int l = 0; l < 8; l++)
                     {
                         float fRotDir4 = 0.7853982f * (float)l + (float)knark2.NextDouble() * 0.7853982f;
                         Vector2 v2Dir4 = Utility.RadiansToVector2(fRotDir4);
                         float fModO4 = (float)knark2.NextDouble();
                         _Effect_MovingAnimated eff4 = Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(this.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.Particle_DustCloudSmall02, v2Dir4 * (1f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 0.75f), 30 + (int)(5f * fModO4), 10, 0.9f)) as _Effect_MovingAnimated;
                         eff4.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
                         (eff4.xRenderComponent as AnimatedRenderComponent).fAnimationTimeWarp = 1.3f;
                         eff4.fRotationMod = (float)knark2.NextDouble() * 0.5f - 0.25f;
                     }
                     if (Program.GetTheGame().xNetworkInfo.enCurrentRole != NetworkHelperInterface.NetworkRole.Client)
                     {
                         this.ExitLockedState();
                     }
                     if (this.Owner == Program.GetTheGame().xLocalPlayer)
                     {
                         Program.GetTheGame().xInput_Game.RecheckAll();
                     }
                 }
             }
         }
     }
     if (this.xClimbUp != null)
     {
         this.iJumpOrClimbProgress++;
         if (this.iJumpOrClimbProgress == 8)
         {
             NPC xPet3 = Program.game._Pet_FindPetInstanceOfOwner(this.Owner);
             if (xPet3 != null)
             {
                 (xPet3.xBehaviour as PetAI).TurnInvisible();
             }
             this.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All);
         }
         if (this.iJumpOrClimbProgress >= 8)
         {
             if (this.iJumpOrClimbProgress % 17 == 8)
             {
                 this.xClimbUp.xRenderComponent.SwitchAnimation(3);
             }
             this.xRenderComponent.v2OffsetRenderPos.Y = 0f;
             TransformComponent expr_C25_cp_0 = this.xTransform;
             expr_C25_cp_0.v2Pos.Y = expr_C25_cp_0.v2Pos.Y - 1f;
             if (this.iJumpOrClimbProgress == 50)
             {
                 this.xRenderComponent.fVirtualHeight += this.xClimbUp.fVirtualHeightDifference;
             }
             if (this.xTransform.v2Pos.Y <= this.xClimbUp.fTargetY)
             {
                 this.xTransform.v2Pos.Y = this.xClimbUp.fTargetY;
                 if (this.iJumpOrClimbProgress < 50)
                 {
                     this.xRenderComponent.fVirtualHeight += this.xClimbUp.fVirtualHeightDifference;
                 }
                 this.xCollisionComponent.ChangeColliderLayer(this.xClimbUp.ibitTargetLayer);
                 this.xClimbUp = null;
                 this.iJumpOrClimbProgress = 0;
                 if (!this.Owner.xViewStats.bIsDead)
                 {
                     this.xRenderComponent.SwitchAnimation(2304, Animation.CancelOptions.IgnoreIfPlaying);
                 }
                 else
                 {
                     this.xCollisionComponent.ActivateGroup(CollisionComponent.ColliderGroup.Movement);
                 }
                 NPC xPet4 = Program.game._Pet_FindPetInstanceOfOwner(this.Owner);
                 if (xPet4 != null)
                 {
                     (xPet4.xBehaviour as PetAI).HardRelocate();
                 }
                 if (this.HardRelocateEvent != null)
                 {
                     this.HardRelocateEvent(this, this.e);
                 }
                 if (Program.GetTheGame().xNetworkInfo.enCurrentRole != NetworkHelperInterface.NetworkRole.Client)
                 {
                     this.ExitLockedState();
                 }
                 if (this.Owner == Program.GetTheGame().xLocalPlayer)
                 {
                     Program.GetTheGame().xInput_Game.RecheckAll();
                 }
             }
         }
     }
     if (this.xCurrentSpellCharge != null)
     {
         this.xCurrentSpellCharge.Update();
     }
     if (master.bEffectsOn)
     {
         if (this.xRenderComponent.xGlow.bIsActive)
         {
             Color endCol = Color.White;
             if (!this.xBaseStats.deniStatusChangeDuration.ContainsKey(BaseStats.StatusEffectSource.ProtectLv1) && !this.xBaseStats.denxActiveEffects.ContainsKey(BaseStats.StatusEffectSource.BerserkModeDMG) && this.xCurrentSpellCharge == null && this.lxSmallGlows.Count == 0)
             {
                 this.xRenderComponent.xGlow.FadeOut();
             }
             else
             {
                 List<Color> lcColors = new List<Color>();
                 if (this.xBaseStats.deniStatusChangeDuration.ContainsKey(BaseStats.StatusEffectSource.ProtectLv1))
                 {
                     lcColors.Add(Color.LightBlue);
                 }
                 if (this.xBaseStats.denxActiveEffects.ContainsKey(BaseStats.StatusEffectSource.BerserkModeDMG))
                 {
                     lcColors.Add(Color.Red);
                 }
                 if (this.xCurrentSpellCharge != null && this.xCurrentSpellCharge.xGlowPartial != null)
                 {
                     lcColors.Add(this.xCurrentSpellCharge.xGlowPartial.cColor);
                 }
                 for (int m = 0; m < this.lxSmallGlows.Count; m++)
                 {
                     lcColors.Add(this.lxSmallGlows[m].cColor);
                 }
                 if (lcColors.Count >= 1)
                 {
                     endCol = lcColors[0];
                     for (int n = 1; n < lcColors.Count; n++)
                     {
                         endCol = Color.Lerp(endCol, lcColors[n], 1f / (float)lcColors.Count);
                     }
                 }
                 this.xRenderComponent.xGlow.cGlowCol = endCol;
             }
             this.xRenderComponent.xGlow.Update();
             for (int i2 = 0; i2 < this.lxSmallGlows.Count; i2++)
             {
                 this.lxSmallGlows[i2].iTimeLeft--;
                 if (this.lxSmallGlows[i2].iTimeLeft <= 0)
                 {
                     if (this.lxSmallGlows[i2].xAttachedParams != null)
                     {
                         int iWidth = this.lxSmallGlows[i2].xAttachedParams.iWidth;
                         if (iWidth >= this.xRenderComponent.xGlow.iWidth)
                         {
                             int iWidest = 0;
                             this.lxSmallGlows.RemoveAt(i2--);
                             for (int j2 = 0; j2 < this.lxSmallGlows.Count; j2++)
                             {
                                 if (this.lxSmallGlows[j2].xAttachedParams != null && this.lxSmallGlows[j2].xAttachedParams.iWidth > iWidest)
                                 {
                                     iWidest = this.lxSmallGlows[j2].xAttachedParams.iWidth;
                                 }
                             }
                             this.xRenderComponent.xGlow.iWidth = iWidest;
                             goto IL_1048;
                         }
                     }
                     this.lxSmallGlows.RemoveAt(i2--);
                 }
                 IL_1048:;
             }
         }
         if (this.xRenderComponent.xWeaponGlow.bIsActive)
         {
             this.xRenderComponent.xWeaponGlow.Update();
         }
     }
     if (this.Owner.xViewStats.bIsDead && CAS.GameMode != StateMaster.GameModes.RogueLike && !Program.game.xCutsceneMaster.bInCutscene)
     {
         float fMaxDistance = 20f;
         if (this.xResurrectAid.xCurrentResurrector != null)
         {
             PlayerView xPlayer = this.xResurrectAid.xCurrentResurrector;
             if (xPlayer.xViewStats.bIsDead || (!Utility.IsWithinRange((int)xPlayer.xEntity.xRenderComponent.iActiveAnimation, 0, 3) && !Utility.IsWithinRange((int)xPlayer.xEntity.xRenderComponent.iActiveAnimation, 512, 515)) || Vector2.Distance(this.xTransform.v2Pos, xPlayer.xEntity.xTransform.v2Pos) > fMaxDistance)
             {
                 if (!xPlayer.xViewStats.bIsDead)
                 {
                     xPlayer.xEntity.xRenderComponent.SwitchAnimation((ushort)(516 + (int)xPlayer.xEntity.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying);
                 }
                 if (this.xResurrectAid.xResurrectMeterSound != null)
                 {
                     this.xResurrectAid.xResurrectMeterSound.Stop();
                     if (this.xResurrectAid.iCounter > 30)
                     {
                         Program.game.xSoundSystem.PlayCue("ResurrectionMeterCancel", this.xResurrectAid.xCurrentResurrector.xEntity.xTransform.v2Pos);
                     }
                 }
                 this.xResurrectAid.iCounter = 0;
                 this.xResurrectAid.xCurrentResurrector = null;
             }
             else
             {
                 this.xResurrectAid.iCounter++;
                 xPlayer.xEntity.xRenderComponent.SwitchAnimation((ushort)(512 + (int)xPlayer.xEntity.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying);
                 if (this.xResurrectAid.iCounter > this.xResurrectAid.iResurrectTick && master.xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server)
                 {
                     master.__Player_CombatRevivePlayerServerLogic(this.Owner);
                     xPlayer.xEntity.xRenderComponent.SwitchAnimation((ushort)(508 + (int)xPlayer.xEntity.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying);
                     xPlayer.xEntity.xRenderComponent.fPassedTicks = 12f;
                     master._EffectMaster_AddEffect(new Effect_CrossFadeFlash(Program.GetTheGame().Content.Load<Texture2D>("GUI/HUD/castbar_filled"), Program.GetTheGame().Content.Load<Texture2D>("GUI/HUD/castbar_flash"), Vector2.Zero, 15, 20, 35)
                     {
                         rcFirstTexture =
                         {
                             v2OffsetRenderPos = new Vector2(1f, -37f)
                         },
                         rcSecondTexture =
                         {
                             v2OffsetRenderPos = new Vector2(1f, -37f)
                         }
                     });
                     this.xResurrectAid.xCurrentResurrector = null;
                     this.xResurrectAid.iCounter = 0;
                 }
             }
         }
         else
         {
             foreach (PlayerView xPlayer2 in master.dixPlayers.Values)
             {
                 if (!xPlayer2.xViewStats.bIsDead && (Utility.IsWithinRange((int)xPlayer2.xEntity.xRenderComponent.iActiveAnimation, 0, 3) || Utility.IsWithinRange((int)xPlayer2.xEntity.xRenderComponent.iActiveAnimation, 512, 515)) && Vector2.Distance(this.xTransform.v2Pos, xPlayer2.xEntity.xTransform.v2Pos) <= fMaxDistance)
                 {
                     this.xResurrectAid.xCurrentResurrector = xPlayer2;
                     this.xResurrectAid.xResurrectMeterSound = Program.game.xSoundSystem.PlayCue("ResurrectionMeterFill", xPlayer2.xEntity.xTransform);
                     break;
                 }
             }
         }
     }
     if (this.iPhasing != 0)
     {
         this.iPhasing++;
         if (this.iPhasing > 0)
         {
             if (master.xLocalPlayer.xEntity != this)
             {
                 this.xRenderComponent.fAlpha = 1f - (float)this.iPhasing / 30f;
             }
             if (this.iPhasing >= 25)
             {
                 this.xTransform.SetBoth(this.xActivePhasingField.v2TargetPosition);
                 master._Level_OnPhasingComplete(this.Owner, this.xActivePhasingField);
                 this.iPhasing = -5;
                 this.xActivePhasingField = null;
                 this.xRenderComponent.fAlpha = 1f;
             }
         }
         return;
     }
     if (this.xBaseStats.deniStatusChangeDuration.ContainsKey(BaseStats.StatusEffectSource.Chilled))
     {
         Color cFreezeCol = new Color(160, 200, 250);
         this.xRenderComponent.cOverlayColor = cFreezeCol * 0.5f;
         this.xRenderComponent.fAnimationTimeWarp = 0.8f;
         if (this.xBaseStats.deniStatusChangeDuration[BaseStats.StatusEffectSource.Chilled].iDuration <= 1)
         {
             this.xRenderComponent.cOverlayColor = Color.White * 0f;
             this.xRenderComponent.fAnimationTimeWarp = 1f;
         }
         if (this.iFrameUpdates % 14 == 0)
         {
             _Effect_SnowFlakeAnimated asd = (_Effect_SnowFlakeAnimated)Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_SnowFlakeAnimated(this.xTransform.v2Pos + new Vector2((float)(-6 + CAS.RandomInVisual.Next(12)), (float)(-4 - CAS.RandomInVisual.Next(10))), SortedAnimated.SortedAnimatedEffects._StatusEffects_Chilled_SnowFlake, -20f, 0.25f, 75, 0.2f, 30));
             asd.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
             asd.iFadeBeforeEnd = 25;
         }
     }
     else if (this.xBaseStats.deniStatusChangeDuration.ContainsKey(BaseStats.StatusEffectSource.Burning))
     {
         Color cBurnCol = Color.Red;
         this.xRenderComponent.cOverlayColor = cBurnCol * 0.5f;
         if (this.xBaseStats.deniStatusChangeDuration[BaseStats.StatusEffectSource.Burning].iDuration <= 10)
         {
             float fBurnOverlayAlpha = (float)this.xBaseStats.deniStatusChangeDuration[BaseStats.StatusEffectSource.Burning].iDuration / 10f;
             this.xRenderComponent.cOverlayColor *= fBurnOverlayAlpha;
         }
         this.xRenderComponent.fAnimationTimeWarp = 0.8f;
         if (this.xBaseStats.deniStatusChangeDuration[BaseStats.StatusEffectSource.Burning].iDuration <= 1)
         {
             this.xRenderComponent.cOverlayColor = Color.White * 0f;
             this.xRenderComponent.fAnimationTimeWarp = 1f;
         }
     }
     if (this.iPostHitInvincibility > 0)
     {
         this.iPostHitInvincibility--;
         if (this.enHitEffectType == Enemy.HitEffectType.Electro)
         {
             if (this.iPostHitInvincibility % 4 > 1)
             {
                 this.xRenderComponent.cColor = Color.Black;
             }
             else
             {
                 this.xRenderComponent.cColor = Color.White;
             }
         }
     }
     if (this.iPostHitInvincibility == 0)
     {
         this.xRenderComponent.iBlinking = 0;
         this.enHitEffectType = Enemy.HitEffectType.Normal;
     }
     if (this.iLevelUpEffectLoop > 0)
     {
         if (this.xRenderComponent.xEffectWrapper == master.dsxEffects["FlashWhite"])
         {
             float fWhiteGrade2 = 1f;
             if (this.iLevelUpEffectLoop < 20)
             {
                 fWhiteGrade2 = (float)this.iLevelUpEffectLoop / 20f;
             }
             else if (this.iLevelUpEffectLoop > 40)
             {
                 fWhiteGrade2 = 1f - (float)(this.iLevelUpEffectLoop - 40) / 10f;
             }
             this.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = fWhiteGrade2;
             this.iLevelUpEffectLoop++;
             if (this.iLevelUpEffectLoop == 50)
             {
                 SortedAnimated xEffikto = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(Vector2.Zero, SortedAnimated.SortedAnimatedEffects._GUIEffects_LevelupText));
                 xEffikto.xRenderComponent.xTransform = this.xTransform;
                 xEffikto.xRenderComponent.v2OffsetRenderPos = new Vector2(0f, -22f);
                 this.iLevelUpEffectLoop = 0;
                 this.xRenderComponent.ClearEffect();
                 if (Program.game.xLocalPlayer.xViewStats.iTalentPoints > 0)
                 {
                     this.Owner.xGUIStuff.iLevelUpReminder = 0;
                     this.Owner.xGUIStuff.v2CharacterScreenPosAtLevelUp = this.Owner.xEntity.xTransform.v2Pos - Program.GetTheGame().xCamera.v2TopLeft - new Vector2(0f, 20f);
                 }
             }
         }
         else
         {
             this.iLevelUpEffectLoop = 0;
         }
     }
     if (this.iDeathLoop > 0)
     {
         this.iDeathLoop++;
         int iExplode = 45;
         int iEnd = 70;
         if (this.iDeathLoop < iExplode)
         {
             float fWhiteGrade3 = (float)this.iDeathLoop / (float)iExplode;
             if (this.xRenderComponent.xEffectWrapper == Program.game.dsxEffects["FlashWhite"])
             {
                 this.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = fWhiteGrade3;
             }
         }
         else if (this.iDeathLoop == iExplode)
         {
             Random knark3 = Program.GetTheGame().randomInVisual;
             this.xRenderComponent.SwitchAnimation((ushort)this.byAnimationDirection, Animation.CancelOptions.RestartIfPlaying);
             Program.GetTheGame()._EffectMaster_AddEffect(new SortedAnimated(this.Owner.xEntity.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.PoofEffectA));
             Vector2 v2CenterPos = this.xTransform.v2Pos + new Vector2(0f, -10f);
             float fHeightPlus = 10f;
             for (int i3 = 0; i3 < 15; i3++)
             {
                 Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2CenterPos, SortedAnimated.SortedAnimatedEffects.Death_PlayerDeathGlitterA, Utility.RandomizeVector2Direction(knark3) * (2f + (float)knark3.NextDouble() * 2f), 60, 20, 0.93f + (float)knark3.NextDouble() * 0.05f)).xRenderComponent.fVirtualHeight += fHeightPlus + this.xRenderComponent.fVirtualHeight;
             }
             for (int i4 = 0; i4 < 15; i4++)
             {
                 Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2CenterPos, SortedAnimated.SortedAnimatedEffects.Death_PlayerDeathGlitterB, Utility.RandomizeVector2Direction(knark3) * (2f + (float)knark3.NextDouble() * 2f), 60, 20, 0.93f + (float)knark3.NextDouble() * 0.05f)).xRenderComponent.fVirtualHeight += fHeightPlus + this.xRenderComponent.fVirtualHeight;
             }
             for (int i5 = 0; i5 < 15; i5++)
             {
                 Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2CenterPos, SortedAnimated.SortedAnimatedEffects.Death_PlayerDeathGlitterC, Utility.RandomizeVector2Direction(knark3) * (2f + (float)knark3.NextDouble() * 2f), 60, 20, 0.93f + (float)knark3.NextDouble() * 0.05f)).xRenderComponent.fVirtualHeight += fHeightPlus + this.xRenderComponent.fVirtualHeight;
             }
         }
         else if (this.iDeathLoop > iExplode && this.iDeathLoop == iEnd)
         {
             this.xRenderComponent.ClearEffect();
             this.iDeathLoop = 0;
         }
     }
     if (this.iWhateverFlash > 0)
     {
         if (this.xRenderComponent.xEffectWrapper == master.dsxEffects["FlashWhite"])
         {
             float fWhiteGrade4 = 1f;
             if (this.iWhateverFlash < 10)
             {
                 fWhiteGrade4 = (float)this.iWhateverFlash / 10f;
             }
             this.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = fWhiteGrade4;
             this.iWhateverFlash--;
             if (this.iWhateverFlash <= 0)
             {
                 this.xRenderComponent.ClearEffect();
             }
         }
         else
         {
             this.iWhateverFlash = 0;
         }
     }
     if (this.Owner.xEquipment.xQuickSlot1 != null)
     {
         this.Owner.xEquipment.xQuickSlot1.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot2 != null)
     {
         this.Owner.xEquipment.xQuickSlot2.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot3 != null)
     {
         this.Owner.xEquipment.xQuickSlot3.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot4 != null)
     {
         this.Owner.xEquipment.xQuickSlot4.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot5 != null)
     {
         this.Owner.xEquipment.xQuickSlot5.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot6 != null)
     {
         this.Owner.xEquipment.xQuickSlot6.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot7 != null)
     {
         this.Owner.xEquipment.xQuickSlot7.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot8 != null)
     {
         this.Owner.xEquipment.xQuickSlot8.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot9 != null)
     {
         this.Owner.xEquipment.xQuickSlot9.iFlashCycle--;
     }
     if (this.Owner.xEquipment.xQuickSlot10 != null)
     {
         this.Owner.xEquipment.xQuickSlot10.iFlashCycle--;
     }
     if (!master.xCutsceneMaster.bInCutscene && !master.xDialogueSystem.bInDialogue)
     {
         this.xBaseStats.Update();
     }
     if (this.bShieldUp)
     {
         this.xBaseStats.iInShield = (short)this.byAnimationDirection;
         return;
     }
     this.xBaseStats.iInShield = -1;
 }
コード例 #2
0
ファイル: PlayerEntity.cs プロジェクト: ancientgods/SoG
 public override void OnMovementCollision(CollisionData xCollisionData)
 {
     IEntity xOtherEntity = xCollisionData.xOtherEntity;
     if (xOtherEntity == null)
     {
         return;
     }
     if (this.bInTeleportMode && !false)
     {
         VFX_PlayerGhostImage moss = Program.GetTheGame()._EffectMaster_AddEffect(new VFX_PlayerGhostImage_Grow(this.Owner, 0.05f)) as VFX_PlayerGhostImage;
         this.byLightShiftDir = 6;
         moss.fAlphaChange = 0.07f;
         this.xLightShiftReassembleEffect = (Program.GetTheGame()._EffectMaster_AddEffect(new Effect_Reassemble(new TransformComponent(this.xTransform.v2Pos), this.xLightPlate.xTransform, this.xRenderComponent.fVirtualHeight, SortedAnimated.SortedAnimatedEffects.LightShift_ReassembleGlitter)) as Effect_Reassemble);
         this.xRenderComponent.fAlpha = 0f;
         if (Program.GetTheGame().xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server)
         {
             NetOutgoingMessage om = Program.GetTheGame()._Network_CreateMessage();
             om.Write(92);
             om.Write(2);
             om.Write(this.Owner.iConnectionIdentifier);
             om.Write(this.xTransform.v2Pos.X);
             om.Write(this.xTransform.v2Pos.Y);
             Program.GetTheGame()._Network_SendMessage(om, true);
         }
         return;
     }
     if (xOtherEntity.enEntityType == IEntity.EntityType.DynamicEnvironment)
     {
         DynamicEnvironment xEn = xOtherEntity as DynamicEnvironment;
         if (xEn.bPuzzlePart)
         {
             PuzzleBox xPuz = xEn as PuzzleBox;
             if (this.bHasDirection && xPuz.bIsMovable)
             {
                 if (!this.bShieldUp && Utility.ConvertV2DirectionToClosestByteDirection(xOtherEntity.xTransform.v2Pos - this.xTransform.v2Pos) == this.byAnimationDirection)
                 {
                     this.bIsPushing = true;
                 }
                 else
                 {
                     this.bIsPushing = false;
                 }
             }
         }
     }
     if (xOtherEntity.enEntityType == IEntity.EntityType.Enemy)
     {
         Enemy xEn2 = xOtherEntity as Enemy;
         if (xEn2.enType == EnemyCodex.EnemyTypes.LivingPuzzleBlock && (xEn2.xBehaviour as LivingPuzzleBlockAI).bIncapacitated && this.bHasDirection)
         {
             if (!this.bShieldUp && Utility.ConvertV2DirectionToClosestByteDirection(xOtherEntity.xTransform.v2Pos - this.xTransform.v2Pos) == this.byAnimationDirection)
             {
                 this.bIsPushing = true;
             }
             else
             {
                 this.bIsPushing = false;
             }
         }
     }
     if (xCollisionData.colOtherCollider.bTriggerPushAnimation && this.bHasDirection)
     {
         if (!this.bShieldUp && Utility.ConvertV2DirectionToClosestByteDirection(-xCollisionData.v2CollisionNormal) == this.byAnimationDirection)
         {
             this.bIsPushing = true;
             return;
         }
         this.bIsPushing = false;
     }
 }