Update Equipment

This commit is contained in:
oc 2018-05-05 19:53:15 +08:00
parent 920fc35769
commit 2cc6ce49be
2 changed files with 351 additions and 189 deletions

View File

@ -14,19 +14,17 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.flags.bombFourDirections) if (core.flags.bombFourDirections)
core.material.items.bomb.text = "可以炸掉勇士四周的怪物"; core.material.items.bomb.text = "可以炸掉勇士四周的怪物";
if (core.flags.equipment) { if (core.flags.equipment) {
core.material.items.sword1 = {'cls': 'constants', 'name': '铁剑', 'text': '一把很普通的铁剑'}; core.material.items.sword1.cls = 'constants';
core.material.items.sword2 = {'cls': 'constants', 'name': '银剑', 'text': '一把很普通的银剑'}; core.material.items.sword2.cls = 'constants';
core.material.items.sword3 = {'cls': 'constants', 'name': '骑士剑', 'text': '一把很普通的骑士剑'}; core.material.items.sword3.cls = 'constants';
core.material.items.sword4 = {'cls': 'constants', 'name': '圣剑', 'text': '一把很普通的圣剑'}; core.material.items.sword4.cls = 'constants';
core.material.items.sword5 = {'cls': 'constants', 'name': '神圣剑', 'text': '一把很普通的神圣剑'}; core.material.items.sword5.cls = 'constants';
core.material.items.shield1 = {'cls': 'constants', 'name': '铁盾', 'text': '一个很普通的铁盾'}; core.material.items.shield1.cls = 'constants';
core.material.items.shield2 = {'cls': 'constants', 'name': '银盾', 'text': '一个很普通的银盾'}; core.material.items.shield2.cls = 'constants';
core.material.items.shield3 = {'cls': 'constants', 'name': '骑士盾', 'text': '一个很普通的骑士盾'}; core.material.items.shield3.cls = 'constants';
core.material.items.shield4 = {'cls': 'constants', 'name': '圣盾', 'text': '一个很普通的圣盾'}; core.material.items.shield4.cls = 'constants';
core.material.items.shield5 = {'cls': 'constants', 'name': '神圣盾', 'text': '一个很普通的神圣盾'}; core.material.items.shield5.cls = 'constants';
} }
}, },
////// 不同难度分别设置初始属性 ////// ////// 不同难度分别设置初始属性 //////
"setInitData":function (hard) { "setInitData":function (hard) {

View File

@ -1,120 +1,286 @@
items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
{ {
"items": {
"items" : { "yellowKey": {
// 钥匙 "cls": "keys",
'yellowKey': {'cls': 'keys', 'name': '黄钥匙'}, "name": "黄钥匙"
'blueKey': {'cls': 'keys', 'name': '蓝钥匙'}, },
'redKey': {'cls': 'keys', 'name': '红钥匙'}, "blueKey": {
"cls": "keys",
// 宝石、血瓶 "name": "蓝钥匙"
'redJewel': {'cls': 'items', 'name': '红宝石'}, },
'blueJewel': {'cls': 'items', 'name': '蓝宝石'}, "redKey": {
'greenJewel': {'cls': 'items', 'name': '绿宝石'}, "cls": "keys",
'yellowJewel': {'cls': 'items', 'name': '黄宝石'}, "name": "红钥匙"
'redPotion': {'cls': 'items', 'name': '红血瓶'}, },
'bluePotion': {'cls': 'items', 'name': '蓝血瓶'}, "redJewel": {
'yellowPotion': {'cls': 'items', 'name': '黄血瓶'}, "cls": "items",
'greenPotion': {'cls': 'items', 'name': '绿血瓶'}, "name": "红宝石"
'sword1': {'cls': 'items', 'name': '铁剑', 'isEquipment': true}, },
'sword2': {'cls': 'items', 'name': '银剑', 'isEquipment': true}, "blueJewel": {
'sword3': {'cls': 'items', 'name': '骑士剑', 'isEquipment': true}, "cls": "items",
'sword4': {'cls': 'items', 'name': '圣剑', 'isEquipment': true}, "name": "蓝宝石"
'sword5': {'cls': 'items', 'name': '神圣剑', 'isEquipment': true}, },
'shield1': {'cls': 'items', 'name': '铁盾', 'isEquipment': true}, "greenJewel": {
'shield2': {'cls': 'items', 'name': '银盾', 'isEquipment': true}, "cls": "items",
'shield3': {'cls': 'items', 'name': '骑士盾', 'isEquipment': true}, "name": "绿宝石"
'shield4': {'cls': 'items', 'name': '圣盾', 'isEquipment': true}, },
'shield5': {'cls': 'items', 'name': '神圣盾', 'isEquipment': true}, "yellowJewel": {
'superPotion': {'cls': 'items', 'name': '圣水'}, "cls": "items",
'moneyPocket': {'cls': 'items', 'name': '金钱袋'}, "name": "黄宝石"
},
// 物品 "redPotion": {
'sword0': {'cls': 'constants', 'name': '折断的剑', 'text': '没有任何作用的剑,相当于脱掉装备。'}, "cls": "items",
'shield0': {'cls': 'constants', 'name': '残破的盾', 'text': '没有任何作用的盾,相当于脱掉装备。'}, "name": "红血瓶"
'book': {'cls': 'constants', 'name': '怪物手册', 'text': '可以查看当前楼层各怪物属性'}, },
'fly': {'cls': 'constants', 'name': '楼层传送器', 'text': '可以自由往来去过的楼层'}, "bluePotion": {
'coin': {'cls': 'constants', 'name': '幸运金币', 'text': '持有时打败怪物可得双倍金币'}, "cls": "items",
'snow': {'cls': 'constants', 'name': '冰冻徽章', 'text': '可以将四周的熔岩变成平地'}, "name": "蓝血瓶"
'cross': {'cls': 'constants', 'name': '十字架', 'text': '持有后无视怪物的无敌属性'}, },
'knife': {'cls': 'constants', 'name': '屠龙匕首', 'text': '该道具尚未被定义'}, "yellowPotion": {
'shoes': {'cls': 'constants', 'name': '绿鞋', 'text': '持有时无视负面地形'}, "cls": "items",
"name": "黄血瓶"
// 道具 },
'bigKey': {'cls': 'tools', 'name': '大黄门钥匙', 'text': '可以开启当前层所有黄门'}, "greenPotion": {
'greenKey': {'cls': 'tools', 'name': '绿钥匙', 'text': '可以打开一扇绿门'}, "cls": "items",
'steelKey': {'cls': 'tools', 'name': '铁门钥匙', 'text': '可以打开一扇铁门'}, "name": "绿血瓶"
'pickaxe': {'cls': 'tools', 'name': '破墙镐', 'text': '可以破坏勇士面前的墙'}, },
'icePickaxe': {'cls': 'tools', 'name': '破冰镐', 'text': '可以破坏勇士面前的一堵冰墙'}, "sword1": {
'bomb': {'cls': 'tools', 'name': '炸弹', 'text': '可以炸掉勇士面前的怪物'}, "cls": "items",
'centerFly': {'cls': 'tools', 'name': '中心对称飞行器', 'text': '可以飞向当前楼层中心对称的位置'}, "name": "铁剑",
'upFly': {'cls': 'tools', 'name': '上楼器', 'text': '可以飞往楼上的相同位置'}, "isEquipment": true,
'downFly': {'cls': 'tools', 'name': '下楼器', 'text': '可以飞往楼下的相同位置'}, "text": "一把很普通的铁剑"
'earthquake': {'cls': 'tools', 'name': '地震卷轴', 'text': '可以破坏当前层的所有墙'}, },
'poisonWine': {'cls': 'tools', 'name': '解毒药水', 'text': '可以解除中毒状态'}, "sword2": {
'weakWine': {'cls': 'tools', 'name': '解衰药水', 'text': '可以解除衰弱状态'}, "cls": "items",
'curseWine': {'cls': 'tools', 'name': '解咒药水', 'text': '可以解除诅咒状态'}, "name": "银剑",
'superWine': {'cls': 'tools', 'name': '万能药水', 'text': '可以解除所有不良状态'}, "isEquipment": true,
'hammer': {'cls': 'tools', 'name': '圣锤', 'text': '可以炸掉勇士面前的怪物'} "text": "一把很普通的银剑"
}, },
"sword3": {
"cls": "items",
"name": "骑士剑",
"isEquipment": true,
"itemEffect" : { "text": "一把很普通的骑士剑"
"redJewel":"core.status.hero.atk += core.values.redJewel * ratio", },
"blueJewel":"core.status.hero.def += core.values.blueJewel * ratio", "sword4": {
"greenJewel":"core.status.hero.mdef += core.values.greenJewel * ratio", "cls": "items",
"name": "圣剑",
"yellowJewel":"core.status.hero.hp+=1000;core.status.hero.atk+=6;core.status.hero.def+=6;core.status.hero.mdef+=10;", "isEquipment": true,
// 黄宝石属性:需自己定义 "text": "一把很普通的圣剑"
"redPotion":"core.status.hero.hp += core.values.redPotion * ratio", },
"bluePotion":"core.status.hero.hp += core.values.bluePotion * ratio", "sword5": {
"yellowPotion":"core.status.hero.hp += core.values.yellowPotion * ratio", "cls": "items",
"greenPotion":"core.status.hero.hp += core.values.greenPotion * ratio", "name": "神圣剑",
"sword1":"core.status.hero.atk += core.values.sword1", "isEquipment": true,
"sword2":"core.status.hero.atk += core.values.sword2", "text": "一把很普通的神圣剑"
"sword3":"core.status.hero.atk += core.values.sword3", },
"sword4":"core.status.hero.atk += core.values.sword4", "shield1": {
"sword5":"core.status.hero.atk += core.values.sword5", "cls": "items",
"shield1":"core.status.hero.def += core.values.shield1", "name": "铁盾",
"shield2":"core.status.hero.def += core.values.shield2", "isEquipment": true,
"shield3":"core.status.hero.def += core.values.shield3", "text": "一个很普通的铁盾"
"shield4":"core.status.hero.def += core.values.shield4", },
"shield5":"core.status.hero.def += core.values.shield5", "shield2": {
"cls": "items",
"bigKey":"core.status.hero.items.keys.yellowKey++;core.status.hero.items.keys.blueKey++;core.status.hero.items.keys.redKey++;", "name": "银盾",
// 只有是钥匙盒才会执行这一步 "isEquipment": true,
"superPotion":"core.status.hero.hp *= 2", "text": "一个很普通的银盾"
"moneyPocket":"core.status.hero.money += core.values.moneyPocket", },
}, "shield3": {
"cls": "items",
"name": "骑士盾",
"itemEffectTip" : { "isEquipment": true,
"redJewel":"',攻击+'+core.values.redJewel * ratio", "text": "一个很普通的骑士盾"
"blueJewel":"',防御+'+core.values.blueJewel * ratio", },
"greenJewel":"',魔防+'+core.values.greenJewel * ratio", "shield4": {
"yellowJewel":"',全属性提升'", "cls": "items",
"redPotion":"',生命+'+core.values.redPotion * ratio", "name": "圣盾",
"bluePotion":"',生命+'+core.values.bluePotion * ratio", "isEquipment": true,
"yellowPotion":"',生命+'+core.values.yellowPotion * ratio", "text": "一个很普通的圣盾"
"greenPotion":"',生命+'+core.values.greenPotion * ratio", },
"sword1":"',攻击+'+core.values.sword1", "shield5": {
"sword2":"',攻击+'+core.values.sword2", "cls": "items",
"sword3":"',攻击+'+core.values.sword3", "name": "神圣盾",
"sword4":"',攻击+'+core.values.sword4", "isEquipment": true,
"sword5":"',攻击+'+core.values.sword5", "text": "一个很普通的神圣盾"
"shield1":"',防御+'+core.values.shield1", },
"shield2":"',防御+'+core.values.shield2", "superPotion": {
"shield3":"',防御+'+core.values.shield3", "cls": "items",
"shield4":"',防御+'+core.values.shield4", "name": "圣水"
"shield5":"',防御+'+core.values.shield5", },
"bigKey":"',全钥匙+1'", "moneyPocket": {
"superPotion":"',生命值翻倍'", "cls": "items",
"moneyPocket":"',金币+'+core.values.moneyPocket", "name": "金钱袋"
}, },
"sword0": {
"useItemEffect": { "cls": "constants",
"name": "折断的剑",
"text": "没有任何作用的剑,相当于脱掉装备。"
},
"shield0": {
"cls": "constants",
"name": "残破的盾",
"text": "没有任何作用的盾,相当于脱掉装备。"
},
"book": {
"cls": "constants",
"name": "怪物手册",
"text": "可以查看当前楼层各怪物属性"
},
"fly": {
"cls": "constants",
"name": "楼层传送器",
"text": "可以自由往来去过的楼层"
},
"coin": {
"cls": "constants",
"name": "幸运金币",
"text": "持有时打败怪物可得双倍金币"
},
"snow": {
"cls": "constants",
"name": "冰冻徽章",
"text": "可以将四周的熔岩变成平地"
},
"cross": {
"cls": "constants",
"name": "十字架",
"text": "持有后无视怪物的无敌属性"
},
"knife": {
"cls": "constants",
"name": "屠龙匕首",
"text": "该道具尚未被定义"
},
"shoes": {
"cls": "constants",
"name": "绿鞋",
"text": "持有时无视负面地形"
},
"bigKey": {
"cls": "tools",
"name": "大黄门钥匙",
"text": "可以开启当前层所有黄门"
},
"greenKey": {
"cls": "tools",
"name": "绿钥匙",
"text": "可以打开一扇绿门"
},
"steelKey": {
"cls": "tools",
"name": "铁门钥匙",
"text": "可以打开一扇铁门"
},
"pickaxe": {
"cls": "tools",
"name": "破墙镐",
"text": "可以破坏勇士面前的墙"
},
"icePickaxe": {
"cls": "tools",
"name": "破冰镐",
"text": "可以破坏勇士面前的一堵冰墙"
},
"bomb": {
"cls": "tools",
"name": "炸弹",
"text": "可以炸掉勇士面前的怪物"
},
"centerFly": {
"cls": "tools",
"name": "中心对称飞行器",
"text": "可以飞向当前楼层中心对称的位置"
},
"upFly": {
"cls": "tools",
"name": "上楼器",
"text": "可以飞往楼上的相同位置"
},
"downFly": {
"cls": "tools",
"name": "下楼器",
"text": "可以飞往楼下的相同位置"
},
"earthquake": {
"cls": "tools",
"name": "地震卷轴",
"text": "可以破坏当前层的所有墙"
},
"poisonWine": {
"cls": "tools",
"name": "解毒药水",
"text": "可以解除中毒状态"
},
"weakWine": {
"cls": "tools",
"name": "解衰药水",
"text": "可以解除衰弱状态"
},
"curseWine": {
"cls": "tools",
"name": "解咒药水",
"text": "可以解除诅咒状态"
},
"superWine": {
"cls": "tools",
"name": "万能药水",
"text": "可以解除所有不良状态"
},
"hammer": {
"cls": "tools",
"name": "圣锤",
"text": "可以炸掉勇士面前的怪物"
}
},
"itemEffect": {
"redJewel": "core.status.hero.atk += core.values.redJewel * ratio",
"blueJewel": "core.status.hero.def += core.values.blueJewel * ratio",
"greenJewel": "core.status.hero.mdef += core.values.greenJewel * ratio",
"yellowJewel": "core.status.hero.hp+=1000;core.status.hero.atk+=6;core.status.hero.def+=6;core.status.hero.mdef+=10;",
"redPotion": "core.status.hero.hp += core.values.redPotion * ratio",
"bluePotion": "core.status.hero.hp += core.values.bluePotion * ratio",
"yellowPotion": "core.status.hero.hp += core.values.yellowPotion * ratio",
"greenPotion": "core.status.hero.hp += core.values.greenPotion * ratio",
"sword1": "core.status.hero.atk += core.values.sword1",
"sword2": "core.status.hero.atk += core.values.sword2",
"sword3": "core.status.hero.atk += core.values.sword3",
"sword4": "core.status.hero.atk += core.values.sword4",
"sword5": "core.status.hero.atk += core.values.sword5",
"shield1": "core.status.hero.def += core.values.shield1",
"shield2": "core.status.hero.def += core.values.shield2",
"shield3": "core.status.hero.def += core.values.shield3",
"shield4": "core.status.hero.def += core.values.shield4",
"shield5": "core.status.hero.def += core.values.shield5",
"bigKey": "core.status.hero.items.keys.yellowKey++;core.status.hero.items.keys.blueKey++;core.status.hero.items.keys.redKey++;",
"superPotion": "core.status.hero.hp *= 2",
"moneyPocket": "core.status.hero.money += core.values.moneyPocket"
},
"itemEffectTip": {
"redJewel": "',攻击+'+core.values.redJewel * ratio",
"blueJewel": "',防御+'+core.values.blueJewel * ratio",
"greenJewel": "',魔防+'+core.values.greenJewel * ratio",
"yellowJewel": "',全属性提升'",
"redPotion": "',生命+'+core.values.redPotion * ratio",
"bluePotion": "',生命+'+core.values.bluePotion * ratio",
"yellowPotion": "',生命+'+core.values.yellowPotion * ratio",
"greenPotion": "',生命+'+core.values.greenPotion * ratio",
"sword1": "',攻击+'+core.values.sword1",
"sword2": "',攻击+'+core.values.sword2",
"sword3": "',攻击+'+core.values.sword3",
"sword4": "',攻击+'+core.values.sword4",
"sword5": "',攻击+'+core.values.sword5",
"shield1": "',防御+'+core.values.shield1",
"shield2": "',防御+'+core.values.shield2",
"shield3": "',防御+'+core.values.shield3",
"shield4": "',防御+'+core.values.shield4",
"shield5": "',防御+'+core.values.shield5",
"bigKey": "',全钥匙+1'",
"superPotion": "',生命值翻倍'",
"moneyPocket": "',金币+'+core.values.moneyPocket"
},
"useItemEffect": {
"book": "core.ui.drawBook(0);", "book": "core.ui.drawBook(0);",
"fly": "core.ui.drawFly(core.status.hero.flyRange.indexOf(core.status.floorId));", "fly": "core.ui.drawFly(core.status.hero.flyRange.indexOf(core.status.floorId));",
"earthquake": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});", "earthquake": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
@ -142,10 +308,9 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"shield2": "core.plugin.useEquipment(itemId)", "shield2": "core.plugin.useEquipment(itemId)",
"shield3": "core.plugin.useEquipment(itemId)", "shield3": "core.plugin.useEquipment(itemId)",
"shield4": "core.plugin.useEquipment(itemId)", "shield4": "core.plugin.useEquipment(itemId)",
"shield5": "core.plugin.useEquipment(itemId)", "shield5": "core.plugin.useEquipment(itemId)"
}, },
"canUseItemEffect": {
"canUseItemEffect": {
"book": "true", "book": "true",
"fly": "core.status.hero.flyRange.indexOf(core.status.floorId)>=0", "fly": "core.status.hero.flyRange.indexOf(core.status.floorId)>=0",
"pickaxe": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) &&\n (block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) // 能破哪些墙\n {\n // 四个方向\n if (core.flags.pickaxeFourDirections) {\n if (Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n ids.push(i);\n }\n }\n else {\n if (block.x == core.nextX() && block.y == core.nextY()) {\n ids.push(i);\n }\n }\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable", "pickaxe": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) &&\n (block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) // 能破哪些墙\n {\n // 四个方向\n if (core.flags.pickaxeFourDirections) {\n if (Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n ids.push(i);\n }\n }\n else {\n if (block.x == core.nextX() && block.y == core.nextY()) {\n ids.push(i);\n }\n }\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
@ -174,7 +339,6 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"shield3": "true", "shield3": "true",
"shield4": "true", "shield4": "true",
"shiled5": "true", "shiled5": "true",
"shield5": "true"
} }
} }