看到友友們在論壇都在求什麼強化技巧,強化攻略。那麼那些所謂的技巧到底靠不靠譜呢?這不,一位IT界的專業人士就自己做了個程式分析了一下強化的金幣花費。
花了20分鐘做的程式,統計了70級武器15強化到20的金幣消耗,結果如下。

附上SourceCode
//武器等級
private
static
int
currentLevel
=
15;
//亂數產生器
private
static
Random
randomNumGernerater
=
new
Random();
static
void
Main(string[]
args)
{
int
maxGoldUse
=
0;
//最大金幣消耗
int
minGoldUse
=
10000;
//最小金幣消耗
int
loopTime
=
1000;
//樣本數
int
totalGoldUse
=
0;
//所有樣本金幣總消耗
int
averageGoldUse
=
0;
//平均金幣消耗
for
(int
i
=
0;
i
<
loopTime;
i++)
{
int
updateTo20GoldUsed
=
CaculateUpdaeteGold();
//計算一次升級消耗的金幣
maxGoldUse
=
(updateTo20GoldUsed
>
maxGoldUse)
?
updateTo20GoldUsed
:
maxGoldUse;
minGoldUse
=
(updateTo20GoldUsed
<
minGoldUse)
?
updateTo20GoldUsed<br />:
minGoldUse;
totalGoldUse
+=
updateTo20GoldUsed;
}
averageGoldUse
=
totalGoldUse
/
loopTime;
//計算平均金幣消耗
Console.WriteLine("樣本數:
"
+
loopTime);
Console.WriteLine("最小金幣消耗:
"
+
minGoldUse);
Console.WriteLine("最大金幣消耗
"
+
maxGoldUse);
Console.WriteLine("平均金幣消耗:
"
+
averageGoldUse);
Console.ReadLine();
}
//計算從15升級到20所消耗的金幣
static
int
CaculateUpdaeteGold()
{
int
goldSum
=
0;
do
{
goldSum
+=
UpdateOnce();
//一直升級到20級跳出迴圈
}
while
(currentLevel
<
20);
currentLevel
=
15;
//迴圈結束後重置武器等級為15,進入下一次樣本分析
return
goldSum;
}
//點一次升級,返回金幣消耗
static
int
UpdateOnce()
{
int
goldUsed
=
GetGoldUseByLevel(currentLevel);
//獲取本次升級消耗的金幣
int
nextRandomNum
=
randomNumGernerater.Next(1000);
//取亂數
if
(nextRandomNum
<
GetOKPercentByLevel(currentLevel))
{
//當級別為16時,如果亂數小於355,則意味著升級成功
currentLevel++;
}
if
(nextRandomNum
>=
1000
–
GetNGPercentByLevel(currentLevel))
{
//當級別為16時,如果亂數大於1000-300=700,則意味著降級
currentLevel–;
}
return
goldUsed;
}
//獲取不同等級的升級金幣消耗
static
int
GetGoldUseByLevel(int
level)
{
int
godUse
=
0;
if
(level
==
15)
godUse
=
10;
if
(level
==
16)
godUse
=
11;
if
(level
==
17)
godUse
=
11;
if
(level
==
18)
godUse
=
12;
if
(level
==
19)
godUse
=
13;
return
godUse;
}
//獲取不同等級的升級成功概率
static
int
GetOKPercentByLevel(int
level)
{
int
percent
=
0;
if
(level
==
15)
percent
=
385;
if
(level
==
16)
percent
=
355;
if
(level
==
17)
percent
=
315;
if
(level
==
18)
percent
=
290;
if
(level
==
19)
percent
=
255;
return
percent;
}
//獲取不同等級的降級概率
static
int
GetNGPercentByLevel(int
level)
{
int
percent
=
0;
if
(level
==
15)
percent
=
0;
if
(level
==
16)
percent
=
300;
if
(level
==
17)
percent
=
329;
if
(level
==
18)
percent
=
351;
if
(level
==
19)
percent
=
380;
return
percent;
}
結果就是強化技巧不過是一種心理上的安慰罷了,平均消耗金幣大約600個。文章來自網絡,若有版權問題請聯繫站長刪除,更多時空獵人攻略,請關注時空獵人