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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  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 = 'reg_airwalk'
  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_wall_r'
  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_wall_l'
  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 = 'revert1'
  664. if aState == check_state:
  665. action = getattr(actionsFSMlist, check_state)
  666. actionPlayer(action)
  667. if own['stateTimer'] > getattr(action, 'fef'):
  668. newState = getattr(action, 'force_exit')
  669. check_state = 'revert2'
  670. if aState == check_state:
  671. action = getattr(actionsFSMlist, check_state)
  672. actionPlayer(action)
  673. if own['stateTimer'] > getattr(action, 'fef'):
  674. newState = getattr(action, 'force_exit')
  675. check_state = 'fak_revert1'
  676. if aState == check_state:
  677. action = getattr(actionsFSMlist, check_state)
  678. actionPlayer(action)
  679. if own['stateTimer'] > getattr(action, 'fef'):
  680. newState = getattr(action, 'force_exit')
  681. check_state = 'fak_revert2'
  682. if aState == check_state:
  683. action = getattr(actionsFSMlist, check_state)
  684. actionPlayer(action)
  685. if own['stateTimer'] > getattr(action, 'fef'):
  686. newState = getattr(action, 'force_exit')
  687. check_state = 'revert3'
  688. if aState == check_state:
  689. action = getattr(actionsFSMlist, check_state)
  690. actionPlayer(action)
  691. if own['stateTimer'] > getattr(action, 'fef'):
  692. newState = getattr(action, 'force_exit')
  693. check_state = 'revert4'
  694. if aState == check_state:
  695. action = getattr(actionsFSMlist, check_state)
  696. actionPlayer(action)
  697. if own['stateTimer'] > getattr(action, 'fef'):
  698. newState = getattr(action, 'force_exit')
  699. check_state = 'fak_idle'
  700. if aState == check_state:
  701. action = getattr(actionsFSMlist, check_state)
  702. actionPlayer(action)
  703. newState = check_exit(aState, rA, timer, action)
  704. check_state = 'fak_idle2'
  705. if aState == check_state:
  706. action = getattr(actionsFSMlist, check_state)
  707. actionPlayer(action)
  708. newState = check_exit(aState, rA, timer, action)
  709. check_state = 'fak_idle3'
  710. if aState == check_state:
  711. action = getattr(actionsFSMlist, check_state)
  712. actionPlayer(action)
  713. newState = check_exit(aState, rA, timer, action)
  714. check_state = 'fak_idle4'
  715. if aState == check_state:
  716. action = getattr(actionsFSMlist, check_state)
  717. actionPlayer(action)
  718. newState = check_exit(aState, rA, timer, action)
  719. check_state = 'fak_idle5'
  720. if aState == check_state:
  721. action = getattr(actionsFSMlist, check_state)
  722. actionPlayer(action)
  723. newState = check_exit(aState, rA, timer, action)
  724. check_state = 'fak_idle5'
  725. if aState == check_state:
  726. action = getattr(actionsFSMlist, check_state)
  727. actionPlayer(action)
  728. newState = check_exit(aState, rA, timer, action)
  729. check_state = 'fak_idle6'
  730. if aState == check_state:
  731. action = getattr(actionsFSMlist, check_state)
  732. actionPlayer(action)
  733. newState = check_exit(aState, rA, timer, action)
  734. check_state = 'fak_jump'
  735. if aState == check_state:
  736. action = getattr(actionsFSMlist, check_state)
  737. actionPlayer(action)
  738. if own['stateTimer'] > getattr(action, 'fef'):
  739. newState = check_exit(aState, rA, timer, action)
  740. check_state = 'fak_walk_air'
  741. if aState == check_state:
  742. action = getattr(actionsFSMlist, check_state)
  743. actionPlayer(action)
  744. if aState != rA:
  745. newState = getattr(action, 'exits')[0]
  746. check_state = 'fak_walk_air_out'
  747. if aState == check_state:
  748. action = getattr(actionsFSMlist, check_state)
  749. actionPlayer(action)
  750. #print(own['stateTimer'], getattr(action, 'fef'))
  751. if own['stateTimer'] > getattr(action, 'fef'):
  752. newState = getattr(action, 'force_exit')
  753. check_state = 'fak_sit'
  754. if aState == check_state:
  755. action = getattr(actionsFSMlist, check_state)
  756. #if own['stateTimer'] < 19:
  757. if own['stateTimer'] < getattr(action, 'intro_frames'):
  758. actionPlayer(getattr(actionsFSMlist, 'intro'))
  759. else:
  760. actionPlayer(action)
  761. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_sit)
  762. #-----------------------
  763. check_state = 'fak_walk'
  764. if aState == check_state:
  765. action = getattr(actionsFSMlist, check_state)
  766. if own['l_aState'] == 'fak_walkFast':
  767. frame = get_frame(actionsFSMlist.fak_walkFast)
  768. actionPlayer(action)
  769. set_frame(actionsFSMlist.fak_walk, frame)
  770. else:
  771. frame = actionPlayer(action)
  772. newState = check_exit(aState, rA, timer, action)
  773. #-----------------------
  774. check_state = 'fak_walkFast'
  775. if aState == check_state:
  776. action = getattr(actionsFSMlist, check_state)
  777. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_walkFast)
  778. if own['l_aState'] == 'fak_walk':
  779. frame = get_frame(actionsFSMlist.fak_walk)
  780. actionPlayer(action)
  781. set_frame(actionsFSMlist.fak_walkFast, frame)
  782. else:
  783. actionPlayer(action)
  784. #print(frame)
  785. check_state = 'fak_onboard'
  786. if aState == check_state:
  787. action = getattr(actionsFSMlist, check_state)
  788. actionPlayer(action)
  789. print('checking onbaord state')
  790. #if own['stateTimer'] > 10:
  791. #newState = check_exit(aState, rA, timer, actionsFSMlist.fak_onboard)
  792. if own['stateTimer'] > getattr(action, 'fef'):
  793. newState = getattr(action, 'force_exit')
  794. check_state = 'fak_offboard'
  795. if aState == check_state:
  796. action = getattr(actionsFSMlist, check_state)
  797. actionPlayer(action)
  798. if own['stateTimer'] > 20:
  799. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_offboard)
  800. check_state = 'fak_roll'
  801. if aState == check_state:
  802. action = getattr(actionsFSMlist, check_state)
  803. actionPlayer(action)
  804. newState = check_exit(aState, rA, timer, action)
  805. check_state = 'fak_turnLeft'
  806. if aState == check_state:
  807. action = getattr(actionsFSMlist, check_state)
  808. actionPlayer(action)
  809. newState = check_exit(aState, rA, timer, action)
  810. check_state = 'fak_turnRight'
  811. if aState == check_state:
  812. action = getattr(actionsFSMlist, check_state)
  813. actionPlayer(action)
  814. newState = check_exit(aState, rA, timer, action)
  815. check_state = 'fak_opos'
  816. if aState == check_state:
  817. action = getattr(actionsFSMlist, check_state)
  818. actionPlayer(action)
  819. newState = check_exit(aState, rA, timer, action)
  820. check_state = 'fak_nopos'
  821. if aState == check_state:
  822. action = getattr(actionsFSMlist, check_state)
  823. actionPlayer(action)
  824. newState = check_exit(aState, rA, timer, action)
  825. check_state = 'fak_pump'
  826. if aState == check_state:
  827. action = getattr(actionsFSMlist, check_state)
  828. actionPlayer(action)
  829. newState = check_exit(aState, rA, timer, action)
  830. check_state = 'fak_pump_left'
  831. if aState == check_state:
  832. action = getattr(actionsFSMlist, check_state)
  833. actionPlayer(action)
  834. newState = check_exit(aState, rA, timer, action)
  835. check_state = 'fak_pump_right'
  836. if aState == check_state:
  837. action = getattr(actionsFSMlist, check_state)
  838. actionPlayer(action)
  839. newState = check_exit(aState, rA, timer, action)
  840. check_state = 'fak_push'
  841. if aState == check_state:
  842. action = getattr(actionsFSMlist, check_state)
  843. actionPlayer(action)
  844. if own['stateTimer'] > 70:
  845. newState = 'fak_roll'
  846. check_state = 'fak_push_goof'
  847. if aState == check_state:
  848. action = getattr(actionsFSMlist, check_state)
  849. actionPlayer(action)
  850. if own['stateTimer'] > 70:
  851. newState = 'fak_roll'
  852. check_state = 'fak_powerslide'
  853. if aState == check_state:
  854. action = getattr(actionsFSMlist, check_state)
  855. # if own['stateTimer'] < 20:
  856. # actionPlayer(actionsFSMlist.fak_powerslide_in)
  857. if own['stateTimer'] < getattr(action, 'intro_frames'):
  858. intro = getattr(action, 'intro')
  859. actionPlayer(getattr(actionsFSMlist, intro))
  860. else:
  861. actionPlayer(action)
  862. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_powerslide)
  863. check_state = 'fak_fs_powerslide'
  864. if aState == check_state:
  865. action = getattr(actionsFSMlist, check_state)
  866. # if own['stateTimer'] < 20:
  867. # actionPlayer(actionsFSMlist.fak_fs_powerslide_in)
  868. if own['stateTimer'] < getattr(action, 'intro_frames'):
  869. intro = getattr(action, 'intro')
  870. actionPlayer(getattr(actionsFSMlist, intro))
  871. else:
  872. actionPlayer(action)
  873. newState = check_exit(aState, rA, timer, actionsFSMlist.fak_fs_powerslide)
  874. check_state = 'fak_brfoot'
  875. if aState == check_state:
  876. action = getattr(actionsFSMlist, check_state)
  877. actionPlayer(action)
  878. if own['stateTimer'] > getattr(action, 'fef'):
  879. newState = getattr(action, 'force_exit')
  880. check_state = 'fak_frfoot'
  881. if aState == check_state:
  882. action = getattr(actionsFSMlist, check_state)
  883. actionPlayer(action)
  884. if own['stateTimer'] > getattr(action, 'fef'):
  885. newState = getattr(action, 'force_exit')
  886. check_state = 'fak_blfoot'
  887. if aState == check_state:
  888. action = getattr(actionsFSMlist, check_state)
  889. actionPlayer(action)
  890. if own['stateTimer'] > getattr(action, 'fef'):
  891. newState = getattr(action, 'force_exit')
  892. check_state = 'fak_flfoot'
  893. if aState == check_state:
  894. action = getattr(actionsFSMlist, check_state)
  895. actionPlayer(action)
  896. if own['stateTimer'] > getattr(action, 'fef'):
  897. newState = getattr(action, 'force_exit')
  898. check_state = 'fak_manual'
  899. if aState == check_state:
  900. action = getattr(actionsFSMlist, check_state)
  901. actionPlayer(action)
  902. newState = check_exit(aState, rA, timer, action)
  903. check_state = 'fak_nmanual'
  904. if aState == check_state:
  905. action = getattr(actionsFSMlist, check_state)
  906. actionPlayer(action)
  907. newState = check_exit(aState, rA, timer, action)
  908. check_state = 'fak_land'
  909. if aState == check_state:
  910. action = getattr(actionsFSMlist, check_state)
  911. actionPlayer(action)
  912. if own['stateTimer'] > getattr(action, 'fef'):
  913. newState = getattr(action, 'force_exit')
  914. check_state = 'fak_landL'
  915. if aState == check_state:
  916. action = getattr(actionsFSMlist, check_state)
  917. actionPlayer(action)
  918. if own['stateTimer'] > getattr(action, 'fef'):
  919. newState = getattr(action, 'force_exit')
  920. check_state = 'fak_landLb'
  921. if aState == check_state:
  922. action = getattr(actionsFSMlist, check_state)
  923. actionPlayer(action)
  924. if own['stateTimer'] > getattr(action, 'fef'):
  925. newState = getattr(action, 'force_exit')
  926. check_state = 'fak_landR'
  927. if aState == check_state:
  928. action = getattr(actionsFSMlist, check_state)
  929. actionPlayer(action)
  930. if own['stateTimer'] > getattr(action, 'fef'):
  931. newState = getattr(action, 'force_exit')
  932. check_state = 'fak_landRb'
  933. if aState == check_state:
  934. action = getattr(actionsFSMlist, check_state)
  935. actionPlayer(action)
  936. if own['stateTimer'] > getattr(action, 'fef'):
  937. newState = getattr(action, 'force_exit')
  938. check_state = 'fak_air'
  939. if aState == check_state:
  940. action = getattr(actionsFSMlist, check_state)
  941. actionPlayer(action)
  942. newState = check_exit(aState, rA, timer, action)
  943. check_state = 'fak_air_nb'
  944. if aState == check_state:
  945. action = getattr(actionsFSMlist, check_state)
  946. actionPlayer(action)
  947. newState = check_exit(aState, rA, timer, action)
  948. check_state = 'fak_air_nose'
  949. if aState == check_state:
  950. action = getattr(actionsFSMlist, check_state)
  951. actionPlayer(action)
  952. newState = check_exit(aState, rA, timer, action)
  953. check_state = 'fak_air_tail'
  954. if aState == check_state:
  955. action = getattr(actionsFSMlist, check_state)
  956. actionPlayer(action)
  957. newState = check_exit(aState, rA, timer, action)
  958. check_state = 'fak_ollie'
  959. if aState == check_state:
  960. action = getattr(actionsFSMlist, check_state)
  961. actionPlayer(action)
  962. if own['stateTimer'] > getattr(action, 'fef'):
  963. newState = getattr(action, 'force_exit')
  964. check_state = 'fak_kickflip'
  965. if aState == check_state:
  966. action = getattr(actionsFSMlist, check_state)
  967. actionPlayer(action)
  968. if own['stateTimer'] > getattr(action, 'fef'):
  969. newState = getattr(action, 'force_exit')
  970. check_state = 'fak_heelflip'
  971. if aState == check_state:
  972. action = getattr(actionsFSMlist, check_state)
  973. actionPlayer(action)
  974. if own['stateTimer'] > getattr(action, 'fef'):
  975. newState = getattr(action, 'force_exit')
  976. check_state = 'fak_shuvit'
  977. if aState == check_state:
  978. action = getattr(actionsFSMlist, check_state)
  979. actionPlayer(action)
  980. if own['stateTimer'] > getattr(action, 'fef'):
  981. newState = getattr(action, 'force_exit')
  982. check_state = 'fak_shuvit360'
  983. if aState == check_state:
  984. action = getattr(actionsFSMlist, check_state)
  985. actionPlayer(action)
  986. if own['stateTimer'] > getattr(action, 'fef'):
  987. newState = getattr(action, 'force_exit')
  988. check_state = 'fak_fsshuvit'
  989. if aState == check_state:
  990. action = getattr(actionsFSMlist, check_state)
  991. actionPlayer(action)
  992. if own['stateTimer'] > getattr(action, 'fef'):
  993. newState = getattr(action, 'force_exit')
  994. check_state = 'fak_fsshuvit360'
  995. if aState == check_state:
  996. action = getattr(actionsFSMlist, check_state)
  997. actionPlayer(action)
  998. if own['stateTimer'] > getattr(action, 'fef'):
  999. newState = getattr(action, 'force_exit')
  1000. #-nollie
  1001. check_state = 'fak_nollie'
  1002. if aState == check_state:
  1003. action = getattr(actionsFSMlist, check_state)
  1004. actionPlayer(action)
  1005. if own['stateTimer'] > getattr(action, 'fef'):
  1006. newState = getattr(action, 'force_exit')
  1007. check_state = 'fak_nollie_kickflip'
  1008. if aState == check_state:
  1009. action = getattr(actionsFSMlist, check_state)
  1010. actionPlayer(action)
  1011. if own['stateTimer'] > getattr(action, 'fef'):
  1012. newState = getattr(action, 'force_exit')
  1013. check_state = 'fak_nollie_heelflip'
  1014. if aState == check_state:
  1015. action = getattr(actionsFSMlist, check_state)
  1016. actionPlayer(action)
  1017. if own['stateTimer'] > getattr(action, 'fef'):
  1018. newState = getattr(action, 'force_exit')
  1019. check_state = 'fak_nollie_shuvit'
  1020. if aState == check_state:
  1021. action = getattr(actionsFSMlist, check_state)
  1022. actionPlayer(action)
  1023. if own['stateTimer'] > getattr(action, 'fef'):
  1024. newState = getattr(action, 'force_exit')
  1025. check_state = 'fak_nollie_fsshuvit'
  1026. if aState == check_state:
  1027. action = getattr(actionsFSMlist, check_state)
  1028. actionPlayer(action)
  1029. if own['stateTimer'] > getattr(action, 'fef'):
  1030. newState = getattr(action, 'force_exit')
  1031. check_state = 'fak_nollie_shuvit360'
  1032. if aState == check_state:
  1033. action = getattr(actionsFSMlist, check_state)
  1034. actionPlayer(action)
  1035. if own['stateTimer'] > getattr(action, 'fef'):
  1036. newState = getattr(action, 'force_exit')
  1037. check_state = 'fak_nollie_fsshuvit_360'
  1038. if aState == check_state:
  1039. action = getattr(actionsFSMlist, check_state)
  1040. actionPlayer(action)
  1041. if own['stateTimer'] > getattr(action, 'fef'):
  1042. newState = getattr(action, 'force_exit')
  1043. check_state = 'fak_hardflip'
  1044. if aState == check_state:
  1045. action = getattr(actionsFSMlist, check_state)
  1046. actionPlayer(action)
  1047. if own['stateTimer'] > getattr(action, 'fef'):
  1048. newState = getattr(action, 'force_exit')
  1049. check_state = 'fak_inward_heelflip'
  1050. if aState == check_state:
  1051. action = getattr(actionsFSMlist, check_state)
  1052. actionPlayer(action)
  1053. if own['stateTimer'] > getattr(action, 'fef'):
  1054. newState = getattr(action, 'force_exit')
  1055. check_state = 'fak_varial_kickflip'
  1056. if aState == check_state:
  1057. action = getattr(actionsFSMlist, check_state)
  1058. actionPlayer(action)
  1059. if own['stateTimer'] > getattr(action, 'fef'):
  1060. newState = getattr(action, 'force_exit')
  1061. check_state = 'fak_varial_heelflip'
  1062. if aState == check_state:
  1063. action = getattr(actionsFSMlist, check_state)
  1064. actionPlayer(action)
  1065. if own['stateTimer'] > getattr(action, 'fef'):
  1066. newState = getattr(action, 'force_exit')
  1067. #-----------
  1068. #grinds-----
  1069. #-----------
  1070. check_state = 'fak_5050'
  1071. if aState == check_state:
  1072. action = getattr(actionsFSMlist, check_state)
  1073. actionPlayer(action)
  1074. newState = check_exit(aState, rA, timer, action)
  1075. check_state = 'fak_bsboard'
  1076. if aState == check_state:
  1077. action = getattr(actionsFSMlist, check_state)
  1078. actionPlayer(action)
  1079. newState = check_exit(aState, rA, timer, action)
  1080. check_state = 'fak_fsboard'
  1081. if aState == check_state:
  1082. action = getattr(actionsFSMlist, check_state)
  1083. actionPlayer(action)
  1084. newState = check_exit(aState, rA, timer, action)
  1085. check_state = 'fak_tailg'
  1086. if aState == check_state:
  1087. action = getattr(actionsFSMlist, check_state)
  1088. actionPlayer(action)
  1089. newState = check_exit(aState, rA, timer, action)
  1090. check_state = 'fak_tailgr'
  1091. if aState == check_state:
  1092. action = getattr(actionsFSMlist, check_state)
  1093. actionPlayer(action)
  1094. newState = check_exit(aState, rA, timer, action)
  1095. check_state = 'fak_tailgl'
  1096. if aState == check_state:
  1097. action = getattr(actionsFSMlist, check_state)
  1098. actionPlayer(action)
  1099. newState = check_exit(aState, rA, timer, action)
  1100. check_state = 'fak_noseg'
  1101. if aState == check_state:
  1102. action = getattr(actionsFSMlist, check_state)
  1103. actionPlayer(action)
  1104. newState = check_exit(aState, rA, timer, action)
  1105. check_state = 'fak_nosegr'
  1106. if aState == check_state:
  1107. action = getattr(actionsFSMlist, check_state)
  1108. actionPlayer(action)
  1109. newState = check_exit(aState, rA, timer, action)
  1110. check_state = 'fak_nosegl'
  1111. if aState == check_state:
  1112. action = getattr(actionsFSMlist, check_state)
  1113. actionPlayer(action)
  1114. newState = check_exit(aState, rA, timer, action)
  1115. check_state = 'fak_tailslide'
  1116. if aState == check_state:
  1117. action = getattr(actionsFSMlist, check_state)
  1118. actionPlayer(action)
  1119. newState = check_exit(aState, rA, timer, action)
  1120. check_state = 'fak_noseslide'
  1121. if aState == check_state:
  1122. action = getattr(actionsFSMlist, check_state)
  1123. actionPlayer(action)
  1124. newState = check_exit(aState, rA, timer, action)
  1125. #-----------
  1126. #grabs------
  1127. #-----------
  1128. check_state = 'fak_frontside_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_backside_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_frontside_nose_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_backside_nose_grab'
  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_frontside_tail_grab'
  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_backside_tail_grab'
  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_ollie_north'
  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_ollie_south'
  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_judo'
  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. check_state = 'fak_frigid'
  1210. if aState == check_state:
  1211. action = getattr(actionsFSMlist, check_state)
  1212. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1213. intro = getattr(action, 'intro')
  1214. actionPlayer(getattr(actionsFSMlist, intro))
  1215. else:
  1216. actionPlayer(action)
  1217. newState = check_exit(aState, rA, timer, action)
  1218. check_state = 'fak_fsonefoot'
  1219. if aState == check_state:
  1220. action = getattr(actionsFSMlist, check_state)
  1221. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1222. intro = getattr(action, 'intro')
  1223. actionPlayer(getattr(actionsFSMlist, intro))
  1224. else:
  1225. actionPlayer(action)
  1226. newState = check_exit(aState, rA, timer, action)
  1227. check_state = 'fak_onefoot'
  1228. if aState == check_state:
  1229. action = getattr(actionsFSMlist, check_state)
  1230. if own['stateTimer'] < getattr(action, 'intro_frames'):
  1231. intro = getattr(action, 'intro')
  1232. actionPlayer(getattr(actionsFSMlist, intro))
  1233. else:
  1234. actionPlayer(action)
  1235. newState = check_exit(aState, rA, timer, action)
  1236. #-----------------------
  1237. #own['aState'] = aState
  1238. if newState != '':
  1239. own['aState'] = newState
  1240. #print(own['l_aState'], '----l_aState', own['aState'])
  1241. own['l_aState'] = og_state
  1242. own['l_actionState'] = og_state
  1243. #own['l_aState'] = newState
  1244. #print(own['l_aState'], '----l_aState', own['aState'], 'rA', rA)
  1245. state_timer(own)