weakValue

This commit is contained in:
oc 2018-12-08 20:16:26 +08:00
parent ae720ee477
commit 3e1220c350
3 changed files with 22 additions and 19 deletions

View File

@ -1884,13 +1884,14 @@ events.prototype.passNet = function (data) {
if (data.event.id=='weakNet') { // 衰网 if (data.event.id=='weakNet') { // 衰网
if (core.hasFlag('weak')) return; if (core.hasFlag('weak')) return;
core.setFlag('weak', true); core.setFlag('weak', true);
var weakValue = core.values.weakValue; if (core.values.weakValue>=1) { // >=1直接扣数值
var weakAtk = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.atk); core.status.hero.atk -= core.values.weakValue;
var weakDef = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.def); core.status.hero.def -= core.values.weakValue;
core.setFlag('weakAtk', weakAtk); }
core.setFlag('weakDef', weakDef); else { // <1扣比例
core.status.hero.atk-=weakAtk; core.setFlag("equip_atk_buff", core.getFlag("equip_atk_buff", 1) + core.values.weakValue - 1);
core.status.hero.def-=weakDef; core.setFlag("equip_def_buff", core.getFlag("equip_def_buff", 1) + core.values.weakValue - 1);
}
} }
if (data.event.id=='curseNet') { // 咒网 if (data.event.id=='curseNet') { // 咒网
if (core.hasFlag('curse')) return; if (core.hasFlag('curse')) return;

View File

@ -179,13 +179,14 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 衰弱 // 衰弱
if (core.enemys.hasSpecial(special, 13) && !core.hasFlag('weak')) { if (core.enemys.hasSpecial(special, 13) && !core.hasFlag('weak')) {
core.setFlag('weak', true); core.setFlag('weak', true);
var weakValue = core.values.weakValue; if (core.values.weakValue>=1) { // >=1直接扣数值
var weakAtk = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.atk); core.status.hero.atk -= core.values.weakValue;
var weakDef = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.def); core.status.hero.def -= core.values.weakValue;
core.setFlag('weakAtk', weakAtk); }
core.setFlag('weakDef', weakDef); else { // <1扣比例
core.status.hero.atk-=weakAtk; core.setFlag("equip_atk_buff", core.getFlag("equip_atk_buff", 1) + core.values.weakValue - 1);
core.status.hero.def-=weakDef; core.setFlag("equip_def_buff", core.getFlag("equip_def_buff", 1) + core.values.weakValue - 1);
}
} }
// 诅咒 // 诅咒
if (core.enemys.hasSpecial(special, 14) && !core.hasFlag('curse')) { if (core.enemys.hasSpecial(special, 14) && !core.hasFlag('curse')) {

View File

@ -1,4 +1,4 @@
var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
{ {
"items": { "items": {
"yellowKey": { "yellowKey": {
@ -301,7 +301,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "constants", "cls": "constants",
"name": "技能:二倍斩", "name": "技能:二倍斩",
"text": "可以打开或关闭主动技能二倍斩", "text": "可以打开或关闭主动技能二倍斩",
"hideInReplay": true "hideInReplay": true
} }
}, },
"itemEffect": { "itemEffect": {
@ -368,9 +368,9 @@ var 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\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.replay();\n});", "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\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.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\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.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\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.replay();\n});",
"poisonWine": "core.removeFlag('poison');", "poisonWine": "core.removeFlag('poison');",
"weakWine": "core.removeFlag('weak');\ncore.status.hero.atk += core.getFlag('weakAtk', core.values.weakValue);\ncore.status.hero.def += core.getFlag('weakDef', core.values.weakValue);", "weakWine": "core.removeFlag('weak');\nif (core.values.weakValue>=1) { // >=1直接扣数值\n\tcore.status.hero.atk += core.values.weakValue;\n\tcore.status.hero.def += core.values.weakValue;\n}\nelse { // <1扣比例\n\tcore.setFlag(\"equip_atk_buff\", core.getFlag(\"equip_atk_buff\", 1) - core.values.weakValue + 1);\n\tcore.setFlag(\"equip_def_buff\", core.getFlag(\"equip_def_buff\", 1) - core.values.weakValue + 1);\n}",
"curseWine": "core.removeFlag('curse');", "curseWine": "core.removeFlag('curse');",
"superWine": "core.removeFlag('poison');\nif (core.hasFlag('weak')) {\n\tcore.removeFlag('weak');\n\tcore.status.hero.atk += core.getFlag('weakAtk', core.values.weakValue);\n\tcore.status.hero.def += core.getFlag('weakDef', core.values.weakValue);\n}\ncore.removeFlag('curse');", "superWine": "core.removeFlag('poison');\nif (core.hasFlag('weak')) {\n\tcore.removeFlag('weak');\n\tif (core.values.weakValue>=1) { // >=1直接扣数值\n\t\tcore.status.hero.atk += core.values.weakValue;\n\t\tcore.status.hero.def += core.values.weakValue;\n\t}\n\telse { // <1扣比例\n\t\tcore.setFlag(\"equip_atk_buff\", core.getFlag(\"equip_atk_buff\", 1) - core.values.weakValue + 1);\n\t\tcore.setFlag(\"equip_def_buff\", core.getFlag(\"equip_def_buff\", 1) - core.values.weakValue + 1);\n\t}\n}\ncore.removeFlag('curse');",
"lifeWand": "core.insertAction([\n\t{\"type\": \"input\", \"text\": \"请输入生命魔杖使用次数:(0-${item:lifeWand})\"},\n\t{\"type\": \"if\", \"condition\": \"flag:input<=item:lifeWand\",\n\t\t\"true\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"item:lifeWand\", \"value\": \"item:lifeWand-flag:input\"},\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:hp\", \"value\": \"status:hp+flag:input*100\"},\n\t\t\t\"成功使用${flag:input}次生命魔杖,恢复${flag:input*100}点生命。\"\n\t\t],\n\t\t\"false\": [\"输入不合法!\"]\n\t},\n]);\ncore.addItem('lifeWand', 1);", "lifeWand": "core.insertAction([\n\t{\"type\": \"input\", \"text\": \"请输入生命魔杖使用次数:(0-${item:lifeWand})\"},\n\t{\"type\": \"if\", \"condition\": \"flag:input<=item:lifeWand\",\n\t\t\"true\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"item:lifeWand\", \"value\": \"item:lifeWand-flag:input\"},\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:hp\", \"value\": \"status:hp+flag:input*100\"},\n\t\t\t\"成功使用${flag:input}次生命魔杖,恢复${flag:input*100}点生命。\"\n\t\t],\n\t\t\"false\": [\"输入不合法!\"]\n\t},\n]);\ncore.addItem('lifeWand', 1);",
"jumpShoes": "core.insertAction({\"type\":\"jumpHero\",\"loc\":[core.nextX(2),core.nextY(2)]});", "jumpShoes": "core.insertAction({\"type\":\"jumpHero\",\"loc\":[core.nextX(2),core.nextY(2)]});",
"redPotion": "core.status.hero.hp += core.values.redPotion", "redPotion": "core.status.hero.hp += core.values.redPotion",
@ -411,5 +411,6 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"greenJewel": "true", "greenJewel": "true",
"yellowJewel": "true", "yellowJewel": "true",
"skill1": "true" "skill1": "true"
} },
"canEquip": {}
} }