1 Star 1 Fork 3

邓广元/MiniTES

forked from 锅巴汉化/MiniTES 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
grinding.js 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
zhaolinxu 提交于 2019-03-07 18:00 . 源码
function grind (grindSpeed, itemDropChance, itemDropVariableName, skillLevelRequirementToEnter, skillRequiredToEnter, skill, text, lockedText) {
// Check if the player can enter the grinding zone..
if (skillRequiredToEnter == "") { var enter = true; }
if (cow[skillRequiredToEnter] >= skillLevelRequirementToEnter) { var enter = true; }
// If yes, then grind..
if (enter == true) {
writeConsole (text);
if (cow.itemDropRNG < itemDropChance && itemDropVariableName != "") { addItemDropToInventory (itemDropVariableName); }
cow[skill+'XP'] += grindSpeed;
cow.currentImprovingSkill = skill;
} else {
// Otherwise, activate the skillgate lock ..
writeConsole (lockedText);
cow.currentImprovingSkill = "invis";
}
// And then refresh the RNG
cow.masterGamestateVariable = "refreshRNGNow";
}
function waitForSomethingIngame (turnsToWait, respawnLocation, text, doneText) {
// initialize
if (cow.masterGamestateVariable == "startingAnEvent") {
// document.getElementById('textCurrentMap').innerHTML = cow.currentMap; // unnecessary?
cow.currentImprovingSkill = "invis";
cow.waitCounter = 0;
cow.masterGamestateVariable = "waiting";
}
// wait...
if (cow.masterGamestateVariable == "waiting") {
if (cow.waitCounter < turnsToWait) { writeConsole (text + ' (' + Math.floor((cow.waitCounter/turnsToWait)*100) + '%)'); }
else { writeConsole (doneText); }
cow.waitCounter++;
if (cow.currentMap == "resting") {cow.medicXP += 0.8; cow.currentImprovingSkill = "medic"; }
if (cow.currentMap == "travelling") {cow.athleteXP += 1.2; cow.currentImprovingSkill = "athlete"; }
}
// end
if (cow.waitCounter > turnsToWait) {
cow.currentMap = respawnLocation;
cow.hp = cow.maxHP;
cow.masterGamestateVariable = "refreshRNGNow";
updateMainTextSpans();
unlockAllTabsExceptMain();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/deng-guangyuan/MiniTES.git
[email protected]:deng-guangyuan/MiniTES.git
deng-guangyuan
MiniTES
MiniTES
master

搜索帮助