new ai task, fixes of old ones, php8 fixes

This commit is contained in:
GameHerobrine 2022-12-24 22:42:23 +03:00
parent a907a7cf5e
commit 80bdddb817
13 changed files with 1581 additions and 1458 deletions

View file

@ -6,7 +6,7 @@ class TaskLookAround extends TaskBase
public function onStart(EntityAI $ai)
{
$this->selfCounter = 1;
$this->rotation = mt_rand(-90, 90);
$this->rotation = mt_rand(-120, 120);
}
public function onEnd(EntityAI $ai)
@ -16,7 +16,7 @@ class TaskLookAround extends TaskBase
public function canBeExecuted(EntityAI $ai)
{
return !$ai->entity->isMoving() && Utils::randomFloat() < 0.04;
return !$ai->entity->isMoving() && Utils::randomFloat() < 0.02 && !$ai->isStarted("TaskLookAtPlayer") && !$ai->isStarted("TaskTempt"); /*Vanilla value*/
}
public function onUpdate(EntityAI $ai)