HERO_PM.SRC 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. ************************************************************************
  2. * *
  3. * 044 [ART OF FIGHT] *
  4. * HERO PWORK PROGRAM *
  5. * by S.OKADA from 92/02/07 Fri 13:46 *
  6. * *
  7. ************************************************************************
  8. XDEF PM_HERO,PM_HERO_HEAD,PM_HERO_ATTACK,PM_HERO_AREA
  9. XDEF PM_HERO_BODY,PM_HERO_SHADOW,PM_HERO_WEAK
  10. XDEF PM_STAR,PM_SP2,PM_SP3
  11. XDEF DEAD_NEXT
  12. XDEF PWORK_HIT
  13. XDEF TAMA_SET,MEGANE
  14. XDEF KAGE_CHG,BLOD_SET,GETA_MAKE,PM_GETA,PM_DESI
  15. XDEF STAR_MAKE
  16. XDEF SPIRIT_RANK
  17. XREF ?A5
  18. ;by HERO
  19. XREF Z_MINIMUM
  20. ;by GAME_SUB
  21. XREF FREE_OBJ_WORK,FREE_HERO_PWORK,SET_HIT_AREA,SET_HIT_AREA_HERO
  22. ;by ACT_SUB
  23. XREF REDUCTION_MOVE
  24. ;by SOUND
  25. XREF SET_SOUND
  26. ;by ACTION
  27. XREF NEXT_ACTION,SORT_SET,ACTION_SET
  28. ;by SUB
  29. XREF PWORK_SET
  30. SECT HERO,,C
  31. INCLUDE MACRO.INC
  32. INCLUDE NEO_GEO.INC
  33. INCLUDE LABEL.INC
  34. INCLUDE ACT_No.INC
  35. INCLUDE HFLAG.INC
  36. INCLUDE SMACRO.INC
  37. INCLUDE SCODE.INC
  38. PWORK_HIT:
  39. MOVE.B WORK_N0(A6),(A5)
  40. MOVE.W (A5),D0
  41. LEA.L 0(A5,D0.W),A4
  42. MOVEP.W WORK_N0(A4),D0
  43. CLR.B D0
  44. LEA.L 0(A5,D0.W),A3
  45. TST.B HIT_FLAG(A3)
  46. BPL.S PWORK_HIT_3
  47. BSET.B #0,WEAK_HIT(A6)
  48. PWORK_HIT_3:
  49. BSR DAMAGE_SET weak point
  50. MOVEP.W WORK_N2(A4),D0
  51. CLR.B D0
  52. LEA.L 0(A5,D0.W),A3
  53. BSR DAMAGE_SET body1
  54. MOVEP.W WORK_N3(A4),D0
  55. CLR.B D0
  56. LEA.L 0(A5,D0.W),A3
  57. BSR DAMAGE_SET body2
  58. MOVEP.W WORK_N1(A4),D0
  59. CLR.B D0
  60. LEA.L 0(A5,D0.W),A3
  61. TST.B HIT_FLAG(A3)
  62. BPL.S PWORK_HIT_1
  63. TST.B HIT_FLAG(A4)
  64. BMI.S PWORK_HIT_1
  65. CMP.W #2,ACT_No(A3)
  66. BCC.S PWORK_HIT_1
  67. ADDQ.W #1,ACT_No(A3)
  68. PWORK_HIT_1:
  69. BSR DAMAGE_SET head
  70. LEA.L (A4),A3
  71. BSR DAMAGE_SET p_main gard
  72. BTST.B #BHF_DAMAGE,FLAG(A6)
  73. BNE DAMAGE_SET_SUB
  74. RTS
  75. DAMAGE_SET:
  76. BCLR.B #0,HIT_FLAG(A3)
  77. BTST.B #0,HIT_OFF(A6)
  78. BNE.S DAMAGE_SET_1
  79. BSET.B #0,HIT_FLAG(A3)
  80. DAMAGE_SET_1:
  81. TST.B HIT_FLAG(A3)
  82. BPL DAMAGE_SET_6
  83. OR.B #HF_DAMAGE,FLAG(A6)
  84. MOVEP.W HIT_PLAYER(A3),D4
  85. CLR.B D4
  86. MOVE.W D4,DEF_HIT_PLAYER(A6)
  87. MOVE.B LEVEL(A5,D4.W),DAMAGE_LEVEL(A6)
  88. MOVE.B HIT_TYPE_No(A5,D4.W),D0
  89. OR.B HIT_TYPE_No(A3),D0
  90. MOVE.B D0,DEF_HIT_TYPE_No(A6)
  91. RTS
  92. DAMAGE_SET_SUB:
  93. MOVE.W DEF_HIT_PLAYER(A6),D4
  94. BSR ATTACK_PARM_SET
  95. MOVEP.W WORK_N0(A4),D0
  96. CLR.B D0
  97. MOVE.B WORK_N1(A5,D0.W),(A5)
  98. MOVE.W (A5),D0
  99. LEA.L 0(A5,D0.W),A0
  100. MOVE.W HIT_LEFT(A0),D0
  101. CMP.W HIT_LEFT(A5,D4.W),D0
  102. BGE.S DAMAGE_SET_2
  103. MOVE.W HIT_LEFT(A5,D4.W),D0
  104. DAMAGE_SET_2:
  105. MOVE.W HIT_RIGHT(A0),D1
  106. CMP.W HIT_RIGHT(A5,D4.W),D1
  107. BLE.S DAMAGE_SET_3
  108. MOVE.W HIT_RIGHT(A5,D4.W),D1
  109. DAMAGE_SET_3:
  110. ADD.W D0,D1
  111. ASR.W #1,D1
  112. MOVE.W D1,TARGET_X(A6)
  113. MOVE.W HIT_LOWER(A0),D0
  114. CMP.W HIT_LOWER(A5,D4.W),D0
  115. BGE.S DAMAGE_SET_4
  116. MOVE.W HIT_LOWER(A5,D4.W),D0
  117. DAMAGE_SET_4:
  118. MOVE.W HIT_UPPER(A0),D1
  119. CMP.W HIT_UPPER(A5,D4.W),D1
  120. BLE.S DAMAGE_SET_5
  121. MOVE.W HIT_UPPER(A5,D4.W),D1
  122. DAMAGE_SET_5:
  123. ADD.W D0,D1
  124. ASR.W #1,D1
  125. MOVE.W D1,TARGET_Y(A6)
  126. CLR.B HIT_FLAG(A4)
  127. MOVEP.W WORK_N0(A4),D0
  128. CLR.B D0
  129. CLR.B HIT_FLAG(A5,D0.W)
  130. MOVEP.W WORK_N1(A4),D0
  131. CLR.B D0
  132. CLR.B HIT_FLAG(A5,D0.W)
  133. MOVEP.W WORK_N2(A4),D0
  134. CLR.B D0
  135. CLR.B HIT_FLAG(A5,D0.W)
  136. MOVEP.W WORK_N3(A4),D0
  137. CLR.B D0
  138. CLR.B HIT_FLAG(A5,D0.W)
  139. DAMAGE_SET_6:
  140. RTS
  141. ATTACK_PARM_SET:
  142. TST.B DEF_HIT_TYPE_No(A6)
  143. BMI APS_TAMA
  144. MOVE.L ANOTHER_PLAYER(A6),A0
  145. MOVE.B GARD_LEVEL(A0),DEF_GARD_LEVEL(A6)
  146. MOVE.B HIT_STOP(A0),DEF_HIT_STOP(A6)
  147. MOVE.B HIT_LR(A0),DEF_HIT_LR(A6)
  148. MOVE.B DAMAGE_ACT_TYPE(A0),DEF_DAMAGE_ACT_TYPE(A6)
  149. MOVE.L HIT_SCORE(A0),DEF_HIT_SCORE(A6)
  150. RTS
  151. APS_TAMA:
  152. MOVE.B 79H(A5,D4.W),DEF_GARD_LEVEL(A6)
  153. MOVE.B 7BH(A5,D4.W),DEF_HIT_STOP(A6)
  154. MOVE.B 7CH(A5,D4.W),DEF_HIT_LR(A6)
  155. MOVE.B 7DH(A5,D4.W),DEF_DAMAGE_ACT_TYPE(A6)
  156. MOVE.L LIFE(A5,D4.W),DEF_HIT_SCORE(A6)
  157. RTS
  158. STAR_MAKE:
  159. MOVE.L #P_STAR*10000H,D2
  160. MOVE.W #C_HITG,D2
  161. MOVEQ.L #0FH,D1
  162. AND.B DEF_HIT_TYPE_No(A6),D1
  163. CMP.B #3,D1 gard ?
  164. BEQ.S STAR_MAKE_1
  165. MOVE.W #C_HITS,D2
  166. CMP.B #16,D0
  167. BCS.S STAR_MAKE_1
  168. MOVE.W #C_HITL,D2
  169. STAR_MAKE_1:
  170. JSR.S FREE_OBJ_WORK
  171. BEQ STAR_MAKE_9
  172. MOVE.B WORK_No(A0),HIT_WORK_No(A6)
  173. MOVE.W TARGET_X(A6),D3
  174. MOVE.W Y_POSITION(A6),D4
  175. MOVE.B #0B8H,D5
  176. JSR.S PWORK_SET
  177. MOVE.W TARGET_Y(A6),Z_POSITION(A0)
  178. STAR_MAKE_9:
  179. RTS
  180. PM_HERO:
  181. MOVE.B MASTER_No(A6),(A5)
  182. MOVE.W (A5),D0
  183. LEA.L -LOG(A5,D0.W),A3
  184. BTST.B #BHF_NON_ACT,FLAG(A3)
  185. BNE PM_HERO_1
  186. TST.B MASTER_REQUEST(A6)
  187. BEQ.S PM_HERO_1
  188. BMI.S PM_HERO_101
  189. JSR ALL_HIT_CLEAR(PC)
  190. PM_HERO_101:
  191. CLR.B MASTER_REQUEST(A6)
  192. MOVE.W HERO_ACT_No(A3),D0
  193. JSR.S ACTION_SET
  194. PM_HERO_1:
  195. MOVE.L X_POSITION(A6),D0
  196. ADD.L VX(A6),D0
  197. MOVE.L D0,X_POSITION(A6)
  198. MOVE.L D0,X_POSITION(A3)
  199. MOVE.L Y_POSITION(A6),D0
  200. ADD.L VY(A6),D0
  201. MOVE.L D0,Y_POSITION(A6)
  202. MOVE.L D0,Y_POSITION(A3)
  203. MOVE.L Z_POSITION(A6),D0
  204. ADD.L VZ(A6),D0
  205. MOVE.L D0,Z_POSITION(A6)
  206. MOVE.L D0,Z_POSITION(A3)
  207. JSR.S REDUCTION_MOVE
  208. BCLR.B #BHF_NON_ACT,FLAG(A3)
  209. BNE.S PM_HERO_2
  210. JSR.S NEXT_ACTION
  211. TST.W ACT_No(A6)
  212. BPL.S PM_HERO_2
  213. TST.B ACT_FLAG(A6)
  214. BPL.S PM_HERO_2
  215. MOVE.L ADRS1(A6),A0
  216. MOVE.W (A0)+,ACT_No(A6)
  217. MOVE.L A0,ADRS1(A6)
  218. BCLR.B #7,ACT_FLAG(A6)
  219. MOVE.B #-1,ACT_COUNT(A6)
  220. MOVE.W ACT_No(A6),ADC_ACT_No(A3)
  221. MOVE.B ACT_COUNT(A6),ADC_ACT_COUNT(A3)
  222. PM_HERO_2:
  223. MOVEQ.L #00000111B,D0
  224. AND.B ACT_FLAG(A6),D0
  225. ADD.B D0,D0
  226. SUB.B PLAYER_No+1+PLAYER_OFFSET(A3),D0
  227. ADD.B #91H,D0
  228. MOVE.B D0,PRIORITY(A6)
  229. JSR.S SET_HIT_AREA_HERO
  230. PM_HERO_21:
  231. MOVE.W X_POSITION(A6),D0
  232. MOVE.W D0,D1
  233. SUB.W BACK2+Wx(A5),D0
  234. BLT.S PM_HERO_3
  235. SUB.W BACK2+WxRIGHT(A5),D1
  236. BGT.S PM_HERO_3
  237. BCLR.B #ACTAT_CUT,ACT_ATTR(A6)
  238. JSR.S SORT_SET
  239. RTS
  240. PM_HERO_3:
  241. BSET.B #ACTAT_CUT,ACT_ATTR(A6)
  242. JSR SORT_SET
  243. RTS
  244. DEAD_NEXT:
  245. MOVEP.W MASTER_No(A6),D0
  246. CLR.B D0
  247. TST.W HERO_LIFE-LOG(A5,D0.W)
  248. BEQ.S DEAD_NEXT_1
  249. MOVE.W (A0),ACT_No(A6)
  250. MOVE.B #-1,ACT_COUNT(A6)
  251. DEAD_NEXT_1:
  252. ADDQ.W #2,A0
  253. RTS
  254. ALL_HIT_CLEAR:
  255. CLR.L HIT_OFS_X(A6)
  256. MOVEP.W WORK_N0(A6),D0
  257. CLR.B D0
  258. CLR.L HIT_OFS_X(A5,D0.W)
  259. CLR.W ACT_No(A5,D0.W)
  260. MOVE.B WORK_N0(A5,D0.W),(A5)
  261. MOVE.W (A5),D0
  262. CLR.L HIT_OFS_X(A5,D0.W)
  263. CLR.L VX(A5,D0.W)
  264. CLR.L VY(A5,D0.W)
  265. MOVEP.W WORK_N1(A6),D0
  266. CLR.B D0
  267. CLR.L HIT_OFS_X(A5,D0.W)
  268. MOVEP.W WORK_N2(A6),D0
  269. CLR.B D0
  270. CLR.L HIT_OFS_X(A5,D0.W)
  271. MOVEP.W WORK_N3(A6),D0
  272. CLR.B D0
  273. CLR.L HIT_OFS_X(A5,D0.W)
  274. RTS
  275. PM_STAR:
  276. TST.B ACT_FLAG(A6)
  277. BPL.S PM_STAR_1
  278. CLR.W TYPE(A6)
  279. RTS
  280. PM_STAR_1:
  281. JSR.S REDUCTION_MOVE
  282. JSR.S NEXT_ACTION
  283. JSR.S SORT_SET
  284. RTS
  285. BLOD_SET:
  286. MOVE.L (A0)+,REG_D0(A5)
  287. MOVE.W (A0)+,REG_D1(A5)
  288. MOVEM.L A0/A6,-(SP)
  289. JSR.S FREE_OBJ_WORK
  290. BEQ BLOD_SET_END
  291. MOVE.W #P_STAR,D2
  292. SWAP D2
  293. MOVE.W REG_D1(A5),D2
  294. MOVE.W Y_POSITION(A6),D4
  295. MOVE.B #0B8H,D5
  296. JSR.S PWORK_SET
  297. MOVE.W REG_D0(A5),D1
  298. MOVEQ.L #1,D0
  299. AND.B ACT_ATTR(A6),D0
  300. BEQ.S BLOD_SET_1
  301. NEG.W D1
  302. BLOD_SET_1:
  303. OR.B D0,ACT_ATTR(A0)
  304. ADD.W X_POSITION(A6),D1
  305. MOVE.W D1,X_POSITION(A0)
  306. MOVE.W REG_D0+2(A5),D0
  307. ADD.W Z_POSITION(A6),D0
  308. MOVE.W D0,Z_POSITION(A0)
  309. BLOD_SET_END:
  310. MOVEM.L (SP)+,A0/A6
  311. RTS
  312. MEGANE:
  313. MOVEP.W WORK_N1(A6),D0
  314. CLR.B D0
  315. CMP.W #1,ACT_No(A5,D0.W)
  316. BEQ.S GETA_MAKE
  317. ADDQ.L #6,A0
  318. RTS
  319. GETA_MAKE:
  320. MOVE.L (A0)+,REG_D0(A5)
  321. MOVE.W (A0)+,REG_D1(A5)
  322. MOVEM.L A0/A6,-(SP)
  323. JSR.S FREE_OBJ_WORK
  324. BEQ GETA_SET_END
  325. MOVE.W #P_GETA,D2
  326. SWAP D2
  327. MOVE.W #C_GETA,D2
  328. MOVE.W Y_POSITION(A6),D4
  329. MOVE.B #0B8H,D5
  330. JSR.S PWORK_SET
  331. MOVE.W REG_D0(A5),D1
  332. MOVEQ.L #1,D0
  333. AND.B ACT_ATTR(A6),D0
  334. BEQ.S GETA_SET_1
  335. NEG.W D1
  336. GETA_SET_1:
  337. OR.B D0,ACT_ATTR(A0)
  338. ADD.W X_POSITION(A6),D1
  339. MOVE.W D1,X_POSITION(A0)
  340. MOVE.W REG_D0+2(A5),D0
  341. ADD.W Z_POSITION(A6),D0
  342. MOVE.W D0,Z_POSITION(A0)
  343. MOVE.W REG_D1(A5),D0
  344. ADD.W D0,D0
  345. ADD.W D0,D0
  346. ADD.W D0,D0
  347. MOVE.L GETA_DATA(PC,D0.W),VZ(A0)
  348. CLR.W VX+2(A0)
  349. MOVE.W GETA_DATA+4(PC,D0.W),VX(A0)
  350. MOVE.W GETA_DATA+6(PC,D0.W),ACT_No(A0)
  351. BTST.B #ACTAT_FLIP,ACT_ATTR(A0)
  352. BEQ.S GETA_SET_END
  353. NEG.W VX(A0)
  354. GETA_SET_END:
  355. MOVEM.L (SP)+,A0/A6
  356. RTS
  357. GETA_DATA:
  358. DC.L 08C000H
  359. DC.W -0006H,C_GETA
  360. DC.L 0BC000H
  361. DC.W -0004H,C_GETA
  362. DC.L 0BC000H
  363. DC.W -0003H,C_E4_HAT
  364. DC.L 040000H
  365. DC.W -0002H,C_E6_MEGANE
  366. DC.L 040000H
  367. DC.W -0002H,C_E7_MEGANE
  368. DC.L -20000H
  369. DC.W -0003H,C_E2_GUM
  370. PM_GETA:
  371. MOVE.W VX(A6),D0
  372. ADD.W D0,X_POSITION(A6)
  373. MOVE.L VZ(A6),D0
  374. SUB.L #9000H,D0
  375. MOVE.L D0,VZ(A6)
  376. ADD.L D0,Z_POSITION(A6)
  377. BMI.S GETA_END
  378. JSR.S REDUCTION_MOVE
  379. JSR.S NEXT_ACTION
  380. JSR.S SORT_SET
  381. RTS
  382. GETA_END:
  383. CLR.W TYPE(A6)
  384. RTS
  385. KAGE_CHG:
  386. MOVEP.W WORK_N3(A6),D0
  387. CLR.B D0
  388. MOVE.W #C_KAGE,ACT_No(A5,D0.W)
  389. MOVE.W (A0)+,D1
  390. MOVE.B D1,ACT_COUNT(A5,D0.W)
  391. MOVE.B #-1,ACT_TIMER(A5,D0.W)
  392. MOVE.B #1,ACT_DEC(A5,D0.W)
  393. RTS
  394. HERO_MASTER_GET:
  395. MOVE.B MASTER_No(A6),(A5)
  396. MOVE.W (A5),D0
  397. LEA.L 0(A5,D0.W),A4
  398. MOVE.B MASTER_No(A4),(A5)
  399. MOVE.W (A5),D0
  400. LEA.L -LOG(A5,D0.W),A3
  401. MOVE.L X_POSITION(A4),X_POSITION(A6)
  402. MOVE.L Y_POSITION(A4),Y_POSITION(A6)
  403. MOVE.L Z_POSITION(A4),Z_POSITION(A6)
  404. MOVE.W DISP_X(A4),DISP_X(A6)
  405. MOVE.W DISP_Y(A4),DISP_Y(A6)
  406. MOVE.B ACT_ATTR(A4),ACT_ATTR(A6)
  407. RTS
  408. PM_HERO_HEAD:
  409. JSR HERO_MASTER_GET(PC)
  410. JSR.S SET_HIT_AREA_HERO
  411. RTS
  412. PM_HERO_ATTACK:
  413. MOVE.B MASTER_No(A6),(A5)
  414. MOVE.W (A5),D0
  415. LEA.L 0(A5,D0.W),A4
  416. MOVE.B MASTER_No(A4),(A5)
  417. MOVE.W (A5),D0
  418. LEA.L -LOG(A5,D0.W),A3
  419. MOVE.L X_POSITION(A4),X_POSITION(A6)
  420. MOVE.L Y_POSITION(A4),Y_POSITION(A6)
  421. MOVE.L Z_POSITION(A4),Z_POSITION(A6)
  422. MOVE.W DISP_X(A4),DISP_X(A6)
  423. MOVE.W DISP_Y(A4),DISP_Y(A6)
  424. MOVE.B ACT_ATTR(A4),ACT_ATTR(A6)
  425. MOVE.L VX(A6),D0
  426. BTST.B #0,MAIN_COUNT+3(A5)
  427. BEQ.S PM_HERO_ATTACK_1
  428. MOVE.L VY(A6),D0
  429. PM_HERO_ATTACK_1:
  430. MOVE.L D0,HIT_OFS_X(A6)
  431. BEQ.S PM_HERO_OFF_1
  432. TST.B HIT_OFF(A3)
  433. BMI.S PM_HERO_OFF_1
  434. MOVE.B ATTACK_LEVEL(A3),LEVEL(A6)
  435. BSET.B #0,HIT_FLAG(A6)
  436. JSR.S SET_HIT_AREA
  437. RTS
  438. PM_HERO_OFF_1:
  439. MOVE.B #0,HIT_FLAG(A6)
  440. JSR.S SET_HIT_AREA
  441. RTS
  442. PM_HERO_AREA:
  443. MOVE.B MASTER_No(A6),(A5)
  444. MOVE.W (A5),D0
  445. LEA.L 0(A5,D0.W),A4
  446. MOVE.B MASTER_No(A4),(A5)
  447. MOVE.W (A5),D0
  448. LEA.L -LOG(A5,D0.W),A3
  449. MOVE.L X_POSITION(A4),X_POSITION(A6)
  450. MOVE.L Y_POSITION(A4),Y_POSITION(A6)
  451. MOVE.L Z_POSITION(A4),Z_POSITION(A6)
  452. MOVE.B ACT_ATTR(A4),ACT_ATTR(A6)
  453. JSR.S SET_HIT_AREA
  454. RTS
  455. PM_HERO_SHADOW:
  456. JSR HERO_MASTER_GET(PC)
  457. JSR.S SET_HIT_AREA_HERO
  458. BTST.B #BHSS_NAGERARE,STATE(A3)
  459. BNE.S PM_HERO_SHADOW_1
  460. BTST.B #BHS_JUMP,HERO_STATE(A3)
  461. BEQ.S PM_HERO_SHADOW_2
  462. PM_HERO_SHADOW_1:
  463. CLR.L Z_POSITION(A6)
  464. PM_HERO_SHADOW_2:
  465. JSR.S REDUCTION_MOVE
  466. JSR.S NEXT_ACTION
  467. JSR PM_HERO_21(PC)
  468. RTS
  469. PM_HERO_BODY:
  470. JSR HERO_MASTER_GET(PC)
  471. JSR.S SET_HIT_AREA_HERO
  472. RTS
  473. PM_HERO_WEAK:
  474. JSR HERO_MASTER_GET(PC)
  475. JSR.S SET_HIT_AREA_HERO
  476. RTS
  477. TAMA_SET:
  478. MOVE.L (A0)+,REG_D0(A5)
  479. MOVE.W (A0)+,REG_D1(A5)
  480. MOVEM.L A0/A6,-(SP)
  481. LEA.L (A6),A3
  482. MOVEP.W MASTER_No(A3),D0
  483. CLR.B D0
  484. LEA.L -LOG(A5,D0.W),A6
  485. JSR.S FREE_HERO_PWORK
  486. BEQ TAMA_SET_2
  487. ADDQ.B #1,SPECIAL_USE(A6)
  488. MOVE.L #P_SP2*10000H+C_TAMA_H21,D2
  489. MOVE.W X_POSITION(A3),D3
  490. MOVE.W Y_POSITION(A3),D4
  491. MOVE.B #0B0H,D5
  492. JSR.S PWORK_SET
  493. BSR TAMA_SPEED_GET
  494. SWAP D1
  495. MOVE.W REG_D0(A5),D0
  496. MOVEQ.L #1,D2
  497. AND.B ACT_ATTR(A3),D2
  498. BEQ.S TAMA_SET_1
  499. NEG.W D0
  500. NEG.L D1
  501. TAMA_SET_1:
  502. OR.B D2,ACT_ATTR(A0)
  503. ADD.W X_POSITION(A3),D0
  504. MOVE.W D0,X_POSITION(A0)
  505. MOVE.L D1,VX(A0)
  506. MOVE.W REG_D0+2(A5),D0
  507. ADD.W Z_POSITION(A3),D0
  508. MOVE.W D0,Z_POSITION(A0)
  509. MOVE.B WORK_No(A6),MASTER_No(A0)
  510. MOVE.B WORK_No(A0),TAMA_No(A6)
  511. MOVE.B #0011B,HIT_ACTIVE(A0)
  512. MOVE.B #0011B,HIT_PASSIVE(A0)
  513. MOVE.B ATTACK_LEVEL(A6),LEVEL(A0)
  514. MOVE.B GARD_LEVEL(A6),79H(A0)
  515. MOVE.B HIT_STOP(A6),7BH(A0)
  516. MOVE.B HIT_LR(A6),7CH(A0)
  517. MOVE.B DAMAGE_ACT_TYPE(A6),7DH(A0)
  518. MOVE.L HIT_SCORE(A6),LIFE(A0)
  519. MOVE.B #80H,HIT_TYPE_No(A0)
  520. MOVE.B #1,HIT_FLAG(A0)
  521. MOVEQ.L #0,D1
  522. MOVE.W REG_D1(A5),D0
  523. MOVE.B SPIRIT_OLD(A6),D2
  524. CMP.B SPIRIT_RANK(PC),D2
  525. BCS.S TAMA_SET_3
  526. ADDQ.W #1,D1
  527. CMP.B SPIRIT_RANK+1(PC),D2
  528. BCS.S TAMA_SET_3
  529. ADDQ.W #1,D1
  530. TAMA_SET_3:
  531. MOVE.B D1,SPEED_RANK(A0)
  532. ADD.W D1,D0
  533. ADD.W D0,D0
  534. ADD.W D0,D0
  535. MOVE.W TAMA_TBL(PC,D0.W),ACT_No(A0)
  536. MOVE.B TAMA_TBL+3(PC,D0.W),PALETTE_ADD(A0)
  537. TAMA_SET_2:
  538. MOVEM.L (SP)+,A0/A6
  539. RTS
  540. SPIRIT_RANK:
  541. DC.B 32,64
  542. TAMA_TBL:
  543. DC.W C_TAMA_H23,-1 0 H1 1
  544. DC.W C_TAMA_H22,-1
  545. DC.W C_TAMA_H21,-1
  546. DC.W C_TAMA_H23,0 1 H2 1
  547. DC.W C_TAMA_H22,0
  548. DC.W C_TAMA_H21,0
  549. DC.W C_TAMA_E53,0 2 E5 1
  550. DC.W C_TAMA_E52,0
  551. DC.W C_TAMA_E51,0
  552. DC.W C_TAMA_E43,0 3 E4
  553. DC.W C_TAMA_E42,0
  554. DC.W C_TAMA_E41,0
  555. DC.W C_TAMA_E63,0 4 E6
  556. DC.W C_TAMA_E62,0
  557. DC.W C_TAMA_E61,0
  558. DC.W C_TAMA_E13,0 5 E1
  559. DC.W C_TAMA_E12,0
  560. DC.W C_TAMA_E11,0
  561. DC.W C_TAMA_H11+8000H,-1 6 H1 2 HAOH
  562. DC.W C_TAMA_H11+8000H,-1
  563. DC.W C_TAMA_H11+8000H,-1
  564. DC.W C_TAMA_H11+8000H,0 7 H2 2 HAOH
  565. DC.W C_TAMA_H11+8000H,0
  566. DC.W C_TAMA_H11+8000H,0
  567. DC.W C_E5_FIRE3,0 8 E5 2
  568. DC.W C_E5_FIRE2,0
  569. DC.W C_E5_FIRE1,0
  570. TAMA_SPEED_GET:
  571. BTST.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A6)
  572. BEQ.S COM_TAMA
  573. MOVEQ.L #6,D1
  574. MOVE.B SPECIAL_OUT(A6),D2
  575. CMP.B #17,D2
  576. BCS.S TAMA_SPEED_GET_1
  577. MOVEQ.L #10,D1
  578. CMP.B #23,D2
  579. BCS.S TAMA_SPEED_GET_1
  580. MOVEQ.L #14,D1
  581. TAMA_SPEED_GET_1:
  582. RTS
  583. COM_TAMA:
  584. MOVEQ.L #0,D1
  585. MOVE.W LEVEL_TEMP(A5),D0
  586. ADD.W D0,D0
  587. MOVE.W COM_TAMA_DATA(PC,D0.W),D1
  588. RTS
  589. COM_TAMA_DATA:
  590. DC.W 6,6,10,10,10,10,14,14
  591. PM_SP2:
  592. TST.B ACT_FLAG(A6)
  593. BMI PM_SP2_2
  594. TST.B HIT_FLAG(A6)
  595. BPL PM_SP2_1
  596. BSR TAMA_SOUND
  597. CLR.B HIT_FLAG(A6)
  598. BTST.B #1,ACT_FLAG(A6)
  599. BNE PM_SP2_1
  600. MOVE.B #0,ACT_COUNT(A6)
  601. PM_SP2_1:
  602. BTST.B #0,ACT_FLAG(A6)
  603. BNE PM_SP2_10
  604. TST.B HIT_FLAG(A6)
  605. BEQ.S PM_SP2_10
  606. MOVE.L VX(A6),D0
  607. ADD.L D0,X_POSITION(A6)
  608. PM_SP2_10:
  609. MOVE.W X_POSITION(A6),D0
  610. MOVE.W D0,D1
  611. SUB.W BACK2+Wx(A5),D0
  612. CMP.W #-32,D0
  613. BLT.S PM_SP2_2
  614. SUB.W BACK2+WxRIGHT(A5),D1
  615. CMP.W #32,D1
  616. BGT.S PM_SP2_2
  617. JSR.S REDUCTION_MOVE
  618. JSR.S NEXT_ACTION
  619. JSR.S SET_HIT_AREA
  620. JSR.S SORT_SET
  621. RTS
  622. PM_SP2_2:
  623. MOVEP.W MASTER_No(A6),D0
  624. CLR.B D0
  625. LEA.L -LOG(A5,D0.W),A0
  626. SUBQ.B #1,SPECIAL_USE(A0)
  627. CLR.W TYPE(A6)
  628. RTS
  629. TAMA_SOUND:
  630. TST.B IN_BONUS(A5)
  631. BNE.S TAMA_SOUND_1
  632. TST.W ACT_No(A6)
  633. BPL.S TAMA_SOUND_1
  634. SOUND #S_PUNCH_4A
  635. RTS
  636. TAMA_SOUND_1:
  637. MOVEQ.L #0,D0
  638. MOVE.B SPEED_RANK(A6),D0
  639. ADD.W D0,D0
  640. MOVE.W TAMA_HIT_SOUND(PC,D0.W),D0
  641. JSR.S SET_SOUND
  642. RTS
  643. TAMA_HIT_SOUND:
  644. DC.W S_ST_PUNCH3,S_ST_PUNCH2,S_ST_PUNCH,S_ST_PUNCH
  645. PM_SP3:
  646. RTS
  647. PM_DESI:
  648. TST.B STEP1(A6)
  649. BNE DESI_STEP2
  650. JSR DESI_JUMP(PC)
  651. TST.W Z_POSITION(A6)
  652. BGT.S PM_DESI_0
  653. MOVE.B #1,ACT_DEC(A6)
  654. PM_DESI_0:
  655. TST.W VZ(A6)
  656. BPL.S PM_DESI_1
  657. BTST.B #5,ACT_FLAG(A6)
  658. BNE.S PM_DESI_1
  659. MOVE.B #1,ACT_DEC(A6)
  660. PM_DESI_1:
  661. JSR.S REDUCTION_MOVE
  662. JSR.S NEXT_ACTION
  663. JSR.S SORT_SET
  664. RTS
  665. DESI_STEP2:
  666. JSR DESI_JUMP(PC)
  667. MOVE.W X_POSITION(A6),D0
  668. MOVE.W D0,D1
  669. SUB.W BACK2+Wx(A5),D0
  670. CMP.W #-32,D0
  671. BLT.S DESI_DEAD
  672. SUB.W BACK2+WxRIGHT(A5),D1
  673. CMP.W #32,D1
  674. BLE.S PM_DESI_1
  675. DESI_DEAD:
  676. CLR.W TYPE(A6)
  677. RTS
  678. DESI_JUMP:
  679. BTST.B #6,ACT_FLAG(A6)
  680. BNE DESI_BOUND
  681. MOVE.W VX(A6),D0
  682. ADD.W D0,X_POSITION(A6)
  683. MOVE.L VZ(A6),D0
  684. SUB.L #9000H,D0
  685. MOVE.L D0,VZ(A6)
  686. ADD.L D0,Z_POSITION(A6)
  687. BGE.S DESI_JUMP_1
  688. NEG.L VZ(A6)
  689. CLR.L Z_POSITION(A6)
  690. DESI_JUMP_1:
  691. RTS
  692. DESI_BOUND:
  693. MOVE.B #1,STEP1(A6)
  694. RTS
  695. INCLUDE WORK.INC
  696.