mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
mobs will attack now, fixed division by 0(i hate php)
This commit is contained in:
parent
616c933d3d
commit
b8589c9dd4
13 changed files with 71 additions and 5 deletions
|
|
@ -14,6 +14,9 @@ class Creeper extends Monster{
|
|||
$this->timeUntilExplode = $this->isIgnited() ? self::EXPL_TIME : 0;
|
||||
}
|
||||
|
||||
public function getAttackDamage(){
|
||||
return 0; //TODO special attack
|
||||
}
|
||||
|
||||
public function setIgnited($v = null){
|
||||
$this->setState($v === null ? !$this->getState() : $v);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ class PigZombie extends Monster{
|
|||
$this->setSpeed(0.25);
|
||||
$this->update();
|
||||
}
|
||||
|
||||
public function getAttackDamage(){
|
||||
return 5;
|
||||
}
|
||||
public function getDrops(){
|
||||
return [
|
||||
[COOKED_PORKCHOP, 0, mt_rand(0,2)],
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ class Skeleton extends Monster{
|
|||
$this->update();
|
||||
}
|
||||
|
||||
public function getAttackDamage(){
|
||||
return 0; //TODO special attack
|
||||
}
|
||||
|
||||
public function updateBurning(){
|
||||
if($this->fire > 0 or !$this->level->isDay()){
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ class Zombie extends Monster{
|
|||
}
|
||||
}
|
||||
|
||||
public function getAttackDamage(){
|
||||
return 4; //TODO vanillafy(zombies might be able to hold items)
|
||||
}
|
||||
|
||||
public function update(){
|
||||
$this->updateBurning();
|
||||
parent::update();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue