diff --git a/SimpleTUOLiveSim-x86.exe b/SimpleTUOLiveSim-x86.exe index f11e362c..3318410a 100644 Binary files a/SimpleTUOLiveSim-x86.exe and b/SimpleTUOLiveSim-x86.exe differ diff --git a/SimpleTUOLiveSim.exe b/SimpleTUOLiveSim.exe index 403f29a0..cec315cb 100644 Binary files a/SimpleTUOLiveSim.exe and b/SimpleTUOLiveSim.exe differ diff --git a/sim.cpp b/sim.cpp index 432e8050..58ec92b6 100644 --- a/sim.cpp +++ b/sim.cpp @@ -3167,7 +3167,7 @@ int evaluate_skill(Field* fd,const Card* c , SkillSpec* ss) { // TODO optimize this int tvalue = ss->x; - + if(ss->card_id != 0)tvalue += 1*evaluate_card(fd,card_by_id_safe(fd->cards,ss->card_id)); tvalue += 10*(ss->id==Skill::flurry); tvalue += 10*(ss->id==Skill::jam); @@ -3242,8 +3242,8 @@ int evaluate_skill(Field* fd,const Card* c , SkillSpec* ss) int evaluate_card(Field* fd,const Card* cs) { int value = 0; - value += cs->m_health; - value += 2*cs->m_attack; + value += cs->m_health; + value += 2*cs->m_attack; for( auto ss : cs->m_skills) { value += evaluate_skill(fd,cs,&ss); } @@ -3254,8 +3254,8 @@ int evaluate_card(Field* fd,const Card* cs) int evaluate_cardstatus(Field* fd,CardStatus* cs) { int value = 0; - value += cs->m_hp; - value += 2*cs->attack_power(); + value += cs->m_hp; + value += 2*cs->attack_power(); value += cs->protected_value(); for( auto ss : cs->m_card->m_skills) { value += evaluate_skill(fd,cs->m_card,&ss); @@ -3354,14 +3354,18 @@ Results evaluate_sim_result(Field* fd, bool single_turn_both) { unsigned enemy_brawl_score = evaluate_brawl_score(fd, 1); unsigned max_score = max_possible_score[(size_t)OptimizationMode::brawl_defense]; - return {0, 0, 1, (points_score_type)(max_score - enemy_brawl_score)}; + if(enemy_brawl_score> max_score) + std::cerr << "WARNING: enemy_brawl_score > max_possible_brawl_score" << std::endl; + return {0, 0, 1, (points_score_type)safe_minus(max_score , enemy_brawl_score)}; } case OptimizationMode::war: return {0,0,1, (points_score_type) 20}; case OptimizationMode::war_defense: { unsigned enemy_war_score = evaluate_war_score(fd, 1); unsigned max_score = max_possible_score[(size_t)OptimizationMode::war_defense]; - return {0, 0, 1, (points_score_type)(max_score - enemy_war_score)}; + if(enemy_war_score> max_score) + std::cerr << "WARNING: enemy_war_score > max_possible_war_score" << std::endl; + return {0, 0, 1, (points_score_type)safe_minus(max_score , enemy_war_score)}; } #ifndef NQUEST case OptimizationMode::quest: return {0, 0, 1, (points_score_type)(fd->quest.must_win ? 0 : quest_score)}; diff --git a/tyrant.cpp b/tyrant.cpp index ed0a271b..84df0e58 100644 --- a/tyrant.cpp +++ b/tyrant.cpp @@ -67,7 +67,7 @@ unsigned min_possible_score[]{0, 0, 0, 20, 20, 5, 5, 5, 0 , 0 #endif }; -unsigned max_possible_score[]{100, 100, 100, 208, 208, 100000, 100000, 100, 100 +unsigned max_possible_score[]{100, 100, 100, 208, 208, 100, 100, 100, 100 #ifndef NQUEST , 100 #endif