diff --git a/hwe/func.php b/hwe/func.php
index 6b7d3e32..8f23e5f0 100644
--- a/hwe/func.php
+++ b/hwe/func.php
@@ -592,11 +592,11 @@ function generalInfo(General $generalObj) {
}
$call = getCall(...$generalObj->getVars('leadership', 'strength', 'intel'));
- $typename = $generalObj->getCrewTypeObj()->name;
- $weaponname = $generalObj->getItem('weapon')->getName();
- $bookname = $generalObj->getItem('book')->getName();
- $horsename = $generalObj->getItem('horse')->getName();
- $itemname = $generalObj->getItem('item')->getName();
+ $crewTypeInfo = displayiActionObjInfo($generalObj->getCrewTypeObj());
+ $weaponInfo = displayiActionObjInfo($generalObj->getItem('weapon'));
+ $bookInfo = displayiActionObjInfo($generalObj->getItem('book'));
+ $horseInfo = displayiActionObjInfo($generalObj->getItem('horse'));
+ $itemInfo = displayiActionObjInfo($generalObj->getItem('item'));
$leadership = $generalObj->getLeadership(true, false, false);
$strength = $generalObj->getStrength(true, false, false);
@@ -681,11 +681,11 @@ function generalInfo(General $generalObj) {
| 명마 |
- $horsename |
+ $horseInfo |
무기 |
- $weaponname |
+ $weaponInfo |
서적 |
- $bookname |
+ $bookInfo |
|
@@ -694,11 +694,11 @@ function generalInfo(General $generalObj) {
군량 |
{$generalObj->getVar('rice')} |
도구 |
- $itemname |
+ $itemInfo |
| 병종 |
- $typename |
+ {$crewTypeInfo} |
병사 |
{$generalObj->getVar('crew')} |
성격 |
diff --git a/hwe/sammo/ActionItem/che_계략_삼략.php b/hwe/sammo/ActionItem/che_계략_삼략.php
index 229cd9cf..d940f696 100644
--- a/hwe/sammo/ActionItem/che_계략_삼략.php
+++ b/hwe/sammo/ActionItem/che_계략_삼략.php
@@ -19,7 +19,7 @@ class che_계략_삼략 extends \sammo\BaseItem{
return $value;
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_계략_육도.php b/hwe/sammo/ActionItem/che_계략_육도.php
index dfc9570a..a4cc6c60 100644
--- a/hwe/sammo/ActionItem/che_계략_육도.php
+++ b/hwe/sammo/ActionItem/che_계략_육도.php
@@ -19,7 +19,7 @@ class che_계략_육도 extends \sammo\BaseItem{
return $value;
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_계략_이추.php b/hwe/sammo/ActionItem/che_계략_이추.php
index 25da597b..b1f1b75e 100644
--- a/hwe/sammo/ActionItem/che_계략_이추.php
+++ b/hwe/sammo/ActionItem/che_계략_이추.php
@@ -21,7 +21,7 @@ class che_계략_이추 extends \sammo\BaseItem{
return $value;
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_계략_향낭.php b/hwe/sammo/ActionItem/che_계략_향낭.php
index ac1d470d..75d08cb6 100644
--- a/hwe/sammo/ActionItem/che_계략_향낭.php
+++ b/hwe/sammo/ActionItem/che_계략_향낭.php
@@ -21,7 +21,7 @@ class che_계략_향낭 extends \sammo\BaseItem{
return $value;
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_치료_도소연명.php b/hwe/sammo/ActionItem/che_치료_도소연명.php
index 6a4c2e02..8f3fd1e2 100644
--- a/hwe/sammo/ActionItem/che_치료_도소연명.php
+++ b/hwe/sammo/ActionItem/che_치료_도소연명.php
@@ -19,7 +19,7 @@ class che_치료_도소연명 extends \sammo\BaseItem{
);
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_치료_무후행군.php b/hwe/sammo/ActionItem/che_치료_무후행군.php
index ed2c4553..3b2fa3ed 100644
--- a/hwe/sammo/ActionItem/che_치료_무후행군.php
+++ b/hwe/sammo/ActionItem/che_치료_무후행군.php
@@ -19,7 +19,7 @@ class che_치료_무후행군 extends \sammo\BaseItem{
);
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_치료_오석산.php b/hwe/sammo/ActionItem/che_치료_오석산.php
index e02e8b4a..5a704316 100644
--- a/hwe/sammo/ActionItem/che_치료_오석산.php
+++ b/hwe/sammo/ActionItem/che_치료_오석산.php
@@ -19,7 +19,7 @@ class che_치료_오석산 extends \sammo\BaseItem{
);
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_치료_정력견혈.php b/hwe/sammo/ActionItem/che_치료_정력견혈.php
index e0ccee9d..a6532840 100644
--- a/hwe/sammo/ActionItem/che_치료_정력견혈.php
+++ b/hwe/sammo/ActionItem/che_치료_정력견혈.php
@@ -19,7 +19,7 @@ class che_치료_정력견혈 extends \sammo\BaseItem{
);
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_치료_칠엽청점.php b/hwe/sammo/ActionItem/che_치료_칠엽청점.php
index 561a47b8..df5f9e9a 100644
--- a/hwe/sammo/ActionItem/che_치료_칠엽청점.php
+++ b/hwe/sammo/ActionItem/che_치료_칠엽청점.php
@@ -19,7 +19,7 @@ class che_치료_칠엽청점 extends \sammo\BaseItem{
);
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
diff --git a/hwe/sammo/ActionItem/che_치료_환약.php b/hwe/sammo/ActionItem/che_치료_환약.php
index ffd09682..1415666a 100644
--- a/hwe/sammo/ActionItem/che_치료_환약.php
+++ b/hwe/sammo/ActionItem/che_치료_환약.php
@@ -21,7 +21,7 @@ class che_치료_환약 extends \sammo\BaseItem{
);
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
diff --git a/hwe/sammo/BaseItem.php b/hwe/sammo/BaseItem.php
index 6636a1bf..95e120b3 100644
--- a/hwe/sammo/BaseItem.php
+++ b/hwe/sammo/BaseItem.php
@@ -34,7 +34,7 @@ class BaseItem implements iAction{
return $this->reqSecu;
}
- function isValidTurnItem(string $actionType, string $command):bool{
+ function isConsumableNow(string $actionType, string $command):bool{
return false;
}
}
\ No newline at end of file
diff --git a/hwe/sammo/BaseStatItem.php b/hwe/sammo/BaseStatItem.php
index 1c1437f2..f808ecae 100644
--- a/hwe/sammo/BaseStatItem.php
+++ b/hwe/sammo/BaseStatItem.php
@@ -21,10 +21,11 @@ class BaseStatItem extends BaseItem{
public function __construct(){
$nameTokens = explode('_', static::class);
- $this->statValue = (int)$nameTokens[-1];
+ $tokenLen = count($nameTokens);
+ $this->statValue = (int)$nameTokens[$tokenLen-2];
assert(is_numeric($this->statValue));
- $this->rawName = $nameTokens[-2];
- [$this->statNick, $this->statType] = static::ITEM_TYPE[$nameTokens[-3]];
+ $this->rawName = $nameTokens[$tokenLen-1];
+ [$this->statNick, $this->statType] = static::ITEM_TYPE[$nameTokens[$tokenLen-3]];
$this->id = $this->statValue;
$this->name = sprintf('%s(+%d)',$this->rawName, $this->statValue);
diff --git a/hwe/sammo/Command/General/che_화계.php b/hwe/sammo/Command/General/che_화계.php
index 853580ed..95bafbc2 100644
--- a/hwe/sammo/Command/General/che_화계.php
+++ b/hwe/sammo/Command/General/che_화계.php
@@ -285,7 +285,7 @@ class che_화계 extends Command\GeneralCommand{
$this->affectDestCity($injuryCount);
$itemObj = $general->getItem();
- if($itemObj->isValidTurnItem('GeneralCommand', '계략') && $itemObj::$consumable){
+ if($itemObj->isConsumableNow('GeneralCommand', '계략') && $itemObj::$consumable){
$itemName = $itemObj->name;
$josaUl = JosaUtil::pick($itemName, '을');
$logger->pushGeneralActionLog("{$itemName}>{$josaUl} 사용!", ActionLogger::PLAIN);
diff --git a/hwe/sammo/Command/Nation/che_포상.php b/hwe/sammo/Command/Nation/che_포상.php
index 1f79b87c..b7c0734c 100644
--- a/hwe/sammo/Command/Nation/che_포상.php
+++ b/hwe/sammo/Command/Nation/che_포상.php
@@ -68,7 +68,7 @@ class che_포상 extends Command\NationCommand{
$this->setCity();
$this->setNation(['gold', 'rice']);
- $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'nation'], 1);
+ $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], 1);
$this->setDestGeneral($destGeneral);
$this->runnableConstraints=[
diff --git a/hwe/sammo/DefaultAction.php b/hwe/sammo/DefaultAction.php
index b3b3c5f9..6fbde710 100644
--- a/hwe/sammo/DefaultAction.php
+++ b/hwe/sammo/DefaultAction.php
@@ -8,6 +8,9 @@ trait DefaultAction{
}
public function getInfo():string{
+ if($this->info === null){
+ return '';
+ }
return $this->info;
}
diff --git a/hwe/sammo/GameUnitDetail.php b/hwe/sammo/GameUnitDetail.php
index 2661d18d..27242763 100644
--- a/hwe/sammo/GameUnitDetail.php
+++ b/hwe/sammo/GameUnitDetail.php
@@ -67,6 +67,10 @@ class GameUnitDetail implements iAction{
}
+ public function getInfo():string{
+ return join("\n
", $this->info);
+ }
+
public function getShortName():string{
return StringUtil::subStringForWidth($this->name, 0, 4);
}
diff --git a/hwe/sammo/GeneralTrigger/che_아이템치료.php b/hwe/sammo/GeneralTrigger/che_아이템치료.php
index 6287ffab..0c9e3c62 100644
--- a/hwe/sammo/GeneralTrigger/che_아이템치료.php
+++ b/hwe/sammo/GeneralTrigger/che_아이템치료.php
@@ -23,7 +23,7 @@ class che_아이템치료 extends BaseGeneralTrigger{
$josaUl = JosaUtil::pick($itemName, '을');
$logger->pushGeneralActionLog("{$itemName}>{$josaUl} 사용하여 치료합니다!", ActionLogger::PLAIN);
- if($itemObj::$consumable && $itemObj->isValidTurnItem('GeneralTrigger', 'che_아이템치료')){
+ if($itemObj::$consumable && $itemObj->isConsumableNow('GeneralTrigger', 'che_아이템치료')){
$general->deleteItem();
}
}