summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Locke <kisuka@kisuka.com>2014-08-12 21:43:49 -0700
committerTaylor Locke <kisuka@kisuka.com>2014-08-12 21:43:49 -0700
commit2b8d5013ea8ba9904d157c773f12495bbca8ca80 (patch)
tree3923ed2b0b14e15aff4b8535eb740ccdf2dc5349
parentcc69b228908d2f74f97cf9b5763f6b3141fdf0d0 (diff)
downloadhercules-2b8d5013ea8ba9904d157c773f12495bbca8ca80.tar.gz
hercules-2b8d5013ea8ba9904d157c773f12495bbca8ca80.tar.bz2
hercules-2b8d5013ea8ba9904d157c773f12495bbca8ca80.tar.xz
hercules-2b8d5013ea8ba9904d157c773f12495bbca8ca80.zip
Battle config option for knockback style when on same tile.
-rw-r--r--conf/battle/battle.conf4
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/map.c7
4 files changed, 10 insertions, 3 deletions
diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf
index 29aa803a0..fc962b008 100644
--- a/conf/battle/battle.conf
+++ b/conf/battle/battle.conf
@@ -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
diff --git a/src/map/battle.c b/src/map/battle.c
index d960b7316..fc159c921 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -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, },
diff --git a/src/map/battle.h b/src/map/battle.h
index 71633372e..dfa156796 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -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;
diff --git a/src/map/map.c b/src/map/map.c
index b26d50fc9..0c8c2d949 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -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