Skip to content

Commit

Permalink
Don't tick Manipulation when action doesn't increase step count
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Jun 20, 2024
1 parent 1cbcc77 commit 06e0ecf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Craftimizer/Craftimizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Authors>Asriel Camora</Authors>
<Version>2.4.3.0</Version>
<Version>2.4.2.0</Version>
<PackageProjectUrl>https://github.com/WorkingRobot/craftimizer.git</PackageProjectUrl>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand Down
22 changes: 0 additions & 22 deletions Craftimizer/Utils/PopulateConverter.cs

This file was deleted.

15 changes: 7 additions & 8 deletions Simulator/Actions/BaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,19 @@ public virtual void Use(Simulator s)
s.ReduceCP(CPCost(s));
s.ReduceDurability(DurabilityCost);

if (s.Durability > 0)
if (IncreasesStepCount)
{
if (s.HasEffect(EffectType.Manipulation))
s.RestoreDurability(5);
}
if (s.Durability > 0)
if (s.HasEffect(EffectType.Manipulation))
s.RestoreDurability(5);

if (IncreasesStepCount)
s.IncreaseStepCount();

s.ActiveEffects.DecrementDuration();
}

s.ActionStates.MutateState(this);
s.ActionCount++;

if (IncreasesStepCount)
s.ActiveEffects.DecrementDuration();
}

public virtual void UseSuccess(Simulator s)
Expand Down
5 changes: 2 additions & 3 deletions Simulator/Actions/Manipulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public override void Use(Simulator s)

s.ActionStates.MutateState(this);
s.ActionCount++;

if (IncreasesStepCount)
s.ActiveEffects.DecrementDuration();

s.ActiveEffects.DecrementDuration();
}
}

0 comments on commit 06e0ecf

Please sign in to comment.