Example #1
0
 public void OnOwnerHardRelocate(PlayerEntity x, EventArgs e)
 {
     if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client)
     {
         this.TeleportToOwner();
     }
 }
 public EnvironmentSurfaceTrigger(PlayerEntity.EnvironmentSurface enSurfaceType, params Collider[] Colliders)
 {
     this.Colliders = Colliders;
     this.enSurfaceType = enSurfaceType;
     this.bRunOnClients = true;
     this.bBroadcastTrigger = false;
 }
Example #3
0
 public PlayerRenderComponent(PlayerEntity p_xOwnerObject)
 {
     this.xOwnerObject = p_xOwnerObject;
     this.enType = RenderComponent.ComponentType.PlayerRenderComponent;
     this.rt2dCurrentFrame = new RenderTarget2D(Program.GetTheGame().GraphicsDevice, 150, 150, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
     this.rt2dCurrentFrameOpaquePlayerShape = new RenderTarget2D(Program.GetTheGame().GraphicsDevice, 150, 150, false, SurfaceFormat.Color, DepthFormat.None);
     this.rt2dCurrentFrameOpaqueWeaponShape = new RenderTarget2D(Program.GetTheGame().GraphicsDevice, 150, 150, false, SurfaceFormat.Color, DepthFormat.None);
 }
 public PlayerLoadingRunRenderComponent(PlayerRenderComponent xParent)
 {
     this.av4ClothingColors = xParent.av4ClothingColors;
     this.av4HairdoColors = xParent.av4HairdoColors;
     PlayerAnimation xSAnim = xParent.dixAnimations[5];
     this.xOwnerObject = xParent.xOwnerObject;
     this.iActiveAnimation = xSAnim.iID;
     this.dixAnimations.Add(xSAnim.iID, new PlayerAnimation(xSAnim.iID, xSAnim.byAnimationDirection, xSAnim.xTextureSet, xSAnim.v2PositionOffset, 4, xSAnim.iEndFrame, xSAnim.iCellWidth, xSAnim.iCellHeight, xSAnim.iOffsetX, xSAnim.iOffsetY, xSAnim.iFramesPerRow, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, false, false, false, new AnimationInstruction[0]));
     this.fAlpha = 0f;
     this.rt2dCurrentFrame = new RenderTarget2D(Program.GetTheGame().GraphicsDevice, 150, 150, false, SurfaceFormat.Color, DepthFormat.None);
 }
Example #5
0
 public CardWatcher(PlayerEntity xTarget, Vector2 v2Lol, EnemyCodex.EnemyTypes enType)
 {
     this.xTransform = new TransformComponent(v2Lol);
     this.xTargetEntity = xTarget;
     Vector2 v2Dir = v2Lol - this.xTargetEntity.xTransform.v2Pos;
     this.enEnemyType = enType;
     v2Dir.Normalize();
     this.v2CurDir = v2Dir;
     this.fRotAdd = 0.01f + (float)Program.GetTheGame().randomInLogic.NextDouble() * 0.025f;
     this.fVelocity = (float)Program.GetTheGame().randomInLogic.NextDouble() * 1f + 3f;
     if (Program.GetTheGame().randomInLogic.Next(2) == 0)
     {
         this.iRotDir = 1;
     }
     else
     {
         this.iRotDir = -1;
     }
     ContentManager Content = Program.GetTheGame().Content;
     this.xRenderComponent = new AnimatedRenderComponent(this);
     this.xRenderComponent.dixAnimations[0] = new Animation(0, 0, Content.Load<Texture2D>("Items/Card/Card"), new Vector2(7f, 7f), 1, 12, 15, 15, 0, 0, 30, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[]
     {
         new AnimationInstruction(new AnimInsCriteria(AnimInsCriteria.Criteria.TriggerAlwaysAfterXTicks, new float[]
         {
             20f
         }), new AnimInsEvent(AnimInsEvent.EventType.ChangeTimeWarp, new float[]
         {
             0.975f
         })),
         new AnimationInstruction(new AnimInsCriteria(AnimInsCriteria.Criteria.TriggerOnceAfterXTicks, new float[]
         {
             54f
         }), new AnimInsEvent(AnimInsEvent.EventType.PlayAnimation, new float[]
         {
             1f
         }))
     });
     this.xRenderComponent.dixAnimations[1] = new Animation(1, 0, Content.Load<Texture2D>("Items/Card/Card"), new Vector2(7f, 7f), 8, 1, 15, 15, 0, 0, 30, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]);
     this.xRenderComponent.dixAnimations[1].enSpriteEffect = SpriteEffects.FlipHorizontally;
     this.xRenderComponent.xTransform = this.xTransform;
     this.xRenderComponent.fVirtualHeight = this.xTargetEntity.xRenderComponent.fVirtualHeight;
     this.xRenderComponent.v2OffsetRenderPos = new Vector2(0f, -15f);
     Program.GetTheGame().xRenderMaster.RegisterAboveSorted(this.xRenderComponent);
     Program.GetTheGame()._EffectMaster_AddEffect(new SortedAnimated(this.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.Card_Appear));
 }
