Weak percentage

This commit is contained in:
oc 2018-05-08 00:54:54 +08:00
parent 0bbb748c7a
commit 01860884a1
5 changed files with 24 additions and 11 deletions

View File

@ -233,7 +233,7 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"weakValue": {
"_leaf": true,
"_type": "textarea",
"_data": "衰弱状态下攻防减少的数值"
"_data": "衰弱状态下攻防减少的数值\n如果此项不小于1则作为实际下降的数值比如10就是攻防各下降10\n如果在0到1之间则为下降的比例比如0.3就是下降30%的攻防)"
},
"redJewel": {
"_leaf": true,

View File

@ -1286,8 +1286,13 @@ events.prototype.passNet = function (data) {
if (data.event.id=='weakNet') { // 衰网
if (core.hasFlag('weak')) return;
core.setFlag('weak', true);
core.status.hero.atk-=core.values.weakValue;
core.status.hero.def-=core.values.weakValue;
var weakValue = core.status.weakValue;
var weakAtk = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.atk);
var weakDef = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.def);
core.setFlag('weakAtk', weakAtk);
core.setFlag('weakDef', weakDef);
core.status.hero.atk-=weakAtk;
core.status.hero.def-=weakDef;
}
if (data.event.id=='curseNet') { // 咒网
if (core.hasFlag('curse')) return;

View File

@ -170,10 +170,13 @@ utils.prototype.setTwoDigits = function (x) {
}
utils.prototype.formatBigNumber = function (x) {
x = parseFloat(x);
x = Math.floor(parseFloat(x));
if (!core.isset(x)) return '???';
if (x<=999999) return x;
var c = x<0?"-":"";
x = Math.abs(x);
if (x<=999999) return c + x;
var all = [
{"val": 1e20, "c": "g"},
@ -187,11 +190,11 @@ utils.prototype.formatBigNumber = function (x) {
var one = all[i];
if (x>=10*one.val) {
var v = x/one.val;
return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
return c + v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
}
}
return x;
return c+x;
}
////// 数组转RGB //////

View File

@ -155,8 +155,13 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 衰弱
if (core.enemys.hasSpecial(special, 13) && !core.hasFlag('weak')) {
core.setFlag('weak', true);
core.status.hero.atk-=core.values.weakValue;
core.status.hero.def-=core.values.weakValue;
var weakValue = core.status.weakValue;
var weakAtk = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.atk);
var weakDef = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.def);
core.setFlag('weakAtk', weakAtk);
core.setFlag('weakDef', weakDef);
core.status.hero.atk-=weakAtk;
core.status.hero.def-=weakDef;
}
// 诅咒
if (core.enemys.hasSpecial(special, 14) && !core.hasFlag('curse')) {

View File

@ -284,9 +284,9 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"upFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.replay();\n});",
"downFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.replay();\n});",
"poisonWine": "core.setFlag('poison', false);",
"weakWine": "core.setFlag('weak', false);\ncore.status.hero.atk += core.values.weakValue;\ncore.status.hero.def += core.values.weakValue;",
"weakWine": "core.setFlag('weak', false);\ncore.status.hero.atk += core.getFlag('weakAtk', core.values.weakValue);\ncore.status.hero.def += core.getFlag('weakDef', core.values.weakValue);",
"curseWine": "core.setFlag('curse', false);",
"superWine": "core.setFlag('poison', false);\nif (core.hasFlag('weak')) {\n core.setFlag('weak', false);\n core.status.hero.atk += core.values.weakValue;\n core.status.hero.def += core.values.weakValue;\n}\ncore.setFlag('curse', false);",
"superWine": "core.setFlag('poison', false);\nif (core.hasFlag('weak')) {\n core.setFlag('weak', false);\n core.status.hero.atk += core.getFlag('weakAtk', core.values.weakValue);\n core.status.hero.def += core.getFlag('weakDef', core.values.weakValue);\n}\ncore.setFlag('curse', false);",
"sword0": "core.plugin.useEquipment(itemId)",
"sword1": "core.plugin.useEquipment(itemId)",
"sword2": "core.plugin.useEquipment(itemId)",