diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-09 16:29:25 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-09 16:29:25 +0000 |
commit | 16a5056b8ff9f7b67d674c967385c76791137755 (patch) | |
tree | ab325d1c0d365b54dfd708c646e0d509d1f7bbe0 /src/map | |
parent | e53a0dc7cb588a1e0ec85afb87c402e30dc3773b (diff) | |
download | hercules-16a5056b8ff9f7b67d674c967385c76791137755.tar.gz hercules-16a5056b8ff9f7b67d674c967385c76791137755.tar.bz2 hercules-16a5056b8ff9f7b67d674c967385c76791137755.tar.xz hercules-16a5056b8ff9f7b67d674c967385c76791137755.zip |
- Cleaned up some the code of TF_DOUBLE and GS_CHAINACTION.
- Removed the code which was auto-setting attacks that do no damage to type FLEE, since that was disabling status-effects which should incur even when the damage was blocked.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8208 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 5044543bf..32857bcb3 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1943,23 +1943,23 @@ static struct Damage battle_calc_weapon_attack( if(sd && !skill_num && !flag.cri) { //Check for double attack. - if(( (skill_lv = 5*pc_checkskill(sd,TF_DOUBLE)) > 0 && sd->weapontype1 == W_DAGGER) || - sd->double_rate > 0) //Success chance is not added, the higher one is used? [Skotlex] - { - if (rand()%100 < (skill_lv>sd->double_rate?skill_lv:sd->double_rate)) + if(((skill_lv = pc_checkskill(sd,TF_DOUBLE)) > 0 && sd->weapontype1 == W_DAGGER) || sd->double_rate > 0) + { //Success chance is not added, the higher one is used [Skotlex] + if (rand()%100 < (5*skill_lv>sd->double_rate?5*skill_lv:sd->double_rate)) { - wd.div_=skill_get_num(TF_DOUBLE,skill_lv?skill_lv/5:1); + wd.div_=skill_get_num(TF_DOUBLE,skill_lv?skill_lv:1); damage_div_fix(wd.damage, wd.div_); wd.type = 0x08; } - } else if ((skill_lv = pc_checkskill(sd,GS_CHAINACTION)) > 0 && sd->weapontype1 == W_REVOLVER) + } else + if (sd->weapontype1 == W_REVOLVER && + (skill_lv = pc_checkskill(sd,GS_CHAINACTION)) > 0 && + (rand()%100 < 5*skill_lv) + ) { - if (rand()%100 < 5*skill_lv) - { - wd.div_=skill_get_num(GS_CHAINACTION,skill_lv); - damage_div_fix(wd.damage, wd.div_); - wd.type = 0x08; - } + wd.div_=skill_get_num(GS_CHAINACTION,skill_lv); + damage_div_fix(wd.damage, wd.div_); + wd.type = 0x08; } } @@ -2460,7 +2460,7 @@ struct Damage battle_calc_magic_attack( damage_div_fix(ad.damage, ad.div_); if (flag.infdef && ad.damage) - ad.damage/= ad.damage; //Why this? Because, well, if damage is absorbed, it should heal 1, not do 1 dmg. + ad.damage = ad.damage>0?1:-1; ad.damage=battle_calc_damage(src,target,ad.damage,ad.div_,skill_num,skill_lv,ad.flag); if (map_flag_gvg(target->m)) @@ -2747,10 +2747,8 @@ struct Damage battle_calc_attack( int attack_type, break; } if (d.damage + d.damage2 < 1 && d.dmg_lv != ATK_LUCKY) - { //Miss/Absorbed - d.dmg_lv = ATK_FLEE; + //Miss/Absorbed d.dmotion = 0; - } return d; } |