Skip to content

Commit

Permalink
Battle config option for knockback style when on same tile.
Browse files Browse the repository at this point in the history
  • Loading branch information
kisuka committed Aug 13, 2014
1 parent cc69b22 commit 2b8d501
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions conf/battle/battle.conf
Expand Up @@ -142,3 +142,7 @@ arrow_decrement: 1
// range. For example, Sonic Blow requires a 2 cell distance before autocasting is allowed.
// This setting also affects autospellwhenhit.
autospell_check_range: no

// If both the attacker and the target are on the same tile, should the target be knocked back to the left?
// Official behavior is "yes", setting this to "no" will knock the target back behind the attacker.
knockback_left: yes
1 change: 1 addition & 0 deletions src/map/battle.c
Expand Up @@ -6714,6 +6714,7 @@ static const struct battle_data {
{ "invincible.nodamage", &battle_config.invincible_nodamage, 0, 0, 1, },
{ "mob_slave_keep_target", &battle_config.mob_slave_keep_target, 0, 0, 1, },
{ "autospell_check_range", &battle_config.autospell_check_range, 0, 0, 1, },
{ "knockback_left", &battle_config.knockback_left, 1, 0, 1, },
{ "client_reshuffle_dice", &battle_config.client_reshuffle_dice, 0, 0, 1, },
{ "client_sort_storage", &battle_config.client_sort_storage, 0, 0, 1, },
{ "feature.buying_store", &battle_config.feature_buying_store, 1, 0, 1, },
Expand Down
1 change: 1 addition & 0 deletions src/map/battle.h
Expand Up @@ -416,6 +416,7 @@ struct Battle_Config {
int invincible_nodamage;
int mob_slave_keep_target;
int autospell_check_range; //Enable range check for autospell bonus. [L0ne_W0lf]
int knockback_left;
int client_reshuffle_dice; // Reshuffle /dice
int client_sort_storage;
int feature_buying_store;
Expand Down
7 changes: 4 additions & 3 deletions src/map/map.c
Expand Up @@ -2413,9 +2413,10 @@ uint8 map_calc_dir(struct block_list* src, int16 x, int16 y)
dx = x-src->x;
dy = y-src->y;
if( dx == 0 && dy == 0 )
{ // both are standing on the same spot
dir = 6; // aegis-style, makes knockback default to the left
//dir = unit->getdir(src); // athena-style, makes knockback default to behind 'src'
{ // both are standing on the same spot.
// aegis-style, makes knockback default to the left.
// athena-style, makes knockback default to behind 'src'.
dir = (battle_config.knockback_left ? 6 : unit->getdir(src));
}
else if( dx >= 0 && dy >=0 )
{ // upper-right
Expand Down

2 comments on commit 2b8d501

@MayakoAelys
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for leaving us the choice!

@kisuka
Copy link
Contributor Author

@kisuka kisuka commented on 2b8d501 Aug 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MayakoLyyn no problem.

Please sign in to comment.