fixed difficulty affecting player damage & armor for creatures

This commit is contained in:
GameHerobrine 2024-05-29 03:57:31 +03:00
parent 3a15dacf51
commit fc0f3f6bde
2 changed files with 14 additions and 13 deletions

View file

@ -44,10 +44,10 @@ abstract class Creature extends Living{
}
public function getSpeedModifer(){
return 0.7; //$this->speedModifer; //should be 0.7?
return 0.7;
}
public function getArmorValue(){
return 2;
return 0;
}
public function spawn($player){
if(!($player instanceof Player)){

View file

@ -1328,19 +1328,20 @@ class Entity extends Position
if (!$this->canBeAttacked) {
return false;
}
if(is_numeric($cause) && ($entity = $this->server->api->entity->get($cause)) != false){
if($this->attackTimeout > 0) return false;
switch($this->server->difficulty){
//case 0: looks like mobs also have 0 attack dmg in peaceful mode
// $dmg = 0;
// break;
case 1:
$dmg = (int)($dmg / 3) + 1;
break;
case 3:
$dmg = 3 * (int)($dmg / 2);
break;
if(!$entity->isPlayer()){
switch($this->server->difficulty){
//case 0: looks like mobs also have 0 attack dmg in peaceful mode
// $dmg = 0;
// break;
case 1:
$dmg = (int)($dmg / 3) + 1;
break;
case 3:
$dmg = 3 * (int)($dmg / 2);
break;
}
}
}