public void setFireplace(GameLocation location, bool playSound = true, bool broadcast = false) { _ = tileLocation.X; _ = tileLocation.Y; if ((bool)isOn) { if (base.lightSource == null) { initializeLightSource(tileLocation); } if (base.lightSource != null && (bool)isOn && !location.hasLightSource(base.lightSource.Identifier)) { location.sharedLights[base.lightSource.identifier] = base.lightSource.Clone(); } if (playSound) { location.localSound("fireball"); } AmbientLocationSounds.addSound(new Vector2(tileLocation.X, tileLocation.Y), 1); } else { if (playSound) { location.localSound("fireball"); } base.performRemoveAction(tileLocation, location); AmbientLocationSounds.removeSound(new Vector2(tileLocation.X, tileLocation.Y)); } }
// Token: 0x06001284 RID: 4740 RVA: 0x00177CF0 File Offset: 0x00175EF0 public override void performTenMinuteAction(int timeElapsed) { base.performTenMinuteAction(timeElapsed); for (int i = this.myJunimos.Count - 1; i >= 0; i--) { if (!Game1.getFarm().characters.Contains(this.myJunimos[i])) { this.myJunimos.RemoveAt(i); } else { this.myJunimos[i].pokeToHarvest(); } } if (this.myJunimos.Count <JunimoHarvester>() < 3 && Game1.timeOfDay < 1900) { this.junimoSendOutTimer = 1; } if (Game1.timeOfDay >= 2000 && Game1.timeOfDay < 2400 && !Game1.IsWinter && Utility.getLightSource(this.tileX + this.tileY * 777) == null && Game1.random.NextDouble() < 0.2) { Game1.currentLightSources.Add(new LightSource(4, new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1)) * (float)Game1.tileSize + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), 0.5f) { identifier = this.tileX + this.tileY * 777 }); AmbientLocationSounds.addSound(new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1)), 1); this.wasLit = true; return; } if (Game1.timeOfDay == 2400 && !Game1.IsWinter) { Utility.removeLightSource(this.tileX + this.tileY * 777); AmbientLocationSounds.removeSound(new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1))); } }
// Token: 0x06001167 RID: 4455 RVA: 0x00164F94 File Offset: 0x00163194 public override void resetForPlayerEntry() { base.resetForPlayerEntry(); if (Game1.player.mailReceived.Contains("ccBoilerRoom")) { this.minecartSteam = new TemporaryAnimatedSprite(27, new Vector2((float)(107 * Game1.tileSize + Game1.pixelZoom * 2), (float)(79 * Game1.tileSize) - (float)Game1.tileSize * 3f / 4f), Color.White, 8, false, 100f, 0, -1, -1f, -1, 0) { totalNumberOfLoops = 999999, interval = 60f, flipped = true }; } if (Game1.player.mailReceived.Contains("ccIsComplete") || Game1.player.mailReceived.Contains("JojaMember") || Game1.player.hasCompletedCommunityCenter()) { this.refurbishCommunityCenter(); } if (Game1.player.eventsSeen.Contains(191393)) { this.showDestroyedJoja(); } if (!Game1.currentSeason.Equals("winter")) { AmbientLocationSounds.addSound(new Vector2(26f, 26f), 0); AmbientLocationSounds.addSound(new Vector2(26f, 28f), 0); } if (!Game1.isStartingToGetDarkOut()) { AmbientLocationSounds.addSound(new Vector2(100f, 79f), 2); this.addClintMachineGraphics(); } if (Game1.player.mailReceived.Contains("checkedBulletinOnce")) { this.playerCheckedBoard = true; } }
public override bool checkForAction(Farmer who, bool justCheckingForActivity = false) { if (!this.bigCraftable) { return(base.checkForAction(who, justCheckingForActivity)); } if (justCheckingForActivity) { return(true); } this.isOn = !this.isOn; if (this.isOn) { if (this.bigCraftable) { if (who != null) { Game1.playSound("fireball"); } base.initializeLightSource(this.tileLocation); AmbientLocationSounds.addSound(this.tileLocation, 1); } } else if (this.bigCraftable) { this.performRemoveAction(this.tileLocation, Game1.currentLocation); if (who != null) { Game1.playSound("woodyHit"); } } return(true); }
protected override void resetLocalState() { base.resetLocalState(); shippingBinLidOpenArea = new Microsoft.Xna.Framework.Rectangle((shippingBinPosition.X - 1) * 64, (shippingBinPosition.Y - 1) * 64, 256, 192); shippingBinLid = new TemporaryAnimatedSprite("LooseSprites\\Cursors", new Microsoft.Xna.Framework.Rectangle(134, 226, 30, 25), new Vector2(shippingBinPosition.X, shippingBinPosition.Y - 1) * 64f + new Vector2(2f, -7f) * 4f, flipped: false, 0f, Color.White) { holdLastFrame = true, destroyable = false, interval = 20f, animationLength = 13, paused = true, scale = 4f, layerDepth = (float)((shippingBinPosition.Y + 1) * 64) / 10000f + 0.0001f, pingPong = true, pingPongMotion = 0 }; if (sandDuggy.Value != null) { sandDuggy.Value.ResetForPlayerEntry(); } NPC i = getCharacterFromName("Birdie"); if (i != null) { if (i.Sprite.SourceRect.Width < 32) { i.extendSourceRect(16, 0); } i.Sprite.SpriteWidth = 32; i.Sprite.ignoreSourceRectUpdates = false; i.Sprite.setCurrentAnimation(new List <FarmerSprite.AnimationFrame> { new FarmerSprite.AnimationFrame(8, 1000, 0, secondaryArm: false, flip: false), new FarmerSprite.AnimationFrame(9, 1000, 0, secondaryArm: false, flip: false) }); i.Sprite.loop = true; i.HideShadow = true; i.IsInvisible = Game1.IsRainingHere(this); } if (Game1.timeOfDay > 1700) { temporarySprites.Add(new TemporaryAnimatedSprite("LooseSprites\\Cursors", new Microsoft.Xna.Framework.Rectangle(276, 1985, 12, 11), new Vector2(23f, 58f) * 64f + new Vector2(-16f, -32f), flipped: false, 0f, Color.White) { interval = 50f, totalNumberOfLoops = 99999, animationLength = 4, light = true, lightID = 987654, id = 987654f, lightRadius = 2f, scale = 4f, layerDepth = 0.37824f }); AmbientLocationSounds.addSound(new Vector2(23f, 58f), 1); } if (Game1.currentSeason == "winter" && !Game1.IsRainingHere(this) && Game1.isDarkOut()) { addMoonlightJellies(100, new Random((int)Game1.stats.DaysPlayed + (int)Game1.uniqueIDForThisGame - 24917), new Microsoft.Xna.Framework.Rectangle(35, 0, 60, 60)); } }
public override void actionOnPlayerEntry() { base.actionOnPlayerEntry(); if (this.bigCraftable && this.isOn) { AmbientLocationSounds.addSound(this.tileLocation, 1); } }
public override void actionOnPlayerEntry() { base.actionOnPlayerEntry(); if ((bool)bigCraftable && (bool)isOn) { AmbientLocationSounds.addSound(tileLocation, 1); } }
public override void performPlayerEntryAction(Vector2 tileLocation) { base.performPlayerEntryAction(tileLocation); if (!Game1.currentSeason.Equals("winter") && !Game1.isRaining && Game1.isDarkOut() && Game1.random.NextDouble() < (Game1.currentSeason.Equals("summer") ? 0.08 : 0.04)) { AmbientLocationSounds.addSound(tileLocation, 3); Game1.debugOutput = Game1.debugOutput + " added cricket at " + tileLocation.ToString(); } }
public override void resetForPlayerEntry() { base.resetForPlayerEntry(); Game1.changeMusicTrack("echos"); //0 is the babbling brook sound AmbientLocationSounds.addSound(fountainPosition, 0); SteamPosition = new Vector2(0f, 0f); SteamAnimation = SteamAnimation ?? Game1.temporaryContent.Load <Texture2D>("LooseSprites\\steamAnimation"); }
public override void performPlayerEntryAction(Vector2 tileLocation) { base.performPlayerEntryAction(tileLocation); string season = (((int)overrideSeason == -1) ? Game1.GetSeasonForLocation(currentLocation) : Utility.getSeasonNameFromNumber(overrideSeason)); if (!season.Equals("winter") && !Game1.IsRainingHere(currentLocation) && Game1.isDarkOut() && Game1.random.NextDouble() < (season.Equals("summer") ? 0.08 : 0.04)) { AmbientLocationSounds.addSound(tileLocation, 3); Game1.debugOutput = Game1.debugOutput + " added cricket at " + tileLocation.ToString(); } }
protected override void resetLocalState() { base.resetLocalState(); AmbientLocationSounds.addSound(new Vector2(4f, 3f), 2); if (this.miniJukeboxTrack.Value is null) { Game1.changeMusicTrack("fieldofficeTentMusic"); // Suggested tracks: Snail's Radio, Jumio Kart (Gem), Pirate Theme } }
protected override void resetLocalState() { base.resetLocalState(); if (Game1.getMusicTrackName().ToLower().Contains("ambient")) { Game1.changeMusicTrack("none"); } if (!Game1.IsWinter) { AmbientLocationSounds.addSound(new Vector2(15f, 56f), 0); } }
// Token: 0x06001280 RID: 4736 RVA: 0x001779F4 File Offset: 0x00175BF4 public override void performActionOnPlayerLocationEntry() { base.performActionOnPlayerLocationEntry(); if (Game1.timeOfDay >= 2000 && Game1.timeOfDay < 2400 && !Game1.IsWinter) { Game1.currentLightSources.Add(new LightSource(4, new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1)) * (float)Game1.tileSize + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), 0.5f) { identifier = this.tileX + this.tileY * 777 }); AmbientLocationSounds.addSound(new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1)), 1); this.wasLit = true; } }
protected override void resetLocalState() { base.resetLocalState(); base.critters = new List <Critter>(); AmbientLocationSounds.addSound(new Vector2(7f, 0f), 0); AmbientLocationSounds.addSound(new Vector2(13f, 0f), 0); if (String.IsNullOrEmpty(this.miniJukeboxTrack.Value)) { Game1.changeMusicTrack("fieldofficeTentMusic"); // Suggested tracks: Snail's Radio, Jumio Kart (Gem), Pirate Theme } }
protected override void resetLocalState() { base.critters = new List <Critter>(); List <TemporaryAnimatedSprite> preservedSprites = new List <TemporaryAnimatedSprite>(); foreach (TemporaryAnimatedSprite sprite in base.temporarySprites) { preservedSprites.Add(sprite); } base.resetLocalState(); base.temporarySprites = preservedSprites; AmbientLocationSounds.addSound(new Vector2(44f, 23f), 2); }
// Token: 0x06001198 RID: 4504 RVA: 0x00168A84 File Offset: 0x00166C84 public override void resetForPlayerEntry() { base.resetForPlayerEntry(); if (Game1.currentSong != null && Game1.currentSong.Name.ToLower().Contains("ambient")) { Game1.changeMusicTrack("none"); } if (this.witchStatueGone || Game1.player.mailReceived.Contains("witchStatueGone")) { base.removeTile(54, 35, "Buildings"); base.removeTile(54, 34, "Front"); } if (!Game1.IsWinter) { AmbientLocationSounds.addSound(new Vector2(15f, 56f), 0); } }
protected override void resetLocalState() { base.resetLocalState(); if (Game1.getMusicTrackName().ToLower().Contains("ambient")) { Game1.changeMusicTrack("none"); } if ((bool)witchStatueGone || Game1.MasterPlayer.mailReceived.Contains("witchStatueGone")) { removeTile(54, 35, "Buildings"); removeTile(54, 34, "Front"); } if (!Game1.IsWinter) { AmbientLocationSounds.addSound(new Vector2(15f, 56f), 0); } }
public override bool checkForAction(Farmer who, bool justCheckingForActivity = false) { if ((bool)bigCraftable) { if (justCheckingForActivity) { return(true); } if ((int)parentSheetIndex == 278) { Vector2 center = Utility.getTopLeftPositionForCenteringOnScreen(800 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2); Game1.activeClickableMenu = new CraftingPage((int)center.X, (int)center.Y, 800 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2, cooking: true, standalone_menu: true); return(true); } isOn.Value = !isOn; if ((bool)isOn) { if ((bool)bigCraftable) { if (who != null) { Game1.playSound("fireball"); } initializeLightSource(tileLocation); AmbientLocationSounds.addSound(tileLocation, 1); } } else if ((bool)bigCraftable) { performRemoveAction(tileLocation, Game1.currentLocation); if (who != null) { Game1.playSound("woodyHit"); } } return(true); } return(base.checkForAction(who, justCheckingForActivity)); }
//Make the ten minute update method call the FruitPokeToHarvest method instead of the regular one. public override void performTenMinuteAction(int timeElapsed) { //building base does nothing for (int index = this.myJunimos.Count - 1; index >= 0; --index) { if (!Game1.getFarm().characters.Contains((NPC)this.myJunimos[index])) { this.myJunimos.RemoveAt(index); } else { (this.myJunimos[index] as FruitTreeAwareJunimoHarvester).FruitPokeToHarvest(); } } if (this.myJunimos.Count <JunimoHarvester>() < 3 && Game1.timeOfDay < 1900) { this.fjunimoSendOutTimer.SetValue(1); } if (Game1.timeOfDay >= 2000 && Game1.timeOfDay < 2400 && (!Game1.IsWinter && Utility.getLightSource(this.tileX + this.tileY * 777) == null) && Game1.random.NextDouble() < 0.2) { Game1.currentLightSources.Add(new LightSource(4, new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1)) * (float)Game1.tileSize + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), 0.5f) { identifier = this.tileX + this.tileY * 777 }); AmbientLocationSounds.addSound(new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1)), 1); this.fwasLit.SetValue(true); } else { if (Game1.timeOfDay != 2400 || Game1.IsWinter) { return; } Utility.removeLightSource(this.tileX + this.tileY * 777); AmbientLocationSounds.removeSound(new Vector2((float)(this.tileX + 1), (float)(this.tileY + 1))); } }
public void updateLightState() { if (Game1.currentLocation != Game1.getFarm()) { return; } if (wasLit.Value) { if (Utility.getLightSource((int)tileX + (int)tileY * 777) == null) { Game1.currentLightSources.Add(new LightSource(4, new Vector2((int)tileX + 1, (int)tileY + 1) * 64f + new Vector2(32f, 32f), 0.5f, LightSource.LightContext.None, 0L) { Identifier = (int)tileX + (int)tileY * 777 }); } AmbientLocationSounds.addSound(new Vector2((int)tileX + 1, (int)tileY + 1), 1); } else { Utility.removeLightSource((int)tileX + (int)tileY * 777); AmbientLocationSounds.removeSound(new Vector2((int)tileX + 1, (int)tileY + 1)); } }
public static bool CheckForAction_Pre(Torch __instance, Farmer who, bool justCheckingForActivity) { try { if (justCheckingForActivity) { return(true); } // check for ignition if (__instance.IsCookoutKit() && !__instance.IsOn && who != null) { int coalCount = mod.Config.CoalNeeded; int baseKindlingCount = mod.Config.FiberNeeded; int baseWoodCount = mod.Config.WoodNeeded; float driftwoodMult = mod.Config.DriftwoodMultiplier; float hardwoodMult = mod.Config.HardwoodMultiplier; bool hasCoal = who.hasItemInInventory(CoalID, coalCount); bool hasKindling = false; int kindlingID = -1; int actualKindlingCount = -1; if (hasCoal) { if (!hasKindling) { // soggy newspaper hasKindling = CheckForResource(who, 172, baseKindlingCount, mod.Config.NewspaperMultiplier, ref kindlingID, ref actualKindlingCount); } if (!hasKindling) { // fiber hasKindling = CheckForResource(who, FiberID, baseKindlingCount, 1, ref kindlingID, ref actualKindlingCount); } if (!hasKindling) { // wool hasKindling = CheckForResource(who, 440, baseKindlingCount, mod.Config.WoolMultiplier, ref kindlingID, ref actualKindlingCount); } if (!hasKindling) { // cloth hasKindling = CheckForResource(who, 428, baseKindlingCount, mod.Config.ClothMultiplier, ref kindlingID, ref actualKindlingCount); } } bool hasWood = false; int chosenWoodID = -1; int actualWoodCount = -1; if (hasCoal && hasKindling) { if (!hasWood) { // driftwood hasWood = CheckForResource(who, DriftwoodID, baseKindlingCount, mod.Config.DriftwoodMultiplier, ref chosenWoodID, ref actualWoodCount); } if (!hasWood) { // wood hasWood = CheckForResource(who, WoodID, baseKindlingCount, 1, ref chosenWoodID, ref actualWoodCount); } if (!hasWood) { // hardwood hasWood = CheckForResource(who, HardwoodID, baseKindlingCount, mod.Config.HardwoodMultiplier, ref chosenWoodID, ref actualWoodCount); } } if (hasCoal && hasKindling && hasWood) { who.removeItemsFromInventory(CoalID, coalCount); who.removeItemsFromInventory(kindlingID, actualKindlingCount); who.removeItemsFromInventory(chosenWoodID, actualWoodCount); __instance.IsOn = true; if (__instance.bigCraftable.Value) { Game1.playSound("fireball"); __instance.initializeLightSource(__instance.TileLocation, false); AmbientLocationSounds.addSound(__instance.TileLocation, 1); } } else { var coal = new StardewObject(CoalID, 0); var fiber = new StardewObject(FiberID, 0); var wood = new StardewObject(WoodID, 0); Game1.showRedMessage($"{coalCount} {coal.DisplayName}, {baseKindlingCount} {fiber.DisplayName}, {baseWoodCount} {wood.DisplayName}"); } return(false); } else { return(true); } } catch (Exception e) { mod.ErrorLog("There was an exception in a patch", e); return(true); } }