Example #6
0
 public void SetPlayer(PlayerEntity xEntity)
 {
     this.iHpAtStartLol = xEntity.xBaseStats.iHP;
     this.xStuckPlayer = xEntity;
 }
Example #7
0
		public PlayerView(long connection)
		{
			this.xEntity = new PlayerEntity(this);
			this.iConnectionIdentifier = connection;
		}
Example #8
0
		public PlayerView()
		{
			this.xEntity = new PlayerEntity(this);
			this.iConnectionIdentifier = 0L;
		}
 public void OnOwnerAttackHit(PlayerEntity x, EventArgs e)
 {
     int iManaRegen = 10;
     if (this.iPowerLevel >= 2)
     {
         iManaRegen = 15;
     }
     if (this.iBuffTimer > this.iBuffTimerSet - iManaRegen)
     {
         iManaRegen -= (this.iBuffTimer - (this.iBuffTimerSet - iManaRegen)) / 2;
     }
     this.xPlayer.xEntity.xBaseStats.AddMana(iManaRegen);
     if (this.iBuffStacks < this.iBuffMaxStacks)
     {
         this.iBuffStacks++;
     }
     this.iBuffTimer = this.iBuffTimerSet;
     if (this.iPowerLevel < 3)
     {
         this.xPlayer.xEntity.xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.BerserkModeASPD, new BaseStats.EBuffFloat(this.iBuffTimer, (float)(3 * this.iBuffStacks), EquipmentInfo.StatEnum.ASPD, false));
         return;
     }
     if (this.iPowerLevel == 3)
     {
         this.xPlayer.xEntity.xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.BerserkModeASPD, new BaseStats.EBuffFloat(this.iBuffTimer, (float)(4 * this.iBuffStacks), EquipmentInfo.StatEnum.ASPD, false));
         this.xPlayer.xEntity.xBaseStats.AddStatusEffect(BaseStats.StatusEffectSource.BerserkModeCRIT, new BaseStats.EBuffFloat(this.iBuffTimer, (float)(2 * this.iBuffStacks), EquipmentInfo.StatEnum.Crit, false));
     }
 }
Example #10
0
 public void SetPlayer(PlayerEntity xEntity)
 {
     if (Utility.IsWithinRange((int)xEntity.xRenderComponent.iActiveAnimation, (int)this.iAnimStart, (int)(this.iAnimStart + 12)))
     {
         this.bToBeDestroyed = true;
         return;
     }
     xEntity.xRenderComponent.SwitchAnimation(Convert.ToUInt16(this.iAnimStart + (ushort)xEntity.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying);
     this.iHpAtStartLol = xEntity.xBaseStats.iHP;
     this.xStuckPlayer = xEntity;
     this.xRenderComponent.xTransform = this.xStuckPlayer.xTransform;
     this.xRenderComponent.fVirtualHeight = this.xStuckPlayer.xRenderComponent.fVirtualHeight + 2f;
     xEntity.bShieldUp = false;
     xEntity.bIsPushing = false;
     xEntity.xCollisionComponent.xMovementCollider.fWeight = 1000f;
     xEntity.xBaseStats.iKnockbackResistance = 5;
     if (xEntity == Program.game.xLocalPlayer.xEntity)
     {
         Program.game.xStolenInput = this;
     }
     if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Server)
     {
         NetOutgoingMessage om = Program.game._Network_CreateMessage();
         om.Write(105);
         om.Write(this.iID);
         om.Write(xEntity.Owner.iConnectionIdentifier);
         om.Write((ushort)this.enType);
         Program.game._Network_SendMessage(om, true);
     }
 }
Example #11
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     base.OnHitByAttack(xAtColData, xAtPhase);
     this.xLastHitBy = (xAtPhase.xOwner as PlayerEntity);
     Vector2 v2MidPoint = xAtColData.v2PointOfImpact;
     this.AddHitEffect(v2MidPoint);
     if (Program.GetTheGame().xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server)
     {
         base.SendClientInstruction(4, new float[]
         {
             v2MidPoint.X,
             v2MidPoint.Y
         });
     }
 }
Example #12
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;
 }
Example #13
0
 public override void Update()
 {
     this.iCooldown--;
     if (this.iCooldown == 0 && this.xCurrentCaught != null)
     {
         this.xAttackPhaseEnvironment.lxCurrentColliders[0].ibitLayers ^= this.xCurrentCaught.xCollisionComponent.ibitCurrentColliderLayer;
         this.xCurrentCaught = null;
     }
     if (this.xTargetActor != null && this.xTargetActor.xBaseStats.iHP <= 0)
     {
         this.bToBeDestroyed = true;
         return;
     }
     if (this.xOwnerEnemy != null)
     {
         return;
     }
     this.xTransform.v2Pos += this.v2Direction * this.fVelocity;
     this.xTransform.v2ServerPos = this.xTransform.v2Pos;
     if (this.iExistTimer % 90 == 0)
     {
         float fMaxSpeed = 0.06f;
         this.fRotSpeedTarget = -fMaxSpeed + fMaxSpeed * 2f * (float)CAS.RandomInLogic.NextDouble();
     }
     this.fCurrentRotSpeed = MathHelper.Lerp(this.fCurrentRotSpeed, this.fRotSpeedTarget, 0.1f);
     this.fCurrentRot += this.fCurrentRotSpeed;
     this.v2Direction = Utility.RadiansToVector2(this.fCurrentRot);
     this.iExistTimer++;
     int arg_13B_0 = GameSessionData.iBaseDifficulty;
     if (this.iExistTimer == this.iDestroyAt - 60)
     {
         this.xAttackPhasePlayer.UnregisterCurrent();
     }
     this.Cosmetic();
 }
Example #14
0
 public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase)
 {
     base.OnHitByAttack(xAtColData, xAtPhase);
     this.xLastHitBy = (xAtPhase.xOwner as PlayerEntity);
 }
Example #15
0
 public void SetPlayer(PlayerEntity xEntity, ISpellInstance xTornado)
 {
     if (Utility.IsWithinRange((int)xEntity.xRenderComponent.iActiveAnimation, 2600, 2603))
     {
         this.bToBeDestroyed = true;
         return;
     }
     this.v2ShootDir = Utility.RandomizeVector2Direction(CAS.RandomInLogic);
     xEntity.xRenderComponent.SwitchAnimation((ushort)(2600 + (int)xEntity.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying);
     this.xStuckPlayer = xEntity;
     this.xTheTornado = xTornado;
     this.xRenderComponent.xTransform = this.xStuckPlayer.xTransform;
     this.xRenderComponent.fVirtualHeight = this.xStuckPlayer.xRenderComponent.fVirtualHeight + 2f;
     xEntity.xCollisionComponent.xMovementCollider.fWeight = 1000f;
     xEntity.bShieldUp = false;
     xEntity.bIsPushing = false;
     if (xEntity == Program.game.xLocalPlayer.xEntity)
     {
         Program.game.xStolenInput = this;
     }
     if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Server)
     {
         NetOutgoingMessage om = Program.game._Network_CreateMessage();
         om.Write(255);
         om.Write(16);
         om.Write(this.iID);
         om.Write(xEntity.Owner.iConnectionIdentifier);
         om.Write(xTornado.iID);
         om.Write(this.v2ShootDir.X);
         om.Write(this.v2ShootDir.Y);
         Program.game._Network_SendMessage(om, true);
     }
 }