Všechna monstra, dynamický targeting. Bugfixy u monster.
This commit is contained in:
parent
55fd052072
commit
4fdff0a0cc
18 changed files with 345 additions and 43 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue