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

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