Skip to content

Commit

Permalink
Steam sim params initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
katycat5e committed Feb 16, 2022
1 parent 0771014 commit 3436415
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions CCL_GameScripts/DamageConfigBasic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,27 @@ public void ApplyDefaults()
postWrapMode = WrapMode.ClampForever
};
}

public void ApplySH282Defaults()
{
BodyHitpoints = 17920f;
BodyCollisionResistance = 25f;
BodyCollisionMultiplier = 1f;
BodyFireResistance = 7.5f;
BodyFireMultiplier = 1f;
DamageTolerance = 0.01f;

BrakeSpeedDamageCurve =
new AnimationCurve(
new Keyframe(0, 0, 0, 0, 0.3333f, 0.3333f),
new Keyframe(2, 0, 0, 0, 0.3333f, 0.3333f),
new Keyframe(7.5f, 0.125f, 0.0285f, 0.0285f, 0.3333f, 0.3333f),
new Keyframe(29, 0.6706f, 0.0151f, 0.0151f, 0.3333f, 0.3333f),
new Keyframe(100, 1, 0, 0, 0.3333f, 0.3333f))
{
preWrapMode = WrapMode.ClampForever,
postWrapMode = WrapMode.ClampForever
};
}
}
}
4 changes: 2 additions & 2 deletions CCL_GameScripts/Editor/AddLocoParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ private void ApplyTemplate()
{
simParams = obj.AddComponent<SimParamsSteam>();
}
simParams.ApplySH282Defaults();

DamageConfigBasic dmgConfig = obj.GetComponent<DamageConfigBasic>();
if (!dmgConfig)
{
dmgConfig = obj.AddComponent<DamageConfigBasic>();
}


dmgConfig.ApplySH282Defaults();
}
}

Expand Down

0 comments on commit 3436415

Please sign in to comment.