Merge branch 'pretmaster' into pret_clean2

This commit is contained in:
Eduardo Quezada 2022-08-20 12:43:09 -04:00
commit 76d2d92abb
19 changed files with 353 additions and 317 deletions

View File

@ -1927,8 +1927,8 @@ BattleScript_EffectTeleport::
ppreduce
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailed
getifcantrunfrombattle BS_ATTACKER
jumpifbyte CMP_EQUAL, gBattleCommunication, 1, BattleScript_ButItFailed
jumpifbyte CMP_EQUAL, gBattleCommunication, 2, BattleScript_PrintAbilityMadeIneffective
jumpifbyte CMP_EQUAL, gBattleCommunication, BATTLE_RUN_FORBIDDEN, BattleScript_ButItFailed
jumpifbyte CMP_EQUAL, gBattleCommunication, BATTLE_RUN_FAILURE, BattleScript_PrintAbilityMadeIneffective
attackanimation
waitanimation
printstring STRINGID_PKMNFLEDFROMBATTLE

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 719 B

View File

@ -64,31 +64,31 @@ $(CASTFORMGFXDIR)/shiny.gbapal: $(CASTFORMGFXDIR)/shiny_normal_form.gbapal \
### Tilesets ###
$(TILESETGFXDIR)/secondary/petalburg/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 159
$(GFX) $< $@ -num_tiles 159 -Wnum_tiles
$(TILESETGFXDIR)/secondary/rustboro/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 498
$(GFX) $< $@ -num_tiles 498 -Wnum_tiles
$(TILESETGFXDIR)/secondary/dewford/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 503
$(GFX) $< $@ -num_tiles 503 -Wnum_tiles
$(TILESETGFXDIR)/secondary/slateport/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 504
$(GFX) $< $@ -num_tiles 504 -Wnum_tiles
$(TILESETGFXDIR)/secondary/mauville/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 503
$(GFX) $< $@ -num_tiles 503 -Wnum_tiles
$(TILESETGFXDIR)/secondary/lavaridge/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 450
$(GFX) $< $@ -num_tiles 450 -Wnum_tiles
$(TILESETGFXDIR)/secondary/fortree/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 493
$(GFX) $< $@ -num_tiles 493 -Wnum_tiles
$(TILESETGFXDIR)/secondary/pacifidlog/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 504
$(GFX) $< $@ -num_tiles 504 -Wnum_tiles
$(TILESETGFXDIR)/secondary/sootopolis/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 328
$(GFX) $< $@ -num_tiles 328 -Wnum_tiles
SOOTOPOLISANIMDIR := $(TILESETGFXDIR)/secondary/sootopolis/anim
@ -125,169 +125,169 @@ $(SOOTOPOLISANIMDIR)/stormy_water/7.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/7_ky
@cat $^ >$@
$(TILESETGFXDIR)/secondary/battle_frontier_outside_west/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 508
$(GFX) $< $@ -num_tiles 508 -Wnum_tiles
$(TILESETGFXDIR)/secondary/battle_frontier_outside_east/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 508
$(GFX) $< $@ -num_tiles 508 -Wnum_tiles
$(TILESETGFXDIR)/primary/building/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 502
$(GFX) $< $@ -num_tiles 502 -Wnum_tiles
$(TILESETGFXDIR)/secondary/shop/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 502
$(GFX) $< $@ -num_tiles 502 -Wnum_tiles
$(TILESETGFXDIR)/secondary/pokemon_center/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 478
$(GFX) $< $@ -num_tiles 478 -Wnum_tiles
$(TILESETGFXDIR)/secondary/cave/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 425
$(GFX) $< $@ -num_tiles 425 -Wnum_tiles
$(TILESETGFXDIR)/secondary/pokemon_school/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 278
$(GFX) $< $@ -num_tiles 278 -Wnum_tiles
$(TILESETGFXDIR)/secondary/pokemon_fan_club/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 319
$(GFX) $< $@ -num_tiles 319 -Wnum_tiles
$(TILESETGFXDIR)/secondary/unused_1/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 17
$(GFX) $< $@ -num_tiles 17 -Wnum_tiles
$(TILESETGFXDIR)/secondary/meteor_falls/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 460
$(GFX) $< $@ -num_tiles 460 -Wnum_tiles
$(TILESETGFXDIR)/secondary/oceanic_museum/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 319
$(GFX) $< $@ -num_tiles 319 -Wnum_tiles
$(TILESETGFXDIR)/secondary/cable_club/unknown_tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 120
$(GFX) $< $@ -num_tiles 120 -Wnum_tiles
$(TILESETGFXDIR)/secondary/seashore_house/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 312
$(GFX) $< $@ -num_tiles 312 -Wnum_tiles
$(TILESETGFXDIR)/secondary/pretty_petal_flower_shop/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 345
$(GFX) $< $@ -num_tiles 345 -Wnum_tiles
$(TILESETGFXDIR)/secondary/pokemon_day_care/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 355
$(GFX) $< $@ -num_tiles 355 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/brown_cave/unused_tiles.4bpp: $(TILESETGFXDIR)/secondary/secret_base/brown_cave/tiles.png
$(GFX) $< $@ -num_tiles 82
$(GFX) $< $@ -num_tiles 82 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/tree/unused_tiles.4bpp: $(TILESETGFXDIR)/secondary/secret_base/tree/tiles.png
$(GFX) $< $@ -num_tiles 82
$(GFX) $< $@ -num_tiles 82 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/shrub/unused_tiles.4bpp: $(TILESETGFXDIR)/secondary/secret_base/shrub/tiles.png
$(GFX) $< $@ -num_tiles 82
$(GFX) $< $@ -num_tiles 82 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/blue_cave/unused_tiles.4bpp: $(TILESETGFXDIR)/secondary/secret_base/blue_cave/tiles.png
$(GFX) $< $@ -num_tiles 82
$(GFX) $< $@ -num_tiles 82 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/yellow_cave/unused_tiles.4bpp: $(TILESETGFXDIR)/secondary/secret_base/yellow_cave/tiles.png
$(GFX) $< $@ -num_tiles 82
$(GFX) $< $@ -num_tiles 82 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/red_cave/unused_tiles.4bpp: $(TILESETGFXDIR)/secondary/secret_base/red_cave/tiles.png
$(GFX) $< $@ -num_tiles 82
$(GFX) $< $@ -num_tiles 82 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/brown_cave/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 83
$(GFX) $< $@ -num_tiles 83 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/tree/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 83
$(GFX) $< $@ -num_tiles 83 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/shrub/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 83
$(GFX) $< $@ -num_tiles 83 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/blue_cave/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 83
$(GFX) $< $@ -num_tiles 83 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/yellow_cave/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 83
$(GFX) $< $@ -num_tiles 83 -Wnum_tiles
$(TILESETGFXDIR)/secondary/secret_base/red_cave/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 83
$(GFX) $< $@ -num_tiles 83 -Wnum_tiles
$(TILESETGFXDIR)/secondary/inside_of_truck/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 62
$(GFX) $< $@ -num_tiles 62 -Wnum_tiles
$(TILESETGFXDIR)/secondary/contest/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 430
$(GFX) $< $@ -num_tiles 430 -Wnum_tiles
$(TILESETGFXDIR)/secondary/lilycove_museum/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 431
$(GFX) $< $@ -num_tiles 431 -Wnum_tiles
$(TILESETGFXDIR)/secondary/lab/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 500
$(GFX) $< $@ -num_tiles 500 -Wnum_tiles
$(TILESETGFXDIR)/secondary/underwater/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 500
$(GFX) $< $@ -num_tiles 500 -Wnum_tiles
$(TILESETGFXDIR)/secondary/generic_building/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 509
$(GFX) $< $@ -num_tiles 509 -Wnum_tiles
$(TILESETGFXDIR)/secondary/mauville_game_corner/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 469
$(GFX) $< $@ -num_tiles 469 -Wnum_tiles
$(TILESETGFXDIR)/secondary/unused_2/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 150
$(GFX) $< $@ -num_tiles 150 -Wnum_tiles
$(TILESETGFXDIR)/secondary/rustboro_gym/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 60
$(GFX) $< $@ -num_tiles 60 -Wnum_tiles
$(TILESETGFXDIR)/secondary/dewford_gym/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 61
$(GFX) $< $@ -num_tiles 61 -Wnum_tiles
$(TILESETGFXDIR)/secondary/lavaridge_gym/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 54
$(GFX) $< $@ -num_tiles 54 -Wnum_tiles
$(TILESETGFXDIR)/secondary/petalburg_gym/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 148
$(GFX) $< $@ -num_tiles 148 -Wnum_tiles
$(TILESETGFXDIR)/secondary/fortree_gym/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 61
$(GFX) $< $@ -num_tiles 61 -Wnum_tiles
$(TILESETGFXDIR)/secondary/mossdeep_gym/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 82
$(GFX) $< $@ -num_tiles 82 -Wnum_tiles
$(TILESETGFXDIR)/secondary/sootopolis_gym/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 484
$(GFX) $< $@ -num_tiles 484 -Wnum_tiles
$(TILESETGFXDIR)/secondary/trick_house_puzzle/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 294
$(GFX) $< $@ -num_tiles 294 -Wnum_tiles
$(TILESETGFXDIR)/secondary/inside_ship/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 342
$(GFX) $< $@ -num_tiles 342 -Wnum_tiles
$(TILESETGFXDIR)/secondary/elite_four/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 505
$(GFX) $< $@ -num_tiles 505 -Wnum_tiles
$(TILESETGFXDIR)/secondary/battle_frontier/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 310
$(GFX) $< $@ -num_tiles 310 -Wnum_tiles
$(TILESETGFXDIR)/secondary/battle_factory/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 424
$(GFX) $< $@ -num_tiles 424 -Wnum_tiles
$(TILESETGFXDIR)/secondary/battle_pike/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 382
$(GFX) $< $@ -num_tiles 382 -Wnum_tiles
$(TILESETGFXDIR)/secondary/mirage_tower/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 420
$(GFX) $< $@ -num_tiles 420 -Wnum_tiles
$(TILESETGFXDIR)/secondary/mossdeep_game_corner/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 95
$(GFX) $< $@ -num_tiles 95 -Wnum_tiles
$(TILESETGFXDIR)/secondary/island_harbor/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 503
$(GFX) $< $@ -num_tiles 503 -Wnum_tiles
$(TILESETGFXDIR)/secondary/trainer_hill/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 374
$(GFX) $< $@ -num_tiles 374 -Wnum_tiles
$(TILESETGFXDIR)/secondary/navel_rock/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 420
$(GFX) $< $@ -num_tiles 420 -Wnum_tiles
$(TILESETGFXDIR)/secondary/battle_frontier_ranking_hall/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 136
$(GFX) $< $@ -num_tiles 136 -Wnum_tiles
$(TILESETGFXDIR)/secondary/mystery_events_house/tiles.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 509
$(GFX) $< $@ -num_tiles 509 -Wnum_tiles
@ -335,13 +335,13 @@ graphics/title_screen/pokemon_logo.gbapal: %.gbapal: %.pal
$(GFX) $< $@ -num_colors 224
graphics/pokemon_jump/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 63
$(GFX) $< $@ -num_tiles 63 -Wnum_tiles
graphics/pokenav/region_map.8bpp: %.8bpp: %.png
$(GFX) $< $@ -num_tiles 233
$(GFX) $< $@ -num_tiles 233 -Wnum_tiles
$(MISCGFXDIR)/japanese_hof.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 29
$(GFX) $< $@ -num_tiles 29 -Wnum_tiles
$(BATINTGFXDIR)/textbox.gbapal: $(BATINTGFXDIR)/textbox_0.gbapal \
$(BATINTGFXDIR)/textbox_1.gbapal
@ -385,10 +385,10 @@ $(UNUSEDGFXDIR)/redyellowgreen_frame.bin: $(UNUSEDGFXDIR)/red_frame.bin \
@cat $^ >$@
$(UNUSEDGFXDIR)/color_frames.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 353
$(GFX) $< $@ -num_tiles 353 -Wnum_tiles
$(BATINTGFXDIR)/unused_window2bar.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 5
$(GFX) $< $@ -num_tiles 5 -Wnum_tiles
$(JPCONTESTGFXDIR)/composite_1.4bpp: $(JPCONTESTGFXDIR)/frame_1.4bpp \
$(JPCONTESTGFXDIR)/floor.4bpp \
@ -404,7 +404,7 @@ $(JPCONTESTGFXDIR)/composite_2.4bpp: $(JPCONTESTGFXDIR)/interface.4bpp \
@cat $^ >$@
$(JPCONTESTGFXDIR)/voltage.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 36
$(GFX) $< $@ -num_tiles 36 -Wnum_tiles
$(BTLANMSPRGFXDIR)/ice_crystals.4bpp: $(BTLANMSPRGFXDIR)/ice_crystals_0.4bpp \
$(BTLANMSPRGFXDIR)/ice_crystals_1.4bpp \
@ -426,13 +426,13 @@ $(BTLANMSPRGFXDIR)/spark.4bpp: $(BTLANMSPRGFXDIR)/spark_0.4bpp \
@cat $^ >$@
$(MASKSGFXDIR)/unused_level_up.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 14
$(GFX) $< $@ -num_tiles 14 -Wnum_tiles
$(BATTRANSGFXDIR)/vs_frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 16
$(GFX) $< $@ -num_tiles 16 -Wnum_tiles
graphics/party_menu/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 62
$(GFX) $< $@ -num_tiles 62 -Wnum_tiles
$(TYPESGFXDIR)/move_types.4bpp: $(types:%=$(TYPESGFXDIR)/%.4bpp) $(contest_types:%=$(TYPESGFXDIR)/contest_%.4bpp)
@cat $^ >$@
@ -443,29 +443,29 @@ $(TYPESGFXDIR)/move_types.gbapal: $(TYPESGFXDIR)/move_types_1.gbapal \
@cat $^ >$@
graphics/bag/menu.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 53
$(GFX) $< $@ -num_tiles 53 -Wnum_tiles
$(RAYQUAZAGFXDIR)/scene_2/rayquaza.8bpp: %.8bpp: %.png
$(GFX) $< $@ -num_tiles 227
$(GFX) $< $@ -num_tiles 227 -Wnum_tiles
$(RAYQUAZAGFXDIR)/scene_2/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 313
$(GFX) $< $@ -num_tiles 313 -Wnum_tiles
$(RAYQUAZAGFXDIR)/scene_3/rayquaza.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 124
$(GFX) $< $@ -num_tiles 124 -Wnum_tiles
$(RAYQUAZAGFXDIR)/scene_3/rayquaza_tail_fix.4bpp: $(RAYQUAZAGFXDIR)/scene_3/rayquaza_tail.4bpp
cp $< $@
head -c 12 /dev/zero >> $@
$(RAYQUAZAGFXDIR)/scene_4/streaks.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 19
$(GFX) $< $@ -num_tiles 19 -Wnum_tiles
$(RAYQUAZAGFXDIR)/scene_4/rayquaza.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 155
$(GFX) $< $@ -num_tiles 155 -Wnum_tiles
graphics/picture_frame/lobby.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 86
$(GFX) $< $@ -num_tiles 86 -Wnum_tiles
$(ROULETTEGFXDIR)/roulette_tilt.4bpp: $(ROULETTEGFXDIR)/shroomish.4bpp \
$(ROULETTEGFXDIR)/tailow.4bpp
@ -478,10 +478,10 @@ $(ROULETTEGFXDIR)/wheel_icons.4bpp: $(ROULETTEGFXDIR)/wynaut.4bpp \
@cat $^ >$@
$(BATTRANSGFXDIR)/regis.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 53
$(GFX) $< $@ -num_tiles 53 -Wnum_tiles
$(BATTRANSGFXDIR)/rayquaza.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 938
$(GFX) $< $@ -num_tiles 938 -Wnum_tiles
$(BATTRANSGFXDIR)/frontier_square_1.4bpp: $(BATTRANSGFXDIR)/frontier_squares_blanktiles.4bpp \
$(BATTRANSGFXDIR)/frontier_squares_1.4bpp
@ -504,20 +504,20 @@ $(SLOTMACHINEGFXDIR)/reel_time_gfx.4bpp: $(SLOTMACHINEGFXDIR)/reel_time_pikachu.
@cat $^ >$@
graphics/birch_speech/unused_beauty.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 822
$(GFX) $< $@ -num_tiles 822 -Wnum_tiles
### Pokémon Storage System ###
$(WALLPAPERGFXDIR)/forest/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 55
$(GFX) $< $@ -num_tiles 55 -Wnum_tiles
$(WALLPAPERGFXDIR)/forest/tiles.4bpp: $(WALLPAPERGFXDIR)/forest/frame.4bpp $(WALLPAPERGFXDIR)/forest/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/city/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 52
$(GFX) $< $@ -num_tiles 52 -Wnum_tiles
$(WALLPAPERGFXDIR)/city/tiles.4bpp: $(WALLPAPERGFXDIR)/city/frame.4bpp $(WALLPAPERGFXDIR)/city/bg.4bpp
@cat $^ >$@
@ -526,97 +526,97 @@ $(WALLPAPERGFXDIR)/desert/tiles.4bpp: $(WALLPAPERGFXDIR)/desert/frame.4bpp $(WAL
@cat $^ >$@
$(WALLPAPERGFXDIR)/savanna/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 45
$(GFX) $< $@ -num_tiles 45 -Wnum_tiles
$(WALLPAPERGFXDIR)/savanna/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 23
$(GFX) $< $@ -num_tiles 23 -Wnum_tiles
$(WALLPAPERGFXDIR)/savanna/tiles.4bpp: $(WALLPAPERGFXDIR)/savanna/frame.4bpp $(WALLPAPERGFXDIR)/savanna/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/crag/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 49
$(GFX) $< $@ -num_tiles 49 -Wnum_tiles
$(WALLPAPERGFXDIR)/crag/tiles.4bpp: $(WALLPAPERGFXDIR)/crag/frame.4bpp $(WALLPAPERGFXDIR)/crag/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/volcano/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 56
$(GFX) $< $@ -num_tiles 56 -Wnum_tiles
$(WALLPAPERGFXDIR)/volcano/tiles.4bpp: $(WALLPAPERGFXDIR)/volcano/frame.4bpp $(WALLPAPERGFXDIR)/volcano/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/snow/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 57
$(GFX) $< $@ -num_tiles 57 -Wnum_tiles
$(WALLPAPERGFXDIR)/snow/tiles.4bpp: $(WALLPAPERGFXDIR)/snow/frame.4bpp $(WALLPAPERGFXDIR)/snow/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/cave/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 55
$(GFX) $< $@ -num_tiles 55 -Wnum_tiles
$(WALLPAPERGFXDIR)/cave/tiles.4bpp: $(WALLPAPERGFXDIR)/cave/frame.4bpp $(WALLPAPERGFXDIR)/cave/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/beach/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 46
$(GFX) $< $@ -num_tiles 46 -Wnum_tiles
$(WALLPAPERGFXDIR)/beach/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 23
$(GFX) $< $@ -num_tiles 23 -Wnum_tiles
$(WALLPAPERGFXDIR)/beach/tiles.4bpp: $(WALLPAPERGFXDIR)/beach/frame.4bpp $(WALLPAPERGFXDIR)/beach/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/seafloor/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 54
$(GFX) $< $@ -num_tiles 54 -Wnum_tiles
$(WALLPAPERGFXDIR)/seafloor/tiles.4bpp: $(WALLPAPERGFXDIR)/seafloor/frame.4bpp $(WALLPAPERGFXDIR)/seafloor/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/river/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 51
$(GFX) $< $@ -num_tiles 51 -Wnum_tiles
$(WALLPAPERGFXDIR)/river/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 11
$(GFX) $< $@ -num_tiles 11 -Wnum_tiles
$(WALLPAPERGFXDIR)/river/tiles.4bpp: $(WALLPAPERGFXDIR)/river/frame.4bpp $(WALLPAPERGFXDIR)/river/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/sky/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 45
$(GFX) $< $@ -num_tiles 45 -Wnum_tiles
$(WALLPAPERGFXDIR)/sky/tiles.4bpp: $(WALLPAPERGFXDIR)/sky/frame.4bpp $(WALLPAPERGFXDIR)/sky/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/polkadot/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 54
$(GFX) $< $@ -num_tiles 54 -Wnum_tiles
$(WALLPAPERGFXDIR)/polkadot/tiles.4bpp: $(WALLPAPERGFXDIR)/polkadot/frame.4bpp $(WALLPAPERGFXDIR)/polkadot/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/pokecenter/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 35
$(GFX) $< $@ -num_tiles 35 -Wnum_tiles
$(WALLPAPERGFXDIR)/pokecenter/tiles.4bpp: $(WALLPAPERGFXDIR)/pokecenter/frame.4bpp $(WALLPAPERGFXDIR)/pokecenter/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/machine/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 33
$(GFX) $< $@ -num_tiles 33 -Wnum_tiles
$(WALLPAPERGFXDIR)/machine/tiles.4bpp: $(WALLPAPERGFXDIR)/machine/frame.4bpp $(WALLPAPERGFXDIR)/machine/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/plain/frame.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 18
$(GFX) $< $@ -num_tiles 18 -Wnum_tiles
$(WALLPAPERGFXDIR)/plain/tiles.4bpp: $(WALLPAPERGFXDIR)/plain/frame.4bpp $(WALLPAPERGFXDIR)/plain/bg.4bpp
@cat $^ >$@
$(WALLPAPERGFXDIR)/friends_frame1.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 57
$(GFX) $< $@ -num_tiles 57 -Wnum_tiles
$(WALLPAPERGFXDIR)/friends_frame2.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 57
$(GFX) $< $@ -num_tiles 57 -Wnum_tiles
$(WALLPAPERGFXDIR)/zigzagoon/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/zigzagoon/bg.4bpp
@cat $^ >$@
@ -667,13 +667,13 @@ $(WALLPAPERGFXDIR)/whiscash/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame2.4bpp $
@cat $^ >$@
$(OBJEVENTGFXDIR)/pics/effects/unknown_4F6D38/0.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 11
$(GFX) $< $@ -num_tiles 11 -Wnum_tiles
$(INTERFACEGFXDIR)/selector_outline.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 8
$(GFX) $< $@ -num_tiles 8 -Wnum_tiles
$(BATTRANSGFXDIR)/frontier_logo_center.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 43
$(GFX) $< $@ -num_tiles 43 -Wnum_tiles
@ -695,28 +695,28 @@ $(PKNAVOPTIONSGFXDIR)/options.4bpp: $(PKNAVOPTIONSGFXDIR)/hoenn_map.4bpp \
@cat $^ >$@
$(PKNAVGFXDIR)/header.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 53
$(GFX) $< $@ -num_tiles 53 -Wnum_tiles
$(PKNAVGFXDIR)/device_outline.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 53
$(GFX) $< $@ -num_tiles 53 -Wnum_tiles
$(PKNAVGFXDIR)/match_call/ui.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 13
$(GFX) $< $@ -num_tiles 13 -Wnum_tiles
$(POKEDEXGFXDIR)/region_map.8bpp: %.8bpp: %.png
$(GFX) $< $@ -num_tiles 232
$(GFX) $< $@ -num_tiles 232 -Wnum_tiles
$(POKEDEXGFXDIR)/region_map_affine.8bpp: %.8bpp: %.png
$(GFX) $< $@ -num_tiles 233
$(GFX) $< $@ -num_tiles 233 -Wnum_tiles
$(STARTERGFXDIR)/birch_help.4bpp: $(STARTERGFXDIR)/birch_bag.4bpp $(STARTERGFXDIR)/birch_grass.4bpp
@cat $^ >$@
$(NAMINGGFXDIR)/cursor.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 5
$(GFX) $< $@ -num_tiles 5 -Wnum_tiles
$(NAMINGGFXDIR)/cursor_squished.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 5
$(GFX) $< $@ -num_tiles 5 -Wnum_tiles
$(NAMINGGFXDIR)/cursor_filled.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 5
$(GFX) $< $@ -num_tiles 5 -Wnum_tiles

View File

@ -50,11 +50,11 @@ void SpriteCB_VsLetterInit(struct Sprite *sprite);
void CB2_InitEndLinkBattle(void);
u32 GetBattleBgTemplateData(u8 arrayId, u8 caseId);
u32 GetBattleWindowTemplatePixelWidth(u32 setId, u32 tableId);
void SpriteCb_WildMon(struct Sprite *sprite);
void SpriteCB_WildMon(struct Sprite *sprite);
void SpriteCallbackDummy_2(struct Sprite *sprite);
void SpriteCB_FaintOpponentMon(struct Sprite *sprite);
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite);
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite);
void SpriteCB_ShowAsMoveTarget(struct Sprite *sprite);
void SpriteCB_HideAsMoveTarget(struct Sprite *sprite);
void SpriteCB_OpponentMonFromBall(struct Sprite *sprite);
void SpriteCB_BattleSpriteStartSlideLeft(struct Sprite *sprite);
void SpriteCB_FaintSlideAnim(struct Sprite *sprite);

