명마 등록

This commit is contained in:
2019-05-15 02:29:21 +09:00
parent ac0f6c6b6c
commit efe8a476da
21 changed files with 293 additions and 25 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace sammo;
use \sammo\iAction;
use \sammo\General;
class BaseStatItem extends BaseItem{
protected static $statType = 'leader';
protected static $statValue = 0;
protected static $cost = 1000;
protected static $rawName = '';
protected static $consumable = false;
protected const STAT_NICK = [
'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 onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === $this->statType){
return $value + $this->statValue;
}
return $value;
}
}