Skip to content

Commit

Permalink
Finally update blood mod to work with both vanilla and DLC
Browse files Browse the repository at this point in the history
  • Loading branch information
heinermann committed Mar 15, 2021
1 parent 4f3bfa2 commit 2ef7f2c
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 5 deletions.
12 changes: 10 additions & 2 deletions Blood/Blood.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,17 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="archived_versions\vanilla_455509\elements\blood.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="archived_versions\vanilla_455509\mod_info.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<PostBuildEvent>XCOPY /Y /F /I "$(TargetPath)" "$(TargetDir)archived_versions\vanilla_455509\"
XCOPY /Y /F /I /E "$(TargetDir)anim" "$(TargetDir)archived_versions\vanilla_455509\anim"</PostBuildEvent>
</PropertyGroup>
</Project>
7 changes: 5 additions & 2 deletions Blood/ElementUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ public static void RegisterElementStrings(string elementId, string name, string
// Note: As of 2021-03-14
// Needed for vanilla as it does not map anims into a dictionary until after elements have been loaded
// Therefore don't use Assets.GetAnim here.
public static KAnimFile FindAnim(HashedString name)
public static KAnimFile FindAnim(string name)
{
return Assets.Anims.Find((anim) => anim.name == name);
KAnimFile result = Assets.Anims.Find((anim) => anim.name == name);
if (result == null)
Debug.LogError($"Failed to find KAnim: {name}");
return result;
}

public static void AddSubstance(Substance substance)
Expand Down
56 changes: 56 additions & 0 deletions Blood/archived_versions/vanilla_455509/elements/blood.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#iron mass = 0.5 mg/mL blood (0.0005g/1.13g = 0.00044)
---
elements:
- elementId: Blood
maxMass: 1000
liquidCompression: 1.02
speed: 100
minHorizontalFlow: 0.1
minVerticalFlow: 0.01
specificHeatCapacity: 3.49
thermalConductivity: 0.58
solidSurfaceAreaMultiplier: 1
liquidSurfaceAreaMultiplier: 25
gasSurfaceAreaMultiplier: 1
lowTemp: 272.5
highTemp: 372.5
lowTempTransitionTarget: FrozenBlood
highTempTransitionTarget: Steam
highTempTransitionOreId: Iron
highTempTransitionOreMassConversion: 0.001
defaultTemperature: 310
defaultMass: 1000
molarMass: 30
toxicity: 0.1
lightAbsorptionFactor: 0.8
tags:
- Mixture
- AnyWater
isDisabled: false
state: Liquid
localizationID: STRINGS.ELEMENTS.BLOOD.NAME

- elementId: FrozenBlood
specificHeatCapacity: 3.05
thermalConductivity: 1
solidSurfaceAreaMultiplier: 1
liquidSurfaceAreaMultiplier: 1
gasSurfaceAreaMultiplier: 1
strength: 1
highTemp: 272.5
highTempTransitionTarget: Blood
defaultTemperature: 230
defaultMass: 500
maxMass: 800
hardness: 10
molarMass: 35
lightAbsorptionFactor: 0.8
materialCategory: Liquifiable
tags:
- IceOre
- Mixture
- BuildableAny
buildMenuSort: 5
isDisabled: false
state: Solid
localizationID: STRINGS.ELEMENTS.FROZENBLOOD.NAME
2 changes: 2 additions & 0 deletions Blood/archived_versions/vanilla_455509/mod_info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
supportedContent: VANILLA_ID
lastWorkingBuild: 455509
2 changes: 2 additions & 0 deletions Blood/elements/blood.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ elements:
isDisabled: false
state: Liquid
localizationID: STRINGS.ELEMENTS.BLOOD.NAME
dlcId: ""

- elementId: FrozenBlood
specificHeatCapacity: 3.05
Expand All @@ -54,3 +55,4 @@ elements:
isDisabled: false
state: Solid
localizationID: STRINGS.ELEMENTS.FROZENBLOOD.NAME
dlcId: ""
2 changes: 1 addition & 1 deletion Blood/mod_info.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
supportedContent: ALL
supportedContent: EXPANSION1_ID
lastWorkingBuild: 455425

0 comments on commit 2ef7f2c

Please sign in to comment.