诚心请教各位大大, 如何将下图的参数曲线
'use strict'; // 要更改的职业IDlet classId = 1; /* * 要更改的属性ID * * mhp 0 * mmp 1 * atk 2 * def 3 * mat 4 * mdf 5 * agi 6 * luk 7 */let paramId = 0; function getParam(originalParam, lv) { if (lv === 0) return originalParam; return Math.floor( // 在这里写下公式 -lv * lv + lv * 100 );} const fs = require('fs');const path = require('path'); let dataPath = path.resolve(location.pathname.slice(1), '../data/Classes.json');let data = require(dataPath);let params = data[classId].params;params[paramId] = params[paramId].map(getParam); fs.writeFileSync(dataPath, JSON.stringify(data)); alert('设置成功,请重启MV以查看效果'); window.close();
'use strict'; // 要更改的职业ID let classId = 1; /* * 要更改的属性ID * * mhp 0 * mmp 1 * atk 2 * def 3 * mat 4 * mdf 5 * agi 6 * luk 7 */ let paramId = 0; function getParam(originalParam, lv) { if (lv === 0) return originalParam; return Math.floor( // 在这里写下公式 -lv * lv + lv * 100 ); } const fs = require('fs'); const path = require('path'); let dataPath = path.resolve(location.pathname.slice(1), '../data/Classes.json'); let data = require(dataPath); let params = data[classId].params; params[paramId] = params[paramId].map(getParam); fs.writeFileSync(dataPath, JSON.stringify(data)); alert('设置成功,请重启MV以查看效果'); window.close();
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-2 09:21
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.