public override void Draw() { for (int i = 0; i < TexList.Count; i++) { CroppedTexture2D croppedTex = TexList[i]; float realDepth = BaseDepth + (i * DepthDiff); SpriteRenderer.Instance.Draw(croppedTex.Tex, Position, croppedTex.SourceRect, TintColor, Rotation, Vector2.Zero, Scale, FlipX, FlipY, realDepth, true); } }
/// <summary> /// Adds a <see cref="CroppedTexture2D"/> to the <see cref="UIStackedTex"/>. /// </summary> /// <param name="croppedTex2D">The <see cref="CroppedTexture2D"/> to add.</param> public void AddElement(CroppedTexture2D croppedTex2D) { if (croppedTex2D == null || croppedTex2D.Tex == null) { Debug.LogError($"{nameof(croppedTex2D)} or it's {nameof(croppedTex2D.Tex)} is null! Not adding"); return; } TexList.Add(croppedTex2D); }
public override void EndInput() { base.EndInput(); BarEnd = null; BarMiddle = null; BarFill = null; BarFillColor = Color.White; }
public override void CleanUp() { base.CleanUp(); Entity = null; StylishData = null; Indicator = null; IndicatorBubble = null; }
public RallyWinkHeartVFX(Vector2 position, double fadeInTime, double fadeOutTime, float layer) { Position = position; FadeInTime = fadeInTime; FadeOutTime = fadeOutTime; Layer = layer; HeartTex = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(324, 407, 61, 58)); }
public FrozenStatus(int duration) : base(duration) { StatusType = Enumerations.StatusTypes.Frozen; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(604, 107, 38, 46)); AfflictedMessage = "Frozen! Movement will be\nimpossible for a while!"; ShouldQueueEndEvent = false; }
public StylishIndicatorVFX(BattleEntity entity, Sequence.StylishData stylishData) { Entity = entity; StylishData = stylishData; Texture2D tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); Indicator = new CroppedTexture2D(tex, new Rectangle(534, 907, 14, 30)); IndicatorBubble = new CroppedTexture2D(tex, new Rectangle(729, 797, 76, 76)); }
public void CleanUp() { BubbleRasterizerState.Dispose(); BubbleRasterizerState = null; BubbleImage = null; Speaker = null; DBubbleData = null; FontGlyphs = null; }
private void InitIconGraphics() { Texture2D battleGFX = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"); CroppedTexture2D arrowTex = new CroppedTexture2D(battleGFX, new Rectangle(5, 353, 50, 61)); IconGraphics.Add(PowerLiftCommand.PowerLiftIcons.None, null); IconGraphics.Add(PowerLiftCommand.PowerLiftIcons.Poison, new CroppedTexture2D(battleGFX, new Rectangle(90, 270, 106, 108))); IconGraphics.Add(PowerLiftCommand.PowerLiftIcons.Attack, arrowTex); IconGraphics.Add(PowerLiftCommand.PowerLiftIcons.Defense, arrowTex); }
public ShellShieldActionCommandUI(ShellShieldCommand shellShieldCommand) : base(shellShieldCommand) { Texture2D battleGFX = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); MovingCursor = new CroppedTexture2D(battleGFX, new Rectangle(498, 304, 46, 38)); BarEnd = new CroppedTexture2D(battleGFX, new Rectangle(514, 245, 6, 28)); BarMiddle = new CroppedTexture2D(battleGFX, new Rectangle(530, 245, 1, 28)); Box = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Box.png"); }
public ProgressDialogueStar() { Texture2D tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); Graphic = new CroppedTexture2D(tex, new Rectangle(393, 403, 60, 58)); Scale = MaxScale; Rotation = 0; ElapsedTime = RotateTime / 2d; }
public virtual void RemoveWings() { Vector2 wingPos = Entity.Position; Animation hurtAnim = Entity.AnimManager.GetAnimation <Animation>(AnimationGlobals.HurtName); if (hurtAnim != null) { wingPos = hurtAnim.CurChildFrame.GetDrawnPosition(Entity.Position, Entity.SpriteFlip); } //Remove the wings from the hurt and death animations Animation[] animations = Entity.AnimManager.GetAnimations <Animation>(AnimationGlobals.HurtName, AnimationGlobals.DeathName); //Clear all child frames with wings for (int i = 0; i < animations.Length; i++) { animations[i].SetChildFrames(null); } //Add VFX for the wings disappearing Texture2D spriteSheet = Entity.AnimManager.SpriteSheet; CroppedTexture2D wingSprite = new CroppedTexture2D(spriteSheet, WingRectRegion); //Put the wings in the same spot as they were in the Paragoomba's last animation WingsDisappearVFX wingsDisappear = new WingsDisappearVFX(wingSprite, wingPos, Entity.EntityType != Enumerations.EntityTypes.Enemy, .1f - .01f, 500d, 500d, (1d / 30d) * Time.MsPerS); Entity.BManager.battleObjManager.AddBattleObject(wingsDisappear); //Copy the StatusProperties from the grounded entity //This happens here, as winged entities use their own status tables until they've been grounded if (GroundedEntity != null) { Entity.EntityProperties.CopyStatusProperties(GroundedEntity.EntityProperties); } //Don't modify Tattle information //The entity knows what its grounded version is //However, one thing we can do here is disable tattling if the grounded version doesn't support it ITattleableEntity gTattleable = GroundedEntity as ITattleableEntity; if (gTattleable == null) { //Disable tattling if the grounded version can't be Tattled ITattleableEntity entity = Entity as ITattleableEntity; if (entity != null) { entity.CanBeTattled = false; } } //After all this set the GroundedEntity to null, as we don't need its information anymore GroundedEntity = null; }
public TattleCommand(IActionCommandHandler commandHandler, float smallCursorSpeed) : base(commandHandler) { Texture2D battleGFX = AssetManager.Instance.LoadAsset <Texture2D>($"{ContentGlobals.UIRoot}/Battle/BattleGFX"); BigCursor = new CroppedTexture2D(battleGFX, new Rectangle(14, 273, 46, 46)); SmallCursor = new CroppedTexture2D(battleGFX, new Rectangle(10, 330, 13, 12)); SmallCursorSpeed = smallCursorSpeed; //Description = "Line up the small cursor with\n the center of the big cursor!" }
public override void Draw() { if (ActionCmd?.AcceptingInput == false) { return; } string text = "NO!"; Color color = Color.Red; if (ActionCmd.WithinRange == true) { text = "OKAY!"; color = Color.Green; } SpriteRenderer.Instance.DrawUIText(AssetManager.Instance.TTYDFont, text, new Vector2(300, 150), color, .7f); base.Draw(); for (int i = 0; i < ActionCmd.NumLights; i++) { CroppedTexture2D light = UnlitLight; //Draw the light as lit if the bar is in or past the light if (ActionCmd.CurLight > i || (ActionCmd.CurLight == i && ActionCmd.WithinRange == true)) { light = LitLight; } //Get the start and end ranges float startScale = (float)(ActionCmd.LightRanges[i].StartRange / ActionCmd.MaxBarValue) * BarSize.X; float endScale = (float)(ActionCmd.LightRanges[i].EndRange / ActionCmd.MaxBarValue) * BarSize.X; Vector2 lightStartPos = StartPos + new Vector2((int)startScale, 0f); Vector2 lightEndPos = StartPos + new Vector2((int)endScale, 0f); //We know the start and end positions, so get the difference for the size int xDiff = (int)(lightEndPos.X - lightStartPos.X); //Get the midpoint Vector2 lightMidPos = new Vector2(lightStartPos.X + (xDiff / 2), lightStartPos.Y + 6f); //If the asset is 44x44, the range was 44, and the bar scale was 100, it would be 1 //The asset should fit inside xDiff; that's the size it should be //diff / assetSize Vector2 lightScale = new Vector2(xDiff / (float)light.SourceRect.Value.Width); //Debug.DebugDrawLine(lightStartPos, lightStartPos + new Vector2(0, 24f), Color.White, .9f, 1, true); //Debug.DebugDrawLine(lightEndPos, lightEndPos + new Vector2(0, 24f), Color.White, .9f, 1, true); SpriteRenderer.Instance.DrawUI(light.Tex, lightMidPos, light.SourceRect, Color.White, 0f, new Vector2(.5f, 0), lightScale, false, false, .8f); } }
private void Initialize() { Position = StartPosition; Texture2D tex = null; Rectangle?rect = null; //Get the correct icon based on the RestoreTypes switch (RestorationType) { case RestoreTypes.MarioHP: tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleHUD.png"); rect = new Rectangle(2, 38, 45, 41); break; case RestoreTypes.BigMarioHP: tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleHUD.png"); rect = new Rectangle(2, 38, 45, 41); Scale = new Vector2(2f, 2f); break; case RestoreTypes.PartnerHP: tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); rect = new Rectangle(324, 407, 61, 58); Scale = new Vector2(.6f, .6f); break; case RestoreTypes.BigPartnerHP: tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); rect = new Rectangle(324, 407, 61, 58); Scale = new Vector2(1.2f, 1.2f); break; case RestoreTypes.FP: tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleHUD.png"); rect = new Rectangle(56, 42, 34, 37); break; case RestoreTypes.BigFP: tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleHUD.png"); rect = new Rectangle(56, 42, 34, 37); Scale = new Vector2(2f, 2f); break; case RestoreTypes.PoisonMushroom: default: tex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); rect = new Rectangle(228, 413, 40, 40); break; } CroppedTex2D = new CroppedTexture2D(tex, rect); }
public FastStatus(int duration) { StatusType = Enumerations.StatusTypes.Fast; Alignment = StatusAlignments.Positive; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(555, 205, 38, 46)); Duration = duration; AfflictedMessage = "More chances to attack\nare now available!"; }
public WaterBlockStatus(int duration) : base(DefenseBoost, duration) { StatusType = Enumerations.StatusTypes.WaterBlock; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(461, 386, 28, 28)); //ArrowRect = new Rectangle(508, 386, 26, 27); AfflictedMessage = "Mario will be protected by Water Block for a short time!"; RemovedMessage = "The Water Block's effect has worn off!"; }
public TurboChargeStatus(int duration) : base(DamageBoost, duration) { StatusType = Enumerations.StatusTypes.TurboCharge; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(461, 423, 29, 29)); //ArrowRect = new Rectangle(506, 422, 30, 30); AfflictedMessage = "Your attack power will go up for a short time!"; RemovedMessage = "Your attack power has returned to normal!"; }
public ParalyzedStatus(int duration) : base(duration) { StatusType = Enumerations.StatusTypes.Paralyzed; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(354, 389, 16, 16)); AfflictedMessage = "Your enemy's paralyzed and can't move!"; SparkIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(377, 391, 8, 12)); }
public PoisonStatus(int duration) { StatusType = Enumerations.StatusTypes.Poison; Alignment = StatusAlignments.Negative; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(555, 58, 38, 46)); Duration = duration; AfflictedMessage = "Poisoned! The toxins will\nsteadily do damage!"; }
public override void CleanUp() { HPShownEntities.Clear(); NoHPEntities.Clear(); HPBar = null; HPBarFill = null; base.CleanUp(); BManager.BattleTurnEndedEvent -= OnBattleTurnEnded; }
public ImmobilizedStatus(int duration) { StatusType = Enumerations.StatusTypes.Immobilized; Alignment = StatusAlignments.Negative; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadAsset <Texture2D>($"{ContentGlobals.UIRoot}/Battle/BattleGFX"), new Rectangle(604, 9, 38, 46)); Duration = duration; AfflictedMessage = "Immobilized! Movement will\nbe impossible for a while!"; }
public ConfusedStatus(int duration) { StatusType = Enumerations.StatusTypes.Confused; Alignment = StatusAlignments.Negative; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(708, 253, 38, 46)); Duration = duration; AfflictedMessage = "Confused! Movement will be\nhindered for a while!"; }
public DodgyStatus(int duration) { StatusType = Enumerations.StatusTypes.Dodgy; Alignment = StatusAlignments.Positive; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadAsset <Texture2D>($"{ContentGlobals.UIRoot}/Battle/BattleGFX"), new Rectangle(658, 253, 38, 46)); Duration = duration; AfflictedMessage = "Dodgy! Some attacks will\nautomatically be dodged!"; }
public InvisibleStatus(int duration) { StatusType = Enumerations.StatusTypes.Invisible; Alignment = StatusAlignments.Positive; StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(707, 105, 40, 48)); Duration = duration; AfflictedMessage = "Invisible! Attacks will now\nmiss!"; }
public override void EndInput() { base.EndInput(); MovingCursor = null; BarEnd = null; BarMiddle = null; BarRanges = null; Box = null; }
public override void StartInput(params object[] values) { base.StartInput(values); Texture2D battleGFX = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); MovingCursor = new CroppedTexture2D(battleGFX, new Rectangle(498, 304, 46, 38)); //Start the cursor at a random point on the bar RandTimeOffset = GeneralGlobals.Randomizer.NextDouble() * (CursorMoveTime * 2); UpdateCursorVal(); }
public LifeShroom() { Name = "Life Shroom"; Description = "Restores 10 HP when Mario or his partner falls."; Icon = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.SpriteRoot}/Items.png"), new Rectangle(563, 7, 25, 23)); HPRestored = 10; RevivalHPRestored = 10; ItemType |= ItemTypes.Revival; }
public SweetTreatThrownStar(BattleUIManager bUIManager, Vector2 startPosition, Vector2 speed) { BUIManager = bUIManager; Position = startPosition; Origin = new Vector2(.5f, .5f); CroppedTex2D = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(245, 986, 40, 37)); Speed = speed; }
public BodyThrowAction(BattleEntity user, ISegmentBehavior segmentBehavior, CroppedTexture2D segmentTex) : base(user) { Name = "Body Throw"; MoveInfo = new MoveActionData(null, "Throw a body part at the target.", MoveResourceTypes.FP, 0f, CostDisplayTypes.Shown, MoveAffectionTypes.Other, EntitySelectionType.Single, true, null, User.GetOpposingEntityType()); DamageInfo = new DamageData(0, Elements.Normal, false, ContactTypes.None, ContactProperties.Ranged, null, DamageEffects.None); SetMoveSequence(new BodyThrowSequence(this, segmentBehavior, segmentTex)); actionCommand = null; }