michaliskambi

Untitled

May 31st, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.47 KB | None | 0 0
  1. { Assuming you have created TMyCreatureDescendant with MyCreatureDescendantResource, see http://castle-engine.sourceforge.net/tutorial_resources_extending.php for explanation }
  2.  
  3. function TMyCreatureDescendant.Enemy: T3DAlive;
  4. begin
  5.   Result := inherited;
  6.   { allies attack player enemies, or nothing }
  7.   if MyCreatureDescendantResource.Ally then
  8.   begin
  9.     if World.Player <> nil then
  10.       Result := World.Player.LastTarget else
  11.       Result := nil;
  12.   end;
  13. end;
Advertisement
Add Comment
Please, Sign In to add comment