Advertisement
Guest User

Untitled

a guest
May 30th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.78 KB | None | 0 0
  1. #TouhouDanmakufu[Player]
  2. #Menu[Kirisame Marisa]
  3. #Text[Ordinary Magician
  4. (Speed Type)
  5.  
  6. Speed: Fast
  7. Normal Shot: Illusion Laser
  8. Focus Shot: Magic Missile
  9. Spellcard: Love Sign "Master Spark"
  10. Seal Attack: Reduces Extra Danmaku. Lasts 8 Seconds]
  11. #ReplayName[Marisa]
  12. #Image[]
  13. #ScriptVersion[2]
  14.  
  15. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  16.  
  17. script_player_main
  18. {
  19.  
  20. //Variables
  21.  
  22. /*** *** *** General *** *** ***/
  23. let CSD = GetCurrentScriptDirectory;
  24. let ShotData = CSD ~ "MarisaShot.txt";
  25.  
  26. /*** *** *** Image Var *** *** ***/
  27. let ImgPlayer = CSD ~ "pl00.png";
  28. let ImgBullet = CSD ~ "MarisaShot.png";
  29. let imgba = CSD ~ "SealEffect.png";
  30. let ReimuX = [0,32,64,96,128,160,192,224,0,32,64,96,128,160,192,224,0,32,64,96,128,160,192,224];
  31. let ReimuY = [0,0,0,0,0,0,0,0,48,48,48,48,48,48,48,48,96,96,96,96,96,96,96,96];
  32. let ReimuPose = 0;
  33. let ReimuFrame = 0;
  34.  
  35. /*** *** *** Control Var *** *** ***/
  36.  
  37. let rcount = 0; //Rotation
  38. let count = -1;
  39. let fcount = -1; //Frame Counter
  40. let scount = 600; //Seal Counter
  41. let IsLaserExists = false;
  42.  
  43. /*** *** *** Common Data *** *** ***/
  44.  
  45. SetCommonData("SealCounter", GetCommonDataDefault("SealCounter", 0));
  46. SetCommonData("SealStatus", false);
  47.  
  48. /*** *** ** Functions *** *** ***/
  49.  
  50. function FindAngle(X1, Y1, X2, Y2) {return (atan2(Y2-Y1, X2-X1));}
  51.  
  52. task DrawOption (x, y)
  53. {
  54. SetRenderState(ADD);
  55. SetGraphicAngle(0, 0, rcount*-5);
  56. SetGraphicScale(1.5, 1.5);
  57. DrawGraphic(x, y);
  58.  
  59. SetRenderState(ALPHA);
  60. SetGraphicAngle(0, 0, rcount*5);
  61. SetGraphicScale(1, 1);
  62. DrawGraphic(x, y);
  63. }
  64.  
  65. /*** *** *** Main Shot *** *** ***/
  66.  
  67. task BlackOut(long){
  68. let id = Obj_Create(OBJ_EFFECT);
  69. let sca = 0;
  70. let alpha = 150;
  71. let rgb = [0,0,0];
  72. let die = 0;
  73.  
  74. ObjEffect_SetTexture(id,imgba);
  75. ObjEffect_SetRenderState(id,ALPHA);
  76. ObjEffect_SetPrimitiveType(id,PRIMITIVE_TRIANGLESTRIP);
  77. ObjEffect_SetLayer(id,0);
  78. ObjEffect_CreateVertex(id,4);
  79. ObjEffect_SetVertexXY(id,0,400/-2,400/-2);
  80. ObjEffect_SetVertexXY(id,1,400/-2,400/2);
  81. ObjEffect_SetVertexXY(id,2,400/2,400/-2);
  82. ObjEffect_SetVertexXY(id,3,400/2,400/2);
  83. ObjEffect_SetVertexUV(id,0,0,0);
  84. ObjEffect_SetVertexUV(id,1,0,400);
  85. ObjEffect_SetVertexUV(id,2,400,0);
  86. ObjEffect_SetVertexUV(id,3,400,400);
  87.  
  88. loop{
  89. die++;
  90. if(sca<3){sca+=0.05;}
  91. Obj_SetPosition(id,GetPlayerX,GetPlayerY);
  92. ObjEffect_SetScale(id,sca,sca);
  93. ObjEffect_SetVertexColor(id,0,alpha,rgb[0],rgb[1],rgb[2]);
  94. ObjEffect_SetVertexColor(id,1,alpha,rgb[0],rgb[1],rgb[2]);
  95. ObjEffect_SetVertexColor(id,2,alpha,rgb[0],rgb[1],rgb[2]);
  96. ObjEffect_SetVertexColor(id,3,alpha,rgb[0],rgb[1],rgb[2]);
  97.  
  98. if(die>long){
  99. if(alpha>0){alpha-=15;}
  100. if(alpha<=0){Obj_Delete(id);}
  101. }
  102.  
  103. yield;
  104. }
  105. }
  106.  
  107. ///////////////////////////////////////////////////////////////////////////////
  108.  
  109. @Initialize
  110. {
  111. LoadGraphic(ImgPlayer);
  112. LoadGraphic(ImgBullet);
  113. LoadGraphic(imgba);
  114. LoadPlayerShotData(ShotData);
  115.  
  116. SetSpeed(5,2.5);
  117. }
  118.  
  119. ///////////////////////////////////////////////////////////////////////////////
  120.  
  121. @MainLoop
  122. {
  123.  
  124. SetIntersectionCircle(GetPlayerX, GetPlayerY, 0);
  125.  
  126. /*** *** *** Fire Logic *** *** ***/
  127.  
  128. if(GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD && count == -1)
  129. {
  130. count = 0;
  131. }
  132.  
  133. if(GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD && fcount == -1)
  134. {
  135. fcount = 0;
  136. }
  137.  
  138. if(count >=0) {count++;}
  139. if(fcount >=0) {fcount++;}
  140.  
  141. //Main Shot
  142.  
  143. if(count == 5)
  144. {
  145. CreatePlayerShot01(GetPlayerX - 45, GetPlayerY + 5, 30, 260, 0.02, 100, 3);
  146. CreatePlayerShot01(GetPlayerX + 25, GetPlayerY + 30, 30, 270, 0.02, 100, 3);
  147. CreatePlayerShot01(GetPlayerX - 25, GetPlayerY + 30, 30, 270, 0.02, 100, 3);
  148. CreatePlayerShot01(GetPlayerX + 45, GetPlayerY + 5, 30, 280, 0.02, 100, 3);
  149.  
  150. count = -1;
  151. }
  152.  
  153.  
  154. if((GetKeyState(VK_SHOT) == KEY_FREE)){fcount = -1;}
  155. /*** *** *** Drawing Logic *** *** ***/
  156. if(GetKeyState(VK_LEFT) == KEY_HOLD || GetKeyState(VK_RIGHT) == KEY_HOLD)
  157. {ReimuFrame += 1;}
  158.  
  159. else
  160. {ReimuFrame += 1.75;}
  161.  
  162. rcount++;
  163.  
  164. /*** *** *** Seal Logic *** *** ***/
  165.  
  166. if(GetKeyState(VK_USER) == KEY_PUSH && GetPlayerBomb >= 2 && GetCommonData("SealStatus") == false)
  167. {
  168. AddBomb(-2);
  169. SetCommonData("SealStatus", true);
  170. DeleteEnemyShot(ALL);
  171. BlackOut(600);
  172. }
  173.  
  174. if(GetCommonData("SealStatus") == true)
  175. {
  176. scount--;
  177. }
  178.  
  179. if(scount == 0)
  180. {
  181. SetCommonData("SealStatus", false);
  182. scount = 600;
  183. }
  184.  
  185. yield;
  186. }
  187.  
  188. ///////////////////////////////////////////////////////////////////////////////
  189.  
  190. @DrawLoop
  191. {
  192.  
  193. /*** *** *** Reimu Graphics *** *** ***/
  194. SetTexture(ImgPlayer);
  195. SetRenderState(ALPHA);
  196. if(GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD){
  197. if(ReimuFrame>=4){ReimuPose++;ReimuFrame=0;}
  198. if(ReimuPose==24){
  199. ReimuPose=20;
  200. } else if(ReimuPose<16||ReimuPose>24){
  201. ReimuPose=16;
  202. }
  203. }else if(GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD){
  204. if(ReimuFrame>=4){ReimuPose++;ReimuFrame=0;}
  205. if(ReimuPose==16){
  206. ReimuPose=12;
  207. } else if(ReimuPose<8||ReimuPose>16){
  208. ReimuPose=8;
  209. }
  210.  
  211. }else{
  212. if(ReimuFrame>=8){ReimuPose++;ReimuFrame=0;}
  213. if(ReimuPose>=8){
  214. ReimuPose=0;
  215. }
  216. }
  217. if(ReimuPose>=32){ReimuPose=0};
  218. SetGraphicRect(ReimuX[ReimuPose],ReimuY[ReimuPose],ReimuX[ReimuPose]+32, ReimuY[ReimuPose]+48);
  219. SetGraphicAngle(0, 0, 0);
  220. DrawGraphic(GetPlayerX, GetPlayerY);
  221.  
  222. /*** *** *** Options *** *** ***/
  223.  
  224. SetTexture(ImgPlayer);
  225. SetGraphicRect(86, 148, 102, 164);
  226.  
  227. DrawOption (GetPlayerX + 25, GetPlayerY + 30);
  228. DrawOption (GetPlayerX + 45, GetPlayerY + 5);
  229. DrawOption (GetPlayerX - 25, GetPlayerY + 30);
  230. DrawOption (GetPlayerX - 45, GetPlayerY + 5);
  231.  
  232. }
  233.  
  234. ///////////////////////////////////////////////////////////////////////////////
  235.  
  236. @SpellCard
  237. {
  238. UseSpellCard("FantasySeal", 0);
  239. }
  240.  
  241. ///////////////////////////////////////////////////////////////////////////////
  242.  
  243. @Missed
  244. {
  245.  
  246. }
  247.  
  248. ///////////////////////////////////////////////////////////////////////////////
  249.  
  250. @Finalize
  251. {
  252.  
  253. }
  254.  
  255. }
  256.  
  257.  
  258. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  259. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  260. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  261.  
  262. #PlayerShotData
  263. ShotImage = ".\pl00.png"
  264.  
  265. ShotData
  266. {
  267. //Main Shot
  268. id = 1
  269. rect = (68,148,82,180)
  270. render = ADD
  271. alpha = 255
  272. }
  273.  
  274. ShotData
  275. {
  276. //Magic Missile
  277. id = 2
  278. rect = (88,148,104,180)
  279. render = ADD
  280. alpha = 255
  281. }
  282.  
  283. ShotData
  284. {
  285. //Laser
  286. id = 3
  287. rect = (256, 0, 270, 316)
  288. render = ADD
  289. alpha = 200
  290. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement