StendhalRefactoringRP: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Neoneurone
No edit summary
imported>Kiheru
Melee Combat; the new formula
Line 39: Line 39:
Combat right now works as follows:
Combat right now works as follows:
# We compute the ''risk'' to hit the target, using their ATK and DEF attributes-
# We compute the ''risk'' to hit the target, using their ATK and DEF attributes-
# If risk>0 then we compute if the target blocks the attack, or how much damage the target recieved.
# If risk>0 then we compute if the target blocks the attack, or how much damage the target received.


The formula looks like:
The formula looks like:
<pre>
<pre>
risk_to_hit = 2 * source[ATK] - target[DEF]+ roll[1D20] - 10
risk_to_hit = 20 * source[ATK] - roll[1D20] * target[DEF]


if risk_to_hit > 0:
if risk_to_hit > 0:
attacker_part = 0.8 * (roll[1D100] / 100) * source[ATK]^2 + 4 * source[ATK] * weapon
max_defence = (target[DEF] * (10 + source[ARMOR])) * (10 + 0.03 * (target[LEVEL] + 5)) * random[0..1];
maxdamage = 0.8 * source[ATK]^2 + 4 * weapon
max_attack = source[ATK] * (1 + source[WEAPON])* (1 + 0.03 * (source[LEVEL + 5)) * speed_effect * random[0..1];
where: speed_effect = 1.0 - 0.5 * speed_part * level_part^2;
defender_part = 0.6 * (roll[1D100] / 100) * target[DEF]^2 + 4 * target[DEF] * shield + 2 * target[DEF] *
where: speed_part = 8 / (source[ATTACK_RATE] + 3.0);
armor + target[DEF]* helmet + target[DEF] * legs + target[DEF] * boots
level_part = 1.0 - (target[LEVEL] + 5) / (1.2 * (source[LEVEL] + 5));


damage = ((attacker_part - defender_part) / maxdamage) * (maxdamage / source[ATK])
damage = (8 * max_attack * random[0..1] - max_defence * random[0..1]) / max_defence);
</pre>
</pre>
There's also small karma effect for both the hitting chance and damage.


See that it is very important the ATK and DEF value, but that you can also get big improvements using weapons, armors, shields, etc...
See that it is very important the ATK and DEF value, but that you can also get big improvements using weapons, armors, shields, etc...
The beneficts you get from weapons and armors are directly proportional to your level.
The benefits you get from weapons and armors are directly proportional to your level.


The formula is nicer than previous one because it gives a good range of damages and it adds lineal damage increase for using weapons and lineal damage absortion for using armors. Now the point is to give values to monsters that will always lack of equipment ( to simplify everything ).
The formula is nicer than previous one because it gives a good range of damages and it adds lineal damage increase for using weapons and lineal damage absortion for using armors. Now the point is to give values to monsters that will always lack of equipment ( to simplify everything ).