phan 1차
This commit is contained in:
+3
-2
@@ -15,13 +15,14 @@ return [
|
|||||||
// Note that the **only** effect of choosing `'5.6'` is to infer
|
// Note that the **only** effect of choosing `'5.6'` is to infer
|
||||||
// that functions removed in php 7.0 exist.
|
// that functions removed in php 7.0 exist.
|
||||||
// (See `backward_compatibility_checks` for additional options)
|
// (See `backward_compatibility_checks` for additional options)
|
||||||
"target_php_version" => '7.4',
|
"target_php_version" => '8.0',
|
||||||
'backward_compatibility_checks ' => false,
|
'backward_compatibility_checks ' => false,
|
||||||
'ignore_undeclared_variables_in_global_scope' => false,
|
'ignore_undeclared_variables_in_global_scope' => false,
|
||||||
'minimum_severity'=>\Phan\Issue::SEVERITY_LOW,
|
'minimum_severity'=>\Phan\Issue::SEVERITY_CRITICAL,
|
||||||
|
|
||||||
'file_list' => [
|
'file_list' => [
|
||||||
'f_config/config.php',
|
'f_config/config.php',
|
||||||
|
'hwe/MYDB.php',
|
||||||
'hwe/a_bestGeneral.php',
|
'hwe/a_bestGeneral.php',
|
||||||
'hwe/a_emperior.php',
|
'hwe/a_emperior.php',
|
||||||
'hwe/a_emperior2.php',
|
'hwe/a_emperior2.php',
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ case "분지연":
|
|||||||
$locked = true;
|
$locked = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sleep(0.5);
|
usleep(500000);
|
||||||
}
|
}
|
||||||
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
|
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
|
||||||
$turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
|
$turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ switch($btn) {
|
|||||||
$turntime = getRandTurn($turnterm);
|
$turntime = getRandTurn($turnterm);
|
||||||
$cutTurn = cutTurn($turntime, $turnterm);
|
$cutTurn = cutTurn($turntime, $turnterm);
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'turntime'=>$curTurn
|
'turntime'=>$cutTurn
|
||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
|
use sammo\Command\BaseCommand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Value Converter
|
* Value Converter
|
||||||
*
|
*
|
||||||
@@ -156,7 +158,7 @@ function getNationTypeClass(?string $type){
|
|||||||
throw new \InvalidArgumentException("{$type}은 올바른 국가 타입 클래스가 아님");
|
throw new \InvalidArgumentException("{$type}은 올바른 국가 타입 클래스가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildNationTypeClass(?string $type):iAction{
|
function buildNationTypeClass(?string $type):BaseNation{
|
||||||
static $cache = [];
|
static $cache = [];
|
||||||
if($type === null){
|
if($type === null){
|
||||||
$type = 'None';
|
$type = 'None';
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
namespace sammo\ActionNationType;
|
namespace sammo\ActionNationType;
|
||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
|
|
||||||
class None implements iAction{
|
class None extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '-';
|
protected $name = '-';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_덕가 implements iAction{
|
class che_덕가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '덕가';
|
protected $name = '덕가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_도가 implements iAction{
|
class che_도가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '도가';
|
protected $name = '도가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_도적 implements iAction{
|
class che_도적 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '도적';
|
protected $name = '도적';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_명가 implements iAction{
|
class che_명가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '명가';
|
protected $name = '명가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_묵가 implements iAction{
|
class che_묵가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '묵가';
|
protected $name = '묵가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_법가 implements iAction{
|
class che_법가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '법가';
|
protected $name = '법가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_병가 implements iAction{
|
class che_병가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '병가';
|
protected $name = '병가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_불가 implements iAction{
|
class che_불가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '불가';
|
protected $name = '불가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_오두미도 implements iAction{
|
class che_오두미도 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '오두미도';
|
protected $name = '오두미도';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_유가 implements iAction{
|
class che_유가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '유가';
|
protected $name = '유가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_음양가 implements iAction{
|
class che_음양가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '음양가';
|
protected $name = '음양가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ use \sammo\iAction;
|
|||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
use \sammo\Util;
|
use \sammo\Util;
|
||||||
|
|
||||||
class che_종횡가 implements iAction{
|
class che_종횡가 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '종횡가';
|
protected $name = '종횡가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_중립 implements iAction{
|
class che_중립 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '-';
|
protected $name = '-';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
|||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
|
|
||||||
class che_태평도 implements iAction{
|
class che_태평도 extends \sammo\BaseNation{
|
||||||
use \sammo\DefaultAction;
|
|
||||||
|
|
||||||
protected $name = '태평도';
|
protected $name = '태평도';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
use \sammo\iAction;
|
||||||
|
use \sammo\General;
|
||||||
|
|
||||||
|
abstract class BaseNation implements iAction{
|
||||||
|
use \sammo\DefaultAction;
|
||||||
|
|
||||||
|
protected $name = '-';
|
||||||
|
protected $info = '';
|
||||||
|
static $pros = '';
|
||||||
|
static $cons = '';
|
||||||
|
}
|
||||||
@@ -285,7 +285,7 @@ class che_화계 extends Command\GeneralCommand{
|
|||||||
$this->affectDestCity($injuryCount);
|
$this->affectDestCity($injuryCount);
|
||||||
|
|
||||||
$itemObj = $general->getItem();
|
$itemObj = $general->getItem();
|
||||||
if($itemObj->isConsumableNow('GeneralCommand', '계략') && $itemObj::$consumable){
|
if($itemObj->isConsumableNow('GeneralCommand', '계략') && $itemObj->isConsumableNow('GeneralCommand', '계략')){
|
||||||
$itemName = $itemObj->getName();
|
$itemName = $itemObj->getName();
|
||||||
$itemRawName = $itemObj->getRawName();
|
$itemRawName = $itemObj->getRawName();
|
||||||
$josaUl = JosaUtil::pick($itemRawName, '을');
|
$josaUl = JosaUtil::pick($itemRawName, '을');
|
||||||
|
|||||||
+19
-2
@@ -3332,8 +3332,24 @@ class GeneralAI
|
|||||||
|
|
||||||
$picked = false;
|
$picked = false;
|
||||||
foreach(Util::range(5) as $idx){
|
foreach(Util::range(5) as $idx){
|
||||||
|
|
||||||
/** @var General */
|
/** @var General */
|
||||||
$randGeneral = Util::choiceRandom($this->npcWarGenerals);
|
if($this->npcWarGenerals){
|
||||||
|
$randGeneral = Util::choiceRandom($this->npcWarGenerals);
|
||||||
|
}
|
||||||
|
else if($this->npcCivilGenerals){
|
||||||
|
$randGeneral = Util::choiceRandom($this->npcCivilGenerals);
|
||||||
|
}
|
||||||
|
else if($this->userWarGenerals){
|
||||||
|
$randGeneral = Util::choiceRandom($this->userWarGenerals);
|
||||||
|
}
|
||||||
|
else if($this->userCivilGenerals){
|
||||||
|
$randGeneral = Util::choiceRandom($this->userCivilGenerals);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if($randGeneral->getVar('officer_level') != 1){
|
if($randGeneral->getVar('officer_level') != 1){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -3357,10 +3373,11 @@ class GeneralAI
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$picked){
|
if(!$picked || !$randGeneral){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var General $randGeneral */
|
||||||
$randGeneral->setVar('officer_level', $chiefLevel);
|
$randGeneral->setVar('officer_level', $chiefLevel);
|
||||||
$randGeneral->setVar('officer_city', 0);
|
$randGeneral->setVar('officer_city', 0);
|
||||||
$randGeneral->applyDB($db);
|
$randGeneral->applyDB($db);
|
||||||
|
|||||||
@@ -473,4 +473,12 @@ class Message
|
|||||||
], 'id=%i', $this->id);
|
], 'id=%i', $this->id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function agreeMessage(int $receiverID, string &$reason):int{
|
||||||
|
throw new NotInheritedMethodException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function declineMessage(int $receiverID, string &$reason):int{
|
||||||
|
throw new NotInheritedMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ class Scenario{
|
|||||||
|
|
||||||
private $history;
|
private $history;
|
||||||
|
|
||||||
|
/** @var \sammo\Scenario\Nation[] */
|
||||||
private $nations;
|
private $nations;
|
||||||
|
/** @var \sammo\Scenario\Nation[] */
|
||||||
private $nationsInv;
|
private $nationsInv;
|
||||||
|
|
||||||
private $diplomacy;
|
private $diplomacy;
|
||||||
@@ -125,7 +127,7 @@ class Scenario{
|
|||||||
) = $rawGeneral;
|
) = $rawGeneral;
|
||||||
|
|
||||||
if(key_exists($nationName, $this->nationsInv)){
|
if(key_exists($nationName, $this->nationsInv)){
|
||||||
$nationID = $this->nationsInv[$nationName]->id;;
|
$nationID = $this->nationsInv[$nationName]->getID();
|
||||||
}
|
}
|
||||||
else if(key_exists($nationName, $this->nations)){
|
else if(key_exists($nationName, $this->nations)){
|
||||||
$nationID = (int)$nationName;
|
$nationID = (int)$nationName;
|
||||||
@@ -167,7 +169,7 @@ class Scenario{
|
|||||||
) = $rawGeneral;
|
) = $rawGeneral;
|
||||||
|
|
||||||
if(key_exists($nationName, $this->nationsInv)){
|
if(key_exists($nationName, $this->nationsInv)){
|
||||||
$nationID = $this->nationsInv[$nationName]->id;;
|
$nationID = $this->nationsInv[$nationName]->getID();
|
||||||
}
|
}
|
||||||
else if(key_exists($nationName, $this->nations)){
|
else if(key_exists($nationName, $this->nations)){
|
||||||
$nationID = (int)$nationName;
|
$nationID = (int)$nationName;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class WarUnit{
|
|||||||
|
|
||||||
protected $currPhase = 0;
|
protected $currPhase = 0;
|
||||||
protected $prePhase = 0;
|
protected $prePhase = 0;
|
||||||
|
protected $bonusPhase = 0;
|
||||||
|
|
||||||
protected $atmosBonus = 0;
|
protected $atmosBonus = 0;
|
||||||
protected $trainBonus = 0;
|
protected $trainBonus = 0;
|
||||||
@@ -166,7 +167,8 @@ class WarUnit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getMaxPhase():int{
|
function getMaxPhase():int{
|
||||||
return $this->getCrewType()->speed;
|
$phase = $this->getCrewType()->speed;
|
||||||
|
return $phase + $this->bonusPhase;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPrePhase(int $phase){
|
function setPrePhase(int $phase){
|
||||||
@@ -177,6 +179,10 @@ class WarUnit{
|
|||||||
$this->currPhase += 1;
|
$this->currPhase += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addBonusPhase(int $cnt){
|
||||||
|
$this->bonusPhase += $cnt;
|
||||||
|
}
|
||||||
|
|
||||||
function setOppose(?WarUnit $oppose){
|
function setOppose(?WarUnit $oppose){
|
||||||
$this->oppose = $oppose;
|
$this->oppose = $oppose;
|
||||||
$this->killedCurr = 0;
|
$this->killedCurr = 0;
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
class WarUnitGeneral extends WarUnit{
|
class WarUnitGeneral extends WarUnit{
|
||||||
protected $bonusPhase = 0;
|
|
||||||
|
|
||||||
function __construct(General $general, array $rawNation, bool $isAttacker){
|
function __construct(General $general, array $rawNation, bool $isAttacker){
|
||||||
$this->general = $general;
|
$this->general = $general;
|
||||||
$this->raw = $general->getRaw();
|
$this->raw = $general->getRaw();
|
||||||
@@ -56,10 +54,6 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addBonusPhase(int $cnt){
|
|
||||||
$this->bonusPhase += $cnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMaxPhase():int{
|
function getMaxPhase():int{
|
||||||
$phase = $this->getCrewType()->speed;
|
$phase = $this->getCrewType()->speed;
|
||||||
$phase = $this->general->onCalcStat($this->general, 'initWarPhase', $phase);
|
$phase = $this->general->onCalcStat($this->general, 'initWarPhase', $phase);
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ class Util extends \utilphp\util
|
|||||||
throw new \InvalidArgumentException('올바르지 않은 type 지정');
|
throw new \InvalidArgumentException('올바르지 않은 type 지정');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function zip(iterable ...$iterators){
|
public static function zip(\Generator ...$iterators){
|
||||||
while(true){
|
while(true){
|
||||||
$hasValue = false;
|
$hasValue = false;
|
||||||
$values = [];
|
$values = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user