View File

@ -64,7 +64,6 @@ u8 GetBattlerForBattleScript(u8 caseId);
void PressurePPLose(u8 target, u8 attacker, u16 move);
void PressurePPLoseOnUsingPerishSong(u8 attacker);
void PressurePPLoseOnUsingImprison(u8 attacker);
void MarkAllBattlersForControllerExec(void); // unused
void MarkBattlerForControllerExec(u8 battlerId);
void MarkBattlerReceivedLinkData(u8 battlerId);
void CancelMultiTurnMoves(u8 battlerId);

View File

@ -316,6 +316,11 @@
#define FLEE_ITEM 1
#define FLEE_ABILITY 2
// Return value for IsRunningFromBattleImpossible.
#define BATTLE_RUN_SUCCESS 0
#define BATTLE_RUN_FORBIDDEN 1
#define BATTLE_RUN_FAILURE 2
#define B_WIN_TYPE_NORMAL 0
#define B_WIN_TYPE_ARENA 1

View File

@ -35,7 +35,7 @@ static void SaveArenaChallenge(void);
static void SetArenaPrize(void);
static void GiveArenaPrize(void);
static void BufferArenaOpponentName(void);
static void SpriteCb_JudgmentIcon(struct Sprite *sprite);
static void SpriteCB_JudgmentIcon(struct Sprite *sprite);
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler);
static const s8 sMindRatings[] =
@ -456,7 +456,7 @@ static const struct SpriteTemplate sSpriteTemplate_JudgmentIcon =
.anims = sJudgementIconAnimCmds,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCb_JudgmentIcon,
.callback = SpriteCB_JudgmentIcon,
};
static const struct CompressedSpriteSheet sBattleArenaJudgementSymbolsSpriteSheet[] =
@ -679,7 +679,7 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
StartSpriteAnim(&gSprites[pointsPlayer], animNum);
}
static void SpriteCb_JudgmentIcon(struct Sprite *sprite)
static void SpriteCB_JudgmentIcon(struct Sprite *sprite)
{
if (gBattleCommunication[0] > 8)
DestroySprite(sprite);

View File

@ -364,7 +364,7 @@ static void HandleInputChooseTarget(void)
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
PlayerBufferExecCompleted();
@ -372,7 +372,7 @@ static void HandleInputChooseTarget(void)
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove;
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
@ -381,7 +381,7 @@ static void HandleInputChooseTarget(void)
else if (JOY_NEW(DPAD_LEFT | DPAD_UP))
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
do
{
@ -422,12 +422,12 @@ static void HandleInputChooseTarget(void)
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
i = 0;
} while (i == 0);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
}
else if (JOY_NEW(DPAD_RIGHT | DPAD_DOWN))
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
do
{
@ -464,7 +464,7 @@ static void HandleInputChooseTarget(void)
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
i = 0;
} while (i == 0);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
}
}
@ -537,7 +537,7 @@ static void HandleInputChooseMove(void)
else
gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
}
}
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)

