game, feat: 턴 시간 지정 방식을 30단계 중 선택하도록 변경
- 1분서버인 경우 120초 단위로 - 유산포인트 3000 -> 2500
This commit is contained in:
@@ -54,7 +54,7 @@ class Join extends \sammo\BaseAPI
|
|||||||
'leadership',
|
'leadership',
|
||||||
'strength',
|
'strength',
|
||||||
'intel',
|
'intel',
|
||||||
'inheritTurntime',
|
'inheritTurntimeZone',
|
||||||
])
|
])
|
||||||
->rule('boolean', [
|
->rule('boolean', [
|
||||||
'pic'
|
'pic'
|
||||||
@@ -72,7 +72,8 @@ class Join extends \sammo\BaseAPI
|
|||||||
], GameConst::$defaultStatMax)
|
], GameConst::$defaultStatMax)
|
||||||
->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random']))
|
->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random']))
|
||||||
->rule('in', 'inheritSpecial', GameConst::$availableSpecialWar)
|
->rule('in', 'inheritSpecial', GameConst::$availableSpecialWar)
|
||||||
->rule('min', 'inheritTurntime', 0)
|
->rule('min', 'inheritTurntimeZone', 0)
|
||||||
|
->rule('max', 'inheritTurntimeZone', 29)
|
||||||
->rule('in', 'inheritCity', array_keys(CityConst::all()))
|
->rule('in', 'inheritCity', array_keys(CityConst::all()))
|
||||||
->rule('integerArray', 'inheritBonusStat');
|
->rule('integerArray', 'inheritBonusStat');
|
||||||
|
|
||||||
@@ -139,11 +140,11 @@ class Join extends \sammo\BaseAPI
|
|||||||
$intel = $this->args['intel'];
|
$intel = $this->args['intel'];
|
||||||
|
|
||||||
$inheritSpecial = $this->args['inheritSpecial'] ?? null;
|
$inheritSpecial = $this->args['inheritSpecial'] ?? null;
|
||||||
$inheritTurntime = $this->args['inheritTurntime'] ?? null;
|
$inheritTurntimeZone = $this->args['inheritTurntimeZone'] ?? null;
|
||||||
$inheritCity = $this->args['inheritCity'] ?? null;
|
$inheritCity = $this->args['inheritCity'] ?? null;
|
||||||
$inheritBonusStat = $this->args['inheritBonusStat'] ?? null;
|
$inheritBonusStat = $this->args['inheritBonusStat'] ?? null;
|
||||||
|
|
||||||
if ($inheritTurntime !== null && $inheritCity !== null) {
|
if ($inheritTurntimeZone !== null && $inheritCity !== null) {
|
||||||
return '턴과 도시를 동시에 지정할 수 없습니다.';
|
return '턴과 도시를 동시에 지정할 수 없습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +236,7 @@ class Join extends \sammo\BaseAPI
|
|||||||
if ($inheritSpecial !== null) {
|
if ($inheritSpecial !== null) {
|
||||||
$inheritRequiredPoint += GameConst::$inheritBornSpecialPoint;
|
$inheritRequiredPoint += GameConst::$inheritBornSpecialPoint;
|
||||||
}
|
}
|
||||||
if ($inheritTurntime !== null) {
|
if ($inheritTurntimeZone !== null) {
|
||||||
$inheritRequiredPoint += GameConst::$inheritBornTurntimePoint;
|
$inheritRequiredPoint += GameConst::$inheritBornTurntimePoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,12 +351,14 @@ class Join extends \sammo\BaseAPI
|
|||||||
$experience *= 0.8;
|
$experience *= 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inheritTurntime !== null) {
|
if ($inheritTurntimeZone !== null) {
|
||||||
$inheritTurntime = $inheritTurntime % ($admin['turnterm'] * 60);
|
$inheritTurntime = $inheritTurntimeZone * ($admin['turnterm'] * 2);
|
||||||
|
$inheritTurntime += $rng->nextRangeInt(0, Util::clamp($admin['turnterm'] * 2 - 1, 0));
|
||||||
|
|
||||||
$userLogger->push(sprintf("턴 시간 %02d:%02d 로 지정", intdiv($inheritTurntime, 60), $inheritTurntime % 60), "inheritPoint");
|
$userLogger->push(sprintf("턴 시간 %02d:%02d 로 지정", intdiv($inheritTurntime, 60), $inheritTurntime % 60), "inheritPoint");
|
||||||
|
|
||||||
$inheritTurntime += $rng->nextRangeInt(0, 999999) / 1000000;
|
$inheritTurntime += $rng->nextRangeInt(0, 999999) / 1000000;
|
||||||
|
|
||||||
$turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm']));
|
$turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm']));
|
||||||
$turntime = $turntime->add(TimeUtil::secondsToDateInterval($inheritTurntime));
|
$turntime = $turntime->add(TimeUtil::secondsToDateInterval($inheritTurntime));
|
||||||
$turntime = TimeUtil::format($turntime, true);
|
$turntime = TimeUtil::format($turntime, true);
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class GameConstBase
|
|||||||
|
|
||||||
public static $minMonthToAllowInheritItem = 4;
|
public static $minMonthToAllowInheritItem = 4;
|
||||||
public static $inheritBornSpecialPoint = 6000;
|
public static $inheritBornSpecialPoint = 6000;
|
||||||
public static $inheritBornTurntimePoint = 3000;
|
public static $inheritBornTurntimePoint = 2500;
|
||||||
public static $inheritBornCityPoint = 1000;
|
public static $inheritBornCityPoint = 1000;
|
||||||
public static $inheritBornStatPoint = 1000;
|
public static $inheritBornStatPoint = 1000;
|
||||||
public static $inheritItemUniqueMinPoint = 5000;
|
public static $inheritItemUniqueMinPoint = 5000;
|
||||||
|
|||||||
+50
-66
@@ -186,58 +186,45 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col col-lg-6 col-sm-6 col-12 p-2 align-self-center">
|
<div class="col col-lg-6 col-sm-6 col-12 p-2 align-self-center">
|
||||||
<div class="a-center">
|
<div class="row">
|
||||||
<label> <input v-model="inheritTurnTimeSet" type="checkbox" />턴 시간 고정 </label>
|
<div class="col col-6 a-right align-self-center">턴 시간 지정</div>
|
||||||
</div>
|
<div class="col col-6 align-self-center">
|
||||||
<div class="row turn_time_pad">
|
<select v-model.number="inheritTurnTimeZone" class="form-select form-inline" style="max-width: 24ch">
|
||||||
<div class="col col-lg-4 offset-lg-3 col-4 offset-3">
|
<option :value="undefined">사용안함</option>
|
||||||
<NumberInputWithInfo
|
<option v-for="(zone, idx) in turnTimeZoneList" :key="idx" :value="idx">
|
||||||
v-model="inheritTurnTimeMinute"
|
{{ zone }}
|
||||||
:readonly="!inheritTurnTimeSet"
|
</option>
|
||||||
:min="0"
|
</select>
|
||||||
:max="turnterm - 1"
|
|
||||||
:right="true"
|
|
||||||
title="분"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="col col-lg-4 col-4">
|
|
||||||
<NumberInputWithInfo
|
|
||||||
v-model="inheritTurnTimeSecond"
|
|
||||||
:readonly="!inheritTurnTimeSet"
|
|
||||||
:min="0"
|
|
||||||
:max="60"
|
|
||||||
:right="true"
|
|
||||||
title="초"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col col-lg-6 col-12 p-2">
|
<div class="col col-lg-6 col-sm-6 col-12 p-2 align-self-center">
|
||||||
<div class="a-center">추가 능력치 고정</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col col-6 a-right align-self-center">추가 능력치 고정(통/무/지)</div>
|
||||||
|
<div class="col col-6 align-self-center">
|
||||||
|
<div class="row g-1">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="(args.inheritBonusStat ?? [0, 0, 0])[0]"
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[0]"
|
||||||
:max="stats.bonusMax"
|
:max="stats.bonusMax"
|
||||||
title="통솔"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="(args.inheritBonusStat ?? [0, 0, 0])[1]"
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[1]"
|
||||||
:max="stats.bonusMax"
|
:max="stats.bonusMax"
|
||||||
title="무력"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="(args.inheritBonusStat ?? [0, 0, 0])[2]"
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[2]"
|
||||||
:max="stats.bonusMax"
|
:max="stats.bonusMax"
|
||||||
title="지력"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -284,7 +271,7 @@ import TopBackBar from "@/components/TopBackBar.vue";
|
|||||||
import { getIconPath } from "@util/getIconPath";
|
import { getIconPath } from "@util/getIconPath";
|
||||||
import { isBrightColor } from "@util/isBrightColor";
|
import { isBrightColor } from "@util/isBrightColor";
|
||||||
import { abilityLeadint, abilityLeadpow, abilityPowint, abilityRand } from "@util/generalStats";
|
import { abilityLeadint, abilityLeadpow, abilityPowint, abilityRand } from "@util/generalStats";
|
||||||
import { shuffle, sum } from "lodash-es";
|
import { range, shuffle, sum } from "lodash-es";
|
||||||
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
||||||
import { SammoAPI } from "./SammoAPI";
|
import { SammoAPI } from "./SammoAPI";
|
||||||
import type { JoinArgs } from "./defs/API/General";
|
import type { JoinArgs } from "./defs/API/General";
|
||||||
@@ -378,7 +365,7 @@ watch(gameConstStore, (gameConst) => {
|
|||||||
inheritCity: undefined,
|
inheritCity: undefined,
|
||||||
inheritBonusStat: [0, 0, 0],
|
inheritBonusStat: [0, 0, 0],
|
||||||
inheritSpecial: undefined,
|
inheritSpecial: undefined,
|
||||||
inheritTurntime: undefined,
|
inheritTurntimeZone: undefined,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -462,7 +449,7 @@ const inheritRequiredPoint = computed(() => {
|
|||||||
if (args.value.inheritSpecial !== undefined) {
|
if (args.value.inheritSpecial !== undefined) {
|
||||||
inheritRequiredPoint += gameConst.inheritBornSpecialPoint;
|
inheritRequiredPoint += gameConst.inheritBornSpecialPoint;
|
||||||
}
|
}
|
||||||
if (args.value.inheritTurntime !== undefined) {
|
if (args.value.inheritTurntimeZone !== undefined) {
|
||||||
inheritRequiredPoint += gameConst.inheritBornTurntimePoint;
|
inheritRequiredPoint += gameConst.inheritBornTurntimePoint;
|
||||||
}
|
}
|
||||||
if (args.value.inheritBonusStat !== undefined && sum(args.value.inheritBonusStat) != 0) {
|
if (args.value.inheritBonusStat !== undefined && sum(args.value.inheritBonusStat) != 0) {
|
||||||
@@ -494,21 +481,41 @@ watch(inheritCity, (newValue: undefined | number) => {
|
|||||||
args.value.inheritCity = inheritCity.value;
|
args.value.inheritCity = inheritCity.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
const inheritTurnTimeSet = ref(false);
|
|
||||||
watch(inheritTurnTimeSet, (newValue: boolean) => {
|
|
||||||
if (!args.value) throw "nyc";
|
|
||||||
|
|
||||||
if (!newValue) {
|
const inheritTurnTimeZone = ref<number>();
|
||||||
args.value.inheritTurntime = undefined;
|
const turnTimeZoneList: string[] = (()=>{
|
||||||
return;
|
const result: string[] = [];
|
||||||
|
const zoneSec = turnterm * (60 / 30); // 1 / 60
|
||||||
|
let zoneCur = 0;
|
||||||
|
for(const idx of range(30)){
|
||||||
|
const zoneNext = zoneCur + zoneSec;
|
||||||
|
|
||||||
|
const zoneCurMin = Math.floor(zoneCur / 60);
|
||||||
|
const zoneCurSec = zoneCur % 60;
|
||||||
|
const zoneCurText = `${zoneCurMin.toString().padStart(2, "0")}:${zoneCurSec.toString().padStart(2, "0")}.000`;
|
||||||
|
|
||||||
|
const zoneCurEnd = zoneCur + zoneSec - 1;
|
||||||
|
const zoneCurEndMin = Math.floor(zoneCurEnd / 60);
|
||||||
|
const zoneCurEndSec = zoneCurEnd % 60;
|
||||||
|
const zoneCurEndText = `${zoneCurEndMin.toString().padStart(2, "0")}:${zoneCurEndSec.toString().padStart(2, "0")}.999`;
|
||||||
|
|
||||||
|
// aa:bb.000 ~ cc:dd.999
|
||||||
|
const zoneStr = `${zoneCurText} ~ ${zoneCurEndText}`;
|
||||||
|
result.push(zoneStr);
|
||||||
|
zoneCur = zoneNext;
|
||||||
}
|
}
|
||||||
args.value.inheritTurntime = inheritTurnTimeMinute.value * 60 + inheritTurnTimeSecond.value;
|
return result;
|
||||||
|
})();
|
||||||
|
|
||||||
|
watch(inheritTurnTimeZone, (newValue: undefined | number) => {
|
||||||
|
if (!args.value) throw "nyc";
|
||||||
|
args.value.inheritTurntimeZone = inheritTurnTimeZone.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[inheritCity, inheritTurnTimeSet],
|
[inheritCity, inheritTurnTimeZone],
|
||||||
([newInheritCity, newInheritTurnTimeSet], [oldInheritCity, oldInheritTurnTimeSet]) => {
|
([newInheritCity, newInheritTurnTimeZone], [oldInheritCity, oldInheritTurnTimeZone]) => {
|
||||||
if (newInheritCity === undefined || newInheritTurnTimeSet === false) {
|
if (newInheritCity === undefined || newInheritTurnTimeZone === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
alert("도시와 턴 시간을 동시에 설정할 수 없습니다.");
|
alert("도시와 턴 시간을 동시에 설정할 수 없습니다.");
|
||||||
@@ -516,33 +523,14 @@ watch(
|
|||||||
if (newInheritCity !== oldInheritCity) {
|
if (newInheritCity !== oldInheritCity) {
|
||||||
inheritCity.value = undefined;
|
inheritCity.value = undefined;
|
||||||
}
|
}
|
||||||
if (newInheritTurnTimeSet !== oldInheritTurnTimeSet) {
|
if (newInheritTurnTimeZone !== oldInheritTurnTimeZone) {
|
||||||
inheritTurnTimeSet.value = false;
|
inheritTurnTimeZone.value = undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
const inheritTurnTimeMinute = ref(0);
|
|
||||||
watch(inheritTurnTimeMinute, (newValue: number) => {
|
|
||||||
if (!args.value) throw "nyc";
|
|
||||||
if (!inheritTurnTimeSet.value) {
|
|
||||||
args.value.inheritTurntime = undefined;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
args.value.inheritTurntime = newValue * 60 + inheritTurnTimeSecond.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
const inheritTurnTimeSecond = ref(0);
|
|
||||||
watch(inheritTurnTimeSecond, (newValue: number) => {
|
|
||||||
if (!args.value) throw "nyc";
|
|
||||||
|
|
||||||
if (!inheritTurnTimeSet.value) {
|
|
||||||
args.value.inheritTurntime = undefined;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
args.value.inheritTurntime = inheritTurnTimeMinute.value * 60 + newValue;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@scss/common/base.scss";
|
@import "@scss/common/base.scss";
|
||||||
@@ -569,10 +557,6 @@ watch(inheritTurnTimeSecond, (newValue: number) => {
|
|||||||
.col-form-label {
|
.col-form-label {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.turn_time_pad .col-form-label {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export type JoinArgs = {
|
|||||||
pic: boolean;
|
pic: boolean;
|
||||||
character: string;
|
character: string;
|
||||||
inheritSpecial?: string;
|
inheritSpecial?: string;
|
||||||
inheritTurntime?: number;
|
inheritTurntimeZone?: number;
|
||||||
inheritCity?: number;
|
inheritCity?: number;
|
||||||
inheritBonusStat?: [number, number, number];
|
inheritBonusStat?: [number, number, number];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user