暂无描述

battle_help.h 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 battle_help.h
  24. * @author Sturmvogel
  25. * @date 15 dec 2016
  26. * @brief Some helper methods to calculate in-battle outcomes etc.
  27. */
  28. #ifndef BATTLE_HELP_H_
  29. #define BATTLE_HELP_H_
  30. #include <types.h>
  31. /**
  32. * @brief get item effect of bank
  33. * @param bank bank to check effect
  34. * @param check_negating_effects if true only return effect if it can be executed
  35. * @return item effect of item held by bank
  36. */
  37. u8 battle_item_get_effect(u8 bank, u8 check_negating_effects);
  38. /**
  39. * @brief update the chained effectiveness according to parameters
  40. * @param attacking_type type of attacking move
  41. * @param defending_type type of defender
  42. * @param atk_bank bank of attacker
  43. * @param def_bank bank of defender
  44. * @param chained_effect previously chained effect
  45. * @param airstatus airborne status according to enumeration
  46. * @return new chained effect
  47. */
  48. u16 battle_damage_type_effectiveness_update(u8 attacking_type, u8 defending_type, u8 atk_bank, u8 def_bank, u16 chained_effect, u8 airstatus);
  49. /**
  50. * @brief fully calculate effectiveness from a base effectiveness (def: 64)
  51. * @param chained_effect chained input (def: 64)
  52. * @param move_type attacking move type
  53. * @param target_bank bank of target
  54. * @param atk_bank bank of attacker
  55. * @param airstatus airstatus of defender
  56. * @return chained effectiveness
  57. */
  58. u16 battle_apply_type_effectiveness(u16 chained_effect, u8 move_type, u8 target_bank, u8 atk_bank, u8 airstatus);
  59. /**
  60. * @brief calculate type effectiveness from front to back
  61. * @param move executed move
  62. * @param move_type type of executed move according to type enumeration
  63. * @param atk_bank bank of attacker
  64. * @param def_bank bank of defender
  65. * @param effects_handling_and_recording TO BE DONE
  66. * @return effectiveness of made attack
  67. */
  68. u16 battle_type_effectiveness_calc(u16 move, u8 move_type, u8 atk_bank, u8 def_bank, u8 effects_handling_and_recording);
  69. /**
  70. * @brief has bank type
  71. * @param bank bank to check
  72. * @param type type to check for
  73. * @return true if bank has type, false otherwise
  74. */
  75. u8 battle_bank_has_type(u8 bank, u8 type);
  76. /**
  77. * @brief check if bank is resistant to poison
  78. * @param bank bank to check for
  79. * @param self_inflicted was poison self_inflicted?
  80. * @return 0 if pokemon can be poisoned; 1 if already poisoned; 2 if other status condition e.g. burn; 3 if blocked by type; 4 if blocked by ability; 5 if blocked by safeguard; 6 if blocked by misty terrain (TODO)
  81. *
  82. */
  83. u8 battle_bank_is_poison_resistant(u8 bank, u8 self_inflicted);
  84. /**
  85. * @brief counts usable party pokemon of side from bank
  86. * @param bank bank of which usable pokemon should be counted
  87. * @return usable (not dead) pokemon on side from bank
  88. */
  89. u8 battle_count_party_pokemon(u8 bank);
  90. #endif