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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  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. cont = bge.logic.getCurrentController()
  8. own = cont.owner
  9. skater = dict['p1']
  10. deck = dict['p1d']
  11. a = getattr(actionsFSMlist.reg_walk, 'name')
  12. name = getattr(ac, 'name')
  13. dname = getattr(ac, 'dname')
  14. start = getattr(ac, 'start')
  15. end = getattr(ac, 'end')
  16. dstart = getattr(ac, 'dstart')
  17. dend = getattr(ac, 'dend')
  18. layer = getattr(ac, 'layer')
  19. mode = getattr(ac, 'mode')
  20. speed = getattr(ac, 'speed')
  21. blendin = getattr(ac, 'blendin')
  22. #--------------------------------
  23. #if zero_blend:
  24. # if own['l_actionState'] != None and own['l_actionState'] in 'revert1':
  25. # blendin = 0
  26. # print('zeroing blend')
  27. skater.playAction(name, start,end, layer=layer, play_mode=mode, speed=speed, blendin=blendin)
  28. deck.playAction(dname, dstart,dend, layer=layer, play_mode=mode, speed=speed, blendin=blendin)
  29. #print('playing', name, get_frame(ac))
  30. if skater.isPlayingAction(3):
  31. print(skater.getActionFrame(3))
  32. def get_frame(ac):
  33. skater = dict['p1']
  34. layer = getattr(ac, 'layer')
  35. #print('getting frame', skater.getActionFrame(layer))
  36. return skater.getActionFrame(layer)
  37. def set_frame(ac, frame):
  38. skater = dict['p1']
  39. deck = dict['p1d']
  40. layer = getattr(ac, 'layer')
  41. skater.setActionFrame(frame, layer)
  42. deck.setActionFrame(frame, layer)
  43. #print('setting frame', frame)
  44. def check_exit(aState, rA, timer, ac):
  45. exits = getattr(ac, 'exits')
  46. force = getattr(ac, 'force_exit')
  47. fe = getattr(ac, 'fef')
  48. #print('?????????????rA, aState', rA, aState)
  49. if rA in exits:
  50. return rA
  51. #
  52. elif ('fak' in rA and 'reg' in aState) or ('reg' in rA and 'fak' in aState):
  53. #print('change stance')
  54. if getattr(ac, 'opposite') != None:
  55. return getattr(ac, 'opposite')
  56. else:
  57. return aState
  58. if force != None and fe >= timer:
  59. #print('doing exit timer')
  60. return force
  61. def state_timer(own):
  62. if own['aState'] == own['l_aState']:
  63. own['stateTimer'] += 1
  64. else:
  65. own['stateTimer'] = 0
  66. def check_land(rA, aState, own):
  67. #check if manualling
  68. if rA in actionsFSMlist.reg_manuallist or rA in actionsFSMlist.reg_grindlist or rA in actionsFSMlist.fak_grindlist:
  69. aState = rA
  70. own['stateTimer'] = 0
  71. own['aState'] = rA
  72. #otherwise, force land, offboard or fliptrick
  73. 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:
  74. #print('landing________________________', rA)
  75. aState = rA
  76. own['stateTimer'] = 0
  77. own['aState'] = rA
  78. #print(own['stance'], '-----stance', rA)
  79. return aState
  80. def main(cont):
  81. own = cont.owner
  82. dict = bge.logic.globalDict
  83. #initial state
  84. if 'aState' not in own:
  85. own['aState'] = 'reg_idle'
  86. own['l_aState'] = None
  87. own['stateTimer'] = 0
  88. aState = own['aState']
  89. rA = own['requestAction']
  90. timer = own['stateTimer']
  91. newState = own['aState']
  92. aState = check_land(rA, aState, own)
  93. newState = aState
  94. og_state = own['aState']
  95. #print(aState, 'cur aState')
  96. if own['l_aState'] in actionsFSMlist.reg_fliplist:
  97. zero_blend = True
  98. #-----------------------
  99. check_state = 'reg_idle'
  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_idle2'
  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_idle3'
  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_idle4'
  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_idle5'
  120. if aState == check_state:
  121. action = getattr(actionsFSMlist, check_state)
  122. actionPlayer(action)
  123. newState = check_exit(aState, rA, timer, action)
  124. check_state = 'reg_idle6'
  125. if aState == check_state:
  126. action = getattr(actionsFSMlist, check_state)
  127. actionPlayer(action)
  128. newState = check_exit(aState, rA, timer, action)
  129. check_state = 'reg_idle7'
  130. if aState == check_state:
  131. action = getattr(actionsFSMlist, check_state)
  132. actionPlayer(action)
  133. newState = check_exit(aState, rA, timer, action)
  134. check_state = 'reg_jump'
  135. if aState == check_state:
  136. action = getattr(actionsFSMlist, check_state)
  137. actionPlayer(action)
  138. if own['stateTimer'] > getattr(action, 'fef'):
  139. newState = check_exit(aState, rA, timer, action)
  140. check_state = 'reg_walk_air'
  141. if aState == check_state:
  142. action = getattr(actionsFSMlist, check_state)
  143. actionPlayer(action)
  144. if aState != rA:
  145. newState = getattr(action, 'exits')[0]
  146. check_state = 'reg_walk_air_out'
  147. if aState == check_state:
  148. action = getattr(actionsFSMlist, check_state)
  149. actionPlayer(action)
  150. #print(own['stateTimer'], getattr(action, 'fef'))
  151. if own['stateTimer'] > getattr(action, 'fef'):
  152. newState = getattr(action, 'force_exit')
  153. check_state = 'reg_sit'
  154. if aState == check_state:
  155. action = getattr(actionsFSMlist, check_state)
  156. #if own['stateTimer'] < 19:
  157. if own['stateTimer'] < getattr(action, 'intro_frames'):
  158. actionPlayer(getattr(actionsFSMlist, 'intro'))
  159. else:
  160. actionPlayer(action)
  161. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_sit)
  162. #-----------------------
  163. check_state = 'reg_walk'
  164. if aState == check_state:
  165. action = getattr(actionsFSMlist, check_state)
  166. if own['l_aState'] == 'reg_walkFast':
  167. frame = get_frame(actionsFSMlist.reg_walkFast)
  168. actionPlayer(action)
  169. set_frame(actionsFSMlist.reg_walk, frame)
  170. else:
  171. frame = actionPlayer(action)
  172. newState = check_exit(aState, rA, timer, action)
  173. #-----------------------
  174. check_state = 'reg_walkFast'
  175. if aState == check_state:
  176. action = getattr(actionsFSMlist, check_state)
  177. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_walkFast)
  178. if own['l_aState'] == 'reg_walk':
  179. frame = get_frame(actionsFSMlist.reg_walk)
  180. actionPlayer(action)
  181. set_frame(actionsFSMlist.reg_walkFast, frame)
  182. else:
  183. actionPlayer(action)
  184. #print(frame)
  185. check_state = 'reg_onboard'
  186. if aState == check_state:
  187. action = getattr(actionsFSMlist, check_state)
  188. actionPlayer(action)
  189. print('checking onbaord state')
  190. #if own['stateTimer'] > 10:
  191. #newState = check_exit(aState, rA, timer, actionsFSMlist.reg_onboard)
  192. if own['stateTimer'] > getattr(action, 'fef'):
  193. newState = getattr(action, 'force_exit')
  194. check_state = 'reg_offboard'
  195. if aState == check_state:
  196. action = getattr(actionsFSMlist, check_state)
  197. actionPlayer(action)
  198. if own['stateTimer'] > 20:
  199. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_offboard)
  200. check_state = 'reg_roll'
  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_turnLeft'
  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_turnRight'
  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_opos'
  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_nopos'
  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_pump'
  226. if aState == check_state:
  227. action = getattr(actionsFSMlist, check_state)
  228. actionPlayer(action)
  229. newState = check_exit(aState, rA, timer, action)
  230. check_state = 'reg_pump_left'
  231. if aState == check_state:
  232. action = getattr(actionsFSMlist, check_state)
  233. actionPlayer(action)
  234. newState = check_exit(aState, rA, timer, action)
  235. check_state = 'reg_pump_right'
  236. if aState == check_state:
  237. action = getattr(actionsFSMlist, check_state)
  238. actionPlayer(action)
  239. newState = check_exit(aState, rA, timer, action)
  240. check_state = 'reg_push'
  241. if aState == check_state:
  242. action = getattr(actionsFSMlist, check_state)
  243. actionPlayer(action)
  244. if own['stateTimer'] > 70:
  245. newState = 'reg_roll'
  246. check_state = 'reg_push_goof'
  247. if aState == check_state:
  248. action = getattr(actionsFSMlist, check_state)
  249. actionPlayer(action)
  250. if own['stateTimer'] > 70:
  251. newState = 'reg_roll'
  252. check_state = 'reg_powerslide'
  253. if aState == check_state:
  254. action = getattr(actionsFSMlist, check_state)
  255. # if own['stateTimer'] < 20:
  256. # actionPlayer(actionsFSMlist.reg_powerslide_in)
  257. if own['stateTimer'] < getattr(action, 'intro_frames'):
  258. intro = getattr(action, 'intro')
  259. actionPlayer(getattr(actionsFSMlist, intro))
  260. else:
  261. actionPlayer(action)
  262. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_powerslide)
  263. check_state = 'reg_fs_powerslide'
  264. if aState == check_state:
  265. action = getattr(actionsFSMlist, check_state)
  266. # if own['stateTimer'] < 20:
  267. # actionPlayer(actionsFSMlist.reg_fs_powerslide_in)
  268. if own['stateTimer'] < getattr(action, 'intro_frames'):
  269. intro = getattr(action, 'intro')
  270. actionPlayer(getattr(actionsFSMlist, intro))
  271. else:
  272. actionPlayer(action)
  273. newState = check_exit(aState, rA, timer, actionsFSMlist.reg_fs_powerslide)
  274. check_state = 'reg_brfoot'
  275. if aState == check_state:
  276. action = getattr(actionsFSMlist, check_state)
  277. actionPlayer(action)
  278. if own['stateTimer'] > getattr(action, 'fef'):
  279. newState = getattr(action, 'force_exit')
  280. check_state = 'reg_frfoot'
  281. if aState == check_state:
  282. action = getattr(actionsFSMlist, check_state)
  283. actionPlayer(action)
  284. if own['stateTimer'] > getattr(action, 'fef'):
  285. newState = getattr(action, 'force_exit')
  286. check_state = 'reg_blfoot'
  287. if aState == check_state:
  288. action = getattr(actionsFSMlist, check_state)
  289. actionPlayer(action)
  290. if own['stateTimer'] > getattr(action, 'fef'):
  291. newState = getattr(action, 'force_exit')
  292. check_state = 'reg_flfoot'
  293. if aState == check_state:
  294. action = getattr(actionsFSMlist, check_state)
  295. actionPlayer(action)
  296. if own['stateTimer'] > getattr(action, 'fef'):
  297. newState = getattr(action, 'force_exit')
  298. check_state = 'reg_manual'
  299. if aState == check_state:
  300. action = getattr(actionsFSMlist, check_state)
  301. actionPlayer(action)
  302. newState = check_exit(aState, rA, timer, action)
  303. check_state = 'reg_nmanual'
  304. if aState == check_state:
  305. action = getattr(actionsFSMlist, check_state)
  306. actionPlayer(action)
  307. newState = check_exit(aState, rA, timer, action)
  308. check_state = 'reg_land'
  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_landL'
  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_landLb'
  321. if aState == check_state:
  322. action = getattr(actionsFSMlist, check_state)
  323. actionPlayer(action)
  324. if own['stateTimer'] > getattr(action, 'fef'):
  325. newState = getattr(action, 'force_exit')
  326. check_state = 'reg_landR'
  327. if aState == check_state:
  328. action = getattr(actionsFSMlist, check_state)
  329. actionPlayer(action)
  330. if own['stateTimer'] > getattr(action, 'fef'):
  331. newState = getattr(action, 'force_exit')
  332. check_state = 'reg_landRb'
  333. if aState == check_state:
  334. action = getattr(actionsFSMlist, check_state)
  335. actionPlayer(action)
  336. if own['stateTimer'] > getattr(action, 'fef'):
  337. newState = getattr(action, 'force_exit')
  338. check_state = 'reg_air'
  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_air_nb'
  344. if aState == check_state:
  345. action = getattr(actionsFSMlist, check_state)
  346. actionPlayer(action)
  347. newState = check_exit(aState, rA, timer, action)
  348. check_state = 'reg_air_nose'
  349. if aState == check_state:
  350. action = getattr(actionsFSMlist, check_state)
  351. actionPlayer(action)
  352. newState = check_exit(aState, rA, timer, action)
  353. check_state = 'reg_air_tail'
  354. if aState == check_state:
  355. action = getattr(actionsFSMlist, check_state)
  356. actionPlayer(action)
  357. newState = check_exit(aState, rA, timer, action)
  358. check_state = 'reg_ollie'
  359. if aState == check_state:
  360. action = getattr(actionsFSMlist, check_state)
  361. actionPlayer(action)
  362. if own['stateTimer'] > getattr(action, 'fef'):
  363. newState = getattr(action, 'force_exit')
  364. check_state = 'reg_kickflip'
  365. if aState == check_state:
  366. action = getattr(actionsFSMlist, check_state)
  367. actionPlayer(action)
  368. if own['stateTimer'] > getattr(action, 'fef'):
  369. newState = getattr(action, 'force_exit')
  370. check_state = 'reg_heelflip'
  371. if aState == check_state:
  372. action = getattr(actionsFSMlist, check_state)
  373. actionPlayer(action)
  374. if own['stateTimer'] > getattr(action, 'fef'):
  375. newState = getattr(action, 'force_exit')
  376. check_state = 'reg_shuvit'
  377. if aState == check_state:
  378. action = getattr(actionsFSMlist, check_state)
  379. actionPlayer(action)
  380. if own['stateTimer'] > getattr(action, 'fef'):
  381. newState = getattr(action, 'force_exit')
  382. check_state = 'reg_shuvit360'
  383. if aState == check_state:
  384. action = getattr(actionsFSMlist, check_state)
  385. actionPlayer(action)
  386. if own['stateTimer'] > getattr(action, 'fef'):
  387. newState = getattr(action, 'force_exit')
  388. check_state = 'reg_fsshuvit'
  389. if aState == check_state:
  390. action = getattr(actionsFSMlist, check_state)
  391. actionPlayer(action)
  392. if own['stateTimer'] > getattr(action, 'fef'):
  393. newState = getattr(action, 'force_exit')
  394. check_state = 'reg_fsshuvit360'
  395. if aState == check_state:
  396. action = getattr(actionsFSMlist, check_state)
  397. actionPlayer(action)
  398. if own['stateTimer'] > getattr(action, 'fef'):
  399. newState = getattr(action, 'force_exit')
  400. #-nollie
  401. check_state = 'reg_nollie'
  402. if aState == check_state:
  403. action = getattr(actionsFSMlist, check_state)
  404. actionPlayer(action)
  405. if own['stateTimer'] > getattr(action, 'fef'):
  406. newState = getattr(action, 'force_exit')
  407. check_state = 'reg_nollie_kickflip'
  408. if aState == check_state:
  409. action = getattr(actionsFSMlist, check_state)
  410. actionPlayer(action)
  411. if own['stateTimer'] > getattr(action, 'fef'):
  412. newState = getattr(action, 'force_exit')
  413. check_state = 'reg_nollie_heelflip'
  414. if aState == check_state:
  415. action = getattr(actionsFSMlist, check_state)
  416. actionPlayer(action)
  417. if own['stateTimer'] > getattr(action, 'fef'):
  418. newState = getattr(action, 'force_exit')
  419. check_state = 'reg_nollie_shuvit'
  420. if aState == check_state:
  421. action = getattr(actionsFSMlist, check_state)
  422. actionPlayer(action)
  423. if own['stateTimer'] > getattr(action, 'fef'):
  424. newState = getattr(action, 'force_exit')
  425. check_state = 'reg_nollie_fsshuvit'
  426. if aState == check_state:
  427. action = getattr(actionsFSMlist, check_state)
  428. actionPlayer(action)
  429. if own['stateTimer'] > getattr(action, 'fef'):
  430. newState = getattr(action, 'force_exit')
  431. check_state = 'reg_nollie_shuvit360'
  432. if aState == check_state:
  433. action = getattr(actionsFSMlist, check_state)
  434. actionPlayer(action)
  435. if own['stateTimer'] > getattr(action, 'fef'):
  436. newState = getattr(action, 'force_exit')
  437. check_state = 'reg_nollie_fsshuvit_360'
  438. if aState == check_state:
  439. action = getattr(actionsFSMlist, check_state)
  440. actionPlayer(action)
  441. if own['stateTimer'] > getattr(action, 'fef'):
  442. newState = getattr(action, 'force_exit')
  443. check_state = 'reg_hardflip'
  444. if aState == check_state:
  445. action = getattr(actionsFSMlist, check_state)
  446. actionPlayer(action)
  447. if own['stateTimer'] > getattr(action, 'fef'):
  448. newState = getattr(action, 'force_exit')
  449. check_state = 'reg_inward_heelflip'
  450. if aState == check_state:
  451. action = getattr(actionsFSMlist, check_state)
  452. actionPlayer(action)
  453. if own['stateTimer'] > getattr(action, 'fef'):
  454. newState = getattr(action, 'force_exit')
  455. check_state = 'reg_varial_kickflip'
  456. if aState == check_state:
  457. action = getattr(actionsFSMlist, check_state)
  458. actionPlayer(action)
  459. if own['stateTimer'] > getattr(action, 'fef'):
  460. newState = getattr(action, 'force_exit')
  461. check_state = 'reg_varial_heelflip'
  462. if aState == check_state:
  463. action = getattr(actionsFSMlist, check_state)
  464. actionPlayer(action)
  465. if own['stateTimer'] > getattr(action, 'fef'):
  466. newState = getattr(action, 'force_exit')
  467. #-----------
  468. #grinds-----
  469. #-----------
  470. check_state = 'reg_5050'
  471. if aState == check_state:
  472. action = getattr(actionsFSMlist, check_state)
  473. actionPlayer(action)
  474. newState = check_exit(aState, rA, timer, action)
  475. check_state = 'reg_bsboard'
  476. if aState == check_state:
  477. action = getattr(actionsFSMlist, check_state)
  478. actionPlayer(action)
  479. newState = check_exit(aState, rA, timer, action)
  480. check_state = 'reg_fsboard'
  481. if aState == check_state:
  482. action = getattr(actionsFSMlist, check_state)
  483. actionPlayer(action)
  484. newState = check_exit(aState, rA, timer, action)
  485. check_state = 'reg_tailg'
  486. if aState == check_state:
  487. action = getattr(actionsFSMlist, check_state)
  488. actionPlayer(action)
  489. newState = check_exit(aState, rA, timer, action)
  490. check_state = 'reg_tailgr'
  491. if aState == check_state:
  492. action = getattr(actionsFSMlist, check_state)
  493. actionPlayer(action)
  494. newState = check_exit(aState, rA, timer, action)
  495. check_state = 'reg_tailgl'
  496. if aState == check_state:
  497. action = getattr(actionsFSMlist, check_state)
  498. actionPlayer(action)
  499. newState = check_exit(aState, rA, timer, action)
  500. check_state = 'reg_noseg'
  501. if aState == check_state:
  502. action = getattr(actionsFSMlist, check_state)
  503. actionPlayer(action)
  504. newState = check_exit(aState, rA, timer, action)
  505. check_state = 'reg_nosegr'
  506. if aState == check_state:
  507. action = getattr(actionsFSMlist, check_state)
  508. actionPlayer(action)
  509. newState = check_exit(aState, rA, timer, action)
  510. check_state = 'reg_nosegl'
  511. if aState == check_state:
  512. action = getattr(actionsFSMlist, check_state)
  513. actionPlayer(action)
  514. newState = check_exit(aState, rA, timer, action)
  515. check_state = 'reg_tailslide'
  516. if aState == check_state:
  517. action = getattr(actionsFSMlist, check_state)
  518. actionPlayer(action)
  519. newState = check_exit(aState, rA, timer, action)
  520. check_state = 'reg_noseslide'
  521. if aState == check_state:
  522. action = getattr(actionsFSMlist, check_state)
  523. actionPlayer(action)
  524. newState = check_exit(aState, rA, timer, action)
  525. #-----------
  526. #grabs------
  527. #-----------
  528. check_state = 'frontside_grab'
  529. if aState == check_state:
  530. action = getattr(actionsFSMlist, check_state)
  531. if own['stateTimer'] < getattr(action, 'intro_frames'):
  532. intro = getattr(action, 'intro')
  533. actionPlayer(getattr(actionsFSMlist, intro))
  534. else:
  535. actionPlayer(action)
  536. newState = check_exit(aState, rA, timer, action)
  537. check_state = 'backside_grab'
  538. if aState == check_state:
  539. action = getattr(actionsFSMlist, check_state)
  540. if own['stateTimer'] < getattr(action, 'intro_frames'):
  541. intro = getattr(action, 'intro')
  542. actionPlayer(getattr(actionsFSMlist, intro))
  543. else:
  544. actionPlayer(action)
  545. newState = check_exit(aState, rA, timer, action)
  546. check_state = 'frontside_nose_grab'
  547. if aState == check_state:
  548. action = getattr(actionsFSMlist, check_state)
  549. if own['stateTimer'] < getattr(action, 'intro_frames'):
  550. intro = getattr(action, 'intro')
  551. actionPlayer(getattr(actionsFSMlist, intro))
  552. else:
  553. actionPlayer(action)
  554. newState = check_exit(aState, rA, timer, action)
  555. check_state = 'backside_nose_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 = 'frontside_tail_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 = 'backside_tail_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 = 'reg_ollie_north'
  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 = 'reg_ollie_south'
  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 = 'reg_judo'
  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_frigid'
  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_fsonefoot'
  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_onefoot'
  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 = 'revert1'
  637. if aState == check_state:
  638. action = getattr(actionsFSMlist, check_state)
  639. actionPlayer(action)
  640. if own['stateTimer'] > getattr(action, 'fef'):
  641. newState = getattr(action, 'force_exit')
  642. check_state = 'revert2'
  643. if aState == check_state:
  644. action = getattr(actionsFSMlist, check_state)
  645. actionPlayer(action)
  646. if own['stateTimer'] > getattr(action, 'fef'):
  647. newState = getattr(action, 'force_exit')
  648. check_state = 'fak_revert1'
  649. if aState == check_state:
  650. action = getattr(actionsFSMlist, check_state)
  651. actionPlayer(action)
  652. if own['stateTimer'] > getattr(action, 'fef'):
  653. newState = getattr(action, 'force_exit')
  654. check_state = 'fak_revert2'
  655. if aState == check_state:
  656. action = getattr(actionsFSMlist, check_state)
  657. actionPlayer(action)
  658. if own['stateTimer'] > getattr(action, 'fef'):
  659. newState = getattr(action, 'force_exit')
  660. check_state = 'revert3'
  661. if aState == check_state:
  662. action = getattr(actionsFSMlist, check_state)
  663. actionPlayer(action)
  664. if own['stateTimer'] > getattr(action, 'fef'):
  665. newState = getattr(action, 'force_exit')
  666. check_state = 'revert4'
  667. if aState == check_state:
  668. action = getattr(actionsFSMlist, check_state)
  669. actionPlayer(action)
  670. if own['stateTimer'] > getattr(action, 'fef'):
  671. newState = getattr(action, 'force_exit')
  672. check_state = 'fak_idle'
  673. if aState == check_state:
  674. action = getattr(actionsFSMlist, check_state)
  675. actionPlayer(action)
  676. newState = check_exit(aState, rA, timer, action)
  677. check_state = 'fak_idle2'
  678. if aState == check_state:
  679. action = getattr(actionsFSMlist, check_state)
  680. actionPlayer(action)
  681. newState = check_exit(aState, rA, timer, action)
  682. check_state = 'fak_idle3'
  683. if aState == check_state:
  684. action = getattr(actionsFSMlist, check_state)
  685. actionPlayer(action)
  686. newState = check_exit(aState, rA, timer, action)
  687. check_state = 'fak_idle4'
  688. if aState == check_state:
  689. action = getattr(actionsFSMlist, check_state)
  690. actionPlayer(action)
  691. newState = check_exit(aState, rA, timer, action)
  692. check_state = 'fak_idle5'
  693. if aState == check_state:
  694. action = getattr(actionsFSMlist, check_state)
  695. actionPlayer(action)
  696. newState = check_exit(aState, rA, timer, action)
  697. check_state = 'fak_idle5'
  698. if aState == check_state:
  699. action = getattr(actionsFSMlist, check_state)
  700. actionPlayer(action)
  701. newState = check_exit(aState, rA, timer, action)
  702. check_state = 'fak_idle6'
  703. if aState == check_state:
  704. action = getattr(actionsFSMlist, check_state)
  705. actionPlayer(action)
  706. newState = check_exit(aState, rA, timer, action)
  707. check_state = 'fak_jump'
  708. if aState == check_state:
  709. action = getattr(actionsFSMlist, check_state)
  710. actionPlayer(action)
  711. if own['stateTimer'] > getattr(action, 'fef'):
  712. newState = check_exit(aState, rA, timer, action)
  713. check_state = 'fak_walk_air'
  714. if aState == check_state:
  715. action = getattr(actionsFSMlist, check_state)
  716. actionPlayer(action)
  717. if aState != rA:
  718. newState = getattr(action, 'exits')[0]
  719. check_state = 'fak_walk_air_out'
  720. if aState == check_state:
  721. action = getattr(actionsFSMlist, check_state)
  722. actionPlayer(action)
  723. #print(own['stateTimer'], getattr(action, 'fef'))
  724. if own['stateTimer'] > getattr(action, 'fef'):
  725. newState = getattr(action, 'force_exit')
  726. check_state = 'fak_sit'
  727. if aState == check_state:
  728. action = getattr(actionsFSMlist, check_state)
  729. #if own['stateTimer'] < 19:
  730. if own['stateTimer'] < getattr(action, 'intro_frames'):
  731. actionPlayer(getattr(actionsFSMlist, 'intro'))
  732. else:
  733. actionPlayer(action)
  734. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_sit)
  735. #-----------------------
  736. check_state = 'fak_walk'
  737. if aState == check_state:
  738. action = getattr(actionsFSMlist, check_state)
  739. if own['l_aState'] == 'fak_walkFast':
  740. frame = get_frame(actionsFSMlist.fak_walkFast)
  741. actionPlayer(action)
  742. set_frame(actionsFSMlist.fak_walk, frame)
  743. else:
  744. frame = actionPlayer(action)
  745. newState = check_exit(aState, rA, timer, action)
  746. #-----------------------
  747. check_state = 'fak_walkFast'
  748. if aState == check_state:
  749. action = getattr(actionsFSMlist, check_state)
  750. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_walkFast)
  751. if own['l_aState'] == 'fak_walk':
  752. frame = get_frame(actionsFSMlist.fak_walk)
  753. actionPlayer(action)
  754. set_frame(actionsFSMlist.fak_walkFast, frame)
  755. else:
  756. actionPlayer(action)
  757. #print(frame)
  758. check_state = 'fak_onboard'
  759. if aState == check_state:
  760. action = getattr(actionsFSMlist, check_state)
  761. actionPlayer(action)
  762. print('checking onbaord state')
  763. #if own['stateTimer'] > 10:
  764. #newState = check_exit(aState, rA, timer, actionsFSMlist.fak_onboard)
  765. if own['stateTimer'] > getattr(action, 'fef'):
  766. newState = getattr(action, 'force_exit')
  767. check_state = 'fak_offboard'
  768. if aState == check_state:
  769. action = getattr(actionsFSMlist, check_state)
  770. actionPlayer(action)
  771. if own['stateTimer'] > 20:
  772. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_offboard)
  773. check_state = 'fak_roll'
  774. if aState == check_state:
  775. action = getattr(actionsFSMlist, check_state)
  776. actionPlayer(action)
  777. newState = check_exit(aState, rA, timer, action)
  778. check_state = 'fak_turnLeft'
  779. if aState == check_state:
  780. action = getattr(actionsFSMlist, check_state)
  781. actionPlayer(action)
  782. newState = check_exit(aState, rA, timer, action)
  783. check_state = 'fak_turnRight'
  784. if aState == check_state:
  785. action = getattr(actionsFSMlist, check_state)
  786. actionPlayer(action)
  787. newState = check_exit(aState, rA, timer, action)
  788. check_state = 'fak_opos'
  789. if aState == check_state:
  790. action = getattr(actionsFSMlist, check_state)
  791. actionPlayer(action)
  792. newState = check_exit(aState, rA, timer, action)
  793. check_state = 'fak_nopos'
  794. if aState == check_state:
  795. action = getattr(actionsFSMlist, check_state)
  796. actionPlayer(action)
  797. newState = check_exit(aState, rA, timer, action)
  798. check_state = 'fak_pump'
  799. if aState == check_state:
  800. action = getattr(actionsFSMlist, check_state)
  801. actionPlayer(action)
  802. newState = check_exit(aState, rA, timer, action)
  803. check_state = 'fak_pump_left'
  804. if aState == check_state:
  805. action = getattr(actionsFSMlist, check_state)
  806. actionPlayer(action)
  807. newState = check_exit(aState, rA, timer, action)
  808. check_state = 'fak_pump_right'
  809. if aState == check_state:
  810. action = getattr(actionsFSMlist, check_state)
  811. actionPlayer(action)
  812. newState = check_exit(aState, rA, timer, action)
  813. check_state = 'fak_push'
  814. if aState == check_state:
  815. action = getattr(actionsFSMlist, check_state)
  816. actionPlayer(action)
  817. if own['stateTimer'] > 70:
  818. newState = 'fak_roll'
  819. check_state = 'fak_push_goof'
  820. if aState == check_state:
  821. action = getattr(actionsFSMlist, check_state)
  822. actionPlayer(action)
  823. if own['stateTimer'] > 70:
  824. newState = 'fak_roll'
  825. check_state = 'fak_powerslide'
  826. if aState == check_state:
  827. action = getattr(actionsFSMlist, check_state)
  828. # if own['stateTimer'] < 20:
  829. # actionPlayer(actionsFSMlist.fak_powerslide_in)
  830. if own['stateTimer'] < getattr(action, 'intro_frames'):
  831. intro = getattr(action, 'intro')
  832. actionPlayer(getattr(actionsFSMlist, intro))
  833. else:
  834. actionPlayer(action)
  835. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_powerslide)
  836. check_state = 'fak_fs_powerslide'
  837. if aState == check_state:
  838. action = getattr(actionsFSMlist, check_state)
  839. # if own['stateTimer'] < 20:
  840. # actionPlayer(actionsFSMlist.fak_fs_powerslide_in)
  841. if own['stateTimer'] < getattr(action, 'intro_frames'):
  842. intro = getattr(action, 'intro')
  843. actionPlayer(getattr(actionsFSMlist, intro))
  844. else:
  845. actionPlayer(action)
  846. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_fs_powerslide)
  847. check_state = 'fak_brfoot'
  848. if aState == check_state:
  849. action = getattr(actionsFSMlist, check_state)
  850. actionPlayer(action)
  851. if own['stateTimer'] > getattr(action, 'fef'):
  852. newState = getattr(action, 'force_exit')
  853. check_state = 'fak_frfoot'
  854. if aState == check_state:
  855. action = getattr(actionsFSMlist, check_state)
  856. actionPlayer(action)
  857. if own['stateTimer'] > getattr(action, 'fef'):
  858. newState = getattr(action, 'force_exit')
  859. check_state = 'fak_blfoot'
  860. if aState == check_state:
  861. action = getattr(actionsFSMlist, check_state)
  862. actionPlayer(action)
  863. if own['stateTimer'] > getattr(action, 'fef'):
  864. newState = getattr(action, 'force_exit')
  865. check_state = 'fak_flfoot'
  866. if aState == check_state:
  867. action = getattr(actionsFSMlist, check_state)
  868. actionPlayer(action)
  869. if own['stateTimer'] > getattr(action, 'fef'):
  870. newState = getattr(action, 'force_exit')
  871. check_state = 'fak_manual'
  872. if aState == check_state:
  873. action = getattr(actionsFSMlist, check_state)
  874. actionPlayer(action)
  875. newState = check_exit(aState, rA, timer, action)
  876. check_state = 'fak_nmanual'
  877. if aState == check_state:
  878. action = getattr(actionsFSMlist, check_state)
  879. actionPlayer(action)
  880. newState = check_exit(aState, rA, timer, action)
  881. check_state = 'fak_land'
  882. if aState == check_state:
  883. action = getattr(actionsFSMlist, check_state)
  884. actionPlayer(action)
  885. if own['stateTimer'] > getattr(action, 'fef'):
  886. newState = getattr(action, 'force_exit')
  887. check_state = 'fak_landL'
  888. if aState == check_state:
  889. action = getattr(actionsFSMlist, check_state)
  890. actionPlayer(action)
  891. if own['stateTimer'] > getattr(action, 'fef'):
  892. newState = getattr(action, 'force_exit')
  893. check_state = 'fak_landLb'
  894. if aState == check_state:
  895. action = getattr(actionsFSMlist, check_state)
  896. actionPlayer(action)
  897. if own['stateTimer'] > getattr(action, 'fef'):
  898. newState = getattr(action, 'force_exit')
  899. check_state = 'fak_landR'
  900. if aState == check_state:
  901. action = getattr(actionsFSMlist, check_state)
  902. actionPlayer(action)
  903. if own['stateTimer'] > getattr(action, 'fef'):
  904. newState = getattr(action, 'force_exit')
  905. check_state = 'fak_landRb'
  906. if aState == check_state:
  907. action = getattr(actionsFSMlist, check_state)
  908. actionPlayer(action)
  909. if own['stateTimer'] > getattr(action, 'fef'):
  910. newState = getattr(action, 'force_exit')
  911. check_state = 'fak_air'
  912. if aState == check_state:
  913. action = getattr(actionsFSMlist, check_state)
  914. actionPlayer(action)
  915. newState = check_exit(aState, rA, timer, action)
  916. check_state = 'fak_air_nb'
  917. if aState == check_state:
  918. action = getattr(actionsFSMlist, check_state)
  919. actionPlayer(action)
  920. newState = check_exit(aState, rA, timer, action)
  921. check_state = 'fak_air_nose'
  922. if aState == check_state:
  923. action = getattr(actionsFSMlist, check_state)
  924. actionPlayer(action)
  925. newState = check_exit(aState, rA, timer, action)
  926. check_state = 'fak_air_tail'
  927. if aState == check_state:
  928. action = getattr(actionsFSMlist, check_state)
  929. actionPlayer(action)
  930. newState = check_exit(aState, rA, timer, action)
  931. check_state = 'fak_ollie'
  932. if aState == check_state:
  933. action = getattr(actionsFSMlist, check_state)
  934. actionPlayer(action)
  935. if own['stateTimer'] > getattr(action, 'fef'):
  936. newState = getattr(action, 'force_exit')
  937. check_state = 'fak_kickflip'
  938. if aState == check_state:
  939. action = getattr(actionsFSMlist, check_state)
  940. actionPlayer(action)
  941. if own['stateTimer'] > getattr(action, 'fef'):
  942. newState = getattr(action, 'force_exit')
  943. check_state = 'fak_heelflip'
  944. if aState == check_state:
  945. action = getattr(actionsFSMlist, check_state)
  946. actionPlayer(action)
  947. if own['stateTimer'] > getattr(action, 'fef'):
  948. newState = getattr(action, 'force_exit')
  949. check_state = 'fak_shuvit'
  950. if aState == check_state:
  951. action = getattr(actionsFSMlist, check_state)
  952. actionPlayer(action)
  953. if own['stateTimer'] > getattr(action, 'fef'):
  954. newState = getattr(action, 'force_exit')
  955. check_state = 'fak_shuvit360'
  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_fsshuvit'
  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_fsshuvit360'
  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. #-nollie
  974. check_state = 'fak_nollie'
  975. if aState == check_state:
  976. action = getattr(actionsFSMlist, check_state)
  977. actionPlayer(action)
  978. if own['stateTimer'] > getattr(action, 'fef'):
  979. newState = getattr(action, 'force_exit')
  980. check_state = 'fak_nollie_kickflip'
  981. if aState == check_state:
  982. action = getattr(actionsFSMlist, check_state)
  983. actionPlayer(action)
  984. if own['stateTimer'] > getattr(action, 'fef'):
  985. newState = getattr(action, 'force_exit')
  986. check_state = 'fak_nollie_heelflip'
  987. if aState == check_state:
  988. action = getattr(actionsFSMlist, check_state)
  989. actionPlayer(action)
  990. if own['stateTimer'] > getattr(action, 'fef'):
  991. newState = getattr(action, 'force_exit')
  992. check_state = 'fak_nollie_shuvit'
  993. if aState == check_state:
  994. action = getattr(actionsFSMlist, check_state)
  995. actionPlayer(action)
  996. if own['stateTimer'] > getattr(action, 'fef'):
  997. newState = getattr(action, 'force_exit')
  998. check_state = 'fak_nollie_fsshuvit'
  999. if aState == check_state:
  1000. action = getattr(actionsFSMlist, check_state)
  1001. actionPlayer(action)
  1002. if own['stateTimer'] > getattr(action, 'fef'):
  1003. newState = getattr(action, 'force_exit')
  1004. check_state = 'fak_nollie_shuvit360'
  1005. if aState == check_state:
  1006. action = getattr(actionsFSMlist, check_state)
  1007. actionPlayer(action)
  1008. if own['stateTimer'] > getattr(action, 'fef'):
  1009. newState = getattr(action, 'force_exit')
  1010. check_state = 'fak_nollie_fsshuvit_360'
  1011. if aState == check_state:
  1012. action = getattr(actionsFSMlist, check_state)
  1013. actionPlayer(action)
  1014. if own['stateTimer'] > getattr(action, 'fef'):
  1015. newState = getattr(action, 'force_exit')
  1016. check_state = 'fak_hardflip'
  1017. if aState == check_state:
  1018. action = getattr(actionsFSMlist, check_state)
  1019. actionPlayer(action)
  1020. if own['stateTimer'] > getattr(action, 'fef'):
  1021. newState = getattr(action, 'force_exit')
  1022. check_state = 'fak_inward_heelflip'
  1023. if aState == check_state:
  1024. action = getattr(actionsFSMlist, check_state)
  1025. actionPlayer(action)
  1026. if own['stateTimer'] > getattr(action, 'fef'):
  1027. newState = getattr(action, 'force_exit')
  1028. check_state = 'fak_varial_kickflip'
  1029. if aState == check_state:
  1030. action = getattr(actionsFSMlist, check_state)
  1031. actionPlayer(action)
  1032. if own['stateTimer'] > getattr(action, 'fef'):
  1033. newState = getattr(action, 'force_exit')
  1034. check_state = 'fak_varial_heelflip'
  1035. if aState == check_state:
  1036. action = getattr(actionsFSMlist, check_state)
  1037. actionPlayer(action)
  1038. if own['stateTimer'] > getattr(action, 'fef'):
  1039. newState = getattr(action, 'force_exit')
  1040. #-----------
  1041. #grinds-----
  1042. #-----------
  1043. check_state = 'fak_5050'
  1044. if aState == check_state:
  1045. action = getattr(actionsFSMlist, check_state)
  1046. actionPlayer(action)
  1047. newState = check_exit(aState, rA, timer, action)
  1048. check_state = 'fak_bsboard'
  1049. if aState == check_state:
  1050. action = getattr(actionsFSMlist, check_state)
  1051. actionPlayer(action)
  1052. newState = check_exit(aState, rA, timer, action)
  1053. check_state = 'fak_fsboard'
  1054. if aState == check_state:
  1055. action = getattr(actionsFSMlist, check_state)
  1056. actionPlayer(action)
  1057. newState = check_exit(aState, rA, timer, action)
  1058. check_state = 'fak_tailg'
  1059. if aState == check_state:
  1060. action = getattr(actionsFSMlist, check_state)
  1061. actionPlayer(action)
  1062. newState = check_exit(aState, rA, timer, action)
  1063. check_state = 'fak_tailgr'
  1064. if aState == check_state:
  1065. action = getattr(actionsFSMlist, check_state)
  1066. actionPlayer(action)
  1067. newState = check_exit(aState, rA, timer, action)
  1068. check_state = 'fak_tailgl'
  1069. if aState == check_state:
  1070. action = getattr(actionsFSMlist, check_state)
  1071. actionPlayer(action)
  1072. newState = check_exit(aState, rA, timer, action)
  1073. check_state = 'fak_noseg'
  1074. if aState == check_state:
  1075. action = getattr(actionsFSMlist, check_state)
  1076. actionPlayer(action)
  1077. newState = check_exit(aState, rA, timer, action)
  1078. check_state = 'fak_nosegr'
  1079. if aState == check_state:
  1080. action = getattr(actionsFSMlist, check_state)
  1081. actionPlayer(action)
  1082. newState = check_exit(aState, rA, timer, action)
  1083. check_state = 'fak_nosegl'
  1084. if aState == check_state:
  1085. action = getattr(actionsFSMlist, check_state)
  1086. actionPlayer(action)
  1087. newState = check_exit(aState, rA, timer, action)
  1088. check_state = 'fak_tailslide'
  1089. if aState == check_state:
  1090. action = getattr(actionsFSMlist, check_state)
  1091. actionPlayer(action)
  1092. newState = check_exit(aState, rA, timer, action)
  1093. check_state = 'fak_noseslide'
  1094. if aState == check_state:
  1095. action = getattr(actionsFSMlist, check_state)
  1096. actionPlayer(action)
  1097. newState = check_exit(aState, rA, timer, action)
  1098. #-----------
  1099. #grabs------
  1100. #-----------
  1101. check_state = 'fak_frontside_grab'
  1102. if aState == check_state:
  1103. action = getattr(actionsFSMlist, check_state)
  1104. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1105. intro = getattr(action, 'intro')
  1106. actionPlayer(getattr(actionsFSMlist, intro))
  1107. else:
  1108. actionPlayer(action)
  1109. newState = check_exit(aState, rA, timer, action)
  1110. check_state = 'fak_backside_grab'
  1111. if aState == check_state:
  1112. action = getattr(actionsFSMlist, check_state)
  1113. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1114. intro = getattr(action, 'intro')
  1115. actionPlayer(getattr(actionsFSMlist, intro))
  1116. else:
  1117. actionPlayer(action)
  1118. newState = check_exit(aState, rA, timer, action)
  1119. check_state = 'fak_frontside_nose_grab'
  1120. if aState == check_state:
  1121. action = getattr(actionsFSMlist, check_state)
  1122. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1123. intro = getattr(action, 'intro')
  1124. actionPlayer(getattr(actionsFSMlist, intro))
  1125. else:
  1126. actionPlayer(action)
  1127. newState = check_exit(aState, rA, timer, action)
  1128. check_state = 'fak_backside_nose_grab'
  1129. if aState == check_state:
  1130. action = getattr(actionsFSMlist, check_state)
  1131. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1132. intro = getattr(action, 'intro')
  1133. actionPlayer(getattr(actionsFSMlist, intro))
  1134. else:
  1135. actionPlayer(action)
  1136. newState = check_exit(aState, rA, timer, action)
  1137. check_state = 'fak_frontside_tail_grab'
  1138. if aState == check_state:
  1139. action = getattr(actionsFSMlist, check_state)
  1140. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1141. intro = getattr(action, 'intro')
  1142. actionPlayer(getattr(actionsFSMlist, intro))
  1143. else:
  1144. actionPlayer(action)
  1145. newState = check_exit(aState, rA, timer, action)
  1146. check_state = 'fak_backside_tail_grab'
  1147. if aState == check_state:
  1148. action = getattr(actionsFSMlist, check_state)
  1149. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1150. intro = getattr(action, 'intro')
  1151. actionPlayer(getattr(actionsFSMlist, intro))
  1152. else:
  1153. actionPlayer(action)
  1154. newState = check_exit(aState, rA, timer, action)
  1155. check_state = 'fak_ollie_north'
  1156. if aState == check_state:
  1157. action = getattr(actionsFSMlist, check_state)
  1158. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1159. intro = getattr(action, 'intro')
  1160. actionPlayer(getattr(actionsFSMlist, intro))
  1161. else:
  1162. actionPlayer(action)
  1163. newState = check_exit(aState, rA, timer, action)
  1164. check_state = 'fak_ollie_south'
  1165. if aState == check_state:
  1166. action = getattr(actionsFSMlist, check_state)
  1167. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1168. intro = getattr(action, 'intro')
  1169. actionPlayer(getattr(actionsFSMlist, intro))
  1170. else:
  1171. actionPlayer(action)
  1172. newState = check_exit(aState, rA, timer, action)
  1173. check_state = 'fak_judo'
  1174. if aState == check_state:
  1175. action = getattr(actionsFSMlist, check_state)
  1176. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1177. intro = getattr(action, 'intro')
  1178. actionPlayer(getattr(actionsFSMlist, intro))
  1179. else:
  1180. actionPlayer(action)
  1181. newState = check_exit(aState, rA, timer, action)
  1182. check_state = 'fak_frigid'
  1183. if aState == check_state:
  1184. action = getattr(actionsFSMlist, check_state)
  1185. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1186. intro = getattr(action, 'intro')
  1187. actionPlayer(getattr(actionsFSMlist, intro))
  1188. else:
  1189. actionPlayer(action)
  1190. newState = check_exit(aState, rA, timer, action)
  1191. check_state = 'fak_fsonefoot'
  1192. if aState == check_state:
  1193. action = getattr(actionsFSMlist, check_state)
  1194. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1195. intro = getattr(action, 'intro')
  1196. actionPlayer(getattr(actionsFSMlist, intro))
  1197. else:
  1198. actionPlayer(action)
  1199. newState = check_exit(aState, rA, timer, action)
  1200. check_state = 'fak_onefoot'
  1201. if aState == check_state:
  1202. action = getattr(actionsFSMlist, check_state)
  1203. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1204. intro = getattr(action, 'intro')
  1205. actionPlayer(getattr(actionsFSMlist, intro))
  1206. else:
  1207. actionPlayer(action)
  1208. newState = check_exit(aState, rA, timer, action)
  1209. #-----------------------
  1210. #own['aState'] = aState
  1211. if newState != '':
  1212. own['aState'] = newState
  1213. #print(own['l_aState'], '----l_aState', own['aState'])
  1214. own['l_aState'] = og_state
  1215. own['l_actionState'] = og_state
  1216. #own['l_aState'] = newState
  1217. print(own['l_aState'], '----l_aState', own['aState'], 'rA', rA)
  1218. state_timer(own)