Skip to content

Commit

Permalink
Current Pity Changer
Browse files Browse the repository at this point in the history
  • Loading branch information
AguzzTN54 committed Oct 25, 2023
1 parent 4715c23 commit a950e6d
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "Probabilitas Dasar {rarity}★:",
"maxPity": "Piti Maksimal {rarity}★:",
"hardPity": "Tingkatkan probabilitas {rarity}★ pada piti:",
"currentPity": "Pity {rarity}★ saat ini",
"winRate": "Probabilitas mendapat item RateUP:",
"charRate": "Probabilitas mendapat Karakter dibanding Senjata",
"nonRateup": "(Item non-RateUP)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "★{rarity} 基礎出現確率:",
"maxPity": "★{rarity} 天井:",
"hardPity": "★{rarity} 確率上昇が始まる祈願連数:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "ピックアップ獲得確率:",
"charRate": "武器ではなくキャラクターを入手する確率",
"nonRateup": "(すり抜け時)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/th-TH.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"baseRate": "{rarity}-Star Base Rate:",
"maxPity": "{rarity}-Star Max Pity:",
"hardPity": "Boost {rarity}-Star rate starts from pity:",
"currentPity": "{rarity}-Star Current Pity",
"winRate": "Chance to get Featured Item:",
"charRate": "Chance to get Character instead of Weapon",
"nonRateup": "(Non RateUp Item)",
Expand Down
43 changes: 38 additions & 5 deletions src/routes/_wish/banner-card/_probability-editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { getContext } from 'svelte';
import { fade } from 'svelte/transition';
import { t } from 'svelte-i18n';
import { localPity } from '$lib/store/localstore-manager';
import { getRate, setRate } from '$lib/helpers/gacha/probabilities';
import { playSfx } from '$lib/helpers/audio/audio';
import ButtonGeneral from '$lib/components/ButtonGeneral.svelte';
Expand Down Expand Up @@ -91,6 +92,12 @@
if (variable === 'hard5') hard5 = finalVal;
}
// Current Pity Changer
if (variable.match('now')) {
if (variable === 'now4') localPity.set(`pity4-${type}`, val);
if (variable === 'now5') localPity.set(`pity5-${type}`, val);
}
setRate(type, variable, finalVal || 1);
};
</script>
Expand Down Expand Up @@ -137,6 +144,19 @@
</div>
</div>

<div class="item" class:disabled={baseRate5 >= 100 || !max5 || max5 <= 1}>
<div class="col">
{$t('editor.currentPity', { values: { rarity: 5 } })}
</div>
<div class="col">
<input
type="number"
value={localPity.get(`pity5-${type}`)}
on:input={(e) => changePity(e, 'now5')}
/>
</div>
</div>

<div class="item" class:disabled={baseRate5 >= 100 || max5 <= 1}>
<div class="col">{$t('editor.baseRate', { values: { rarity: 4 } })}</div>
<div class="col percent">
Expand Down Expand Up @@ -178,6 +198,19 @@
</div>
</div>

<div class="item" class:disabled={baseRate5 >= 100 || !max5 || max5 <= 1}>
<div class="col">
{$t('editor.currentPity', { values: { rarity: 4 } })}
</div>
<div class="col">
<input
type="number"
value={localPity.get(`pity4-${type}`)}
on:input={(e) => changePity(e, 'now4')}
/>
</div>
</div>

{#if type !== 'standard'}
<div class="item">
<div class="col">{$t('editor.winRate')}</div>
Expand Down Expand Up @@ -250,7 +283,7 @@
flex-direction: column;
min-height: 100%;
width: 100%;
font-size: 85%;
font-size: 80%;
position: relative;
}
Expand Down Expand Up @@ -287,17 +320,17 @@
.footer {
margin-top: auto;
padding: 1%;
padding: 0 1% 1%;
text-align: right;
}
.item {
display: flex;
align-items: center;
width: 100%;
padding: 0.28% 0 0.28% 1%;
padding: 0.2% 0 0.2% 1%;
border-bottom: rgba(20, 18, 15, 0.5) 1px solid;
transition: background 0.5s;
transition: background 0.25s;
}
.fullscreenEditor .item {
Expand Down Expand Up @@ -328,7 +361,7 @@
}
.col:nth-child(2) {
height: 2rem;
height: 1.8rem;
flex-basis: 10%;
min-width: 5rem;
}
Expand Down

0 comments on commit a950e6d

Please sign in to comment.