2007
10.17

Blacksmith

There’s a new merchant in town and he can fix your weapons and armors. Nothing special here. You see your inventory and you choose what you want to be repaired. Items that are not damaged or that are too expensive are greyed.

3 comments so far

Add Your Comment
  1. How do you calculate the cost of repairing an item?

  2. cost = itemCost * 2 * repairAmount

    repairAmount = itemCurrentDurability / itemTotalDurability

    itemTotalDurability : number of times an item can take damages before it breaks apart

    itemCurrentDurability : remaining durability

    Thus, repairing an item almost completely broken cost you twice the price of a brand new item of the same type. As lots of other things, this has to be balanced…

  3. oops.. you may have corrected yourself :

    repairAmount = 1 – itemCurrentDurability / itemTotalDurability