Skip to content

Commit

Permalink
Merge branch 'porymap-6' into generate-map-constants
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards authored Dec 10, 2024
2 parents 0ee9b3c + 382ee9e commit dbff8c4
Show file tree
Hide file tree
Showing 17 changed files with 316 additions and 476 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ include audio_rules.mk
# NOTE: Tools must have been built prior (FIXME)
# so you can't really call this rule directly
generated: $(AUTO_GEN_TARGETS)
@: # Silence the "Nothing to be done for `generated'" message, which some people were confusing for an error.


%.s: ;
%.png: ;
Expand Down Expand Up @@ -378,6 +380,7 @@ libagbsyscall:
@$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN)

# Elf from object files
LDFLAGS = -Map ../../$(MAP)
$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ <objs> <libs> | cat"
Expand Down
30 changes: 26 additions & 4 deletions data/battle_ai_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,8 @@ AI_CV_Disable2:
AI_CV_Disable_End:
end

@ BUG: The original script would score up Counter when the target's types were not physical
@ This is incorrect since Counter only deals double the damage received if hit by a physical attack
AI_CV_Counter:
if_status AI_TARGET, STATUS1_SLEEP, AI_CV_Counter_ScoreDown1
if_status2 AI_TARGET, STATUS2_INFATUATION, AI_CV_Counter_ScoreDown1
Expand All @@ -1625,7 +1627,7 @@ AI_CV_Counter2:
if_random_less_than 100, AI_CV_Counter3
score -1
AI_CV_Counter3:
if_has_move AI_USER, MOVE_MIRROR_COAT, AI_CV_Counter7
if_has_move AI_USER, MOVE_MIRROR_COAT, AI_CV_Counter8
get_last_used_bank_move AI_TARGET
get_move_power_from_result
if_equal 0, AI_CV_Counter5
Expand All @@ -1645,15 +1647,24 @@ AI_CV_Counter5:
if_random_less_than 100, AI_CV_Counter6
score +1
AI_CV_Counter6:
#ifdef BUGFIX
get_target_type1
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter7
get_target_type2
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter7
goto AI_CV_Counter_End
#else
get_target_type1
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter_End
get_target_type2
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter_End
if_random_less_than 50, AI_CV_Counter_End
#endif
AI_CV_Counter7:
if_random_less_than 100, AI_CV_Counter8
score +4
if_random_less_than 50, AI_CV_Counter_End
AI_CV_Counter8:
if_random_less_than 100, AI_CV_Counter9
score +4
AI_CV_Counter9:
end

AI_CV_Counter_ScoreDown1:
Expand Down Expand Up @@ -2100,6 +2111,8 @@ AI_CV_PsychUp_ScoreDown2:
AI_CV_PsychUp_End:
end

@ BUG: The original script would score up Mirror Coat when the target's types were not special
@ This is incorrect since Mirror Coat only deals double the damage received if hit by a special attack
AI_CV_MirrorCoat:
if_status AI_TARGET, STATUS1_SLEEP, AI_CV_MirrorCoat_ScoreDown1
if_status2 AI_TARGET, STATUS2_INFATUATION, AI_CV_MirrorCoat_ScoreDown1
Expand Down Expand Up @@ -2132,10 +2145,19 @@ AI_CV_MirrorCoat5:
if_random_less_than 100, AI_CV_MirrorCoat6
score +1
AI_CV_MirrorCoat6:
#ifdef BUGFIX
get_target_type1
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat7
get_target_type2
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat7
goto AI_CV_MirrorCoat_End
#else
get_target_type1
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat_End
get_target_type2
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat_End
#endif
AI_CV_MirrorCoat7:
if_random_less_than 50, AI_CV_MirrorCoat_End
AI_CV_MirrorCoat_ScoreUp4:
if_random_less_than 100, AI_CV_MirrorCoat_ScoreUp4_End
Expand Down
Binary file modified graphics/title_screen/emerald_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion graphics_file_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ POKEDEXGFXDIR := graphics/pokedex
STARTERGFXDIR := graphics/starter_choose
NAMINGGFXDIR := graphics/naming_screen
SPINDAGFXDIR := graphics/pokemon/spinda/spots
TITLESCREENGFXDIR := graphics/title_screen

types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark
contest_types := cool beauty cute smart tough
Expand Down Expand Up @@ -298,9 +299,13 @@ $(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female.png


### Miscellaneous ###
graphics/title_screen/pokemon_logo.gbapal: %.gbapal: %.pal

$(TITLESCREENGFXDIR)/pokemon_logo.gbapal: %.gbapal: %.pal
$(GFX) $< $@ -num_colors 224

$(TITLESCREENGFXDIR)/emerald_version.8bpp: %.8bpp: %.png
$(GFX) $< $@ -mwidth 8 -mheight 4

graphics/pokemon_jump/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 63 -Wnum_tiles

Expand Down
6 changes: 4 additions & 2 deletions include/bard_music.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef GUARD_BARD_MUSIC_H
#define GUARD_BARD_MUSIC_H

#define BARD_SOUND_MAX_LENGTH 6

struct BardSound
{
/*0x00*/ u8 songLengthId;
Expand All @@ -26,8 +28,8 @@ struct BardSong
/*0x06*/ u16 volume;
/*0x08*/ s16 pitch;
/*0x0A*/ s16 voiceInflection;
/*0x0C*/ u16 lyrics[6];
/*0x18*/ struct BardPhoneme phonemes[6];
/*0x0C*/ u16 lyrics[BARD_SOUND_MAX_LENGTH];
/*0x18*/ struct BardPhoneme phonemes[BARD_SOUND_MAX_LENGTH];
/*0x30*/ const struct BardSound *sound;
};

Expand Down
1 change: 1 addition & 0 deletions include/constants/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Will be moved to build/ eventually
map_groups.h
layouts.h
region_map_sections.h
map_event_ids.h
227 changes: 0 additions & 227 deletions include/constants/region_map_sections.h

This file was deleted.

4 changes: 4 additions & 0 deletions json_data_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ $(DATA_SRC_SUBDIR)/region_map/region_map_entries.h: $(DATA_SRC_SUBDIR)/region_ma
$(JSONPROC) $^ $@

$(C_BUILDDIR)/region_map.o: c_dep += $(DATA_SRC_SUBDIR)/region_map/region_map_entries.h

AUTO_GEN_TARGETS += include/constants/region_map_sections.h
include/constants/region_map_sections.h: $(DATA_SRC_SUBDIR)/region_map/region_map_sections.json $(DATA_SRC_SUBDIR)/region_map/region_map_sections.constants.json.txt
$(JSONPROC) $^ $@
2 changes: 1 addition & 1 deletion src/bard_music.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void GetWordPhonemes(struct BardSong *song, u16 word)
const struct BardSound *sound;

song->length = 0;
for (i = 0; i < 6; i ++)
for (i = 0; i < BARD_SOUND_MAX_LENGTH; i ++)
{
sound = &song->sound[i];
if (sound->songLengthId != 0xFF)
Expand Down
Loading

0 comments on commit dbff8c4

Please sign in to comment.