-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pity to card upgrades #7
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,9 @@ export class UpgradeCommand extends Command { | |
} | ||
|
||
const upgradePrice = condition.upgradePrice * (card.foil ? 2 : 1); | ||
const pityFactor = 0.07 * card.pity; | ||
const upgradeChance = Math.min(card.condition.upgradeChance + pityFactor, .8); | ||
const downgradeChance = Math.max(0.5 - pityFactor, 0.3) | ||
|
||
const imagePath = await renderCard(card, {cardCode: true}) | ||
|
||
|
@@ -85,8 +88,8 @@ export class UpgradeCommand extends Command { | |
.setTitle('Upgrade card') | ||
.setThumbnail('attachment://card.png') | ||
.setDescription([ | ||
`Upgrading the \`${card.mapper.username}\` card from from **${condition.id}** to **${condition.nextUpgrade.id}** has a ${Math.floor(condition.upgradeChance * 100)}% chance of success.`, | ||
condition.previousUpgrade ? `If the upgrade fails, there is a 50% chance the card will be downgraded to **${condition.previousUpgrade.id}**` : `If the upgrade fails, nothing will happen.`, | ||
`Upgrading the \`${card.mapper.username}\` card from from **${condition.id}** to **${condition.nextUpgrade.id}** has a ${Math.floor(upgradeChance * 100)}% chance of success.`, | ||
condition.previousUpgrade ? `If the upgrade fails, there is a ${Math.floor(downgradeChance * 100)}% chance the card will be downgraded to **${condition.previousUpgrade.id}**` : `If the upgrade fails, nothing will happen.`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the pity factor should be advertised anywhere There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it displays the odds and the odds change, felt like basic transparency There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd still prefer not to give it away, ppl should not really be aware of the pity system There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's a fair standpoint, can remove when we've figured it all out |
||
'', | ||
'Attempting to upgrade will cost', | ||
'```diff', | ||
|
@@ -176,13 +179,14 @@ export class UpgradeCommand extends Command { | |
} | ||
|
||
const random = Math.random(); | ||
const success = random < condition.upgradeChance; | ||
const downgrade = !success && Math.random() < 0.5; | ||
const success = random < upgradeChance; | ||
const downgrade = !success && Math.random() < downgradeChance; | ||
if (success) { | ||
currentCard.condition = condition.nextUpgrade; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pretty sure pity should be reset on success There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typical pity systems would do that, but I don't think it would fit here the main killer in the upgrade system is how much it can fluctuate, in 10% of cases your card downgrades 3+ times by going from good to poor and back on repeat for example at that point just reducing overall costs or reducing chance to downgrade in general would be more effective changes, which people would probably also be happy with |
||
} else { | ||
if (condition.previousUpgrade && downgrade) { | ||
currentCard.condition = condition.previousUpgrade; | ||
currentCard.pity++; | ||
} | ||
} | ||
|
||
|
@@ -208,7 +212,7 @@ export class UpgradeCommand extends Command { | |
} else { | ||
await response.update({ | ||
embeds: [ | ||
embed.setFooter({text: 'Upgrade failed' + (downgrade && condition.previousUpgrade ? '. Card is now `' + condition.previousUpgrade.id + '`' : '') ,}) | ||
embed.setFooter({text: 'Upgrade failed' + (downgrade && condition.previousUpgrade ? '. Card is now `' + condition.previousUpgrade.id + '`' + '\n' + 'Your chances for future upgrades improved a little..': '') ,}) | ||
.setColor('Red') | ||
], | ||
components: [] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably not be linear, rather something that slowly approaches but never reaches 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can agree with making it non-linear, though making it "slowly" approach anything seems a bit pointless since most upgrade sequences currently don't even reach 10 total rolls
; this isn't like spending 100 gacha pulls to get your guaranteed SSR character
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this? It's
pity / (pity + 8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparison with previous formula
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simulated this and got this, it going up steeper early has a stronger effect it seems
but having the average coincidentally hover around the price of a superdrop seems rather neat