Equipment
This commit is contained in:
parent
d5a396fc89
commit
1213a32cc5
BIN
images/items.png
BIN
images/items.png
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 35 KiB |
@ -121,6 +121,8 @@ data.prototype.init = function() {
|
||||
"bluePotion": 250, // 蓝血瓶加血数值
|
||||
"yellowPotion": 500, // 黄血瓶加血数值
|
||||
"greenPotion": 800, // 绿血瓶加血数值
|
||||
"sword0": 0, // 默认装备折断的剑的攻击力
|
||||
"shield0": 0, // 默认装备残破的盾的防御力
|
||||
"sword1": 10, // 铁剑加攻数值
|
||||
"shield1": 10, // 铁盾加防数值
|
||||
"sword2": 20, // 银剑加攻数值
|
||||
@ -156,8 +158,10 @@ data.prototype.init = function() {
|
||||
"pickaxeFourDirections": true, // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁
|
||||
"bombFourDirections": true, // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价)
|
||||
"bigKeyIsBox": false, // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙
|
||||
"equipment": false, // 剑和盾是否直接作为装备。如果此项为true,则作为装备,需要在道具栏使用,否则将直接加属性。
|
||||
/****** 怪物相关 ******/
|
||||
"enableNegativeDamage": true, // 是否支持负伤害(回血)
|
||||
"hatredDecrease": true, // 是否在和仇恨怪战斗后减一半的仇恨值,此项为false则和仇恨怪不会扣减仇恨值。
|
||||
"betweenAttackCeil": false, // 夹击方式是向上取整还是向下取整。如果此项为true则为向上取整,为false则为向下取整
|
||||
/****** 系统相关 ******/
|
||||
"startDirectly": false, // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面
|
||||
|
||||
@ -142,7 +142,7 @@ enemys.prototype.getSpecialHint = function (enemy, special) {
|
||||
case 14: return "诅咒:战斗后,勇士陷入诅咒状态,战斗无法获得金币和经验";
|
||||
case 15: return "领域:经过怪物周围"+(enemy.range||1)+"格时自动减生命"+enemy.value+"点";
|
||||
case 16: return "夹击:经过两只相同的怪物中间,勇士生命值变成一半";
|
||||
case 17: return "仇恨:战斗前,怪物附加之前积累的仇恨值作为伤害;战斗后,释放一半的仇恨值。(每杀死一个怪物获得"+core.values.hatred+"点仇恨值)";
|
||||
case 17: return "仇恨:战斗前,怪物附加之前积累的仇恨值作为伤害"+(core.flags.hatredDecrease?";战斗后,释放一半的仇恨值":"")+"。(每杀死一个怪物获得"+core.values.hatred+"点仇恨值)";
|
||||
case 18: return "阻击:经过怪物的十字领域时自动减生命"+enemy.value+"点,同时怪物后退一格";
|
||||
case 19: return "自爆:战斗后勇士的生命值变成1";
|
||||
case 20: return "无敌:勇士无法打败怪物,除非拥有十字架";
|
||||
|
||||
@ -706,7 +706,7 @@ events.prototype.afterBattle = function(enemyId,x,y,callback) {
|
||||
core.setFlag('curse', true);
|
||||
}
|
||||
// 仇恨属性:减半
|
||||
if (core.enemys.hasSpecial(special, 17)) {
|
||||
if (core.flags.hatredDecrease && core.enemys.hasSpecial(special, 17)) {
|
||||
core.setFlag('hatred', parseInt(core.getFlag('hatred', 0)/2));
|
||||
}
|
||||
// 自爆
|
||||
|
||||
@ -178,11 +178,13 @@ icons.prototype.init = function () {
|
||||
'bluePotion': 21,
|
||||
'greenPotion': 22,
|
||||
'yellowPotion': 23,
|
||||
'sword0': 60,
|
||||
'sword1': 50,
|
||||
'sword2': 51,
|
||||
'sword3': 52,
|
||||
'sword4': 53,
|
||||
'sword5': 54,
|
||||
'shield0': 61,
|
||||
'shield1': 55,
|
||||
'shield2': 56,
|
||||
'shield3': 57,
|
||||
|
||||
@ -33,6 +33,8 @@ items.prototype.init = function () {
|
||||
'moneyPocket': {'cls': 'items', 'name': '金钱袋'},
|
||||
|
||||
// 物品
|
||||
'sword0': {'cls': 'constants', 'name': '折断的剑', 'text': '没有任何作用的剑,相当于脱掉装备。'},
|
||||
'shield0': {'cls': 'constants', 'name': '残破的盾', 'text': '没有任何作用的盾,相当于脱掉装备。'},
|
||||
'book': {'cls': 'constants', 'name': '怪物手册', 'text': '可以查看当前楼层各怪物属性'},
|
||||
'fly': {'cls': 'constants', 'name': '楼层传送器', 'text': '可以自由往来去过的楼层'},
|
||||
'coin': {'cls': 'constants', 'name': '幸运金币', 'text': '持有时打败怪物可得双倍金币'},
|
||||
@ -70,6 +72,19 @@ items.prototype.getItems = function () {
|
||||
this.items.pickaxe.text = "可以破坏勇士四周的墙";
|
||||
if (core.flags.bombFourDirections)
|
||||
this.items.bomb.text = "可以炸掉勇士四周的怪物";
|
||||
if (core.flags.equipment) {
|
||||
this.items.sword1 = {'cls': 'constants', 'name': '铁剑', 'text': '一把很普通的铁剑,攻击+'+core.values.sword1};
|
||||
this.items.sword2 = {'cls': 'constants', 'name': '银剑', 'text': '一把很普通的银剑,攻击+'+core.values.sword2};
|
||||
this.items.sword3 = {'cls': 'constants', 'name': '骑士剑', 'text': '一把很普通的骑士剑,攻击+'+core.values.sword3};
|
||||
this.items.sword4 = {'cls': 'constants', 'name': '圣剑', 'text': '一把很普通的圣剑,攻击+'+core.values.sword4};
|
||||
this.items.sword5 = {'cls': 'constants', 'name': '神圣剑', 'text': '一把很普通的神圣剑,攻击+'+core.values.sword5};
|
||||
this.items.shield1 = {'cls': 'constants', 'name': '铁盾', 'text': '一个很普通的铁盾,防御+'+core.values.shield1};
|
||||
this.items.shield2 = {'cls': 'constants', 'name': '银盾', 'text': '一个很普通的银盾,防御+'+core.values.shield2};
|
||||
this.items.shield3 = {'cls': 'constants', 'name': '骑士盾', 'text': '一个很普通的骑士盾,防御+'+core.values.shield3};
|
||||
this.items.shield4 = {'cls': 'constants', 'name': '圣盾', 'text': '一个很普通的圣盾,防御+'+core.values.shield4};
|
||||
this.items.shield5 = {'cls': 'constants', 'name': '神圣盾', 'text': '一个很普通的神圣盾,防御+'+core.values.shield5};
|
||||
}
|
||||
|
||||
return this.items;
|
||||
}
|
||||
|
||||
@ -118,24 +133,24 @@ items.prototype.getItemEffect = function(itemId, itemNum) {
|
||||
|
||||
////// “即捡即用类”道具的文字提示 //////
|
||||
items.prototype.getItemEffectTip = function(itemId) {
|
||||
if (itemId === 'redJewel') return ",攻击+"+core.values.redJewel;
|
||||
if (itemId === 'blueJewel') return ",防御+"+core.values.blueJewel;
|
||||
if (itemId === 'greenJewel') return ",魔防+"+core.values.greenJewel;
|
||||
if (itemId == 'redJewel') return ",攻击+"+core.values.redJewel;
|
||||
if (itemId == 'blueJewel') return ",防御+"+core.values.blueJewel;
|
||||
if (itemId == 'greenJewel') return ",魔防+"+core.values.greenJewel;
|
||||
if (itemId == 'yellowJewel') return ",全属性提升";
|
||||
if (itemId === 'redPotion') return ",生命+"+core.values.redPotion;
|
||||
if (itemId === 'bluePotion') return ",生命+"+core.values.bluePotion;
|
||||
if (itemId === 'yellowPotion') return ",生命+"+core.values.yellowPotion;
|
||||
if (itemId === 'greenPotion') return ",生命+"+core.values.greenPotion;
|
||||
if (itemId === 'sword1') return ",攻击+"+core.values.sword1;
|
||||
if (itemId === 'sword2') return ",攻击+"+core.values.sword2;
|
||||
if (itemId === 'sword3') return ",攻击+"+core.values.sword3;
|
||||
if (itemId === 'sword4') return ",攻击+"+core.values.sword4;
|
||||
if (itemId === 'sword5') return ",攻击+"+core.values.sword5;
|
||||
if (itemId === 'shield1') return ",防御+"+core.values.shield1;
|
||||
if (itemId === 'shield2') return ",防御+"+core.values.shield2;
|
||||
if (itemId === 'shield3') return ",防御+"+core.values.shield3;
|
||||
if (itemId === 'shield4') return ",防御+"+core.values.shield4;
|
||||
if (itemId === 'shield5') return ",防御+"+core.values.shield5;
|
||||
if (itemId == 'redPotion') return ",生命+"+core.values.redPotion;
|
||||
if (itemId == 'bluePotion') return ",生命+"+core.values.bluePotion;
|
||||
if (itemId == 'yellowPotion') return ",生命+"+core.values.yellowPotion;
|
||||
if (itemId == 'greenPotion') return ",生命+"+core.values.greenPotion;
|
||||
if (!core.flags.equipment && itemId == 'sword1') return ",攻击+"+core.values.sword1;
|
||||
if (!core.flags.equipment && itemId == 'sword2') return ",攻击+"+core.values.sword2;
|
||||
if (!core.flags.equipment && itemId == 'sword3') return ",攻击+"+core.values.sword3;
|
||||
if (!core.flags.equipment && itemId == 'sword4') return ",攻击+"+core.values.sword4;
|
||||
if (!core.flags.equipment && itemId == 'sword5') return ",攻击+"+core.values.sword5;
|
||||
if (!core.flags.equipment && itemId == 'shield1') return ",防御+"+core.values.shield1;
|
||||
if (!core.flags.equipment && itemId == 'shield2') return ",防御+"+core.values.shield2;
|
||||
if (!core.flags.equipment && itemId == 'shield3') return ",防御+"+core.values.shield3;
|
||||
if (!core.flags.equipment && itemId == 'shield4') return ",防御+"+core.values.shield4;
|
||||
if (!core.flags.equipment && itemId == 'shield5') return ",防御+"+core.values.shield5;
|
||||
if (itemId === 'bigKey') return ",全钥匙+1";
|
||||
if (itemId === 'superPotion') return ",生命值翻倍";
|
||||
if (itemId == 'moneyPocket') return ",金币+"+core.values.moneyPocket;
|
||||
@ -196,6 +211,28 @@ items.prototype.useItem = function (itemId, callback) {
|
||||
}
|
||||
core.setFlag('curse', false);
|
||||
}
|
||||
|
||||
// 剑
|
||||
if (itemId.indexOf("sword")==0) {
|
||||
var now=core.getFlag('sword', 'sword0'); // 当前装备剑的ID
|
||||
core.status.hero.atk -= core.values[now];
|
||||
core.setItem(now, 1);
|
||||
core.status.hero.atk += core.values[itemId];
|
||||
core.setItem(itemId, 0);
|
||||
core.setFlag('sword', itemId);
|
||||
core.drawTip("已装备"+core.material.items[itemId].name);
|
||||
}
|
||||
// 盾
|
||||
if (itemId.indexOf("shield")==0) {
|
||||
var now=core.getFlag('shield', 'shield0');
|
||||
core.status.hero.def -= core.values[now];
|
||||
core.setItem(now, 1);
|
||||
core.status.hero.def += core.values[itemId];
|
||||
core.setItem(itemId, 0);
|
||||
core.setFlag('shield', itemId);
|
||||
core.drawTip("已装备"+core.material.items[itemId].name);
|
||||
}
|
||||
|
||||
core.updateStatusBar();
|
||||
|
||||
// 记录路线
|
||||
@ -375,5 +412,9 @@ items.prototype.canUseItem = function (itemId) {
|
||||
if (itemId=='weakWine') return core.hasFlag('weak');
|
||||
if (itemId=='curseWine') return core.hasFlag('curse');
|
||||
if (itemId=='superWine') return core.hasFlag('poison') || core.hasFlag('weak') || core.hasFlag('curse');
|
||||
|
||||
// 剑盾
|
||||
if (itemId.indexOf("sword")==0 || itemId.indexOf("shield")==0) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user