move all_items_identified into cParty

This commit is contained in:
2025-01-08 08:41:12 -06:00
committed by Celtic Minstrel
parent 79bf21cb7d
commit 3ad8b87417
4 changed files with 12 additions and 11 deletions

View File

@@ -1006,7 +1006,7 @@ void handle_item_shop_action(short item_hit) {
target.ident = true;
shopper.combine_things();
if(overall_mode == MODE_ITEM_TARGET) {
if(all_items_identified()){
if(univ.party.all_items_identified()){
overall_mode = MODE_TOWN;
stat_screen_mode = MODE_INVEN;
ASB("Identify: All of your items are identified.");

View File

@@ -579,7 +579,7 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) {
break;
case eSpell::IDENTIFY:{
bool all_identified = all_items_identified();
bool all_identified = univ.party.all_items_identified();
// Cancel without spending points if there are no unidentified items
if(!(freebie || all_identified))
@@ -2629,12 +2629,3 @@ short party_size(bool only_living) {
return num_pcs;
}
bool all_items_identified() {
bool all_identified = true;
for(cPlayer& pc : univ.party)
for(cItem& item : pc.items)
if (item.variety != eItemType::NO_ITEM)
all_identified &= item.ident;
return all_identified;
}

View File

@@ -617,6 +617,15 @@ bool cParty::forced_give(cItem item,eItemAbil abil,short dat) {
return false;
}
bool cParty::all_items_identified() {
bool all_identified = true;
for(cPlayer& pc : *this)
for(cItem& item : pc.items)
if (item.variety != eItemType::NO_ITEM)
all_identified &= item.ident;
return all_identified;
}
bool cParty::has_abil(eItemAbil abil, short dat) const {
for(int i = 0; i < 6; i++)
if(adven[i]->main_status == eMainStatus::ALIVE)

View File

@@ -201,6 +201,7 @@ public:
bool give_item(cItem item,int flags);
bool forced_give(cItem item,eItemAbil abil,short dat = -1);
bool all_items_identified();
bool has_abil(eItemAbil abil, short dat = -1) const;
bool take_abil(eItemAbil abil, short dat = -1);
bool has_class(unsigned int item_class, bool require_charges = false);