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
This commit is contained in:
Lemongrass3110 2016-08-10 23:06:41 +02:00
parent 5090693182
commit 8857ff6279
4 changed files with 31 additions and 0 deletions

View File

@ -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.<variable name>, <default value>, <minimum value>, <maximum value> },
**/

View File

@ -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:
* <datatype> name;
**/

View File

@ -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

View File

@ -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);