27.03.2009, 01:07
You can do it like this:
final_price = ( undamaged_car_price * ( car_health / max_car_health ) )
if undamaged_car_price is 100000$, and if car is damaged 40% (car_health=600) then it is
final_price = ( 100000 * ( 600 / 1000 ) ) = ( 100000 * 0.6 ) = 60000$
It is not realistic because more the car is damaged, and less it will cost money, not proportionally, i think, if car is damaged only 20% then price should be ~60% of undamaged car price, and if damage is 50% then price should be ~25% of undamaged car price.. Need think about this but it is too late in now : ))
final_price = ( undamaged_car_price * ( car_health / max_car_health ) )
if undamaged_car_price is 100000$, and if car is damaged 40% (car_health=600) then it is
final_price = ( 100000 * ( 600 / 1000 ) ) = ( 100000 * 0.6 ) = 60000$
It is not realistic because more the car is damaged, and less it will cost money, not proportionally, i think, if car is damaged only 20% then price should be ~60% of undamaged car price, and if damage is 50% then price should be ~25% of undamaged car price.. Need think about this but it is too late in now : ))