public GlowTrailRenderComponent(Texture2D p_txTextre, TransformComponent p_xMountTransform, float p_fTrailLength = 0.05f)
 {
     this.txTexture = p_txTextre;
     this.enType = RenderComponent.ComponentType.StaticRenderComponent;
     this.xTransform = p_xMountTransform;
     this.fLength = p_fTrailLength;
 }
Esempio n. 2
0
 public StaticRenderComponent(Texture2D p_txTextre, TransformComponent p_xMountTransform)
 {
     this.txTexture = p_txTextre;
     this.enType = RenderComponent.ComponentType.StaticRenderComponent;
     this.xTransform = p_xMountTransform;
     this.v2Offset = Utility.PointToVector2(p_txTextre.Bounds.Center);
 }
Esempio n. 3
0
 public SphereCollider(float p_fRadius, Vector2 p_v2LocalPosition, TransformComponent p_xMount, float p_fWeight, IEntity p_xOwner)
 {
     this.enColliderType = Collider.ColliderType.Sphere;
     this.fRadius = p_fRadius;
     this.xMountTransform = p_xMount;
     this.bFollowMount = true;
     this.xLocalTransform = new TransformComponent(p_v2LocalPosition);
     this.fWeight = p_fWeight;
     this.xOwnerObject = p_xOwner;
     if (p_xOwner != null)
     {
         if (p_xOwner.enEntityType == IEntity.EntityType.Player)
         {
             this.xAttackPhase = ((PlayerEntity)p_xOwner).xAttackPhase;
             this.xBaseStats = ((PlayerEntity)p_xOwner).xBaseStats;
             return;
         }
         if (p_xOwner.enEntityType == IEntity.EntityType.Enemy)
         {
             this.xAttackPhase = ((Enemy)p_xOwner).xAttackPhase;
             this.xBaseStats = ((Enemy)p_xOwner).xBaseStats;
             return;
         }
         if (p_xOwner.enEntityType == IEntity.EntityType.NPC)
         {
             this.xAttackPhase = ((Enemy)p_xOwner).xAttackPhase;
             this.xBaseStats = ((Enemy)p_xOwner).xBaseStats;
             return;
         }
         if (p_xOwner.enEntityType == IEntity.EntityType.DynamicEnvironment)
         {
             this.xBaseStats = ((DynamicEnvironment)p_xOwner).xBaseStats;
         }
     }
 }
Esempio n. 4
0
 public ProximityBasedAlpha(RenderComponent rcComponent, TransformComponent xTransformA, TransformComponent xTransformB, float fFullAlphaDistance, float fNoAlphaDistance, float fAlphaMultiplier = 1f)
 {
     this.rc = rcComponent;
     this.xTransformA = xTransformA;
     this.xTransformB = xTransformB;
     this.fFullAlphaDistance = fFullAlphaDistance;
     this.fNoAlphaDistance = fNoAlphaDistance;
     this.fAlphaMultiplier = fAlphaMultiplier;
 }
 public GlowTrailConPostRenderComponent(Texture2D p_txTextre, TransformComponent p_xMountTransform, float fMin, float fAdd, float p_fTrailLength = 0.05f)
 {
     this.txTexture = p_txTextre;
     this.enType = RenderComponent.ComponentType.StaticRenderComponent;
     this.xTransform = p_xMountTransform;
     this.fLength = p_fTrailLength;
     this.fMin = fMin;
     this.fAdd = fAdd;
 }
 public override void Init(NetIncomingMessage msg, params float[] p_afInitFloats)
 {
     this.bSendNetworkUpdates = false;
     this.iRotDir = (int)p_afInitFloats[0];
     this.fCurRot = p_afInitFloats[1];
     this.fRotSpeed = p_afInitFloats[2];
     this.fCurDistance = p_afInitFloats[3];
     this.fDistanceSpeed = p_afInitFloats[4];
     this.xOrbitTransform = new TransformComponent(new Vector2(p_afInitFloats[5], p_afInitFloats[6]));
 }
 public void ConveyorMove(TransformComponent x)
 {
     for (int i = 0; i < this.lxConveyorMos.Count; i++)
     {
         if (this.lxConveyorMos[i].recEffectArea.Contains(Utility.Vector2ToPoint(x.v2Pos)))
         {
             x.v2Pos += this.lxConveyorMos[i].v2Move;
             x.v2ServerPos += this.lxConveyorMos[i].v2Move;
         }
     }
 }
