명마, 무기 타입 변경

This commit is contained in:
2019-05-15 03:00:00 +09:00
parent 7dd519565b
commit 21d21f4261
66 changed files with 442 additions and 261 deletions
+18 -14
View File
@@ -5,25 +5,29 @@ use \sammo\General;
class BaseStatItem extends BaseItem{
protected static $statNick = '통솔';
protected static $statType = 'leader';
protected static $statValue = 0;
protected static $statValue = 1;
protected static $cost = 1000;
protected static $rawName = '';
protected static $rawName = '노기';
protected static $consumable = false;
protected const STAT_NICK = [
'leader'=>'통솔',
'power'=>'무력',
'intel'=>'지력'
protected static $buyable = true;
protected const ITEM_TYPE = [
'명마'=>['통솔', 'leader'],
'무기'=>['무력', 'power'],
'서적'=>['지력', 'intel']
];
function getID(){
return $this->statValue;
}
function getName(){
return sprintf('%s(+%d)',$this->rawName, $this->statValue);
}
function getInfo(){
return sprintf('%s +%d', static::STAT_NICK[$this->statType], $this->statValue);
public function __construct(){
$nameTokens = explode('_', static::class);
$this->statValue = (int)$nameTokens[-1];
$this->rawName = $nameTokens[-2];
[$this->statNick, $this->statType] = static::ITEM_TYPE[$nameTokens[-3]];
$this->id = $this->statValue;
$this->name = sprintf('%s(+%d)',$this->rawName, $this->statValue);
$this->info = sprintf('%s +%d', $this->statNick, $this->statValue);
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){