Sporkinator

Max Aggro

Jan 16th, 2012
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mx, mxid;
  2. mx = -1;
  3. with (enemy)
  4. {
  5.     if (aggro > mx)
  6.     {
  7.         if (collision_circle(x, y, 400, player, 0, 1))
  8.         {
  9.             if (collision_line(x, y, player.x, player.y, nopass, 0, 1))
  10.             {
  11.                 mx = aggro;
  12.                 mxid = id;
  13.             }
  14.         }
  15.     }
  16. }
  17. //Now mxid has the ID of the instance with the highest aggro
  18. //It has a line of sight and is within range.
  19.  
  20. //I'm not sure how it will tie into the below code yet
  21. if collision_circle(x, y, 400, player, 0, 1) and not collision_line(x, y, player.x, player.y, nopass, 0, 1)
  22. {
  23.  
  24.     mp_potential_step(player.x, player.y, 4, solid)
  25. }
  26. else mp_potential_step(random(x), random(y), 2, checkall);
Advertisement
Add Comment
Please, Sign In to add comment