暫無描述

rooms.c 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <battle_common.h>
  2. #include <constants/moves.h>
  3. #include <battle_custom_structs.h>
  4. #include <battle_structs.h>
  5. #include <battle_locations.h>
  6. extern char str_trick_room_off[];
  7. extern char str_trick_room_on[];
  8. extern char str_magic_room_off[];
  9. extern char str_magic_room_on[];
  10. extern char str_wonder_room_off[];
  11. extern char str_wonder_room_on[];
  12. u8 set_or_delete_rooms() {
  13. struct field_affecting* field = &custom_battle_elements.ptr->field_affecting;
  14. switch (battle_executed_move) {
  15. case MOVE_TRICK_ROOM:
  16. if (field->trick_room) {
  17. field->trick_room = 0;
  18. battle_string_chooser = str_trick_room_off;
  19. } else {
  20. field->trick_room = 5;
  21. battle_string_chooser = str_trick_room_on;
  22. }
  23. break;
  24. case MOVE_MAGIC_ROOM:
  25. if (field->magic_room) {
  26. field->magic_room = 0;
  27. battle_string_chooser = str_magic_room_off;
  28. } else {
  29. field->magic_room = 5;
  30. battle_string_chooser = str_magic_room_on;
  31. }
  32. break;
  33. case MOVE_WONDER_ROOM:
  34. if (field->wonder_room) {
  35. field->wonder_room = 0;
  36. battle_string_chooser = str_wonder_room_off;
  37. } else {
  38. field->wonder_room = 5;
  39. battle_string_chooser = str_wonder_room_on;
  40. }
  41. break;
  42. }
  43. return false;
  44. }