本文将详细介绍如何在 PokeRogue 游戏中通过浏览器开发者工具修改游戏数据。该方法适用于想获得更好游戏体验的玩家。
🎯 准备工作
- 使用 Chrome 或 Edge 浏览器打开 PokeRogue 官网
- 按 F12 键打开浏览器开发者工具
- 确保游戏已加载并可以正常游玩
🔧 修改步骤详解
第一步:定位关键文件
- 在开发者工具中,点击源代码标签
- 在左侧文件树中,展开 assets 目录
- 找到名为 battle-scene-CG56cFXL.js 的文件
- 点击该文件,在中央编辑区域打开源代码
第二步:设置断点
- 在打开的源代码文件中,按 Ctrl + F 打开搜索框
- 搜索 case I.ACTION(注意大小写和空格)
- 继续查找,直到找到第9个匹配结果
- 在第9个 case I.ACTION 所在行的行号左侧点击,设置断点
- 成功设置后,你会看到一个红色断点标记
第三步:触发断点
- 回到游戏界面,按 ESC 键打开菜单
- 选择并进入扭蛋机界面
- 使用键盘的左/右方向键切换不同的扭蛋机
- 此时游戏会暂停,进入断点,浏览器自动跳转到开发者工具界面
第四步:修改游戏数据
当断点触发后,在开发者工具中:
- 找到并点击 控制台 标签,输入下文中的代码
- 此处以修改扭蛋卷数量为例,输入
s.gameData.voucherCounts[0] = 10000; // 1抽券 s.gameData.voucherCounts[1] = 9999; // 5抽券 s.gameData.voucherCounts[2] = 9999; // 10抽券 s.gameData.voucherCounts[3] = 9999; // 25抽券
- 回车后看到9999,则表示修改成功
第五步:保存修改
- 点击之前设置的红色断点标记取消断点
- 按 F8 键或点击继续执行按钮让游戏恢复正常运行
📝 常用修改项目
修改扭蛋券数量
s.gameData.voucherCounts[0] = 10000; // 1抽券
s.gameData.voucherCounts[1] = 9999; // 5抽券
s.gameData.voucherCounts[2] = 9999; // 10抽券
s.gameData.voucherCounts[3] = 9999; // 25抽券
修改扭蛋数据
s.gameData.eggs.forEach(item => {
item.hatchWaves = 1; // 孵化剩余波次
item._tier = 3; // 稀有度:普通0,稀有1,史诗2,传说3
item._species = 0; // 宝可梦编号(0为随机),可以指定宝可梦
});
游戏对局修改
s.money = 100000000000; // 金钱数量
s.pokeballCounts[4] = 99; // 大师球数量
注意:以下道具至少持有一个才能修改
糖果罐修改
for(const h in s.modifiers) {
if (s.modifiers[h].type.id === 'CANDY_JAR') {
s.modifiers[h].stackCount = 99;
}
}
护符类修改
// 闪耀护符
for(const h in s.modifiers) {
if (s.modifiers[h].type.id === 'SHINY_CHARM') {
s.modifiers[h].stackCount = 4;
}
}
// 特性护符
for(const h in s.modifiers) {
if (s.modifiers[h].type.id === 'ABILITY_CHARM') {
s.modifiers[h].stackCount = 4;
}
}
// 捕获护符
for(const h in s.modifiers) {
if (s.modifiers[h].type.id === 'CATCHING_CHARM') {
s.modifiers[h].stackCount = 3;
}
}
图鉴修改
个别图鉴修改
const dex = [382, 383, 384]; // 图鉴编号(丰缘三神兽)
for (let h = 0; h < dex.length; h++) {
const index = dex[h];
s.gameData.starterData[index] = {
abilityAttr: 2, // 特性
candyCount: 100, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 100, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[index] = {
caughtAttr: 247n, // 捕获属性(确认闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 1, // 捕获次数
hatchedCount: 5, // 孵化次数
seenCount: 1, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
全图鉴黄闪修改
// 主图鉴(1-1025)
for (let h = 1; h <= 1025; h++) {
s.gameData.starterData[h] = {
abilityAttr: 7, // 特性
candyCount: 100, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 90, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[h] = {
caughtAttr: 159n, // 捕获属性(闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 0, // 捕获次数
hatchedCount: 1, // 孵化次数
seenCount: 3, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
// 特殊形态图鉴
const specialDex = [2019, 2020, 2026, 2027, 2028, 2037, 2038, 2050, 2051, 2052, 2053,
2074, 2075, 2076, 2088, 2089, 2103, 2105, 2670, 4052, 4077,
4078, 4079, 4080, 4083, 4110, 4122, 4144, 4145, 4146, 4199,
4222, 4263, 4264, 4554, 4555, 4562, 4618, 6058, 6059, 6100,
6101, 6157, 6211, 6215, 6503, 6549, 6570, 6571, 6628, 6705,
6706, 6713, 6724, 8128, 8194, 8901];
for (let h = 0; h < specialDex.length; h++) {
const index = specialDex[h];
s.gameData.starterData[index] = {
abilityAttr: 7, // 特性
candyCount: 100, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 90, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[index] = {
caughtAttr: 159n, // 捕获属性(闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 0, // 捕获次数
hatchedCount: 1, // 孵化次数
seenCount: 3, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
性别补正
公/无性别宝可梦
const maleDex = [890,382,383,384,493,888,1007,1008,150,249,250,483,484,487,644,646,716,717,718,798,800,802,803,889,887,898,381,385,386,486,490,491,789,786,721,720,719,648,641,642,645,795,801,806,984,987,1002,1004,1005,1009,1020,1021,1022,1023,145,146,243,244,245,377,379,482,492,494,638,639,640,647,649,785,787,793,794,796,797,799,805,807,808,894,895,896,988,989,990,991,992,993,994,1006,1010,1014,1015,1025,4144,4145,4146,144,151,251,378,480,481,772,788,880,882,893,985,986,995,1001,1016,489,881,883,999,1012,120,337,338,436,622,599,854,6100,132,100,343,703,201,1003,374,479,615,774,781,870,924,32,859];
for (let h = 0; h < maleDex.length; h++) {
const index = maleDex[h];
s.gameData.starterData[index] = {
abilityAttr: 7, // 特性
candyCount: 100, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 100, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[index] = {
caughtAttr: 151n, // 捕获属性(确认闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 0, // 捕获次数
hatchedCount: 3, // 孵化次数
seenCount: 1, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
仅有母的宝可梦
const femaleDex = [380,905,488,856,241,868,548,238,29,440,2670,669];
for (let h = 0; h < femaleDex.length; h++) {
const index = femaleDex[h];
s.gameData.starterData[index] = {
abilityAttr: 7, // 特性
candyCount: 100, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 100, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[index] = {
caughtAttr: 155n, // 捕获属性(确认闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 0, // 捕获次数
hatchedCount: 3, // 孵化次数
seenCount: 1, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
特性补正
公/无性别特性补正
const abilityMaleDex = [890,382,383,384,493,888,1007,1008,1024,646,644,643,716,717,718,798,800,802,803,889,897,491,490,386,385,381,898,648,719,720,721,789,1005,1004,1002,987,984,806,801,795,1009,1017,1020,1021,1022,1023,638,494,492,482,639,640,647,649,793,794,796,797,799,805,807,808,891,894,895,896,988,989,990,991,992,993,994,1003,1006,4146,4145,4144,1025,1010,151,251,480,481,772,1001,995,986,985,893,8901,92,489,479,615,679,633,774,776,778,781,999,200,338,337,562,570,676,692,736,741,775,877,875,874,948,963,4562,6570,343,433,455,746,4618,201,351,420];
for (let h = 0; h < abilityMaleDex.length; h++) {
const index = abilityMaleDex[h];
s.gameData.starterData[index] = {
abilityAttr: 1, // 特性
candyCount: 50, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 100, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[index] = {
caughtAttr: 151n, // 捕获属性(确认闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 0, // 捕获次数
hatchedCount: 3, // 孵化次数
seenCount: 1, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
母特性补正
const abilityFemaleDex = [380,488];
for (let h = 0; h < abilityFemaleDex.length; h++) {
const index = abilityFemaleDex[h];
s.gameData.starterData[index] = {
abilityAttr: 1, // 特性
candyCount: 100, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 100, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[index] = {
caughtAttr: 155n, // 捕获属性(确认闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 0, // 捕获次数
hatchedCount: 3, // 孵化次数
seenCount: 1, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
无尽模式专用红闪宝可梦
const endlessDex = [235,263,708,290,656];
for (let h = 0; h < endlessDex.length; h++) {
const index = endlessDex[h];
s.gameData.starterData[index] = {
abilityAttr: 7, // 特性
candyCount: 300, // 糖果数量
classicWinCount: 0, // 经典模式胜利场次
eggMoves: 15, // 遗传技能
friendship: 100, // 亲密度
passiveAttr: 3, // 被动
valueReduction: 2 // 减费
};
s.gameData.dexData[index] = {
caughtAttr: 255n, // 捕获属性(确认闪光)
ivs: [31, 31, 31, 31, 31, 31], // 个体值
seenAttr: 479n, // 遭遇属性
caughtCount: 0, // 捕获次数
hatchedCount: 3, // 孵化次数
seenCount: 1, // 遭遇次数
natureAttr: 67108862 // 性格
};
}
闪光颜色与性别对照表
闪光类型 | 公/无性别 | 仅母 | 性别全 |
---|---|---|---|
不闪 | 1n | - | - |
黄闪 | 151n | 155n | 159n |
蓝黄闪 | 183n | 187n | 191n |
红蓝黄 | 247n | 251n | 255n |
💡 注意事项
- 数据保存:修改后,建议进行一场战斗或抽取一次扭蛋,以确保数据正确保存到云端
- 适度修改:过度修改可能会降低游戏乐趣,建议根据个人需求适度调整
- 版本兼容:此方法针对 v1.10 版本,游戏更新后可能需要调整
- 风险提示:修改有极小概率导致数据异常,请谨慎操作
🆘 常见问题
Q: 找不到 battle-scene 文件怎么办?
A: 确保游戏已完全加载,可以尝试刷新页面后重新查找。
Q: 断点无法触发是怎么回事?
A: 检查是否在第9个 case I.ACTION
处设置断点,并确保在扭蛋机界面使用方向键切换。
Q: 修改后游戏卡住了怎么办?
A: 确保已取消断点并按 F8 继续执行,如仍卡住可尝试刷新页面。
本文转载自【宝可梦肉鸽】修改代码(v1.10)版本 - 哔哩哔哩,感谢作者的分享。
默认评论
Halo系统提供的评论