forked from devsam/core
아이템 관련 버그 수정
This commit is contained in:
+10
-10
@@ -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) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align:center;' class='bg1'><b>명마</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$horsename</font></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$horseInfo</font></td>
|
||||
<td style='text-align:center;' class='bg1'><b>무기</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$weaponname</font></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$weaponInfo</font></td>
|
||||
<td style='text-align:center;' class='bg1'><b>서적</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$bookname</font></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$bookInfo</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height=64 rowspan=3 style='text-align:center;background:no-repeat center url(\"{$weapImage}\");background-size:64px;'></td>
|
||||
@@ -694,11 +694,11 @@ function generalInfo(General $generalObj) {
|
||||
<td style='text-align:center;' class='bg1'><b>군량</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$generalObj->getVar('rice')}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>도구</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$itemname</font></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$itemInfo</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align:center;' class='bg1'><b>병종</b></td>
|
||||
<td style='text-align:center;' colspan=2>$typename</td>
|
||||
<td style='text-align:center;' colspan=2>{$crewTypeInfo}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>병사</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$generalObj->getVar('crew')}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>성격</b></td>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||
|
||||
@@ -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=[
|
||||
|
||||
@@ -8,6 +8,9 @@ trait DefaultAction{
|
||||
}
|
||||
|
||||
public function getInfo():string{
|
||||
if($this->info === null){
|
||||
return '';
|
||||
}
|
||||
return $this->info;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,10 @@ class GameUnitDetail implements iAction{
|
||||
|
||||
}
|
||||
|
||||
public function getInfo():string{
|
||||
return join("\n<br>", $this->info);
|
||||
}
|
||||
|
||||
public function getShortName():string{
|
||||
return StringUtil::subStringForWidth($this->name, 0, 4);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class che_아이템치료 extends BaseGeneralTrigger{
|
||||
$josaUl = JosaUtil::pick($itemName, '을');
|
||||
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용하여 치료합니다!", ActionLogger::PLAIN);
|
||||
|
||||
if($itemObj::$consumable && $itemObj->isValidTurnItem('GeneralTrigger', 'che_아이템치료')){
|
||||
if($itemObj::$consumable && $itemObj->isConsumableNow('GeneralTrigger', 'che_아이템치료')){
|
||||
$general->deleteItem();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user