Esempio n. 8
0
		public override void OnEnter()
		{
			base.OnEnter();
			if (this.xEntity == null)
			{
				this.bToBeDestroyed = true;
				return;
			}
			this.bToBeDestroyed = true;
			this.xTransformToSet = this.xEntity.xTransform;
			this.xTransformToSet.v2Pos = (this.xTransformToSet.v2ServerPos = this.v2PositionToSet);
		}
Esempio n. 9
0
 public Effect_Reassemble(TransformComponent xSource, TransformComponent xTarget, float fVirtualHeight, SortedAnimated.SortedAnimatedEffects enEffect)
 {
     this.xTarget = xTarget;
     this.xSource = xSource;
     (xTarget.v2Pos - xSource.v2Pos).Normalize();
     float fPart = 0.7853982f;
     for (int i = 0; i < 8; i++)
     {
         this.lxBeamParts.Add(Program.GetTheGame()._EffectMaster_AddEffect(new SortedAnimated(xSource.v2Pos, enEffect)) as SortedAnimated);
         this.v2DirLol.Add(Utility.RadiansToVector2(fPart * (float)i) * 10f);
     }
 }
Esempio n. 10
0
 public BoxCollider(int p_iWidth, int p_iHeight, float p_fRotation, Vector2 p_v2LocalPosition, TransformComponent p_xMount, float p_fWeight, IEntity p_xOwner)
 {
     this.enColliderType = Collider.ColliderType.Box;
     this.fRotation = p_fRotation;
     if (p_xMount != null)
     {
         this.xMountTransform = p_xMount;
         this.bFollowMount = true;
     }
     this.xLocalTransform = new TransformComponent(p_v2LocalPosition);
     this.fWeight = p_fWeight;
     this.xOwnerObject = p_xOwner;
     this.iWidth = p_iWidth;
     this.iHeight = p_iHeight;
     if (p_xOwner != null)
     {
         if (p_xOwner.enEntityType == IEntity.EntityType.Player)
         {
             this.xAttackPhase = ((PlayerEntity)p_xOwner).xAttackPhase;
             this.xBaseStats = ((PlayerEntity)p_xOwner).xBaseStats;
             return;
         }
         if (p_xOwner.enEntityType == IEntity.EntityType.DynamicEnvironment)
         {
             this.xBaseStats = ((DynamicEnvironment)p_xOwner).xBaseStats;
             return;
         }
         if (p_xOwner.enEntityType == IEntity.EntityType.NPC)
         {
             this.xAttackPhase = ((Enemy)p_xOwner).xAttackPhase;
             this.xBaseStats = ((Enemy)p_xOwner).xBaseStats;
             return;
         }
         if (p_xOwner.enEntityType == IEntity.EntityType.Enemy)
         {
             this.xAttackPhase = ((Enemy)p_xOwner).xAttackPhase;
             this.xBaseStats = ((Enemy)p_xOwner).xBaseStats;
         }
     }
 }
Esempio n. 11
0
 public virtual Collider EmptyInit(TransformComponent p_xMount, IEntity p_xOwner)
 {
     return null;
 }
Esempio n. 12
0
 public virtual Collider Clone(TransformComponent p_xMount)
 {
     return null;
 }
Esempio n. 13
0
 public static Collider CreateEmptyShell(Vector2 p_v2LocalPos, TransformComponent p_xMountTransform, IEntity p_xOwner)
 {
     return new Collider
     {
         xLocalTransform = new TransformComponent(p_v2LocalPos),
         xMountTransform = p_xMountTransform,
         xOwnerObject = p_xOwner
     };
 }
