mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
simple autojump, more vanilla speed
This commit is contained in:
parent
d0a262a3da
commit
dee744e709
15 changed files with 52 additions and 35 deletions
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
class TaskAttackPlayer extends TaskBase
|
||||
{
|
||||
public $moveSpeed;
|
||||
public $speedMultiplier;
|
||||
public $rangeSquared;
|
||||
|
||||
public $attackCounter;
|
||||
|
||||
public function __construct($speed, $range){
|
||||
$this->moveSpeed = $speed;
|
||||
$this->speedMultiplier = $speed;
|
||||
$this->rangeSquared = $range*$range;
|
||||
}
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ class TaskAttackPlayer extends TaskBase
|
|||
$this->reset();
|
||||
return false;
|
||||
}
|
||||
$ai->mobController->setMovingTarget($ai->entity->target->x, $ai->entity->target->y, $ai->entity->target->z, $this->moveSpeed);
|
||||
$ai->mobController->setMovingTarget($ai->entity->target->x, $ai->entity->target->y, $ai->entity->target->z, $this->speedMultiplier);
|
||||
$ai->mobController->setLookPosition($ai->entity->target->x, $ai->entity->target->y + 0.12, $ai->entity->target->z, 10, $ai->entity->getVerticalFaceSpeed());
|
||||
|
||||
--$this->attackCounter;
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ class TaskPanic extends TaskBase
|
|||
{
|
||||
protected $randX = 2, $randZ = 2;
|
||||
|
||||
public $moveSpeed;
|
||||
public function __construct($moveSpeed){
|
||||
$this->moveSpeed = $moveSpeed;
|
||||
public $speedMultiplier;
|
||||
public function __construct($speedMultiplier){
|
||||
$this->speedMultiplier = $speedMultiplier;
|
||||
}
|
||||
|
||||
public function onStart(EntityAI $ai)
|
||||
|
|
@ -34,7 +34,7 @@ class TaskPanic extends TaskBase
|
|||
{
|
||||
--$this->selfCounter;
|
||||
if($this->selfCounter % 20 === 0) $this->regenerateRandXZ();
|
||||
$ai->mobController->setMovingOffset($this->randX, 0, $this->randZ, $this->moveSpeed);
|
||||
$ai->mobController->setMovingOffset($this->randX, 0, $this->randZ, $this->speedMultiplier);
|
||||
}
|
||||
|
||||
public function canBeExecuted(EntityAI $ai)
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
class TaskRandomWalk extends TaskBase
|
||||
{
|
||||
private $x, $z;
|
||||
public $moveSpeed;
|
||||
public function __construct($moveSpeed){
|
||||
$this->moveSpeed = $moveSpeed;
|
||||
public $speedMultiplier;
|
||||
public function __construct($speedMultiplier){
|
||||
$this->speedMultiplier = $speedMultiplier;
|
||||
}
|
||||
|
||||
public function onStart(EntityAI $ai)
|
||||
|
|
@ -31,7 +31,7 @@ class TaskRandomWalk extends TaskBase
|
|||
return false; //TODO Better way: block movement
|
||||
}
|
||||
--$this->selfCounter;
|
||||
$ai->mobController->setMovingOffset($this->x, 0, $this->z, $this->moveSpeed);
|
||||
$ai->mobController->setMovingOffset($this->x, 0, $this->z, $this->speedMultiplier);
|
||||
//TODO fix $ai->mobController->moveNonInstant($this->x, 0, $this->z);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue