Skip to content

Commit

Permalink
feat: irene calculator start stage add "2 (not halved)"
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuk1ko committed May 10, 2024
1 parent 1a867db commit 19b9435
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
46 changes: 39 additions & 7 deletions src/components/material/IreneCalculatorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@
<span class="mdui-m-r-1">{{ $t('ireneCalc.settings.initSpLv') }}</span>
<div class="mdui-btn-group">
<button
v-for="i in 3"
:key="i"
v-for="{ value, half } in startStageButtons"
:key="`${value}-${half}`"
class="mdui-btn"
:class="{ 'mdui-btn-active': settings.startStage === i }"
@click="settings.startStage = i"
>{{ i }}</button
:class="{
'mdui-btn-active': settings.startStage === value && settings.startWithHalf === half,
}"
@click="
() => {
settings.startStage = value;
settings.startWithHalf = half;
}
"
>{{ value
}}{{ half || value === 1 ? '' : ` (${$t('ireneCalc.settings.notHalved')})` }}</button
>
</div>
</div>
Expand Down Expand Up @@ -160,6 +168,7 @@ const isReleasedChar = inject('isReleasedChar');
const nls = new NamespacedLocalStorage('ireneCalc');
const ELITE_1_TIME = 8 * 3600;
const ELITE_2_TIME = 16 * 3600;
const ELITE_2_TIME_HALF = 8 * 3600;
const ELITE_3_TIME_HALF = 12 * 3600;
const ELITE_IRENE_REAL_TIME = 5 * 3600;
Expand All @@ -170,6 +179,25 @@ const FORMAT_STR = 'HH:mm';
const SETTING_STORE_KEY = 'settings';
const ASCALON_ID = '4132_ascln';
const startStageButtons = [
{
value: 1,
half: false,
},
{
value: 2,
half: false,
},
{
value: 2,
half: true,
},
{
value: 3,
half: true,
},
];
const emit = defineEmits(MDUI_DIALOG_EMITS);
const dialogRef = ref();
const dialog = useMduiDialog(emit, dialogRef);
Expand All @@ -181,6 +209,7 @@ const settings = reactive({
lazyMode: false,
isGuardOrSniper: false,
startStage: 1,
startWithHalf: false,
eliteAcc: ['', '', ''],
useAscalon: false,
});
Expand All @@ -196,6 +225,9 @@ const ascalonAcc = computed(() =>
settings.useAscalon && isAscalonUnreleased.value ? ELITE_ASCALON_ACC : 0,
);
const ireneAcc = computed(() => (settings.isGuardOrSniper ? ELITE_IRENE_ACC : 0));
const elite2time = computed(() =>
settings.startStage === 2 && !settings.startWithHalf ? ELITE_2_TIME : ELITE_2_TIME_HALF,
);
const customStartTime = computed({
get: () => {
Expand Down Expand Up @@ -274,7 +306,7 @@ const realTime1a = computed(
const realTime1r = computed(() => basicTimeIrene.value / eliteTimeAccRatio.value[0]);
// 专二时加速干员占用的实际时间
const realTime2a = computed(
() => (ELITE_2_TIME_HALF - basicTimeIrene.value) / eliteTimeAccRatio.value[1],
() => (elite2time.value - basicTimeIrene.value) / eliteTimeAccRatio.value[1],
);
// 专二时换艾丽妮的剩余时间
const realTime2r = computed(() => basicTimeIrene.value / eliteTimeAccRatio.value[1]);
Expand All @@ -284,7 +316,7 @@ const realTime3 = computed(() => ELITE_3_TIME_HALF / eliteTimeAccRatio.value[2])
// 懒人专一实际时间
const realLazyTime1 = computed(() => ELITE_1_TIME / eliteIreneTimeAccRatio.value);
// 懒人专二实际时间
const realLazyTime2 = computed(() => ELITE_2_TIME_HALF / eliteIreneTimeAccRatio.value);
const realLazyTime2 = computed(() => elite2time.value / eliteIreneTimeAccRatio.value);
const realTimeArrayA = [realTime1a, realTime2a];
const realTimeArrayR = [realTime1r, realTime2r];
Expand Down
1 change: 1 addition & 0 deletions src/locales/cn/ireneCalc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lazyMode": "懒人模式",
"isGuardOrSniper": "+30%",
"initSpLv": "起始专精",
"notHalved": "未减半",
"spBonus": "专{i}加成%",
"customStartTime": "自定义开始时间"
},
Expand Down
1 change: 1 addition & 0 deletions src/locales/jp/ireneCalc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lazyMode": "レイジーモード",
"isGuardOrSniper": "+30%",
"initSpLv": "初期ランク",
"notHalved": "半減ない",
"spBonus": "ランク{i}加速%",
"customStartTime": "カスタム開始時間"
},
Expand Down
1 change: 1 addition & 0 deletions src/locales/tw/ireneCalc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lazyMode": "懶人模式",
"isGuardOrSniper": "+30%",
"initSpLv": "起始專精",
"notHalved": "未減半",
"spBonus": "專{i}加成%",
"customStartTime": "自訂開始時間"
},
Expand Down
1 change: 1 addition & 0 deletions src/locales/us/ireneCalc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lazyMode": "Lazy mode",
"isGuardOrSniper": "+30%",
"initSpLv": "Initial level",
"notHalved": "not halved",
"spBonus": "Lv.{i} speed+%",
"customStartTime": "Custom start time"
},
Expand Down

0 comments on commit 19b9435

Please sign in to comment.