Name | Type | is_array | initial_value |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//**************Matching Utils *************************
//* *
//* v.1.0 *
//* *
//* by Saia_Djinn *
//* *
//* *
//* Contains the most usual FilterFunctions *
//* *
//* Credits: maskedpoptart for IsUnitDead() *
//****************************************************
// USAGE
// An Example shows best how to use this:
// function Match takes nothing returns boolean
// return IsUnitAlly( GetFilterUnit() , GetOwningPlayer(Temp)) and GroupUnitMatch()
// endfunction
// This would send a true for all allied units not being immune or a structure in the Filter
//Only thing you should most times call before this in a Match function is:
// IsUnitAlly() or IsUnitEnemy() or nothing if you want friendly fire
//for sure you can also call other function before this just simplifies some
// Contains some functions to simplify Catching units in a Filter and to don't have to type it everytime again
// Credits should be given
library MatchingUtils
function IsUnitDead takes unit u returns boolean // by maskedpoptart
return IsUnitType(u, UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0
endfunction
function GroupTypeUnitMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeUnitImmuneMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitDead(GetFilterUnit()) ) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)
endfunction
function GroupTypeUnitAllMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeHeroMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeHeroImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeHeroAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeStructureMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeStructureImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit() , UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeStructureAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_STRUCTURE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeMovableMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeMovableImmuneMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitDead(GetFilterUnit()) ) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)
endfunction
function GroupTypeMovableAllMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeFlyingMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_FLYING) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeFlyingImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_FLYING) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeFlyingAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_FLYING) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeGroundMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_GROUND) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeGroundImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_GROUND) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeGroundAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_GROUND) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeMechanicalMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_MECHANICAL) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeMechanicalImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_MECHANICAL) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeMechanicalAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_MECHANICAL) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeAncientMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_ANCIENT) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeAncientImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_ANCIENT) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeAncientAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_ANCIENT) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeUndeadMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_UNDEAD) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeUndeadImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_UNDEAD) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeUndeadAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_UNDEAD) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeTaurenMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_TAUREN) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeTaurenImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_TAUREN) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeTaurenAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_TAUREN) and IsUnitDead(GetFilterUnit()) == false
endfunction
endlibrary