Add riverboat captain career and distinct ship classes
Add class-specific vessel geometry and sea motion, a guided helm qualification path, dockside sailing orders, and local excursions at all 24 ports.
This commit is contained in:
78
Assets/BigShipTycoon/Runtime/RiverVesselExterior.cs
Normal file
78
Assets/BigShipTycoon/Runtime/RiverVesselExterior.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BigShipTycoon
|
||||
{
|
||||
internal sealed partial class VesselExterior
|
||||
{
|
||||
private void BuildRiverVessel()
|
||||
{
|
||||
float baseY = BaseDeck(ship);
|
||||
Vector2[] hull = Outline(length, beam, 0, 36);
|
||||
Coat(Paint.Antifouling).Loft(hull, Vector2.zero, false,
|
||||
new Vector3(.79f, -.82f, .69f), new Vector3(.93f, -.50f, .84f), new Vector3(1f, -.17f, .965f));
|
||||
Coat(Paint.Navy).Loft(hull, Vector2.zero, false, new Vector3(1f, -.18f, .97f), new Vector3(1.002f, .86f, 1.02f));
|
||||
Coat(Paint.Gold).Loft(hull, Vector2.zero, false, new Vector3(1.006f, .615f, 1.025f), new Vector3(1.006f, .70f, 1.026f));
|
||||
Coat(Paint.Ivory).Loft(hull, Vector2.zero, false, new Vector3(1.002f, .87f, 1.02f), new Vector3(.994f, baseY, .995f));
|
||||
Coat(Paint.Teak).Loft(hull, Vector2.zero, true, new Vector3(.994f, baseY, .995f));
|
||||
Rails(hull, baseY, baseY + .66f, 1.65f);
|
||||
|
||||
for (int deck = 0; deck < ship.Decks.Count; deck++)
|
||||
{
|
||||
float deckY = baseY + DeckSpacing * deck;
|
||||
bool top = deck == ship.Decks.Count - 1;
|
||||
float cabinLength = length * (top ? .68f : .76f);
|
||||
float cabinHalfWidth = beam * (top ? .73f : .78f);
|
||||
var center = new Vector2(-length * .047f, 0);
|
||||
Vector2[] cabin = RoundedRectangle(center, cabinLength * .5f, cabinHalfWidth, .75f);
|
||||
Coat(Paint.Ivory).Loft(cabin, center, false,
|
||||
new Vector3(1, deckY, .98f), new Vector3(1, deckY + .58f, 1));
|
||||
Coat(Paint.AtriumGlass).Loft(cabin, center, false,
|
||||
new Vector3(1, deckY + .57f, 1), new Vector3(.998f, deckY + 2.13f, .992f));
|
||||
Coat(Paint.Ivory).Loft(cabin, center, false,
|
||||
new Vector3(.998f, deckY + 2.13f, .992f), new Vector3(.999f, deckY + 2.42f, 1.01f));
|
||||
Coat(Paint.Pearl).Loft(cabin, center, false,
|
||||
new Vector3(1.018f, deckY + 2.40f, 1.047f), new Vector3(1.022f, deckY + DeckSpacing, 1.061f));
|
||||
Coat(Paint.Teak).Loft(cabin, center, true, new Vector3(1.023f, deckY + DeckSpacing, 1.063f));
|
||||
Rails(cabin, deckY + DeckSpacing, deckY + DeckSpacing + .69f, 1.52f);
|
||||
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
{
|
||||
float z = side * cabinHalfWidth;
|
||||
for (int pane = 0; pane < 8; pane++)
|
||||
{
|
||||
float x = center.x + Mathf.Lerp(-cabinLength * .405f, cabinLength * .405f, pane / 7f);
|
||||
Coat(Paint.Pearl).Box(new Vector3(x, deckY + 1.38f, z), new Vector3(.088f, 1.64f, .102f));
|
||||
Coat(Paint.Steel).Box(new Vector3(x, deckY + .68f, z + side * .045f), new Vector3(.24f, .031f, .099f));
|
||||
}
|
||||
Coat(Paint.Steel).Box(new Vector3(center.x, deckY + .69f, z + side * .034f), new Vector3(cabinLength * .88f, .05f, .088f));
|
||||
Coat(Paint.Pearl).Box(new Vector3(center.x, deckY + 2.18f, z + side * .034f), new Vector3(cabinLength * .91f, .077f, .092f));
|
||||
Coat(Paint.Gold).Box(new Vector3(center.x, deckY + 2.28f, z - side * .025f), new Vector3(cabinLength * .92f, .046f, .052f));
|
||||
}
|
||||
}
|
||||
|
||||
float roof = MegaDeckGeometry.RoofHeight(ship.Decks.Count, SunDeckZone.Sky, ship);
|
||||
float bridge = MegaDeckGeometry.BridgeCenter(ship, ship.Decks.Count);
|
||||
var bridgeCenter = new Vector2(bridge, 0);
|
||||
Vector2[] wheelhouse = RoundedRectangle(bridgeCenter, Mathf.Min(4.21f, length * .17f), beam * .63f, .59f);
|
||||
Coat(Paint.Ivory).Loft(wheelhouse, bridgeCenter, false, new Vector3(1, roof, 1), new Vector3(1, roof + .83f, 1));
|
||||
Coat(Paint.Glass).Loft(wheelhouse, bridgeCenter, false,
|
||||
new Vector3(1, roof + .83f, 1), new Vector3(.92f, roof + 2.39f, .96f));
|
||||
Coat(Paint.Pearl).Loft(wheelhouse, bridgeCenter, true,
|
||||
new Vector3(.965f, roof + 2.39f, 1.025f), new Vector3(1.015f, roof + 2.57f, 1.06f));
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
{
|
||||
Coat(Paint.Pearl).Box(new Vector3(bridge, roof + 1.6f, side * beam * .62f), new Vector3(.092f, 1.6f, .10f));
|
||||
Coat(side < 0 ? Paint.PortLight : Paint.StarboardLight).Box(new Vector3(bridge + 2.93f, roof + 1.55f, side * beam * .61f),
|
||||
new Vector3(.29f, .18f, .13f));
|
||||
float stern = -length * .245f;
|
||||
Vector3 upright = new(stern, roof, side * beam * .51f);
|
||||
Coat(Paint.Steel).Rod(upright, upright + Vector3.up * 1.64f, .055f, 7, true);
|
||||
Coat(Paint.Steel).Rod(upright - Vector3.right * 1.68f, upright - Vector3.right * 1.68f + Vector3.up * 1.63f, .055f, 7, true);
|
||||
Coat(Paint.Ivory).Box(new Vector3(stern - .75f, roof + .38f, side * beam * .47f), new Vector3(2.68f, .22f, .52f));
|
||||
}
|
||||
Coat(Paint.DeckCanvas).Box(new Vector3(-length * .245f - .84f, roof + 1.65f, 0), new Vector3(2.07f, .15f, beam * 1.19f));
|
||||
Coat(Paint.Steel).Rod(new Vector3(bridge + .2f, roof + 2.51f, 0), new Vector3(bridge + .2f, roof + 3.42f, 0), .045f, 8);
|
||||
Coat(Paint.Pearl).Box(new Vector3(bridge + .2f, roof + 3.3f, 0), new Vector3(.125f, .061f, 1.56f));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user