diff --git a/hwe/sammo/API/General/Join.php b/hwe/sammo/API/General/Join.php
index 99a70b7c..5d50164c 100644
--- a/hwe/sammo/API/General/Join.php
+++ b/hwe/sammo/API/General/Join.php
@@ -143,15 +143,17 @@ class Join extends \sammo\BaseAPI
if (count($inheritBonusStat) != 3) {
return "보너스 능력치가 잘못 지정되었습니다. 다시 가입해주세요!";
}
- $sum = array_sum($inheritBonusStat);
- if ($sum < 3 || $sum > 5) {
- return "보너스 능력치 합이 잘못 지정되었습니다. 다시 가입해주세요!";
- }
foreach ($inheritBonusStat as $stat) {
if ($stat < 0) {
return "보너스 능력치가 음수입니다. 다시 가입해주세요!";
}
}
+ $sum = array_sum($inheritBonusStat);
+ if ($sum == 0) {
+ $inheritBonusStat = null;
+ } else if ($sum < 3 || $sum > 5) {
+ return "보너스 능력치 합이 잘못 지정되었습니다. 다시 가입해주세요!";
+ }
}
$admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year']);
@@ -163,7 +165,7 @@ class Join extends \sammo\BaseAPI
$inheritRequiredPoint += GameConst::$inheritBornCityPoint;
}
if ($inheritBonusStat !== null) {
- $inheritRequiredPoint += GameConst::$inheritBornMaxBonusStat;
+ $inheritRequiredPoint += GameConst::$inheritBornStatPoint;
}
if ($inheritSpecial !== null) {
$inheritRequiredPoint += GameConst::$inheritBornSpecialPoint;
@@ -278,6 +280,7 @@ class Join extends \sammo\BaseAPI
}
if ($inheritTurntime !== null) {
+ //FIXME: 오동작함
$inheritTurntime = $inheritTurntime % ($gameStor->turnterm * 60);
$inheritTurntime += Util::randRangeInt(0, 999999) / 1000000;
$turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm']));
@@ -372,6 +375,16 @@ class Join extends \sammo\BaseAPI
]);
$cityname = CityConst::byID($city)->name;
+ if ($inheritRequiredPoint > 0) {
+ $inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
+ $inheritStor->setValue('previous', [$inheritTotalPoint - $inheritRequiredPoint, [
+ 'inheritBonusStat'=>$inheritBonusStat,
+ 'inheritCity'=>$inheritCity,
+ 'inheritSpecial'=>$inheritSpecial,
+ 'inheritTurntime'=>$inheritTurntime,
+ ]]);
+ }
+
$me = [
'no' => $generalID
];
diff --git a/hwe/sammo/GameConstBase.php b/hwe/sammo/GameConstBase.php
index 37b61b89..d36689df 100644
--- a/hwe/sammo/GameConstBase.php
+++ b/hwe/sammo/GameConstBase.php
@@ -198,7 +198,7 @@ class GameConstBase
public static $inheritBornSpecialPoint = 12000;
public static $inheritBornTurntimePoint = 3000;
public static $inheritBornCityPoint = 1000;
- public static $inheritBornMaxBonusStat = 1000;
+ public static $inheritBornStatPoint = 1000;
public static $allItems = [
'horse' => [
diff --git a/hwe/ts/Join.vue b/hwe/ts/Join.vue
index b6f366a1..b4984534 100644
--- a/hwe/ts/Join.vue
+++ b/hwe/ts/Join.vue
@@ -135,6 +135,129 @@
임의의 도시에서 재야로 시작하며 건국과 임관은 게임 내에서 실행합니다.
+
+
장수 생성 {
+ const rC = lhs[1].localeCompare(rhs[1]);
+ if (rC != 0) return rC;
+ return lhs[2].localeCompare(rhs[2]);
+ });
return {
- displayTable: displayTable,
+ displayTable,
+ displayInherit,
availablePersonality,
+ availableInheritSpecial,
+ availableInheritCity,
member: member,
stats,
args,
nationList: nationListShuffled,
isBrightColor,
+ inheritTotalPoint,
+ inheritTurnTimeSet: false,
+ inheritTurnTimeMinute: 0,
+ inheritTurnTimeSecond: 0,
+ turnterm,
};
},
watch: {
@@ -260,6 +425,31 @@ export default defineComponent({
JSON.stringify(newValue)
);
},
+ displayInherit(newValue: boolean) {
+ localStorage.setItem(
+ `conf.${serverID}.join.displayInherit`,
+ JSON.stringify(newValue)
+ );
+ },
+ inheritTurnTimeMinute(newValue: number) {
+ if (!this.inheritTurnTimeSet) {
+ this.args.inheritTurntime = 0;
+ }
+ this.args.inheritTurntime = newValue * 60 + this.inheritTurnTimeSecond;
+ },
+ inheritTurnTimeSecond(newValue: number) {
+ if (!this.inheritTurnTimeSet) {
+ this.args.inheritTurntime = 0;
+ }
+ this.args.inheritTurntime = this.inheritTurnTimeMinute * 60 + newValue;
+ },
+ inheritTurnTimeSet(newValue: boolean) {
+ if (!newValue) {
+ this.args.inheritTurntime = 0;
+ }
+ this.args.inheritTurntime =
+ this.inheritTurnTimeMinute * 60 + this.inheritTurnTimeSecond;
+ },
},
computed: {
iconPath() {
@@ -268,6 +458,25 @@ export default defineComponent({
}
return getIconPath(0, "default.jpg");
},
+ inheritRequiredPoint() {
+ let inheritRequiredPoint = 0;
+ if (this.args.inheritCity !== undefined) {
+ inheritRequiredPoint += inheritPoints.city;
+ }
+ if (this.args.inheritSpecial !== undefined) {
+ inheritRequiredPoint += inheritPoints.special;
+ }
+ if (this.args.inheritTurntime !== undefined) {
+ inheritRequiredPoint += inheritPoints.turnTime;
+ }
+ if (
+ this.args.inheritBonusStat !== undefined &&
+ sum(this.args.inheritBonusStat) != 0
+ ) {
+ inheritRequiredPoint += inheritPoints.stat;
+ }
+ return inheritRequiredPoint;
+ },
},
methods: {
randStatRandom() {
@@ -295,7 +504,7 @@ export default defineComponent({
this.args.intel = Math.floor(stats.total / 3);
},
async submitForm() {
- //검증은 언제 되어야 하는가?
+ //검증은 언제 되어야 하는가?
const args = clone(this.args);
let result: InvalidResponse;
try {
@@ -309,8 +518,8 @@ export default defineComponent({
},
});
result = response.data;
- if(!result.result){
- throw result.reason;
+ if (!result.result) {
+ throw result.reason;
}
} catch (e) {
console.error(e);
@@ -318,8 +527,10 @@ export default defineComponent({
return;
}
- alert('정상적으로 생성되었습니다. \n위키와 팁/강좌 게시판을 꼭 읽어보세요!');
- location.href = './';
+ alert(
+ "정상적으로 생성되었습니다. \n위키와 팁/강좌 게시판을 꼭 읽어보세요!"
+ );
+ location.href = "./";
},
},
});
diff --git a/hwe/ts/components/NumberInputWithInfo.vue b/hwe/ts/components/NumberInputWithInfo.vue
index 69fef342..c5e55cdf 100644
--- a/hwe/ts/components/NumberInputWithInfo.vue
+++ b/hwe/ts/components/NumberInputWithInfo.vue
@@ -17,6 +17,7 @@
{
(this.$refs.input as HTMLInputElement).focus();
diff --git a/hwe/v_join.php b/hwe/v_join.php
index e67a3e34..c6db78da 100644
--- a/hwe/v_join.php
+++ b/hwe/v_join.php
@@ -23,7 +23,7 @@ if (!$member) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
-$admin = $gameStor->getValues(['block_general_create', 'show_img_level', 'maxgeneral']);
+$admin = $gameStor->getValues(['block_general_create', 'show_img_level', 'maxgeneral', 'turnterm']);
if ($admin['block_general_create']) {
die(WebUtil::errorBackMsg("잘못된 접근입니다!!!"));
}
@@ -38,6 +38,7 @@ if ($gencount >= $admin['maxgeneral']) {
die(WebUtil::errorBackMsg("더 이상 등록할 수 없습니다."));
}
+$inheritTotalPoint = resetInheritanceUser($userID);
$nationList = $db->query('SELECT nation,`name`,color,scout FROM nation');
$nationList = Util::convertArrayToDict($nationList, 'nation');
@@ -57,6 +58,20 @@ foreach (GameConst::$availablePersonality as $personalityID) {
];
}
+$availableInheritSpecial = [];
+foreach (GameConst::$availableSpecialWar as $specialID){
+ $specialObj = buildGeneralSpecialWarClass($specialID);
+ $availableInheritSpecial[$specialID] = [
+ 'name' => $specialObj->getName(),
+ 'info' => $specialObj->getInfo(),
+ ];
+}
+
+$availableInheritCity = [];
+foreach(CityConst::all() as $city){
+ $availableInheritCity[] = [$city->id, CityConst::$regionMap[$city->region], $city->name];
+}
+
?>
@@ -93,7 +108,17 @@ foreach (GameConst::$availablePersonality as $personalityID) {
'total' => GameConst::$defaultStatTotal,
'bonusMin' => GameConst::$bornMinStatBonus,
'bonusMax' => GameConst::$bornMaxStatBonus,
- ]
+ ],
+ 'inheritTotalPoint'=>$inheritTotalPoint,
+ 'inheritPoints'=>[
+ 'special'=>GameConst::$inheritBornSpecialPoint,
+ 'turnTime'=>GameConst::$inheritBornTurntimePoint,
+ 'city'=>GameConst::$inheritBornCityPoint,
+ 'stat'=>GameConst::$inheritBornStatPoint
+ ],
+ 'availableInheritSpecial' => $availableInheritSpecial,
+ 'availableInheritCity'=> $availableInheritCity,
+ 'turnterm'=>$gameStor->turnterm,
]) ?>