From 8857ff6279923743284b68e8d79e94fe3f468396 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Wed, 10 Aug 2016 23:06:41 +0200 Subject: [PATCH] Added custom battle config support You can now define custom battle config structure members in src/custom/battle_config_struct.inc and initialize them in src/custom/battle_config_init.inc You can put the configuration into any battle configuration file, but we recommend you to put it into conf/import/battle_conf.txt --- src/custom/battle_config_init.inc | 13 +++++++++++++ src/custom/battle_config_struct.inc | 14 ++++++++++++++ src/map/battle.c | 2 ++ src/map/battle.h | 2 ++ 4 files changed, 31 insertions(+) create mode 100644 src/custom/battle_config_init.inc create mode 100644 src/custom/battle_config_struct.inc diff --git a/src/custom/battle_config_init.inc b/src/custom/battle_config_init.inc new file mode 100644 index 00000000000..c2a4555f2ce --- /dev/null +++ b/src/custom/battle_config_init.inc @@ -0,0 +1,13 @@ +// Copyright (c) Athena Dev Teams - Licensed under GNU GPL +// For more information, see LICENCE in the main folder + +/** + * Custom battle config initializations + * Place the definition of custom battle configuration initializations in this file. + * + * Do not forget to add a comma at the end of the line, if you want to add another config + * + * Format: + * { "name", &battle_config., , , }, + **/ + diff --git a/src/custom/battle_config_struct.inc b/src/custom/battle_config_struct.inc new file mode 100644 index 00000000000..a5278525868 --- /dev/null +++ b/src/custom/battle_config_struct.inc @@ -0,0 +1,14 @@ +// Copyright (c) Athena Dev Teams - Licensed under GNU GPL +// For more information, see LICENCE in the main folder + +/** + * Custom battle config structure + * Place the definition of custom battle configuration structure members in this file. + * + * Make sure that the name you want is not already taken by looking into battle.h + * Do not forget to add initilization logic to battle_config_init.inc + * + * Format: + * name; + **/ + diff --git a/src/map/battle.c b/src/map/battle.c index 17a4ccb3ac1..514ac33fabd 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -8329,6 +8329,8 @@ static const struct _battle_data { { "exp_cost_inspiration", &battle_config.exp_cost_inspiration, 1, 0, 100, }, { "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, }, { "can_damage_skill", &battle_config.can_damage_skill, 1, 0, BL_ALL, }, + +#include "../custom/battle_config_init.inc" }; #ifndef STATS_OPT_OUT diff --git a/src/map/battle.h b/src/map/battle.h index 2618ed55863..013581a8d03 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -610,6 +610,8 @@ extern struct Battle_Config int exp_cost_inspiration; int mvp_exp_reward_message; int can_damage_skill; //Which BL types can damage traps + +#include "../custom/battle_config_struct.inc" } battle_config; void do_init_battle(void);