Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. ffc script Eye_Sentry{
  2. void run(int item_id, int perm, bool left){
  3. bool triggered = false;
  4. float angle;
  5. int sfxTimer;
  6. if(Screen->D[perm]==1)
  7. triggered= true;
  8. while(!Link->Item[item_id])
  9. Waitframe();
  10. Screen->D[perm]=1;
  11. this->Data++;
  12. while(!triggered){
  13. if(left){
  14. //angle between object and player
  15. angle = Angle(this->X+24, this->Y+8,Link->X+8,Link->Y);
  16. //Because arc is weird.
  17. angle *=-1;
  18. Screen->Arc(3, this->X+8, this->Y+8, 256, angle+10,angle-10, 1, 1, 0, 0, 0, true, true, OP_TRANS);
  19. }
  20. else{
  21. angle = Angle(this->X+8, this->Y+8,Link->X+8,Link->Y);
  22. angle *=-1;
  23. Screen->Arc(3, this->X+8, this->Y+8, 256, angle+10,angle-10, 1, 1, 0, 0, 0, true, true, OP_TRANS);
  24. }
  25. //Create sound every sixty seconds.
  26. if ( sfxTimer == 0 ) Game->PlaySound(SFX_X_RAY);
  27. sfxTimer = (sfxTimer+1)% 60;
  28. Waitframe();
  29. }
  30. this->Data=GH_INVISIBLE_COMBO;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement