private void InputEvents_ButtonPressed(object sender, EventArgsInput e) { if (Context.IsWorldReady && Game1.player.CurrentTool is Hoe && treasure && e.IsUseToolButton && e.Cursor.GrabTile == tile) // save is loaded { //this.Monitor.Log($"Treasure Params: {e.Cursor.GrabTile + ", " + tile + ", " + Game1.player.Position}"); var data = Game1.content.Load <Dictionary <int, string> >("Data\\ObjectInformation"); item = new StardewValley.Object(rand(data.Count - 1, 0), 1); if (clue == clueTypes[0]) { while (item.Category == -4 || item.Category == -9 || item.Category == -7 || item.Category == -12 || item.DisplayName.ToLower().Contains("error")) { item = new StardewValley.Object(rand(data.Count - 1, 0), 1); } } else { //weap, ring, equipment, tools (HARD) while ((item.Category != -98 && item.Category != -29 && item.Category != -96 && item.Category != -99) || item.DisplayName.ToLower().Contains("error")) { item = new StardewValley.Object(rand(data.Count - 1, 0), 1); } } List <Item> l = new List <Item>(); l.Add(item); curr = new Chest(rand(200, 0), l, tile); while (!loc.isTileLocationTotallyClearAndPlaceable(tile) || !loc.isTileOnMap(tile)) { tile = loc.getRandomTile(); } loc.objects.Add(tile, curr); HUDMessage message = new HUDMessage($"You find a hidden chest."); Game1.addHUDMessage(message); message.color = new Color(218, 165, 32); message.timeLeft += 2000.0f; message.noIcon = true; message.update(Game1.currentGameTime); treasure = false; SetTimer2(5000, 1); SetTimer(15000, 1); } }
private void SetTimer2(int time, int type) { // Create a timer with a two second interval. aTimer2 = new System.Timers.Timer(time); // Hook up the Elapsed event for the timer. if (type == 1) { aTimer2.Elapsed += OnTimedEvent12; } else if (type == 2) { first = true; aTimer2.Elapsed += norm; HUDMessage message = new HUDMessage($"The ground shakes violently..."); Game1.addHUDMessage(message); message.color = new Color(218, 165, 32); message.timeLeft += 1000.0f; message.noIcon = true; message.update(Game1.currentGameTime); } else if (type == 3) { first = true; aTimer2.Elapsed += hard; HUDMessage message = new HUDMessage($"You feel a strong presence of evil..."); Game1.addHUDMessage(message); message.color = new Color(218, 165, 32); message.timeLeft += 2000.0f; message.noIcon = true; message.update(Game1.currentGameTime); } if (type == 1) { aTimer2.AutoReset = false; } else if (type == 2 || type == 3) { aTimer2.AutoReset = true; } aTimer2.Enabled = true; }
public void DisplayMood() { if (mpdebug) { Monitor.Log($"Health: {mood.modifiers[0]}, Resilience: {mood.modifiers[1]}, Slipperiness: {mood.modifiers[2]}, Combat XP Bonus: {mood.modifiers[3]}, " + $"Scale: {mood.modifiers[4]}, Speed: {mood.modifiers[5]} < --DEBUG--"); Monitor.Log($"-MOODY--PLANET-> World Mood : {mood.name} <--DEBUG--"); } HUDMessage message = new HUDMessage($"The world is {mood.name} today!", mood.moodColor, 8000.0f); Game1.addHUDMessage(message); message.noIcon = true; message.update(Game1.currentGameTime); }
public void DisplayMood() { if (mpdebug) { Monitor.Log($"-MOODY--PLANET-> World Multis : Health: {CMS[0]}, Resilience: {CMS[1]}, Slipperiness: {CMS[2]}, ExperienceGained(All Skills): {CMS[3]}, Scale: {CMS[4]}, Speed: {CMS[5]} <--DEBUG--"); Monitor.Log($"-MOODY--PLANET-> World Mood : {mood} <--DEBUG--"); } HUDMessage message = new HUDMessage($"The world is {mood} today!"); message.color = new Color(218, 165, 32); Game1.addHUDMessage(message); message.timeLeft += 7000.0f; message.noIcon = true; message.update(Game1.currentGameTime); }
public void init_treas_day() { loc = Game1.locations[rand(Game1.locations.Count - 1, 0)]; /*while (!Game1.isLocationAccessible(loc.Name)) * { * loc = Game1.locations[rand(Game1.locations.Count - 1, 0)]; * }*/ tile = loc.getRandomTile(); while (!loc.isTileLocationTotallyClearAndPlaceable(tile) || !loc.isTileOnMap(tile)) { tile = loc.getRandomTile(); } //loc.terrainFeatures.Add(tile, new Grass(1,4)); //HUDMessage message = new HUDMessage($"A secret stash is located in: {loc.Name}\n -Anonymous"); HUDMessage message = new HUDMessage($"You find a note lying under your bed."); Game1.addHUDMessage(message); message.color = new Color(218, 165, 32); message.timeLeft += 2500.0f; message.noIcon = true; message.update(Game1.currentGameTime); if (rnd.NextDouble() < (0.1 + (Game1.player.LuckLevel / 100))) { clue = clueTypes[1]; } else { clue = clueTypes[0]; } //Game1.drawDialogueBox("A secret stash is somewhere."); treasure = true; SetTimer(4000, 2); }