Initial stage of major refactor - putting all PC/monster-affecting functions inside the respective classes

This commit is contained in:
2015-01-24 20:02:20 -05:00
parent 44a235673f
commit 144945587b
29 changed files with 1110 additions and 879 deletions

View File

@@ -753,15 +753,6 @@ void place_glands(location where,mon_num_t m_type) {
}
}
short party_total_level() {
short i,j = 0;
for(i = 0; i < 6; i++)
if(univ.party[i].main_status == eMainStatus::ALIVE)
j += univ.party[i].level;
return j;
}
void reset_item_max() {
while(univ.town.items.back().variety == eItemType::NO_ITEM)
univ.town.items.pop_back();
@@ -820,9 +811,9 @@ void place_treasure(location where,short level,short loot,short mode) {
amt = get_ran(2,1,7) + 1;
else amt = loot * (get_ran(1,0,10 + (loot * 6) + (level * 2)) + 5);
if(party_total_level() <= 12)
if(univ.party.get_level() <= 12)
amt += 1;
if((party_total_level() <= 60) && (amt > 2))
if(univ.party.get_level() <= 60 && amt > 2)
amt += 2;
if(amt > 3) {
@@ -830,7 +821,7 @@ void place_treasure(location where,short level,short loot,short mode) {
new_item.item_level = amt;
r1 = get_ran(1,1,9);
if(((loot > 1) && (r1 < 7)) || ((loot == 1) && (r1 < 5)) || (mode == 1)
|| ((r1 < 6) && (party_total_level() < 30)) || (loot > 2) )
|| ((r1 < 6) && (univ.party.get_level() < 30)) || (loot > 2) )
place_item(new_item,where,false);
}
for(j = 0; j < 5; j++) {