Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { Assuming you have created TMyCreatureDescendant with MyCreatureDescendantResource, see http://castle-engine.sourceforge.net/tutorial_resources_extending.php for explanation }
- function TMyCreatureDescendant.Enemy: T3DAlive;
- begin
- Result := inherited;
- { allies attack player enemies, or nothing }
- if MyCreatureDescendantResource.Ally then
- begin
- if World.Player <> nil then
- Result := World.Player.LastTarget else
- Result := nil;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment