print caster's name, not active PC name

This commit is contained in:
2025-03-17 17:50:16 -05:00
parent 76040c5f6b
commit ab513e6113
4 changed files with 7 additions and 6 deletions

View File

@@ -1243,7 +1243,7 @@ void do_combat_cast(location target) {
if(stat_window == univ.cur_pc)
put_item_screen(stat_window);
do_mindduel(univ.cur_pc,cur_monst);
} else add_pc_needs_to_buf("a smoky crystal");
} else add_caster_needs_to_buf("a smoky crystal");
}
store_sound = 24;
break;

View File

@@ -748,7 +748,7 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) {
{
cInvenSlot item = univ.party[pc_num].has_abil(eItemAbil::SAPPHIRE);
if(!item && !freebie)
add_pc_needs_to_buf("a sapphire");
add_caster_needs_to_buf("a sapphire");
else if(univ.town->defy_scrying || univ.town->defy_mapping)
add_string_to_buf(" The spell fails.");
else {
@@ -1131,7 +1131,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) {
if(cInvenSlot item = univ.party[pc_num].has_abil(eItemAbil::RESURRECTION_BALM)) {
univ.party[pc_num].take_item(item.slot);
} else {
add_pc_needs_to_buf("resurrection balm");
add_caster_needs_to_buf("resurrection balm");
break;
}
}

View File

@@ -1064,12 +1064,13 @@ void add_string_to_buf(std::string str, unsigned short indent) {
}
void add_pc_needs_to_buf(std::string needs_what, unsigned short pre_indent, unsigned short indent) {
void add_caster_needs_to_buf(std::string needs_what, unsigned short pre_indent, unsigned short indent) {
std::ostringstream sout;
for(int i = 0; i < pre_indent; ++i){
sout << ' ';
}
sout << univ.party[univ.cur_pc].name << " needs " << needs_what << ".";
extern short pc_casting;
sout << univ.party[pc_casting].name << " needs " << needs_what << ".";
add_string_to_buf(sout.str(), indent);
}

View File

@@ -31,7 +31,7 @@ void print_nums(short a,short b,short c);
short print_terrain(location space);
void add_string_to_buf(std::string str, unsigned short indent); // Set second parameter to nonzero to auto-split the line if it's too long
void add_string_to_buf(std::string str);
void add_pc_needs_to_buf(std::string needs_what, unsigned short pre_indent = 2, unsigned short indent = 4);
void add_caster_needs_to_buf(std::string needs_what, unsigned short pre_indent = 2, unsigned short indent = 4);
void init_buf();
void print_buf () ;
void restart_printing();