View File

@ -108,8 +108,8 @@ static u8 UpdateTourneyTreeCursor(u8);
static void DecideRoundWinners(u8);
static u8 GetOpposingNPCTournamentIdByRound(u8, u8);
static void DrawTourneyAdvancementLine(u8, u8);
static void SpriteCb_HorizontalScrollArrow(struct Sprite *);
static void SpriteCb_VerticalScrollArrow(struct Sprite *);
static void SpriteCB_HorizontalScrollArrow(struct Sprite *);
static void SpriteCB_VerticalScrollArrow(struct Sprite *);
static void InitDomeChallenge(void);
static void GetDomeData(void);
static void SetDomeData(void);
@ -1089,7 +1089,7 @@ static const struct SpriteTemplate sHorizontalScrollArrowSpriteTemplate =
.anims = sSpriteAnimTable_HorizontalScrollArrow,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCb_HorizontalScrollArrow
.callback = SpriteCB_HorizontalScrollArrow
};
static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
@ -1100,7 +1100,7 @@ static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
.anims = sSpriteAnimTable_VerticalScrollArrow,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCb_VerticalScrollArrow
.callback = SpriteCB_VerticalScrollArrow
};
// Organized by seed starting position, i.e. seed 0 battles seed 8 first
@ -3115,7 +3115,7 @@ static void Task_ShowTourneyInfoCard(u8 taskId)
// Note: Card scrolling up means the current card goes down and another one appears from top.
// The same is true for scrolling left.
// That means that the sprite needs to move with the moving card in the opposite scrolling direction.
static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
static void SpriteCB_TrainerIconCardScrollUp(struct Sprite *sprite)
{
sprite->y += 4;
if (sprite->data[0] != 0)
@ -3135,7 +3135,7 @@ static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
}
}
static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
static void SpriteCB_TrainerIconCardScrollDown(struct Sprite *sprite)
{
sprite->y -= 4;
if (sprite->data[0] != 0)
@ -3155,7 +3155,7 @@ static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
}
}
static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
static void SpriteCB_TrainerIconCardScrollLeft(struct Sprite *sprite)
{
sprite->x += 4;
if (sprite->data[0] != 0)
@ -3175,7 +3175,7 @@ static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
}
}
static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
static void SpriteCB_TrainerIconCardScrollRight(struct Sprite *sprite)
{
sprite->x -= 4;
if (sprite->data[0] != 0)
@ -3197,13 +3197,13 @@ static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
#define sMonIconStill data[3]
static void SpriteCb_MonIcon(struct Sprite *sprite)
static void SpriteCB_MonIconDomeInfo(struct Sprite *sprite)
{
if (!sprite->sMonIconStill)
UpdateMonIconFrame(sprite);
}
static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
static void SpriteCB_MonIconCardScrollUp(struct Sprite *sprite)
{
if (!sprite->sMonIconStill)
UpdateMonIconFrame(sprite);
@ -3213,7 +3213,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
if (sprite->y >= -16)
sprite->invisible = FALSE;
if (++sprite->data[1] == 40)
sprite->callback = SpriteCb_MonIcon;
sprite->callback = SpriteCB_MonIconDomeInfo;
}
else
{
@ -3225,7 +3225,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
}
}
static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
static void SpriteCB_MonIconCardScrollDown(struct Sprite *sprite)
{
if (!sprite->sMonIconStill)
UpdateMonIconFrame(sprite);
@ -3235,7 +3235,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
if (sprite->y <= 176)
sprite->invisible = FALSE;
if (++sprite->data[1] == 40)
sprite->callback = SpriteCb_MonIcon;
sprite->callback = SpriteCB_MonIconDomeInfo;
}
else
{
@ -3247,7 +3247,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
}
}
static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
static void SpriteCB_MonIconCardScrollLeft(struct Sprite *sprite)
{
if (!sprite->sMonIconStill)
UpdateMonIconFrame(sprite);
@ -3257,7 +3257,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
if (sprite->x >= -16)
sprite->invisible = FALSE;
if (++sprite->data[1] == 64)
sprite->callback = SpriteCb_MonIcon;
sprite->callback = SpriteCB_MonIconDomeInfo;
}
else
{
@ -3269,7 +3269,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
}
}
static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
static void SpriteCB_MonIconCardScrollRight(struct Sprite *sprite)
{
if (!sprite->sMonIconStill)
UpdateMonIconFrame(sprite);
@ -3279,7 +3279,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
if (sprite->x <= DISPLAY_WIDTH + 16)
sprite->invisible = FALSE;
if (++sprite->data[1] == 64)
sprite->callback = SpriteCb_MonIcon;
sprite->callback = SpriteCB_MonIconDomeInfo;
}
else
{
@ -3291,7 +3291,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
}
}
static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
static void SpriteCB_HorizontalScrollArrow(struct Sprite *sprite)
{
int taskId1 = sprite->data[0];
int arrId = gTasks[gTasks[taskId1].data[4]].data[1];
@ -3360,7 +3360,7 @@ static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
}
}
static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite)
static void SpriteCB_VerticalScrollArrow(struct Sprite *sprite)
{
int taskId1 = sprite->data[0];
@ -3526,7 +3526,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3537,7 +3537,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3550,7 +3550,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3561,7 +3561,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3642,7 +3642,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3653,7 +3653,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3666,7 +3666,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3677,7 +3677,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3725,7 +3725,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3736,7 +3736,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3749,7 +3749,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3760,7 +3760,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3808,7 +3808,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3819,7 +3819,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3832,7 +3832,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3843,7 +3843,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3889,7 +3889,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3900,7 +3900,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3913,7 +3913,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3924,7 +3924,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3972,7 +3972,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3983,7 +3983,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -3996,7 +3996,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -4007,7 +4007,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
{
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
{
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
@ -4297,7 +4297,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
if (trainerId == TRAINER_PLAYER)
{
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sInfoTrainerMonX[i],
y + sInfoTrainerMonY[i],
0, 0, TRUE);
@ -4306,7 +4306,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
else if (trainerId == TRAINER_FRONTIER_BRAIN)
{
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sInfoTrainerMonX[i],
y + sInfoTrainerMonY[i],
0, 0, TRUE);
@ -4315,7 +4315,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
else
{
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species,
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sInfoTrainerMonX[i],
y + sInfoTrainerMonY[i],
0, 0, TRUE);
@ -4786,7 +4786,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
if (trainerIds[0] == TRAINER_PLAYER)
{
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sLeftTrainerMonX[i],
y + sLeftTrainerMonY[i],
0, 0, TRUE);
@ -4795,7 +4795,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
{
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sLeftTrainerMonX[i],
y + sLeftTrainerMonY[i],
0, 0, TRUE);
@ -4804,7 +4804,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
else
{
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[0]][i]].species,
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sLeftTrainerMonX[i],
y + sLeftTrainerMonY[i],
0, 0, TRUE);
@ -4826,7 +4826,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
if (trainerIds[1] == TRAINER_PLAYER)
{
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sRightTrainerMonX[i],
y + sRightTrainerMonY[i],
0, 0, TRUE);
@ -4835,7 +4835,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
{
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sRightTrainerMonX[i],
y + sRightTrainerMonY[i],
0, 0, TRUE);
@ -4844,7 +4844,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
else
{
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[1]][i]].species,
SpriteCb_MonIcon,
SpriteCB_MonIconDomeInfo,
x | sRightTrainerMonX[i],
y + sRightTrainerMonY[i],
0, 0, TRUE);

