-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A bunch of clean up to support using json for stats
- Loading branch information
Showing
20 changed files
with
244 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,50 @@ | ||
using NovemberPirates.Utilities; | ||
using NovemberPirates.Utilities.Data; | ||
using System.Numerics; | ||
|
||
namespace NovemberPirates.Components | ||
{ | ||
internal class Ship | ||
{ | ||
public Ship(HullType hull, BoatColor color, Team team) | ||
{ | ||
BoatType = hull; | ||
BoatColor = color; | ||
Team = team; | ||
|
||
Crew = (int)ShipData.Instance.Data[$"{hull}{Stats.InitialCrew}"]; | ||
MaxSpeed = ShipData.Instance.Data[$"{hull}{Stats.MaxSpeed}"]; | ||
RowingPower = ShipData.Instance.Data[$"{hull}{Stats.RowingSpeed}"]; | ||
RotationSpeed = ShipData.Instance.Data[$"{hull}{Stats.TurningSpeed}"]; | ||
HullHealth = ShipData.Instance.Data[$"{hull}{Stats.HullHealth}"]; | ||
SailHealth = ShipData.Instance.Data[$"{hull}{Stats.SailHealth}"]; | ||
HalfSailSpeedModifier = ShipData.Instance.Data[$"{hull}{Stats.HalfSailSpeed}"]; | ||
FullSailSpeedModifier = ShipData.Instance.Data[$"{hull}{Stats.FullSailSpeed}"]; | ||
SailSpeedEasing = ShipData.Instance.Data[$"{hull}{Stats.SailSpeedEasing}"]; | ||
} | ||
public BoatCondition BoatCondition = BoatCondition.Good; | ||
|
||
public BoatColor BoatColor; | ||
public BoatType BoatType; | ||
public HullType BoatType; | ||
public Team Team; | ||
internal SailStatus Sail = SailStatus.Closed; | ||
|
||
internal List<Cannon> Cannons = new List<Cannon>(); | ||
|
||
internal int Crew = 10; | ||
internal int NextPatrolPoint = 1; | ||
internal Vector2 Target; | ||
internal List<Vector2> Route = new(); | ||
internal float RowingPower = 100f; | ||
internal float RotationSpeed = 100f; | ||
|
||
internal float MaxSpeed = 500f; | ||
internal float HullHealth = 100f; | ||
internal float WindInSail; | ||
|
||
internal int Crew; | ||
internal float RowingPower; | ||
internal float RotationSpeed; | ||
|
||
internal float MaxSpeed; | ||
internal float HullHealth; | ||
internal float SailHealth; | ||
internal float HalfSailSpeedModifier; | ||
internal float FullSailSpeedModifier; | ||
internal float SailSpeedEasing; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using NovemberPirates.Components; | ||
using NovemberPirates.Utilities.Data; | ||
|
||
namespace NovemberPirates.Entities.Archetypes | ||
{ | ||
internal static class CannonBuilder | ||
{ | ||
internal static Cannon Create(CannonType cannonType, BoatSide boatSide, int row) | ||
{ | ||
var cannon = new Cannon(); | ||
cannon.Placement = boatSide; | ||
cannon.Row = row; | ||
|
||
cannon.CannonType = cannonType; | ||
|
||
cannon.ReloadTime = ShipData.Instance.Data[$"{cannonType}{Stats.CannonReloadTime}"]; | ||
cannon.ReloadRate = ShipData.Instance.Data[$"{cannonType}{Stats.CannonReloadRate}"]; | ||
cannon.HullDamage = ShipData.Instance.Data[$"{cannonType}{Stats.CannonHullDamage}"]; | ||
cannon.SailDamage = ShipData.Instance.Data[$"{cannonType}{Stats.CannonSailDamage}"]; | ||
cannon.CrewKillChance = ShipData.Instance.Data[$"{cannonType}{Stats.CannonCrewKillChance}"]; | ||
cannon.CrewKillChainLimit = ShipData.Instance.Data[$"{cannonType}{Stats.CannonCrewKillChainLimit}"]; | ||
cannon.Spread = ShipData.Instance.Data[$"{cannonType}{Stats.CannonSpread}"]; | ||
cannon.BallSpeed = ShipData.Instance.Data[$"{cannonType}{Stats.CannonballSpeed}"]; | ||
cannon.BallDuration = ShipData.Instance.Data[$"{cannonType}{Stats.CannonballDuration}"]; | ||
cannon.ShotPer = ShipData.Instance.Data[$"{cannonType}{Stats.CannonsShotPer}"]; | ||
|
||
return cannon; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.