Esempio n. 14
0
 public override Collider Clone(TransformComponent p_xMount)
 {
     BoxCollider xLol = new BoxCollider(this.iWidth, this.iHeight, this.fRotation, this.xLocalTransform.v2Pos, p_xMount, this.fWeight, this.xOwnerObject);
     base.CopyDetails(xLol);
     return xLol;
 }
Esempio n. 15
0
 public override void OnUpdate()
 {
     if (!this.bInited)
     {
         this.bInited = true;
         this.iMeriGoRound = 0;
         this.iSubMeri = 0;
         this.xOwner.xRenderComponent.SwitchAnimation(2, Animation.CancelOptions.IgnoreIfPlaying);
     }
     this.iCounter++;
     this.iMoveLol++;
     this.iSpawnCooldown--;
     if (this.bSpawnSuckEffect)
     {
         int iModOs = 6 - this.iCounter / 8;
         if (iModOs < 1)
         {
             iModOs = 1;
         }
         if (this.iCounter % iModOs == 0)
         {
             float fDistance = (float)CAS.RandomInVisual.NextDouble() * 20f + 20f;
             float fRadian = (float)CAS.RandomInVisual.Next(1000) / 1000f;
             fRadian *= 6.28318548f;
             Vector2 v2Dir = Utility.RadiansToVector2(fRadian);
             Vector2 v2Pos = this.xOwner.xTransform.v2Pos + v2Dir * fDistance;
             Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Pos, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Crystal_SlowEffectAppearParticle, -v2Dir * (fDistance / 24f), 30));
         }
     }
     if (this.v2SuperJumpDirection != Vector2.Zero)
     {
         if (this.iJumpAirCounter > 0)
         {
             this.xOwner.xTransform.v2Pos += this.v2SuperJumpDirection * this.fJumpSpeed;
         }
         if (this.iJumpAirCounter == 8)
         {
             this.xOwner.xRenderComponent.SwitchAnimation((ushort)(this.xOwner.byAnimationDirection + 28));
         }
         this.iJumpAirCounter--;
         if (this.xShadowRC != null)
         {
             this.fJumpYVelocity += 0.14f;
             if (this.fJumpYVelocity > -1f && this.fJumpYVelocity < 0.1f)
             {
                 this.fJumpYVelocity -= 0.06f;
             }
             else if (this.fJumpYVelocity >= 0.2f)
             {
                 this.fJumpYVelocity += 0.15f;
             }
             AnimatedRenderComponent expr_205_cp_0 = this.xOwner.xRenderComponent;
             expr_205_cp_0.v2OffsetRenderPos.Y = expr_205_cp_0.v2OffsetRenderPos.Y + this.fJumpYVelocity;
             if (this.xOwner.xRenderComponent.v2OffsetRenderPos.Y > 0f)
             {
                 this.xOwner.xRenderComponent.v2OffsetRenderPos.Y = 0f;
             }
         }
         else
         {
             this.xOwner.xRenderComponent.v2OffsetRenderPos.Y = 0f;
         }
         if (this.iJumpAirCounter == 0)
         {
             this.xOwner.xRenderComponent.v2OffsetRenderPos.Y = 0f;
             this.v2SuperJumpDirection = Vector2.Zero;
             this.xOwner.xCollisionComponent.ActivateGroup(CollisionComponent.ColliderGroup.All);
             this.xOwner.xRenderComponent.SwitchAnimation((ushort)(this.xOwner.byAnimationDirection + 36));
         }
         return;
     }
     if (this.v2RandMoveDir != Vector2.Zero && this.iNextHardUpdate > 0 && this.xOwner.xRenderComponent.GetCurrentAnimation().bIsMoveCancellable)
     {
         this.Move(this.v2RandMoveDir);
     }
     else if (this.xOwner.xRenderComponent.GetCurrentAnimation().bIsMoveCancellable)
     {
         if (this.xPlayerLockedOnto != null && Vector2.Distance(this.xPlayerLockedOnto.xTransform.v2Pos, this.xOwner.xTransform.v2Pos) > 120f && this.iCounter > this.iCounterAtLastJump + 300)
         {
             this.xOwner.xRenderComponent.SwitchAnimation((ushort)(this.xOwner.byAnimationDirection + 20));
             this.xTransformToJumpTo = this.xPlayerLockedOnto.xTransform;
             return;
         }
         if (this.iNextHardUpdate <= 0)
         {
             Game1 Lord = Program.GetTheGame();
             Random arg_3BA_0 = Program.GetTheGame().randomInLogic;
             Rectangle arg_3CF_0 = Program.GetTheGame().xLevelMaster.xCurrentLevel.recCurrentBounds;
             float fClosest = 50000f;
             WorldActor xClosestPlayer = null;
             if (this.iMeriGoRound == 0)
             {
                 List<WorldActor> lx = Lord._Enemy_GetTargetList(this, true);
                 foreach (WorldActor xActor in lx)
                 {
                     float fDist = Vector2.Distance(xActor.xTransform.v2Pos, this.xOwner.xTransform.v2Pos);
                     if (fDist < this.fAggroDistance && fDist < fClosest)
                     {
                         xClosestPlayer = xActor;
                         fClosest = fDist;
                     }
                 }
                 this.xPlayerLockedOnto = xClosestPlayer;
                 if (this.xPlayerLockedOnto != null)
                 {
                     this.iNextHardUpdate = 32;
                     Vector2 v2LolDir = this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos;
                     v2LolDir.Normalize();
                     this.v2RandMoveDir = v2LolDir;
                     this.iMeriGoRound = 1;
                     this.iCurrentAggroJumps = 1;
                 }
             }
             else if (this.iMeriGoRound == 1)
             {
                 if (this.xPlayerLockedOnto == null || Vector2.Distance(this.xPlayerLockedOnto.xTransform.v2Pos, this.xOwner.xTransform.v2Pos) > this.fAggroDistance)
                 {
                     this.iMeriGoRound = 0;
                     this.iNextHardUpdate = 0;
                     this.xOwner.xRenderComponent.SwitchAnimation((ushort)Utility.ConvertV2DirectionToClosestByteDirection(this.v2RandMoveDir), Animation.CancelOptions.RestartIfPlaying);
                     return;
                 }
                 float fHPPcnt = (float)this.xOwner.xBaseStats.iHP / (float)this.xOwner.xBaseStats.iMaxHP;
                 bool bSummonBirds = (this.iBirdFlocks == 0 && fHPPcnt < 0.9f) || (this.iBirdFlocks == 1 && fHPPcnt < 0.6f) || (this.iBirdFlocks == 2 && fHPPcnt < 0.3f);
                 if (bSummonBirds)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation((ushort)(this.xOwner.byAnimationDirection + 16));
                     return;
                 }
                 float fDistance2 = Utility.Vector2ManhattanLength(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos);
                 if (fDistance2 < this.fAttackDistance && Utility.FindClosestStraightLine(this.xOwner.xTransform.v2Pos, this.xPlayerLockedOnto.xTransform.v2Pos).Length() < 20f)
                 {
                     this.iMeriGoRound = 2;
                     this.iSubMeri = 0;
                     byte byDir = Utility.ConvertV2DirectionToClosestByteDirection(Vector2.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos));
                     Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, (ushort)(byDir + 8));
                 }
                 else
                 {
                     Vector2 v2LolDir2 = this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos;
                     v2LolDir2.Normalize();
                     byte byDirAsByte = Utility.ConvertV2DirectionToClosestByteDirection(v2LolDir2);
                     Vector2 v2AniDir = Utility.AnimationDirectionToVector2((int)byDirAsByte);
                     Vector2 v2ModPos = this.xPlayerLockedOnto.xTransform.v2Pos + v2AniDir * this.fAttackDistance;
                     this.iNextHardUpdate = 32;
                     this.v2RandMoveDir = Vector2.Normalize(v2ModPos - this.xOwner.xTransform.v2Pos);
                     this.xOwner.xRenderComponent.SwitchAnimation((ushort)(Utility.ConvertV2DirectionToClosestByteDirection(this.v2RandMoveDir) + 4), Animation.CancelOptions.RestartIfPlaying);
                 }
             }
             else if (this.iMeriGoRound == 2)
             {
                 if (this.iSubMeri < 3 - Program.GetTheGame()._Enemy_GetDifficultyModifier())
                 {
                     this.iSubMeri++;
                     this.iNextHardUpdate = 4;
                 }
                 else
                 {
                     this.iMeriGoRound = 0;
                     this.iNextHardUpdate = 0;
                 }
             }
             else if (this.iMeriGoRound == 100)
             {
                 if (this.iSubMeri == 0)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(2, Animation.CancelOptions.IgnoreIfPlaying);
                     this.iSubMeri++;
                     this.iNextHardUpdate = 10;
                 }
                 else
                 {
                     this.iSubMeri++;
                     this.iNextHardUpdate = 10;
                     if (this.iSubMeri % 2 == 0)
                     {
                         this.xOwner.xRenderComponent.SwitchAnimation(3, Animation.CancelOptions.IgnoreIfPlaying);
                         this.iNextHardUpdate = 11;
                         if (this.iSubMeri > 6)
                         {
                             this.iSubMeri = 1;
                         }
                     }
                     else
                     {
                         this.xOwner.xRenderComponent.SwitchAnimation(15, Animation.CancelOptions.IgnoreIfPlaying);
                     }
                 }
             }
         }
     }
     this.xOwner.xTransform.v2ServerPos = this.xOwner.xTransform.v2Pos;
 }
