mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
attackEntity method was added
This commit is contained in:
parent
89ee29a30a
commit
45b36cb034
4 changed files with 50 additions and 40 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue