Skip to content

Commit

Permalink
broken digester (not yet reparable)
Browse files Browse the repository at this point in the history
  • Loading branch information
ameliajmoser committed Mar 7, 2024
1 parent 722c1d2 commit 88ed00a
Show file tree
Hide file tree
Showing 16 changed files with 421 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Assets/Art/Materials/RedLights_Static.mat
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Material:
- _BendDirection: {r: 1.65, g: 2.1, b: 0, a: 0}
- _Color: {r: 1, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EndColor: {r: 1, g: 0.007843138, b: 0, a: 0}
- _EndColor: {r: 0.42352942, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _StartColor: {r: 0.4245283, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []
Expand Down
3 changes: 2 additions & 1 deletion Assets/Code/Assets/RegionAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public enum BuildingType : byte {
ExportDepot,
TollBooth,
TempObstruction,
SkimmerLocation
SkimmerLocation,
DigesterBroken
}

[CreateAssetMenu(menuName = "Zavala/Region Asset")]
Expand Down
1 change: 1 addition & 0 deletions Assets/Code/Building/BuildToolState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public static void RecalculateBlockedTiles(SimGridState grid, SimWorldState worl
// If non-buildable, add to list
if ((grid.Terrain.Info[index].Flags & TerrainFlags.NonBuildable) != 0)
{
// TODO: add exception for broken digester
btState.BlockedIdxs.Add(index);

}
Expand Down
5 changes: 4 additions & 1 deletion Assets/Code/Building/BuildingPools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public class BuildingPools : SharedStateComponent, IRegistrationCallbacks
#region Types

[Serializable] public class RoadPool : SerializablePool<RoadInstanceController> { }
[Serializable] public class DigesterPool : SerializablePool<OccupiesTile> { }
[Serializable] public class DigesterPool : SerializablePool<OccupiesTile> {
[Space]
[SerializeField] public GameObject BrokenDigesterPrefab;
}
[Serializable] public class StoragePool : SerializablePool<OccupiesTile> { }
[Serializable] public class SkimmerPool : SerializablePool<PhosphorusSkimmer> { }
[Serializable] public class VizAnchorPool : SerializablePool<ParticleSystem> { }
Expand Down
11 changes: 11 additions & 0 deletions Assets/Code/Editor/RegionImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,17 @@ static public void ReadStaticConstructions(in TiledData data, RegionId regionId,
tiles[pos].Flags |= TerrainFlags.NonBuildable;
break;
}
case 14: { // broken digester
buildingList.Add(new RegionAsset.BuildingData() {
LocalTileIndex = (ushort)pos,
Type = BuildingType.DigesterBroken,
ScriptName = scriptName
});
occupiedTileIndices.Add(pos);
tiles[pos].Flags |= TerrainFlags.IsOccupied;
tiles[pos].Flags |= TerrainFlags.NonBuildable;
break;
}
case 11:
case 12:
case 13:
Expand Down
8 changes: 8 additions & 0 deletions Assets/Code/Rendering/SimWorldObjectSpawnSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ public override void ProcessWork(float deltaTime) {
building.GetComponent<BuildingPreview>().Apply();
break;
}
case BuildingType.DigesterBroken: {
m_StateB.Terrain.Info[spawn.TileIndex].Flags |= TerrainFlags.IsOccupied;
m_StateB.Terrain.Info[spawn.TileIndex].Flags |= TerrainFlags.NonBuildable;
building = Instantiate(m_StateC.Digesters.BrokenDigesterPrefab, worldPos, Quaternion.identity);
building.SetActive(true);
// building.GetComponent<BuildingPreview>().Apply();
break;
}
}
Assert.NotNull(building);
EventActorUtility.RegisterActor(building.GetComponent<EventActor>(), spawn.Id);
Expand Down
12 changes: 12 additions & 0 deletions Assets/Content/Story/region2-script.leaf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ $call QueueDialogueBubble(region2_city1, region2.enjoyingCypress)
{@advisorEcolForest} All thanks to our <i>stellar</i> ecosystem management.
{@advisorEcolForest} Those <i>hill dwellers</i> over in Knoll County could learn a thing or two.

:: oldDigester
@trigger AlertExamined
@conditions alertType == "dialogue", buildingType == "DigesterBroken", alertRegion == 2
@once
{@advisorEconForest} Ah, this old thing.
{@advisorEconForest} A farmer tried to build a Manure Processor here...
{@advisorEconForest} Thought he could turn Manure into Fertilizer.
{@advisorEcolHill} That sounds great! What happened?
{@advisorEconForest} The cost was too great. It bankrupted his farm!
{@advisorEconForest} Simply not economically feasible...
{@advisorEcolHill} Ugh. You economists are always saying that.

:: bloomRumors
@once
@queued
Expand Down
6 changes: 6 additions & 0 deletions Assets/Content/Text/locations.zaloc
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,18 @@ Storage Unit
:: digester
Manure Processor

:: digesterBroken
Abandoned Processor

:: digesterInfo
<i><u>buys</u> raw manure, <u>sells</u> fertilizer</i>

:: digesterDesc
Manure Processors buy raw manure and turn it into fertilizer that can be shipped for cheap.

:: digesterBrokenDesc
Manure Processors turn manure into fertilizer... But this one's ruined.

:: toll
Border Gate

Expand Down
26 changes: 18 additions & 8 deletions Assets/Data/Regions/SecondRegion.asset
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ MonoBehaviour:
- RegionIndex: 65535
Category: 1
SubCategory: 1
Flags: 177
Flags: 128
Height: 200
- RegionIndex: 65535
Category: 2
Expand Down Expand Up @@ -288,7 +288,7 @@ MonoBehaviour:
- RegionIndex: 65535
Category: 1
SubCategory: 1
Flags: 0
Flags: 32
Height: 200
- RegionIndex: 65535
Category: 2
Expand Down Expand Up @@ -796,6 +796,21 @@ MonoBehaviour:
m_Type: 0
m_RawValue: 0
m_StringHashSource:
- LocalTileIndex: 54
ScriptName:
m_Source: region2_digester1
m_HashValue: 1167550896
Type: 13
LocationName:
m_Source:
m_HashValue: 0
CharacterId:
m_Source:
m_HashValue: 0
AdditionalData:
m_Type: 0
m_RawValue: 0
m_StringHashSource:
Points: []
Roads: []
Modifiers:
Expand All @@ -809,17 +824,12 @@ MonoBehaviour:
m_Source:
m_HashValue: 0
Modifier: 0
- LocalTileIndex: 65
ScriptName:
m_Source:
m_HashValue: 0
Modifier: 0
- LocalTileIndex: 32
ScriptName:
m_Source:
m_HashValue: 0
Modifier: 0
- LocalTileIndex: 43
- LocalTileIndex: 65
ScriptName:
m_Source:
m_HashValue: 0
Expand Down
6 changes: 5 additions & 1 deletion Assets/Editor/LocDatabase.asset
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,15 @@ MonoBehaviour:
Content: Storage Unit
- Id: location.shared.digester
Content: Manure Processor
- Id: location.shared.digesterBroken
Content: Abandoned Processor
- Id: location.shared.digesterInfo
Content: <i><u>buys</u> raw manure, <u>sells</u> fertilizer</i>
- Id: location.shared.digesterDesc
Content: Manure Processors buy raw manure and turn it into fertilizer that
can be shipped for cheap.
- Id: location.shared.digesterBrokenDesc
Content: Manure Processors turn manure into fertilizer... But this one's ruined.
- Id: location.shared.toll
Content: Border Gate
- Id: location.shared.tollDesc
Expand Down Expand Up @@ -275,7 +279,7 @@ MonoBehaviour:
- Path: location.shared
Start: 25
- Path: region
Start: 42
Start: 44
NeedsExport: 0
- Name: ui
FilePath: Assets/Content/Text/ui.zaloc
Expand Down
3 changes: 1 addition & 2 deletions Assets/Prefabs/Regions/Shared/Digester.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ MonoBehaviour:
RefusesSameBuildingType: 0
OverridesBuyPrice: 1
OverrideBlock:
Phosphorus: 18
Phosphorus: 20
Grain: 0
Milk: 0
Flagstaff: {fileID: 0}
Expand Down Expand Up @@ -240,7 +240,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 828cc8f04903a4348baf85b7c59522bc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Renderer: {fileID: 1895349179121568628}
m_Renderers:
- {fileID: 1895349179121568628}
m_Snapping: {fileID: 4665823543789613535}
Expand Down
Loading

0 comments on commit 88ed00a

Please sign in to comment.