View File

@ -78,12 +78,12 @@ static void EndLinkBattleInSteps(void);
static void CB2_InitAskRecordBattle(void);
static void CB2_AskRecordBattle(void);
static void AskRecordBattle(void);
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite);
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite);
static void SpriteCb_WildMonAnimate(struct Sprite *sprite);
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite);
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite);
static void SpriteCB_WildMonAnimate(struct Sprite *sprite);
static void SpriteCB_Flicker(struct Sprite *sprite);
static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite);
static void SpriteCb_BlinkVisible(struct Sprite *sprite);
static void SpriteCB_BlinkVisible(struct Sprite *sprite);
static void SpriteCB_Idle(struct Sprite *sprite);
static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite);
static void TurnValuesCleanUp(bool8 var0);
@ -772,8 +772,7 @@ static void SetPlayerBerryDataInBattleStruct(void)
static void SetAllPlayersBerryData(void)
{
s32 i;
s32 j;
s32 i, j;
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK))
{
@ -816,8 +815,8 @@ static void SetAllPlayersBerryData(void)
gEnigmaBerries[2].itemEffect[i] = 0;
}
gEnigmaBerries[0].holdEffect = 0;
gEnigmaBerries[2].holdEffect = 0;
gEnigmaBerries[0].holdEffect = HOLD_EFFECT_NONE;
gEnigmaBerries[2].holdEffect = HOLD_EFFECT_NONE;
gEnigmaBerries[0].holdEffectParam = 0;
gEnigmaBerries[2].holdEffectParam = 0;
}
@ -2650,38 +2649,38 @@ u32 GetBattleWindowTemplatePixelWidth(u32 windowsType, u32 tableId)
#define sBattler data[0]
#define sSpeciesId data[2]
void SpriteCb_WildMon(struct Sprite *sprite)
void SpriteCB_WildMon(struct Sprite *sprite)
{
sprite->callback = SpriteCb_MoveWildMonToRight;
sprite->callback = SpriteCB_MoveWildMonToRight;
StartSpriteAnimIfDifferent(sprite, 0);
BeginNormalPaletteFade(0x20000, 0, 10, 10, RGB(8, 8, 8));
}
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite)
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite)
{
if ((gIntroSlideFlags & 1) == 0)
{
sprite->x2 += 2;
if (sprite->x2 == 0)
{
sprite->callback = SpriteCb_WildMonShowHealthbox;
sprite->callback = SpriteCB_WildMonShowHealthbox;
}
}
}
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite)
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite)
{
if (sprite->animEnded)
{
StartHealthboxSlideIn(sprite->sBattler);
SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->sBattler]);
sprite->callback = SpriteCb_WildMonAnimate;
sprite->callback = SpriteCB_WildMonAnimate;
StartSpriteAnimIfDifferent(sprite, 0);
BeginNormalPaletteFade(0x20000, 0, 10, 0, RGB(8, 8, 8));
}
}
static void SpriteCb_WildMonAnimate(struct Sprite *sprite)
static void SpriteCB_WildMonAnimate(struct Sprite *sprite)
{
if (!gPaletteFade.active)
{
@ -2798,14 +2797,14 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
}
// Used when selecting a move, which can hit multiple targets, in double battles.
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite)
void SpriteCB_ShowAsMoveTarget(struct Sprite *sprite)
{
sprite->data[3] = 8;
sprite->data[4] = sprite->invisible;
sprite->callback = SpriteCb_BlinkVisible;
sprite->callback = SpriteCB_BlinkVisible;
}
static void SpriteCb_BlinkVisible(struct Sprite *sprite)
static void SpriteCB_BlinkVisible(struct Sprite *sprite)
{
if (--sprite->data[3] == 0)
{
@ -2814,7 +2813,7 @@ static void SpriteCb_BlinkVisible(struct Sprite *sprite)
}
}
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite)
void SpriteCB_HideAsMoveTarget(struct Sprite *sprite)
{
sprite->invisible = sprite->data[4];
sprite->data[4] = FALSE;
@ -3038,13 +3037,13 @@ static void BattleStartClearSetData(void)
gDisableStructs[i].isFirstTurn = 2;
sUnusedBattlersArray[i] = 0;
gLastMoves[i] = 0;
gLastLandedMoves[i] = 0;
gLastMoves[i] = MOVE_NONE;
gLastLandedMoves[i] = MOVE_NONE;
gLastHitByType[i] = 0;
gLastResultingMoves[i] = 0;
gLastResultingMoves[i] = MOVE_NONE;
gLastHitBy[i] = 0xFF;
gLockedMoves[i] = 0;
gLastPrintedMoves[i] = 0;
gLockedMoves[i] = MOVE_NONE;
gLastPrintedMoves[i] = MOVE_NONE;
gBattleResources->flags->flags[i] = 0;
gPalaceSelectionBattleScripts[i] = 0;
}
@ -3105,10 +3104,10 @@ static void BattleStartClearSetData(void)
for (i = 0; i < 8; i++)
{
*((u8 *)gBattleStruct->lastTakenMove + i) = 0;
*((u8 *)gBattleStruct->usedHeldItems + i) = 0;
*((u8 *)gBattleStruct->choicedMove + i) = 0;
*((u8 *)gBattleStruct->changedItems + i) = 0;
*((u8 *)gBattleStruct->lastTakenMove + i) = MOVE_NONE;
*((u8 *)gBattleStruct->usedHeldItems + i) = ITEM_NONE;
*((u8 *)gBattleStruct->choicedMove + i) = MOVE_NONE;
*((u8 *)gBattleStruct->changedItems + i) = ITEM_NONE;
*(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
*(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
*(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
@ -3205,15 +3204,15 @@ void SwitchInClearSetData(void)
gMoveResultFlags = 0;
gDisableStructs[gActiveBattler].isFirstTurn = 2;
gDisableStructs[gActiveBattler].truantSwitchInHack = disableStructCopy.truantSwitchInHack;
gLastMoves[gActiveBattler] = 0;
gLastLandedMoves[gActiveBattler] = 0;
gLastMoves[gActiveBattler] = MOVE_NONE;
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
gLastHitByType[gActiveBattler] = 0;
gLastResultingMoves[gActiveBattler] = 0;
gLastPrintedMoves[gActiveBattler] = 0;
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
gLastHitBy[gActiveBattler] = 0xFF;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
@ -3229,18 +3228,18 @@ void SwitchInClearSetData(void)
{
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
{
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
}
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
}
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
gBattleResources->flags->flags[gActiveBattler] = 0;
gCurrentMove = 0;
gCurrentMove = MOVE_NONE;
gBattleStruct->arenaTurnCounter = 0xFF;
ClearBattlerMoveHistory(gActiveBattler);
@ -3297,18 +3296,18 @@ void FaintClearSetData(void)
gDisableStructs[gActiveBattler].isFirstTurn = 2;
gLastMoves[gActiveBattler] = 0;
gLastLandedMoves[gActiveBattler] = 0;
gLastMoves[gActiveBattler] = MOVE_NONE;
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
gLastHitByType[gActiveBattler] = 0;
gLastResultingMoves[gActiveBattler] = 0;
gLastPrintedMoves[gActiveBattler] = 0;
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
gLastHitBy[gActiveBattler] = 0xFF;
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
@ -3324,8 +3323,8 @@ void FaintClearSetData(void)
{
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
{
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
}
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
@ -3371,8 +3370,8 @@ static void BattleIntroPrepareBackgroundSlide(void)
BtlController_EmitIntroSlide(BUFFER_A, gBattleTerrain);
MarkBattlerForControllerExec(gActiveBattler);
gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites;
gBattleCommunication[0] = 0;
gBattleCommunication[1] = 0;
gBattleCommunication[MULTIUSE_STATE] = 0;
gBattleCommunication[SPRITES_INIT_STATE1] = 0;
}
}
@ -3387,7 +3386,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
{
if ((gBattleTypeFlags & BATTLE_TYPE_SAFARI)
&& GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
&& GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
{
ptr = (u8 *)&gBattleMons[gActiveBattler];
for (i = 0; i < sizeof(struct BattlePokemon); i++)
@ -3545,7 +3544,6 @@ static void BattleIntroDrawPartySummaryScreens(void)
gBattleMainFunc = BattleIntroPrintWildMonAttacked;
}
}
static void BattleIntroPrintTrainerWantsToBattle(void)
@ -3839,7 +3837,7 @@ static void TryDoEventsBeforeFirstTurn(void)
gBattleStruct->switchInAbilitiesCounter++;
if (effect)
if (effect != 0)
return;
}
if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) != 0)
@ -3854,7 +3852,7 @@ static void TryDoEventsBeforeFirstTurn(void)
gBattleStruct->switchInItemsCounter++;
if (effect)
if (effect != 0)
return;
}
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
@ -3997,11 +3995,11 @@ u8 IsRunningFromBattleImpossible(void)
gPotentialItemEffectBattler = gActiveBattler;
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
return 0;
return BATTLE_RUN_SUCCESS;
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
return 0;
return BATTLE_RUN_SUCCESS;
if (gBattleMons[gActiveBattler].ability == ABILITY_RUN_AWAY)
return 0;
return BATTLE_RUN_SUCCESS;
side = GetBattlerSide(gActiveBattler);
@ -4013,7 +4011,7 @@ u8 IsRunningFromBattleImpossible(void)
gBattleScripting.battler = i;
gLastUsedAbility = gBattleMons[i].ability;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2;
return BATTLE_RUN_FAILURE;
}
if (side != GetBattlerSide(i)
&& gBattleMons[gActiveBattler].ability != ABILITY_LEVITATE
@ -4023,7 +4021,7 @@ u8 IsRunningFromBattleImpossible(void)
gBattleScripting.battler = i;
gLastUsedAbility = gBattleMons[i].ability;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2;
return BATTLE_RUN_FAILURE;
}
}
i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0);
@ -4032,20 +4030,20 @@ u8 IsRunningFromBattleImpossible(void)
gBattleScripting.battler = i - 1;
gLastUsedAbility = gBattleMons[i - 1].ability;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2;
return BATTLE_RUN_FAILURE;
}
if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|| (gStatuses3[gActiveBattler] & STATUS3_ROOTED))
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE;
return 1;
return BATTLE_RUN_FORBIDDEN;
}
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH;
return 1;
return BATTLE_RUN_FORBIDDEN;
}
return 0;
return BATTLE_RUN_SUCCESS;
}
void SwitchPartyOrder(u8 battler)
@ -4301,7 +4299,7 @@ static void HandleTurnActionSelectionState(void)
BattleScriptExecute(BattleScript_PrintCantRunFromTrainer);
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
}
else if (IsRunningFromBattleImpossible()
else if (IsRunningFromBattleImpossible() != BATTLE_RUN_SUCCESS
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
{
gSelectionBattleScripts[gActiveBattler] = BattleScript_PrintCantEscapeFromBattle;

View File

@ -471,7 +471,7 @@ bool8 TryRunFromBattle(u8 battler)
gBattleStruct->runTries++;
}
if (effect)
if (effect != 0)
{
gCurrentTurnActionNumber = gBattlersCount;
gBattleOutcome = B_OUTCOME_RAN;
@ -823,7 +823,8 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
}
}
void MarkAllBattlersForControllerExec(void) // unused
// Unused
static void MarkAllBattlersForControllerExec(void)
{
int i;
@ -1108,8 +1109,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
#define ALL_MOVES_MASK ((1 << MAX_MON_MOVES) - 1)
bool8 AreAllMovesUnusable(void)
{
u8 unusable;
unusable = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL);
u8 unusable = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL);
if (unusable == ALL_MOVES_MASK) // All moves are unusable.
{
@ -1220,10 +1220,10 @@ u8 DoFieldEndTurnEffects(void)
}
}
gBattleStruct->turnSideTracker++;
if (effect)
if (effect != 0)
break;
}
if (!effect)
if (effect == 0)
{
gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0;
@ -1246,10 +1246,10 @@ u8 DoFieldEndTurnEffects(void)
}
}
gBattleStruct->turnSideTracker++;
if (effect)
if (effect != 0)
break;
}
if (!effect)
if (effect == 0)
{
gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0;
@ -1260,8 +1260,7 @@ u8 DoFieldEndTurnEffects(void)
{
side = gBattleStruct->turnSideTracker;
gActiveBattler = gBattlerAttacker = gSideTimers[side].mistBattlerId;
if (gSideTimers[side].mistTimer != 0
&& --gSideTimers[side].mistTimer == 0)
if (gSideTimers[side].mistTimer != 0 && --gSideTimers[side].mistTimer == 0)
{
gSideStatuses[side] &= ~SIDE_STATUS_MIST;
BattleScriptExecute(BattleScript_SideStatusWoreOff);
@ -1270,10 +1269,10 @@ u8 DoFieldEndTurnEffects(void)
effect++;
}
gBattleStruct->turnSideTracker++;
if (effect)
if (effect != 0)
break;
}
if (!effect)
if (effect == 0)
{
gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0;
@ -1294,10 +1293,10 @@ u8 DoFieldEndTurnEffects(void)
}
}
gBattleStruct->turnSideTracker++;
if (effect)
if (effect != 0)
break;
}
if (!effect)
if (effect == 0)
{
gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0;
@ -1316,10 +1315,10 @@ u8 DoFieldEndTurnEffects(void)
effect++;
}
gBattleStruct->turnSideTracker++;
if (effect)
if (effect != 0)
break;
}
if (!effect)
if (effect == 0)
{
gBattleStruct->turnCountersTracker++;
}
@ -1687,12 +1686,12 @@ u8 DoBattlerEndTurnEffects(void)
}
if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore
{
gDisableStructs[gActiveBattler].disabledMove = 0;
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
gDisableStructs[gActiveBattler].disableTimer = 0;
}
else if (--gDisableStructs[gActiveBattler].disableTimer == 0) // disable ends
{
gDisableStructs[gActiveBattler].disabledMove = 0;
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
BattleScriptExecute(BattleScript_DisabledNoMore);
effect++;
}
@ -1704,13 +1703,13 @@ u8 DoBattlerEndTurnEffects(void)
{
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
{
gDisableStructs[gActiveBattler].encoredMove = 0;
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
gDisableStructs[gActiveBattler].encoreTimer = 0;
}
else if (--gDisableStructs[gActiveBattler].encoreTimer == 0
|| gBattleMons[gActiveBattler].pp[gDisableStructs[gActiveBattler].encoredMovePos] == 0)
{
gDisableStructs[gActiveBattler].encoredMove = 0;
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
gDisableStructs[gActiveBattler].encoreTimer = 0;
BattleScriptExecute(BattleScript_EncoredNoMore);
effect++;
@ -2103,7 +2102,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleStruct->atkCancellerTracker++;
break;
case CANCELLER_DISABLED: // disabled move
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0)
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != MOVE_NONE)
{
gProtectStructs[gBattlerAttacker].usedDisabledMove = 1;
gBattleScripting.battler = gBattlerAttacker;
@ -2172,7 +2171,7 @@ u8 AtkCanceller_UnableToUseMove(void)
if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0)
{
gProtectStructs[gBattlerAttacker].prlzImmobility = 1;
// This is removed in Emerald for some reason
// This is removed in FRLG and Emerald for some reason
//CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
@ -2210,7 +2209,7 @@ u8 AtkCanceller_UnableToUseMove(void)
}
else
{
// This is removed in Emerald for some reason
// This is removed in FRLG and Emerald for some reason
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
if (gTakenDmg[gBattlerAttacker])
{
@ -2261,8 +2260,8 @@ u8 AtkCanceller_UnableToUseMove(void)
bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
{
u8 playerId, flankId;
struct Pokemon *party;
u8 id1, id2;
s32 i;
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
@ -2275,15 +2274,15 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
else
party = gEnemyParty;
id1 = ((battler & BIT_FLANK) / 2);
for (i = id1 * MULTI_PARTY_SIZE; i < id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
playerId = ((battler & BIT_FLANK) / 2);
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
break;
}
return (i == id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
}
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{
@ -2292,76 +2291,76 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
{
party = gPlayerParty;
id2 = GetBattlerMultiplayerId(battler);
id1 = GetLinkTrainerFlankId(id2);
flankId = GetBattlerMultiplayerId(battler);
playerId = GetLinkTrainerFlankId(flankId);
}
else
{
party = gEnemyParty;
if (battler == 1)
id1 = 0;
playerId = 0;
else
id1 = 1;
playerId = 1;
}
}
else
{
id2 = GetBattlerMultiplayerId(battler);
flankId = GetBattlerMultiplayerId(battler);
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
party = gPlayerParty;
else
party = gEnemyParty;
id1 = GetLinkTrainerFlankId(id2);
playerId = GetLinkTrainerFlankId(flankId);
}
for (i = id1 * MULTI_PARTY_SIZE; i < id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
break;
}
return (i == id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
}
else if ((gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) && GetBattlerSide(battler) == B_SIDE_OPPONENT)
{
party = gEnemyParty;
if (battler == 1)
id1 = 0;
playerId = 0;
else
id1 = MULTI_PARTY_SIZE;
playerId = MULTI_PARTY_SIZE;
for (i = id1; i < id1 + MULTI_PARTY_SIZE; i++)
for (i = playerId; i < playerId + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
break;
}
return (i == id1 + 3);
return (i == playerId + 3);
}
else
{
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
{
id2 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
id1 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
flankId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
playerId = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
party = gEnemyParty;
}
else
{
id2 = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
id1 = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
flankId = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
playerId = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
party = gPlayerParty;
}
if (partyIdBattlerOn1 == PARTY_SIZE)
partyIdBattlerOn1 = gBattlerPartyIndexes[id2];
partyIdBattlerOn1 = gBattlerPartyIndexes[flankId];
if (partyIdBattlerOn2 == PARTY_SIZE)
partyIdBattlerOn2 = gBattlerPartyIndexes[id1];
partyIdBattlerOn2 = gBattlerPartyIndexes[playerId];
for (i = 0; i < PARTY_SIZE; i++)
{
@ -2369,7 +2368,7 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
&& i != partyIdBattlerOn1 && i != partyIdBattlerOn2
&& i != *(gBattleStruct->monToSwitchIntoId + id2) && i != id1[gBattleStruct->monToSwitchIntoId])
&& i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId])
break;
}
return (i == PARTY_SIZE);
@ -2506,7 +2505,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
break;
}
}
if (effect)
if (effect != 0)
{
gBattleCommunication[MULTISTRING_CHOOSER] = GetCurrentWeather();
BattleScriptPushCursorAndCallback(BattleScript_OverworldWeatherStarts);
@ -2548,7 +2547,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
break;
case ABILITY_FORECAST:
effect = CastformDataTypeChange(battler);
if (effect)
if (effect != 0)
{
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
gBattleScripting.battler = battler;
@ -2569,7 +2568,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
for (target1 = 0; target1 < gBattlersCount; target1++)
{
effect = CastformDataTypeChange(target1);
if (effect)
if (effect != 0)
{
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
gBattleScripting.battler = target1;
@ -2909,7 +2908,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
}
break;
}
if (effect)
if (effect != 0)
{
switch (effect)
{
@ -2940,7 +2939,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
if (gBattleMons[battler].ability == ABILITY_FORECAST)
{
effect = CastformDataTypeChange(battler);
if (effect)
if (effect != 0)
{
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
gBattleScripting.battler = battler;
@ -3040,7 +3039,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
effect++;
}
}
if (effect)
if (effect != 0)
{
BattleScriptPushCursorAndCallback(BattleScript_TraceActivates);
gStatuses3[i] &= ~STATUS3_TRACE;
@ -3300,7 +3299,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
effect = ITEM_STATS_CHANGE;
}
}
if (effect)
if (effect != 0)
{
gBattleScripting.battler = battlerId;
gPotentialItemEffectBattler = battlerId;
@ -3371,7 +3370,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
effect = ITEM_STATS_CHANGE;
}
}
if (effect)
if (effect != 0)
{
gBattleScripting.battler = battlerId;
gPotentialItemEffectBattler = battlerId;
@ -3583,7 +3582,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
}
break;
}
if (effect)
if (effect != 0)
{
gBattleScripting.battler = battlerId;
gPotentialItemEffectBattler = battlerId;
@ -3727,7 +3726,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
effect = ITEM_STATS_CHANGE;
}
}
if (effect)
if (effect != 0)
{
gBattleScripting.battler = battlerId;
gPotentialItemEffectBattler = battlerId;
@ -3737,7 +3736,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
}
break;
}
if (effect)
if (effect != 0)
{
gBattleScripting.battler = battlerId;
gPotentialItemEffectBattler = battlerId;

View File

@ -1945,7 +1945,7 @@ const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] =
.anims = NULL,
.images = gBattlerPicTable_OpponentLeft,
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
.callback = SpriteCb_WildMon,
.callback = SpriteCB_WildMon,
},
[B_POSITION_PLAYER_RIGHT] = {
.tileTag = TAG_NONE,
@ -1963,7 +1963,7 @@ const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] =
.anims = NULL,
.images = gBattlerPicTable_OpponentRight,
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
.callback = SpriteCb_WildMon
.callback = SpriteCB_WildMon
},
};

