This commit is contained in:
xiekaidong 2023-04-14 17:59:15 +08:00
commit f48194bfd1
13 changed files with 594 additions and 463 deletions

View File

@ -3,98 +3,34 @@ local attr = {
["name"]="hp"
},
[2]={
["name"]="recover"
["name"]="atk_red"
},
[3]={
["name"]="atk"
["name"]="atk_yellow"
},
[4]={
["name"]="red_atk"
["name"]="atk_green"
},
[5]={
["name"]="yellow_atk"
["name"]="atk_blue"
},
[6]={
["name"]="green_atk"
},
[7]={
["name"]="blue_atk"
},
[8]={
["name"]="purple_atk"
},
[9]={
["name"]="atkp"
},
[10]={
["name"]="red_atkp"
},
[11]={
["name"]="yellow_atkp"
},
[12]={
["name"]="green_atkp"
},
[13]={
["name"]="blue_atkp"
},
[14]={
["name"]="purple_atkp"
},
[15]={
["name"]="hpp"
},
[16]={
["name"]="crit"
},
[17]={
["name"]="crit_time"
},
[18]={
["name"]="exp_time"
},
[19]={
["name"]="cured"
},
[20]={
["name"]="vampire"
},
[21]={
["name"]="block"
},
[22]={
["name"]="dmg_dec"
["name"]="atk_purple"
}
}
local keys = {
name = {
["hp"]=attr[1],
["recover"]=attr[2],
["atk"]=attr[3],
["red_atk"]=attr[4],
["yellow_atk"]=attr[5],
["green_atk"]=attr[6],
["blue_atk"]=attr[7],
["purple_atk"]=attr[8],
["atkp"]=attr[9],
["red_atkp"]=attr[10],
["yellow_atkp"]=attr[11],
["green_atkp"]=attr[12],
["blue_atkp"]=attr[13],
["purple_atkp"]=attr[14],
["hpp"]=attr[15],
["crit"]=attr[16],
["crit_time"]=attr[17],
["exp_time"]=attr[18],
["cured"]=attr[19],
["vampire"]=attr[20],
["block"]=attr[21],
["dmg_dec"]=attr[22]
["atk_red"]=attr[2],
["atk_yellow"]=attr[3],
["atk_green"]=attr[4],
["atk_blue"]=attr[5],
["atk_purple"]=attr[6]
}
}
local config = {
data=attr,
keys=keys,
count=22
count=6
}
return config

View File

