attackEntity method was added

This commit is contained in:
GameHerobrine 2023-01-23 11:38:40 +03:00
parent 89ee29a30a
commit 45b36cb034
4 changed files with 50 additions and 40 deletions

View file

@ -1,11 +1,15 @@
<?php
class Monster extends Creature{
public function __construct(Level $level, $eid, $class, $type = 0, $data = []){
parent::__construct($level, $eid, $class, $type, $data);
$this->ai->addTask(new TaskAttackPlayer());
}
public function getAttackDamage(){
return 2;
}
public function __construct(Level $level, $eid, $class, $type = 0, $data = []){
parent::__construct($level, $eid, $class, $type, $data);
$this->ai->addTask(new TaskAttackPlayer());
}
public function getAttackDamage(){
return 2;
}
public function attackEntity($entity){
$entity->harm($this->getAttackDamage(), $this->eid);
}
}