small changes to armor system + maxstacksize of armor is fixed

This commit is contained in:
GameHerobrine 2022-09-05 21:19:35 +03:00
parent f2da48c7e3
commit 81d46e71aa
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,9 @@
<?php
/*value - durability*/
class Material{
const LEATHER = 5; //when enums
const CHAIN = 15;
const GOLD = 7;
const IRON = 15;
const DIAMOND = 33;
}

View file

@ -0,0 +1,16 @@
<?php
abstract class ArmorItem extends Item{ //abstract to avoid making instances of it
public function isArmor(){
return true;
}
public abstract function getMaterialDurability();
public abstract function getBaseDurability();
public function getMaxDurability(){
return $this->getMaterialDurability() * $this->getBaseDurability();
}
}