Skip to content

Commit

Permalink
Merge pull request #5 from veywrn/update-steam-154
Browse files Browse the repository at this point in the history
Decompile of Windows Steam edition v1.5.4 with ILSpy 5.0
  • Loading branch information
veywrn authored Jan 24, 2021
2 parents d1eeac0 + 5702242 commit 3ff171b
Show file tree
Hide file tree
Showing 100 changed files with 1,640 additions and 667 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Community edition. Different steps may be necessary for other environments.
- steam_api.dll
- Steamworks.NET.dll
- xTile.dll
- (pre 1.5) CSteamworks.dll
- (pre 1.5) GalaxyPeer.dll

1. Copy the following libraries from XNA 4.0 to `lib`:
- Microsoft.Xna.Framework.dll
Expand Down
15 changes: 15 additions & 0 deletions StardewValley/BaseEnchantment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ public static List<BaseEnchantment> GetAvailableEnchantmentsForItem(Tool item)
item_enchantments.Add(enchantment);
}
}
foreach (string previous_enchantment in item.previousEnchantments)
{
if (item_enchantments.Count <= 1)
{
return item_enchantments;
}
for (int i = 0; i < item_enchantments.Count; i++)
{
if (item_enchantments[i].GetName() == previous_enchantment)
{
item_enchantments.RemoveAt(i);
break;
}
}
}
return item_enchantments;
}

Expand Down
1 change: 1 addition & 0 deletions StardewValley/BellsAndWhistles/Lexicon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public static string makePlural(string word, bool ignore = false)
case "Smallmouth Bass":
case "Star Shards":
case "Tea Leaves":
case "Clay":
case "Pickles":
return word;
default:
Expand Down
4 changes: 4 additions & 0 deletions StardewValley/Buildings/FishPond.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ public override bool doAction(Vector2 tileLocation, Farmer who)
{
Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\Buildings:WrongFishTypeCoral", heldFishName2));
}
else if (Game1.content.GetCurrentLanguage() == LocalizedContentManager.LanguageCode.de)
{
Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\Buildings:WrongFishType", heldFishName2, Game1.objectInformation[fishType].Split('/')[4]));
}
else
{
Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\Buildings:WrongFishType", heldFishName2.ToLower(), Game1.objectInformation[fishType].Split('/')[4].ToLower()));
Expand Down
54 changes: 29 additions & 25 deletions StardewValley/Buildings/GreenhouseBuilding.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using xTile;
using xTile.Dimensions;
using xTile.Layers;
Expand Down Expand Up @@ -166,34 +167,37 @@ public virtual void DrawEntranceTiles(SpriteBatch b)
{
Map map = GetFarm().Map;
Layer back_layer = map.GetLayer("Back");
TileSheet tilesheet = map.TileSheets[1];
if (Game1.whichFarm == 6)
TileSheet tilesheet = map.GetTileSheet("untitled tile sheet");
if (tilesheet == null)
{
tilesheet = map.TileSheets[2];
tilesheet = map.TileSheets[Math.Min(1, map.TileSheets.Count - 1)];
}
Vector2 vector_draw_position3 = Vector2.Zero;
Location draw_location = new Location(0, 0);
StaticTile tile2 = new StaticTile(back_layer, tilesheet, BlendMode.Alpha, 812);
if (CanDrawEntranceTiles())
if (tilesheet != null)
{
float draw_layer = 0f;
vector_draw_position3 = Game1.GlobalToLocal(Game1.viewport, new Vector2((int)tileX + humanDoor.Value.X - 1, (int)tileY + humanDoor.Value.Y + 1) * 64f);
draw_location.X = (int)vector_draw_position3.X;
draw_location.Y = (int)vector_draw_position3.Y;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
tile2 = new StaticTile(back_layer, tilesheet, BlendMode.Alpha, 838);
vector_draw_position3 = Game1.GlobalToLocal(Game1.viewport, new Vector2((int)tileX + humanDoor.Value.X - 1, (int)tileY + humanDoor.Value.Y + 2) * 64f);
draw_location.X = (int)vector_draw_position3.X;
draw_location.Y = (int)vector_draw_position3.Y;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
Vector2 vector_draw_position3 = Vector2.Zero;
Location draw_location = new Location(0, 0);
StaticTile tile2 = new StaticTile(back_layer, tilesheet, BlendMode.Alpha, 812);
if (CanDrawEntranceTiles())
{
float draw_layer = 0f;
vector_draw_position3 = Game1.GlobalToLocal(Game1.viewport, new Vector2((int)tileX + humanDoor.Value.X - 1, (int)tileY + humanDoor.Value.Y + 1) * 64f);
draw_location.X = (int)vector_draw_position3.X;
draw_location.Y = (int)vector_draw_position3.Y;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
tile2 = new StaticTile(back_layer, tilesheet, BlendMode.Alpha, 838);
vector_draw_position3 = Game1.GlobalToLocal(Game1.viewport, new Vector2((int)tileX + humanDoor.Value.X - 1, (int)tileY + humanDoor.Value.Y + 2) * 64f);
draw_location.X = (int)vector_draw_position3.X;
draw_location.Y = (int)vector_draw_position3.Y;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
draw_location.X += 64;
Game1.mapDisplayDevice.DrawTile(tile2, draw_location, draw_layer);
}
}
}

Expand Down
29 changes: 25 additions & 4 deletions StardewValley/Buildings/JunimoHut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Netcode;
using StardewValley.BellsAndWhistles;
using StardewValley.Characters;
using StardewValley.Locations;
using StardewValley.Menus;
using StardewValley.Objects;
using StardewValley.TerrainFeatures;
Expand Down Expand Up @@ -35,6 +36,9 @@ public class JunimoHut : Building
[XmlIgnore]
public Point lastKnownCropLocation = Point.Zero;

[XmlElement("shouldSendOutJunimos")]
public NetBool shouldSendOutJunimos = new NetBool(value: false);

private Rectangle lightInteriorRect = new Rectangle(195, 0, 18, 17);

private Rectangle bagRect = new Rectangle(208, 51, 15, 13);
Expand All @@ -54,7 +58,7 @@ public JunimoHut()
protected override void initNetFields()
{
base.initNetFields();
base.NetFields.AddFields(output, noHarvest, wasLit);
base.NetFields.AddFields(output, noHarvest, wasLit, shouldSendOutJunimos);
wasLit.fieldChangeVisibleEvent += delegate
{
updateLightState();
Expand Down Expand Up @@ -85,6 +89,14 @@ public override void dayUpdate(int dayOfMonth)
sourceRect = getSourceRectForMenu();
myJunimos.Clear();
wasLit.Value = false;
shouldSendOutJunimos.Value = true;
foreach (Farmer f in Game1.getAllFarmers())
{
if (f.isActive() && f.currentLocation != null && (f.currentLocation is FarmHouse || f.currentLocation.isStructure.Value))
{
shouldSendOutJunimos.Value = false;
}
}
}

public void sendOutJunimos()
Expand Down Expand Up @@ -153,15 +165,15 @@ public int getUnusedJunimoNumber()
return 2;
}

public override void Update(GameTime time)
public override void updateWhenFarmNotCurrentLocation(GameTime time)
{
base.Update(time);
base.updateWhenFarmNotCurrentLocation(time);
output.Value.mutex.Update(Game1.getFarm());
if (output.Value.mutex.IsLockHeld() && Game1.activeClickableMenu == null)
{
output.Value.mutex.ReleaseLock();
}
if (!Game1.IsMasterGame || junimoSendOutTimer <= 0)
if (!Game1.IsMasterGame || junimoSendOutTimer <= 0 || !shouldSendOutJunimos.Value)
{
return;
}
Expand Down Expand Up @@ -189,6 +201,15 @@ public override void Update(GameTime time)
}
}

