Skip to content

Commit

Permalink
Fix Blade Stop effect trigger conditions
Browse files Browse the repository at this point in the history
1. Only in Pre-RE player attacks will cause blade stop to trigger from
   far away.
   In RE, distance checks apply the same as for non-player attacks (i.e. monsters)
2. For both modes, Blade Stop distance is always to 2 cells, regardless
   of equipped weapon. Even bare hands should work for up to 2 cells.
  • Loading branch information
guilherme-gm committed Nov 15, 2023
1 parent 9a5c87d commit 8810ae3
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ static int64 battle_calc_defense(int attack_type, struct block_list *src, struct
def1 = 0;
if (def2 < 1)
def2 = 1;

//Vitality reduction from rodatazone: http://rodatazone.simgaming.net/mechanics/substats.php#def
if (tsd) {
//Sd vit-eq
Expand Down Expand Up @@ -6518,19 +6518,18 @@ static bool battle_should_bladestop_attacker(struct block_list *attacker, struct
if (is_boss(attacker))
return false; // Boss monsters are not affected

// CHECKME: Is that right?
#ifndef RENEWAL
if (attacker->type == BL_PC)
return true; // Player gets into BladeStop regardless of distance
return true; // In Pre-RE (Ep 11.2), player attackers are BladeStopped regardless of the distance
#endif

struct map_session_data *tsd = BL_CAST(BL_PC, target);
if (tsd != NULL) {
int max_distance = tsd->weapontype == W_FIST ? 1 : 2;
return distance_bl(attacker, target) <= max_distance;
if (target->type != BL_PC) {
// Non-player targets causes BladeStop regardless of distance (Hercules-custom).
// Officially, non-player units does not use Blade Stop.
return true;
}

// CHECKME: Is that right?
// Target is not a player. BladeStop starts regardless of distance
return true;
return (distance_bl(attacker, target) <= 2);
}

/*==========================================
Expand Down

0 comments on commit 8810ae3

Please sign in to comment.