No Description

game_engine.h 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /****************************************************************************
  2. * Copyright (C) 2015-2016 by the SotS Team *
  3. * *
  4. * This file is part of Sovereign of the Skies. *
  5. * *
  6. * Sovereign of the Skies is free software: you can redistribute it *
  7. * and/or modify it *
  8. * under the terms of the GNU Lesser General Public License as published *
  9. * by the Free Software Foundation, either version 3 of the License, or *
  10. * (at your option) any later version provided you include a copy of the *
  11. * licence and this header. *
  12. * *
  13. * Sovereign of the Skies is distributed in the hope that it will be *
  14. * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  16. * GNU Lesser General Public License for more details. *
  17. * *
  18. * You should have received a copy of the GNU Lesser General Public *
  19. * License along with Sovereign of the Skies. *
  20. * If not, see <http://www.gnu.org/licenses/>. *
  21. ****************************************************************************/
  22. /**
  23. * @file game_engine.h
  24. * @author Sturmvogel
  25. * @date 15 dec 2016
  26. * @brief Game Environment
  27. *
  28. * This header file contains methods to interact with the game environment,
  29. * misc. functions i.e. access to flags / variables and (encrypted) pokémon
  30. * data.
  31. */
  32. #ifndef GAME_ENGINE_H
  33. #define GAME_ENGINE_H
  34. /* === INCLUDE === */
  35. #include <types.h>
  36. #include <battle_structs.h>
  37. /* === EXTERN METHODS === */
  38. /**
  39. * @brief get pointer of var
  40. * @param index variable to access
  41. * @return pointer to given variable storage
  42. */
  43. extern u16 *var_access(u32 index);
  44. /**
  45. * @brief gets value of variable at index
  46. * @param index index to get varaible value from
  47. * @return value of VAR[index]
  48. */
  49. extern u16 var_get(u16 index);
  50. /**
  51. * @brief sets variable at index to value
  52. * @param index unsigned index of the variable
  53. * @param value value to set the variable to
  54. * @return true on success, false otherwise
  55. */
  56. extern u8 var_set(u16 index, u16 value);
  57. /**
  58. * @brief checks if flag is set
  59. * @param flag index of flag to check
  60. * @return flag status (bool)
  61. */
  62. extern u8 flag_check(u32 flag);
  63. /**
  64. * @brief clears a flag
  65. * @param flag flag index to clear
  66. */
  67. extern void flag_clear(u16 flag);
  68. /**
  69. * @brief gets attribute of pokémon
  70. * @param poke_address address to pokémon structure
  71. * @param request request from the attribute request table
  72. * @param destination destination to write to (if not returned directly)
  73. * @return requested value (if not too big)
  74. */
  75. extern u32 pokemon_get_attribute(struct pokemon* poke_address, u8 request, void* destination);
  76. /**
  77. * @brief sets attribute of pokémon
  78. * @param poke_address address to pokémon structure
  79. * @param request request from the attribute request table
  80. * @param new_value pointer to new value
  81. */
  82. void pokemon_set_attribute(struct pokemon* poke_address, u8 request, void* new_value);
  83. /**
  84. * @brief gets the gender of the selected pokemon
  85. * @param poke_address address to pokémon structure
  86. * @return true if the pokémon is female, false otherwise
  87. */
  88. extern u8 pokemon_get_gender(struct pokemon* poke_address);
  89. /**
  90. * @brief gets x12 value of item
  91. * @param item_id item to get value of
  92. * @return corresponding x12 value
  93. */
  94. extern u8 item_get_x12(u16 item_id);
  95. /* TODO: Implement without macros */
  96. #define pokemon_party_player ((struct pokemon*) 0x02024284)
  97. #endif /* GAME_ENGINE_H */