public override void Update(GameTime time)
{
if (!shouldSendOutJunimos.Value)
{
shouldSendOutJunimos.Value = true;
}
base.Update(time);
}

private Color? getGemColor(ref bool isPrismatic)
{
List<Color> gemColors = new List<Color>();
Expand Down
4 changes: 4 additions & 0 deletions StardewValley/BundleGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ public Item ParseItemString(string item_string)
(found_item as Object).Quality = quality;
}
}
if (found_item == null)
{
throw new Exception("Invalid item name '" + item_name + "' encountered while generating a bundle.");
}
found_item.Stack = count;
return found_item;
}
Expand Down
4 changes: 0 additions & 4 deletions StardewValley/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ public class Character : INetObject<NetFields>

private bool emoteFading;

[XmlIgnore]
public bool hasMoved;

[XmlIgnore]
private readonly NetBool _willDestroyObjectsUnderfoot = new NetBool(value: true);

Expand Down Expand Up @@ -282,7 +279,6 @@ public Vector2 Position
{
if (position.Value != value)
{
hasMoved = true;
position.Set(value);
}
}
Expand Down
2 changes: 1 addition & 1 deletion StardewValley/Characters/JunimoHarvester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public override void update(GameTime time, GameLocation location)
}
else if (alpha > 0f && controller == null)
{
if ((base.addedSpeed > 0 || base.speed > 2 || isCharging) && Game1.IsMasterGame)
if ((base.addedSpeed > 0 || base.speed > 3 || isCharging) && Game1.IsMasterGame)
{
destroy = true;
}
Expand Down
12 changes: 9 additions & 3 deletions StardewValley/Crop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public class Crop : INetObject<NetFields>

private Rectangle coloredSourceRect;

private static Vector2 origin = new Vector2(8f, 24f);

private static Vector2 smallestTileSizeOrigin = new Vector2(8f, 8f);

public NetFields NetFields
{
get;
Expand Down Expand Up @@ -571,7 +575,10 @@ public bool harvest(int xTile, int yTile, HoeDirt soil, JunimoHarvester junimoHa
}
else if ((int)indexOfHarvest == 771)
{
Game1.player.currentLocation.playSound("cut");
if (soil != null && soil.currentLocation != null)
{
soil.currentLocation.playSound("cut");
}
if (r.NextDouble() < 0.1)
{
Object mixedSeeds_item = new Object(770, 1);
Expand Down Expand Up @@ -813,11 +820,10 @@ public void draw(SpriteBatch b, Vector2 tileLocation, Color toTint, float rotati
}
else
{
b.Draw(Game1.mouseCursors, position, sourceRect, Color.White, 0f, new Vector2(8f, 8f), 4f, SpriteEffects.None, layerDepth);
b.Draw(Game1.mouseCursors, position, sourceRect, Color.White, 0f, smallestTileSizeOrigin, 4f, SpriteEffects.None, layerDepth);
}
return;
}
Vector2 origin = new Vector2(8f, 24f);
SpriteEffects effect = flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
b.Draw(Game1.cropSpriteSheet, position, sourceRect, toTint, rotation, origin, 4f, effect, layerDepth);
Color tintColor = this.tintColor.Value;
Expand Down
Loading

0 comments on commit 3ff171b

Please sign in to comment.