Refactor alot of stuff
This commit is contained in:
@@ -7,6 +7,40 @@ namespace KernelPanic.Combat
|
||||
/// </summary>
|
||||
public sealed class EnemyInstance
|
||||
{
|
||||
// Explicit checkpoint values: no gameplay hooks or random draws during restoration.
|
||||
internal EnemyInstanceValues CaptureValues() => new()
|
||||
{
|
||||
TurnsAlive = TurnsAlive,
|
||||
CountdownRemaining = CountdownRemaining,
|
||||
IntentRevealed = IntentRevealed,
|
||||
HasRevived = HasRevived,
|
||||
PendingRevive = PendingRevive,
|
||||
Reaped = Reaped,
|
||||
LethalHitThisTurn = LethalHitThisTurn,
|
||||
DefeatedPendingRemoval = DefeatedPendingRemoval,
|
||||
PairId = PairId,
|
||||
RaceEnrageStacks = RaceEnrageStacks,
|
||||
TelemetryStacks = TelemetryStacks,
|
||||
SpawnedFromDeath = SpawnedFromDeath,
|
||||
DeathSpawnIntentRevealed = DeathSpawnIntentRevealed,
|
||||
};
|
||||
internal void RestoreValues(EnemyInstanceValues value)
|
||||
{
|
||||
TurnsAlive = value.TurnsAlive;
|
||||
CountdownRemaining = value.CountdownRemaining;
|
||||
IntentRevealed = value.IntentRevealed;
|
||||
HasRevived = value.HasRevived;
|
||||
PendingRevive = value.PendingRevive;
|
||||
Reaped = value.Reaped;
|
||||
LethalHitThisTurn = value.LethalHitThisTurn;
|
||||
DefeatedPendingRemoval = value.DefeatedPendingRemoval;
|
||||
PairId = value.PairId;
|
||||
RaceEnrageStacks = value.RaceEnrageStacks;
|
||||
TelemetryStacks = value.TelemetryStacks;
|
||||
SpawnedFromDeath = value.SpawnedFromDeath;
|
||||
DeathSpawnIntentRevealed = value.DeathSpawnIntentRevealed;
|
||||
}
|
||||
|
||||
private readonly List<EnemyIntent> _intentPool = new();
|
||||
|
||||
public EnemyInstance(string name, int maxUptime, IEnumerable<EnemyIntent> intentPool)
|
||||
@@ -30,6 +64,8 @@ namespace KernelPanic.Combat
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
internal EnemyInstance(EnemyArchetypeDescriptor archetype, CombatantState state, EnemyIntent intent) : this(archetype, state.MaxUptime)
|
||||
{ State = state; CurrentIntent = intent; }
|
||||
public EnemyArchetypeDescriptor Archetype { get; }
|
||||
public string ArchetypeId => Archetype.Id;
|
||||
public int CurrentUptime => State.CurrentUptime;
|
||||
|
||||
Reference in New Issue
Block a user