Esempio n. 16
0
		public SnatchRenderComponent(RenderComponent p_xParentComponent, TransformComponent p_xTransform)
		{
			this.xParentComponent = p_xParentComponent;
			this.xTransform = p_xTransform;
			Program.GetTheGame().xRenderMaster.lxTextureSnatchers.Add(this);
		}
Esempio n. 17
0
 public override Collider Clone(TransformComponent p_xMount)
 {
     SphereCollider xRet;
     if (p_xMount == null)
     {
         xRet = new SphereCollider(this.fRadius, this.xLocalTransform.v2Pos, this.fWeight, this.xOwnerObject);
     }
     else
     {
         xRet = new SphereCollider(this.fRadius, this.xLocalTransform.v2Pos, p_xMount, this.fWeight, this.xOwnerObject);
     }
     xRet.bCollideWithFlat = this.bCollideWithFlat;
     xRet.ibitLayers = this.ibitLayers;
     base.CopyDetails(xRet);
     return xRet;
 }
Esempio n. 18
0
 public ItemRenderComponent(Texture2D p_txTextre, TransformComponent p_xMountTransform)
 {
     this.txTexture = p_txTextre;
     this.enType = RenderComponent.ComponentType.StaticRenderComponent;
     this.xTransform = p_xMountTransform;
 }
