//so originally the mod wasn't going to involve a normal terraria world at all, and the played would be dumped into a now-cut level (some of the content of which has ended up in the desert arena) //this is what would have happened before the player was dropped in static SequenceQueue ConstructIntroSequence(Player player) { Vector2 destination = 16 * new Vector2(259, 1726); SequenceQueue queue = new SequenceQueue(Sequence.IntroCutscene); PlayerFixer pf = player.GetModPlayer <PlayerFixer>(); queue.Append(new ImmobiliseItem()); queue.Append(new PlayerHolderItem(player, new Vector2(4756 * 16, 249 * 16))); queue.Append(new ChangeMountItem(player, ModContent.GetInstance <StartingShip>().Type)); queue.Append(new SpawnChangeItem(destination, player)); queue.Append(new PauseItem(300)); queue.Append(new SpeechItem(new SpeechBubble("Hmmm, this doesn't look anything like my starmap...so it was a left at the Crab Nebula, right at the supermassive black hole, right at the...", (int)pf.GetScreenPosition().X, (int)pf.GetScreenPosition().Y, 400, 480), pf, new Vector2(100, -100))); queue.Append(new SpeechItem(new SpeechBubble("Oh my mistake that should have been a left at the Crab Nebula, which means on the map I should be...", (int)pf.GetScreenPosition().X, (int)pf.GetScreenPosition().Y, 400, 300), pf, new Vector2(100, -100))); queue.Append(new SpeechItem(new SpeechBubble("...off the edge of it. Which makes me lost.", (int)pf.GetScreenPosition().X, (int)pf.GetScreenPosition().Y, 400, 300), pf, new Vector2(100, -100))); queue.Append(new PauseItem(240)); queue.Append(new SpeechItem(new SpeechBubble("I wonder what's on the radio in these parts...", (int)pf.GetScreenPosition().X, (int)pf.GetScreenPosition().Y, 400, 300), pf, new Vector2(100, -100))); queue.Append(new SoundEffectItem(665, "Sounds/RadioSound")); queue.Append(new SpeechItem(new SpeechBubble("Gosh they've got some weird music around here.", (int)pf.GetScreenPosition().X, (int)pf.GetScreenPosition().Y, 400, 180), pf, new Vector2(100, -100))); queue.Append(new SpeechItem(new SpeechBubble("ERROR: ENGINE FAILURE!", (int)pf.GetScreenPosition().X, (int)pf.GetScreenPosition().Y, 400, 180), pf, new Vector2(-400, -100))); queue.Append(new SpaceShipCrashItem(player)); queue.Append(new SpeechItem(new SpeechBubble("This is not at all good...", (int)pf.GetScreenPosition().X, (int)pf.GetScreenPosition().Y, 400, 180), pf, new Vector2(100, -100))); queue.Append(new SpaceShipCrashItem(player)); queue.Append(new PlayerHolderItem(player, destination)); queue.Append(new PauseItem(240)); queue.Append(new SpaceShipCrashItem(player)); queue.Append(new ChangeMountItem(player)); queue.Append(new PlayerHolderItem(player)); queue.Append(new MobiliseItem()); return(queue); }
public void Draw(SpriteBatch sb) { PlayerFixer pf = Main.LocalPlayer.GetModPlayer <PlayerFixer>(); bool canPurchase = pf.CanPurchase(quantity * item.cost); Color color; if (canPurchase) { Rectangle mouseRect = new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1); if (mouseRect.Intersects(rect)) { color = Color.LightBlue; if (!intersect && Main.hasFocus) { Main.PlaySound(SoundID.MenuTick, Main.LocalPlayer.position); } intersect = true; } else { intersect = false; color = Color.CornflowerBlue; } } else { color = Color.DarkRed; } string text = "Buy " + quantity; float scale = 0.40f; Vector2 vector = Main.fontDeathText.MeasureString(text); Vector2 location = new Vector2(rect.X, rect.Y + 4) + (0.5f * new Vector2(rect.Width, rect.Height)); DrawBox(sb, rect, color, alpha); ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontDeathText, text, new Vector2(0, -10) + location, Color.White, 0f, vector / 2f, new Vector2(scale), -1f, 1.5f); //int[] ammoIDS = { ModContent.ItemType<NinemmRound>(), ModContent.ItemType<FiveFivemmRound>(), ModContent.ItemType<RocketItem>(), ModContent.ItemType<MeteorBombItem>(), ModContent.ItemType<ShotgunShell>() }; Vector2 dims = Main.fontMouseText.MeasureString(GetCostMeasureString()); ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, GetCostString(), new Vector2(0, 10) + location, Color.White, 0f, dims / 2, Vector2.One, -1f, 2f); if (quantity == 1) { //int typeMax; Texture2D tex1 = Main.itemTexture[item.itemID]; //Texture2D texMax = Main.itemTexture[ammoIDS[index]]; sb.Draw(tex1, new Rectangle(80 + (Main.screenWidth / 2) - (tex1.Width / 2), rect.Y + (int)(0.5f * (rect.Height - tex1.Height)), tex1.Width, tex1.Height), Color.White); //sb.Draw(texMax, new Rectangle(130 + (Main.screenWidth / 2) - (texMax.Width / 2), rect.Y + (int)(0.5f * (rect.Height - tex1.Height)), texMax.Width, texMax.Height), Color.White); } else if (quantity == 100) { ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontDeathText, "x" + GetQuantity(), location + new Vector2(30 + rect.Width, 0), Color.White, 0f, vector / 2, new Vector2(scale), -1f, 1.5f); } }
public void Update() { PlayerFixer pf = Main.LocalPlayer.GetModPlayer <PlayerFixer>(); bool canPurchase = pf.CanPurchase(item.cost); StarSailorMod sm = ModContent.GetInstance <StarSailorMod>(); if (intersect && Main.hasFocus && sm.newMouseState.LeftButton == ButtonState.Pressed && sm.oldMouseState.LeftButton == ButtonState.Released && canPurchase) { Item.NewItem(Main.LocalPlayer.position, item.itemID); pf.ChargeCoins(item.cost); } }
public void Update() { PlayerFixer pf = Main.LocalPlayer.GetModPlayer <PlayerFixer>(); StarSailorMod sm = ModContent.GetInstance <StarSailorMod>(); bool canPurchase = pf.CanPurchase(quantity * item.cost); if (intersect && Main.hasFocus && sm.newMouseState.LeftButton == ButtonState.Pressed && sm.oldMouseState.LeftButton == ButtonState.Released && canPurchase) { //int[] ammoIDS = { ModContent.ItemType<NinemmRound>(), ModContent.ItemType<FiveFivemmRound>(), ModContent.ItemType<RocketItem>(), ModContent.ItemType<MeteorBombItem>(), ModContent.ItemType<ShotgunShell>() }; Item.NewItem(Main.LocalPlayer.position, item.itemID, quantity); pf.ChargeCoins(quantity * item.cost); } }
public bool Execute() { PlayerFixer pf = player.GetModPlayer <PlayerFixer>(); if (engage) { pf.playerHolder.Engage(loc, player); } else { pf.playerHolder.Disengage(); } return(true); }
public void Draw(SpriteBatch sb) { PlayerFixer pf = Main.LocalPlayer.GetModPlayer <PlayerFixer>(); bool canPurchase = pf.CanPurchase(item.cost); Color color; if (canPurchase) { Rectangle mouseRect = new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1); if (mouseRect.Intersects(rect)) { color = Color.LightBlue; if (!intersect && Main.hasFocus) { Main.PlaySound(SoundID.MenuTick, Main.LocalPlayer.position); } intersect = true; } else { intersect = false; color = Color.CornflowerBlue; } } else { color = Color.DarkRed; } ModItem mit = ModContent.GetModItem(item.itemID); Texture2D boxTex = ModContent.GetInstance <StarSailorMod>().box; Texture2D boxInsideTex = ModContent.GetInstance <StarSailorMod>().boxInside; Texture2D itemTex = Main.itemTexture[item.itemID]; DrawBox(sb, rect, color, alpha); sb.Draw(boxTex, new Rectangle(rect.X + 10, rect.Y + (rect.Height / 2) - (boxTex.Height / 2), boxTex.Width, boxTex.Height), Color.White); sb.Draw(boxInsideTex, new Rectangle(rect.X + 10, rect.Y + (rect.Height / 2) - (boxTex.Height / 2), boxTex.Width, boxTex.Height), Color.White * 0.9f); sb.Draw(itemTex, new Rectangle(rect.X + 10 + (boxTex.Width / 2) - (itemTex.Width / 2), rect.Y + (rect.Height / 2) - (itemTex.Height / 2), itemTex.Width, itemTex.Height), Color.White); float scale = 0.3f; ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontMouseText, GetNameString(), new Vector2(rect.X + 20 + boxTex.Width, rect.Y + (rect.Height / 2) - (boxTex.Height / 2)), Color.White, 0f, new Vector2(0), new Vector2(1f), -1f, 1.5f); ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontDeathText, item.description, new Vector2(rect.X + 20 + boxTex.Width, 30 + rect.Y + (rect.Height / 2) - (boxTex.Height / 2)), Color.White, 0f, new Vector2(0), new Vector2(scale), -1f, 1.5f); string costString = GetCostString(); Vector2 dims = Main.fontMouseText.MeasureString(GetCostMeasureString()); ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, costString, new Vector2(rect.X + rect.Width - dims.X, rect.Y + 5), Color.White, 0f, Vector2.Zero, Vector2.One, -1f, 2f); }
string GetBankString() { PlayerFixer pf = Main.LocalPlayer.GetModPlayer <PlayerFixer>(); string coinsText = "In Bank: "; int[] coins = Utils.CoinsSplit(pf.GetMoney()); if (coins[3] > 0) { coinsText = coinsText + "[c/" + Colors.AlphaDarken(Colors.CoinPlatinum).Hex3() + ":" + coins[3] + " " + Language.GetTextValue("LegacyInterface.15") + "] "; } if (coins[2] > 0) { coinsText = coinsText + "[c/" + Colors.AlphaDarken(Colors.CoinGold).Hex3() + ":" + coins[2] + " " + Language.GetTextValue("LegacyInterface.16") + "] "; } if (coins[1] > 0) { coinsText = coinsText + "[c/" + Colors.AlphaDarken(Colors.CoinSilver).Hex3() + ":" + coins[1] + " " + Language.GetTextValue("LegacyInterface.17") + "] "; } if (coins[0] > 0) { coinsText = coinsText + "[c/" + Colors.AlphaDarken(Colors.CoinCopper).Hex3() + ":" + coins[0] + " " + Language.GetTextValue("LegacyInterface.18") + "] "; } return(coinsText); }