Sfoglia il codice sorgente

fixed decay for absents bug

master
peter 5 anni fa
parent
commit
abed080892

+ 5
- 2
src/backend/Components/Item/ItemManager.ts Vedi File

@@ -369,6 +369,8 @@ export class ItemManager
369 369
     }
370 370
 
371 371
     decayTokens = async (tier: Tiers, amount = 1) => {
372
+        getLogger('ItemManager#decayTokens').debug(tier)
373
+
372 374
         await this.admin
373 375
         .knex(tier + 'tokens')
374 376
         .decrement('level', Math.max(amount, 1))
@@ -379,13 +381,14 @@ export class ItemManager
379 381
         .del()
380 382
     }
381 383
 
382
-    decayTokensOfCharacter = async (tier: Tiers, character:Character, amount = 1) => {
384
+    decayTokensOfCharacter = async (tier: Tiers, character:Character) => {
385
+        getLogger('ItemManager#decayTokensOfCharacter').debug(character, tier)
383 386
         await this.admin
384 387
         .knex(tier + 'tokens')
385 388
         .where({
386 389
             characterid: character.id
387 390
         })
388
-        .decrement('level', Math.max(amount, 1))
391
+        .decrement('level')
389 392
 
390 393
         await this.admin
391 394
         .knex(tier + 'tokens as t')

+ 7
- 1
src/backend/Components/Raid/RaidManager.ts Vedi File

@@ -174,7 +174,13 @@ export class RaidManager
174 174
 
175 175
     startRaid = async (raid: Raid): Promise<RaidData> => {
176 176
         const data = await this.getRaidData(raid)
177
-        data.participants.absent.map(p => this.itemManager.decayTokensOfCharacter(raid.tier, p, 1))
177
+        await Promise.all(data.participants.absent.map(p => this.itemManager.decayTokensOfCharacter(raid.tier, {
178
+            charactername: p.charactername,
179
+            id: p.characterid,
180
+            race: p.race,
181
+            specid: p.specid,
182
+            userid: p.userid
183
+        }, 1)))
178 184
         await this.itemManager.decayTokens(data.tier)      
179 185
         const archived = await this.archiveRaid(raid)
180 186
 

+ 15
- 4
src/frontend/src/app/frontcraft/pages/rules/rules.component.html Vedi File

@@ -15,7 +15,7 @@
15 15
                         raid start.
16 16
                     </li>
17 17
                     <li>
18
-                        When you sign up to a raid you can spend your reserves on an item
18
+                        When you sign up to a raid you can spend your reserves on an item. 
19 19
                     </li>
20 20
                     <li>
21 21
                         Every week you can re-reserve the same item to build a streak on it
@@ -27,8 +27,7 @@
27 27
                 <h3>Priorities</h3>
28 28
                 <ul>
29 29
                     <li>
30
-                        Some classes and races may get an initial boost to specific streaks. The list is on the
31
-                        right
30
+                        Some classes and races may get an initial boost to specific streaks.
32 31
                     </li>
33 32
                     <li>
34 33
                         If an item was not reserved at all, players may roll according to their priority <br />(e.g.
@@ -37,8 +36,20 @@
37 36
                     </li>
38 37
                 </ul>
39 38
                 <br />
40
-                <h3>Streaks</h3>
39
+                <h3>Streaks & Decay</h3>
41 40
                 <ul>
41
+                    <li>
42
+                        Spending your reserves will increase your streak by 1+#reserves. This number is affected by decay
43
+                    </li>
44
+                    <li>
45
+                        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)
46
+                    </li>
47
+                    <li>
48
+                        Players that are marked absent have their streaks decay by 2 instead (which leaves the total unchanged)
49
+                    </li>
50
+                    <li>
51
+                        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
52
+                    </li>
42 53
                     <li>
43 54
                         Switching the selected item destroys previous streaks. (Streaks must be continued without
44 55
                         switchup)

Loading…
Annulla
Salva