HexManiacAdvance/src/HexManiac.Core/Models/Code/battleAIScriptReference.txt
ShinyTillDawn 9ce2b6cd10
Updating script references (#191)
* Specified the formatting of some ptr<> fields.

I wasn't too sure about the "virtualbuffer" command, so I left it untouched.

* A few preliminary changes

Script command 0x10 should be "loadbyte" instead of "setbyte2," but based on the official description of the command, "setbyte" makes more sense over "loadbyte".

I kept the old names & comments for "jumpram" and such.

I also made the last 6 commands or so in battleAIScriptReference.txt exclusive to Emerald via the [BPEE] tag as those are only defined in Emerald, not the older games.

* Changed "resetvars" to "gettime."

* Replaced "playsong2" with "savesong".

* Switched commands 4D and 4E.

Both "checkdecoration" and "testdecoration" were in the wrong places. The pokéemerald decomp puts "checkdecor" at command 4D while "checkdecorspace" ("testdecoration") is positioned at command 4E.

* Corrected applymovement2's parameters.

Because the 2 bytes after the pointer in "applymovement2" actually correspond to map data, supplying invalid maps (thinking that they were bytes for the next few commands) could lead to bugs.

* Did the same treatment with "waitmovement2."

I also made sure that "bank" comes before "map" for both commands.

* Multiple changes

- Replaced more instances of x & y when they should be bank & map.
- Clarified what "spriteinvisible" and "spritevisible" do.

For commands like "hidesprite" and "showsprite", the decomps call them "removeobject" and "addobject," respectively. Those deal with flags while "spritevisible" and "spriteinvisible" deal with some other attribute.

* Added more info to the "repeattrainerbattle" cmd.

* Clarified the description for "waitkeypress".

* "showbox" and "clearbox" are a nop in Emerald.

* Added a description for "preparemsg2."

* Adjusted the descs of "cry" and "sethealingplace."

* Updated some descriptions.

Commands B1 & B2 are actually nops in Emerald, not RS. Either way, they were unused in RS. The "addelevmenuitem" command actually takes in 4 parameters.

* Added descriptions for "hidecoins" & "updatecoins"

* Added more descriptions.

* Added descriptions for commands D8 and D9.

* Finishing touches
2023-08-22 23:40:25 -05:00

101 lines
4.0 KiB
Plaintext

00 if_random_less_than percent. ptr<`tse`>
01 if_random_greater_than percent. ptr<`tse`>
02 if_random_equal percent. ptr<`tse`>
03 if_random_not_equal percent. ptr<`tse`>
04 score score.|z
05 if_hp_less_than battler.AI_targets percent. ptr<`tse`>
06 if_hp_more_than battler.AI_targets percent. ptr<`tse`>
07 if_hp_equal battler.AI_targets percent. ptr<`tse`>
08 if_hp_not_equal battler.AI_targets percent. ptr<`tse`>
09 if_status battler.AI_targets status:: ptr<`tse`>
0a if_not_status battler.AI_targets status:: ptr<`tse`>
0b if_status2 battler.AI_targets status:: ptr<`tse`>
0c if_not_status2 battler.AI_targets status:: ptr<`tse`>
0d if_status3 battler.AI_targets status:: ptr<`tse`>
0e if_not_status3 battler.AI_targets status:: ptr<`tse`>
0f if_side_affecting battler.AI_targets status:: ptr<`tse`>
10 if_not_side_affecting battler.AI_targets status:: ptr<`tse`>
11 if_less_than value. ptr<`tse`>
12 if_more_than value. ptr<`tse`>
13 if_equal value. ptr<`tse`>
14 if_not_equal value. ptr<`tse`>
15 if_less_than_ptr value:: ptr<`tse`>
16 if_more_than_ptr value:: ptr<`tse`>
17 if_equal_ptr value:: ptr<`tse`>
18 if_not_equal_ptr value:: ptr<`tse`>
19 if_move move:data.pokemon.moves.names ptr<`tse`>
1a if_not_move move:data.pokemon.moves.names ptr<`tse`>
1b if_in_bytes list:: ptr<`tse`>
1c if_not_in_bytes list:: ptr<`tse`>
1d if_in_hwords list:: ptr<`tse`>
1e if_not_in_hwords list:: ptr<`tse`>
1f if_user_has_attacking_move ptr<`tse`>
20 if_user_has_no_attacking_moves ptr<`tse`>
21 get_turn_count
22 get_type index.
23 get_considered_move_power
24 get_how_powerful_move_is
25 get_last_used_move battler.AI_targets
26 if_equal_ type.data.pokemon.type.names ptr<`tse`>
27 if_not_equal_ type.data.pokemon.type.names ptr<`tse`>
28 if_would_go_first battler.AI_targets ptr<`tse`>
29 if_would_not_go_first battler.AI_targets ptr<`tse`>
2a ai_2a
2b ai_2b
2c count_alive_pokemon battler.AI_targets
2d get_considered_move
2e get_considered_move_effect
2f get_ability battler.AI_targets
30 get_highest_type_effectiveness
31 if_type_effectiveness effectiveness.AI_type_matchups ptr<`tse`>
32 ai_32
33 ai_33
34 if_status_in_party battler.AI_targets status:: ptr<`tse`>
35 if_status_not_in_party battler.AI_targets status:: ptr<`tse`>
36 get_weather
37 if_effect byte.moveeffectoptions ptr<`tse`>
38 if_not_effect byte.moveeffectoptions ptr<`tse`>
39 if_stat_level_less_than battler.AI_targets stat. level. ptr<`tse`>
3a if_stat_level_more_than battler.AI_targets stat. level. ptr<`tse`>
3b if_stat_level_equal battler.AI_targets stat. level. ptr<`tse`>
3c if_stat_level_not_equal battler.AI_targets stat. level. ptr<`tse`>
3d if_can_faint ptr<`tse`>
3e if_cant_faint ptr<`tse`>
3f if_has_move battler.AI_targets move:data.pokemon.moves.names ptr<`tse`>
40 if_doesnt_have_move battler.AI_targets move:data.pokemon.moves.names ptr<`tse`>
41 if_has_move_with_effect battler.AI_targets effect.moveeffectoptions ptr<`tse`>
42 if_doesnt_have_move_with_effect battler.AI_targets effect.moveeffectoptions ptr<`tse`>
43 if_any_move_disabled_or_encored battler.AI_targets byte. ptr<`tse`>
44 if_curr_move_disabled_or_encored battler.AI_targets ptr<`tse`>
45 flee
46 if_random_safari_flee ptr<`tse`>
47 watch
48 get_hold_effect battler.AI_targets
49 get_gender battler.AI_targets
4a is_first_turn_for battler.AI_targets
4b get_stockpile_count battler.AI_targets
4c is_double_battle
4d get_used_held_item battler.AI_targets
4e get_move_type_from_result
4f get_move_power_from_result
50 get_move_effect_from_result
51 get_protect_count battler.AI_targets
52 ai_52
53 ai_53
54 ai_54
55 ai_55
56 ai_56
57 ai_57
58 call ptr<`tse`>
59 goto ptr<`tse`>
5a end
5b if_level_cond cond. ptr<`tse`>
5c if_target_taunted ptr<`tse`>
5d if_target_not_taunted ptr<`tse`>
[BPEE] 5e if_target_is_ally ptr<`tse`>
[BPEE] 5f is_of_type battler.AI_targets type.data.pokemon.type.names
[BPEE] 60 check_ability battler.AI_targets ability.data.abilities.names
[BPEE] 61 if_flash_fired battler.AI_targets ptr<`tse`>
[BPEE] 62 if_holds_item battler.AI_targets item:data.items.stats ptr<`tse`>