MCPcopy Create free account
hub / github.com/demoth/jake2 / HuntTarget

Method HuntTarget

game/src/main/java/jake2/game/GameAI.java:261–275  ·  view source on GitHub ↗

Decides running or standing according to flag AI_STAND_GROUND.

(SubgameEntity self, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

259 * Decides running or standing according to flag AI_STAND_GROUND.
260 */
261 static void HuntTarget(SubgameEntity self, GameExportsImpl gameExports) {
262 float[] vec = { 0, 0, 0 };
263
264 self.goalentity = self.enemy;
265 if ((self.monsterinfo.aiflags & GameDefines.AI_STAND_GROUND) != 0)
266 self.monsterinfo.stand.think(self, gameExports);
267 else
268 self.monsterinfo.run.think(self, gameExports);
269 Math3D.VectorSubtract(self.enemy.s.origin, self.s.origin, vec);
270 self.ideal_yaw = Math3D.vectoyaw(vec);
271
272 // wait a while before first attack
273 if (0 == (self.monsterinfo.aiflags & GameDefines.AI_STAND_GROUND))
274 GameUtil.AttackFinished(self, gameExports.level.time + 1);
275 }
276
277
278 public static EntThinkAdapter walkmonster_start_go = new EntThinkAdapter() {

Callers 2

ai_checkattackMethod · 0.95
FoundTargetMethod · 0.95

Calls 4

VectorSubtractMethod · 0.95
vectoyawMethod · 0.95
AttackFinishedMethod · 0.95
thinkMethod · 0.45

Tested by

no test coverage detected