summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-09-03 15:27:28 -0700
committerYamaArashi <shadow962@live.com>2016-09-03 15:27:28 -0700
commit6874afafe545365a52c2262da4e4a84ddf14afaf (patch)
tree0bb2c81cca7e5b8295b98eac97ccccecbb6056d0
parent231ea2f27c9abe0b19ae415cf2af2352555ed2d0 (diff)
contest AI
-rw-r--r--asm/macros.s2
-rw-r--r--asm/macros/asm.s12
-rw-r--r--asm/macros/contest_ai_script.s506
-rw-r--r--asm/rom_80A92F4.s2
-rw-r--r--constants/constants.s1
-rw-r--r--constants/contest_move_effects.s49
-rw-r--r--data/contest_ai_scripts.s854
7 files changed, 1422 insertions, 4 deletions
diff --git a/asm/macros.s b/asm/macros.s
index 99e6cf201..1e3a3e78f 100644
--- a/asm/macros.s
+++ b/asm/macros.s
@@ -1,5 +1,5 @@
+ .include "asm/macros/asm.s"
.include "asm/macros/function.s"
- .include "asm/macros/event.s"
.include "asm/macros/window.s"
.include "asm/macros/pokemon_data.s"
.include "asm/macros/ec.s"
diff --git a/asm/macros/asm.s b/asm/macros/asm.s
new file mode 100644
index 000000000..4ac003fab
--- /dev/null
+++ b/asm/macros/asm.s
@@ -0,0 +1,12 @@
+ .macro inc x
+ .set \x, \x + 1
+ .endm
+
+ .macro enum_start x=0
+ .set __enum__, \x
+ .endm
+
+ .macro enum constant
+ .equiv \constant, __enum__
+ inc __enum__
+ .endm
diff --git a/asm/macros/contest_ai_script.s b/asm/macros/contest_ai_script.s
new file mode 100644
index 000000000..05d70e351
--- /dev/null
+++ b/asm/macros/contest_ai_script.s
@@ -0,0 +1,506 @@
+@ Add a positive/negative value to the score of the move being evaluated.
+
+ .macro score score
+ .byte 0x00
+ .byte \score
+ .endm
+
+@ turn (AKA "Appeal No.")
+
+ .macro get_turn
+ .byte 0x01
+ .endm
+
+ .macro if_turn_less_than param, addr
+ .byte 0x02
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_turn_more_than param, addr
+ .byte 0x03
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_turn_eq param, addr
+ .byte 0x04
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_turn_not_eq param, addr
+ .byte 0x05
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ audience excitement
+
+ .macro get_excitement
+ .byte 0x06
+ .endm
+
+ .macro if_excitement_less_than param, addr
+ .byte 0x07
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_excitement_more_than param, addr
+ .byte 0x08
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_excitement_eq param, addr
+ .byte 0x09
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_excitement_not_eq param, addr
+ .byte 0x0A
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ the order that the user goes in the current turn
+
+ .macro get_user_order
+ .byte 0x0B
+ .endm
+
+ .macro if_user_order_less_than param addr
+ .byte 0x0C
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_user_order_more_than param addr
+ .byte 0x0D
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_user_order_eq param addr
+ .byte 0x0E
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_user_order_not_eq param addr
+ .byte 0x0F
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ user condition
+
+ .macro get_user_condition
+ .byte 0x10
+ .endm
+
+ .macro if_user_condition_less_than param, addr
+ .byte 0x11
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_user_condition_more_than param, addr
+ .byte 0x12
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_user_condition_eq param, addr
+ .byte 0x13
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_user_condition_not_eq param, addr
+ .byte 0x14
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ 15
+@ 16
+@ 17
+@ 18
+@ 19
+@ 1A
+@ 1B
+@ 1C
+@ 1D
+@ 1E
+
+@ contest type
+
+ .macro get_contest_type
+ .byte 0x1F
+ .endm
+
+ .macro if_contest_type_eq param, addr
+ .byte 0x20
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_contest_type_not_eq param, addr
+ .byte 0x21
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ move excitement (change in excitement due to move)
+
+ .macro get_move_excitement
+ .byte 0x22
+ .endm
+
+ .macro if_move_excitement_less_than param, addr
+ .byte 0x23
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_move_excitement_more_than param, addr
+ .byte 0x24
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_move_excitement_eq param, addr
+ .byte 0x25
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_move_excitement_not_eq param, addr
+ .byte 0x26
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ move effect
+
+ .macro get_effect
+ .byte 0x27
+ .endm
+
+ .macro if_effect_eq param, addr
+ .byte 0x28
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_effect_not_eq param, addr
+ .byte 0x29
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ move effect type
+
+ .macro get_effect_type
+ .byte 0x2A
+ .endm
+
+ .macro if_effect_type_eq param, addr
+ .byte 0x2B
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_effect_type_not_eq param, addr
+ .byte 0x2C
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ whether the current move is the most appealing in the user's moveset
+
+ .macro check_most_appealing_move
+ .byte 0x2D
+ .endm
+
+ .macro if_most_appealing_move addr
+ .byte 0x2E
+ .4byte \addr
+ .endm
+
+@ 2F
+@ 30
+@ 31
+@ 32
+@ 33
+@ 34
+@ 35
+@ 36
+@ 37
+@ 38
+@ 39
+@ 3A
+
+@ number of times current move has been used
+
+ .macro get_move_used_count
+ .byte 0x3B
+ .endm
+
+ .macro if_move_used_count_less_than param, addr
+ .byte 0x3C
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_move_used_count_more_than param, addr
+ .byte 0x3D
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_move_used_count_eq param, addr
+ .byte 0x3E
+ .byte \param
+ .4byte \addr
+ .endm
+
+ .macro if_move_used_count_not_eq param, addr
+ .byte 0x3F
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ whether the current move is a combo starter (with another move in the moveset)
+
+ .macro check_combo_starter
+ .byte 0x40
+ .endm
+
+ .macro if_combo_starter addr
+ .byte 0x41
+ .4byte \addr
+ .endm
+
+ .macro if_not_combo_starter addr
+ .byte 0x42
+ .4byte \addr
+ .endm
+
+@ whether the current move is a combo finisher (with another move in the moveset)
+
+ .macro check_combo_finisher
+ .byte 0x43
+ .endm
+
+ .macro if_combo_finisher addr
+ .byte 0x44
+ .4byte \addr
+ .endm
+
+ .macro if_not_combo_finisher addr
+ .byte 0x45
+ .4byte \addr
+ .endm
+
+@ whether the current move would finish a combo
+
+ .macro check_would_finish_combo
+ .byte 0x46
+ .endm
+
+ .macro if_would_finish_combo addr
+ .byte 0x47
+ .4byte \addr
+ .endm
+
+ .macro if_would_not_finish_combo addr
+ .byte 0x48
+ .4byte \addr
+ .endm
+
+@ condition of mon (indexed by order)
+
+ .macro get_condition mon
+ .byte 0x49
+ .byte \mon
+ .endm
+
+ .macro if_condition_less_than mon, value, addr
+ .byte 0x4A
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+ .macro if_condition_more_than mon, value, addr
+ .byte 0x4B
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+ .macro if_condition_eq mon, value, addr
+ .byte 0x4C
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+ .macro if_condition_not_eq mon, value, addr
+ .byte 0x4D
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+@ whether the mon used a combo starter move
+@ Even though this value is always 1 or 0 (i.e. TRUE/FALSE),
+@ there are less-than and greater-than comparison operations for some reason.
+
+ .macro get_used_combo_starter mon
+ .byte 0x4E
+ .byte \mon
+ .endm
+
+ .macro if_used_combo_starter_less_than mon, value, addr
+ .byte 0x4F
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+ .macro if_used_combo_starter_more_than mon, value, addr
+ .byte 0x50
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+
+ .macro if_used_combo_starter_eq mon, value, addr
+ .byte 0x51
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+ .macro if_used_combo_starter_not_eq mon, value, addr
+ .byte 0x52
+ .byte \mon
+ .byte \value
+ .4byte \addr
+ .endm
+
+@ whether the mon can make an appeal
+
+ .macro check_can_participate mon
+ .byte 0x53
+ .byte \mon
+ .endm
+
+ .macro if_can_participate mon, addr
+ .byte 0x54
+ .byte \mon
+ .4byte \addr
+ .endm
+
+ .macro if_cannot_participate mon, addr
+ .byte 0x55
+ .byte \mon
+ .4byte \addr
+ .endm
+
+@ 56
+@ 57
+
+ .macro contest_58 param addr
+ .byte 0x58
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ 59
+@ 5A
+@ 5B
+@ 5C
+@ 5D
+@ 5E
+@ 5F
+@ 60
+@ 61
+@ 62
+@ 63
+@ 64
+@ 65
+@ 66
+@ 67
+@ 68
+@ 69
+@ 6A
+@ 6B
+@ 6C
+@ 6D
+@ 6E
+@ 6F
+@ 70
+@ 71
+@ 72
+@ 73
+@ 74
+@ 75
+@ 76
+@ 77
+@ 78
+@ 79
+@ 7A
+@ 7B
+@ 7C
+
+ .macro if_random param addr
+ .byte 0x7D
+ .byte \param
+ .4byte \addr
+ .endm
+
+@ 7E
+
+ .macro jump addr
+ .byte 0x7F
+ .4byte \addr
+ .endm
+
+ .macro call addr
+ .byte 0x80
+ .4byte \addr
+ .endm
+
+ .macro end
+ .byte 0x81
+ .endm
+
+ .macro check_user_has_exciting_move
+ .byte 0x82
+ .endm
+
+ .macro if_user_has_exciting_move addr
+ .byte 0x83
+ .4byte \addr
+ .endm
+
+ .macro if_user_doesnt_have_exciting_move addr
+ .byte 0x84
+ .4byte \addr
+ .endm
+
+@ 85
+@ 86
+
+ .macro if_effect_in_user_moveset param addr
+ .byte 0x87
+ .2byte \param
+ .4byte \addr
+ .endm
diff --git a/asm/rom_80A92F4.s b/asm/rom_80A92F4.s
index 9ba4b889d..8dabce13d 100644
--- a/asm/rom_80A92F4.s
+++ b/asm/rom_80A92F4.s
@@ -333481,7 +333481,7 @@ _081563CC:
bgt _08156496
cmp r0, 0
bne _08156496
- ldr r1, =gUnknown_082DE350
+ ldr r1, =gContestAIs
ldrb r0, [r2, 0x10]
lsls r0, 2
adds r0, r1
diff --git a/constants/constants.s b/constants/constants.s
index cdc8af9bd..30fd312e6 100644
--- a/constants/constants.s
+++ b/constants/constants.s
@@ -15,3 +15,4 @@
.include "constants/map_constants.s"
.include "constants/berry_constants.s"
.include "constants/field_object_constants.s"
+ .include "constants/contest_move_effects.s"
diff --git a/constants/contest_move_effects.s b/constants/contest_move_effects.s
new file mode 100644
index 000000000..b19e05004
--- /dev/null
+++ b/constants/contest_move_effects.s
@@ -0,0 +1,49 @@
+ enum_start
+ enum CONTEST_EFFECT_HIGHLY_APPEALING @ 0
+ enum CONTEST_EFFECT_USER_MORE_EASILY_STARTLED @ 1
+ enum CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES @ 2
+ enum CONTEST_EFFECT_REPETITION_NOT_BORING @ 3
+ enum CONTEST_EFFECT_AVOID_STARTLE_ONCE @ 4
+ enum CONTEST_EFFECT_AVOID_STARTLE @ 5
+ enum CONTEST_EFFECT_AVOID_STARTLE_SLIGHTLY @ 6
+ enum CONTEST_EFFECT_USER_LESS_EASILY_STARTLED @ 7
+ enum CONTEST_EFFECT_STARTLE_FRONT_MON @ 8
+ enum CONTEST_EFFECT_SLIGHTLY_STARTLE_PREV_MONS @ 9
+ enum CONTEST_EFFECT_STARTLE_PREV_MON @ 10
+ enum CONTEST_EFFECT_STARTLE_PREV_MONS @ 11
+ enum CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON @ 12
+ enum CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS @ 13
+ enum CONTEST_EFFECT_STARTLE_PREV_MON_2 @ 14
+ enum CONTEST_EFFECT_STARTLE_PREV_MONS_2 @ 15
+ enum CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION @ 16
+ enum CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION @ 17
+ enum CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN @ 18
+ enum CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL @ 19
+ enum CONTEST_EFFECT_STARTLE_MONS_COOL_APPEAL @ 20
+ enum CONTEST_EFFECT_STARTLE_MONS_BEAUTY_APPEAL @ 21
+ enum CONTEST_EFFECT_STARTLE_MONS_CUTE_APPEAL @ 22
+ enum CONTEST_EFFECT_STARTLE_MONS_SMART_APPEAL @ 23
+ enum CONTEST_EFFECT_STARTLE_MONS_TOUGH_APPEAL @ 24
+ enum CONTEST_EFFECT_MAKE_FOLLOWING_MON_NERVOUS @ 25
+ enum CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS @ 26
+ enum CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS @ 27
+ enum CONTEST_EFFECT_BADLY_STARTLES_MONS_IN_GOOD_CONDITION @ 28
+ enum CONTEST_EFFECT_BETTER_IF_FIRST @ 29
+ enum CONTEST_EFFECT_BETTER_IF_LAST @ 30
+ enum CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES @ 31
+ enum CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE @ 32
+ enum CONTEST_EFFECT_BETTER_WHEN_LATER @ 33
+ enum CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING @ 34
+ enum CONTEST_EFFECT_BETTER_IF_SAME_TYPE @ 35
+ enum CONTEST_EFFECT_BETTER_IF_DIFF_TYPE @ 36
+ enum CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL @ 37
+ enum CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS @ 38
+ enum CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION @ 39
+ enum CONTEST_EFFECT_NEXT_APPEAL_EARLIER @ 40
+ enum CONTEST_EFFECT_NEXT_APPEAL_LATER @ 41
+ enum CONTEST_EFFECT_MAKE_SCRAMBLING_TURN_ORDER_EASIER @ 42
+ enum CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER @ 43
+ enum CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST @ 44
+ enum CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS @ 45
+ enum CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED @ 46
+ enum CONTEST_EFFECT_DONT_EXCITE_AUDIENCE @ 47
diff --git a/data/contest_ai_scripts.s b/data/contest_ai_scripts.s
index 9f3f5bec4..3e8c9e59d 100644
--- a/data/contest_ai_scripts.s
+++ b/data/contest_ai_scripts.s
@@ -1,8 +1,858 @@
.include "asm/macros.s"
+ .include "asm/macros/contest_ai_script.s"
.include "constants/constants.s"
.section script_data, "aw", %progbits
+ enum_start
+ enum MON_1
+ enum MON_2
+ enum MON_3
+ enum MON_4
+
.align 2
-gUnknown_082DE350:: @ 82DE350
- .incbin "baserom.gba", 0x2de350, 0x9dc
+gContestAIs:: @ 82DE350
+ .4byte AI_CheckForBadMove
+ .4byte AI_CheckForCombo
+ .4byte AI_CheckBoring
+ .4byte AI_CheckExcitement
+ .4byte AI_CheckOrder
+ .4byte AI_CheckForGoodMove
+ .4byte AI_Erratic
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+ .4byte AI_Nothing
+
+@ Unreferenced AI routine to encourage moves that improve condition on the first
+@ turn. Additionally, it checks the appeal order of the user and the effect
+@ type, but the code is buggy and doesn't affect the score.
+ if_turn_not_eq 0, ContestUnreferenced_80
+ if_effect_not_eq CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, ContestUnreferenced_80
+ score +10
+ContestUnreferenced_80:
+ call ContestUnreferenced_0D
+ end
+ContestUnreferenced_0D:
+ if_user_order_more_than MON_2, ContestUnreferenced_end
+ if_effect_type_not_eq 2, ContestUnreferenced_end
+ if_effect_type_not_eq 3, ContestUnreferenced_end
+ score +10 @ unreachable
+ContestUnreferenced_end:
+ end
+
+@ Unreferenced AI routine that doesn't make much sense.
+ if_turn_eq 0, ContestUnreferenced_0F_1
+ if_turn_eq 1, ContestUnreferenced_0F_2
+ if_turn_eq 2, ContestUnreferenced_0F_3
+ if_turn_eq 3, ContestUnreferenced_0F_4
+ if_turn_eq 4, ContestUnreferenced_0F_5
+ end
+ContestUnreferenced_0F_1:
+ if_user_order_not_eq MON_1, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_2, ContestUnreferenced_2B_2
+ if_user_order_not_eq MON_3, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_4, ContestUnreferenced_2B_1
+ end
+ContestUnreferenced_2B_1:
+ if_effect_type_eq 1, ContestUnreferenced_score
+ end
+ContestUnreferenced_2B_2:
+ if_effect_type_eq 1, ContestUnreferenced_score
+ end
+ if_effect_type_eq 1, ContestUnreferenced_score
+ end
+ContestUnreferenced_0F_2:
+ if_user_order_not_eq MON_1, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_2, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_3, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_4, ContestUnreferenced_2B_1
+ end
+ContestUnreferenced_0F_3:
+ if_user_order_not_eq MON_1, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_2, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_3, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_4, ContestUnreferenced_2B_1
+ end
+ContestUnreferenced_0F_4:
+ if_user_order_not_eq MON_1, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_2, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_3, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_4, ContestUnreferenced_2B_1
+ end
+ContestUnreferenced_0F_5:
+ if_user_order_not_eq MON_1, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_2, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_3, ContestUnreferenced_2B_1
+ if_user_order_not_eq MON_4, ContestUnreferenced_2B_1
+ end
+ContestUnreferenced_score:
+ score +10
+ end
+
+ end
+
+@ Unreferenced AI routine to encourage the most appealing move.
+ if_most_appealing_move ContestUnreferenced_score2
+ end
+ContestUnreferenced_score2:
+ score +10
+ end
+
+AI_CheckBoring:
+ if_effect_eq CONTEST_EFFECT_REPETITION_NOT_BORING, AI_end_081DC27F
+ if_move_used_count_eq 1, AI_score1_081DC27F
+ if_move_used_count_eq 2, AI_score2_081DC27F
+ if_move_used_count_eq 3, AI_score3_081DC27F
+ if_move_used_count_eq 4, AI_score4_081DC27F
+ end
+AI_score1_081DC27F:
+ score -5
+ end
+AI_score2_081DC27F:
+ score -15
+ end
+AI_score3_081DC27F:
+ score -20
+ end
+AI_score4_081DC27F:
+ score -25
+ end
+AI_end_081DC27F:
+ end
+
+AI_CheckExcitement:
+ if_move_excitement_less_than 0, AI_contest09_081DC2AB
+ if_move_excitement_eq 0, AI_contest7D_4_081DC2AB
+ if_move_excitement_eq 1, AI_contest3D_081DC2AB
+ end
+AI_contest09_081DC2AB:
+ if_excitement_eq 4, AI_contest0F_1_081DC2AB
+ if_excitement_eq 3, AI_contest0F_2_081DC2AB
+ if_user_has_exciting_move AI_end_081DC2AB
+ score +15
+ end
+AI_contest0F_1_081DC2AB:
+ if_user_order_not_eq MON_1, AI_contest7D_1_081DC2AB
+ if_random 51, AI_end_081DC2AB
+ score +20
+ end
+AI_contest7D_1_081DC2AB:
+ if_random 127, AI_end_081DC2AB
+ score -10
+ end
+AI_contest0F_2_081DC2AB:
+ if_user_order_not_eq MON_1, AI_contest7D_3_081DC2AB
+ if_turn_eq 4, AI_score_081DC2AB
+AI_contest7D_2_081DC2AB:
+ if_random 51, AI_end_081DC2AB
+ score +10
+ end
+AI_score_081DC2AB:
+ score +15
+ end
+AI_contest7D_3_081DC2AB:
+ if_random 127, AI_end_081DC2AB
+ score +10
+ end
+AI_contest7D_4_081DC2AB:
+ if_random 127, AI_end_081DC2AB
+ score +10
+ end
+AI_contest3D_081DC2AB:
+ if_move_used_count_more_than 0, AI_contest29_081DC2AB
+ if_user_order_not_eq MON_1, AI_contest7D_5_081DC2AB
+ if_excitement_not_eq 4, AI_contest7D_5_081DC2AB
+ score +30
+ end
+AI_contest7D_5_081DC2AB:
+ if_random 100, AI_end_081DC2AB
+ score +10
+ end
+AI_contest29_081DC2AB:
+ if_effect_not_eq CONTEST_EFFECT_REPETITION_NOT_BORING, AI_end_081DC2AB
+ if_user_order_not_eq MON_1, AI_contest7D_5_081DC2AB
+ if_excitement_not_eq 4, AI_contest7D_5_081DC2AB
+ score +30
+ end
+AI_end_081DC2AB:
+ end
+
+AI_CheckForCombo:
+ if_would_finish_combo AI_score_081DC348
+ call AI_contest3F_081DC348
+ call AI_contest45_081DC348
+ end
+AI_contest3F_081DC348:
+ if_move_used_count_not_eq 0, AI_end_081DC348
+ if_not_combo_starter AI_end_081DC348
+ if_user_order_eq MON_1, AI_contest04_1_081DC348
+ if_user_order_eq MON_2, AI_contest04_2_081DC348
+ if_user_order_eq MON_3, AI_contest04_3_081DC348
+ if_user_order_eq MON_4, AI_contest04_4_081DC348
+ end
+AI_contest45_081DC348:
+ if_not_combo_finisher AI_end_081DC348
+ score -10
+ end
+AI_score_081DC348:
+ score +25
+ end
+AI_contest04_1_081DC348:
+ if_turn_eq 4, AI_contest7D_081DC348
+ if_random 150, AI_end_081DC348
+ score +10
+ end
+AI_contest04_2_081DC348:
+ if_turn_eq 4, AI_contest7D_081DC348
+ if_random 125, AI_end_081DC348
+ score +10
+ end
+AI_contest04_3_081DC348:
+ if_turn_eq 4, AI_contest7D_081DC348
+ if_random 50, AI_end_081DC348
+ score +10
+ end
+AI_contest04_4_081DC348:
+ if_turn_eq 4, AI_contest7D_081DC348
+ score +10
+ end
+AI_contest7D_081DC348:
+ if_random 125, AI_end_081DC348
+ score -15
+ end
+AI_end_081DC348:
+ end
+
+AI_CheckForGoodMove:
+ if_effect_eq CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION, ContestEffect39
+ if_effect_eq CONTEST_EFFECT_NEXT_APPEAL_EARLIER, ContestEffect40
+ if_effect_eq CONTEST_EFFECT_NEXT_APPEAL_LATER, ContestEffect41
+ if_effect_eq CONTEST_EFFECT_REPETITION_NOT_BORING, ContestEffect3
+ if_effect_eq CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, ContestEffect38
+ if_effect_eq CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, ContestEffect47
+ if_effect_eq CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, ContestEffect31
+ if_effect_eq CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE, ContestEffect32
+ if_effect_eq CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, ContestEffect46
+ if_effect_eq CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, ContestEffect27
+ if_effect_eq CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION, ContestEffect16or17
+ if_effect_eq CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, ContestEffect16or17
+ if_effect_eq CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, ContestEffect_FollowingMonsNervous
+ if_effect_eq CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, ContestEffect18
+ end
+
+ContestEffect39:
+ if_user_condition_eq 3, ContestEffect39_score1
+ if_user_condition_eq 2, ContestEffect39_score2
+ if_user_condition_eq 1, ContestEffect39_score3
+ if_user_condition_eq 0, ContestEffect39_score4
+ end
+ContestEffect39_score1:
+ score +20
+ end
+ContestEffect39_score2:
+ if_random 125, ContestEffectEnd
+ score +15
+ end
+ContestEffect39_score3:
+ if_random 125, ContestEffectEnd
+ score +5
+ end
+ContestEffect39_score4:
+ score -20
+ end
+
+ContestEffect40:
+ if_effect_in_user_moveset CONTEST_EFFECT_BETTER_IF_FIRST, ContestEffectEnd
+ if_random 50, ContestEffectEnd
+ score +20
+ end
+
+ContestEffect41:
+ if_effect_in_user_moveset CONTEST_EFFECT_BETTER_IF_LAST, ContestEffectEnd
+ if_random 50, ContestEffectEnd
+ score +20
+ end
+
+ContestEffect3:
+ if_user_order_not_eq MON_4, ContestEffectEnd
+ if_random 50, ContestEffectEnd
+ score +15
+ end
+ if_turn_eq 4, ContestEffect3_7D
+ if_random 220, ContestEffect3_score
+ score +10
+ end
+ContestEffect3_7D:
+ if_random 20, ContestEffectEnd
+ score +15
+ end
+ContestEffect3_score:
+ score -20
+ end
+
+ContestEffect38:
+ if_effect_in_user_moveset CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION, ContestEffect38_contest04
+ if_user_condition_eq 3, ContestEffect38_score1
+ if_random 50, ContestEffectEnd
+ score +15
+ end
+ContestEffect38_score1:
+ score -10
+ end
+ContestEffect38_contest04:
+ if_turn_eq 4, ContestEffect38_score2
+ if_turn_eq 0, ContestEffect38_random
+ if_move_used_count_eq 1, ContestEffectEnd
+ if_random 125, ContestEffectEnd
+ score +10
+ end
+ContestEffect38_random:
+ if_random 100, ContestEffectEnd
+ score +10
+ end
+ContestEffect38_score2:
+ score -10
+ end
+
+ContestEffect47:
+ if_move_used_count_eq 1, ContestEffectEnd
+ if_user_order_eq MON_1, ContestEffect47_random
+ if_user_order_eq MON_2, ContestEffect47_random
+ if_turn_not_eq 4, ContestEffectEnd
+ if_user_has_exciting_move ContestEffectEnd
+ if_excitement_less_than 1, ContestEffectEnd
+ score +10
+ end
+ContestEffect47_random:
+ if_random 127, ContestEffectEnd
+ score +10
+ end
+
+ContestEffect31:
+ if_user_order_eq MON_2, ContestEffect31_score1
+ if_user_order_eq MON_3, ContestEffect31_score2
+ if_user_order_eq MON_4, ContestEffect31_score3
+ end
+ContestEffect31_score1:
+ score +5
+ end
+ContestEffect31_score2:
+ score +15
+ end
+ContestEffect31_score3:
+ score +20
+ end
+
+ContestEffect32:
+ if_user_order_eq MON_1, ContestEffect32_score1
+ if_user_order_eq MON_2, ContestEffect32_score2
+ if_user_order_eq MON_3, ContestEffect32_score3
+ if_user_order_eq MON_4, ContestEffect32_score5
+ end
+ContestEffect32_score1:
+ score -10
+ end
+ContestEffect32_score2:
+ if_cannot_participate MON_1, ContestEffectEnd
+ score +5
+ end
+ContestEffect32_score3:
+ if_cannot_participate MON_1, ContestEffect32_score4
+ score +5
+ jump ContestEffect32_score4
+ end
+ContestEffect32_score4:
+ if_cannot_participate MON_2, ContestEffectEnd
+ score +5
+ end
+ContestEffect32_score5:
+ if_cannot_participate MON_1, ContestEffect32_score6
+ score +5
+ jump ContestEffect32_score6
+ end
+ContestEffect32_score6:
+ if_cannot_participate MON_2, ContestEffect32_score7
+ score +5
+ jump ContestEffect32_score7
+ end
+ContestEffect32_score7:
+ if_cannot_participate MON_3, ContestEffectEnd
+ score +5
+ end
+
+ContestEffect46:
+ if_user_order_eq MON_1, ContestEffect46_05
+ if_user_order_more_than MON_1, ContestEffect46_score4
+ end
+ContestEffect46_05:
+ if_turn_not_eq 0, ContestEffect46_score1
+ if_excitement_eq 4, ContestEffect46_score2
+ if_excitement_eq 3, ContestEffect46_score3
+ end
+ContestEffect46_score1:
+ if_random 125, ContestEffectEnd
+ score -15
+ end
+ContestEffect46_score2:
+ if_random 125, ContestEffectEnd
+ score +20
+ end
+ContestEffect46_score3:
+ if_random 125, ContestEffectEnd
+ score +15
+ end
+ContestEffect46_score4:
+ if_random 178, ContestEffectEnd
+ score +10
+ end
+
+ContestEffect27:
+ if_user_order_eq MON_1, ContestEffectEnd
+ jump ContestEffect27_55_1
+ end
+ContestEffect27_55_1:
+ if_cannot_participate MON_1, ContestEffect27_noscore
+ if_condition_eq MON_1, 0, ContestEffect27_noscore
+ if_condition_eq MON_1, 1, ContestEffect27_score1
+ if_condition_eq MON_1, 2, ContestEffect27_score2
+ if_condition_eq MON_1, 3, ContestEffect27_score3
+ end
+ContestEffect27_score1:
+ if_random 125, ContestEffect27_55_2
+ score +5
+ if_user_order_more_than MON_2, ContestEffect27_55_2
+ end
+ContestEffect27_score2:
+ if_random 125, ContestEffect27_55_2
+ score +10
+ if_user_order_more_than MON_2, ContestEffect27_55_2
+ end
+ContestEffect27_score3:
+ if_random 125, ContestEffect27_55_2
+ score +15
+ if_user_order_more_than MON_2, ContestEffect27_55_2
+ end
+ContestEffect27_noscore:
+ if_user_order_more_than MON_2, ContestEffect27_55_2
+ end
+ContestEffect27_55_2:
+ if_cannot_participate MON_2, ContestEffect27_noscore2
+ if_condition_eq MON_2, 0, ContestEffect27_noscore2
+ if_condition_eq MON_2, 1, ContestEffect27_score4
+ if_condition_eq MON_2, 2, ContestEffect27_score5
+ if_condition_eq MON_2, 3, ContestEffect27_score6
+ end
+ContestEffect27_score4:
+ if_random 125, ContestEffect27_55_3
+ score +5
+ if_user_order_more_than MON_3, ContestEffect27_55_3
+ end
+ContestEffect27_score5:
+ if_random 125, ContestEffect27_55_3
+ score +10
+ if_user_order_more_than MON_3, ContestEffect27_55_3
+ end
+ContestEffect27_score6:
+ if_random 125, ContestEffect27_55_3
+ score +15
+ if_user_order_more_than MON_3, ContestEffect27_55_3
+ end
+ContestEffect27_noscore2:
+ if_user_order_more_than MON_3, ContestEffect27_55_3
+ end
+ContestEffect27_55_3:
+ if_cannot_participate MON_3, ContestEffect27_end
+ if_condition_eq MON_3, 0, ContestEffect27_end
+ if_condition_eq MON_3, 1, ContestEffect27_score7
+ if_condition_eq MON_3, 2, ContestEffect27_score8
+ if_condition_eq MON_3, 3, ContestEffect27_score9
+ end
+ContestEffect27_score7:
+ if_random 125, ContestEffectEnd
+ score +5
+ end
+ContestEffect27_score8:
+ if_random 125, ContestEffectEnd
+ score +10
+ end
+ContestEffect27_score9:
+ if_random 125, ContestEffectEnd
+ score +15
+ end
+ContestEffect27_end:
+ end
+
+ContestEffect16or17:
+ if_user_order_eq MON_1, ContestEffectEnd
+ jump ContestEffect16or17_55
+ end
+ContestEffect16or17_55:
+ if_cannot_participate MON_1, ContestEffect16or17_0E_1
+ if_used_combo_starter_eq MON_1, TRUE, ContestEffect16or17_0E_1
+ if_random 125, ContestEffect16or17_0E_1
+ score +2
+ contest_58 MON_1, ContestEffect16or17_0E_1
+ score +8
+ end
+ContestEffect16or17_0E_1:
+ if_user_order_eq MON_2, ContestEffectEnd
+ if_cannot_participate MON_2, ContestEffect16or17_0E_2
+ if_used_combo_starter_eq MON_2, TRUE, ContestEffect16or17_0E_2
+ if_random 125, ContestEffect16or17_0E_2
+ score +2
+ contest_58 MON_2, ContestEffect16or17_0E_2
+ score +8
+ end
+ContestEffect16or17_0E_2:
+ if_user_order_eq MON_3, ContestEffectEnd
+ if_cannot_participate MON_3, ContestEffectEnd
+ if_used_combo_starter_eq MON_3, TRUE, ContestEffectEnd
+ if_random 125, ContestEffectEnd
+ score +2
+ contest_58 MON_3, ContestEffectEnd
+ score +8
+ end
+
+ContestEffect_FollowingMonsNervous:
+ if_user_order_eq MON_4, ContestEffectEnd
+ jump ContestEffect_FollowingMonsNervous_CheckMon4
+ end
+ContestEffect_FollowingMonsNervous_CheckMon4:
+ if_cannot_participate MON_4, ContestEffect_FollowingMonsNervous_CheckMon3
+ if_used_combo_starter_eq MON_4, FALSE, ContestEffect_FollowingMonsNervous_CheckMon3
+ score +5
+ if_random 125, ContestEffect16or17_0E_1
+ score +5
+ end
+ContestEffect_FollowingMonsNervous_CheckMon3:
+ if_user_order_eq MON_3, ContestEffectEnd
+ if_cannot_participate MON_3, ContestEffect_FollowingMonsNervous_CheckMon2
+ if_used_combo_starter_eq MON_3, FALSE, ContestEffect_FollowingMonsNervous_CheckMon2
+ score +5
+ if_random 125, ContestEffect16or17_0E_2
+ score +5
+ end
+ContestEffect_FollowingMonsNervous_CheckMon2:
+ if_user_order_eq MON_2, ContestEffectEnd
+ if_cannot_participate MON_2, ContestEffectEnd
+ if_used_combo_starter_eq MON_2, FALSE, ContestEffectEnd
+ score +5
+ if_random 125, ContestEffectEnd
+ score +5
+ end
+
+ContestEffect18:
+ if_turn_eq 4, ContestEffect18_score1
+ jump ContestEffect18_0E
+ end
+ContestEffect18_score1:
+ score +5
+ jump ContestEffect18_0E
+ end
+ContestEffect18_0E:
+ if_user_order_eq MON_1, ContestEffect18_score2
+ if_user_order_eq MON_2, ContestEffect18_random1
+ if_user_order_eq MON_3, ContestEffect18_random2
+ if_user_order_eq MON_4, ContestEffect18_random3
+ end
+ContestEffect18_score2:
+ score -15
+ end
+ContestEffect18_random1:
+ if_random 125, ContestEffectEnd
+ score -10
+ end
+ContestEffect18_random2:
+ if_random 125, ContestEffectEnd
+ score +5
+ end
+ContestEffect18_random3:
+ if_random 125, ContestEffectEnd
+ score +15
+ end
+
+ContestEffectEnd:
+ end
+
+@ Randomly encourage moves in Cute, Smart, and Tough contests.
+AI_Erratic:
+ if_contest_type_eq CONTEST_CUTE, Erratic_CuteSmartTough
+ if_contest_type_eq CONTEST_SMART, Erratic_CuteSmartTough
+ if_contest_type_eq CONTEST_TOUGH, Erratic_CuteSmartTough
+ end
+Erratic_CuteSmartTough:
+ if_random 125, Erratic_NoScoreIncrease
+ score +10
+ end
+Erratic_NoScoreIncrease:
+ end
+
+AI_CheckForBadMove:
+ if_effect_eq CONTEST_EFFECT_STARTLE_FRONT_MON, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_STARTLE_PREV_MON, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_STARTLE_PREV_MON_2, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_BETTER_IF_SAME_TYPE, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_BETTER_IF_DIFF_TYPE, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, ContestEffect2_8
+ if_effect_eq CONTEST_EFFECT_SLIGHTLY_STARTLE_PREV_MONS, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_PREV_MONS, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_PREV_MONS_2, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_MONS_COOL_APPEAL, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_MONS_BEAUTY_APPEAL, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_MONS_CUTE_APPEAL, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_MONS_SMART_APPEAL, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_STARTLE_MONS_TOUGH_APPEAL, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_BADLY_STARTLES_MONS_IN_GOOD_CONDITION, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, ContestEffect2_9
+ if_effect_eq CONTEST_EFFECT_MAKE_FOLLOWING_MON_NERVOUS, ContestEffect2_25
+ if_effect_eq CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, ContestEffect2_26
+ if_effect_eq CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, ContestEffect2_26
+ if_effect_eq CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, ContestEffect2_38
+ if_effect_eq CONTEST_EFFECT_AVOID_STARTLE_ONCE, ContestEffect2_4
+ if_effect_eq CONTEST_EFFECT_AVOID_STARTLE, ContestEffect2_4
+ if_effect_eq CONTEST_EFFECT_AVOID_STARTLE_SLIGHTLY, ContestEffect2_4
+ if_effect_eq CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, ContestEffect2_2
+ end
+
+ContestEffect2_8:
+ if_user_order_eq MON_1, ContestEffect2_8_score1
+ if_user_order_eq MON_2, ContestEffect2_8_score2
+ if_user_order_eq MON_3, ContestEffect2_8_score3
+ if_user_order_eq MON_4, ContestEffect2_8_score4
+ end
+ContestEffect2_8_score1:
+ score -10
+ end
+ContestEffect2_8_score2:
+ if_can_participate MON_1, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_8_score3:
+ if_can_participate MON_2, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_8_score4:
+ if_can_participate MON_3, ContestEffectEnd2
+ score -10
+ end
+
+ContestEffect2_9:
+ if_user_order_eq MON_1, ContestEffect2_9_score1
+ if_user_order_eq MON_2, ContestEffect2_9_score2
+ if_user_order_eq MON_3, ContestEffect2_9_score3
+ if_user_order_eq MON_4, ContestEffect2_9_score4
+ end
+ContestEffect2_9_score1:
+ score -20
+ end
+ContestEffect2_9_score2:
+ if_can_participate MON_1, ContestEffectEnd2
+ score -15
+ end
+ContestEffect2_9_score3:
+ if_can_participate MON_1, ContestEffectEnd2
+ if_can_participate MON_2, ContestEffectEnd2
+ score -15
+ end
+ContestEffect2_9_score4:
+ if_can_participate MON_1, ContestEffectEnd2
+ if_can_participate MON_2, ContestEffectEnd2
+ if_can_participate MON_3, ContestEffectEnd2
+ score -15
+ end
+
+ContestEffect2_25:
+ if_user_order_eq MON_1, ContestEffect2_25_score1
+ if_user_order_eq MON_2, ContestEffect2_25_score2
+ if_user_order_eq MON_3, ContestEffect2_25_score3
+ score -10
+ end
+ContestEffect2_25_score1:
+ if_can_participate MON_2, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_25_score2:
+ if_can_participate MON_3, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_25_score3:
+ if_can_participate MON_4, ContestEffectEnd2
+ score -10
+ end
+
+ContestEffect2_26:
+ if_user_order_eq MON_1, ContestEffect2_26_score1
+ if_user_order_eq MON_2, ContestEffect2_26_score2
+ if_user_order_eq MON_3, ContestEffect2_26_score3
+ score -10
+ end
+ContestEffect2_26_score1:
+ if_can_participate MON_2, ContestEffectEnd2
+ if_can_participate MON_3, ContestEffectEnd2
+ if_can_participate MON_4, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_26_score2:
+ if_can_participate MON_3, ContestEffectEnd2
+ if_can_participate MON_4, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_26_score3:
+ if_can_participate MON_4, ContestEffectEnd2
+ score -10
+ end
+
+ContestEffect2_38:
+ if_user_condition_less_than 3, ContestEffectEnd2
+ score -20
+ end
+
+ContestEffect2_4:
+ if_user_order_eq MON_1, ContestEffect2_4_score1
+ if_user_order_eq MON_2, ContestEffect2_4_score2
+ if_user_order_eq MON_3, ContestEffect2_4_score3
+ score -10
+ end
+ContestEffect2_4_score1:
+ if_can_participate MON_2, ContestEffectEnd2
+ if_can_participate MON_3, ContestEffectEnd2
+ if_can_participate MON_4, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_4_score2:
+ if_can_participate MON_3, ContestEffectEnd2
+ if_can_participate MON_4, ContestEffectEnd2
+ score -10
+ end
+ContestEffect2_4_score3:
+ if_can_participate MON_4, ContestEffectEnd2
+ score -10
+ end
+
+ContestEffect2_2:
+ if_turn_eq 0, ContestEffect2_2_score1
+ if_turn_eq 1, ContestEffect2_2_score2
+ if_turn_eq 2, ContestEffect2_2_score3
+ if_turn_eq 3, ContestEffect2_2_score4
+ if_turn_eq 4, ContestEffect2_2_score5
+ end
+ContestEffect2_2_score1:
+ if_random 20, ContestEffectEnd2
+ score -15
+ end
+ContestEffect2_2_score2:
+ if_random 40, ContestEffectEnd2
+ score -15
+ end
+ContestEffect2_2_score3:
+ if_random 60, ContestEffectEnd2
+ score -15
+ end
+ContestEffect2_2_score4:
+ if_random 80, ContestEffectEnd2
+ score -15
+ end
+ContestEffect2_2_score5:
+ if_random 20, ContestEffectEnd2
+ score +20
+ end
+
+ContestEffectEnd2:
+ end
+
+AI_CheckOrder:
+ if_user_order_eq MON_1, AI_effectcheck1_081DCA4C
+ if_user_order_eq MON_2, AI_effectcheck2_081DCA4C
+ if_user_order_eq MON_3, AI_effectcheck3_081DCA4C
+ if_user_order_eq MON_4, AI_effectcheck4_081DCA4C
+ end
+AI_effectcheck1_081DCA4C:
+ if_effect_eq CONTEST_EFFECT_BETTER_IF_FIRST, AI_score1_081DCA4C
+ if_effect_eq CONTEST_EFFECT_BETTER_WHEN_LATER, AI_score2_081DCA4C
+ if_effect_type_eq 1, AI_random1_081DCA4C
+ end
+AI_score1_081DCA4C:
+ score +15
+ end
+AI_score2_081DCA4C:
+ score -15
+ end
+AI_random1_081DCA4C:
+ if_random 100, ContestEffectEnd2
+ score +10
+ end
+AI_effectcheck2_081DCA4C:
+ if_effect_eq CONTEST_EFFECT_BETTER_WHEN_LATER, AI_score3_081DCA4C
+ if_effect_type_eq 1, AI_random2_081DCA4C
+ end
+AI_score3_081DCA4C:
+ score -5
+ end
+AI_random2_081DCA4C:
+ if_random 125, ContestEffectEnd2
+ score +10
+ end
+AI_effectcheck3_081DCA4C:
+ if_effect_eq CONTEST_EFFECT_BETTER_WHEN_LATER, AI_score4_081DCA4C
+ if_effect_eq CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, AI_score4_081DCA4C
+ if_effect_eq CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, AI_score4_081DCA4C
+ end
+AI_score4_081DCA4C:
+ score +5
+ end
+AI_effectcheck4_081DCA4C:
+ if_effect_eq CONTEST_EFFECT_BETTER_WHEN_LATER, AI_score5_081DCA4C
+ if_effect_eq CONTEST_EFFECT_BETTER_IF_LAST, AI_score5_081DCA4C
+ if_effect_eq CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, AI_score5_081DCA4C
+ if_effect_eq CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, AI_score5_081DCA4C
+ if_effect_eq CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, AI_score7_081DCA4C
+ if_effect_type_eq 1, AI_score6_081DCA4C
+ if_effect_type_eq 3, AI_random3_081DCA4C
+ end
+AI_score5_081DCA4C:
+ score +15
+ end
+AI_score6_081DCA4C:
+ score -10
+ end
+AI_random3_081DCA4C:
+ if_random 125, ContestEffectEnd2
+ score +10
+ end
+AI_score7_081DCA4C:
+ score +5
+ end
+
+AI_Nothing:
+ end