아이템에 consumable 개념 추가, GameConstBase에 아이템 준비

This commit is contained in:
2019-05-13 03:17:48 +09:00
parent 8c163515db
commit ac0f6c6b6c
8 changed files with 51 additions and 0 deletions
@@ -10,6 +10,7 @@ class che_계략_이추 extends \sammo\BaseItem{
protected static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p';
protected static $cost = 1000;
protected static $consumable = true;
protected static $buyable = true;
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
if($turnType == '계략'){
@@ -10,6 +10,7 @@ class che_계략_향낭 extends \sammo\BaseItem{
protected static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
protected static $cost = 3000;
protected static $consumable = true;
protected static $buyable = true;
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
if($turnType == '계략'){
@@ -11,6 +11,7 @@ class che_사기_탁주 extends \sammo\BaseItem{
protected static $info = '[전투] 사기 +3. 1회용';
protected static $cost = 1000;
protected static $consumable = true;
protected static $buyable = true;
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller([
@@ -15,6 +15,7 @@ class che_저격_수극 extends \sammo\BaseItem{
protected static $info = '[전투] 전투 개시 전 20% 확률로 저격 시도. 1회용';
protected static $cost = 1000;
protected static $consumable = true;
protected static $buyable = true;
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller([
@@ -12,6 +12,7 @@ class che_치료_환약 extends \sammo\BaseItem{
protected static $info = '[군사] 턴 실행 전 부상 회복. 1회용';
protected static $cost = 100;
protected static $consumable = true;
protected static $buyable = true;
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
return new GeneralTriggerCaller([
@@ -10,6 +10,7 @@ class che_훈련_청주 extends \sammo\BaseItem{
protected static $info = '[전투] 훈련 +3. 1회용';
protected static $cost = 1000;
protected static $consumable = true;
protected static $buyable = true;
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller([
+5
View File
@@ -12,6 +12,7 @@ class BaseItem implements iAction{
protected static $info = '';
protected static $cost = null;
protected static $consumable = false;
protected static $buyable = false;
function getID(){
return $this->id;
@@ -29,6 +30,10 @@ class BaseItem implements iAction{
return $this->consumable;
}
function isBuyable(){
return $this->buyable;
}
function isValidTurnItem(string $actionType, string $command):bool{
return false;
}
+40
View File
@@ -148,6 +148,46 @@ class GameConstBase
'che_패권', 'che_의협', 'che_대의', 'che_왕좌', 'che_은둔', 'None'
];
public static $allItems = [
'horse' => [
'che_명마_노기', 'che_명마_조랑', 'che_명마_노새', 'che_명마_나귀', 'che_명마_갈색마', 'che_명마_흑색마',
'che_명마_백마a', 'che_명마_백마b', 'che_명마_기주마a', 'che_명마_기주마b',
'che_명마_양주마a', 'che_명마_양주마b', 'che_명마_과하마a', 'che_명마_과하마b',
'che_명마_대완마a', 'che_명마_대완마b', 'che_명마_서량마a', 'che_명마_서량마b',
'che_명마_사륜거a', 'che_명마_사륜거b', 'che_명마_절영', 'che_명마_적로',
'che_명마_적란마', 'che_명마_조황비전', 'che_명마_한혈마', 'che_명마_적토마',
],
'weapon' => [
'che_무기_단도', 'che_무기_단궁', 'che_무기_단극', 'che_무기_목검', 'che_무기_죽창', 'che_무기_소부',
'che_무기_동추', 'che_무기_철편', 'che_무기_철쇄', 'che_무기_맥궁',
'che_무기_유성추', 'che_무기_철질여골', 'che_무기_쌍철극', 'che_무기_동호비궁',
'che_무기_삼첨도', 'che_무기_대부', 'che_무기_고정도', 'che_무기_이광궁',
'che_무기_철척사모', 'che_무기_칠성검', 'che_무기_사모', 'che_무기_양유기궁',
'che_무기_언월도', 'che_무기_방천화극', 'che_무기_청홍검', 'che_무기_의천검'
],
'book' => [
'che_서적_효경전', 'che_서적_회남자', 'che_서적_변도론', 'che_서적_건상역주', 'che_서적_여씨춘추', 'che_서적_사민월령',
'che_서적_위료자', 'che_서적_사마법', 'che_서적_한서', 'che_서적_논어',
'che_서적_전론', 'che_서적_사기', 'che_서적_장자', 'che_서적_역경',
'che_서적_시경', 'che_서적_구국론', 'che_서적_상군서', 'che_서적_춘추전',
'che_서적_산해경', 'che_서적_맹덕신서', 'che_서적_관자', 'che_서적_병법24편',
'che_서적_한비자', 'che_서적_오자병법', 'che_서적_노자', 'che_서적_손자병법',
],
'item' => [
'che_치료_환약', 'che_저격_수극', 'che_사기_탁주', 'che_훈련_청주', 'che_계략_이추', 'che_계략_향낭',
'che_치료_오석산', 'che_치료_무후행군', 'che_치료_도소연명', 'che_치료_칠엽청점', 'che_치료_정력견혈',
'che_훈련_과실주', 'che_훈련_이강주', 'che_사기_의적주', 'che_사기_두강주', 'che_사기_보령압주',
'che_훈련_철벽서', 'che_훈련_단결도', 'che_사기_춘화첩', 'che_사기_초선화',
'che_계략_육도', 'che_계략_삼략',
'che_의술_청낭서', 'che_의술_태평청령',
'che_회피_태평요술', 'che_회피_둔갑천서',
]
];
/** @var array[string] 선택 가능한 커맨드 */
public static $availableGeneralCommand = [
''=>[