Don't tick Manipulation when action doesn't increase step count
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors>Asriel Camora</Authors>
|
<Authors>Asriel Camora</Authors>
|
||||||
<Version>2.4.3.0</Version>
|
<Version>2.4.2.0</Version>
|
||||||
<PackageProjectUrl>https://github.com/WorkingRobot/craftimizer.git</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/WorkingRobot/craftimizer.git</PackageProjectUrl>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Craftimizer.Utils;
|
|
||||||
|
|
||||||
public class PopulateConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override bool CanConvert(Type objectType) =>
|
|
||||||
objectType.GetConstructor(Type.EmptyTypes) != null;
|
|
||||||
|
|
||||||
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
existingValue ??= Activator.CreateInstance(objectType) ?? throw new ArgumentException($"Could not create object of type {objectType}", nameof(objectType));
|
|
||||||
serializer.Populate(reader, existingValue);
|
|
||||||
return existingValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
serializer.Serialize(writer, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -69,20 +69,19 @@ public abstract class BaseAction(
|
|||||||
s.ReduceCP(CPCost(s));
|
s.ReduceCP(CPCost(s));
|
||||||
s.ReduceDurability(DurabilityCost);
|
s.ReduceDurability(DurabilityCost);
|
||||||
|
|
||||||
if (s.Durability > 0)
|
|
||||||
{
|
|
||||||
if (s.HasEffect(EffectType.Manipulation))
|
|
||||||
s.RestoreDurability(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IncreasesStepCount)
|
if (IncreasesStepCount)
|
||||||
|
{
|
||||||
|
if (s.Durability > 0)
|
||||||
|
if (s.HasEffect(EffectType.Manipulation))
|
||||||
|
s.RestoreDurability(5);
|
||||||
|
|
||||||
s.IncreaseStepCount();
|
s.IncreaseStepCount();
|
||||||
|
|
||||||
|
s.ActiveEffects.DecrementDuration();
|
||||||
|
}
|
||||||
|
|
||||||
s.ActionStates.MutateState(this);
|
s.ActionStates.MutateState(this);
|
||||||
s.ActionCount++;
|
s.ActionCount++;
|
||||||
|
|
||||||
if (IncreasesStepCount)
|
|
||||||
s.ActiveEffects.DecrementDuration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UseSuccess(Simulator s)
|
public virtual void UseSuccess(Simulator s)
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ internal sealed class Manipulation() : BaseBuffAction(
|
|||||||
|
|
||||||
s.ActionStates.MutateState(this);
|
s.ActionStates.MutateState(this);
|
||||||
s.ActionCount++;
|
s.ActionCount++;
|
||||||
|
|
||||||
if (IncreasesStepCount)
|
s.ActiveEffects.DecrementDuration();
|
||||||
s.ActiveEffects.DecrementDuration();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user