De-Hardcode give strings
This commit is contained in:
parent
55d47af239
commit
266d7d3308
|
@ -5,8 +5,10 @@ $input_rom_file = "bin/m12fresh.gba"
|
||||||
$output_rom_file = "bin/m12.gba"
|
$output_rom_file = "bin/m12.gba"
|
||||||
$eb_rom_file = "bin/eb.smc"
|
$eb_rom_file = "bin/eb.smc"
|
||||||
$working_dir = "working"
|
$working_dir = "working"
|
||||||
|
$give_dir = "working/m12-give-strings"
|
||||||
$src_dir = "src"
|
$src_dir = "src"
|
||||||
$data_dir = "src/data"
|
$data_dir = "src/data"
|
||||||
|
$give_new_dir = "src/m12-give-strings"
|
||||||
$cast_roll_file = "working/cast_roll.json"
|
$cast_roll_file = "working/cast_roll.json"
|
||||||
$compiled_asm_file = "src/m2-compiled.asm"
|
$compiled_asm_file = "src/m2-compiled.asm"
|
||||||
$includes_asm_file = "m12-includes.asm" # implicitly rooted in working_dir
|
$includes_asm_file = "m12-includes.asm" # implicitly rooted in working_dir
|
||||||
|
@ -356,6 +358,9 @@ Copy-Item -Path $input_rom_file -Destination $output_rom_file
|
||||||
& dotnet $scripttool_cmd $scripttool_args
|
& dotnet $scripttool_cmd $scripttool_args
|
||||||
if ($LASTEXITCODE -ne 0) { exit -1 }
|
if ($LASTEXITCODE -ne 0) { exit -1 }
|
||||||
|
|
||||||
|
"Copying give strings to src folder..."
|
||||||
|
Copy-Item -Path $give_dir -Destination $give_new_dir -Recurse
|
||||||
|
|
||||||
"Pre-rendering cast roll..."
|
"Pre-rendering cast roll..."
|
||||||
& dotnet $rendercastroll_cmd $rendercastroll_args
|
& dotnet $rendercastroll_cmd $rendercastroll_args
|
||||||
if ($LASTEXITCODE -ne 0) { exit -1 }
|
if ($LASTEXITCODE -ne 0) { exit -1 }
|
||||||
|
@ -445,4 +450,6 @@ $rom_bytes = [IO.File]::ReadAllBytes($output_rom_file)
|
||||||
|
|
||||||
"Finished compiling $output_rom_file in $($timer.Elapsed.TotalSeconds.ToString("F3")) s"
|
"Finished compiling $output_rom_file in $($timer.Elapsed.TotalSeconds.ToString("F3")) s"
|
||||||
|
|
||||||
|
Remove-Item -Path $give_new_dir -Recurse
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
542
src/c/goods.c
542
src/c/goods.c
|
@ -561,7 +561,7 @@ void shop_print_items(WINDOW *window, unsigned char *items, int y_offset, int it
|
||||||
//It's based on the party's status, whether the target's inventory is full or not and whether the source is the target
|
//It's based on the party's status, whether the target's inventory is full or not and whether the source is the target
|
||||||
void give_print(byte item, byte target, byte source, WINDOW *window, byte *str)
|
void give_print(byte item, byte target, byte source, WINDOW *window, byte *str)
|
||||||
{
|
{
|
||||||
bool notFullInventory = false;
|
bool fullInventory = true;
|
||||||
int index;
|
int index;
|
||||||
struct PC *user_data = (&m2_ness_data[source]);
|
struct PC *user_data = (&m2_ness_data[source]);
|
||||||
struct PC *target_data = (&m2_ness_data[target]);
|
struct PC *target_data = (&m2_ness_data[target]);
|
||||||
|
@ -571,507 +571,121 @@ void give_print(byte item, byte target, byte source, WINDOW *window, byte *str)
|
||||||
for(index = 0; index < 0xE; index++)
|
for(index = 0; index < 0xE; index++)
|
||||||
if(target_data->goods[index] == 0)
|
if(target_data->goods[index] == 0)
|
||||||
{
|
{
|
||||||
notFullInventory = true;
|
fullInventory = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if((user_data->ailment == UNCONSCIOUS) ||(user_data->ailment == DIAMONDIZED))
|
if((user_data->ailment == UNCONSCIOUS) ||(user_data->ailment == DIAMONDIZED))
|
||||||
incapable_user = true;
|
incapable_user = true;
|
||||||
if((target_data->ailment == UNCONSCIOUS) ||(target_data->ailment == DIAMONDIZED))
|
if((target_data->ailment == UNCONSCIOUS) ||(target_data->ailment == DIAMONDIZED))
|
||||||
incapable_target = true;
|
incapable_target = true;
|
||||||
index = 0;
|
|
||||||
if(source == target)
|
if(source == target)
|
||||||
{
|
{
|
||||||
if(incapable_user)
|
if(incapable_user)
|
||||||
setupSelf_Dead(str, &index, source, item);
|
readStringGive(str, give_strings_table[SELF_DEAD], source, target, item);
|
||||||
else
|
else
|
||||||
setupSelf_Alive(str, &index, source, item);
|
readStringGive(str, give_strings_table[SELF], source, target, item);
|
||||||
}
|
}
|
||||||
else if(!notFullInventory)
|
else if(fullInventory)
|
||||||
{
|
{
|
||||||
if(!incapable_target && !incapable_user)
|
if(!incapable_target && !incapable_user)
|
||||||
setupFull_Both_Alive(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[ALIVE_BOTH_FULL], source, target, item);
|
||||||
else if(incapable_target && incapable_user)
|
else if(incapable_target && incapable_user)
|
||||||
setupFull_Both_Dead(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[DEAD_FULL], source, target, item);
|
||||||
else if(incapable_target && !incapable_user)
|
else if(incapable_target && !incapable_user)
|
||||||
setupFull_Target_Dead(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[TARGET_DEAD_FULL], source, target, item);
|
||||||
else
|
else
|
||||||
setupFull_User_Dead(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[GIVER_DEAD_FULL], source, target, item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!incapable_target && !incapable_user)
|
if(!incapable_target && !incapable_user)
|
||||||
setup_Both_Alive(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[ALIVE_BOTH], source, target, item);
|
||||||
else if(incapable_target && !incapable_user)
|
else if(incapable_target && !incapable_user)
|
||||||
setup_Target_Dead(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[TARGET_DEAD], source, target, item);
|
||||||
else if(!incapable_target && incapable_user)
|
else if(!incapable_target && incapable_user)
|
||||||
setup_User_Dead(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[GIVER_DEAD], source, target, item);
|
||||||
else
|
else
|
||||||
setup_Both_Dead(str, &index, source, target, item);
|
readStringGive(str, give_strings_table[DEAD], source, target, item);
|
||||||
}
|
}
|
||||||
str[index++] = 0x1D;
|
|
||||||
str[index++] = 0xFF; //END
|
|
||||||
str[index++] = 0;
|
|
||||||
str[index++] = 0xFF; //END
|
|
||||||
|
|
||||||
window->text_start = str;
|
window->text_start = str;
|
||||||
window->text_start2 = str;
|
window->text_start2 = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupSelf_Alive(byte *String, int *index, byte user, byte item)
|
void readStringGive(byte *outputString, byte *baseString, byte source, byte target, byte item)
|
||||||
{
|
{
|
||||||
char rearranged[] = " rearranged ";
|
while(*baseString != END)
|
||||||
char own[] = " own";
|
|
||||||
char items[] = " items and the ";
|
|
||||||
char moved[] = " moved.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(rearranged) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(rearranged[i]);
|
|
||||||
|
|
||||||
getPossessive(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(own) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(own[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(items) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(items[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii(' '); //Format
|
|
||||||
String[(*index)++] = encode_ascii(' ');
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(moved) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(moved[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupSelf_Dead(byte *String, int *index, byte user, byte item)
|
|
||||||
{
|
|
||||||
struct PC *tmp; //Get alive character
|
|
||||||
byte alive = 0;
|
|
||||||
while((alive == user))
|
|
||||||
alive++;
|
|
||||||
for(int i = alive; i < 4; i++)
|
|
||||||
{
|
{
|
||||||
tmp = &(m2_ness_data[i]);
|
outputString = readCharacterGive(outputString, *baseString, source, target, item);
|
||||||
if((tmp->ailment != UNCONSCIOUS) && (tmp->ailment != DIAMONDIZED))
|
baseString++;
|
||||||
{
|
|
||||||
alive = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
char rearranged[] = " rearranged";
|
|
||||||
char items[] = "'s items and the";
|
|
||||||
char moved[] = " moved.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(alive, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(rearranged) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(rearranged[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii(' ');
|
|
||||||
String[(*index)++] = encode_ascii(' '); //Format
|
|
||||||
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(items) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(items[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii(' ');
|
|
||||||
String[(*index)++] = encode_ascii(' '); //Format
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(moved) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(moved[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupFull_Both_Alive(byte *String, int *index, byte user, byte target, byte item)
|
|
||||||
{
|
|
||||||
char tried[] = " tried to give";
|
|
||||||
char the[] = " the ";
|
|
||||||
char to[] = " to ";
|
|
||||||
char but[] = "but ";
|
|
||||||
char was[] = " was already";
|
|
||||||
char carrying[] = " carrying too much stuff.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(tried) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(tried[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(the) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(the[i]);
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(to) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(to[i]);
|
|
||||||
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii(',');
|
|
||||||
|
|
||||||
String[(*index)++] = 0x2;
|
|
||||||
String[(*index)++] = 0xFF; //prompt + newline
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(but) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(but[i]);
|
|
||||||
|
|
||||||
getPronoun(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(was) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(was[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(carrying) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(carrying[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupFull_Target_Dead(byte *String, int *index, byte user, byte target, byte item)
|
|
||||||
{
|
|
||||||
char tried[] = " tried to add";
|
|
||||||
char the[] = " the ";
|
|
||||||
char to[] = " to ";
|
|
||||||
char s_stuff[]= "'s stuff,";
|
|
||||||
char but[] = "but there was no room for it.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(tried) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(tried[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(the) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(the[i]);
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(to) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(to[i]);
|
|
||||||
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(s_stuff) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(s_stuff[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 0x2;
|
|
||||||
String[(*index)++] = 0xFF; //prompt + newline
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(but) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(but[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupFull_User_Dead(byte *String, int *index, byte user, byte target, byte item)
|
|
||||||
{
|
|
||||||
char tried[] = " tried to take";
|
|
||||||
char the[] = " the ";
|
|
||||||
char from[] = " from ";
|
|
||||||
char s_stuff[]= "'s stuff,";
|
|
||||||
char but[] = "but ";
|
|
||||||
char was[] = " was already";
|
|
||||||
char carrying[] = " carrying too much stuff.";
|
|
||||||
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(tried) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(tried[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(the) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(the[i]);
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(from) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(from[i]);
|
|
||||||
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(s_stuff) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(s_stuff[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 0x2;
|
|
||||||
String[(*index)++] = 0xFF; //prompt + newline
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(but) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(but[i]);
|
|
||||||
|
|
||||||
getPronoun(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(was) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(was[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(carrying) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(carrying[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupFull_Both_Dead(byte *String, int *index, byte user, byte target, byte item)
|
|
||||||
{
|
|
||||||
struct PC *tmp; //Get alive character
|
|
||||||
byte alive = 0;
|
|
||||||
while((alive == user) || (alive == target))
|
|
||||||
alive++;
|
|
||||||
for(int i = alive; i < 4; i++)
|
|
||||||
{
|
|
||||||
tmp = &(m2_ness_data[i]);
|
|
||||||
if((tmp->ailment != UNCONSCIOUS) && (tmp->ailment != DIAMONDIZED))
|
|
||||||
{
|
|
||||||
alive = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char tried[] = " tried to add";
|
outputString[0] = 0x1D;
|
||||||
char s_[] = "'s ";
|
outputString[1] = 0xFF; //END
|
||||||
char to[] = " to ";
|
outputString[2] = 0;
|
||||||
char s_stuff[]= "'s stuff,";
|
outputString[3] = 0xFF; //END
|
||||||
char but[] = "but there was no room for it.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(alive, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(tried) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(tried[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii(' ');
|
|
||||||
String[(*index)++] = encode_ascii(' '); //Format
|
|
||||||
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(s_) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(s_[i]);
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(to) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(to[i]);
|
|
||||||
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(s_stuff) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(s_stuff[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 0x2;
|
|
||||||
String[(*index)++] = 0xFF; //prompt + newline
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(but) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(but[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_Both_Alive(byte *String, int *index, byte user, byte target, byte item)
|
byte *readCharacterGive(byte *outputString, byte chr, byte source, byte target, byte item)
|
||||||
{
|
{
|
||||||
char gave[] = " gave";
|
int index = 0; //Index used by multi-characters entries
|
||||||
char the[] = " the ";
|
struct PC *tmp; //Struct to get alive character
|
||||||
char to[] = " to ";
|
byte alive;
|
||||||
|
byte *item_str; //Item string
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
switch(chr)
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(gave) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(gave[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(the) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(the[i]);
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(to) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(to[i]);
|
|
||||||
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii('.');
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup_Target_Dead(byte *String, int *index, byte user, byte target, byte item)
|
|
||||||
{
|
|
||||||
char added[] = " added";
|
|
||||||
char the[] = " the ";
|
|
||||||
char to[] = " to ";
|
|
||||||
char s_stuff[] = "'s stuff.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(added) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(added[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(the) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(the[i]);
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(to) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(to[i]);
|
|
||||||
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(s_stuff) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(s_stuff[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup_User_Dead(byte *String, int *index, byte user, byte target, byte item)
|
|
||||||
{
|
|
||||||
char took[] = " took";
|
|
||||||
char the[] = " the ";
|
|
||||||
char from[] = " from ";
|
|
||||||
char s_stuff[] = "'s stuff.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(took) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(took[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(the) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(the[i]);
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(from) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(from[i]);
|
|
||||||
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(s_stuff) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(s_stuff[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup_Both_Dead(byte *String, int *index, byte user, byte target, byte item)
|
|
||||||
{
|
|
||||||
struct PC *tmp; //Get alive character
|
|
||||||
byte alive = 0;
|
|
||||||
while((alive == user) || (alive == target))
|
|
||||||
alive++;
|
|
||||||
for(int i = alive; i < 4; i++)
|
|
||||||
{
|
{
|
||||||
tmp = &(m2_ness_data[i]);
|
case PROMPT:
|
||||||
if((tmp->ailment != UNCONSCIOUS) && (tmp->ailment != DIAMONDIZED))
|
outputString[0] = 2;
|
||||||
{
|
outputString[1] = 0xFF;
|
||||||
alive = i;
|
index = 2;
|
||||||
break;
|
break;
|
||||||
}
|
case NEWLINE:
|
||||||
|
outputString[0] = 1;
|
||||||
|
outputString[1] = 0xFF;
|
||||||
|
index = 2;
|
||||||
|
break;
|
||||||
|
case TARGET:
|
||||||
|
getCharName(target, outputString, &index);
|
||||||
|
break;
|
||||||
|
case SOURCE:
|
||||||
|
getCharName(source, outputString, &index);
|
||||||
|
break;
|
||||||
|
case ALIVE:
|
||||||
|
alive = 0;
|
||||||
|
while((alive == source))
|
||||||
|
alive++;
|
||||||
|
for(int i = alive; i < 4; i++)
|
||||||
|
{
|
||||||
|
tmp = &(m2_ness_data[i]);
|
||||||
|
if((tmp->ailment != UNCONSCIOUS) && (tmp->ailment != DIAMONDIZED))
|
||||||
|
{
|
||||||
|
alive = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getCharName(alive, outputString, &index);
|
||||||
|
break;
|
||||||
|
case TARGET_POSS:
|
||||||
|
getPossessive(target, outputString, &index);
|
||||||
|
break;
|
||||||
|
case SOURCE_POSS:
|
||||||
|
getPossessive(source, outputString, &index);
|
||||||
|
break;
|
||||||
|
case TARGET_PRON:
|
||||||
|
getPronoun(target, outputString, &index);
|
||||||
|
break;
|
||||||
|
case SOURCE_PRON:
|
||||||
|
getPronoun(source, outputString, &index);
|
||||||
|
break;
|
||||||
|
case ITEM:
|
||||||
|
item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
||||||
|
copy_name(outputString, item_str, &index, 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
outputString[0] = chr + CHAR_OFFSET;
|
||||||
|
index = 1;
|
||||||
}
|
}
|
||||||
|
return outputString + index;
|
||||||
char added[] = " added ";
|
|
||||||
char _s[] = "'s";
|
|
||||||
char to[] = " to";
|
|
||||||
char s_stuff[] = "'s stuff.";
|
|
||||||
|
|
||||||
String[(*index)++] = 0x70; //Initial bullet
|
|
||||||
getCharName(alive, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(added) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(added[i]);
|
|
||||||
|
|
||||||
getCharName(user, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(_s) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(_s[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii(' '); //Format
|
|
||||||
String[(*index)++] = encode_ascii(' ');
|
|
||||||
|
|
||||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
|
||||||
copy_name(String, item_str, index, 0);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(to) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(to[i]);
|
|
||||||
|
|
||||||
String[(*index)++] = 1;
|
|
||||||
String[(*index)++] = 0xFF; //newline
|
|
||||||
|
|
||||||
String[(*index)++] = encode_ascii(' '); //Format
|
|
||||||
String[(*index)++] = encode_ascii(' ');
|
|
||||||
|
|
||||||
getCharName(target, String, index);
|
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(s_stuff) - 1); i++)
|
|
||||||
String[(*index)++] = encode_ascii(s_stuff[i]);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,29 @@
|
||||||
#include "pc.h"
|
#include "pc.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
|
||||||
|
#define SELF 0
|
||||||
|
#define SELF_DEAD 1
|
||||||
|
#define ALIVE_BOTH 2
|
||||||
|
#define GIVER_DEAD 3
|
||||||
|
#define TARGET_DEAD 4
|
||||||
|
#define DEAD 5
|
||||||
|
#define ALIVE_BOTH_FULL 6
|
||||||
|
#define GIVER_DEAD_FULL 7
|
||||||
|
#define TARGET_DEAD_FULL 8
|
||||||
|
#define DEAD_FULL 9
|
||||||
|
|
||||||
|
#define END 0xFF
|
||||||
|
#define PROMPT 0xFE
|
||||||
|
#define NEWLINE 0xFD
|
||||||
|
#define TARGET 0xFC
|
||||||
|
#define SOURCE 0xFB
|
||||||
|
#define ALIVE 0xFA
|
||||||
|
#define TARGET_POSS 0xF9
|
||||||
|
#define SOURCE_POSS 0xF8
|
||||||
|
#define TARGET_PRON 0xF7
|
||||||
|
#define SOURCE_PRON 0xF6
|
||||||
|
#define ITEM 0xF5
|
||||||
|
|
||||||
typedef enum DIRECTION_MOVED
|
typedef enum DIRECTION_MOVED
|
||||||
{
|
{
|
||||||
DIRECTION_NONE,
|
DIRECTION_NONE,
|
||||||
|
@ -16,17 +39,10 @@ int goods_outer_process(WINDOW* window, int y_offset, bool give);
|
||||||
int goods_inner_process(WINDOW *window, unsigned short *items);
|
int goods_inner_process(WINDOW *window, unsigned short *items);
|
||||||
void goods_print_items(WINDOW *window, unsigned short *items, int y_offset);
|
void goods_print_items(WINDOW *window, unsigned short *items, int y_offset);
|
||||||
void shop_print_items(WINDOW *window, unsigned char *items, int y_offset, int itemsnum);
|
void shop_print_items(WINDOW *window, unsigned char *items, int y_offset, int itemsnum);
|
||||||
void setupSelf_Alive(byte *String, int *index, byte user, byte item);
|
|
||||||
void setupSelf_Dead(byte *String, int *index, byte user, byte item);
|
|
||||||
void setupFull_Both_Alive(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void setupFull_Target_Dead(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void setupFull_User_Dead(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void setupFull_Both_Dead(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void setup_Both_Alive(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void setup_Target_Dead(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void setup_User_Dead(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void setup_Both_Dead(byte *String, int *index, byte user, byte target, byte item);
|
|
||||||
void give_print(byte item, byte target, byte source, WINDOW *window, byte *str);
|
void give_print(byte item, byte target, byte source, WINDOW *window, byte *str);
|
||||||
|
void readStringGive(byte *outputString, byte *baseString, byte source, byte target, byte item);
|
||||||
|
byte *readCharacterGive(byte *outputString, byte chr, byte source, byte target, byte item);
|
||||||
|
|
||||||
|
|
||||||
extern void m2_soundeffect(int index);
|
extern void m2_soundeffect(int index);
|
||||||
extern int m2_div(int dividend, int divisor);
|
extern int m2_div(int dividend, int divisor);
|
||||||
|
@ -36,6 +52,7 @@ extern void m2_clearwindowtiles(WINDOW* window);
|
||||||
extern int bin_to_bcd(int value, int* digit_count);
|
extern int bin_to_bcd(int value, int* digit_count);
|
||||||
|
|
||||||
extern int m2_items;
|
extern int m2_items;
|
||||||
|
extern byte* give_strings_table[];
|
||||||
extern PC m2_ness_data[];
|
extern PC m2_ness_data[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1932,6 +1932,50 @@ flyover_tea:
|
||||||
flyover_coffee:
|
flyover_coffee:
|
||||||
.include "data/flyover-coffee.asm"
|
.include "data/flyover-coffee.asm"
|
||||||
|
|
||||||
|
give_self:
|
||||||
|
.include "m12-give-strings/m12-give-self-alive.asm"
|
||||||
|
|
||||||
|
give_self_dead:
|
||||||
|
.include "m12-give-strings/m12-give-self-dead.asm"
|
||||||
|
|
||||||
|
give_alive:
|
||||||
|
.include "m12-give-strings/m12-give-both-alive.asm"
|
||||||
|
|
||||||
|
give_giver_dead:
|
||||||
|
.include "m12-give-strings/m12-give-giver-dead.asm"
|
||||||
|
|
||||||
|
give_target_dead:
|
||||||
|
.include "m12-give-strings/m12-give-target-dead.asm"
|
||||||
|
|
||||||
|
give_dead:
|
||||||
|
.include "m12-give-strings/m12-give-both-dead.asm"
|
||||||
|
|
||||||
|
give_alive_full:
|
||||||
|
.include "m12-give-strings/m12-give-both-alive-full.asm"
|
||||||
|
|
||||||
|
give_giver_dead_full:
|
||||||
|
.include "m12-give-strings/m12-give-giver-dead-full.asm"
|
||||||
|
|
||||||
|
give_target_dead_full:
|
||||||
|
.include "m12-give-strings/m12-give-target-dead-full.asm"
|
||||||
|
|
||||||
|
give_dead_full:
|
||||||
|
.include "m12-give-strings/m12-give-both-dead-full.asm"
|
||||||
|
|
||||||
|
.align 4
|
||||||
|
give_strings_table:
|
||||||
|
dw give_self
|
||||||
|
dw give_self_dead
|
||||||
|
dw give_alive
|
||||||
|
dw give_giver_dead
|
||||||
|
dw give_target_dead
|
||||||
|
dw give_dead
|
||||||
|
dw give_alive_full
|
||||||
|
dw give_giver_dead_full
|
||||||
|
dw give_target_dead_full
|
||||||
|
dw give_dead_full
|
||||||
|
|
||||||
|
.align 4
|
||||||
m2InsaneCultist:
|
m2InsaneCultist:
|
||||||
.incbin "data/m2-insane-cultist.bin"
|
.incbin "data/m2-insane-cultist.bin"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\csender tried to give\n the \citem\n to \creceiver,\prompt@but \creceiverpronoun was already\n carrying too much stuff."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\csender gave\n the \citem\n to \creceiver."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\calive tried to add\n \csender's \citem\n to \creceiver's stuff,\prompt@but there was no room for it."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\calive added \csender's\n \citem to\n \creceiver's stuff."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\creceiver tried to take\n the \citem\n from \csender's stuff,\prompt@but \creceiverpronoun was already\n carrying too much stuff."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\creceiver took\n the \citem\n from \csender's stuff."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\csender rearrenged \csenderpossessive own\n items and the\n \citem moved."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\calive rearrenged\n \creceiver's items and the\n \citem moved."
|
|
@ -0,0 +1,120 @@
|
||||||
|
00=\x00
|
||||||
|
01=\x01
|
||||||
|
17=\x17
|
||||||
|
1C=\x1C
|
||||||
|
26=\x26
|
||||||
|
30=\x30
|
||||||
|
3E=\x3E
|
||||||
|
44=\x44
|
||||||
|
4A=\x4A
|
||||||
|
4C=\x4C
|
||||||
|
56=\x56
|
||||||
|
|
||||||
|
00=
|
||||||
|
01=!
|
||||||
|
02="
|
||||||
|
03=#
|
||||||
|
04=$
|
||||||
|
05=%
|
||||||
|
06=&
|
||||||
|
07='
|
||||||
|
08=(
|
||||||
|
09=)
|
||||||
|
0A=*
|
||||||
|
0B=+
|
||||||
|
0C=,
|
||||||
|
0D=-
|
||||||
|
0E=.
|
||||||
|
0F=/
|
||||||
|
10=0
|
||||||
|
11=1
|
||||||
|
12=2
|
||||||
|
13=3
|
||||||
|
14=4
|
||||||
|
15=5
|
||||||
|
16=6
|
||||||
|
17=7
|
||||||
|
18=8
|
||||||
|
19=9
|
||||||
|
1A=:
|
||||||
|
1B=;
|
||||||
|
1C=<
|
||||||
|
1D==
|
||||||
|
1E=>
|
||||||
|
1F=?
|
||||||
|
20=@
|
||||||
|
21=A
|
||||||
|
22=B
|
||||||
|
23=C
|
||||||
|
24=D
|
||||||
|
25=E
|
||||||
|
26=F
|
||||||
|
27=G
|
||||||
|
28=H
|
||||||
|
29=I
|
||||||
|
2A=J
|
||||||
|
2B=K
|
||||||
|
2C=L
|
||||||
|
2D=M
|
||||||
|
2E=N
|
||||||
|
2F=O
|
||||||
|
30=P
|
||||||
|
31=Q
|
||||||
|
32=R
|
||||||
|
33=S
|
||||||
|
34=T
|
||||||
|
35=U
|
||||||
|
36=V
|
||||||
|
37=W
|
||||||
|
38=X
|
||||||
|
39=Y
|
||||||
|
3A=Z
|
||||||
|
3B=[8B]
|
||||||
|
3C=[8C]
|
||||||
|
3D=[8D]
|
||||||
|
3E=[8E]
|
||||||
|
3F=[8F]
|
||||||
|
40=`
|
||||||
|
41=a
|
||||||
|
42=b
|
||||||
|
43=c
|
||||||
|
44=d
|
||||||
|
45=e
|
||||||
|
46=f
|
||||||
|
47=g
|
||||||
|
48=h
|
||||||
|
49=i
|
||||||
|
4A=j
|
||||||
|
4B=k
|
||||||
|
4C=l
|
||||||
|
4D=m
|
||||||
|
4E=n
|
||||||
|
4F=o
|
||||||
|
50=p
|
||||||
|
51=q
|
||||||
|
52=r
|
||||||
|
53=s
|
||||||
|
54=t
|
||||||
|
55=u
|
||||||
|
56=v
|
||||||
|
57=w
|
||||||
|
58=x
|
||||||
|
59=y
|
||||||
|
5A=z
|
||||||
|
5B={
|
||||||
|
5C=|
|
||||||
|
5D=}
|
||||||
|
5E=~
|
||||||
|
5F=[AF]
|
||||||
|
|
||||||
|
F5=\citem
|
||||||
|
F6=\csenderpronoun
|
||||||
|
F7=\creceiverpronoun
|
||||||
|
F8=\csenderpossessive
|
||||||
|
F9=\creceiverpossessive
|
||||||
|
FA=\calive
|
||||||
|
FB=\csender
|
||||||
|
FC=\creceiver
|
||||||
|
FD=\n
|
||||||
|
FE=\prompt
|
||||||
|
/FF
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\csender tried to add\n the \citem\n to \creceiver's stuff,\prompt@but there was no room for it."
|
|
@ -0,0 +1,3 @@
|
||||||
|
.loadtable "m12-give-strings/m12-give-table.tbl"
|
||||||
|
|
||||||
|
.str "@\csender added\n the \citem\n to \creceiver's stuff."
|
Loading…
Reference in New Issue