説明なし

split_moves.c 1.4KB

123456789101112131415161718192021222324252627282930
  1. #include <battle_locations.h>
  2. #include <battle_structs.h>
  3. #include <constants/moves.h>
  4. extern char str_guard_split[];
  5. extern char str_power_split[];
  6. u8 split_status() {
  7. if (battle_executed_move == MOVE_GUARD_SPLIT) {
  8. u16 defense = (battle_participants[battle_attacker_bank].def + battle_participants[battle_defender_bank].def) >> 1;
  9. u16 sdefense = (battle_participants[battle_attacker_bank].sp_def + battle_participants[battle_defender_bank].sp_def) >> 1;
  10. battle_participants[battle_attacker_bank].def = defense;
  11. battle_participants[battle_attacker_bank].sp_def = sdefense;
  12. battle_participants[battle_defender_bank].def = defense;
  13. battle_participants[battle_defender_bank].sp_def = sdefense;
  14. battle_string_chooser = str_guard_split;
  15. }
  16. else if (battle_executed_move == MOVE_POWER_SPLIT) {
  17. u16 attack = (battle_participants[battle_attacker_bank].atk + battle_participants[battle_defender_bank].atk) >> 1;
  18. u16 sattack = (battle_participants[battle_attacker_bank].sp_atk + battle_participants[battle_defender_bank].sp_atk) >> 1;
  19. battle_participants[battle_attacker_bank].atk = attack;
  20. battle_participants[battle_attacker_bank].sp_atk = sattack;
  21. battle_participants[battle_defender_bank].atk = attack;
  22. battle_participants[battle_defender_bank].sp_atk = sattack;
  23. battle_string_chooser = str_power_split;
  24. }
  25. return false;
  26. }