---
# System prepended metadata

title: 口袋怪獸筆記

---

### pokerogue javascript hacks
https://www.youtube.com/results?search_query=pokerogue+javascript
https://github.com/PokeRogueMOD/JsPoRoMOD/tree/main/scripts
https://www.youtube.com/watch?v=iS8bZPSHkIg

### 無限扭蛋券
```javascript
Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.gameData.voucherCounts[3] = 100
```

### 把第一顆蛋改成想孵化的怪物
```javascript
Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.gameData.eggs[0]._species = 495
```

### 指定要孵出什麼怪物
```javascript!
[37, 282, 597, 131, 213, 116, 479, 207].forEach((_species, index) => {
    const egg = Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.gameData.eggs[index]
    egg.hatchWaves = 0
    egg._species = _species
    egg._isShiny = true
    egg._overrideHiddenAbility = true
    egg._eggMoveIndex = egg._eggMoveIndex === 0 ? 3: egg._eggMoveIndex
})
```

### 全部都色違
```javascript!
const eggs = Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.gameData.eggs
eggs.forEach((egg) => {
    egg.hatchWaves = 0
    egg._isShiny = true
    egg._overrideHiddenAbility = true
    egg._eggMoveIndex = egg._eggMoveIndex === 0 ? 3 : egg._eggMoveIndex
})
```

### 查看持有的道具
```
const items = []
const modifiers = Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.modifiers
modifiers.forEach((modifier) => {
    const { type: { localeKey } } = modifier
    // if (localeKey) return
    items.push(modifier.type.iconImage)
})
console.log(items)
```

### 調整持有道具的數量
```javascript
const modifiers = Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.modifiers
modifiers.forEach((modifier) => {
    const { type: { iconImage } } = modifier
    if (iconImage === "amulet_coin") modifier.stackCount = 30
    if (iconImage === "exp_share") modifier.stackCount = 30
    if (iconImage === "super_exp_charm") modifier.stackCount = 30
    if (iconImage === "exp_charm") modifier.stackCount = 30
    if (iconImage === "shell_bell") modifier.stackCount = 10
    if (iconImage === "berry_pouch") modifier.stackCount = 10
    if (iconImage === "wide_lens") modifier.stackCount = 10
    if (iconImage === "black_glasses") modifier.stackCount = 10
    if (iconImage === "exp_balance") modifier.stackCount = 10
    if (iconImage === "golden_punch") modifier.stackCount = 10
    if (iconImage === "soothe_bell") modifier.stackCount = 10
    if (iconImage === "candy_jar") modifier.stackCount = 30
    if (iconImage === "spell_tag") modifier.stackCount = 10
    if (iconImage === "soul_dew") modifier.stackCount = 10
    if (iconImage === "twisted_spoon") modifier.stackCount = 10
    if (iconImage === "healing_charm") modifier.stackCount = 30
    if (iconImage === "soft_sand") modifier.stackCount = 10
    if (iconImage === "zoom_lens") modifier.stackCount = 10
    if (iconImage === "ability_charm") modifier.stackCount = 30
    if (iconImage === "quick_claw") modifier.stackCount = 10
    if (iconImage === "mini_black_hole") modifier.stackCount = 10
    if (iconImage === "focus_band") modifier.stackCount = 10
    if (iconImage === "miracle_seed") modifier.stackCount = 10
    if (iconImage === "leftovers") modifier.stackCount = 10
    if (iconImage === "shiny_charm") modifier.stackCount = 30
    if (iconImage === "scope_lens") modifier.stackCount = 30
})
```

### 開夢特性
```javascript
const starter = Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.gameData.starterData[37] // 記得是六尾？
starter.abilityAttr = 2
```


### 改幸運值
```javascript
const active = Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys
        .battle.sys.updateList._active
active.forEach((element) => {
    if (!element.parentContainer) return
    if (!element.parentContainer.constructor) return
    if (element.parentContainer.constructor.name !== "PlayerPokemon") return
    const pokemon = element.parentContainer
    pokemon.luck = 100000
})
```

### 錢錢
```javascript!
Phaser.Display.Canvas.CanvasPool.pool[0].parent.game.scene.keys.battle.money = 1000000000
```