버그 테스트
This commit is contained in:
+16
-5
@@ -2123,8 +2123,16 @@ class GeneralAI
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$armType =$general->getAuxVar('armType');
|
$armType =$general->getAuxVar('armType');
|
||||||
if(!$armType){
|
if($armType){
|
||||||
|
if(!($genType & self::t지장) && $armType == GameUnitConst::T_WIZARD){
|
||||||
|
$armType = null;
|
||||||
|
}
|
||||||
|
else if(!($genType & self::t무장) && in_array($armType, [GameUnitConst::T_FOOTMAN, GameUnitConst::T_ARCHER, GameUnitConst::T_CAVALRY])){
|
||||||
|
$armType = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$armType){
|
||||||
$dex = [
|
$dex = [
|
||||||
GameUnitConst::T_FOOTMAN => sqrt($general->getVar('dex1') + 500),
|
GameUnitConst::T_FOOTMAN => sqrt($general->getVar('dex1') + 500),
|
||||||
GameUnitConst::T_ARCHER => sqrt($general->getVar('dex2') + 500),
|
GameUnitConst::T_ARCHER => sqrt($general->getVar('dex2') + 500),
|
||||||
@@ -2169,13 +2177,16 @@ class GeneralAI
|
|||||||
if ($types) {
|
if ($types) {
|
||||||
$type = Util::choiceRandomUsingWeightPair($types);
|
$type = Util::choiceRandomUsingWeightPair($types);
|
||||||
} else {
|
} else {
|
||||||
$type = GameUnitConst::DEFAULT_CREWTYPE;
|
throw new MustNotBeReachedException('에러:'.var_dump([$general->getName(), $general->getAuxVar('armType'), $armType, $cities, $regions, $relYear, $tech], true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->generalPolicy->can고급병종){
|
if($this->generalPolicy->can고급병종){
|
||||||
$currType = $general->getCrewTypeObj()->id;
|
$currCrewType = $general->getCrewTypeObj();
|
||||||
if(key_exists($currType, $types) && $types[$currType][1] >= $types[$type][1]){
|
if ($currCrewType->isValid($cities, $regions, $relYear, $tech)) {
|
||||||
$type = $currType;
|
$currScore = $crewtype->pickScore($tech);
|
||||||
|
if($types[$type][1] * 0.8 < $currScore){
|
||||||
|
$type = $currCrewType->id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user