StendhalRefactoringRP: Difference between revisions

Content deleted Content added
imported>Neoneurone
No edit summary
imported>Kiheru
Melee Combat; the new formula
Line 39:
Combat right now works as follows:
# 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 recievedreceived.
 
The formula looks like:
<pre>
risk_to_hit = 220 * source[ATK] - target[DEF]+ roll[1D20] -* 10target[DEF]
 
if risk_to_hit > 0:
attacker_partmax_defence = 0.8 * (rolltarget[1D100DEF] /* 100)(10 *+ source[ATKARMOR]^2)) * (10 + 40.03 * source(target[ATKLEVEL] + 5)) * weaponrandom[0..1];
maxdamagemax_attack = source[ATK] * (1 + source[WEAPON])* (1 + 0.803 * (source[ATK]^2LEVEL + 45)) * weaponspeed_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_part8 -* defender_part)max_attack /* maxdamage)random[0..1] *- (maxdamagemax_defence /* sourcerandom[ATK0..1]) / max_defence);
</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...
The benefictsbenefits 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 ).