diff --git a/project/functions.js b/project/functions.js index d202ca9..014cf56 100644 --- a/project/functions.js +++ b/project/functions.js @@ -905,9 +905,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = var hero_hp = core.getRealStatusOrDefault(hero, "hp"), hero_atk = core.getRealStatusOrDefault(hero, "atk"), hero_def = core.getRealStatusOrDefault(hero, "def"), + hero_matk = core.getRealStatusOrDefault(hero, "matk"), hero_mdef = core.getRealStatusOrDefault(hero, "mdef"), hero_speed = core.getRealStatusOrDefault(hero, "speed"), - hero_magic = core.getRealStatusOrDefault(hero, "magic"), + hero_spell = core.getRealStatusOrDefault(hero, "spell"), origin_hero_hp = core.getStatusOrDefault(hero, "hp"), origin_hero_atk = core.getStatusOrDefault(hero, "atk"), origin_hero_def = core.getStatusOrDefault(hero, "def"); @@ -976,6 +977,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = //---第三部分:递归开始--- let length = hero_speed * mon_speed; + let heroDiffPerTurn = [], + enemyDiffPerTurn = []; + for ( let now_mon_hp = mon_hp, last_mon_hp = mon_hp, @@ -990,7 +994,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = hero_time = hero_length / hero_speed; if ( mon_time < hero_time || - ((mon_time = hero_time) && mon_speed > hero_speed) + ((mon_time == hero_time) && mon_speed > hero_speed) ) { //怪物攻击的回合 //这里计算怪物攻击时发生的各种变化 @@ -1021,6 +1025,11 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = hero_length = length; mon_length = mon_length - hero_time * mon_speed; } + let hero_diff = {}, + mon_diff = {}; + //这里插入汇总勇士和怪物在此回合结束时的情况数值,用以跑条动画读取 + heroDiffPerTurn.push(hero_diff); + enemyDiffPerTurn.push(mon_diff); //将勇士和怪物此回合结束时的属性变动保存到heroPerInfo和enemyPerInfo中,用以跑条动画读取 } //下面这些还没修改 @@ -1051,7 +1060,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = //上面这些还没修改 //勇士护盾计算 let barrier = hero_mdef; - if (enemyInfo.magic) barrier = hero_def; + // ------ 支援 ----- // // 这个递归最好想明白为什么,flag:__extraTurn__是怎么用的 @@ -1119,6 +1128,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = 1. 显示怪物是魔攻还是物攻(在怪物名字上做颜色变化,物攻是黄色,魔攻是蓝色) 2. 一防减伤是物防还是魔防(由怪物是物攻还是魔攻来转换) 3. 特殊战斗的怪物,在怪物手册里“伤害”写为“特殊战”*/ + /*TODO:怪物和勇士同时跑条到终点时,谁先出手的逻辑确定 + 怪物、勇士和装备同时跑条时的计算*/ } }, "actions": {