Fixed incorrect calculation of mana percentage (#6)

* Fixed incorrect calculation of mana percentage

* Check for some monsters that need to be skipped

* Fixed incorrect values when not a pointer function

Co-authored-by: Héctor Giménez <hector.fwbz@gmail.com>

---------

Co-authored-by: Héctor Giménez <hector.fwbz@gmail.com>
This commit is contained in:
Jai
2023-12-02 15:20:20 +08:00
committed by GitHub
parent 8ae0eb55c2
commit c32e8d6ae1
2 changed files with 41 additions and 22 deletions

View File

@@ -50,7 +50,7 @@ func (m Monsters) FindOne(id npc.ID, t MonsterType) (Monster, bool) {
func (m Monsters) Enemies(filters ...MonsterFilter) []Monster {
monsters := make([]Monster, 0)
for _, mo := range m {
if !mo.IsMerc() && mo.Name != npc.BaalTaunt && mo.Name != npc.Act5Combatant && mo.Name != npc.Act5Combatant2 && !mo.IsGoodNPC() && mo.Stats[stat.Life] > 0 {
if !mo.IsMerc() && mo.Name != npc.BaalTaunt && mo.Name != npc.Act5Combatant && mo.Name != npc.Act5Combatant2 && !mo.IsSkip() && !mo.IsGoodNPC() && mo.Stats[stat.Life] > 0 {
monsters = append(monsters, mo)
}
}
@@ -153,3 +153,13 @@ func (m Monster) IsMonsterRaiser() bool {
return false
}
// Monster can`t be targeted normally
func (m Monster) IsSkip() bool {
switch m.Name {
case npc.WaterWatcherLimb, npc.WaterWatcherHead:
return true
}
return false
}