Skip to content

Commit a2f4c43

Browse files
pve stage 19 gives 2 random components as rewards
1 parent 71dd237 commit a2f4c43

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

app/models/pve-stages.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import {
99
} from "../types/enum/Item"
1010
import { Pkm } from "../types/enum/Pokemon"
1111
import { Synergy } from "../types/enum/Synergy"
12-
import { chance, pickNRandomIn, pickRandomIn } from "../utils/random"
12+
import {
13+
chance,
14+
pickNRandomIn,
15+
pickRandomIn,
16+
randomWeighted
17+
} from "../utils/random"
1318
import { values } from "../utils/schemas"
1419
import Player from "./colyseus-models/player"
1520

@@ -144,9 +149,18 @@ export const PVEStages: { [turn: number]: PVEStage } = {
144149
[Stat.SPE_DEF]: 5
145150
},
146151
marowakItems: [[Item.COMET_SHARD], [Item.SACRED_ASH]],
147-
rewards: CraftableNoStonesOrScarves,
152+
rewards: ItemComponentsNoFossilOrScarf,
148153
getRewards(player: Player) {
149-
return [pickRandomIn(CraftableNoStonesOrScarves)]
154+
const componentsWeights = ItemComponentsNoFossilOrScarf.reduce((o, i) => {
155+
return { ...o, [i]: player.randomComponentsGiven.includes(i) ? 1 : 2 } // twice the weight if the player doesn't have it yet
156+
}, {})
157+
const randomComponentsGiven: Item[] = []
158+
for (let i = 0; i < 2; i++) {
159+
randomComponentsGiven.push(randomWeighted(componentsWeights)!)
160+
}
161+
162+
player.randomComponentsGiven.push(...randomComponentsGiven)
163+
return randomComponentsGiven
150164
}
151165
},
152166

app/public/dist/client/changelog/patch-6.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
# Changes to Gameplay
6161

6262
- Abilities that do not require a target can now be casted even when the caster is not currently targeting an enemy. Here are the affected abilities: Agility, Anchor Shot, Aqua Ring, Astral Barrage, Attract, Aurora Veil, Axe Kick, Baneful Bunker, Beat Up, Bone Armor, Bounce, Bulk Up, Chain Crazed, Chatter, Column Crush, Cosmic Power (Moon), Cosmic Power (Sun), Curse, Dark Harvest, Decorate, Defense Curl, Dive, Echo, Electric Surge, Electrify, Eruption, Expanding Force, Fairy Wind, Fly, Flying Press, Forecast, Future Sight, Geomancy, Grassy Surge, Gravity, Growth, Happy Hour, Harden, Helping Hand, Hidden Power (all), Hypnosis, Icicle Missile, Lunar Blessing, Lunge, Magic Bounce, Magnet Pull, Meditate, Misty Surge, Mud Bubble, Nasty Plot, Natural Gift, Nightmare, Nutrients, Pastel Veil, Petal Dance, Pollen Puff, Psychic Surge, Purify, Quiver Dance, Recover, Relic Song, Roar of Time, Rock Artillery, Roost, Shadow Force, Shadow Punch, Shed Tail, Shields Down, Shields Up, Shore Up, Sing, Sky Attack, Slack Off, Smokescreen, Soft Boiled, Song of Desire, Spicy Extract, Splash, Stone Edge, Sunsteel Strike, Supercell Slam, Syrup Bomb, Tailwind, Take Heart, Teatime, Teeter Dance, Teleport, Terrain Pulse, Thousand Arrows, Thrash, Thunder, Time Travel, Torch Song, Torment, Triple Dive, Unbound, Victory Dance, Volt Surge, Waterfall, Wise Yawn, Wish, Yawn.
63+
- Stage 19 Pve Rewards changed to 2 components instead of a fully craftable item
6364

6465
# Misc
6566

0 commit comments

Comments
 (0)