Shuvit game master repo. http://shuvit.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actionPlayer.py 39KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411
  1. import bge
  2. import actionsFSMlist
  3. dict = bge.logic.globalDict
  4. zero_blend = False
  5. def actionPlayer(ac):
  6. scene = bge.logic.getCurrentScene()
  7. skater = dict['p1']
  8. deck = dict['p1d']
  9. a = getattr(actionsFSMlist.reg_walk, 'name')
  10. name = getattr(ac, 'name')
  11. dname = getattr(ac, 'dname')
  12. start = getattr(ac, 'start')
  13. end = getattr(ac, 'end')
  14. dstart = getattr(ac, 'dstart')
  15. dend = getattr(ac, 'dend')
  16. layer = getattr(ac, 'layer')
  17. mode = getattr(ac, 'mode')
  18. speed = getattr(ac, 'speed')
  19. blendin = getattr(ac, 'blendin')
  20. #--------------------------------
  21. if zero_blend:
  22. blendin = 0
  23. print('zeroing blend')
  24. skater.playAction(name, start,end, layer=layer, play_mode=mode, speed=speed, blendin=blendin)
  25. deck.playAction(dname, dstart,dend, layer=layer, play_mode=mode, speed=speed, blendin=blendin)
  26. #print('playing', name, get_frame(ac))
  27. def get_frame(ac):
  28. skater = dict['p1']
  29. layer = getattr(ac, 'layer')
  30. #print('getting frame', skater.getActionFrame(layer))
  31. return skater.getActionFrame(layer)
  32. def set_frame(ac, frame):
  33. skater = dict['p1']
  34. deck = dict['p1d']
  35. layer = getattr(ac, 'layer')
  36. skater.setActionFrame(frame, layer)
  37. deck.setActionFrame(frame, layer)
  38. print('setting frame', frame)
  39. def check_exit(aState, rA, timer, ac):
  40. exits = getattr(ac, 'exits')
  41. force = getattr(ac, 'force_exit')
  42. fe = getattr(ac, 'fef')
  43. print('?????????????rA, aState', rA, aState)
  44. if rA in exits:
  45. return rA
  46. #
  47. elif ('fak' in rA and 'reg' in aState) or ('reg' in rA and 'fak' in aState):
  48. print('change stance')
  49. if getattr(ac, 'opposite') != None:
  50. return getattr(ac, 'opposite')
  51. else:
  52. return aState
  53. if force != None and fe >= timer:
  54. print('doing exit timer')
  55. return force
  56. def state_timer(own):
  57. if own['aState'] == own['l_aState']:
  58. own['stateTimer'] += 1
  59. else:
  60. own['stateTimer'] = 0
  61. def check_land(rA, aState, own):
  62. #check if manualling
  63. if rA in actionsFSMlist.reg_manuallist or rA in actionsFSMlist.reg_grindlist or rA in actionsFSMlist.fak_grindlist:
  64. aState = rA
  65. own['stateTimer'] = 0
  66. own['aState'] = rA
  67. #otherwise, force land, offboard or fliptrick
  68. elif 'land' in rA or 'onboard' in rA or 'offboard' in rA or rA in actionsFSMlist.reg_fliplist or rA in actionsFSMlist.fak_fliplist:
  69. print('landing________________________', rA)
  70. aState = rA
  71. own['stateTimer'] = 0
  72. own['aState'] = rA
  73. print(own['stance'], '-----stance', rA)
  74. return aState
  75. def main(cont):
  76. own = cont.owner
  77. dict = bge.logic.globalDict
  78. #initial state
  79. if 'aState' not in own:
  80. own['aState'] = 'reg_idle'
  81. own['l_aState'] = None
  82. own['stateTimer'] = 0
  83. aState = own['aState']
  84. rA = own['requestAction']
  85. timer = own['stateTimer']
  86. newState = own['aState']
  87. aState = check_land(rA, aState, own)
  88. newState = aState
  89. og_state = own['aState']
  90. #print(aState, 'cur aState')
  91. if own['l_aState'] in actionsFSMlist.reg_fliplist:
  92. zero_blend = True
  93. #-----------------------
  94. check_state = 'reg_idle'
  95. if aState == check_state:
  96. action = getattr(actionsFSMlist, check_state)
  97. actionPlayer(action)
  98. newState = check_exit(aState, rA, timer, action)
  99. check_state = 'reg_idle2'
  100. if aState == check_state:
  101. action = getattr(actionsFSMlist, check_state)
  102. actionPlayer(action)
  103. newState = check_exit(aState, rA, timer, action)
  104. check_state = 'reg_idle3'
  105. if aState == check_state:
  106. action = getattr(actionsFSMlist, check_state)
  107. actionPlayer(action)
  108. newState = check_exit(aState, rA, timer, action)
  109. check_state = 'reg_idle4'
  110. if aState == check_state:
  111. action = getattr(actionsFSMlist, check_state)
  112. actionPlayer(action)
  113. newState = check_exit(aState, rA, timer, action)
  114. check_state = 'reg_idle5'
  115. if aState == check_state:
  116. action = getattr(actionsFSMlist, check_state)
  117. actionPlayer(action)
  118. newState = check_exit(aState, rA, timer, action)
  119. check_state = 'reg_jump'
  120. if aState == check_state:
  121. action = getattr(actionsFSMlist, check_state)
  122. actionPlayer(action)
  123. if own['stateTimer'] > getattr(action, 'fef'):
  124. newState = check_exit(aState, rA, timer, action)
  125. check_state = 'reg_walk_air'
  126. if aState == check_state:
  127. action = getattr(actionsFSMlist, check_state)
  128. actionPlayer(action)
  129. if aState != rA:
  130. newState = getattr(action, 'exits')[0]
  131. check_state = 'reg_walk_air_out'
  132. if aState == check_state:
  133. action = getattr(actionsFSMlist, check_state)
  134. actionPlayer(action)
  135. print(own['stateTimer'], getattr(action, 'fef'))
  136. if own['stateTimer'] > getattr(action, 'fef'):
  137. newState = getattr(action, 'force_exit')
  138. check_state = 'reg_sit'
  139. if aState == check_state:
  140. action = getattr(actionsFSMlist, check_state)
  141. #if own['stateTimer'] < 19:
  142. if own['stateTimer'] < getattr(action, 'intro_frames'):
  143. actionPlayer(getattr(actionsFSMlist, 'intro'))
  144. else:
  145. actionPlayer(action)
  146. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_sit)
  147. #-----------------------
  148. check_state = 'reg_walk'
  149. if aState == check_state:
  150. action = getattr(actionsFSMlist, check_state)
  151. if own['l_aState'] == 'reg_walkFast':
  152. frame = get_frame(actionsFSMlist.reg_walkFast)
  153. actionPlayer(action)
  154. set_frame(actionsFSMlist.reg_walk, frame)
  155. else:
  156. frame = actionPlayer(action)
  157. newState = check_exit(aState, rA, timer, action)
  158. #-----------------------
  159. check_state = 'reg_walkFast'
  160. if aState == check_state:
  161. action = getattr(actionsFSMlist, check_state)
  162. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_walkFast)
  163. if own['l_aState'] == 'reg_walk':
  164. frame = get_frame(actionsFSMlist.reg_walk)
  165. actionPlayer(action)
  166. set_frame(actionsFSMlist.reg_walkFast, frame)
  167. else:
  168. actionPlayer(action)
  169. #print(frame)
  170. check_state = 'reg_onboard'
  171. if aState == check_state:
  172. action = getattr(actionsFSMlist, check_state)
  173. actionPlayer(action)
  174. print('checking onbaord state')
  175. #if own['stateTimer'] > 10:
  176. #newState = check_exit(aState, rA, timer, actionsFSMlist.reg_onboard)
  177. if own['stateTimer'] > getattr(action, 'fef'):
  178. newState = getattr(action, 'force_exit')
  179. check_state = 'reg_offboard'
  180. if aState == check_state:
  181. action = getattr(actionsFSMlist, check_state)
  182. actionPlayer(action)
  183. if own['stateTimer'] > 20:
  184. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_offboard)
  185. check_state = 'reg_roll'
  186. if aState == check_state:
  187. action = getattr(actionsFSMlist, check_state)
  188. actionPlayer(action)
  189. newState = check_exit(aState, rA, timer, action)
  190. check_state = 'reg_turnLeft'
  191. if aState == check_state:
  192. action = getattr(actionsFSMlist, check_state)
  193. actionPlayer(action)
  194. newState = check_exit(aState, rA, timer, action)
  195. check_state = 'reg_turnRight'
  196. if aState == check_state:
  197. action = getattr(actionsFSMlist, check_state)
  198. actionPlayer(action)
  199. newState = check_exit(aState, rA, timer, action)
  200. check_state = 'reg_opos'
  201. if aState == check_state:
  202. action = getattr(actionsFSMlist, check_state)
  203. actionPlayer(action)
  204. newState = check_exit(aState, rA, timer, action)
  205. check_state = 'reg_nopos'
  206. if aState == check_state:
  207. action = getattr(actionsFSMlist, check_state)
  208. actionPlayer(action)
  209. newState = check_exit(aState, rA, timer, action)
  210. check_state = 'reg_pump'
  211. if aState == check_state:
  212. action = getattr(actionsFSMlist, check_state)
  213. actionPlayer(action)
  214. newState = check_exit(aState, rA, timer, action)
  215. check_state = 'reg_pump_left'
  216. if aState == check_state:
  217. action = getattr(actionsFSMlist, check_state)
  218. actionPlayer(action)
  219. newState = check_exit(aState, rA, timer, action)
  220. check_state = 'reg_pump_right'
  221. if aState == check_state:
  222. action = getattr(actionsFSMlist, check_state)
  223. actionPlayer(action)
  224. newState = check_exit(aState, rA, timer, action)
  225. check_state = 'reg_push'
  226. if aState == check_state:
  227. action = getattr(actionsFSMlist, check_state)
  228. actionPlayer(action)
  229. if own['stateTimer'] > 70:
  230. newState = 'reg_roll'
  231. check_state = 'reg_push_goof'
  232. if aState == check_state:
  233. action = getattr(actionsFSMlist, check_state)
  234. actionPlayer(action)
  235. if own['stateTimer'] > 70:
  236. newState = 'reg_roll'
  237. check_state = 'reg_powerslide'
  238. if aState == check_state:
  239. action = getattr(actionsFSMlist, check_state)
  240. # if own['stateTimer'] < 20:
  241. # actionPlayer(actionsFSMlist.reg_powerslide_in)
  242. if own['stateTimer'] < getattr(action, 'intro_frames'):
  243. intro = getattr(action, 'intro')
  244. actionPlayer(getattr(actionsFSMlist, intro))
  245. else:
  246. actionPlayer(action)
  247. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_powerslide)
  248. check_state = 'reg_fs_powerslide'
  249. if aState == check_state:
  250. action = getattr(actionsFSMlist, check_state)
  251. # if own['stateTimer'] < 20:
  252. # actionPlayer(actionsFSMlist.reg_fs_powerslide_in)
  253. if own['stateTimer'] < getattr(action, 'intro_frames'):
  254. intro = getattr(action, 'intro')
  255. actionPlayer(getattr(actionsFSMlist, intro))
  256. else:
  257. actionPlayer(action)
  258. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_fs_powerslide)
  259. check_state = 'reg_brfoot'
  260. if aState == check_state:
  261. action = getattr(actionsFSMlist, check_state)
  262. actionPlayer(action)
  263. if own['stateTimer'] > getattr(action, 'fef'):
  264. newState = getattr(action, 'force_exit')
  265. check_state = 'reg_frfoot'
  266. if aState == check_state:
  267. action = getattr(actionsFSMlist, check_state)
  268. actionPlayer(action)
  269. if own['stateTimer'] > getattr(action, 'fef'):
  270. newState = getattr(action, 'force_exit')
  271. check_state = 'reg_blfoot'
  272. if aState == check_state:
  273. action = getattr(actionsFSMlist, check_state)
  274. actionPlayer(action)
  275. if own['stateTimer'] > getattr(action, 'fef'):
  276. newState = getattr(action, 'force_exit')
  277. check_state = 'reg_flfoot'
  278. if aState == check_state:
  279. action = getattr(actionsFSMlist, check_state)
  280. actionPlayer(action)
  281. if own['stateTimer'] > getattr(action, 'fef'):
  282. newState = getattr(action, 'force_exit')
  283. check_state = 'reg_manual'
  284. if aState == check_state:
  285. action = getattr(actionsFSMlist, check_state)
  286. actionPlayer(action)
  287. newState = check_exit(aState, rA, timer, action)
  288. check_state = 'reg_nmanual'
  289. if aState == check_state:
  290. action = getattr(actionsFSMlist, check_state)
  291. actionPlayer(action)
  292. newState = check_exit(aState, rA, timer, action)
  293. check_state = 'reg_land'
  294. if aState == check_state:
  295. action = getattr(actionsFSMlist, check_state)
  296. actionPlayer(action)
  297. if own['stateTimer'] > getattr(action, 'fef'):
  298. newState = getattr(action, 'force_exit')
  299. check_state = 'reg_landL'
  300. if aState == check_state:
  301. action = getattr(actionsFSMlist, check_state)
  302. actionPlayer(action)
  303. if own['stateTimer'] > getattr(action, 'fef'):
  304. newState = getattr(action, 'force_exit')
  305. check_state = 'reg_landLb'
  306. if aState == check_state:
  307. action = getattr(actionsFSMlist, check_state)
  308. actionPlayer(action)
  309. if own['stateTimer'] > getattr(action, 'fef'):
  310. newState = getattr(action, 'force_exit')
  311. check_state = 'reg_landR'
  312. if aState == check_state:
  313. action = getattr(actionsFSMlist, check_state)
  314. actionPlayer(action)
  315. if own['stateTimer'] > getattr(action, 'fef'):
  316. newState = getattr(action, 'force_exit')
  317. check_state = 'reg_landRb'
  318. if aState == check_state:
  319. action = getattr(actionsFSMlist, check_state)
  320. actionPlayer(action)
  321. if own['stateTimer'] > getattr(action, 'fef'):
  322. newState = getattr(action, 'force_exit')
  323. check_state = 'reg_air'
  324. if aState == check_state:
  325. action = getattr(actionsFSMlist, check_state)
  326. actionPlayer(action)
  327. newState = check_exit(aState, rA, timer, action)
  328. check_state = 'reg_air_nb'
  329. if aState == check_state:
  330. action = getattr(actionsFSMlist, check_state)
  331. actionPlayer(action)
  332. newState = check_exit(aState, rA, timer, action)
  333. check_state = 'reg_air_nose'
  334. if aState == check_state:
  335. action = getattr(actionsFSMlist, check_state)
  336. actionPlayer(action)
  337. newState = check_exit(aState, rA, timer, action)
  338. check_state = 'reg_air_tail'
  339. if aState == check_state:
  340. action = getattr(actionsFSMlist, check_state)
  341. actionPlayer(action)
  342. newState = check_exit(aState, rA, timer, action)
  343. check_state = 'reg_ollie'
  344. if aState == check_state:
  345. action = getattr(actionsFSMlist, check_state)
  346. actionPlayer(action)
  347. if own['stateTimer'] > getattr(action, 'fef'):
  348. newState = getattr(action, 'force_exit')
  349. check_state = 'reg_kickflip'
  350. if aState == check_state:
  351. action = getattr(actionsFSMlist, check_state)
  352. actionPlayer(action)
  353. if own['stateTimer'] > getattr(action, 'fef'):
  354. newState = getattr(action, 'force_exit')
  355. check_state = 'reg_heelflip'
  356. if aState == check_state:
  357. action = getattr(actionsFSMlist, check_state)
  358. actionPlayer(action)
  359. if own['stateTimer'] > getattr(action, 'fef'):
  360. newState = getattr(action, 'force_exit')
  361. check_state = 'reg_shuvit'
  362. if aState == check_state:
  363. action = getattr(actionsFSMlist, check_state)
  364. actionPlayer(action)
  365. if own['stateTimer'] > getattr(action, 'fef'):
  366. newState = getattr(action, 'force_exit')
  367. check_state = 'reg_shuvit360'
  368. if aState == check_state:
  369. action = getattr(actionsFSMlist, check_state)
  370. actionPlayer(action)
  371. if own['stateTimer'] > getattr(action, 'fef'):
  372. newState = getattr(action, 'force_exit')
  373. check_state = 'reg_fsshuvit'
  374. if aState == check_state:
  375. action = getattr(actionsFSMlist, check_state)
  376. actionPlayer(action)
  377. if own['stateTimer'] > getattr(action, 'fef'):
  378. newState = getattr(action, 'force_exit')
  379. check_state = 'reg_fsshuvit360'
  380. if aState == check_state:
  381. action = getattr(actionsFSMlist, check_state)
  382. actionPlayer(action)
  383. if own['stateTimer'] > getattr(action, 'fef'):
  384. newState = getattr(action, 'force_exit')
  385. #-nollie
  386. check_state = 'reg_nollie'
  387. if aState == check_state:
  388. action = getattr(actionsFSMlist, check_state)
  389. actionPlayer(action)
  390. if own['stateTimer'] > getattr(action, 'fef'):
  391. newState = getattr(action, 'force_exit')
  392. check_state = 'reg_nollie_kickflip'
  393. if aState == check_state:
  394. action = getattr(actionsFSMlist, check_state)
  395. actionPlayer(action)
  396. if own['stateTimer'] > getattr(action, 'fef'):
  397. newState = getattr(action, 'force_exit')
  398. check_state = 'reg_nollie_heelflip'
  399. if aState == check_state:
  400. action = getattr(actionsFSMlist, check_state)
  401. actionPlayer(action)
  402. if own['stateTimer'] > getattr(action, 'fef'):
  403. newState = getattr(action, 'force_exit')
  404. check_state = 'reg_nollie_shuvit'
  405. if aState == check_state:
  406. action = getattr(actionsFSMlist, check_state)
  407. actionPlayer(action)
  408. if own['stateTimer'] > getattr(action, 'fef'):
  409. newState = getattr(action, 'force_exit')
  410. check_state = 'reg_nollie_fsshuvit'
  411. if aState == check_state:
  412. action = getattr(actionsFSMlist, check_state)
  413. actionPlayer(action)
  414. if own['stateTimer'] > getattr(action, 'fef'):
  415. newState = getattr(action, 'force_exit')
  416. check_state = 'reg_nollie_shuvit360'
  417. if aState == check_state:
  418. action = getattr(actionsFSMlist, check_state)
  419. actionPlayer(action)
  420. if own['stateTimer'] > getattr(action, 'fef'):
  421. newState = getattr(action, 'force_exit')
  422. check_state = 'reg_nollie_fsshuvit_360'
  423. if aState == check_state:
  424. action = getattr(actionsFSMlist, check_state)
  425. actionPlayer(action)
  426. if own['stateTimer'] > getattr(action, 'fef'):
  427. newState = getattr(action, 'force_exit')
  428. #-----------
  429. #grinds-----
  430. #-----------
  431. check_state = 'reg_5050'
  432. if aState == check_state:
  433. action = getattr(actionsFSMlist, check_state)
  434. actionPlayer(action)
  435. newState = check_exit(aState, rA, timer, action)
  436. check_state = 'reg_bsboard'
  437. if aState == check_state:
  438. action = getattr(actionsFSMlist, check_state)
  439. actionPlayer(action)
  440. newState = check_exit(aState, rA, timer, action)
  441. check_state = 'reg_fsboard'
  442. if aState == check_state:
  443. action = getattr(actionsFSMlist, check_state)
  444. actionPlayer(action)
  445. newState = check_exit(aState, rA, timer, action)
  446. check_state = 'reg_tailg'
  447. if aState == check_state:
  448. action = getattr(actionsFSMlist, check_state)
  449. actionPlayer(action)
  450. newState = check_exit(aState, rA, timer, action)
  451. check_state = 'reg_tailgr'
  452. if aState == check_state:
  453. action = getattr(actionsFSMlist, check_state)
  454. actionPlayer(action)
  455. newState = check_exit(aState, rA, timer, action)
  456. check_state = 'reg_tailgl'
  457. if aState == check_state:
  458. action = getattr(actionsFSMlist, check_state)
  459. actionPlayer(action)
  460. newState = check_exit(aState, rA, timer, action)
  461. check_state = 'reg_noseg'
  462. if aState == check_state:
  463. action = getattr(actionsFSMlist, check_state)
  464. actionPlayer(action)
  465. newState = check_exit(aState, rA, timer, action)
  466. check_state = 'reg_nosegr'
  467. if aState == check_state:
  468. action = getattr(actionsFSMlist, check_state)
  469. actionPlayer(action)
  470. newState = check_exit(aState, rA, timer, action)
  471. check_state = 'reg_nosegl'
  472. if aState == check_state:
  473. action = getattr(actionsFSMlist, check_state)
  474. actionPlayer(action)
  475. newState = check_exit(aState, rA, timer, action)
  476. check_state = 'reg_tailslide'
  477. if aState == check_state:
  478. action = getattr(actionsFSMlist, check_state)
  479. actionPlayer(action)
  480. newState = check_exit(aState, rA, timer, action)
  481. check_state = 'reg_noseslide'
  482. if aState == check_state:
  483. action = getattr(actionsFSMlist, check_state)
  484. actionPlayer(action)
  485. newState = check_exit(aState, rA, timer, action)
  486. #-----------
  487. #grabs------
  488. #-----------
  489. check_state = 'frontside_grab'
  490. if aState == check_state:
  491. action = getattr(actionsFSMlist, check_state)
  492. if own['stateTimer'] < getattr(action, 'intro_frames'):
  493. intro = getattr(action, 'intro')
  494. actionPlayer(getattr(actionsFSMlist, intro))
  495. else:
  496. actionPlayer(action)
  497. newState = check_exit(aState, rA, timer, action)
  498. check_state = 'backside_grab'
  499. if aState == check_state:
  500. action = getattr(actionsFSMlist, check_state)
  501. if own['stateTimer'] < getattr(action, 'intro_frames'):
  502. intro = getattr(action, 'intro')
  503. actionPlayer(getattr(actionsFSMlist, intro))
  504. else:
  505. actionPlayer(action)
  506. newState = check_exit(aState, rA, timer, action)
  507. check_state = 'frontside_nose_grab'
  508. if aState == check_state:
  509. action = getattr(actionsFSMlist, check_state)
  510. if own['stateTimer'] < getattr(action, 'intro_frames'):
  511. intro = getattr(action, 'intro')
  512. actionPlayer(getattr(actionsFSMlist, intro))
  513. else:
  514. actionPlayer(action)
  515. newState = check_exit(aState, rA, timer, action)
  516. check_state = 'backside_nose_grab'
  517. if aState == check_state:
  518. action = getattr(actionsFSMlist, check_state)
  519. if own['stateTimer'] < getattr(action, 'intro_frames'):
  520. intro = getattr(action, 'intro')
  521. actionPlayer(getattr(actionsFSMlist, intro))
  522. else:
  523. actionPlayer(action)
  524. newState = check_exit(aState, rA, timer, action)
  525. check_state = 'frontside_tail_grab'
  526. if aState == check_state:
  527. action = getattr(actionsFSMlist, check_state)
  528. if own['stateTimer'] < getattr(action, 'intro_frames'):
  529. intro = getattr(action, 'intro')
  530. actionPlayer(getattr(actionsFSMlist, intro))
  531. else:
  532. actionPlayer(action)
  533. newState = check_exit(aState, rA, timer, action)
  534. check_state = 'backside_tail_grab'
  535. if aState == check_state:
  536. action = getattr(actionsFSMlist, check_state)
  537. if own['stateTimer'] < getattr(action, 'intro_frames'):
  538. intro = getattr(action, 'intro')
  539. actionPlayer(getattr(actionsFSMlist, intro))
  540. else:
  541. actionPlayer(action)
  542. newState = check_exit(aState, rA, timer, action)
  543. check_state = 'reg_ollie_north'
  544. if aState == check_state:
  545. action = getattr(actionsFSMlist, check_state)
  546. if own['stateTimer'] < getattr(action, 'intro_frames'):
  547. intro = getattr(action, 'intro')
  548. actionPlayer(getattr(actionsFSMlist, intro))
  549. else:
  550. actionPlayer(action)
  551. newState = check_exit(aState, rA, timer, action)
  552. check_state = 'reg_ollie_south'
  553. if aState == check_state:
  554. action = getattr(actionsFSMlist, check_state)
  555. if own['stateTimer'] < getattr(action, 'intro_frames'):
  556. intro = getattr(action, 'intro')
  557. actionPlayer(getattr(actionsFSMlist, intro))
  558. else:
  559. actionPlayer(action)
  560. newState = check_exit(aState, rA, timer, action)
  561. check_state = 'reg_judo'
  562. if aState == check_state:
  563. action = getattr(actionsFSMlist, check_state)
  564. if own['stateTimer'] < getattr(action, 'intro_frames'):
  565. intro = getattr(action, 'intro')
  566. actionPlayer(getattr(actionsFSMlist, intro))
  567. else:
  568. actionPlayer(action)
  569. newState = check_exit(aState, rA, timer, action)
  570. check_state = 'reg_frigid'
  571. if aState == check_state:
  572. action = getattr(actionsFSMlist, check_state)
  573. if own['stateTimer'] < getattr(action, 'intro_frames'):
  574. intro = getattr(action, 'intro')
  575. actionPlayer(getattr(actionsFSMlist, intro))
  576. else:
  577. actionPlayer(action)
  578. newState = check_exit(aState, rA, timer, action)
  579. check_state = 'reg_fsonefoot'
  580. if aState == check_state:
  581. action = getattr(actionsFSMlist, check_state)
  582. if own['stateTimer'] < getattr(action, 'intro_frames'):
  583. intro = getattr(action, 'intro')
  584. actionPlayer(getattr(actionsFSMlist, intro))
  585. else:
  586. actionPlayer(action)
  587. newState = check_exit(aState, rA, timer, action)
  588. check_state = 'reg_onefoot'
  589. if aState == check_state:
  590. action = getattr(actionsFSMlist, check_state)
  591. if own['stateTimer'] < getattr(action, 'intro_frames'):
  592. intro = getattr(action, 'intro')
  593. actionPlayer(getattr(actionsFSMlist, intro))
  594. else:
  595. actionPlayer(action)
  596. newState = check_exit(aState, rA, timer, action)
  597. check_state = 'fak_idle'
  598. if aState == check_state:
  599. action = getattr(actionsFSMlist, check_state)
  600. actionPlayer(action)
  601. newState = check_exit(aState, rA, timer, action)
  602. check_state = 'fak_idle2'
  603. if aState == check_state:
  604. action = getattr(actionsFSMlist, check_state)
  605. actionPlayer(action)
  606. newState = check_exit(aState, rA, timer, action)
  607. check_state = 'fak_idle3'
  608. if aState == check_state:
  609. action = getattr(actionsFSMlist, check_state)
  610. actionPlayer(action)
  611. newState = check_exit(aState, rA, timer, action)
  612. check_state = 'fak_idle4'
  613. if aState == check_state:
  614. action = getattr(actionsFSMlist, check_state)
  615. actionPlayer(action)
  616. newState = check_exit(aState, rA, timer, action)
  617. check_state = 'fak_idle5'
  618. if aState == check_state:
  619. action = getattr(actionsFSMlist, check_state)
  620. actionPlayer(action)
  621. newState = check_exit(aState, rA, timer, action)
  622. check_state = 'fak_jump'
  623. if aState == check_state:
  624. action = getattr(actionsFSMlist, check_state)
  625. actionPlayer(action)
  626. if own['stateTimer'] > getattr(action, 'fef'):
  627. newState = check_exit(aState, rA, timer, action)
  628. check_state = 'fak_walk_air'
  629. if aState == check_state:
  630. action = getattr(actionsFSMlist, check_state)
  631. actionPlayer(action)
  632. if aState != rA:
  633. newState = getattr(action, 'exits')[0]
  634. check_state = 'fak_walk_air_out'
  635. if aState == check_state:
  636. action = getattr(actionsFSMlist, check_state)
  637. actionPlayer(action)
  638. print(own['stateTimer'], getattr(action, 'fef'))
  639. if own['stateTimer'] > getattr(action, 'fef'):
  640. newState = getattr(action, 'force_exit')
  641. check_state = 'fak_sit'
  642. if aState == check_state:
  643. action = getattr(actionsFSMlist, check_state)
  644. #if own['stateTimer'] < 19:
  645. if own['stateTimer'] < getattr(action, 'intro_frames'):
  646. actionPlayer(getattr(actionsFSMlist, 'intro'))
  647. else:
  648. actionPlayer(action)
  649. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_sit)
  650. #-----------------------
  651. check_state = 'fak_walk'
  652. if aState == check_state:
  653. action = getattr(actionsFSMlist, check_state)
  654. if own['l_aState'] == 'fak_walkFast':
  655. frame = get_frame(actionsFSMlist.fak_walkFast)
  656. actionPlayer(action)
  657. set_frame(actionsFSMlist.fak_walk, frame)
  658. else:
  659. frame = actionPlayer(action)
  660. newState = check_exit(aState, rA, timer, action)
  661. #-----------------------
  662. check_state = 'fak_walkFast'
  663. if aState == check_state:
  664. action = getattr(actionsFSMlist, check_state)
  665. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_walkFast)
  666. if own['l_aState'] == 'fak_walk':
  667. frame = get_frame(actionsFSMlist.fak_walk)
  668. actionPlayer(action)
  669. set_frame(actionsFSMlist.fak_walkFast, frame)
  670. else:
  671. actionPlayer(action)
  672. #print(frame)
  673. check_state = 'fak_onboard'
  674. if aState == check_state:
  675. action = getattr(actionsFSMlist, check_state)
  676. actionPlayer(action)
  677. print('checking onbaord state')
  678. #if own['stateTimer'] > 10:
  679. #newState = check_exit(aState, rA, timer, actionsFSMlist.fak_onboard)
  680. if own['stateTimer'] > getattr(action, 'fef'):
  681. newState = getattr(action, 'force_exit')
  682. check_state = 'fak_offboard'
  683. if aState == check_state:
  684. action = getattr(actionsFSMlist, check_state)
  685. actionPlayer(action)
  686. if own['stateTimer'] > 20:
  687. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_offboard)
  688. check_state = 'fak_roll'
  689. if aState == check_state:
  690. action = getattr(actionsFSMlist, check_state)
  691. actionPlayer(action)
  692. newState = check_exit(aState, rA, timer, action)
  693. check_state = 'fak_turnLeft'
  694. if aState == check_state:
  695. action = getattr(actionsFSMlist, check_state)
  696. actionPlayer(action)
  697. newState = check_exit(aState, rA, timer, action)
  698. check_state = 'fak_turnRight'
  699. if aState == check_state:
  700. action = getattr(actionsFSMlist, check_state)
  701. actionPlayer(action)
  702. newState = check_exit(aState, rA, timer, action)
  703. check_state = 'fak_opos'
  704. if aState == check_state:
  705. action = getattr(actionsFSMlist, check_state)
  706. actionPlayer(action)
  707. newState = check_exit(aState, rA, timer, action)
  708. check_state = 'fak_nopos'
  709. if aState == check_state:
  710. action = getattr(actionsFSMlist, check_state)
  711. actionPlayer(action)
  712. newState = check_exit(aState, rA, timer, action)
  713. check_state = 'fak_pump'
  714. if aState == check_state:
  715. action = getattr(actionsFSMlist, check_state)
  716. actionPlayer(action)
  717. newState = check_exit(aState, rA, timer, action)
  718. check_state = 'fak_pump_left'
  719. if aState == check_state:
  720. action = getattr(actionsFSMlist, check_state)
  721. actionPlayer(action)
  722. newState = check_exit(aState, rA, timer, action)
  723. check_state = 'fak_pump_right'
  724. if aState == check_state:
  725. action = getattr(actionsFSMlist, check_state)
  726. actionPlayer(action)
  727. newState = check_exit(aState, rA, timer, action)
  728. check_state = 'fak_push'
  729. if aState == check_state:
  730. action = getattr(actionsFSMlist, check_state)
  731. actionPlayer(action)
  732. if own['stateTimer'] > 70:
  733. newState = 'fak_roll'
  734. check_state = 'fak_push_goof'
  735. if aState == check_state:
  736. action = getattr(actionsFSMlist, check_state)
  737. actionPlayer(action)
  738. if own['stateTimer'] > 70:
  739. newState = 'fak_roll'
  740. check_state = 'fak_powerslide'
  741. if aState == check_state:
  742. action = getattr(actionsFSMlist, check_state)
  743. # if own['stateTimer'] < 20:
  744. # actionPlayer(actionsFSMlist.fak_powerslide_in)
  745. if own['stateTimer'] < getattr(action, 'intro_frames'):
  746. intro = getattr(action, 'intro')
  747. actionPlayer(getattr(actionsFSMlist, intro))
  748. else:
  749. actionPlayer(action)
  750. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_powerslide)
  751. check_state = 'fak_fs_powerslide'
  752. if aState == check_state:
  753. action = getattr(actionsFSMlist, check_state)
  754. # if own['stateTimer'] < 20:
  755. # actionPlayer(actionsFSMlist.fak_fs_powerslide_in)
  756. if own['stateTimer'] < getattr(action, 'intro_frames'):
  757. intro = getattr(action, 'intro')
  758. actionPlayer(getattr(actionsFSMlist, intro))
  759. else:
  760. actionPlayer(action)
  761. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_fs_powerslide)
  762. check_state = 'fak_brfoot'
  763. if aState == check_state:
  764. action = getattr(actionsFSMlist, check_state)
  765. actionPlayer(action)
  766. if own['stateTimer'] > getattr(action, 'fef'):
  767. newState = getattr(action, 'force_exit')
  768. check_state = 'fak_frfoot'
  769. if aState == check_state:
  770. action = getattr(actionsFSMlist, check_state)
  771. actionPlayer(action)
  772. if own['stateTimer'] > getattr(action, 'fef'):
  773. newState = getattr(action, 'force_exit')
  774. check_state = 'fak_blfoot'
  775. if aState == check_state:
  776. action = getattr(actionsFSMlist, check_state)
  777. actionPlayer(action)
  778. if own['stateTimer'] > getattr(action, 'fef'):
  779. newState = getattr(action, 'force_exit')
  780. check_state = 'fak_flfoot'
  781. if aState == check_state:
  782. action = getattr(actionsFSMlist, check_state)
  783. actionPlayer(action)
  784. if own['stateTimer'] > getattr(action, 'fef'):
  785. newState = getattr(action, 'force_exit')
  786. check_state = 'fak_manual'
  787. if aState == check_state:
  788. action = getattr(actionsFSMlist, check_state)
  789. actionPlayer(action)
  790. newState = check_exit(aState, rA, timer, action)
  791. check_state = 'fak_nmanual'
  792. if aState == check_state:
  793. action = getattr(actionsFSMlist, check_state)
  794. actionPlayer(action)
  795. newState = check_exit(aState, rA, timer, action)
  796. check_state = 'fak_land'
  797. if aState == check_state:
  798. action = getattr(actionsFSMlist, check_state)
  799. actionPlayer(action)
  800. if own['stateTimer'] > getattr(action, 'fef'):
  801. newState = getattr(action, 'force_exit')
  802. check_state = 'fak_landL'
  803. if aState == check_state:
  804. action = getattr(actionsFSMlist, check_state)
  805. actionPlayer(action)
  806. if own['stateTimer'] > getattr(action, 'fef'):
  807. newState = getattr(action, 'force_exit')
  808. check_state = 'fak_landLb'
  809. if aState == check_state:
  810. action = getattr(actionsFSMlist, check_state)
  811. actionPlayer(action)
  812. if own['stateTimer'] > getattr(action, 'fef'):
  813. newState = getattr(action, 'force_exit')
  814. check_state = 'fak_landR'
  815. if aState == check_state:
  816. action = getattr(actionsFSMlist, check_state)
  817. actionPlayer(action)
  818. if own['stateTimer'] > getattr(action, 'fef'):
  819. newState = getattr(action, 'force_exit')
  820. check_state = 'fak_landRb'
  821. if aState == check_state:
  822. action = getattr(actionsFSMlist, check_state)
  823. actionPlayer(action)
  824. if own['stateTimer'] > getattr(action, 'fef'):
  825. newState = getattr(action, 'force_exit')
  826. check_state = 'fak_air'
  827. if aState == check_state:
  828. action = getattr(actionsFSMlist, check_state)
  829. actionPlayer(action)
  830. newState = check_exit(aState, rA, timer, action)
  831. check_state = 'fak_air_nb'
  832. if aState == check_state:
  833. action = getattr(actionsFSMlist, check_state)
  834. actionPlayer(action)
  835. newState = check_exit(aState, rA, timer, action)
  836. check_state = 'fak_air_nose'
  837. if aState == check_state:
  838. action = getattr(actionsFSMlist, check_state)
  839. actionPlayer(action)
  840. newState = check_exit(aState, rA, timer, action)
  841. check_state = 'fak_air_tail'
  842. if aState == check_state:
  843. action = getattr(actionsFSMlist, check_state)
  844. actionPlayer(action)
  845. newState = check_exit(aState, rA, timer, action)
  846. check_state = 'fak_ollie'
  847. if aState == check_state:
  848. action = getattr(actionsFSMlist, check_state)
  849. actionPlayer(action)
  850. if own['stateTimer'] > getattr(action, 'fef'):
  851. newState = getattr(action, 'force_exit')
  852. check_state = 'fak_kickflip'
  853. if aState == check_state:
  854. action = getattr(actionsFSMlist, check_state)
  855. actionPlayer(action)
  856. if own['stateTimer'] > getattr(action, 'fef'):
  857. newState = getattr(action, 'force_exit')
  858. check_state = 'fak_heelflip'
  859. if aState == check_state:
  860. action = getattr(actionsFSMlist, check_state)
  861. actionPlayer(action)
  862. if own['stateTimer'] > getattr(action, 'fef'):
  863. newState = getattr(action, 'force_exit')
  864. check_state = 'fak_shuvit'
  865. if aState == check_state:
  866. action = getattr(actionsFSMlist, check_state)
  867. actionPlayer(action)
  868. if own['stateTimer'] > getattr(action, 'fef'):
  869. newState = getattr(action, 'force_exit')
  870. check_state = 'fak_shuvit360'
  871. if aState == check_state:
  872. action = getattr(actionsFSMlist, check_state)
  873. actionPlayer(action)
  874. if own['stateTimer'] > getattr(action, 'fef'):
  875. newState = getattr(action, 'force_exit')
  876. check_state = 'fak_fsshuvit'
  877. if aState == check_state:
  878. action = getattr(actionsFSMlist, check_state)
  879. actionPlayer(action)
  880. if own['stateTimer'] > getattr(action, 'fef'):
  881. newState = getattr(action, 'force_exit')
  882. check_state = 'fak_fsshuvit360'
  883. if aState == check_state:
  884. action = getattr(actionsFSMlist, check_state)
  885. actionPlayer(action)
  886. if own['stateTimer'] > getattr(action, 'fef'):
  887. newState = getattr(action, 'force_exit')
  888. #-nollie
  889. check_state = 'fak_nollie'
  890. if aState == check_state:
  891. action = getattr(actionsFSMlist, check_state)
  892. actionPlayer(action)
  893. if own['stateTimer'] > getattr(action, 'fef'):
  894. newState = getattr(action, 'force_exit')
  895. check_state = 'fak_nollie_kickflip'
  896. if aState == check_state:
  897. action = getattr(actionsFSMlist, check_state)
  898. actionPlayer(action)
  899. if own['stateTimer'] > getattr(action, 'fef'):
  900. newState = getattr(action, 'force_exit')
  901. check_state = 'fak_nollie_heelflip'
  902. if aState == check_state:
  903. action = getattr(actionsFSMlist, check_state)
  904. actionPlayer(action)
  905. if own['stateTimer'] > getattr(action, 'fef'):
  906. newState = getattr(action, 'force_exit')
  907. check_state = 'fak_nollie_shuvit'
  908. if aState == check_state:
  909. action = getattr(actionsFSMlist, check_state)
  910. actionPlayer(action)
  911. if own['stateTimer'] > getattr(action, 'fef'):
  912. newState = getattr(action, 'force_exit')
  913. check_state = 'fak_nollie_fsshuvit'
  914. if aState == check_state:
  915. action = getattr(actionsFSMlist, check_state)
  916. actionPlayer(action)
  917. if own['stateTimer'] > getattr(action, 'fef'):
  918. newState = getattr(action, 'force_exit')
  919. check_state = 'fak_nollie_shuvit360'
  920. if aState == check_state:
  921. action = getattr(actionsFSMlist, check_state)
  922. actionPlayer(action)
  923. if own['stateTimer'] > getattr(action, 'fef'):
  924. newState = getattr(action, 'force_exit')
  925. check_state = 'fak_nollie_fsshuvit_360'
  926. if aState == check_state:
  927. action = getattr(actionsFSMlist, check_state)
  928. actionPlayer(action)
  929. if own['stateTimer'] > getattr(action, 'fef'):
  930. newState = getattr(action, 'force_exit')
  931. #-----------
  932. #grinds-----
  933. #-----------
  934. check_state = 'fak_5050'
  935. if aState == check_state:
  936. action = getattr(actionsFSMlist, check_state)
  937. actionPlayer(action)
  938. newState = check_exit(aState, rA, timer, action)
  939. check_state = 'fak_bsboard'
  940. if aState == check_state:
  941. action = getattr(actionsFSMlist, check_state)
  942. actionPlayer(action)
  943. newState = check_exit(aState, rA, timer, action)
  944. check_state = 'fak_fsboard'
  945. if aState == check_state:
  946. action = getattr(actionsFSMlist, check_state)
  947. actionPlayer(action)
  948. newState = check_exit(aState, rA, timer, action)
  949. check_state = 'fak_tailg'
  950. if aState == check_state:
  951. action = getattr(actionsFSMlist, check_state)
  952. actionPlayer(action)
  953. newState = check_exit(aState, rA, timer, action)
  954. check_state = 'fak_tailgr'
  955. if aState == check_state:
  956. action = getattr(actionsFSMlist, check_state)
  957. actionPlayer(action)
  958. newState = check_exit(aState, rA, timer, action)
  959. check_state = 'fak_tailgl'
  960. if aState == check_state:
  961. action = getattr(actionsFSMlist, check_state)
  962. actionPlayer(action)
  963. newState = check_exit(aState, rA, timer, action)
  964. check_state = 'fak_noseg'
  965. if aState == check_state:
  966. action = getattr(actionsFSMlist, check_state)
  967. actionPlayer(action)
  968. newState = check_exit(aState, rA, timer, action)
  969. check_state = 'fak_nosegr'
  970. if aState == check_state:
  971. action = getattr(actionsFSMlist, check_state)
  972. actionPlayer(action)
  973. newState = check_exit(aState, rA, timer, action)
  974. check_state = 'fak_nosegl'
  975. if aState == check_state:
  976. action = getattr(actionsFSMlist, check_state)
  977. actionPlayer(action)
  978. newState = check_exit(aState, rA, timer, action)
  979. check_state = 'fak_tailslide'
  980. if aState == check_state:
  981. action = getattr(actionsFSMlist, check_state)
  982. actionPlayer(action)
  983. newState = check_exit(aState, rA, timer, action)
  984. check_state = 'fak_noseslide'
  985. if aState == check_state:
  986. action = getattr(actionsFSMlist, check_state)
  987. actionPlayer(action)
  988. newState = check_exit(aState, rA, timer, action)
  989. #-----------
  990. #grabs------
  991. #-----------
  992. check_state = 'fak_frontside_grab'
  993. if aState == check_state:
  994. action = getattr(actionsFSMlist, check_state)
  995. if own['stateTimer'] < getattr(action, 'intro_frames'):
  996. intro = getattr(action, 'intro')
  997. actionPlayer(getattr(actionsFSMlist, intro))
  998. else:
  999. actionPlayer(action)
  1000. newState = check_exit(aState, rA, timer, action)
  1001. check_state = 'fak_backside_grab'
  1002. if aState == check_state:
  1003. action = getattr(actionsFSMlist, check_state)
  1004. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1005. intro = getattr(action, 'intro')
  1006. actionPlayer(getattr(actionsFSMlist, intro))
  1007. else:
  1008. actionPlayer(action)
  1009. newState = check_exit(aState, rA, timer, action)
  1010. check_state = 'fak_frontside_nose_grab'
  1011. if aState == check_state:
  1012. action = getattr(actionsFSMlist, check_state)
  1013. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1014. intro = getattr(action, 'intro')
  1015. actionPlayer(getattr(actionsFSMlist, intro))
  1016. else:
  1017. actionPlayer(action)
  1018. newState = check_exit(aState, rA, timer, action)
  1019. check_state = 'fak_backside_nose_grab'
  1020. if aState == check_state:
  1021. action = getattr(actionsFSMlist, check_state)
  1022. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1023. intro = getattr(action, 'intro')
  1024. actionPlayer(getattr(actionsFSMlist, intro))
  1025. else:
  1026. actionPlayer(action)
  1027. newState = check_exit(aState, rA, timer, action)
  1028. check_state = 'fak_frontside_tail_grab'
  1029. if aState == check_state:
  1030. action = getattr(actionsFSMlist, check_state)
  1031. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1032. intro = getattr(action, 'intro')
  1033. actionPlayer(getattr(actionsFSMlist, intro))
  1034. else:
  1035. actionPlayer(action)
  1036. newState = check_exit(aState, rA, timer, action)
  1037. check_state = 'fak_backside_tail_grab'
  1038. if aState == check_state:
  1039. action = getattr(actionsFSMlist, check_state)
  1040. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1041. intro = getattr(action, 'intro')
  1042. actionPlayer(getattr(actionsFSMlist, intro))
  1043. else:
  1044. actionPlayer(action)
  1045. newState = check_exit(aState, rA, timer, action)
  1046. check_state = 'fak_ollie_north'
  1047. if aState == check_state:
  1048. action = getattr(actionsFSMlist, check_state)
  1049. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1050. intro = getattr(action, 'intro')
  1051. actionPlayer(getattr(actionsFSMlist, intro))
  1052. else:
  1053. actionPlayer(action)
  1054. newState = check_exit(aState, rA, timer, action)
  1055. check_state = 'fak_ollie_south'
  1056. if aState == check_state:
  1057. action = getattr(actionsFSMlist, check_state)
  1058. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1059. intro = getattr(action, 'intro')
  1060. actionPlayer(getattr(actionsFSMlist, intro))
  1061. else:
  1062. actionPlayer(action)
  1063. newState = check_exit(aState, rA, timer, action)
  1064. check_state = 'fak_judo'
  1065. if aState == check_state:
  1066. action = getattr(actionsFSMlist, check_state)
  1067. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1068. intro = getattr(action, 'intro')
  1069. actionPlayer(getattr(actionsFSMlist, intro))
  1070. else:
  1071. actionPlayer(action)
  1072. newState = check_exit(aState, rA, timer, action)
  1073. check_state = 'fak_frigid'
  1074. if aState == check_state:
  1075. action = getattr(actionsFSMlist, check_state)
  1076. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1077. intro = getattr(action, 'intro')
  1078. actionPlayer(getattr(actionsFSMlist, intro))
  1079. else:
  1080. actionPlayer(action)
  1081. newState = check_exit(aState, rA, timer, action)
  1082. check_state = 'fak_fsonefoot'
  1083. if aState == check_state:
  1084. action = getattr(actionsFSMlist, check_state)
  1085. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1086. intro = getattr(action, 'intro')
  1087. actionPlayer(getattr(actionsFSMlist, intro))
  1088. else:
  1089. actionPlayer(action)
  1090. newState = check_exit(aState, rA, timer, action)
  1091. check_state = 'fak_onefoot'
  1092. if aState == check_state:
  1093. action = getattr(actionsFSMlist, check_state)
  1094. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1095. intro = getattr(action, 'intro')
  1096. actionPlayer(getattr(actionsFSMlist, intro))
  1097. else:
  1098. actionPlayer(action)
  1099. newState = check_exit(aState, rA, timer, action)
  1100. #-----------------------
  1101. #own['aState'] = aState
  1102. if newState != '':
  1103. own['aState'] = newState
  1104. #print(own['l_aState'], '----l_aState', own['aState'])
  1105. own['l_aState'] = og_state
  1106. own['l_actionState'] = og_state
  1107. #own['l_aState'] = newState
  1108. #print(own['l_aState'], '----l_aState', own['aState'], 'rA', rA)
  1109. state_timer(own)