fixed decay for absents bug
This commit is contained in:
@@ -369,6 +369,8 @@ export class ItemManager
|
||||
}
|
||||
|
||||
decayTokens = async (tier: Tiers, amount = 1) => {
|
||||
getLogger('ItemManager#decayTokens').debug(tier)
|
||||
|
||||
await this.admin
|
||||
.knex(tier + 'tokens')
|
||||
.decrement('level', Math.max(amount, 1))
|
||||
@@ -379,13 +381,14 @@ export class ItemManager
|
||||
.del()
|
||||
}
|
||||
|
||||
decayTokensOfCharacter = async (tier: Tiers, character:Character, amount = 1) => {
|
||||
decayTokensOfCharacter = async (tier: Tiers, character:Character) => {
|
||||
getLogger('ItemManager#decayTokensOfCharacter').debug(character, tier)
|
||||
await this.admin
|
||||
.knex(tier + 'tokens')
|
||||
.where({
|
||||
characterid: character.id
|
||||
})
|
||||
.decrement('level', Math.max(amount, 1))
|
||||
.decrement('level')
|
||||
|
||||
await this.admin
|
||||
.knex(tier + 'tokens as t')
|
||||
|
||||
@@ -174,7 +174,13 @@ export class RaidManager
|
||||
|
||||
startRaid = async (raid: Raid): Promise<RaidData> => {
|
||||
const data = await this.getRaidData(raid)
|
||||
data.participants.absent.map(p => this.itemManager.decayTokensOfCharacter(raid.tier, p, 1))
|
||||
await Promise.all(data.participants.absent.map(p => this.itemManager.decayTokensOfCharacter(raid.tier, {
|
||||
charactername: p.charactername,
|
||||
id: p.characterid,
|
||||
race: p.race,
|
||||
specid: p.specid,
|
||||
userid: p.userid
|
||||
}, 1)))
|
||||
await this.itemManager.decayTokens(data.tier)
|
||||
const archived = await this.archiveRaid(raid)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
raid start.
|
||||
</li>
|
||||
<li>
|
||||
When you sign up to a raid you can spend your reserves on an item
|
||||
When you sign up to a raid you can spend your reserves on an item.
|
||||
</li>
|
||||
<li>
|
||||
Every week you can re-reserve the same item to build a streak on it
|
||||
@@ -27,8 +27,7 @@
|
||||
<h3>Priorities</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Some classes and races may get an initial boost to specific streaks. The list is on the
|
||||
right
|
||||
Some classes and races may get an initial boost to specific streaks.
|
||||
</li>
|
||||
<li>
|
||||
If an item was not reserved at all, players may roll according to their priority <br />(e.g.
|
||||
@@ -37,8 +36,20 @@
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
<h3>Streaks</h3>
|
||||
<h3>Streaks & Decay</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Spending your reserves will increase your streak by 1+#reserves. This number is affected by decay
|
||||
</li>
|
||||
<li>
|
||||
Every time a raid starts, ALL streaks in that raid tier are reduced by 1 (this evens out the streak-gain for attendees back to 1)
|
||||
</li>
|
||||
<li>
|
||||
Players that are marked absent have their streaks decay by 2 instead (which leaves the total unchanged)
|
||||
</li>
|
||||
<li>
|
||||
If a player does not sign up as either "Attending" or "Absent" they are still subject to the decay, thereby decreasing the streak by 1
|
||||
</li>
|
||||
<li>
|
||||
Switching the selected item destroys previous streaks. (Streaks must be continued without
|
||||
switchup)
|
||||
|
||||
Reference in New Issue
Block a user