View File

@ -305,7 +305,7 @@ static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *);
static void CreateCaughtBallSprite(struct Pokemon *);
static void CreateSetStatusSprite(void);
static void CreateMoveSelectorSprites(u8);
static void SpriteCb_MoveSelector(struct Sprite *);
static void SpriteCB_MoveSelector(struct Sprite *);
static void DestroyMoveSelectorSprites(u8);
static void SetMainMoveSelectorColor(u8);
static void KeepMoveSelectorVisible(u8);
@ -4082,14 +4082,14 @@ static void CreateMoveSelectorSprites(u8 idArrayStart)
else
StartSpriteAnim(&gSprites[spriteIds[i]], 6); // middle
gSprites[spriteIds[i]].callback = SpriteCb_MoveSelector;
gSprites[spriteIds[i]].callback = SpriteCB_MoveSelector;
gSprites[spriteIds[i]].data[0] = idArrayStart;
gSprites[spriteIds[i]].data[1] = 0;
}
}
}
static void SpriteCb_MoveSelector(struct Sprite *sprite)
static void SpriteCB_MoveSelector(struct Sprite *sprite)
{
if (sprite->animNum > 3 && sprite->animNum < 7)
{

View File

@ -397,7 +397,7 @@ void ReadImage(char *path, int tilesWidth, int bitDepth, int metatileWidth, int
free(buffer);
}
void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors)
void WriteImage(char *path, enum NumTilesMode numTilesMode, int numTiles, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors)
{
int tileSize = bitDepth * 8;
@ -424,7 +424,8 @@ void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int m
FATAL_ERROR("The specified number of tiles (%d) is greater than the maximum possible value (%d).\n", numTiles, maxNumTiles);
int bufferSize = numTiles * tileSize;
unsigned char *buffer = malloc(bufferSize);
int maxBufferSize = maxNumTiles * tileSize;
unsigned char *buffer = malloc(maxBufferSize);
if (buffer == NULL)
FATAL_ERROR("Failed to allocate memory for pixels.\n");
@ -433,17 +434,36 @@ void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int m
switch (bitDepth) {
case 1:
ConvertToTiles1Bpp(image->pixels, buffer, numTiles, metatilesWide, metatileWidth, metatileHeight, invertColors);
ConvertToTiles1Bpp(image->pixels, buffer, maxNumTiles, metatilesWide, metatileWidth, metatileHeight, invertColors);
break;
case 4:
ConvertToTiles4Bpp(image->pixels, buffer, numTiles, metatilesWide, metatileWidth, metatileHeight, invertColors);
ConvertToTiles4Bpp(image->pixels, buffer, maxNumTiles, metatilesWide, metatileWidth, metatileHeight, invertColors);
break;
case 8:
ConvertToTiles8Bpp(image->pixels, buffer, numTiles, metatilesWide, metatileWidth, metatileHeight, invertColors);
ConvertToTiles8Bpp(image->pixels, buffer, maxNumTiles, metatilesWide, metatileWidth, metatileHeight, invertColors);
break;
}
WriteWholeFile(path, buffer, bufferSize);
bool zeroPadded = true;
for (int i = bufferSize; i < maxBufferSize && zeroPadded; i++) {
if (buffer[i] != 0)
{
switch (numTilesMode)
{
case NUM_TILES_IGNORE:
break;
case NUM_TILES_WARN:
fprintf(stderr, "Ignoring -num_tiles %d because tile %d contains non-transparent pixels.\n", numTiles, 1 + i / tileSize);
zeroPadded = false;
break;
case NUM_TILES_ERROR:
FATAL_ERROR("Tile %d contains non-transparent pixels.\n", 1 + i / tileSize);
break;
}
}
}
WriteWholeFile(path, buffer, zeroPadded ? bufferSize : maxBufferSize);
free(buffer);
}

View File

@ -44,8 +44,14 @@ struct Image {
bool isAffine;
};
enum NumTilesMode {
NUM_TILES_IGNORE,
NUM_TILES_WARN,
NUM_TILES_ERROR,
};
void ReadImage(char *path, int tilesWidth, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors);
void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors);
void WriteImage(char *path, enum NumTilesMode numTilesMode, int numTiles, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors);
void FreeImage(struct Image *image);
void ReadGbaPalette(char *path, struct Palette *palette);
void WriteGbaPalette(char *path, struct Palette *palette);

