GetAvaliableTargets¶
This method updates avaliabletargets
and refreshes the enemy positions when applicable
private void GetAvaliableTargets(bool onlyground, bool onlyfront, int attackid, bool excludeunderground)
Parameters¶
onlyground
: Only include enemy party members with a position ofGround
(orUnderground
if excludeunderground is false)onlyfront
: Only the first eligible enemy party member will be includedattackid
: The skill id or a negative number denoting a player party member's basic attack (-1 isBee
's, -2 isBeetle
's and -3 isMoth
's)excludeunderground
: Excludes all enemies with a position ofUnderground
whenonlyground
is true. There is an overload without this parameter that sends false
Procedure¶
There is a simpler case that is checked first.
If currentaction is SkillList
and the AttackArea of the skill from skilldata is AllParty
or SingleAlly
, availabletargets
is set to playerdata
which ends the method.
Otherwise:
- RefreshEnemyPos is called which checks all enemy party members whose
hp
is above 0, whose cantfall is false and whose position isGround
orFlying
. If the enemy battleentity.height
is above battleentity.minheight
+ 0.5, the position is set toFlying
,Ground
otherwise - Each enemy party members is checked if it should be included in
avaliabletargets
. In order for the enemy to be included, all of the following must be true (on top of this, if onlyfront is true, only the first one found is included and the rest skipped):- Its position isn't
OutOfReach
- UndergroundCheck returns true for the attackid and the enemy position which only happens if the
position
isn'tUnderground
or the attackid is among the following: -3 (Moth
's basic attack), 21 (FrigidCoffin
), 6 (BeetleDig
), 27 (IceDrill
), 18 (HurricaneBeemerang
) - The parameters clauses are fufillfed which is checked using the following rules in order:
- Its position isn't
avaliabletargets
is initialised to all the enemy party members included earlier