StendhalRefactoringRP: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kiheru
m Melee Combat: removed surplus trailing parenthesis
imported>Kiheru
Range Combat: Updated ranged damage formula to correspond to current code
Line 68: Line 68:


===Range Combat===
===Range Combat===
Should be based on the above formula but:
Damage from ranged attacks is based on the above formula, but:
* We have a maximun range
* We have a maximum range
* Weapon is only effective on middle-long range
* Weapon is most effective on middle range
* Damage also depends of the arrow
* Item ATK is the sum of the bow and arrow ATK values


So a nice formula would be:
<pre>
<pre>
ranged_damage = distance_modifier * normal_damage
range_damage = damage * ( actual_distance / max range of weapon )
where:

if range = 0
if actual_distance < min_range:
range_damage = damage / 20
distance_modifier = 0.8
else
if actual_distance > max_range:
distance_modifier = 4 * (distance / out_of_range - distance^2 / out_of_range^2)
range_damage = 0
where:
out_of_range = max_range + 1,
</pre>
</pre>
Thus <code>ranged_damage</code> reaches the normal maximum damage at middle range, and drops to 0 at maximum range + 1. The point blank case is treated specially to avoid archers being completely helpless at melee.


Here is some improved formulas for ranged combat, they also use arrow damage.

<pre>
attacker_part = 0.8 * (roll[1D100] / 100) * source[ATK]^2 + 4 * source[ATK] * (weapon + arrow)
maxdamage = 0.8 * source[ATK]^2 + 4 * (weapon + arrow)

range_damage = damage * ( 1 - (actual_distance / max_range) ) + ( damage - damage * ( 1 - (min_range / max_range) ) ) *
( 1 - (actual_distance / max_range) )
</pre>
==Tactics slider==
==Tactics slider==
As a more or less easy to implement feature I (Zuse) suggest tactics sliders. A single (or more) slider(s) which can be adjusted by the player during the game.
As a more or less easy to implement feature I (Zuse) suggest tactics sliders. A single (or more) slider(s) which can be adjusted by the player during the game.