View File

@ -77,7 +77,7 @@ void ConvertPngToGba(char *inputPath, char *outputPath, struct PngToGbaOptions *
ReadPng(inputPath, &image);
WriteImage(outputPath, options->numTiles, options->bitDepth, options->metatileWidth, options->metatileHeight, &image, !image.hasPalette);
WriteImage(outputPath, options->numTilesMode, options->numTiles, options->bitDepth, options->metatileWidth, options->metatileHeight, &image, !image.hasPalette);
FreeImage(&image);
}
@ -179,6 +179,7 @@ void HandlePngToGbaCommand(char *inputPath, char *outputPath, int argc, char **a
char *outputFileExtension = GetFileExtensionAfterDot(outputPath);
int bitDepth = outputFileExtension[0] - '0';
struct PngToGbaOptions options;
options.numTilesMode = NUM_TILES_IGNORE;
options.numTiles = 0;
options.bitDepth = bitDepth;
options.metatileWidth = 1;
@ -203,6 +204,12 @@ void HandlePngToGbaCommand(char *inputPath, char *outputPath, int argc, char **a
if (options.numTiles < 1)
FATAL_ERROR("Number of tiles must be positive.\n");
}
else if (strcmp(option, "-Wnum_tiles") == 0) {
options.numTilesMode = NUM_TILES_WARN;
}
else if (strcmp(option, "-Werror=num_tiles") == 0) {
options.numTilesMode = NUM_TILES_ERROR;
}
else if (strcmp(option, "-mwidth") == 0)
{
if (i + 1 >= argc)

View File

@ -4,6 +4,7 @@
#define OPTIONS_H
#include <stdbool.h>
#include "gfx.h"
struct GbaToPngOptions {
char *paletteFilePath;
@ -18,6 +19,7 @@ struct GbaToPngOptions {
struct PngToGbaOptions {
int numTiles;
enum NumTilesMode numTilesMode;
int bitDepth;
int metatileWidth;
int metatileHeight;