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 47KB

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