MCPcopy Create free account
hub / github.com/bwapi/bwapi / WeaponCanHit

Function WeaponCanHit

bwapi/BWScriptEmulator/Military.cpp:23–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21};
22
23BWAPI::UnitFilter WeaponCanHit(WeaponType wpn)
24{
25 return [wpn](Unit u)->bool
26 {
27 UnitType ut = u->getType();
28 return !(( wpn.targetsOwn() && u->getPlayer() != Broodwar->self() ) ||
29 ( !wpn.targetsAir() && !u->isFlying() ) ||
30 ( !wpn.targetsGround() && u->isFlying() ) ||
31 ( wpn.targetsMechanical() && ut.isMechanical() ) ||
32 ( wpn.targetsOrganic() && ut.isOrganic() ) ||
33 ( wpn.targetsNonBuilding() && !ut.isBuilding() ) ||
34 ( wpn.targetsNonRobotic() && !ut.isRobotic() ) ||
35 ( wpn.targetsOrgOrMech() && (ut.isOrganic() || ut.isMechanical()) ));
36 };
37};
38
39auto LockdownReqs = [](Unit pTarg)->bool
40{

Callers 1

Military.cppFile · 0.85

Calls 15

targetsOwnMethod · 0.80
targetsAirMethod · 0.80
isFlyingMethod · 0.80
targetsGroundMethod · 0.80
targetsMechanicalMethod · 0.80
isMechanicalMethod · 0.80
targetsOrganicMethod · 0.80
isOrganicMethod · 0.80
targetsNonBuildingMethod · 0.80
isBuildingMethod · 0.80
targetsNonRoboticMethod · 0.80
isRoboticMethod · 0.80

Tested by

no test coverage detected