game: 경과 시간에 따라 변하는 유니크 추가
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace sammo\ActionItem;
|
||||
|
||||
use sammo\DB;
|
||||
use sammo\GameConst;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use sammo\KVStorage;
|
||||
use sammo\Util;
|
||||
|
||||
class che_능력치_통솔_두강주 extends \sammo\BaseItem{
|
||||
|
||||
protected $rawName = '두강주';
|
||||
protected $name = '두강주(무력)';
|
||||
protected $info = '[능력치] 무력 보정 +5 + (5년마다 +1)';
|
||||
protected $cost = 200;
|
||||
protected $consumable = false;
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
if($statName === 'strength'){
|
||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
||||
$relYear = $year - $startYear;
|
||||
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace sammo\ActionItem;
|
||||
|
||||
use sammo\DB;
|
||||
use sammo\GameConst;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use sammo\KVStorage;
|
||||
use sammo\Util;
|
||||
|
||||
class che_능력치_통솔_과실주 extends \sammo\BaseItem{
|
||||
|
||||
protected $rawName = '과실주';
|
||||
protected $name = '과실주(무력)';
|
||||
protected $info = '[능력치] 지력 보정 +5 + (5년마다 +1)';
|
||||
protected $cost = 200;
|
||||
protected $consumable = false;
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
if($statName === 'intel'){
|
||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
||||
$relYear = $year - $startYear;
|
||||
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace sammo\ActionItem;
|
||||
|
||||
use sammo\DB;
|
||||
use sammo\GameConst;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use sammo\KVStorage;
|
||||
use sammo\Util;
|
||||
|
||||
class che_능력치_통솔_보령압주 extends \sammo\BaseItem{
|
||||
|
||||
protected $rawName = '보령압주';
|
||||
protected $name = '보령압주(통솔)';
|
||||
protected $info = '[능력치] 통솔 보정 +5 + (5년마다 +1)';
|
||||
protected $cost = 200;
|
||||
protected $consumable = false;
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
if($statName === 'leadership'){
|
||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
||||
$relYear = $year - $startYear;
|
||||
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -17,4 +17,6 @@ class che_사기_두강주 extends \sammo\BaseItem{
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//NOTE: 구버전
|
||||
@@ -17,4 +17,6 @@ class che_사기_보령압주 extends \sammo\BaseItem{
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//NOTE: 구버전
|
||||
@@ -17,4 +17,6 @@ class che_훈련_이강주 extends \sammo\BaseItem{
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//NOTE: 구버전
|
||||
Reference in New Issue
Block a user