getDamageInfo+getEnemyInfo
This commit is contained in:
parent
657bfefae9
commit
24807dffe0
@ -1 +1 @@
|
|||||||
N4IgZgNg9lBOCSATEAuEBnALrApjzADAIwgA0IAFjrFKqAJYC2AhgOY6qXVQB0A7jgBGABzIhmAOybNMHFGGYR0OchOaM5IAMLMmYiADdURchWEsAHsYI3TolERsFyLNZesvJzVM/GYA1h4giDhgQYwhYQ6+jFASOACePuQ4Fva+OACOAK705jgSmKgA2gC65PSyjOh0IADGcViSmDUooIIwgQ7kkEkOAL7kmDBKdIMgWbnCrcD949B1tYj0uHWY9HGc2aLkVigArOR9AJzjkGwzIJU4jAAi+LoQqNjZKiDZygBC+AIFADL0VgUIooF5vAD64OUOEQkOMRAAzARjgAWAgIgAcx3IkNgklh4PhSNR6Kx5GYuGYrWKoDcmgAOtkUTgCIJGfs6iiAExiFjTEraXSMChQDQgUqDWnqBlMlls7Ic7m85j8lDFEAAK3o2VY2Uk4slIDpnEZzNZ7M5PM8qvVAGkACoANQNpClYrQjIA7FyAGxcr1csAka3UkAOx0AMR5EtdRulJuy3r9AaDyptIFYUAgiH8iRdbplZvliqtID5ocE9AoH2ytBjBYTZuYFqVIYFWuYUEwklY+bj7pAppZzYVlrTofQVAkrAkBhFYvr/cLw5bpfLAsn9Fn844i+NHsTvv9h9TbbVmvoMM7ff3g8PyZPwbLKon2DwhCfWFw+AIpd1PbqCgezEf9p0AntSwsehOygntiDEWCoFg6dfwQ6CkOg6cERveMUAkbIIAgM91QSegchIPdcPwwjiJAUicmjQ192oojn3Tejsmwyj3RY2iOJRHCeII1j13PDj9kEuReLY0MOJ9STUGk0SSLIxMFLw4S+NUjF1KUl8BQ445dM0mSDNUxwDXKDB/DyVAFCUN4gNgZAUF8SEnMQLQszgOE0FwZAcXBa5GAACS3TBfLKQKIBwZgDBwP4oDqXzZkCgx6HQa4CVqL933g0FYFecZBB+PAJAAQUwbs6n8W4ZG8DSaJASFmBwehIqsoC3xcrlyHQGzCOSaz6EIgA5XC7x9fYWTESFlnQZhBBi7K2gwN8fxINViiILkuXKMoJTOLNoAEWBqSsrAcFVGIZC6Xx0GEPAXMcPrsCCNh6CCcKggaCRwg+xZ5EUZRXpkDL1jqS5hm7CB7SYOQuURH0poxHhjicGwiAxQ56myWBYDh90EX2FFjh4IhjkpqnqYxOwhsEGRMBi4wXDiPNXJSNJ6cZmK6pYdghuEKAMriPm2DkDILGwZgxYFjmyygeLbhWHA1ggPpequGc4BwABlWRVU1ppYBBLkEWOYmeAROZTApFyQHHHL1o/Wo+RKZwPdIT3va90higAWhMQPSGD0OTGcMOQ6D6Oo6j8pvcO8gaGyWROD+eBHVYAANcqNXK25ysyTIAE0AFEUXK7IAFk+E+fxHXocqxAMRRXhmcZ4rOjY/oPY4cARRB2UEfYCC9ZhjkH7J0a5UeFWxlELQIMBGWOH0iDCchdXoe2fUEZlBEQT0MXBIhmBRZhwRRMBPWOcEMUQBFBHBfZia5UIUUQRAwFRMR1ndIhPQIh9CiT0N99iehRH6foQA===
|
N4IgZgNg9lBOCSATEAuEBnALrApjzADAIwgA0IAFjrFKqAJYC2AhgOY6qXVQB0A7jgBGABzIhmAOybNMHFGGYR0OchOaM5IAMLMmYiADdURchWEsAHsYI3TolERsFyLNZesvJzVM/GYA1h4giDhgQYwhYQ6+jFASOACePuQ4Fva+OACOAK705jgSmKgA2gC65PSyjOh0IADGcViSmDUooIIwgQ7kkEkOAL7kmDBKdIMgWbnCrcD949B1tYj0uHWY9HGc2aLkVigArOR9AJzjkGwzIJU4jAAi+LoQqNjZKiDZygBC+AIFADL0VgUIooF5vAD64OUOEQkNQABYAGwAdgAHAAmDH7Y7kSGwSSw8EIlEYrE48S4ZitYqgNyaAA62XhOAIgkZ+zq8PRYhY0xK2l0jAoUA0IFKg1p6gZTJZbOyHK5POYfJQxRAACt6NlWNlJGKJSA6ZxGczWezOdzPCq1QBpAAqADV9aRJaK0IzkejEeiPeiwCQrdSQPaHQAxbnil2GqXG7Ke72+/1K60gVhQCCIfyJZ2u6WmuUKy0gXlBwT0CgfbK0SO52Om5jmxWB/ma5hQTCSVg56NukAmlkN+UW5NB9BUCSsCQGYWims9vMDxtFkv8sf0Kczjhzo3uuNen17pPN1Ua+gwtvdnd9vcJw8B4vK0fYPCEe9YXD4AhFnWduoUTtiD+E5/p2RYWPQbbgZ2xBiFBUBQROX6wRB8EQROADMl4xigEjZBAEDHmqCT0DkJDbthuH4YRIDETkEYGjulEEQ+Ka0dkmHkW6THUWx8JYVxeHMSuJ5sfs/FyNxLFBmxiLiagknCURJFxnJOGCTxymoqpCmPvybHHNp6lSXpymOPq5QYP4eSoAoShvP+sDICgviQg5iBaOmcBwmguDILi4LXIwAAS66YN5ZT+RAODMAYOB/FAdTebM/kGPQ6DXIStTvi+MGgrArzjIIPx4BIACCmAdnU/i3DI3hqVRICQswOD0OFFn/s+TnouQ6BWfhySWfQ+EAHLYdeiL7CyYiQss6DMIIUWZW0GDPp+JCqsURDoui5RlOKZzptAAiwNSFlYDgKrdQ+AQDegwh4E5jg9dgQRsPQQShUEDQSOEb2LPIijKM9MhpesdSXMMHYQHaTByEQaIYsino8PsTgEIiRCoqi5B1NksCwDDbqIqiSLwjw5JmANggyJgUXGC4cTZs5KRpFTNNRTVLDsANwhQGlcSc2wcgZBY2DMIL3PM8WUCxbcKw4GsEB9FdgISHAOAAMqyJdwOwCCyJbcixw8PCcymMwjmcCOWWra+tS8iUzhO6Qzuuy7pDFAAtCY3ukL7/smM4Ad+z7ochyH5Su/t5A0NksicH88AOqwAAapXqqVtylZkrAAF6lQAog6ADipUSFnfzqgAsgAigAvA3YgGIorwzOMsUnRsP27scODoYg7KCKjHrMMcA/ZMcX4EOyqL7PC5oEGAjLHBjYTkDq9BOcEdRgOh6KCFj4LMJjYDgvCzXHEfiJgIlYDHKi6HIogiBEIizDogQYjrG68PoYixPIn2OhFe6JTZAA=
|
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
||||||
{
|
{
|
||||||
"greenSlime": {"name":"绿头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0},
|
"greenSlime": {"name":"绿头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"magic":false},
|
||||||
"redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"value":10},
|
"redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"value":10,"magic":false},
|
||||||
"blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0},
|
"blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0},
|
||||||
"slimelord": {"name":"怪王","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":[1,9]},
|
"slimelord": {"name":"怪王","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":[1,9]},
|
||||||
"bat": {"name":"小蝙蝠","hp":100,"atk":120,"def":0,"money":2,"exp":0,"point":0,"special":[1]},
|
"bat": {"name":"小蝙蝠","hp":100,"atk":120,"def":0,"money":2,"exp":0,"point":0,"special":[1]},
|
||||||
|
@ -531,15 +531,21 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
var hero_hp = core.getRealStatusOrDefault(hero, 'hp'),
|
var hero_hp = core.getRealStatusOrDefault(hero, 'hp'),
|
||||||
hero_atk = core.getRealStatusOrDefault(hero, 'atk'),
|
hero_atk = core.getRealStatusOrDefault(hero, 'atk'),
|
||||||
hero_def = core.getRealStatusOrDefault(hero, 'def'),
|
hero_def = core.getRealStatusOrDefault(hero, 'def'),
|
||||||
hero_mdef = core.getRealStatusOrDefault(hero, 'mdef');
|
hero_mdef = core.getRealStatusOrDefault(hero, 'mdef'),
|
||||||
|
hero_speed = core.getRealStatusOrDefault(hero, 'speed');
|
||||||
|
|
||||||
var mon_hp = core.getEnemyValue(enemy, 'hp', x, y, floorId),
|
var mon_hp = core.getEnemyValue(enemy, 'hp', x, y, floorId),
|
||||||
mon_atk = core.getEnemyValue(enemy, 'atk', x, y, floorId),
|
mon_atk = core.getEnemyValue(enemy, 'atk', x, y, floorId),
|
||||||
mon_def = core.getEnemyValue(enemy, 'def', x, y, floorId),
|
mon_def = core.getEnemyValue(enemy, 'def', x, y, floorId),
|
||||||
|
mon_mdef = core.getEnemyValue(enemy, 'mdef', x, y, floorId),
|
||||||
|
mon_speed = core.getEnemyValue(enemy, 'speed', x, y, floorId),
|
||||||
mon_special = core.getEnemyValue(enemy, 'special', x, y, floorId);
|
mon_special = core.getEnemyValue(enemy, 'special', x, y, floorId);
|
||||||
var mon_money = core.getEnemyValue(enemy, 'money', x, y, floorId),
|
var mon_money = core.getEnemyValue(enemy, 'money', x, y, floorId),
|
||||||
mon_exp = core.getEnemyValue(enemy, 'exp', x, y, floorId),
|
mon_exp = core.getEnemyValue(enemy, 'exp', x, y, floorId),
|
||||||
mon_point = core.getEnemyValue(enemy, 'point', x, y, floorId);
|
mon_point = core.getEnemyValue(enemy, 'point', x, y, floorId);
|
||||||
|
var mon_barrier = 0,
|
||||||
|
mon_absorb_damage = 0,
|
||||||
|
mon_magic = core.getEnemyValue(enemy, 'magic', x, y, floorId);
|
||||||
// 模仿
|
// 模仿
|
||||||
if (core.hasSpecial(mon_special, 10)) {
|
if (core.hasSpecial(mon_special, 10)) {
|
||||||
mon_atk = hero_atk;
|
mon_atk = hero_atk;
|
||||||
@ -633,10 +639,15 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
"hp": Math.floor(mon_hp),
|
"hp": Math.floor(mon_hp),
|
||||||
"atk": Math.floor(mon_atk),
|
"atk": Math.floor(mon_atk),
|
||||||
"def": Math.floor(mon_def),
|
"def": Math.floor(mon_def),
|
||||||
|
"mdef": Math.floor(mon_mdef),
|
||||||
|
"speed": Math.floor(mon_speed),
|
||||||
|
"barrier": Math.floor(mon_barrier),
|
||||||
|
"absorb": Math.floor(mon_absorb_damage),
|
||||||
"money": Math.floor(mon_money),
|
"money": Math.floor(mon_money),
|
||||||
"exp": Math.floor(mon_exp),
|
"exp": Math.floor(mon_exp),
|
||||||
"point": Math.floor(mon_point),
|
"point": Math.floor(mon_point),
|
||||||
"special": mon_special,
|
"special": mon_special,
|
||||||
|
"magic": mon_magic,
|
||||||
"guards": guards, // 返回支援情况
|
"guards": guards, // 返回支援情况
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -655,15 +666,13 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
hero_atk = core.getRealStatusOrDefault(hero, 'atk'),
|
hero_atk = core.getRealStatusOrDefault(hero, 'atk'),
|
||||||
hero_def = core.getRealStatusOrDefault(hero, 'def'),
|
hero_def = core.getRealStatusOrDefault(hero, 'def'),
|
||||||
hero_mdef = core.getRealStatusOrDefault(hero, 'mdef'),
|
hero_mdef = core.getRealStatusOrDefault(hero, 'mdef'),
|
||||||
|
hero_speed = core.getRealStatusOrDefault(hero, 'speed'),
|
||||||
|
hero_magic = core.getRealStatusOrDefault(hero, 'magic'),
|
||||||
origin_hero_hp = core.getStatusOrDefault(hero, 'hp'),
|
origin_hero_hp = core.getStatusOrDefault(hero, 'hp'),
|
||||||
origin_hero_atk = core.getStatusOrDefault(hero, 'atk'),
|
origin_hero_atk = core.getStatusOrDefault(hero, 'atk'),
|
||||||
origin_hero_def = core.getStatusOrDefault(hero, 'def');
|
origin_hero_def = core.getStatusOrDefault(hero, 'def');
|
||||||
|
|
||||||
// 勇士的负属性都按0计算
|
|
||||||
hero_hp = Math.max(0, hero_hp);
|
|
||||||
hero_atk = Math.max(0, hero_atk);
|
|
||||||
hero_def = Math.max(0, hero_def);
|
|
||||||
hero_mdef = Math.max(0, hero_mdef);
|
|
||||||
|
|
||||||
// 怪物的各项数据
|
// 怪物的各项数据
|
||||||
// 对坚固模仿等处理扔到了脚本编辑-getEnemyInfo之中
|
// 对坚固模仿等处理扔到了脚本编辑-getEnemyInfo之中
|
||||||
@ -671,23 +680,34 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
var mon_hp = enemyInfo.hp,
|
var mon_hp = enemyInfo.hp,
|
||||||
mon_atk = enemyInfo.atk,
|
mon_atk = enemyInfo.atk,
|
||||||
mon_def = enemyInfo.def,
|
mon_def = enemyInfo.def,
|
||||||
mon_special = enemyInfo.special;
|
mon_mdef = enemyInfo.mdef,
|
||||||
|
mon_speed = enemyInfo.speed,
|
||||||
|
mon_special = enemyInfo.special,
|
||||||
|
mon_absorb_damage = enemyInfo.absorb,
|
||||||
|
mon_barrier = enemyInfo.barrier;
|
||||||
|
|
||||||
|
//---第一部分:静态属性修正---
|
||||||
|
//此处写入静态影响勇士属性的勇士或怪物技能(静态影响怪物属性的技能于getEnemyInfo中写入)
|
||||||
// 技能的处理
|
// 技能的处理
|
||||||
if (core.getFlag('skill', 0) == 1) { // 开启了技能1:二倍斩
|
if (core.getFlag('skill', 0) == 1) { // 开启了技能1:二倍斩
|
||||||
hero_atk *= 2; // 计算时攻击力翻倍
|
hero_atk *= 2; // 计算时攻击力翻倍
|
||||||
}
|
}
|
||||||
|
//勇士属性取整
|
||||||
|
hero_atk = Math.max(0, Math.floor(hero_atk));
|
||||||
|
hero_def = Math.max(0, Math.floor(hero_def));
|
||||||
|
hero_mdef = Math.max(0, Math.floor(hero_mdef));
|
||||||
|
hero_speed = Math.max(0, Math.floor(hero_speed));
|
||||||
|
|
||||||
// 如果是无敌属性,且勇士未持有十字架
|
// 如果是无敌属性,且勇士未持有十字架
|
||||||
if (core.hasSpecial(mon_special, 20) && !core.hasItem("cross"))
|
if (core.hasSpecial(mon_special, 20) && !core.hasItem("cross"))
|
||||||
return null; // 不可战斗
|
return null; // 不可战斗
|
||||||
|
|
||||||
// 战前造成的额外伤害(可被护盾抵消)
|
// 战前造成的额外伤害(可被护盾抵消)
|
||||||
var init_damage = 0;
|
let init_damage = 0;
|
||||||
|
|
||||||
// 吸血
|
// 吸血
|
||||||
if (core.hasSpecial(mon_special, 11)) {
|
if (core.hasSpecial(mon_special, 11)) {
|
||||||
var vampire_damage = hero_hp * enemy.vampire;
|
let vampire_damage = hero_hp * enemy.vampire;
|
||||||
|
|
||||||
// 如果有神圣盾免疫吸血等可以在这里写
|
// 如果有神圣盾免疫吸血等可以在这里写
|
||||||
// 也可以用hasItem和hasEquip来判定装备
|
// 也可以用hasItem和hasEquip来判定装备
|
||||||
@ -701,17 +721,60 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
init_damage += vampire_damage;
|
init_damage += vampire_damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//——第二部分:变量定义和初始赋值——
|
||||||
// 每回合怪物对勇士造成的战斗伤害
|
// 每回合怪物对勇士造成的战斗伤害
|
||||||
var per_damage = mon_atk - hero_def;
|
let per_damage = Math.max(mon_atk - hero_def, 0);
|
||||||
|
if (enemyInfo.magic) per_damage = Math.max(mon_atk - hero_mdef, 0);
|
||||||
|
|
||||||
// 战斗伤害不能为负值
|
//
|
||||||
if (per_damage < 0) per_damage = 0;
|
let hero_per_damage = Math.max(hero_atk - mon_def, 0);
|
||||||
|
if (hero_magic) hero_per_damage = Math.max(hero_atk - mon_mdef, 0);
|
||||||
|
|
||||||
|
let damage = 0,
|
||||||
|
hero_turn = 0,
|
||||||
|
mon_turn = 0;
|
||||||
|
//---第三部分:递归开始---
|
||||||
|
let length = hero_speed * mon_speed;
|
||||||
|
|
||||||
|
for (let now_mon_hp = mon_hp, last_mon_hp = mon_hp, mon_length = length, hero_length = length, mon_time = 0, hero_time = 0; now_mon_hp > 0;) { //勇士和怪物的长度
|
||||||
|
mon_time = mon_length / mon_speed;
|
||||||
|
hero_time = hero_length / hero_speed;
|
||||||
|
if ((mon_time < hero_time) || ((mon_time = hero_time) && (mon_speed > hero_speed))) { //怪物攻击的回合
|
||||||
|
//这里计算怪物攻击时发生的各种变化
|
||||||
|
|
||||||
|
//伤害与回合增加
|
||||||
|
damage += per_damage;
|
||||||
|
if (core.hasSpecial(mon_special, 6)) {
|
||||||
|
mon_turn += enemy.n;
|
||||||
|
} else {
|
||||||
|
mon_turn += 1;
|
||||||
|
}
|
||||||
|
//重新为长度赋值
|
||||||
|
mon_length = length;
|
||||||
|
hero_length = hero_length - mon_time * hero_speed;
|
||||||
|
} else { //勇士攻击的回合
|
||||||
|
// 这里计算勇士攻击时发生的各种变化
|
||||||
|
|
||||||
|
// 伤害与回合数增加
|
||||||
|
now_mon_hp -= hero_per_damage;
|
||||||
|
hero_turn += 1; //勇士回合+1,如果有勇士每回合多次攻击的情况,在这里写判断
|
||||||
|
// 无法战斗计算
|
||||||
|
if (hero_turn % 50 == 0) {
|
||||||
|
if (now_mon_hp >= last_mon_hp) return null;
|
||||||
|
last_mon_hp = now_mon_hp;
|
||||||
|
}
|
||||||
|
//重新为长度赋值
|
||||||
|
hero_length = length;
|
||||||
|
mon_length = mon_length - hero_time * mon_speed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//下面这些还没修改
|
||||||
// 连击
|
// 连击
|
||||||
if (core.hasSpecial(mon_special, 6)) per_damage *= (enemy.n || 2);
|
if (core.hasSpecial(mon_special, 6)) per_damage *= (enemy.n || 2);
|
||||||
|
|
||||||
// 每回合的反击伤害;反击是按照勇士的攻击次数来计算回合
|
// 每回合的反击伤害;反击是按照勇士的攻击次数来计算回合
|
||||||
var counterDamage = 0;
|
let counterDamage = 0;
|
||||||
if (core.hasSpecial(mon_special, 8))
|
if (core.hasSpecial(mon_special, 8))
|
||||||
counterDamage += Math.floor((enemy.counterAttack || core.values.counterAttack) * hero_atk);
|
counterDamage += Math.floor((enemy.counterAttack || core.values.counterAttack) * hero_atk);
|
||||||
|
|
||||||
@ -725,19 +788,14 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
// 净化
|
// 净化
|
||||||
if (core.hasSpecial(mon_special, 9))
|
if (core.hasSpecial(mon_special, 9))
|
||||||
init_damage += Math.floor((enemy.purify || core.values.purify) * hero_mdef);
|
init_damage += Math.floor((enemy.purify || core.values.purify) * hero_mdef);
|
||||||
|
//上面这些还没修改
|
||||||
// 勇士每回合对怪物造成的伤害
|
//勇士护盾计算
|
||||||
var hero_per_damage = Math.max(hero_atk - mon_def, 0);
|
let barrier = hero_mdef;
|
||||||
|
if (enemyInfo.magic) barrier = hero_def;
|
||||||
// 如果没有破防,则不可战斗
|
|
||||||
if (hero_per_damage <= 0) return null;
|
|
||||||
|
|
||||||
// 勇士的攻击回合数;为怪物生命除以每回合伤害向上取整
|
|
||||||
var turn = Math.ceil(mon_hp / hero_per_damage);
|
|
||||||
|
|
||||||
// ------ 支援 ----- //
|
// ------ 支援 ----- //
|
||||||
// 这个递归最好想明白为什么,flag:__extraTurn__是怎么用的
|
// 这个递归最好想明白为什么,flag:__extraTurn__是怎么用的
|
||||||
var guards = core.getFlag("__guards__" + x + "_" + y, enemyInfo.guards);
|
/*var guards = core.getFlag("__guards__" + x + "_" + y, enemyInfo.guards);
|
||||||
var guard_before_current_enemy = false; // ------ 支援怪是先打(true)还是后打(false)?
|
var guard_before_current_enemy = false; // ------ 支援怪是先打(true)还是后打(false)?
|
||||||
turn += core.getFlag("__extraTurn__", 0);
|
turn += core.getFlag("__extraTurn__", 0);
|
||||||
if (guards.length > 0) {
|
if (guards.length > 0) {
|
||||||
@ -764,13 +822,13 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
turn += core.getFlag("__extraTurn__", 0);
|
turn += core.getFlag("__extraTurn__", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.removeFlag("__extraTurn__");
|
core.removeFlag("__extraTurn__");*/
|
||||||
// ------ 支援END ------ //
|
// ------ 支援END ------ //
|
||||||
|
|
||||||
// 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害
|
// 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害
|
||||||
var damage = init_damage + (turn - 1) * per_damage + turn * counterDamage;
|
damage += init_damage + hero_turn * counterDamage;
|
||||||
// 再扣去护盾
|
// 再扣去护盾
|
||||||
damage -= hero_mdef;
|
damage -= barrier;
|
||||||
|
|
||||||
// 检查是否允许负伤
|
// 检查是否允许负伤
|
||||||
if (!core.flags.enableNegativeDamage)
|
if (!core.flags.enableNegativeDamage)
|
||||||
@ -788,12 +846,18 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
"mon_hp": Math.floor(mon_hp),
|
"mon_hp": Math.floor(mon_hp),
|
||||||
"mon_atk": Math.floor(mon_atk),
|
"mon_atk": Math.floor(mon_atk),
|
||||||
"mon_def": Math.floor(mon_def),
|
"mon_def": Math.floor(mon_def),
|
||||||
|
"mon_mdef": Math.floor(mon_mdef),
|
||||||
"init_damage": Math.floor(init_damage),
|
"init_damage": Math.floor(init_damage),
|
||||||
"per_damage": Math.floor(per_damage),
|
"per_damage": Math.floor(per_damage),
|
||||||
"hero_per_damage": Math.floor(hero_per_damage),
|
"hero_per_damage": Math.floor(hero_per_damage),
|
||||||
"turn": Math.floor(turn),
|
"turn": Math.floor(hero_turn),
|
||||||
|
"mon_turn": Math.floor(mon_turn),
|
||||||
"damage": Math.floor(damage)
|
"damage": Math.floor(damage)
|
||||||
};
|
};
|
||||||
|
/*TODO:怪物手册的修改(需要修改这里return的内容以及一些战后判断)
|
||||||
|
1. 显示怪物是魔攻还是物攻(在怪物名字上做颜色变化,物攻是黄色,魔攻是蓝色)
|
||||||
|
2. 一防减伤是物防还是魔防(由怪物是物攻还是魔攻来转换)
|
||||||
|
3. 特殊战斗的怪物,在怪物手册里“伤害”写为“特殊战”*/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
|
@ -13741,71 +13741,71 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
"属性映射": function () {
|
"属性映射": function () {
|
||||||
// 在此增加新插件
|
// 在此增加新插件
|
||||||
this.statusEquip = function () {
|
this.statusEquip = function () {
|
||||||
const hero = core.status.hero;
|
const hero = core.status.hero;
|
||||||
//装备具体效果在这里写,道具填写道具类型为equip并选择装备类型,道具的装备属性中装备类型遵循以下填写方式:
|
//装备具体效果在这里写,道具填写道具类型为equip并选择装备类型,道具的装备属性中装备类型遵循以下填写方式:
|
||||||
//固定装备孔的填写0/1/2/3,分别对应主手、副手、防具、饰品
|
//固定装备孔的填写0/1/2/3,分别对应主手、副手、防具、饰品
|
||||||
//主副手同时可使用的,填写 武器
|
//主副手同时可使用的,填写 武器
|
||||||
//具体的换装时装备切换操作写在新道具栏/物品栏插件
|
//具体的换装时装备切换操作写在新道具栏/物品栏插件
|
||||||
//当前仅完善法杖、单手剑、双手剑、匕首、盾牌的多孔切换操作
|
//当前仅完善法杖、单手剑、双手剑、匕首、盾牌的多孔切换操作
|
||||||
//主武器效果
|
//主武器效果
|
||||||
if (core.getEquip[0]) {
|
if (core.getEquip[0]) {
|
||||||
switch (core.getEquip[0]) {
|
switch (core.getEquip[0]) {
|
||||||
case "sword1":
|
case "sword1":
|
||||||
hero.atk = hero.str + hero.agi;
|
hero.atk = hero.str + hero.agi;
|
||||||
hero.magic = false;
|
hero.magic = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//副手效果
|
//副手效果
|
||||||
if (core.getEquip[1]) {
|
if (core.getEquip[1]) {
|
||||||
switch (core.getEquip[1]) {
|
switch (core.getEquip[1]) {
|
||||||
case "sword1":
|
case "sword1":
|
||||||
hero.atk += hero.agi;
|
hero.atk += hero.agi;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//防具效果
|
//防具效果
|
||||||
if (core.getEquip[2]) {
|
if (core.getEquip[2]) {
|
||||||
switch (core.getEquip[2]) {
|
switch (core.getEquip[2]) {
|
||||||
case "sword1":
|
case "sword1":
|
||||||
hero.def = hero.con + hero.agi;
|
hero.def = hero.con + hero.agi;
|
||||||
hero.hpmax = 2.5 * hero.con;
|
hero.hpmax = 2.5 * hero.con;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//饰品效果
|
//饰品效果
|
||||||
if (core.getEquip[3]) {
|
if (core.getEquip[3]) {
|
||||||
switch (core.getEquip[3]) {
|
switch (core.getEquip[3]) {
|
||||||
case "sword1":
|
case "sword1":
|
||||||
hero.speed += 0.4 * hero.int + 0.6 * hero.agi;
|
hero.speed += 0.4 * hero.int + 0.6 * hero.agi;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.updateStatus = function () {
|
this.updateStatus = function () {
|
||||||
const hero = core.status.hero;
|
const hero = core.status.hero;
|
||||||
//默认映射关系
|
//默认映射关系
|
||||||
hero.hpmax = hero.str * 50 + hero.con * 50;
|
hero.hpmax = hero.str * 50 + hero.con * 50;
|
||||||
hero.atk = hero.str * 0.5 + hero.int * 0.5;
|
hero.atk = hero.str * 0.5 + hero.int * 0.5;
|
||||||
hero.manamax = hero.agi * 0.5 + hero.int * 0.5;
|
hero.manamax = hero.agi * 0.5 + hero.int * 0.5;
|
||||||
hero.def = hero.con * 0.5 + hero.agi * 0.5;
|
hero.def = hero.con * 0.5 + hero.agi * 0.5;
|
||||||
hero.mdef = hero.con * 0.5 + hero.int * 0.5;
|
hero.mdef = hero.con * 0.5 + hero.int * 0.5;
|
||||||
hero.speed = hero.str * 0.5 + hero.agi * 0.5;
|
hero.speed = hero.str * 0.5 + hero.agi * 0.5;
|
||||||
hero.magic = false;
|
hero.magic = false;
|
||||||
this.statusEquip(); //处理装备效果
|
this.statusEquip(); //处理装备效果
|
||||||
for (let v in hero) {
|
for (let v in hero) {
|
||||||
//归整
|
//归整
|
||||||
if (typeof hero[v] === "number") {
|
if (typeof hero[v] === "number") {
|
||||||
hero[v] = Math.floor(hero[v]);
|
hero[v] = Math.floor(hero[v]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hero.hp = Math.min(hero.hp, hero.hpmax);
|
hero.hp = Math.min(hero.hp, hero.hpmax);
|
||||||
hero.mana = Math.min(hero.mana, hero.manamax);
|
hero.mana = Math.min(hero.mana, hero.manamax);
|
||||||
core.status.hero = hero;
|
core.status.hero = hero;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
"回合制boss战": function () {
|
"回合制boss战": function () {
|
||||||
// 在此增加新插件
|
// 在此增加新插件
|
||||||
const boss = document.createElement("canvas"); //boss战画布设置
|
const boss = document.createElement("canvas"); //boss战画布设置
|
||||||
|
Loading…
Reference in New Issue
Block a user