@ -1,5 +1,165 @@
local buff = {
[1]={
["name"]="hurt",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[2]={
["name"]="hurt_red",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[3]={
["name"]="hurt_yellow",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[4]={
["name"]="hurt_green",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[5]={
["name"]="hurt_blue",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[6]={
["name"]="hurt_purple",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[7]={
["name"]="dec_dmg_red_add",
["buff_type"]=1,
["decr"]=1,
["icon"]="dec_dmg_red_add"
},
[8]={
["name"]="dec_dmg_ryellow_add",
["buff_type"]=1,
["decr"]=1,
["icon"]="dec_dmg_ryellow_add"
},
[9]={
["name"]="dec_dmg_green_add",
["buff_type"]=1,
["decr"]=1,
["icon"]="dec_dmg_green_add"
},
[10]={
["name"]="dec_dmg_blue_add",
["buff_type"]=1,
["decr"]=1,
["icon"]="dec_dmg_blue_add"
},
[11]={
["name"]="dec_dmg_purple_add",
["buff_type"]=1,
["decr"]=1,
["icon"]="dec_dmg_purple_add"
},
[12]={
["name"]="dec_dmg_all_add",
["buff_type"]=1
},
[13]={
["name"]="weakness_red_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="weakness_red_add"
},
[14]={
["name"]="weakness_yellow_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="weakness_yellow_add"
},
[15]={
["name"]="weakness_green_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="weakness_green_add"
},
[16]={
["name"]="weakness_blue_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="weakness_blue_add"
},
[17]={
["name"]="weakness_purple_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="weakness_purple_add"
},
[18]={
["name"]="weakness_all_add"
},
[19]={
["name"]="dmg_addition_red_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="dmg_addition_red_add"
},
[20]={
["name"]="dmg_addition_yellow_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="dmg_addition_yellow_add"
},
[21]={
["name"]="dmg_addition_green_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="dmg_addition_green_add"
},
[22]={
["name"]="dmg_addition_blue_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="dmg_addition_blue_add"
},
[23]={
["name"]="dmg_addition_purple_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="dmg_addition_purple_add"
},
[24]={
["name"]="dmg_addition_all_add"
},
[25]={
["name"]="wavehealp",
["buff_type"]=5,
["decr"]=3,
["formula"]=2
},
[26]={
["name"]="heal",
["buff_type"]=5,
["decr"]=3,
["formula"]=3,
["fx_take"]={
4001
}
},
[27]={
["name"]="hit_heal",
["buff_type"]=5,
["decr"]=3,
["formula"]=3,
["fx_take"]={
4001
}
},
[28]={
["name"]="stun",
["buff_type"]=8,
["decr"]=2,
@ -8,18 +168,12 @@ local buff = {
4001
}
},
[2]={
[29]={
["name"]="hit_stun",
["buff_type"]=9,
["buff_type"]=8,
["decr"]=2
},
[3]={
["name"]="hurt",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[4]={
[30]={
["name"]="shield",
["buff_type"]=2,
["decr"]=1,
@ -27,28 +181,22 @@ local buff = {
4001
}
},
[5]={
[31]={
["name"]="atkp_add",
["buff_type"]=1,
["decr"]=1
},
[6]={
[32]={
["name"]="atkp_add_defenderhp",
["buff_type"]=1,
["decr"]=1
},
[7]={
["name"]="wavehealp",
["buff_type"]=5,
["decr"]=3,
["formula"]=7
},
[8]={
[33]={
["name"]="atkp_add_connect",
["buff_type"]=1,
["decr"]=3
},
[9]={
[34]={
["name"]="spd_dec",
["buff_type"]=8,
["decr"]=2,
@ -56,178 +204,150 @@ local buff = {
4001
}
},
[10]={
[35]={
["name"]="block",
["buff_type"]=1,
["decr"]=1
},
[11]={
[36]={
["name"]="hit_block",
["buff_type"]=1,
["decr"]=1
},
[12]={
["name"]="heal",
["buff_type"]=5,
["decr"]=3,
["formula"]=8,
["fx_take"]={
4001
}
},
[13]={
["name"]="hit_heal",
["buff_type"]=5,
["decr"]=3,
["formula"]=9,
["fx_take"]={
4001
}
},
[14]={
["name"]="hurt_red",
["buff_type"]=3,
["decr"]=3,
["formula"]=2
},
[15]={
["name"]="hurt_yellow",
["buff_type"]=3,
["decr"]=3,
["formula"]=3
},
[16]={
["name"]="hurt_green",
["buff_type"]=3,
["decr"]=3,
["formula"]=4
},
[17]={
["name"]="hurt_blue",
["buff_type"]=3,
["decr"]=3,
["formula"]=5
},
[18]={
["name"]="hurt_purple",
["buff_type"]=3,
["decr"]=3,
["formula"]=6
},
[19]={
["name"]="red_atkp_dec",
["buff_type"]=1,
["decr"]=1,
["icon"]="red_atkp_dec"
},
[20]={
["name"]="yellow_atkp_dec",
["buff_type"]=1,
["decr"]=1,
["icon"]="yellow_atkp_dec"
},
[21]={
["name"]="green_atkp_dec",
["buff_type"]=1,
["decr"]=1,
["icon"]="green_atkp_dec"
},
[22]={
["name"]="blue_atkp_dec",
["buff_type"]=1,
["decr"]=1,
["icon"]="blue_atkp_dec"
},
[23]={
["name"]="purple_atkp_dec",
["buff_type"]=1,
["decr"]=1,
["icon"]="purple_atkp_dec"
},
[24]={
["name"]="random_atkp_dec",
["buff_type"]=7,
["decr"]=1
},
[25]={
["name"]="board_make",
["buff_type"]=7,
["decr"]=3
},
[26]={
["name"]="red_atkp_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="red_atkp_dec"
},
[27]={
["name"]="yellow_atkp_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="yellow_atkp_dec"
},
[28]={
["name"]="green_atkp_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="green_atkp_dec"
},
[29]={
["name"]="blue_atkp_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="blue_atkp_dec"
},
[30]={
["name"]="purple_atkp_add",
["buff_type"]=1,
["decr"]=2,
["icon"]="purple_atkp_dec"
},
[31]={
[37]={
["name"]="atk_times_add",
["buff_type"]=7,
["decr"]=1
},
[38]={
["name"]="atkp_color_add",
["buff_type"]=1,
["decr"]=1
},
[39]={
["name"]="atkp_red_add",
["buff_type"]=1,
["decr"]=1
},
[40]={
["name"]="atkp_yellow_add",
["buff_type"]=1,
["decr"]=1
},
[41]={
["name"]="atkp_green_add",
["buff_type"]=1,
["decr"]=1
},
[42]={
["name"]="atkp_blue_add",
["buff_type"]=1,
["decr"]=1
},
[43]={
["name"]="atkp_purple_add",
["buff_type"]=1,
["decr"]=1
},
[44]={
["name"]="hpp_add",
["buff_type"]=1,
["decr"]=1
},
[45]={
["name"]="crit_add",
["buff_type"]=1,
["decr"]=1
},
[46]={
["name"]="crit_time_add",
["buff_type"]=1,
["decr"]=1
},
[47]={
["name"]="exp_time_add",
["buff_type"]=7,
["decr"]=1
},
[48]={
["name"]="cured_add",
["buff_type"]=1,
["decr"]=1
},
[49]={
["name"]="block_add",
["buff_type"]=1,
["decr"]=1
},
[50]={
["name"]="dec_dmg_random_add",
["buff_type"]=7,
["decr"]=1
},
[51]={
["name"]="board_make",
["buff_type"]=7,
["decr"]=3
}
}
local keys = {
name = {
["stun"]=buff[1],
["hit_stun"]=buff[2],
["hurt"]=buff[3],
["shield"]=buff[4],
["atkp_add"]=buff[5],
["atkp_add_defenderhp"]=buff[6],
["wavehealp"]=buff[7],
["atkp_add_connect"]=buff[8],
["spd_dec"]=buff[9],
["block"]=buff[10],
["hit_block"]=buff[11],
["heal"]=buff[12],
["hit_heal"]=buff[13],
["hurt_red"]=buff[14],
["hurt_yellow"]=buff[15],
["hurt_green"]=buff[16],
["hurt_blue"]=buff[17],
["hurt_purple"]=buff[18],
["red_atkp_dec"]=buff[19],
["yellow_atkp_dec"]=buff[20],
["green_atkp_dec"]=buff[21],
["blue_atkp_dec"]=buff[22],
["purple_atkp_dec"]=buff[23],
["random_atkp_dec"]=buff[24],
["board_make"]=buff[25],
["red_atkp_add"]=buff[26],
["yellow_atkp_add"]=buff[27],
["green_atkp_add"]=buff[28],
["blue_atkp_add"]=buff[29],
["purple_atkp_add"]=buff[30],
["atk_times_add"]=buff[31]
["hurt"]=buff[1],
["hurt_red"]=buff[2],
["hurt_yellow"]=buff[3],
["hurt_green"]=buff[4],
["hurt_blue"]=buff[5],
["hurt_purple"]=buff[6],
["dec_dmg_red_add"]=buff[7],
["dec_dmg_ryellow_add"]=buff[8],
["dec_dmg_green_add"]=buff[9],
["dec_dmg_blue_add"]=buff[10],
["dec_dmg_purple_add"]=buff[11],
["dec_dmg_all_add"]=buff[12],
["weakness_red_add"]=buff[13],
["weakness_yellow_add"]=buff[14],
["weakness_green_add"]=buff[15],
["weakness_blue_add"]=buff[16],
["weakness_purple_add"]=buff[17],
["weakness_all_add"]=buff[18],
["dmg_addition_red_add"]=buff[19],
["dmg_addition_yellow_add"]=buff[20],
["dmg_addition_green_add"]=buff[21],
["dmg_addition_blue_add"]=buff[22],
["dmg_addition_purple_add"]=buff[23],
["dmg_addition_all_add"]=buff[24],
["wavehealp"]=buff[25],
["heal"]=buff[26],
["hit_heal"]=buff[27],
["stun"]=buff[28],
["hit_stun"]=buff[29],
["shield"]=buff[30],
["atkp_add"]=buff[31],
["atkp_add_defenderhp"]=buff[32],
["atkp_add_connect"]=buff[33],
["spd_dec"]=buff[34],
["block"]=buff[35],
["hit_block"]=buff[36],
["atk_times_add"]=buff[37],
["atkp_color_add"]=buff[38],
["atkp_red_add"]=buff[39],
["atkp_yellow_add"]=buff[40],
["atkp_green_add"]=buff[41],
["atkp_blue_add"]=buff[42],
["atkp_purple_add"]=buff[43],
["hpp_add"]=buff[44],
["crit_add"]=buff[45],
["crit_time_add"]=buff[46],
["exp_time_add"]=buff[47],
["cured_add"]=buff[48],
["block_add"]=buff[49],
["dec_dmg_random_add"]=buff[50],
["board_make"]=buff[51]
}
}
local config = {
data=buff,
keys=keys,
count=31
count=51
}
return config

View File

@ -11,17 +11,20 @@ local LocalizationGlobalConst =
BTN_TEXT_CANCEL = "BTN_TEXT_CANCEL",
BTN_TEXT_OK = "BTN_TEXT_OK",
BATTLE_DESC_1 = "BATTLE_DESC_1",
GET_REWARDS_DESC = "GET_REWARDS_DESC",
CLICK_CLOSE_DESC = "CLICK_CLOSE_DESC",
["REWARD_DESC"] = "REWARD_DESC",
["CONTINUE_DESC"] = "CONTINUE_DESC",
["BATTLE_DESC_2"] = "BATTLE_DESC_2",
["BATTLE_DESC_3"] = "BATTLE_DESC_3",
["BATTLE_DESC_4"] = "BATTLE_DESC_4",
["BATTLE_DESC_5"] = "BATTLE_DESC_5",
["BATTLE_DESC_6"] = "BATTLE_DESC_6",
["BATTLE_DESC_7"] = "BATTLE_DESC_7"
ITEM_NOT_ENOUGH = "ITEM_NOT_ENOUGH",
START_DESC = "START_DESC",
ELEMENT_NAME_1 = "ELEMENT_NAME_1",
ELEMENT_NAME_2 = "ELEMENT_NAME_2",
ELEMENT_NAME_3 = "ELEMENT_NAME_3",
ELEMENT_NAME_4 = "ELEMENT_NAME_4",
ELEMENT_NAME_5 = "ELEMENT_NAME_5",
HERO_DESC_1 = "HERO_DESC_1",
HERO_DESC_2 = "HERO_DESC_2",
HERO_DESC_3 = "HERO_DESC_3",
HERO_DESC_4 = "HERO_DESC_4",
HERO_DESC_5 = "HERO_DESC_5",
HERO_DESC_6 = "HERO_DESC_6",
HERO_DESC_7 = "HERO_DESC_7",
}
return LocalizationGlobalConst

View File

@ -1,6 +1,5 @@
local skill = {
[1]={
["position"]=1,
["method"]=2,
["skill_type"]=0,
["effect_type"]=1,
@ -13,10 +12,9 @@ local skill = {
["round"]=0
}
},
["position"]=1
["skill_position"]=1
},
[2]={
["position"]=1,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -27,10 +25,9 @@ local skill = {
["round"]=0
}
},
["position"]=1
["skill_position"]=1
},
[3]={
["position"]=1,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -41,10 +38,9 @@ local skill = {
["round"]=0
}
},
["position"]=1
["skill_position"]=1
},
[4]={
["position"]=1,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -55,10 +51,9 @@ local skill = {
["round"]=0
}
},
["position"]=1
["skill_position"]=1
},
[5]={
["position"]=1,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -69,10 +64,9 @@ local skill = {
["round"]=0
}
},
["position"]=1
["skill_position"]=1
},
[6]={
["position"]=2,
["method"]=2,
["skill_type"]=0,
["effect_type"]=1,
@ -85,10 +79,9 @@ local skill = {
["round"]=0
}
},
["position"]=2
["skill_position"]=2
},
[7]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -99,10 +92,9 @@ local skill = {
["round"]=0
}
},
["position"]=2
["skill_position"]=2
},
[8]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -113,10 +105,9 @@ local skill = {
["round"]=0
}
},
["position"]=2
["skill_position"]=2
},
[9]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -127,10 +118,9 @@ local skill = {
["round"]=0
}
},
["position"]=2
["skill_position"]=2
},
[10]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -141,11 +131,11 @@ local skill = {
["round"]=0
}
},
["position"]=2
["skill_position"]=2
},
[11]={
["energy"]=10,
["position"]=1,
["position"]=3,
["method"]=2,
["skill_type"]=1,
["boardrange"]={
@ -160,11 +150,11 @@ local skill = {
},
["icon"]=10,
["battle_icon"]=1,
["position"]=1
["skill_position"]=1
},
[20]={
["energy"]=10,
["position"]=1,
["position"]=2,
["method"]=2,
["skill_type"]=0,
["icon"]=20,
@ -180,11 +170,11 @@ local skill = {
}
},
["obj"]=2,
["position"]=1
["skill_position"]=1
},
[21]={
["energy"]=10,
["position"]=1,
["position"]=2,
["method"]=1,
["skill_type"]=2,
["skill_type_parameter"]=2,
@ -218,11 +208,11 @@ local skill = {
["round"]=0
}
},
["position"]=1
["skill_position"]=1
},
[30]={
["energy"]=10,
["position"]=2,
["position"]=4,
["method"]=2,
["skill_type"]=1,
["boardrange"]={
@ -233,11 +223,11 @@ local skill = {
},
["icon"]=30,
["battle_icon"]=3,
["position"]=2
["skill_position"]=2
},
[40]={
["energy"]=10,
["position"]=2,
["position"]=5,
["method"]=2,
["skill_type"]=0,
["icon"]=40,
@ -253,11 +243,11 @@ local skill = {
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[50]={
["energy"]=10,
["position"]=2,
["position"]=1,
["method"]=2,
["skill_type"]=1,
["boardrange"]={
@ -272,11 +262,11 @@ local skill = {
},
["icon"]=50,
["battle_icon"]=5,
["position"]=2
["skill_position"]=2
},
[60]={
["energy"]=10,
["position"]=2,
["position"]=3,
["method"]=2,
["skill_type"]=0,
["icon"]=60,
@ -292,11 +282,11 @@ local skill = {
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[70]={
["energy"]=10,
["position"]=1,
["position"]=2,
["method"]=2,
["skill_type"]=0,
["icon"]=70,
@ -312,11 +302,11 @@ local skill = {
}
},
["obj"]=1,
["position"]=1
["skill_position"]=1
},
[71]={
["energy"]=10,
["position"]=1,
["position"]=2,
["method"]=1,
["skill_type"]=2,
["skill_type_parameter"]=2,
@ -351,11 +341,11 @@ local skill = {
}
},
["obj"]=1,
["position"]=1
["skill_position"]=1
},
[72]={
["energy"]=10,
["position"]=1,
["position"]=2,
["method"]=1,
["skill_type"]=2,
["skill_type_parameter"]=2,
@ -395,11 +385,11 @@ local skill = {
},
["icon"]=70,
["battle_icon"]=7,
["position"]=1
["skill_position"]=1
},
[80]={
["energy"]=10,
["position"]=1,
["position"]=4,
["method"]=2,
["skill_type"]=0,
["icon"]=80,
@ -420,11 +410,11 @@ local skill = {
["round"]=1
}
},
["position"]=1
["skill_position"]=1
},
[81]={
["energy"]=10,
["position"]=1,
["position"]=4,
["method"]=2,
["skill_type"]=1,
["boardrange"]={
@ -463,10 +453,9 @@ local skill = {
["round"]=1
}
},
["position"]=1
["skill_position"]=1
},
[100000]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -478,10 +467,9 @@ local skill = {
}
},
["obj"]=2,
["position"]=2
["skill_position"]=2
},
[100001]={
["position"]=1,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -493,10 +481,9 @@ local skill = {
}
},
["obj"]=2,
["position"]=1
["skill_position"]=1
},
[100002]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -508,12 +495,11 @@ local skill = {
}
},
["obj"]=1,
["position"]=2,
["skill_position"]=2,
["cd"]=3,
["cd_start"]=3
},
[100003]={
["position"]=1,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -525,12 +511,11 @@ local skill = {
}
},
["obj"]=2,
["position"]=1,
["skill_position"]=1,
["cd"]=4,
["cd_start"]=4
},
[100004]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -542,27 +527,25 @@ local skill = {
}
},
["obj"]=1,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100005]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="red_atkp_dec",
["type"]="dec_dmg_red_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100006]={
["position"]=1,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -592,27 +575,25 @@ local skill = {
}
},
["obj"]=2,
["position"]=1,
["skill_position"]=1,
["cd"]=3,
["cd_start"]=3
},
[100007]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="yellow_atkp_dec",
["type"]="dec_dmg_ryellow_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100008]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -630,33 +611,31 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100009]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="purple_atkp_add",
["type"]="weakness_purple_add",
["num"]=10000,
["ratio"]=10000,
["round"]=999
},
{
["type"]="green_atkp_dec",
["type"]="dec_dmg_green_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100010]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -686,12 +665,11 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100011]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -703,27 +681,25 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100012]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="green_atkp_dec",
["type"]="dec_dmg_green_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100013]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -735,27 +711,25 @@ local skill = {
}
},
["obj"]=1,
["position"]=2,
["skill_position"]=2,
["cd"]=3,
["cd_start"]=3
},
[100014]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="green_atkp_dec",
["type"]="dec_dmg_green_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100015]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -773,12 +747,11 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100016]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -808,27 +781,25 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100017]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="blue_atkp_dec",
["type"]="dec_dmg_blue_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100018]={
["position"]=1,
["effect_type"]=1,
["trigger"]=3,
["effect"]={
@ -840,12 +811,11 @@ local skill = {
}
},
["obj"]=1,
["position"]=1,
["skill_position"]=1,
["cd"]=3,
["cd_start"]=3
},
[100019]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -857,27 +827,25 @@ local skill = {
}
},
["obj"]=1,
["position"]=2,
["skill_position"]=2,
["cd"]=3,
["cd_start"]=3
},
[100020]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="yellow_atkp_dec",
["type"]="dec_dmg_ryellow_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100021]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -907,12 +875,11 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100022]={
["position"]=1,
["effect_type"]=1,
["trigger"]=3,
["effect"]={
@ -924,12 +891,11 @@ local skill = {
}
},
["obj"]=1,
["position"]=1,
["skill_position"]=1,
["cd"]=3,
["cd_start"]=3
},
[100023]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -947,12 +913,11 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=3,
["cd_start"]=3
},
[100024]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -982,27 +947,25 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=3,
["cd_start"]=3
},
[100025]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="green_atkp_dec",
["type"]="dec_dmg_green_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100026]={
["position"]=2,
["effect_type"]=1,
["trigger"]=1,
["effect"]={
@ -1014,27 +977,25 @@ local skill = {
}
},
["obj"]=2,
["position"]=2,
["skill_position"]=2,
["cd"]=2,
["cd_start"]=2
},
[100027]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="yellow_atkp_dec",
["type"]="dec_dmg_ryellow_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
},
[100028]={
["position"]=1,
["effect_type"]=1,
["trigger"]=3,
["effect"]={
@ -1052,24 +1013,23 @@ local skill = {
}
},
["obj"]=2,
["position"]=1,
["skill_position"]=1,
["cd"]=3,
["cd_start"]=3
},
[100029]={
["position"]=2,
["effect_type"]=2,
["trigger"]=2,
["effect"]={
{
["type"]="random_atkp_dec",
["type"]="dec_dmg_random_add",
["num"]=5000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["position"]=2
["skill_position"]=2
}
}
local config = {

View File

@ -7,11 +7,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="atkp",
["type"]="atkp_color_add",
["minnum"]=300,
["maxnum"]=500
}
},
["obj"]=1,
["icon"]=1
},
[2]={
@ -22,11 +23,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="atkp",
["type"]="atkp_color_add",
["minnum"]=800,
["maxnum"]=1200
}
},
["obj"]=1,
["icon"]=1
},
[3]={
@ -37,11 +39,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="atkp",
["type"]="atkp_color_add",
["minnum"]=1300,
["maxnum"]=2000
}
},
["obj"]=1,
["icon"]=1
},
[4]={
@ -52,11 +55,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="red_atkp",
["type"]="atkp_red_add",
["minnum"]=300,
["maxnum"]=500
}
},
["obj"]=1,
["icon"]=2
},
[5]={
@ -67,11 +71,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="red_atkp",
["type"]="atkp_red_add",
["minnum"]=800,
["maxnum"]=1200
}
},
["obj"]=1,
["icon"]=2
},
[6]={
@ -82,11 +87,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="red_atkp",
["type"]="atkp_red_add",
["minnum"]=1300,
["maxnum"]=2000
}
},
["obj"]=1,
["icon"]=2
},
[7]={
@ -97,11 +103,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="yellow_atkp",
["type"]="atkp_yellow_add",
["minnum"]=300,
["maxnum"]=500
}
},
["obj"]=1,
["icon"]=3
},
[8]={
@ -112,11 +119,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="yellow_atkp",
["type"]="atkp_yellow_add",
["minnum"]=800,
["maxnum"]=1200
}
},
["obj"]=1,
["icon"]=3
},
[9]={
@ -127,11 +135,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="yellow_atkp",
["type"]="atkp_yellow_add",
["minnum"]=1300,
["maxnum"]=2000
}
},
["obj"]=1,
["icon"]=3
},
[10]={
@ -142,11 +151,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="green_atkp",
["type"]="atkp_green_add",
["minnum"]=300,
["maxnum"]=500
}
},
["obj"]=1,
["icon"]=4
},
[11]={
@ -157,11 +167,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="green_atkp",
["type"]="atkp_green_add",
["minnum"]=800,
["maxnum"]=1200
}
},
["obj"]=1,
["icon"]=4
},
[12]={
@ -172,11 +183,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="green_atkp",
["type"]="atkp_green_add",
["minnum"]=1300,
["maxnum"]=2000
}
},
["obj"]=1,
["icon"]=4
},
[13]={
@ -187,11 +199,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="blue_atkp",
["type"]="atkp_blue_add",
["minnum"]=300,
["maxnum"]=500
}
},
["obj"]=1,
["icon"]=5
},
[14]={
@ -202,11 +215,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="blue_atkp",
["type"]="atkp_blue_add",
["minnum"]=800,
["maxnum"]=1200
}
},
["obj"]=1,
["icon"]=5
},
[15]={
@ -217,11 +231,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="blue_atkp",
["type"]="atkp_blue_add",
["minnum"]=1300,
["maxnum"]=2000
}
},
["obj"]=1,
["icon"]=5
},
[16]={
@ -232,11 +247,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="purple_atkp",
["type"]="atkp_purple_add",
["minnum"]=300,
["maxnum"]=500
}
},
["obj"]=1,
["icon"]=6
},
[17]={
@ -247,11 +263,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="purple_atkp",
["type"]="atkp_purple_add",
["minnum"]=800,
["maxnum"]=1200
}
},
["obj"]=1,
["icon"]=6
},
[18]={
@ -262,11 +279,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="purple_atkp",
["type"]="atkp_purple_add",
["minnum"]=1300,
["maxnum"]=2000
}
},
["obj"]=1,
["icon"]=6
},
[19]={
@ -280,7 +298,7 @@ local skill_rogue = {
["type"]="atkp_add_defenderhp",
["num"]=4000,
["ratio"]=10000,
["round"]=0
["round"]=9999
}
},
["obj"]=1,
@ -292,13 +310,15 @@ local skill_rogue = {
["weight"]=3000,
["qlt"]=2,
["type"]=5,
["attr"]={
["effect"]={
{
["type"]="exp_time",
["minnum"]=500,
["maxnum"]=500
["type"]="exp_time_add",
["num"]=500,
["ratio"]=10000,
["round"]=9999
}
},
["obj"]=1,
["icon"]=8
},
[21]={
@ -309,11 +329,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="hpp",
["type"]="hpp_add",
["minnum"]=300,
["maxnum"]=500
}
},
["obj"]=1,
["icon"]=9
},
[22]={
@ -324,11 +345,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="hpp",
["type"]="hpp_add",
["minnum"]=800,
["maxnum"]=1200
}
},
["obj"]=1,
["icon"]=9
},
[23]={
@ -339,11 +361,12 @@ local skill_rogue = {
["type"]=5,
["attr"]={
{
["type"]="hpp",
["type"]="hpp_add",
["minnum"]=1300,
["maxnum"]=2000
}
},
["obj"]=1,
["icon"]=9
},
[24]={
@ -357,7 +380,7 @@ local skill_rogue = {
["type"]="wavehealp",
["num"]=100,
["ratio"]=10000,
["round"]=0
["round"]=999
}
},
["obj"]=1,
@ -369,13 +392,15 @@ local skill_rogue = {
["weight"]=3000,
["qlt"]=2,
["type"]=5,
["attr"]={
["effect"]={
{
["type"]="cured",
["minnum"]=100,
["maxnum"]=100
["type"]="cured_add",
["num"]=100,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["icon"]=11
},
[26]={
@ -384,13 +409,15 @@ local skill_rogue = {
["weight"]=2000,
["qlt"]=3,
["type"]=5,
["attr"]={
["effect"]={
{
["type"]="block",
["minnum"]=1000,
["maxnum"]=1000
["type"]="block_add",
["num"]=1000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["icon"]=12
},
[27]={
@ -399,13 +426,15 @@ local skill_rogue = {
["weight"]=2000,
["qlt"]=3,
["type"]=5,
["attr"]={
["effect"]={
{
["type"]="crit",
["minnum"]=1000,
["maxnum"]=1000
["type"]="crit_add",
["num"]=1000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["icon"]=13
},
[28]={
@ -414,13 +443,15 @@ local skill_rogue = {
["weight"]=2000,
["qlt"]=3,
["type"]=5,
["attr"]={
["effect"]={
{
["type"]="dmg_dec",
["minnum"]=1000,
["maxnum"]=1000
["type"]="dec_dmg_add",
["num"]=1000,
["ratio"]=10000,
["round"]=999
}
},
["obj"]=1,
["icon"]=14
},
[29]={
@ -433,7 +464,7 @@ local skill_rogue = {
["type"]="healp",
["num"]=100,
["ratio"]=10000,
["round"]=0
["round"]=999
}
},
["obj"]=1,

View File

@ -11,7 +11,6 @@ local localization_global =
["BTN_TEXT_CANCEL"] = "取消",
["BTN_TEXT_OK"] = "确定",
["BATTLE_DESC_1"] = "是否退出战斗",
["ITEM_NOT_ENOUGH"] = "{0}不足",
["START_DESC"] = "开始",
["ELEMENT_NAME_1"] = "红色元素",
@ -26,17 +25,6 @@ local localization_global =
["HERO_DESC_5"] = "激活",
["HERO_DESC_6"] = "已解锁",
["HERO_DESC_7"] = "未解锁",
["GET_REWARDS_DESC"] = "获得奖励",
["CLICK_CLOSE_DESC"] = "点击关闭",
["REWARD_DESC"] = "奖励",
["CONTINUE_DESC"] = "继续",
["BATTLE_DESC_2"] = "暂停",
["BATTLE_DESC_3"] = "刷新",
["BATTLE_DESC_4"] = "达到",
["BATTLE_DESC_5"] = "胜利",
["BATTLE_DESC_6"] = "失败",
["BATTLE_DESC_7"] = "累计造成总伤害:<color=#89FF76>{0}</color>",
}
return localization_global

View File

@ -22,7 +22,7 @@ local struct = {
["parameter3"]="ratio:int",
["parameter4"]="round:int"
},
["attr_range"]={
["effect_range"]={
["parameter1"]="type:string",
["parameter2"]="minnum:int",
["parameter3"]="maxnum:int"

View File

@ -397,6 +397,7 @@ GConst.ENTITY_TYPE = {
}
GConst.MATCH_ATTACK_NAME = {
[0] = "atk",
[1] = "atk_red",
[2] = "atk_yellow",
[3] = "atk_green",

View File

@ -61,6 +61,33 @@ BattleConst.UNIT_STATE = {
DEAD = 5, -- 死亡
}
BattleConst.MATCH_DMG_ADDITION_NAME = {
[0] = "dmg_addition_none",
[1] = "dmg_addition_red",
[2] = "dmg_addition_yellow",
[3] = "dmg_addition_green",
[4] = "dmg_addition_blue",
[5] = "dmg_addition_purple",
}
BattleConst.MATCH_DMG_DEC_NAME = {
[0] = "dec_dmg_none",
[1] = "dec_dmg_red",
[2] = "dec_dmg_yellow",
[3] = "dec_dmg_green",
[4] = "dec_dmg_blue",
[5] = "dec_dmg_purple",
}
BattleConst.MATCH_WEAKNESS_NAME = {
[0] = "weakness_none",
[1] = "weakness_red",
[2] = "weakness_yellow",
[3] = "weakness_green",
[4] = "weakness_blue",
[5] = "weakness_purple",
}
BattleConst.SPINE_ANIMATION_NAME = {
IDLE = "idle",
ATTACK = "atk1",

View File

@ -15,21 +15,28 @@ function BattleFormula:getDamageOrCureResult(unitComp, buff, targetUnitComp)
end
BattleFormula.calculateFormula = {
-- 攻击力乘以系数
-- (攻击)*技能倍率*(1+(攻击者元素伤害增加+所有伤害增加)(攻击者)+(受到元素伤害增加+受到所有伤害增加(受击)-受到元素伤害降低-受到所有伤害降低(受击)*暴击伤害
[1] = function(unitComp, buff, targetUnit)
local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR
local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR *
(DEFAULT_FACTOR + unitComp.unitEntity:getDmgAddition() + targetUnit.unitEntity:getWeakness() - targetUnit.unitEntity:getDmgDec()) // DEFAULT_FACTOR
local hurtState = 0
local crit = unitComp.unitEntity:getCrit()
if crit > 0 then
if BattleHelper:random(1, DEFAULT_FACTOR) <= crit then -- 暴击了
result = result * (DEFAULT_FACTOR + unitComp.unitEntity:getCrittime()) // DEFAULT_FACTOR
hurtState = HURT_STATE_CRIT
end
end
return result, hurtState
end,
-- 目标生命上限的百分比伤害
-- 生命值*回合开始时的回血系数*(1 + 治疗效果增加)
[2] = function(unitComp, buff, targetUnit)
local result = targetUnit.unitEntity:getMaxHp() * buff:getEffectNum() // DEFAULT_FACTOR
local result = targetUnit.unitEntity:getMaxHp() * buff:getEffectNum() // DEFAULT_FACTOR * (unitComp.unitEntity:getCureAddition() + DEFAULT_FACTOR) // DEFAULT_FACTOR
return result, 0
end,
-- 角色攻击力*技能倍率*(1+治疗效果增加)
[3] = function(unitComp, buff, targetUnit)
local result = targetUnit.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR * (unitComp.unitEntity:getCureAddition() + DEFAULT_FACTOR) // DEFAULT_FACTOR
return result, 0
end
}

View File

@ -334,6 +334,7 @@ function BattleData:initHeroData()
attr = {
hp = hp,
max_hp = hp,
atk = 0,
atk_red = heroAttr[ATTR_TYPE.atk_red] // DEFAULT_FACTOR,
atk_yellow = heroAttr[ATTR_TYPE.atk_yellow] // DEFAULT_FACTOR,
atk_green = heroAttr[ATTR_TYPE.atk_green] // DEFAULT_FACTOR,
@ -365,11 +366,12 @@ function BattleData:addMonster(monsterId)
attr = {
hp = hp,
max_hp = hp,
atk_red = atk,
atk_yellow = atk,
atk_green = atk,
atk_blue = atk,
atk_purple = atk,
atk = atk,
atk_red = 0,
atk_yellow = 0,
atk_green = 0,
atk_blue = 0,
atk_purple = 0,
}
}
return self.defTeam:addUnit(unitData)

View File

@ -1,7 +1,14 @@
local BattleConst = require "app/module/battle/battle_const"
local BattleUnitEntity = require "app/userdata/battle/team/battle_unit_entity"
local BattleTeamEntity = class("BattleTeamEntity", BaseData)
local MATCH_ATTACK_NAME = GConst.MATCH_ATTACK_NAME
local MATCH_DMG_ADDITION_NAME = BattleConst.MATCH_DMG_ADDITION_NAME
local MATCH_DMG_DEC_NAME = BattleConst.MATCH_DMG_DEC_NAME
local MATCH_WEAKNESS_NAME = BattleConst.MATCH_WEAKNESS_NAME
function BattleTeamEntity:ctor()
self.members = {}
self.membersCount = 0
@ -9,9 +16,8 @@ end
function BattleTeamEntity:init(side, data)
self.side = side
self.shieldHp = 0
self.hp = 0
self.maxHp = 0
self.baseAttr = {}
self.attr = {}
self.isDead = false
if data then
table.sort(data.units, function(a, b)
@ -29,6 +35,7 @@ function BattleTeamEntity:init(side, data)
for i, unitData in ipairs(data.units) do
local unit = BattleUnitEntity:create()
unit:init(unitData, side, self)
self:addBaseAttr(unitData.attr)
self.members[unitData.matchType] = unit
self.membersCount = self.membersCount + 1
if self.mainHero == nil then
@ -42,6 +49,7 @@ end
function BattleTeamEntity:addUnit(unitData)
local unit = BattleUnitEntity:create()
unit:init(unitData, self.side, self)
self:addBaseAttr(unitData.attr)
self.members[unitData.matchType] = unit
self.membersCount = self.membersCount + 1
if self.mainHero == nil then
@ -51,6 +59,13 @@ function BattleTeamEntity:addUnit(unitData)
return unit
end
function BattleTeamEntity:addBaseAttr(unitAttr)
for k, v in pairs(unitAttr) do
self.baseAttr[k] = (self.baseAttr[k] or 0) + v
self.attr[k] = (self.attr[k] or 0) + v
end
end
function BattleTeamEntity:getAllMembers()
return self.members
end
@ -60,7 +75,35 @@ function BattleTeamEntity:getMembersCount()
end
function BattleTeamEntity:getHpPercent()
return self.hp / self.maxHp
return self.attr.hp / self.attr.max_hp
end
function BattleTeamEntity:getAtk(matchType)
return self.attr[MATCH_ATTACK_NAME[matchType]] or 0
end
function BattleTeamEntity:getDmgAddition(matchType)
return (self.attr.dmg_addition or 0) + (self.attr[MATCH_DMG_ADDITION_NAME[matchType]] or 0)
end
function BattleTeamEntity:getDmgDec(matchType)
return (self.attr.dec_dmg or 0) + (self.attr[MATCH_DMG_DEC_NAME[matchType]] or 0)
end
function BattleTeamEntity:getWeakness(matchType)
return (self.attr.weakness or 0) + (self.attr[MATCH_WEAKNESS_NAME[matchType]] or 0)
end
function BattleTeamEntity:getCrittime()
return self.attr.crittime or 0
end
function BattleTeamEntity:getCrit()
return self.attr.crit or 0
end
function BattleTeamEntity:getCureAddition()
return self.attr.cure_addition or 0
end
function BattleTeamEntity:takeDamageOrCure(num)
@ -70,18 +113,18 @@ function BattleTeamEntity:takeDamageOrCure(num)
return 0
end
end
local hpBefore = self.hp
self.hp = self.hp + num
local hpBefore = self.attr.hp
self.attr.hp = self.attr.hp + num
local hurtEventNum = 0
if self.hp <= 0 then -- 死了
if self.attr.hp <= 0 then -- 死了
hurtEventNum = -hpBefore
self:die()
elseif self.hp < self.maxHp then
elseif self.attr.hp < self.attr.max_hp then
hurtEventNum = num
else -- 满血了
-- 这是加血
hurtEventNum = 0
self.hp = self.maxHp
self.attr.hp = self.attr.max_hp
end
return hurtEventNum
end

View File

@ -9,24 +9,9 @@ function BattleUnitEntity:init(unitData, side, team)
self.unitData = unitData
self.side = side
self.team = team
self:initAttr()
self:initSkill()
end
function BattleUnitEntity:initAttr()
local attr = self.attr or {}
if self.attr then -- 已经初始化过了
for k, v in pairs(attr) do
attr[k] = self.unitData.attr[k] or 0
end
else
for k, v in pairs(self.unitData.attr) do
attr[k] = v
end
end
self.attr = attr
end
function BattleUnitEntity:initSkill()
self.activeSkills = {}
if self.unitData.normalSkill then
@ -72,4 +57,32 @@ function BattleUnitEntity:getHpPercent()
return self.team:getHpPercent()
end
function BattleUnitEntity:getAtk()
return self.team:getAtk(self.unitData.matchType)
end
function BattleUnitEntity:getDmgAddition()
return self.team:getDmgAddition(self.unitData.matchType)
end
function BattleUnitEntity:getDmgDec()
return self.team:getDmgDec(self.unitData.matchType)
end
function BattleUnitEntity:getWeakness()
return self.team:getWeakness(self.unitData.matchType)
end
function BattleUnitEntity:getCrit()
return self.team:getCrit()
end
function BattleUnitEntity:getCrittime()
return self.team:getCrittime()
end
function BattleUnitEntity:getCureAddition()
return self.team:getCureAddition()
end
return BattleUnitEntity