Jump to content

Elin:Code Analysis/Hearthstone growth: Difference between revisions

Recalculate the number to account for float to int conversion
m (Trying to make the page shown on dynamic list)
(Recalculate the number to account for float to int conversion)
 
Line 32: Line 32:
Every alive resident that is not livestock has 1 in 3 chance of giving out 1 xp of hearthstone level every day.
Every alive resident that is not livestock has 1 in 3 chance of giving out 1 xp of hearthstone level every day.


If they have a Pioneer job, they are guaranteed to provide 3 additional points of xp everyday.
If they have a Pioneer job, they are guaranteed to provide 3 additional points of xp everyday on top of the normal random chance one.


==Shipping EXP==
==Shipping EXP==
Line 72: Line 72:
That is to say, for the purpose of Hearthstone growth, any item with a shipping price more than 9985 is considered the same.
That is to say, for the purpose of Hearthstone growth, any item with a shipping price more than 9985 is considered the same.


At the same time, every item, '''even if it is sold for nothing''', will also have the minimum exp of '''1.15''' thanks to the +15 of the price in the formula and +1 at the end of it.
At the same time, every item, '''even if it is sold for nothing''', will also have the minimum exp of '''1.15''' (Which will be rounded down to 1 due to being int value) thanks to the +15 of the price in the formula and +1 at the end of it.


But keep in mind, due to the order of operation, the +1 at the end is only applied '''once per type of item'''.
But keep in mind, due to the order of operation, the +1 at the end is only applied '''once per type of item'''.
Line 83: Line 83:
return a / 2 + Rand.rnd(a / 2);
return a / 2 + Rand.rnd(a / 2);
}
}
</syntaxhighlight>In essence, it returns the value at 50-100% of the input. So for an item with 0 selling price, it can now yield anywhere between 0.575 and 1.15 xp.
</syntaxhighlight>In essence, it returns the value at 50-100% of the input rounding down again.


<code>num2 = num2 / 2 + 1;</code>
<code>num2 = num2 / 2 + 1;</code>


Now dividing the value by 2 and plus 1 to it. The 0 sell value item xp is now between 1.2875 - 1.575
Now dividing the value by 2 and plus 1 to it, rounding down for the third time.


This time, the plus one is only applied '''once per shipment''' of item.
This time, the plus one is only applied '''once per shipment''' of item.
Line 115: Line 115:
}
}


</syntaxhighlight>It essentially multiplies the EXP by 1.5 and randomly add 0-1 to it.
</syntaxhighlight>It essentially multiplies the EXP by 1.5 and randomly add 0-1 to it. Rounding down again down to being an int.


==EXP require for each level==
==EXP require for each level==
Line 167: Line 167:
! colspan="2" |Worst Rng
! colspan="2" |Worst Rng
Max Sell value item
Max Sell value item
! colspan="2" |Medium Rng
! colspan="2" |Average Rng
Max Sell value item
Max Sell value item
! colspan="2" |Best Rng
! colspan="2" |Best Rng
Line 188: Line 188:
| rowspan="6" |LV
| rowspan="6" |LV
|1 > 2
|1 > 2
|3,523
|3,540
|5,300
|5,300
|2,340
|2,634
|3,532
|3,974
|1,759
|1,754
|2,647
|2,647
|6
|6
Line 202: Line 202:
|-
|-
|2 > 3
|2 > 3
|8,856
|8,874
|13,300
|13,300
|5,896
|6,634
|8,865
|9,974
|4,416
|4,420
|6,647
|6,647
|14
|14
|18
|20
|9
|10
|14
|15
|7
|7
|10
|10
|-
|-
|3 > 4
|3 > 4
|17,745
|17,754
|26,634
|26,634
|11,822
|13,314
|17,754
|19,974
|8,860
|8,860
|13,314
|13,314
|27
|27
|40
|40
|18
|20
|27
|30
|14
|14
|20
|20
|-
|-
|4 > 5
|4 > 5
|30,189
|30,207
|45,300
|45,300
|20,117
|22,634
|30,198
|33,974
|15,083
|15,087
|22,647
|22,647
|46
|46
|68
|68
|31
|31
|46
|51
|23
|23
|34
|34
|-
|-
|5 > 6
|5 > 6
|46,189
|51,540
|69,300
|77,300
|30,785
|38,634
|46,198
|57,974
|23,083
|25,754
|34,647
|38,647
|70
|78
|104
|116
|47
|58
|70
|87
|34
|39
|52
|58
|-
|-
|6 > 7
|6 > 7
|65,745
|98,634
|43,822
|65,754
|65,754
|98,647
|49,314
|73,974
|32,860
|32,860
|49,314
|49,314
|99
|99
|148
|148
|66
|74
|99
|111
|50
|50
|74
|74
|-
|-
| colspan="2" |Total
| colspan="2" |Total
|172,246
|177,669
|258,468
|266,481
|114,781
|133,164
|172,301
|199,844
|86,061
|88,735
|129,216
|133,216
|262
|270
|386
|400
|175
|197
|262
|300
|131
|136
|194
|200
|}<!-- Someone please peer-review this. Math is my worst subject -->
|}<!-- Someone please peer-review this. Math is my worst subject -->
{{DEFAULTSORT:Code_Analysis/Hearthstone_growth}}
{{DEFAULTSORT:Code_Analysis/Hearthstone_growth}}
[[Category:Elin Spoiler]]
[[Category:Elin Spoiler]]
[[Category:EN]]
[[Category:EN]]