Všechna monstra, dynamický targeting. Bugfixy u monster.

This commit is contained in:
Perry 2026-03-17 20:14:29 +01:00
parent 55fd052072
commit 4fdff0a0cc
18 changed files with 345 additions and 43 deletions

View file

@ -5,11 +5,15 @@ namespace FNAF_Server.Enemies;
public class MovementOpportunity {
public int Interval{ get; set; }
// public double ChanceDenominator;
public double MovementChance{ get; set; }
public double MovementChance{
get;
set{
field = value;
GuaranteeSuccess(value >= 1);
}
}
public bool Running => stopwatch.IsRunning;
public bool ConstantChance{ get; private set; }
private Stopwatch stopwatch = new();
private long stopwatchOffset = 0;
@ -19,13 +23,10 @@ public class MovementOpportunity {
public MovementOpportunity(int intervalMs, double movementChance) {
Interval = intervalMs;
MovementChance = movementChance;
GuaranteeSuccess(false);
ConstantChance = true; // unused
}
public MovementOpportunity(int intervalMs) {
Interval = intervalMs;
GuaranteeSuccess(true);
MovementChance = 1;
}