mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
default difficulty is now 2(normal), damage will change on easy/hard difficulty
This commit is contained in:
parent
2fb69cf607
commit
093efa0f2e
5 changed files with 21 additions and 3 deletions
|
|
@ -1315,6 +1315,21 @@ class Entity extends Position
|
|||
if (! $this->canBeAttacked) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(is_numeric($cause) && ($entity = $this->server->api->entity->get($cause)) != 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;
|
||||
}
|
||||
}
|
||||
|
||||
$dmg = $this->applyArmor($dmg, $cause);
|
||||
$ret = $this->setHealth(max(- 128, $this->getHealth() - ((int) $dmg)), $cause, $force);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class Skeleton extends Monster{
|
|||
}
|
||||
|
||||
public function getAttackDamage(){
|
||||
return 0; //TODO special attack
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function updateBurning(){
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ class Spider extends Monster{
|
|||
$this->ai->addTask(new TaskAttackPlayer(1.0, 16)); //TODO fix range?
|
||||
}
|
||||
|
||||
public function getAttackDamage(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function attackEntity($entity, $distance){
|
||||
if($distance > 2.0 && $distance < 6.0){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue