mark feature
This commit is contained in:
parent
d731d65bb7
commit
1369d15c39
|
@ -37,6 +37,7 @@
|
||||||
"world_state": "Spear",
|
"world_state": "Spear",
|
||||||
|
|
||||||
"jillo/bounce": 0.6,
|
"jillo/bounce": 0.6,
|
||||||
"jillo/immune_to_dart_maggots": true
|
"jillo/immune_to_dart_maggots": true,
|
||||||
|
"jillo/has_mark": true
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,6 +18,7 @@ class Plugin : BaseUnityPlugin {
|
||||||
|
|
||||||
BounceFeature.AddHooks();
|
BounceFeature.AddHooks();
|
||||||
ImmuneToDartMaggotsFeature.AddHooks();
|
ImmuneToDartMaggotsFeature.AddHooks();
|
||||||
|
MarkFeature.AddHooks();
|
||||||
} catch (Exception err) {
|
} catch (Exception err) {
|
||||||
Logger.LogError($"error initializing: {err}");
|
Logger.LogError($"error initializing: {err}");
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
using SlugBase.Features;
|
||||||
|
using static SlugBase.Features.FeatureTypes;
|
||||||
|
using SlugBase;
|
||||||
|
|
||||||
|
namespace JilloSlug;
|
||||||
|
|
||||||
|
internal static class MarkFeature {
|
||||||
|
public static readonly PlayerFeature<bool> Mark = PlayerBool("jillo/has_mark");
|
||||||
|
|
||||||
|
public static void AddHooks() {
|
||||||
|
On.SaveState.ctor += SaveState_ctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SaveState_ctor(On.SaveState.orig_ctor orig, SaveState self, SlugcatStats.Name slugcat, PlayerProgression progression) {
|
||||||
|
orig(self, slugcat, progression);
|
||||||
|
|
||||||
|
if (SlugBaseCharacter.TryGet(slugcat, out var chara) && Mark.TryGet(chara, out bool hasMark) && hasMark) {
|
||||||
|
self.deathPersistentSaveData.theMark = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue