Several minor fixes
- Bound-check occasional party statuses - Martyr's shield no longer ignored in attacks between monsters - Fix food/gold decreasing when a monster with a steal food/gold ability attacks a monster
This commit is contained in:
@@ -2195,6 +2195,7 @@ void do_rest(long length, int hp_restore, int mp_restore) {
|
||||
for(int j = 0; j < 24; j++) {
|
||||
cItem& item = univ.party[i].items[j];
|
||||
if(item.ability != eItemAbil::OCCASIONAL_STATUS) continue;
|
||||
if(item.abil_data[1] < 0 || item.abil_data[1] > 15) continue;
|
||||
if(item.magic_use_type < 2) continue;
|
||||
if(get_ran(1,0,5) != 3) continue;
|
||||
int how_much = item.abil_data[0];
|
||||
@@ -2316,6 +2317,7 @@ void increase_age() {
|
||||
for(int j = 0; j < 24; j++) {
|
||||
cItem& item = univ.party[i].items[j];
|
||||
if(item.ability != eItemAbil::OCCASIONAL_STATUS) continue;
|
||||
if(item.abil_data[1] < 0 || item.abil_data[1] > 15) continue;
|
||||
if(item.magic_use_type < 2) continue;
|
||||
if(get_ran(1,0,5) != 3) continue;
|
||||
int how_much = item.abil_data[0];
|
||||
|
@@ -2714,6 +2714,12 @@ void monster_attack_monster(short who_att,short attackee) {
|
||||
damaged_message(store_hp - target->health,
|
||||
attacker->a[i].type);
|
||||
|
||||
if(target->is_shielded()) {
|
||||
int how_much = target->get_shared_dmg(store_hp - target->get_health());
|
||||
add_string_to_buf(" Shares damage! ");
|
||||
damage_monst(who_att, 7, how_much, 0, eDamageType::MAGIC, 0);
|
||||
}
|
||||
|
||||
for(auto& abil : attacker->abil) {
|
||||
if(!abil.second.active) continue;
|
||||
if(getMonstAbilCategory(abil.first) != eMonstAbilCat::GENERAL)
|
||||
@@ -3068,9 +3074,11 @@ void monst_basic_abil(short m_num, std::pair<eMonstAbil,uAbility> abil, short ta
|
||||
damage_target(target, r1, eDamageType::UNBLOCKABLE);
|
||||
break;
|
||||
case eMonstAbil::STEAL_FOOD:
|
||||
if(target >= 100) break;
|
||||
univ.party.food = std::max(0, univ.party.food - get_ran(1,0,abil.second.gen.strength) - abil.second.gen.strength);
|
||||
break;
|
||||
case eMonstAbil::STEAL_GOLD:
|
||||
if(target >= 100) break;
|
||||
univ.party.gold = std::max(0, univ.party.gold - get_ran(1,0,abil.second.gen.strength) - abil.second.gen.strength);
|
||||
break;
|
||||
case eMonstAbil::FIELD:
|
||||
|
Reference in New Issue
Block a user