big-and-small-unofficial-ad.../Source/MBS_Anomaly/HediffSizeOffset.cs
maciek f390de6ce3
initial commit
first working version
a little late since i didn't expect this to be big enough to require source control 😵‍💫
2025-02-27 19:40:35 +01:00

51 lines
2.4 KiB
C#

/*
Copyright 2025 Maciej Pawłowski
This file is part of "Maciek's Big and Small unofficial addon - Anomaly".
"Maciek's Big and Small unofficial addon - Anomaly" is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
"Maciek's Big and Small unofficial addon - Anomaly" is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with "Maciek's Big and Small unofficial addon - Anomaly". If not, see <https://www.gnu.org/licenses/>.
*/
using Verse;
namespace MBS_Anomaly;
public class HediffSizeOffset : Hediff
{
public float SizeOffset = 0f;
// public override void ExposeData()
// {
// Scribe_Values.Look(ref SizeOffset, "SizeOffset");
// }
public override void ExposeData()
{
if (Scribe.mode == LoadSaveMode.Saving && combatLogEntry != null)
{
LogEntry target = combatLogEntry.Target;
if (target == null || !Current.Game.battleLog.IsEntryActive(target))
{
combatLogEntry = null;
}
}
Scribe_Values.Look(ref SizeOffset, "SizeOffset");
Scribe_Values.Look(ref loadID, "loadID", 0);
Scribe_Values.Look(ref ageTicks, "ageTicks", 0);
Scribe_Values.Look(ref tickAdded, "tickAdded", 0);
Scribe_Values.Look(ref severityInt, "severity", 0f);
Scribe_Values.Look(ref causesNoPain, "causesNoPain", defaultValue: true);
Scribe_Values.Look(ref combatLogText, "combatLogText");
Scribe_Values.Look(ref canBeThreateningToPart, "canBeThreateningToPart", defaultValue: false);
Scribe_Defs.Look(ref def, "def");
Scribe_Defs.Look(ref sourceDef, "source");
Scribe_Defs.Look(ref sourceHediffDef, "sourceHediffDef");
Scribe_Defs.Look(ref sourceBodyPartGroup, "sourceBodyPartGroup");
Scribe_Values.Look(ref sourceLabel, "sourceLabel");
Scribe_Values.Look(ref sourceToolLabel, "sourceToolLabel");
Scribe_References.Look(ref combatLogEntry, "combatLogEntry");
BackCompatibility.PostExposeData(this);
}
}