Skip to content

Commit

Permalink
进一步修复计算BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinosaur-MC committed Oct 14, 2024
1 parent 0360da6 commit 13c42ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#define PROGRAM_NAME_CN "最佳附魔顺序计算器"
#define PROGRAM_NAME_EN "The Best Enchanting Sequence"
#define VERSION "2.2.0_Beta"
#define VERSION_ID 12410110 //NyymmXXx; N:1, yy:the two last number of recent year, mm:recent month, XX:version number, x:small number
#define VERSION "2.2.1_Beta"
#define VERSION_ID 12410140 //NyymmXXx; N:1, yy:the two last number of recent year, mm:recent month, XX:version number, x:small number
#define AUTHOR "Dinosaur_MC(Dinosaur-MC)"
#define WEBSITE "https://github.com/Dinosaur-MC/BestEnchSeq"
#define UPDATE_JSON "https://raw.githubusercontent.com/Dinosaur-MC/BestEnchSeq/main/update.json"
Expand Down
10 changes: 5 additions & 5 deletions itempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ Step ItemPool::preForge(Item A, Item B, ForgeMode mode)
cost += Basic::ench_table[Basic::searchTable(B.ench[i].name)].multiplier[0] * combine(B.ench[i].name, A.ench[q].lvl, B.ench[i].lvl);
} else {
if (B.name == ID_ECB)
cost += Basic::ench_table[Basic::searchTable(B.ench[i].name)].multiplier[1] * (combine(B.ench[i].name, A.ench[q].lvl, B.ench[i].lvl) - A.ench[i].lvl);
cost += Basic::ench_table[Basic::searchTable(B.ench[i].name)].multiplier[1] * (combine(B.ench[i].name, A.ench[q].lvl, B.ench[i].lvl) - A.ench[q].lvl);
else
cost += Basic::ench_table[Basic::searchTable(B.ench[i].name)].multiplier[0] * (combine(B.ench[i].name, A.ench[q].lvl, B.ench[i].lvl) - A.ench[i].lvl);
cost += Basic::ench_table[Basic::searchTable(B.ench[i].name)].multiplier[0] * (combine(B.ench[i].name, A.ench[q].lvl, B.ench[i].lvl) - A.ench[q].lvl);
}
} else {
if (B.name == ID_ECB)
Expand Down Expand Up @@ -405,7 +405,7 @@ Item ItemPool::forge(Item A, Item B)

int q = Basic::searchEnch(A.ench, A_el, B.ench[i].name);
if (q != -1) {
A.ench[q].lvl = combine(B.ench[i].name, A.ench[q].lvl, B.ench[q].lvl);
A.ench[q].lvl = combine(B.ench[i].name, A.ench[q].lvl, B.ench[i].lvl);
} else {
int k = 0;
while (k < INIT_LENGTH && A.ench[k].name != "")
Expand All @@ -416,7 +416,7 @@ Item ItemPool::forge(Item A, Item B)
}

if (A.duration != 100 && B.duration != 0) {
A.duration += B.penalty;
A.duration += B.duration;
A.duration *= 1.12;
if (A.duration > 100)
A.duration = 100;
Expand All @@ -429,7 +429,7 @@ Item ItemPool::forge(Item A, Item B)
int combine(QString ench, int a, int b)
{
if (a == b && a != Basic::ench_table[Basic::searchTable(ench)].mlvl)
return ++a;
return a + 1;
else
return max(a, b);
}

0 comments on commit 13c42ec

Please sign in to comment.