Browse Source

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
Lemongrass3110 8 years ago
parent
commit
8857ff6279
4 changed files with 31 additions and 0 deletions
  1. 13 0
      src/custom/battle_config_init.inc
  2. 14 0
      src/custom/battle_config_struct.inc
  3. 2 0
      src/map/battle.c
  4. 2 0
      src/map/battle.h

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

+ 14 - 0
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:
+ *	 <datatype> name;
+ **/
+

+ 2 - 0
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

+ 2 - 0
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);