Esempio n. 19
0
 public void SetNewMount(TransformComponent p_xMountTransform)
 {
     this.xMountTransform = p_xMountTransform;
 }
Esempio n. 20
0
 public override Collider EmptyInit(TransformComponent p_xMount, IEntity p_xOwner)
 {
     SphereCollider sc;
     if (p_xMount == null)
     {
         sc = new SphereCollider(0f, Vector2.Zero, 0f, p_xOwner);
     }
     else
     {
         sc = new SphereCollider(0f, Vector2.Zero, p_xMount, 0f, p_xOwner);
     }
     return sc;
 }
 public void LoadGraphics(ToyFactoryTrainStuffBagman.Train.GraphicType enType)
 {
     ContentManager Content = CAS.RegionContent;
     this.xRenderComponent = new AnimatedRenderComponent(this);
     this.xRenderComponent.xTransform = this.xTransform;
     bool bIsEngine = true;
     string sCartMos = "Train";
     if (enType == ToyFactoryTrainStuffBagman.Train.GraphicType.Cart01)
     {
         sCartMos = "Cart";
         bIsEngine = false;
     }
     if (bIsEngine)
     {
         this.xRenderComponent.dixAnimations.Add(0, new Animation(0, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Up"), new Vector2(11f, 16f), 4, 4, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(1, new Animation(1, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/UpRight"), new Vector2(13f, 15f), 4, 1, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(2, new Animation(2, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Right"), new Vector2(12f, 17f), 4, 4, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(3, new Animation(3, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/DownRight"), new Vector2(10f, 16f), 4, 1, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(4, new Animation(4, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Down"), new Vector2(11f, 16f), 4, 4, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(5, new Animation(5, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/DownRight"), new Vector2(10f, 16f), 4, 1, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations[5].enSpriteEffect = SpriteEffects.FlipHorizontally;
         this.xRenderComponent.dixAnimations.Add(6, new Animation(6, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Right"), new Vector2(10f, 17f), 4, 4, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations[6].enSpriteEffect = SpriteEffects.FlipHorizontally;
         this.xRenderComponent.dixAnimations.Add(7, new Animation(7, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/UpRight"), new Vector2(9f, 15f), 4, 1, 23, 30, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations[7].enSpriteEffect = SpriteEffects.FlipHorizontally;
     }
     else
     {
         this.xRenderComponent.dixAnimations.Add(0, new Animation(0, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Down"), new Vector2(9f, 12f), 4, 4, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(1, new Animation(1, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/UpRight"), new Vector2(10f, 12f), 4, 1, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(2, new Animation(2, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Right"), new Vector2(9f, 12f), 4, 4, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(3, new Animation(3, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/DownRight"), new Vector2(10f, 12f), 4, 1, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(4, new Animation(4, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Down"), new Vector2(9f, 12f), 4, 4, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations.Add(5, new Animation(5, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/DownRight"), new Vector2(10f, 12f), 4, 1, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations[5].enSpriteEffect = SpriteEffects.FlipHorizontally;
         this.xRenderComponent.dixAnimations.Add(6, new Animation(6, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/Right"), new Vector2(9f, 12f), 4, 4, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations[6].enSpriteEffect = SpriteEffects.FlipHorizontally;
         this.xRenderComponent.dixAnimations.Add(7, new Animation(7, 0, Content.Load<Texture2D>("Sprites/Monster/Winterland/Toy Machine/" + sCartMos + "/Idle/UpRight"), new Vector2(10f, 12f), 4, 1, 19, 23, 0, 0, 20, Animation.LoopSettings.Looping, Animation.CancelOptions.IgnoreIfPlaying, true, true, new AnimationInstruction[0]));
         this.xRenderComponent.dixAnimations[7].enSpriteEffect = SpriteEffects.FlipHorizontally;
     }
     Program.game.xRenderMaster.RegisterSortedRenderComponent(this.xRenderComponent);
 }
 public Train(Vector2 v2Position, Vector2 v2Direction, float fSpeed, ToyFactoryTrainStuffBagman.Train.GraphicType enType)
 {
     this.xTransform = new TransformComponent(v2Position);
     this.v2Direction = v2Direction;
     this.fSpeed = fSpeed;
     this.enGraphicType = enType;
     this.LoadGraphics(enType);
     this.xRenderComponent.SwitchAnimation((ushort)(Utility.ConvertV2DirectionToClosestByteDirection(v2Direction) * 2));
     this.xAttackPhase = new AttackPhase(this);
     SphereCollider col = new SphereCollider(10f, Vector2.Zero, this.xTransform, 0f, this);
     col.xAttackPhase = this.xAttackPhase;
     this.xAttackPhase.lxCurrentColliders.Add(col);
     this.xAttackPhase.RegisterCurrent();
     this.xAttackPhase.lenLayers.Add(Collider.ColliderLayers.Players);
     this.xAttackPhase.lenLayers.Add(Collider.ColliderLayers.Neutrals);
     this.xAttackPhase.xStats.iBaseDamage = 50;
     this.xAttackPhase.xStats.fKnockBack = 25f;
 }
Esempio n. 23
0
		public DuplicateRC(RenderComponent p_xParentComponent, TransformComponent xOverrideTransform)
		{
			this.xParentComponent = p_xParentComponent;
			this.xTransform = xOverrideTransform;
		}
Esempio n. 24
0
 public SoundSystem.CueWrapper PlayCue(string sCueName, TransformComponent xTransform)
 {
     if (!this.bSystemActive)
     {
         return null;
     }
     SoundSystem.CueWrapper xCue = new SoundSystem.PositionedAmbientCueWrapper(this.effectSoundBank.GetCue(sCueName), sCueName, this.xAudioListener, xTransform);
     this.lxCueWrappers.Add(xCue);
     this.lxCuesInLevel.Add(xCue);
     xCue.Play();
     return xCue;
 }
Esempio n. 25
0
 public override void Enter(PlayerView xOwnerView)
 {
     bool bIsLocal = Program.GetTheGame().xLocalPlayer == xOwnerView;
     this.xTargetEffect = (Program.GetTheGame()._EffectMaster_AddEffect(new SortedAnimated(Vector2.Zero, SortedAnimated.SortedAnimatedEffects.ChargeTarget_Small)) as SortedAnimated);
     Program.GetTheGame().xWeaponAssetLibrary.SetPRCWeapon(xOwnerView.xEntity.xRenderComponent, xOwnerView.xEquipment.xBufferWeapon.enItemType);
     xOwnerView.xEquipment.xWeapon = xOwnerView.xEquipment.xBufferWeapon;
     this.enTrueWeapon = xOwnerView.xEquipment.xWeapon.enItemType;
     base.Enter(xOwnerView);
     xOwnerView.xEntity.xRenderComponent.SwitchAnimation((ushort)(650 + (int)xOwnerView.xEntity.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying, 1f + (1f - this.fChargeSpeedModifier));
     this.xefPowerBalls = (Program.GetTheGame()._EffectMaster_AddEffect(new SortedAnimated(Vector2.Zero, SortedAnimated.SortedAnimatedEffects.ChargeEffect_Balls_Weapon)) as SortedAnimated);
     this.xefPowerBalls.xRenderComponent.xTransform = xOwnerView.xEntity.xTransform;
     this.xefPowerBalls.xRenderComponent.fVirtualHeight = xOwnerView.xEntity.xRenderComponent.fVirtualHeight + 1f;
     this.lxAttachedEffects.Add(this.xefPowerBalls);
     if (!bIsLocal)
     {
         Program.GetTheGame().xRenderMaster.UnregisterRenderComponenent(this.xTargetEffect.xRenderComponent);
     }
     this.xTargetEffect.xTransform = new TransformComponent(xOwnerView.xEntity.xTransform.v2Pos + Utility.AnimationDirectionToVector2((int)xOwnerView.xEntity.byAnimationDirection) * 20f);
     this.xTargetEffect.xRenderComponent.xTransform = this.xTargetEffect.xTransform;
     this.colCheckCollider = new SphereCollider(12f, new Vector2(0f, 0f), this.xTargetEffect.xTransform, 0f, this.xTargetEffect);
     this.colCheckCollider.ibitLayers = Utility.CreateIntMask(new int[]
     {
         30
     });
     Program.GetTheGame().xCollisionMaster.RegisterGhostCollider(this.colCheckCollider);
     if (Program.GetTheGame()._CollisionMaster_CheckVsStatic(this.colCheckCollider))
     {
         this.xTargetEffect.xTransform.SetBoth(xOwnerView.xEntity.xTransform.v2Pos);
     }
     TransformComponent xTransLol = new TransformComponent(this.xTargetEffect.xTransform.v2Pos);
     this.colCheckColliderAdjusted = new SphereCollider(6f, new Vector2(0f, 0f), xTransLol, 0f, new IEntity());
     this.colCheckColliderAdjusted.ibitLayers = Utility.CreateIntMask(new int[]
     {
         30,
         31
     });
     Program.GetTheGame().xCollisionMaster.RegisterGhostCollider(this.colCheckColliderAdjusted);
     this.colHeightMan = new SphereCollider(12f, new Vector2(0f, 0f), this.xTargetEffect.xTransform, 0f, this.xTargetEffect);
     this.colHeightMan.ibitLayers = xOwnerView.xEntity.xCollisionComponent.ibitCurrentColliderLayer;
     Program.GetTheGame().xCollisionMaster.RegisterHitboxCollider(this.colHeightMan, Collider.ColliderLayers.HeighDifferenceIntercept);
     this.rcTroll = new StaticRenderComponent(RenderMaster.txNullTex);
     this.rcTroll.xTransform = this.xTargetEffect.xTransform;
     this.rcTroll.fVirtualHeight = xOwnerView.xEntity.xRenderComponent.fVirtualHeight;
     this.rcTroll.bReSortHeight = true;
     Program.GetTheGame().xRenderMaster.RegisterSortedRenderComponent(this.rcTroll);
 }
Esempio n. 26
0
 public PositionedAmbientCueWrapper(Cue p_xCue, string sName, AudioListener p_xListener, TransformComponent p_xTransform)
     : base(p_xCue, sName)
 {
     this.xListener = p_xListener;
     this.xSoundTransform = p_xTransform;
     this.xEmit = new AudioEmitter();
     if (!float.IsNaN(this.xSoundTransform.v2Pos.X))
     {
         this.xEmit.Position = new Vector3(this.xSoundTransform.v2Pos.X, this.xSoundTransform.v2Pos.Y, -320f);
     }
     else
     {
         this.xEmit.Position = Vector3.Zero;
     }
     this.xCue.Apply3D(this.xListener, this.xEmit);
 }
 public void FireDelayedHomingBullet(float fMaxVelocity, float fAfterAimVelocity, Vector2 v2StartMove, TransformComponent xAimTowards)
 {
     Vector2 v2Pos = this.v2Source;
     _EnemySpells_DelayedHomingBullet xInst = (_EnemySpells_DelayedHomingBullet)Program.GetTheGame()._EntityMaster_AddSpellInstance(SpellCodex.SpellTypes._EnemySkill_DelayedHomingBullet, this, v2Pos, false, new float[0]);
     xInst.xOwner = this;
     xInst.fVelocityAfterAim = fAfterAimVelocity;
     xInst.fVelocityAtStart = fMaxVelocity;
     xInst.v2MoveDir = v2StartMove;
     xInst.xAimTowards = xAimTowards;
     xInst.iFreezeTime = 10;
     xInst.iAimTime = 50;
     ((SphereCollider)xInst.xAttackPhasePlayer.lxCurrentColliders[0]).fRadius = 3f;
     xInst.xAttackPhasePlayer.lxCurrentColliders[0].ibitLayers = 1;
     xInst.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.Players);
     xInst.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.Neutrals);
     xInst.xAttackPhasePlayer.xStats.fKnockBack = 10f;
     xInst.xAttackPhasePlayer.xStats.iBaseDamage = 10;
     xInst.xAttackPhasePlayer.xStats.enShieldCrush = AttackStats.ShieldCrush.AllButPerfectGuard;
     xInst.xAttackPhasePlayer.xStats.enAttackElement = AttackStats.Element.Neutral;
     xInst.xAttackPhasePlayer.xStats.enAttackType = AttackStats.Type.Physical;
     xInst.xRenderComponent.SwitchAnimation(0, Animation.CancelOptions.IgnoreIfPlaying);
 }
Esempio n. 28
0
 public GundamScreenNumbersRC(ContentManager Content, TransformComponent xTransform)
 {
     this.xTransform = xTransform;
     this.txNumbers = Content.Load<Texture2D>("Bkg/Zone009_FlyingTemple/Inside/BossRoom/Screen/Numbers");
 }