Advertisement
Guest User

Untitled

a guest
May 30th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. ffc script sentry{
  2. void run(){
  3.  
  4. this->X = Link->X;
  5. this->Y = Link->Y;
  6. this->Data = sentile;
  7. this->CSet = sencset;
  8. Game->PlaySound(sensound);
  9.  
  10. while(!Link->PressB){
  11.  
  12. //Set the direction of the sentry
  13. if(Link->Dir == DIR_UP) this->Data = sentile;
  14. else if(Link->Dir == DIR_DOWN) this->Data = sentile+1;
  15. else if(Link->Dir == DIR_LEFT) this->Data = sentile+2;
  16. else if(Link->Dir == DIR_RIGHT)this->Data = sentile+3;
  17.  
  18. //If the player hits 'A', fire magic!
  19. if(Link->PressA == true && Link->MP>= senmag){
  20. //Create the magic weapon and fire it
  21. lweapon magic = Screen->CreateLWeapon(13);
  22. magic->X = this->X;
  23. magic->Y = this->Y;
  24. magic->UseSprite(senweapon);
  25. magic->Tile += Link->Dir;
  26. magic->Damage = sendam;
  27. magic->Step = senspd;
  28. magic->Dir = Link->Dir;
  29. Game->PlaySound(magsound);
  30. Link->MP -= senmag;
  31. }
  32. Waitframe();
  33. }
  34.  
  35. //Set up the explosion
  36. lweapon explode = Screen->CreateLWeapon(6);
  37. explode->X = this->X;
  38. explode->Y = this->Y + 2;
  39. explode->UseSprite(senbweapon);
  40. explode->Damage = sendam;
  41. this->X = -16;
  42. this->Y = -16;
  43.  
  44. while(explode->isValid()) Waitframe();
  45.  
  46. this->Data = 0;
  47. Quit();
  48. }
  49. }
  50.  
  51. item script sentryitem{
  52. void run(int NAME, int scriptNum, int magic){
  53. if(CountFFCsRunning(scriptNum) == 0 && Link->MP >= magic){
  54. RunFFCScript(scriptNum,NULL);
  55. Link->MP -= magic;
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement