Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // my comments
- StardewValley.Utility
- // at a 1% chance, if past year 1, create a new "0" Sound in the Night (SITN) event
- // for reference, meteorites and witches happen at 1% chance (no other criteria). fairy at 1% if not winter.
- // owl statues would be created at 1% chance (i think) but that code is removed
- // (the game finds a location when it does the owl event but then does nothing with it)
- if (random.NextDouble() < 0.01 && Game1.year > 1)
- {
- return new SoundInTheNightEvent(0);
- }
- StardewValley.Events/SoundInTheNightEvent
- // SITN event 0 marked as "crop Circle". may have originally been something else
- public const int cropCircle = 0;
- ...
- switch (this.behavior)
- {
- case 0:
- this.soundName = "UFO";
- this.message = "A strange sound was heard in the night...";
- for (int i = 50; i > 0; i--)
- {
- // determine random placeable location. tries fifty times to find a possible location?
- this.targetLocation = new Vector2((float)random.Next(5, farm.map.GetLayer("Back").TileWidth - 4), (float)random.Next(5, farm.map.GetLayer("Back").TileHeight - 4));
- if (!farm.isTileLocationTotallyClearAndPlaceable(this.targetLocation))
- {
- return true;
- }
- }
- break;
- ...
- switch (this.behavior)
- {
- case 0:
- {
- // creates object 96 and sets a 'minutes until ready' count to 24000 - whatever the current time of day is
- // 60 mins/hour * 24 hours/day = approx 16 days to hatch?
- StardewValley.Object @object = new StardewValley.Object(this.targetLocation, 96, false);
- @object.minutesUntilReady = 24000 - Game1.timeOfDay;
- farm.objects.Add(this.targetLocation, @object);
- return;
- }
- StardewValley/Object
- public virtual bool minutesElapsed(int minutes, GameLocation environment)
- {
- ..
- // if object is 96 (or 97? there are three sprites for the capsule so maybe it cycles animations between 96/97..)
- case 96:
- case 97:
- this.minutesUntilReady -= minutes;
- this.showNextIndex = (this.parentSheetIndex == 96);
- if (this.minutesUntilReady <= 0)
- {
- // remove the 96 object (Strange Capsule) and replace it with 98 object (Empty Capsule)
- environment.objects.Remove(this.tileLocation);
- environment.objects.Add(this.tileLocation, new Object(this.tileLocation, 98, false));
- }
- break;
- // setting up light
- public void initializeLightSource(Vector2 tileLocation)
- {
- // it gives off light identical to singing stone
- if (this.name.Equals("Singing Stone") || this.name.Equals("Strange Capsule"))
- {
- this.lightSource = new LightSource(4, new Vector2(tileLocation.X * (float)Game1.tileSize + (float)(Game1.tileSize / 2), tileLocation.Y * (float)Game1.tileSize - (float)Game1.tileSize), 2f, Color.Violet, (int)(tileLocation.X * 2000f + tileLocation.Y));
- }
- // when placed down by the player
- public virtual bool performDropDownAction(Farmer who)
- {
- if (this.name.Contains("Strange Capsule"))
- {
- // if placed by the player instead of the event, hatches after approximately 4 days
- this.minutesUntilReady = 6000 - Game1.timeOfDay;
- }
- BigCraftablesInformation.yaml
- 96: "Strange Capsule/0/-300/Crafting -9/There's something fleshy bobbing around in the fluid.../true/false/0" #!String
- 98: "Empty Capsule/0/-300/Crafting -9/Part of the glass is shattered./true/false/0" #!String
- // nothing found in the 'interact with object' (like the Singing Stone or Hopper or whatever) code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement