Merge branch 'master' into heal_location
This commit is contained in:
65
src/bard_music.c
Normal file
65
src/bard_music.c
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
// Includes
|
||||
#include "global.h"
|
||||
#include "bard_music.h"
|
||||
#include "easy_chat.h"
|
||||
|
||||
#include "data/bard_music/bard_sounds.h"
|
||||
#include "data/bard_music/word_pitch.h"
|
||||
#include "data/bard_music/default_sound.h"
|
||||
#include "data/bard_music/length_table.h"
|
||||
|
||||
s16 CalcWordPitch(int arg0, int songPos)
|
||||
{
|
||||
return gBardSoundPitchTables[arg0][songPos];
|
||||
}
|
||||
|
||||
const struct BardSound *GetWordSounds(u16 word)
|
||||
{
|
||||
u32 category;
|
||||
u32 subword;
|
||||
const struct BardSound (*ptr)[6];
|
||||
|
||||
if (ECWord_CheckIfOutsideOfValidRange(word))
|
||||
{
|
||||
return gBardSound_InvalidWord;
|
||||
}
|
||||
category = word >> 9;
|
||||
subword = word & 0x1ff;
|
||||
switch (category)
|
||||
{
|
||||
case EC_GROUP_POKEMON:
|
||||
case EC_GROUP_POKEMON_2:
|
||||
ptr = gBardSounds_Pokemon;
|
||||
break;
|
||||
case EC_GROUP_MOVE_1:
|
||||
case EC_GROUP_MOVE_2:
|
||||
ptr = gBardSounds_Moves;
|
||||
break;
|
||||
default:
|
||||
ptr = gBardSoundsTable[category];
|
||||
break;
|
||||
}
|
||||
ptr += subword;
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
void GetWordPhonemes(struct BardSong *song, u16 word)
|
||||
{
|
||||
int i;
|
||||
const struct BardSound *sound;
|
||||
|
||||
song->length = 0;
|
||||
for (i = 0; i < 6; i ++)
|
||||
{
|
||||
sound = &song->sound[i];
|
||||
if (sound->var00 != 0xFF)
|
||||
{
|
||||
song->phonemes[i].length = sound->var01 + gBardSoundLengthTable[sound->var00];
|
||||
song->phonemes[i].pitch = CalcWordPitch(word + 30, i);
|
||||
song->length += song->phonemes[i].length;
|
||||
}
|
||||
}
|
||||
song->currPhoneme = 0;
|
||||
song->voiceInflection = 0;
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "field_effect_helpers.h"
|
||||
#include "field_camera.h"
|
||||
#include "trainer_see.h"
|
||||
#include "decoration.h"
|
||||
#include "field_map_obj.h"
|
||||
|
||||
#define NUM_FIELD_MAP_OBJECT_TEMPLATES 0x51
|
||||
@@ -1755,18 +1756,18 @@ void sub_808F254(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 action)
|
||||
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat)
|
||||
{
|
||||
u8 mapObjectId;
|
||||
|
||||
if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId))
|
||||
{
|
||||
switch (action)
|
||||
switch (decorCat)
|
||||
{
|
||||
case 6:
|
||||
case DECORCAT_DOLL:
|
||||
sub_808F228(&gMapObjects[mapObjectId], gUnknown_082766A2);
|
||||
break;
|
||||
case 7:
|
||||
case DECORCAT_CUSHION:
|
||||
sub_808F228(&gMapObjects[mapObjectId], gUnknown_082766A6);
|
||||
break;
|
||||
}
|
||||
|
||||
2272
src/secret_base.c
Normal file
2272
src/secret_base.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user