Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Swim] Update to 1.6 #133

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
62 changes: 29 additions & 33 deletions Swim/AbigailProjectile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using Newtonsoft.Json.Linq;
using StardewValley;
using StardewValley.Monsters;
using StardewValley.Network;
Expand All @@ -12,13 +13,12 @@ public class AbigailProjectile : BasicProjectile
private string myCollisionSound;
private bool myExplode;

public AbigailProjectile(int damageToFarmer, int ParentSheetIndex, int bouncesTillDestruct, int tailLength, float rotationVelocity, float xVelocity, float yVelocity, Vector2 startingPosition, string collisionSound, string bounceSound, string firingSound, bool explode, bool damagesMonsters = false, GameLocation location = null, Character firer = null, onCollisionBehavior collisionBehavior = null, string shotItemId = null) : base(damageToFarmer, ParentSheetIndex, bouncesTillDestruct, tailLength, rotationVelocity, xVelocity, yVelocity, startingPosition, collisionSound, bounceSound, firingSound, explode, true, location, firer, null, null)
public AbigailProjectile(int damageToFarmer, int ParentSheetIndex, int bouncesTillDestruct, int tailLength, float rotationVelocity, float xVelocity, float yVelocity, Vector2 startingPosition, string collisionSound, string bounceSound, string firingSound, bool explode, bool damagesMonsters = false, GameLocation location = null, Character firer = null, onCollisionBehavior collisionBehavior = null, string shotItemId = null) : base(damageToFarmer, ParentSheetIndex, bouncesTillDestruct, tailLength, rotationVelocity, xVelocity, yVelocity, startingPosition, collisionSound, bounceSound, firingSound, explode, true, location, firer, collisionBehavior, shotItemId)
{
IgnoreLocationCollision = true;
myCollisionSound = collisionSound;
myExplode = explode;
}

public override void behaviorOnCollisionWithMonster(NPC n, GameLocation location)
{
explosionAnimation(location);
Expand All @@ -31,41 +31,37 @@ public override void behaviorOnCollisionWithMonster(NPC n, GameLocation location
protected override void explosionAnimation(GameLocation location)
{
Rectangle sourceRect = GetSourceRect();
sourceRect.X += 28;
sourceRect.Y += 28;
sourceRect.Width = 8;
sourceRect.Height = 8;
int whichDebris = 12;
int value = currentTileSheetIndex.Value;
switch (value)

if(itemId.Value != null)
{
case 378:
whichDebris = 0;
break;
case 379:
case 381:
case 383:
case 385:
break;
case 380:
whichDebris = 2;
break;
case 382:
whichDebris = 4;
break;
case 384:
whichDebris = 6;
break;
case 386:
whichDebris = 10;
break;
default:
if (value == 390)
{
sourceRect.X += 28;
sourceRect.Y += 28;
sourceRect.Width = 8;
sourceRect.Height = 8;
switch (itemId.Value)
{
case "(O)378":
whichDebris = 0;
break;
case "(O)380":
whichDebris = 2;
break;
case "(O)382":
whichDebris = 4;
break;
case "(O)384":
whichDebris = 6;
break;
case "(O)386":
whichDebris = 10;
break;
case "(O)390":
whichDebris = 14;
}
break;
break;
}
}

if (itemId.Value != null)
{
Game1.createRadialDebris(location, whichDebris, (int)(position.X + 32f) / 64, (int)(position.Y + 32f) / 64, 6, false, -1, false);
Expand Down
4 changes: 2 additions & 2 deletions Swim/IJsonAssetsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
public interface IJsonAssetsApi
{
int GetClothingId(string name);
int GetHatId(string name);
string GetClothingId(string name);
string GetHatId(string name);
void LoadAssets(string path);
}
}
4 changes: 4 additions & 0 deletions Swim/ModConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class ModConfig
public bool ReadyToSwim { get; set; }
public bool SwimIndoors { get; set; }
public bool SwimSuitAlways { get; set; }
public bool DisplayHatWithSwimsuit { get; set; }
public bool NoAutoSwimSuit { get; set; }
public bool ShowOxygenBar { get; set; }
public int JumpTimeInMilliseconds { get; set; }
Expand All @@ -22,6 +23,7 @@ public class ModConfig
public bool AddCrabs { get; set; }
public bool BreatheSound { get; set; }
public bool EnableClickToSwim { get; set; }
public bool MustClickOnOppositeTerrain { get; set; } // In click to swim, whether you must click on land to leave water (and vice versa) or can just click in the direction of land.
public int MineralPerThousandMin { get; set; }
public int MineralPerThousandMax { get; set; }
public int CrabsPerThousandMin { get; set; }
Expand Down Expand Up @@ -55,7 +57,9 @@ public ModConfig()
SwimIndoors = false;
ShowOxygenBar = true;
SwimSuitAlways = false;
DisplayHatWithSwimsuit = true;
EnableClickToSwim = true;
MustClickOnOppositeTerrain = false;
BreatheSound = true;
SwimRestoresVitals = false;

Expand Down
Loading