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.

controller2.py 166KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195
  1. #shuvit.org
  2. # control script
  3. def main():
  4. #scale = .3
  5. #action layers
  6. #0-14 rolling
  7. #grablay = 400
  8. #fliplay = 500
  9. #grindlay = 700
  10. os = 'Windows'
  11. from sys import platform
  12. if platform != "win32":
  13. os = 'Linux'
  14. def onWindows():
  15. return os == 'Windows'
  16. from mathutils import Vector
  17. import bge
  18. import GameLogic
  19. import ctypes
  20. import math
  21. #import bpy
  22. #build global dict (move this to separate script that runs once)
  23. scene = bge.logic.getCurrentScene()
  24. objList = scene.objects
  25. try:
  26. GameLogic.DictObjects
  27. init=1
  28. except:
  29. init=0
  30. if init:
  31. cont.GameLogic.getCurrentController()
  32. own = cont.getOwner()
  33. name = own.getName()
  34. if not GameLogic.DictObjects.has_key(name):
  35. GameLogic.DictObjects[name]=cont
  36. own.init=0
  37. #reduction = 400000
  38. #axisTh = 0.03
  39. #initialize quadrant variables
  40. q1on = 0
  41. q2on = 0
  42. q3on = 0
  43. q4on = 0
  44. q5on = 0
  45. q6on = 0
  46. q7on = 0
  47. q8on = 0
  48. lq1on = 0
  49. lq2on = 0
  50. lq3on = 0
  51. lq4on = 0
  52. lq5on = 0
  53. lq6on = 0
  54. lq7on = 0
  55. lq8on = 0
  56. #number of frames / length of the location timers
  57. countdown = 20
  58. cont = GameLogic.getCurrentController()
  59. obj = bge.logic.getCurrentScene().objects
  60. char = bge.constraints.getCharacter
  61. own = cont.owner
  62. dict = bge.logic.globalDict #Get the global dictionary
  63. #dict['trick_string'] = ''
  64. #last frame stuff
  65. lGRAB_ON = own["lGRAB_ON"]
  66. lastgrab = own["lastGrab"]
  67. lastpump = own["lastPump"]
  68. lf_ground = own["lF_ground"]
  69. lastopos = own["last_Opos"]
  70. lastnopos = own["last_nOpos"]
  71. LAST_STANCE = own["last_stance"]
  72. LAST_GROUND = own["last_ground"]
  73. lastStop = own["lastStop"]
  74. LAST_LEFT = own["LAST_LEFT"]
  75. last_trick_string = dict.get('last_trick_sting')
  76. lasta = own["lasta"]
  77. lastx = own["lastx"]
  78. lastaf = own["lastaf"]
  79. lastxf = own["lastxf"]
  80. lgf = own['last_grind_frame']
  81. frame = own['framenum']
  82. frames_since_grinding = frame - lgf
  83. ground_since = own["framenum"] - own['lF_air_frame']
  84. own['last_footplant'] = own['footplant_on']
  85. lastaBut_ground = own['lastaBut_ground']
  86. lastxBut_ground = own['lastxBut_ground']
  87. aBut_ground = own['aBut_ground']
  88. xBut_ground = own['xBut_ground']
  89. own['last_manual_v2'] = own['manual_v2']
  90. lRequest = own['requestAction']
  91. lAs = own['actionState']
  92. #current frame stuff
  93. GRAB_ON = own["GRAB_ON"]
  94. pumpon = own["Pump"]
  95. vib_countdown = own["vib_Countdown"]
  96. grindold = own['grindOld']
  97. #grindHit = own["LAST_GRIND"]
  98. LAST_GRIND = own["LAST_GRIND"]
  99. #grindTouch = cont.sensors['grindCol']
  100. grindTouch = cont.sensors['grindCol_bottom']
  101. touched = grindTouch.triggered
  102. leftgrabon = own["Leftgrabon"]
  103. rightgrabon = own["Rightgrabon"]
  104. linvel = own.getLinearVelocity
  105. zvel = own.worldLinearVelocity.z
  106. own["Zvel"] = zvel
  107. r_ground = cont.sensors["r_Ground"]
  108. trigger = r_ground.triggered
  109. STANCE = own["stance"]
  110. motion = cont.actuators['MotionPump']
  111. linVelocity = own.getLinearVelocity(True)
  112. countdown = own['countdown']
  113. jump_timer = own['jump_timer']
  114. pos = own.localPosition
  115. rot = own.getAxisVect( [0.0, 0.0, 1.0])
  116. gray = cont.sensors["gRay"]
  117. #airconst = cont.actuators["airConst"]
  118. pop = cont.actuators["pop"]
  119. grindHit = own["grindHit"]
  120. grindCement = cont.actuators["grind_cement"]
  121. grindRail = cont.actuators["grind_rail"]
  122. grindSound = own["grindSound"]
  123. skater = scene.objects["Char4"]
  124. deck = scene.objects["deck"]
  125. trucks = scene.objects["trucks"]
  126. wheel1 = scene.objects["rollen.000"]
  127. wheel2 = scene.objects["rollen.001"]
  128. wheel3 = scene.objects["rollen.002"]
  129. wheel4 = scene.objects["rollen.003"]
  130. turnsens = .04
  131. turnsens2 = .06 #air_turn_boost
  132. grindDar = own["grindDar_hit"]
  133. grindEmpty = scene.objects["grindEmpty"]
  134. grindDar2 = grindEmpty.sensors["grindDar2"]
  135. #invertCol = cont.sensors["invertCol"]
  136. cam = scene.objects["Camera.003"]
  137. freecam = scene.objects["freecam"]
  138. followcam = scene.objects["followcam"]
  139. coping_on = own["coping"]
  140. invert_on = own['invert_on']
  141. grab_type = own['grab_type']
  142. c_ground = cont.sensors['c_ground']
  143. #
  144. control_bottom = scene.objects['control_bottom']
  145. invertTouch = control_bottom.sensors['grindCol_bottom']
  146. wallride = own["wallride"]
  147. wallride_col = cont.sensors['wallride']
  148. wallrideL = cont.sensors['wallrideL']
  149. wallrideR = cont.sensors['wallrideR']
  150. wallrideconstL = cont.actuators['wallrideconstL']
  151. wallrideconstR = cont.actuators['wallrideconstR']
  152. if r_ground.triggered: own['wallride_off'] = 0
  153. own['pop_sound'] = 0
  154. own['land_sound'] = 0
  155. own['revert_sound'] = 0
  156. #own['fall'] = 0
  157. #joystick location timers
  158. q1oncd = own["Q1oncd"]
  159. q2oncd = own["Q2oncd"]
  160. q3oncd = own["Q3oncd"]
  161. q4oncd = own["Q4oncd"]
  162. q5oncd = own["Q5oncd"]
  163. q6oncd = own["Q6oncd"]
  164. q7oncd = own["Q7oncd"]
  165. q8oncd = own["Q8oncd"]
  166. q1oncdl = own["Q1oncdl"]
  167. q2oncdl = own["Q2oncdl"]
  168. q3oncdl = own["Q3oncdl"]
  169. q4oncdl = own["Q4oncdl"]
  170. q5oncdl = own["Q5oncdl"]
  171. q6oncdl = own["Q6oncdl"]
  172. q7oncdl = own["Q7oncdl"]
  173. q8oncdl = own["Q8oncdl"]
  174. #setable
  175. grablay = 600 #this plus 1
  176. fliplay = 470
  177. MAX_VEL = 6.7
  178. SPEEDUP = .055
  179. SPEEDPUMP = .12 #.09
  180. SPEEDPUMPFAST = .14 #.13
  181. PUMP_SPEED_SENS = .4
  182. PUMP_SENS = .98
  183. ACCEL = 10
  184. CRUISE = 9
  185. COUNTDOWN = 20 #pump and speed stuff
  186. JUMPHEIGHT = 800 #775#750
  187. JUMPSTRENGTH = 0
  188. own['flip_manual_stance'] = 0
  189. #CAVEMAN_SPEED = .75
  190. LAND_LAYER = 100
  191. LAND_END = 20
  192. lLR = dict['lLR']
  193. lUD = dict['lUD']
  194. rLR = dict['rLR']
  195. rUD = dict['rUD']
  196. lTrig = dict['lTrig']
  197. rTrig = dict['rTrig']
  198. aBut = dict['aBut']
  199. bBut = dict['bBut']
  200. xBut = dict['xBut']
  201. yBut = dict['yBut']
  202. lBump = dict['lBump']
  203. rBump = dict['rBump']
  204. bkBut = dict['bkBut']
  205. stBut = dict['stBut']
  206. xbBut = dict['xbBut']
  207. ltsBut = dict['ltsBut']
  208. rtsBut = dict['rtsBut']
  209. ldPad = dict['ldPad']
  210. rdPad = dict['rdPad']
  211. udPad = dict['udPad']
  212. ddPad = dict['ddPad']
  213. #fliptricks after manuals
  214. if (frame - own['last_manual_frame']) < 25:
  215. flip_start_lay = 8
  216. flipspeed = .4
  217. own['flipspeed'] = .4
  218. own['flip_start_lay'] = 8
  219. #print("chopping flip start")
  220. else:
  221. flip_start_lay = 1
  222. own['flip_start_lay'] = 1
  223. flipspeed = .6
  224. own['flipspeed'] = .6
  225. def printplaying():
  226. splaying_layers = "S: "
  227. playing_layers = "D: "
  228. tplaying_layers = "T: "
  229. for x in range(9900):
  230. if skater.isPlayingAction(x):
  231. #if trucks.isPlayingAction(x):
  232. #if skater.isPlayingAction(x):
  233. splaying_layers += str(x)
  234. splaying_layers += " "
  235. if deck.isPlayingAction(x):
  236. #if trucks.isPlayingAction(x):
  237. #if skater.isPlayingAction(x):
  238. playing_layers += str(x)
  239. playing_layers += " "
  240. if trucks.isPlayingAction(x):
  241. #if trucks.isPlayingAction(x):
  242. #if skater.isPlayingAction(x):
  243. tplaying_layers += str(x)
  244. tplaying_layers += " "
  245. print(splaying_layers, playing_layers, tplaying_layers)
  246. if aBut == True and lasta == False and r_ground.triggered:
  247. aBut_ground = True
  248. own['aBut_ground'] = True
  249. #else:
  250. if aBut == False:
  251. aBut_ground = False
  252. own['aBut_ground'] = False
  253. if xBut == True and lastx == False and r_ground.triggered:
  254. xBut_ground = True
  255. own['xBut_ground'] = True
  256. #else:
  257. if xBut == False:
  258. xBut_ground = False
  259. own['xBut_ground'] = False
  260. def killact(layer):
  261. if skater.isPlayingAction(layer):
  262. skater.stopAction(layer)
  263. if deck.isPlayingAction(layer):
  264. deck.stopAction(layer)
  265. if trucks.isPlayingAction(layer):
  266. trucks.stopAction(layer)
  267. def killall():
  268. for x in range(9000):
  269. skater.stopAction(x)
  270. deck.stopAction(x)
  271. trucks.stopAction(x)
  272. def reset_rtimers():
  273. own["Q1oncd"] = 0
  274. own["Q2oncd"] = 0
  275. own["Q3oncd"] = 0
  276. own["Q4oncd"] = 0
  277. own["Q5oncd"] = 0
  278. own["Q6oncd"] = 0
  279. own["Q7oncd"] = 0
  280. own["Q8oncd"] = 0
  281. q1oncd = 0
  282. q2oncd = 0
  283. q3oncd = 0
  284. q4oncd = 0
  285. q5oncd = 0
  286. q6oncd = 0
  287. q7oncd = 0
  288. q8oncd = 0
  289. def check_fall():
  290. playing_frame = 20
  291. if skater.isPlayingAction(fliplay):
  292. playing_frame = skater.getActionFrame(fliplay)
  293. if r_ground.triggered == True and skater.isPlayingAction(fliplay) and own['jump_timer'] < 40 and playing_frame < 14 and playing_frame > 3:
  294. own['fall'] = 1
  295. own['last_fall_frame'] = frame
  296. print("fall: ", playing_frame, own['jump_timer'])
  297. if STANCE == 0:
  298. #own['requestAction'] = 'reg_fall1'
  299. own['requestAction'] = 'reg_air-walk_air'
  300. if STANCE == 1:
  301. #own['requestAction'] = 'fak_fall1'
  302. own['requestAction'] = 'fak_air-walk_air'
  303. check_fall()
  304. def check_landing():
  305. lf_ground = own["lF_ground"]
  306. STANCE = own["stance"]
  307. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  308. if lf_ground == False and r_ground.triggered == True:
  309. own['jump_from_trans'] = 0
  310. nearestObject = None
  311. minDist = None
  312. detectedObjects = grindDar2.hitObjectList
  313. if grindDar == 0:
  314. lastheight = own["air_height"]
  315. pos = own.worldPosition.z
  316. dist = lastheight - pos
  317. dist = dist * 2
  318. if dist > 1:
  319. dist = 1
  320. own.actuators["land"].volume = dist
  321. sact = own.actuators["land"]
  322. sact.stopSound()
  323. cont.activate(own.actuators["land"])
  324. own['land_sound'] = 1
  325. if grindDar == 1:
  326. pass
  327. own["vib_Countdown"] = 14
  328. cont.activate(own.actuators["Vibration"])
  329. if own['manual_v2'] == 0 and grindDar == 0:
  330. if STANCE == 0:
  331. own['requestAction'] = 'reg_land'
  332. elif STANCE == 1:
  333. own['requestAction'] = 'fak_land'
  334. killact(2)
  335. killact(3)
  336. killact(4)
  337. killact(5)
  338. lf_ground = r_ground.triggered
  339. own["lF_ground"] = lf_ground
  340. vib_countdown = own["vib_Countdown"]
  341. if vib_countdown > 0:
  342. vib_countdown = vib_countdown - 1
  343. own["vib_Countdown"] = vib_countdown
  344. if vib_countdown == 1:
  345. stopAnims()
  346. stance()
  347. #air anim
  348. if r_ground.triggered == False:
  349. if STANCE == 0:
  350. own['requestAction'] = 'reg_air'
  351. if STANCE == 1:
  352. own['requestAction'] = 'fak_air'
  353. else:
  354. if STANCE == 0:
  355. own['requestAction'] = 'reg_roll'
  356. if STANCE == 1:
  357. own['requestAction'] = 'fak_roll'
  358. #check manual_v2
  359. if (rUD > .03 and rUD < .08) or (rUD < -.03 and rUD > -.08):
  360. #if (rUD > .04 and rUD < .07):
  361. #print("zoned")
  362. timer = own['manual_v2_timer']
  363. timer = timer + 1
  364. if timer > 20:
  365. own['manual_v2'] = 1
  366. own['manual_v2_timer'] = timer
  367. if rUD < .04 and rUD > -.04:
  368. own['manual_v2_timer'] = 0
  369. own['manual_v2'] = 0
  370. own['manual_v2_type'] = None
  371. if own['manual_v2'] == 1:
  372. if own['last_manual_v2'] == 0:
  373. if STANCE == 0:
  374. if rUD > .04 and rUD < .07:
  375. #print("reg manual")
  376. own['manual_v2_type'] = 'reg manual'
  377. if rUD < -.04 and rUD > -.07:
  378. own['manual_v2_type'] = 'reg nose manual'
  379. if STANCE == 1:
  380. if rUD > .04 and rUD < .07:
  381. own['manual_v2_type'] = 'fak manual'
  382. if lRequest == 'reg_air_tail to manual':
  383. #print('chaaaaange init')
  384. own['manual_v2_type'] = 'fak nose manual'
  385. if rUD < -.04 and rUD > -.07:
  386. own['manual_v2_type'] = 'fak nose manual'
  387. else:
  388. #print("flip stance")
  389. if own['jump_stance'] == 0:
  390. #print('flipstance 0')
  391. if own['manual_v2_type'] == 'fak manual':
  392. own['manual_v2_type'] = 'reg nose manual'
  393. if own['manual_v2_type'] == 'fak nose manual':
  394. own['manual_v2_type'] = 'reg manual'
  395. if lAs == 'fak_air_tail to manual' and own['manual_v2_type'] == 'reg manual':
  396. print('---requesting reg nose manual')
  397. own['manual_v2_type'] = 'reg nose manual'
  398. if lAs == 'fak_air_nose to nmanual' and own['manual_v2_type'] == 'reg nose manual':
  399. print('---requesting reg nose manual')
  400. own['manual_v2_type'] = 'reg manual'
  401. if own['jump_stance'] == 1:
  402. #print('flipstance 1')
  403. if own['manual_v2_type'] == 'reg manual':
  404. own['manual_v2_type'] = 'fak nose manual'
  405. if own['manual_v2_type'] == 'reg nose manual':
  406. #print("asdfasdfasdfsdfasdfasdf")
  407. own['manual_v2_type'] = 'fak manual'
  408. if lAs == 'reg_air_tail to manual' and own['manual_v2_type'] == 'fak manual':
  409. print('---requesting fak nose manual')
  410. own['manual_v2_type'] = 'fak nose manual'
  411. if lAs == 'reg_air_nose to nmanual' and own['manual_v2_type'] == 'fak nose manual':
  412. print('---requesting fak nose manual')
  413. own['manual_v2_type'] = 'fak manual'
  414. if STANCE == 0 and own['manual_v2_type'] == 'fak manual':
  415. print('change manual stance')
  416. own['manual_v2_type'] = 'reg nose manual'
  417. if STANCE == 1 and own['manual_v2_type'] == 'reg manual':
  418. print('change manual stance')
  419. own['manual_v2_type'] = 'fak nose manual'
  420. if STANCE == 0 and own['manual_v2_type'] == 'fak nose manual':
  421. print('change manual stance')
  422. own['manual_v2_type'] = 'reg manual'
  423. if STANCE == 1 and own['manual_v2_type'] == 'reg nose manual':
  424. print('change manual stance')
  425. own['manual_v2_type'] = 'fak manual'
  426. #check manual
  427. ####
  428. #reg
  429. if rUD > .03 and rUD < .08 and STANCE == 0 and rLR < .035 and rLR > -.035:
  430. timer = own["reg_manual_timer"]
  431. timer = timer + 1
  432. own["reg_manual_timer"] = timer
  433. if timer > 20 and rUD < .04:
  434. own["reg_manual"] = 0
  435. #print("reg_man off")
  436. if rUD <= .03 and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
  437. own["reg_manual_timer"] = 0
  438. own["reg_manual"] = 0
  439. #print("reg_man off2")
  440. #####
  441. if own["reg_manual_timer"] > 10 and own["fak_manual"] == 0 and own['reg_nmanual'] == 0:
  442. own["reg_manual"] = 1
  443. ######
  444. if own["reg_manual_timer"] == 0:
  445. own["reg_manual"] = 0
  446. if own['last_reg_manual'] == 1 and own['reg_manual'] == 0:
  447. #killall()
  448. pass
  449. ####
  450. #fak
  451. if rUD > .03 and rUD < .08 and STANCE == 1 and rLR < .035 and rLR > -.035:
  452. timer = own["fak_manual_timer"]
  453. timer = timer + 1
  454. own["fak_manual_timer"] = timer
  455. if timer > 20:
  456. own["fak_manual"] = 0
  457. if rUD <= .03 and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
  458. own["fak_manual_timer"] = 0
  459. own["fak_manual"] = 0
  460. if own["fak_manual_timer"] > 10 and own["reg_manual"] == 0:
  461. own["fak_manual"] = 1
  462. if own["fak_manual_timer"] == 0:
  463. own["fak_manual"] = 0
  464. if own['last_fak_manual'] == 1 and own['fak_manual'] == 0:
  465. #killall()
  466. pass
  467. #print(own["reg_manual"], own["fak_manual"])
  468. #####
  469. #reg nmanual
  470. if rUD < -.03 and rUD > -.08 and STANCE == 0 and rLR < .035 and rLR > -.035:
  471. timer = own["reg_nmanual_timer"]
  472. timer = timer + 1
  473. own["reg_nmanual_timer"] = timer
  474. if timer > 20:
  475. own["reg_nmanual"] = 0
  476. if rUD >= -.03 and (STANCE == 1 or STANCE == 0) and rUD <= .04:
  477. own["reg_nmanual_timer"] = 0
  478. own["reg_nmanual"] = 0
  479. if own["reg_nmanual_timer"] > 10 and own["fak_nmanual"] == 0 and own['reg_manual'] == 0 and own['fak_manual'] == 0:
  480. if own['last_fak_manual'] == False and own['last_reg_manual'] == False and own['last_fak_manual'] == False:
  481. own["reg_nmanual"] = 1
  482. #print("baaad", own['reg_manual'], own['last_reg_manual'])
  483. if own["reg_nmanual_timer"] == 0:
  484. own["reg_nmanual"] = 0
  485. if own['last_reg_nmanual'] == 1 and own['reg_nmanual'] == 0:
  486. pass
  487. #killall()
  488. #####
  489. #fak nmanual
  490. #print (rUD)
  491. if rUD < -.03 and rUD > -.08 and STANCE == 1 and rLR < .035 and rLR > -.035:
  492. timer = own["fak_nmanual_timer"]
  493. timer = timer + 1
  494. own["fak_nmanual_timer"] = timer
  495. if timer > 20:
  496. own["fak_nmanual"] = 0
  497. if rUD >= -.03 and (STANCE == 1 or STANCE == 0) and rUD <= .04:
  498. own["fak_nmanual_timer"] = 0
  499. own["fak_nmanual"] = 0
  500. #print('@@@@@@@@@fak_man_off_1')
  501. if own["fak_nmanual_timer"] > 10 and own["reg_nmanual"] == 0 and own['fak_manual'] == 0 and own ['reg_manual'] == 0:
  502. own["fak_nmanual"] = 1
  503. if own["fak_nmanual_timer"] == 0 and own['reg_manual'] == 0:
  504. #if own['flip_manual_stance'] == 0:
  505. own["fak_nmanual"] = 0
  506. if own['last_fak_nmanual'] == 1 and own['fak_nmanual'] == 0:
  507. pass
  508. def reg_stance_left_off():
  509. LAST_LEFT = own["LAST_LEFT"]
  510. own["LAST_LEFT"] = 0
  511. def reg_stance_right_off():
  512. LAST_RIGHT = own["LAST_RIGHT"]
  513. own["LAST_RIGHT"] = 0
  514. def reg_stance_on():
  515. #revert_timer
  516. playing = deck.isPlayingAction(40)
  517. if own["revert_timer"] < 1 and own['manual_v2'] == 0 and playing == 0:
  518. own['requestAction'] = 'reg_roll'
  519. def reg_stance_off():
  520. killact(2)
  521. def reg_manual_on():
  522. own['requestAction'] = 'reg_manual'
  523. if own["reg_manual_timer"] == 41:
  524. killact(3000)
  525. killact(3001)
  526. killact(3002)
  527. def reg_manual_off():
  528. killact(222)
  529. killact(223)
  530. killact(224)
  531. killact(3000)
  532. killact(3001)
  533. killact(3002)
  534. killact(10)
  535. killact(32)
  536. killact(11)
  537. killact(34)
  538. def fak_manual_on():
  539. #killall()
  540. own['requestAction'] = 'fak_manual'
  541. #print('fuck fuck fuck')
  542. if own["fak_manual_timer"] == 41:
  543. killact(3000)
  544. killact(3001)
  545. killact(3002)
  546. def fak_manual_off():
  547. killact(222)
  548. killact(223)
  549. killact(224)
  550. killact(3000)
  551. killact(3001)
  552. killact(3002)
  553. killact(10)
  554. killact(32)
  555. killact(11)
  556. killact(34)
  557. #######
  558. #######
  559. #######
  560. #######
  561. def reg_nmanual_on():
  562. own['requestAction'] = 'reg_nmanual'
  563. if own["reg_nmanual_timer"] == 41:
  564. killact(3000)
  565. killact(3001)
  566. killact(3002)
  567. def reg_nmanual_off():
  568. killact(222)
  569. killact(223)
  570. killact(224)
  571. killact(3000)
  572. killact(3001)
  573. killact(3002)
  574. killact(10)
  575. killact(32)
  576. killact(11)
  577. killact(34)
  578. def fak_nmanual_on():
  579. own['requestAction'] = 'fak_nmanual'
  580. if own["fak_nmanual_timer"] == 41:
  581. killact(3000)
  582. killact(3001)
  583. killact(3002)
  584. def fak_nmanual_off():
  585. killact(222)
  586. killact(223)
  587. killact(224)
  588. killact(3000)
  589. killact(3001)
  590. killact(3002)
  591. killact(10)
  592. killact(32)
  593. killact(11)
  594. killact(34)
  595. if own['l_actionState'] == 'reg_manual_revert_ccw':
  596. own['manual_v2_type'] = 'fak nose manual'
  597. fak_nmanual_on()
  598. if own['l_actionState'] == 'reg_manual_revert_cw':
  599. own['manual_v2_type'] = 'fak nose manual'
  600. fak_nmanual_on()
  601. ###########
  602. def reg_stanceinc_on():
  603. pass
  604. #skater.playAction("nreg", 1,60, layer=3, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  605. #deck.playAction("a_reg", 1,40, layer=3, blendin=0, blend_mode=0, play_mode=1, speed=.5)
  606. #trucks.playAction("a_reg", 1,40, layer=3, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  607. def reg_stanceinc_off():
  608. killact(3)
  609. def reg_stance_left_on():
  610. if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
  611. own['requestAction'] = 'reg_turnLeft'
  612. LAST_LEFT = own["LAST_LEFT"]
  613. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  614. if LAST_LEFT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
  615. LAST_LEFT = 1
  616. own["LAST_LEFT"] = 1
  617. def reg_stance_right_on():
  618. if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
  619. own['requestAction'] = 'reg_turnRight'
  620. LAST_RIGHT = own["LAST_RIGHT"]
  621. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  622. if LAST_RIGHT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
  623. LAST_RIGHT = 1
  624. own["LAST_RIGHT"] = 1
  625. def fak_stance_on():
  626. playing = deck.isPlayingAction(40)
  627. if own['manual_v2'] == 0 and own["revert_timer"] < 1 and playing == 0 and own['gt_cd2'] < 1:
  628. own['requestAction'] = 'fak_roll'
  629. def fak_stance_off():
  630. killact(3)
  631. def fak_stance_left_on():
  632. if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
  633. own['requestAction'] = 'fak_turnLeft'
  634. LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
  635. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  636. if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
  637. LAST_LEFT_FAK = 1
  638. own["LAST_LEFT_FAK"] = 1
  639. def fak_stance_left_off():
  640. killact(12)
  641. killact(36)
  642. LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
  643. own["LAST_LEFT_FAK"] = 0
  644. def fak_stance_right_on():
  645. if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
  646. own['requestAction'] = 'fak_turnRight'
  647. LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
  648. own["LAST_RIGHT_FAK"] = 1
  649. def fak_stance_right_off():
  650. killact(13)
  651. killact(37)
  652. LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
  653. own["LAST_RIGHT_FAK"] = 0
  654. def reg_air_on():
  655. playing = deck.isPlayingAction(fliplay)
  656. if playing == False:
  657. own['requestAction'] = 'reg_air'
  658. def reg_air_off():
  659. killact(4)
  660. def fak_air_on():
  661. flipping = skater.isPlayingAction(fliplay)
  662. if flipping == False:
  663. own['requestAction'] = 'fak_air'
  664. def fak_air_off():
  665. killact(5)
  666. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  667. def stance():
  668. # turnsens = .04
  669. # turnblend = 10
  670. rotation = .96
  671. turnsens = 0.06
  672. if rot.z < .9: inc = 1
  673. else: inc = 0
  674. flipping = skater.isPlayingAction(500)
  675. #print(flipping)
  676. #ground
  677. ground_since = own["framenum"] - own['lF_air_frame']
  678. #if r_ground.triggered == True and grindHit == False and flipping == False and own["wallride"] == None and own['revert_timer'] < 2 and ground_since > 40:
  679. if r_ground.triggered == True and grindHit == False and flipping == False and own["wallride"] == None and own['revert_timer'] < 2:
  680. if STANCE == 0:
  681. reg_manual = own['reg_manual']
  682. fak_manual = own["fak_manual"]
  683. reg_nmanual = own['reg_nmanual']
  684. fak_nmanual = own["fak_nmanual"]
  685. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  686. fak_stance_off()
  687. reg_air_off()
  688. fak_air_off()
  689. if reg_manual == 0 and fak_manual == 0:
  690. last_manual = own['last_reg_manual']
  691. if last_manual == 1:
  692. reg_manual_off()
  693. fak_manual_off()
  694. reg_stance_on()
  695. if own['manual_v2_type'] == 'reg manual':
  696. reg_manual_on()
  697. elif own['manual_v2_type'] == 'reg nose manual':
  698. reg_nmanual_on()
  699. elif own['manual_v2_type'] == 'fak manual':
  700. fak_manual_on()
  701. elif own['manual_v2_type'] == 'fak nose manual':
  702. fak_nmanual_on()
  703. if STANCE == 1:
  704. reg_manual = own['reg_manual']
  705. fak_manual = own["fak_manual"]
  706. reg_nmanual = own['reg_nmanual']
  707. fak_nmanual = own["fak_nmanual"]
  708. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  709. reg_stance_off()
  710. reg_air_off()
  711. fak_air_off
  712. if fak_manual == 0:
  713. last_manual = own['last_fak_manual']
  714. if last_manual == 1:
  715. fak_manual_off()
  716. reg_manual_off()
  717. fak_stance_on()
  718. if own['manual_v2_type'] == 'fak manual':
  719. fak_manual_on()
  720. elif own['manual_v2_type'] == 'fak nose manual':
  721. fak_nmanual_on()
  722. elif own['manual_v2_type'] == 'reg manual':
  723. reg_manual_on()
  724. elif own['manual_v2_type'] == 'reg nose manual':
  725. reg_nmanual_on()
  726. if own["Pump"] == False:
  727. if lLR < -turnsens and STANCE == 0:
  728. reg_stance_left_on()
  729. if lLR > -turnsens or LAST_GRIND != grindHit:
  730. reg_stance_left_off()
  731. if lLR > turnsens and STANCE == 0:
  732. reg_stance_right_on()
  733. if lLR < turnsens or LAST_GRIND != grindHit:
  734. reg_stance_right_off()
  735. if lLR < -turnsens and STANCE == 1:
  736. fak_stance_left_on()
  737. if lLR > -turnsens or LAST_GRIND != grindHit:
  738. fak_stance_left_off()
  739. if lLR > turnsens and STANCE == 1:
  740. fak_stance_right_on()
  741. if lLR < turnsens or LAST_GRIND != grindHit:
  742. fak_stance_right_off()
  743. #air
  744. playing = deck.isPlayingAction(fliplay)
  745. if r_ground.triggered == False and playing == False and flipping == False:
  746. if STANCE == 0:
  747. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  748. fak_air_off()
  749. reg_stance_off()
  750. fak_stance_off()
  751. reg_stance_left_off()
  752. reg_stance_right_off()
  753. fak_stance_left_off()
  754. fak_stance_right_off()
  755. reg_air_on()
  756. if STANCE == 1:
  757. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  758. reg_air_off()
  759. reg_stance_off()
  760. fak_stance_off()
  761. reg_stance_left_off()
  762. reg_stance_right_off()
  763. fak_stance_left_off()
  764. fak_stance_right_off()
  765. fak_air_on()
  766. if grindHit == True:
  767. reg_stance_off()
  768. fak_stance_off()
  769. ###################
  770. #trick definitions#
  771. ###################
  772. def jump():
  773. #print("jump funct")
  774. jump_timer = own['jump_timer']
  775. reg_manual_off()
  776. fak_manual_off()
  777. reg_nmanual_off()
  778. fak_nmanual_off()
  779. cont.deactivate(wallrideconstL)
  780. cont.deactivate(wallrideconstR)
  781. if JUMPSTRENGTH != 0:
  782. height = JUMPSTRENGTH * JUMPHEIGHT
  783. else:
  784. height = JUMPHEIGHT
  785. #if jump_timer == 0:
  786. if jump_timer < 50:
  787. jump_timer = 60
  788. own['jump_timer'] = jump_timer
  789. if zvel < 7 and jump_timer == 60:
  790. cont.activate(own.actuators["pop"])
  791. own['pop_sound'] = 1
  792. print("jump")
  793. #
  794. posx = own.worldPosition[0]
  795. posy = own.worldPosition[1]
  796. posz = own.worldPosition[2]
  797. jumppos = Vector((posx, posy, posz))
  798. own['jumpPos'] = jumppos
  799. force = [ 0.0, 0.0, height]
  800. # use local axis
  801. local = False
  802. # apply force
  803. try:
  804. if 'trans' in r_ground.hitObject:
  805. print('jump from trans')
  806. own['jump_from_trans'] = 1
  807. own['trans_jump_obj'] = r_ground.hitObject
  808. except:
  809. print('trans jump broke')
  810. if grindHit == False:
  811. own.applyForce(force, local)
  812. force2 = [0.0, 0, 150]
  813. own.applyForce(force2, True)
  814. #print("apply jump force1")
  815. if grindHit == True:
  816. linvelloc = own.getLinearVelocity(True)
  817. own.applyForce(force, True)
  818. force2 = [0.0, 0, 150]
  819. own.applyForce(force2, True)
  820. linvelloc2 = own.getLinearVelocity(True)
  821. force = (linvelloc.x, linvelloc.y, linvelloc2.z)
  822. own.setLinearVelocity(force, True)
  823. #print("apply jump force2 grindHit")
  824. own['jump_stance'] = STANCE
  825. if STANCE == True:
  826. own["jump_stance"] = 1
  827. if STANCE == False:
  828. own["jump_stance"] = 0
  829. own["jump_stance"] = own["stance"]
  830. if grindHit == True:
  831. own['grind_jump'] = 1
  832. if lLR > turnsens or lLR < -turnsens or lUD > turnsens or lUD < -turnsens:
  833. own['grindjumpturn'] = True
  834. #print("turn on grindjumpturn")
  835. num = 1
  836. if num ==1:
  837. rString = "R"
  838. lString = "L"
  839. cont.deactivate(wallrideconstL)
  840. cont.deactivate(wallrideconstR)
  841. #print("deactivating constraints")
  842. if own["wallride"] == "R":
  843. force = [0,170,0]
  844. own.applyForce(force, True)
  845. print("****walljumpforce R")
  846. cont.activate(own.actuators["pop2"])
  847. jump_timer = 60
  848. own['jump_timer'] = jump_timer
  849. if own["wallride"] == "L":
  850. force = [0,-170,0] #325
  851. own.applyForce(force, True)
  852. print("****walljumpforce L")
  853. cont.activate(own.actuators["pop2"])
  854. jump_timer = 60
  855. own['jump_timer'] = jump_timer
  856. own["Q1oncd"] = 0
  857. own["Q2oncd"] = 0
  858. own["Q3oncd"] = 0
  859. own["Q4oncd"] = 0
  860. own["Q5oncd"] = 0
  861. own["Q6oncd"] = 0
  862. own["Q7oncd"] = 0
  863. own["Q8oncd"] = 0
  864. if own['jump_timer'] == 60:
  865. own['jump_timer'] = 59
  866. def jump_Timer():
  867. jump_timer = own['jump_timer']
  868. if jump_timer > 0:
  869. jump_timer = jump_timer - 1
  870. own['jump_timer'] = jump_timer
  871. if own['grindjumpturn'] == True:
  872. jump_timer = 30
  873. own['jump_timer'] = jump_timer
  874. def pump():
  875. velocity = own['velocity']
  876. #regular
  877. local = True
  878. downforce = -.1
  879. lF_air_frame = own['lF_air_frame']
  880. frames_since_ground = own['framenum'] - own['lF_air_frame']
  881. if linVelocity.x < MAX_VEL and linVelocity.x >= -0 and STANCE == 1 and grindHit == False and frames_since_ground > 30:
  882. countdown = COUNTDOWN
  883. yvel = linVelocity.x + SPEEDPUMP
  884. yvel2 = linVelocity.x + SPEEDPUMPFAST
  885. own['countdown'] = countdown
  886. force = [(yvel), 0, linVelocity.z + downforce]
  887. force2 = [(yvel2), 0, linVelocity.z + downforce]
  888. if rot.z < PUMP_SENS and rot.z > PUMP_SPEED_SENS:
  889. own.setLinearVelocity(force, local)
  890. if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
  891. own.setLinearVelocity(force2, local)
  892. own['requestAction'] = 'fak_pump'
  893. #switch
  894. if linVelocity.x > -MAX_VEL and linVelocity.x <= 0 and STANCE == 0 and grindHit == False and frames_since_ground > 30:
  895. countdown = COUNTDOWN
  896. yvel = linVelocity.x - SPEEDPUMP
  897. yvel2 = linVelocity.x - SPEEDPUMPFAST
  898. own['countdown'] = countdown
  899. force = [(yvel), 0, linVelocity.z + downforce]
  900. force2 = [(yvel2), 0, linVelocity.z + downforce]
  901. if rot.z < PUMP_SENS and rot.z > PUMP_SPEED_SENS:
  902. own.setLinearVelocity(force, local)
  903. if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
  904. own.setLinearVelocity(force2, local)
  905. own['requestAction'] = 'reg_pump'
  906. own["Pump"] = True
  907. own["lastPump"] = True
  908. def roll():
  909. if r_ground.triggered == 1:
  910. pass
  911. def stop():
  912. if linVelocity.x < .05 and linVelocity.x > -.05:
  913. can_stop = 0
  914. own["lastStop"] = True
  915. else:
  916. can_stop = 1
  917. if r_ground.triggered == 1 and STANCE == False and can_stop == 1:
  918. own['requestAction'] = 'reg_stop'
  919. yvel = linVelocity.x * .985
  920. force = [(yvel), 0, linVelocity.z]
  921. own.setLinearVelocity(force, True)
  922. elif r_ground.triggered == 1 and STANCE == True and can_stop == 1:
  923. own['requestAction'] = 'fak_stop'
  924. yvel = linVelocity.x * .985
  925. force = [(yvel), 0, linVelocity.z]
  926. own.setLinearVelocity(force, True)
  927. if linVelocity.x < .05 and linVelocity.x > -.05 and own["lastStop"] == True:
  928. own["lastStop"] == False
  929. def oposin():
  930. if ground_since > 30:
  931. if (r_ground.triggered == 1) and STANCE == False and own['manual'] == 0:
  932. if grindold == 0:
  933. own['requestAction'] = 'reg_opos'
  934. elif (r_ground.triggered == 1) and STANCE == True and own['manual'] == 0:
  935. if grindold == 0:
  936. own['requestAction'] = 'fak_opos'
  937. own["last_Opos"] = True
  938. def noposin():
  939. if ground_since > 30:
  940. if (r_ground.triggered == 1) and STANCE == False and own['manual'] == 0:
  941. if grindold == 0:
  942. own['requestAction'] = 'reg_nopos'
  943. elif (r_ground.triggered == 1) and STANCE == True and own['manual'] == 0:
  944. if grindold == 0:
  945. own['requestAction'] = 'fak_nopos'
  946. own["last_nOpos"] = True
  947. def aollie():
  948. print("ollie")
  949. dict['trick_string'] = 'Ollie'
  950. r_ground = cont.sensors["r_Ground"]
  951. trigger = r_ground.triggered
  952. STANCE = own["stance"]
  953. wallride = own["wallride"]
  954. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  955. own["wallride_off"] = 1
  956. own['requestAction'] = 'reg_ollie'
  957. jump()
  958. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  959. own["wallride_off"] = 1
  960. own['requestAction'] = 'fak_ollie'
  961. jump()
  962. def nollie():
  963. print("nollie")
  964. dict['trick_string'] = 'Nollie'
  965. r_ground = cont.sensors["r_Ground"]
  966. trigger = r_ground.triggered
  967. STANCE = own["stance"]
  968. if (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  969. own['requestAction'] = 'fak_nollie'
  970. own["wallride_off"] = 1
  971. jump()
  972. elif (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  973. own["wallride_off"] = 1
  974. own['requestAction'] = 'reg_nollie'
  975. jump()
  976. def kickflip():
  977. print("kickflip")
  978. dict['trick_string'] = 'Kickflip'
  979. STANCE = own["stance"]
  980. print(flip_start_lay)
  981. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  982. own["wallride_off"] = 1
  983. own['requestAction'] = 'reg_kickflip'
  984. jump()
  985. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  986. own["wallride_off"] = 1
  987. own['requestAction'] = 'fak_kickflip'
  988. jump()
  989. if own["wallride"] !=1: jump()
  990. if r_ground.triggered == 0 and STANCE == False:
  991. own["wallride_off"] = 1
  992. own['requestAction'] = 'reg_kickflip'
  993. if own["wallride"] != None:
  994. jump()
  995. elif r_ground.triggered == 0 and STANCE == True:
  996. own["wallride_off"] = 1
  997. own['requestAction'] = 'fak_kickflip'
  998. if own["wallride"] != None:
  999. jump()
  1000. def varial_kickflip():
  1001. print("varial kickflip")
  1002. dict['trick_string'] = 'Varial Kickflip'
  1003. STANCE = own["stance"]
  1004. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1005. own["wallride_off"] = 1
  1006. own['requestAction'] = 'reg_varial_kickflip'
  1007. jump()
  1008. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1009. own["wallride_off"] = 1
  1010. own['requestAction'] = 'fak_varial_kickflip'
  1011. jump()
  1012. if r_ground.triggered == 0 and STANCE == False:
  1013. own["wallride_off"] = 1
  1014. if own["wallride"] != None:
  1015. jump()
  1016. elif r_ground.triggered == 0 and STANCE == True:
  1017. own["wallride_off"] = 1
  1018. if own["wallride"] != None:
  1019. jump()
  1020. def nollie_varial_kickflip():
  1021. print("nollie varial kickflip")
  1022. dict['trick_string'] = 'Nollie Varial Kickflip'
  1023. STANCE = own["stance"]
  1024. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1025. own["wallride_off"] = 1
  1026. own['requestAction'] = 'reg_nollie_varial_kickflip'
  1027. jump()
  1028. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1029. own["wallride_off"] = 1
  1030. own['requestAction'] = 'fak_nollie_varial_kickflip'
  1031. jump()
  1032. if r_ground.triggered == 0 and STANCE == False:
  1033. own["wallride_off"] = 1
  1034. if own["wallride"] != None:
  1035. jump()
  1036. elif r_ground.triggered == 0 and STANCE == True:
  1037. own["wallride_off"] = 1
  1038. if own["wallride"] != None:
  1039. jump()
  1040. def nollie_varial_heelflip():
  1041. print("nollie varial heelflip")
  1042. dict['trick_string'] = 'Nollie Varial Heelflip'
  1043. STANCE = own["stance"]
  1044. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1045. own["wallride_off"] = 1
  1046. own['requestAction'] = 'reg_nollie_varial_heelflip'
  1047. jump()
  1048. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1049. own["wallride_off"] = 1
  1050. own['requestAction'] = 'fak_nollie_varial_heelflip'
  1051. jump()
  1052. if r_ground.triggered == 0 and STANCE == False:
  1053. own["wallride_off"] = 1
  1054. if own["wallride"] != None:
  1055. jump()
  1056. elif r_ground.triggered == 0 and STANCE == True:
  1057. own["wallride_off"] = 1
  1058. if own["wallride"] != None:
  1059. jump()
  1060. def varial_heelflip():
  1061. print("varial heelflip")
  1062. dict['trick_string'] = 'Varial Heelflip'
  1063. STANCE = own["stance"]
  1064. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1065. own["wallride_off"] = 1
  1066. own['requestAction'] = 'reg_varial_heelflip'
  1067. jump()
  1068. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1069. own["wallride_off"] = 1
  1070. own['requestAction'] = 'fak_varial_heelflip'
  1071. jump()
  1072. if r_ground.triggered == 0 and STANCE == False:
  1073. own["wallride_off"] = 1
  1074. if own["wallride"] != None:
  1075. jump()
  1076. elif r_ground.triggered == 0 and STANCE == True:
  1077. own["wallride_off"] = 1
  1078. if own["wallride"] != None:
  1079. jump()
  1080. def nollie_kickflip():
  1081. print("kickflip")
  1082. STANCE = own["stance"]
  1083. dict['trick_string'] = 'Nollie Kickflip'
  1084. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1085. own["wallride_off"] = 1
  1086. own['requestAction'] = 'reg_nollie_kickflip'
  1087. jump()
  1088. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1089. own["wallride_off"] = 1
  1090. own['requestAction'] = 'fak_nollie_kickflip'
  1091. jump()
  1092. if r_ground.triggered == 0 and STANCE == False:
  1093. own["wallride_off"] = 1
  1094. elif r_ground.triggered == 0 and STANCE == True:
  1095. own["wallride_off"] = 1
  1096. def heelflip():
  1097. print("heelflip")
  1098. dict['trick_string'] = 'Heelflip'
  1099. STANCE = own["stance"]
  1100. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1101. own["wallride_off"] = 1
  1102. own['requestAction'] = 'reg_heelflip'
  1103. jump()
  1104. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1105. own["wallride_off"] = 1
  1106. own['requestAction'] = 'fak_heelflip'
  1107. jump()
  1108. if r_ground.triggered == 0 and STANCE == False:
  1109. own["wallride_off"] = 1
  1110. elif r_ground.triggered == 0 and STANCE == True:
  1111. own["wallride_off"] = 1
  1112. def nollie_heelflip():
  1113. print("heelflip")
  1114. dict['trick_string'] = 'Nollie Heelflip'
  1115. STANCE = own["stance"]
  1116. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1117. own["wallride_off"] = 1
  1118. own['requestAction'] = 'reg_nollie_heelflip'
  1119. jump()
  1120. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1121. own["wallride_off"] = 1
  1122. own['requestAction'] = 'fak_nollie_heelflip'
  1123. jump()
  1124. if r_ground.triggered == 0 and STANCE == False:
  1125. own["wallride_off"] = 1
  1126. if own["wallride"] != None:
  1127. jump()
  1128. elif r_ground.triggered == 0 and STANCE == True:
  1129. own["wallride_off"] = 1
  1130. if own["wallride"] != None:
  1131. jump()
  1132. def shovit():
  1133. print("shovit")
  1134. dict['trick_string'] = 'Shovit'
  1135. STANCE = own["stance"]
  1136. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1137. own["wallride_off"] = 1
  1138. own['requestAction'] = 'reg_shovit'
  1139. jump()
  1140. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1141. own["wallride_off"] = 1
  1142. own['requestAction'] = 'fak_shovit'
  1143. jump()
  1144. if r_ground.triggered == 0 and STANCE == False:
  1145. if own["wallride"] != None:
  1146. jump()
  1147. elif r_ground.triggered == 0 and STANCE == True:
  1148. own["wallride_off"] = 1
  1149. if own["wallride"] != None:
  1150. jump()
  1151. def shovit360():
  1152. print("360shovit")
  1153. dict['trick_string'] = '360 Shovit'
  1154. STANCE = own["stance"]
  1155. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1156. own["wallride_off"] = 1
  1157. own['requestAction'] = 'reg_shovit360'
  1158. jump()
  1159. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1160. own["wallride_off"] = 1
  1161. own['requestAction'] = 'fak_shovit360'
  1162. jump()
  1163. if r_ground.triggered == 0 and STANCE == False:
  1164. own["wallride_off"] = 1
  1165. if own["wallride"] != None:
  1166. jump()
  1167. elif r_ground.triggered == 0 and STANCE == True:
  1168. own["wallride_off"] = 1
  1169. if own["wallride"] != None:
  1170. jump()
  1171. def fsshovit360():
  1172. print("360shovit")
  1173. dict['trick_string'] = '360 Shovit'
  1174. STANCE = own["stance"]
  1175. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1176. own["wallride_off"] = 1
  1177. own['requestAction'] = 'reg_fsshovit360'
  1178. jump()
  1179. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1180. own["wallride_off"] = 1
  1181. own['requestAction'] = 'fak_fsshovit360'
  1182. jump()
  1183. if r_ground.triggered == 0 and STANCE == False:
  1184. own["wallride_off"] = 1
  1185. if own["wallride"] != None:
  1186. jump()
  1187. elif r_ground.triggered == 0 and STANCE == True:
  1188. own["wallride_off"] = 1
  1189. if own["wallride"] != None:
  1190. jump()
  1191. def nollie_shovit():
  1192. print("shovit")
  1193. dict['trick_string'] = 'Nollie Shovit'
  1194. STANCE = own["stance"]
  1195. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1196. own["wallride_off"] = 1
  1197. own['requestAction'] = 'reg_nollie_shovit'
  1198. jump()
  1199. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1200. own["wallride_off"] = 1
  1201. own['requestAction'] = 'fak_nollie_shovit'
  1202. jump()
  1203. if r_ground.triggered == 0 and STANCE == False:
  1204. own["wallride_off"] = 1
  1205. if own["wallride"] != None:
  1206. jump()
  1207. elif r_ground.triggered == 0 and STANCE == True:
  1208. own["wallride_off"] = 1
  1209. if own["wallride"] != None:
  1210. jump()
  1211. def fsshovit():
  1212. dict['trick_string'] = 'Frontside Shovit'
  1213. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1214. own["wallride_off"] = 1
  1215. own['requestAction'] = 'reg_fsshovit'
  1216. jump()
  1217. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1218. own["wallride_off"] = 1
  1219. own['requestAction'] = 'fak_fsshovit'
  1220. jump()
  1221. if r_ground.triggered == 0 and STANCE == False:
  1222. own["wallride_off"] = 1
  1223. if own["wallride"] != None:
  1224. jump()
  1225. elif r_ground.triggered == 0 and STANCE == True:
  1226. own["wallride_off"] = 1
  1227. if own["wallride"] != None:
  1228. jump()
  1229. def nollie_fsshovit():
  1230. dict['trick_string'] = 'Nollie Frontside Shovit'
  1231. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1232. own["wallride_off"] = 1
  1233. own['requestAction'] = 'reg_nollie_fsshovit'
  1234. jump()
  1235. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1236. own["wallride_off"] = 1
  1237. own['requestAction'] = 'fak_nollie_fsshovit'
  1238. jump()
  1239. if r_ground.triggered == 0 and STANCE == False:
  1240. own["wallride_off"] = 1
  1241. if own["wallride"] != None:
  1242. jump()
  1243. elif r_ground.triggered == 0 and STANCE == True:
  1244. own["wallride_off"] = 1
  1245. if own["wallride"] != None:
  1246. jump()
  1247. #nollie_shovit360()
  1248. def nollie_shovit360():
  1249. dict['trick_string'] = 'Nollie Frontside Shovit 360'
  1250. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1251. own["wallride_off"] = 1
  1252. own['requestAction'] = 'reg_nollie_shovit360'
  1253. jump()
  1254. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1255. own["wallride_off"] = 1
  1256. own['requestAction'] = 'fak_nollie_shovit360'
  1257. jump()
  1258. if r_ground.triggered == 0 and STANCE == False:
  1259. own["wallride_off"] = 1
  1260. if own["wallride"] != None:
  1261. jump()
  1262. elif r_ground.triggered == 0 and STANCE == True:
  1263. own["wallride_off"] = 1
  1264. if own["wallride"] != None:
  1265. jump()
  1266. #nollie_fsshovit360()
  1267. def nollie_fsshovit360():
  1268. dict['trick_string'] = 'Nollie Frontside Shovit'
  1269. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1270. own["wallride_off"] = 1
  1271. own['requestAction'] = 'reg_nollie_fsshovit'
  1272. jump()
  1273. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1274. own["wallride_off"] = 1
  1275. own['requestAction'] = 'fak_nollie_fsshovit'
  1276. jump()
  1277. if r_ground.triggered == 0 and STANCE == False:
  1278. own["wallride_off"] = 1
  1279. if own["wallride"] != None:
  1280. jump()
  1281. elif r_ground.triggered == 0 and STANCE == True:
  1282. own["wallride_off"] = 1
  1283. if own["wallride"] != None:
  1284. jump()
  1285. def reg_judo_grab_on():
  1286. GRAB_PLAYED = own["GRAB_PLAYED"]
  1287. GRAB_ON = own["GRAB_ON"]
  1288. dict['trick_string'] = 'Judo Grab'
  1289. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1290. own['requestAction'] = 'reg_judo'
  1291. grablay2 = grablay + 1
  1292. GRAB_PLAYED = True
  1293. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1294. def fak_judo_grab_on():
  1295. GRAB_PLAYED = own["GRAB_PLAYED"]
  1296. GRAB_ON = own["GRAB_ON"]
  1297. dict['trick_string'] = 'Fak Judo Grab'
  1298. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1299. own['requestAction'] = 'fak_judo'
  1300. grablay2 = grablay + 1
  1301. GRAB_PLAYED = True
  1302. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1303. def frontside_grab_on():
  1304. GRAB_PLAYED = own["GRAB_PLAYED"]
  1305. GRAB_ON = own["GRAB_ON"]
  1306. dict['trick_string'] = 'Mute Grab'
  1307. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1308. own['requestAction'] = 'frontside_grab'
  1309. #skater.playAction("reg_fg", 10,30, layer=400, priority=5, play_mode=1, speed=.5)
  1310. grablay2 = grablay + 1
  1311. GRAB_PLAYED = True
  1312. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1313. elif r_ground.triggered == 1:
  1314. killact(400)
  1315. killact(401)
  1316. def backside_grab_on():
  1317. GRAB_PLAYED = own["GRAB_PLAYED"]
  1318. GRAB_ON = own["GRAB_ON"]
  1319. if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
  1320. own['requestAction'] = 'reg_fp_rback'
  1321. elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1322. own['requestAction'] = 'backside_grab'
  1323. GRAB_PLAYED = True
  1324. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1325. elif r_ground.triggered == 1:
  1326. killact(402)
  1327. def fakfrontside_grab_on():
  1328. GRAB_PLAYED = own["GRAB_PLAYED"]
  1329. GRAB_ON = own["GRAB_ON"]
  1330. if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
  1331. own['requestAction'] = 'fak_fp_rback'
  1332. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1333. own['requestAction'] = 'fak_frontside_grab'
  1334. GRAB_PLAYED = True
  1335. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1336. elif r_ground.triggered == 1:
  1337. killact(403)
  1338. def fakbackside_grab_on():
  1339. GRAB_PLAYED = own["GRAB_PLAYED"]
  1340. GRAB_ON = own["GRAB_ON"]
  1341. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1342. own['requestAction'] = 'fak_backside_grab'
  1343. GRAB_PLAYED = True
  1344. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1345. elif r_ground.triggered == 1:
  1346. killact(404)
  1347. #nose/tail grabs
  1348. def frontside_nose_grab_on():
  1349. GRAB_PLAYED = own["GRAB_PLAYED"]
  1350. GRAB_ON = own["GRAB_ON"]
  1351. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1352. own['requestAction'] = 'frontside_nose_grab'
  1353. GRAB_PLAYED = True
  1354. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1355. elif r_ground.triggered == 1:
  1356. killact(400)
  1357. #print("frontside nosegrab on")
  1358. def frontside_tail_grab_on():
  1359. GRAB_PLAYED = own["GRAB_PLAYED"]
  1360. GRAB_ON = own["GRAB_ON"]
  1361. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1362. own['requestAction'] = 'frontside_tail_grab'
  1363. GRAB_PLAYED = True
  1364. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1365. elif r_ground.triggered == 1:
  1366. killact(400)
  1367. #print("frontside tailgrab on")
  1368. def backside_nose_grab_on():
  1369. GRAB_PLAYED = own["GRAB_PLAYED"]
  1370. GRAB_ON = own["GRAB_ON"]
  1371. #airwalk
  1372. if GRAB_ON == True and r_ground.triggered == 0 and (aBut == True):
  1373. print("airwalk")
  1374. skater.playAction("reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
  1375. deck.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
  1376. trucks.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
  1377. #norm
  1378. elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1379. own['requestAction'] = 'backside_nose_grab'
  1380. GRAB_PLAYED = True
  1381. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1382. elif r_ground.triggered == 1:
  1383. killact(405)
  1384. #print("backside nosegrab on")
  1385. def backside_tail_grab_on():
  1386. GRAB_PLAYED = own["GRAB_PLAYED"]
  1387. GRAB_ON = own["GRAB_ON"]
  1388. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1389. own['requestAction'] = 'backside_tail_grab'
  1390. GRAB_PLAYED = True
  1391. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1392. elif r_ground.triggered == 1:
  1393. killact(411)
  1394. #print("backside tailgrab on")
  1395. #switch
  1396. def fak_frontside_nose_grab_on():
  1397. GRAB_PLAYED = own["GRAB_PLAYED"]
  1398. GRAB_ON = own["GRAB_ON"]
  1399. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1400. own['requestAction'] = 'fak_frontside_nose_grab'
  1401. GRAB_PLAYED = True
  1402. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1403. elif r_ground.triggered == 1:
  1404. killact(406)
  1405. #print("fak frontside nosegrab on")
  1406. def fak_frontside_tail_grab_on():
  1407. GRAB_PLAYED = own["GRAB_PLAYED"]
  1408. GRAB_ON = own["GRAB_ON"]
  1409. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1410. own['requestAction'] = 'fak_frontside_tail_grab'
  1411. GRAB_PLAYED = True
  1412. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1413. elif r_ground.triggered == 1:
  1414. killact(412)
  1415. #print("fak frontside tailgrab on")
  1416. def fak_backside_nose_grab_on():
  1417. GRAB_PLAYED = own["GRAB_PLAYED"]
  1418. GRAB_ON = own["GRAB_ON"]
  1419. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1420. own['requestAction'] = 'fak_backside_nose_grab'
  1421. GRAB_PLAYED = True
  1422. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1423. elif r_ground.triggered == 1:
  1424. killact(408)
  1425. #print("fak backside nosegrab on")
  1426. def fak_backside_tail_grab_on():
  1427. GRAB_PLAYED = own["GRAB_PLAYED"]
  1428. GRAB_ON = own["GRAB_ON"]
  1429. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1430. own['requestAction'] = 'fak_backside_tail_grab'
  1431. GRAB_PLAYED = True
  1432. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1433. elif r_ground.triggered == 1:
  1434. killact(410)
  1435. #print("fak backside tailgrab on")
  1436. #--------------------
  1437. def SWAG():
  1438. if r_ground.triggered == 1:
  1439. SWAG = own["swag"]
  1440. SWAG = own.getLinearVelocity(True)
  1441. SWAG = SWAG[1]
  1442. own["swag"] = SWAG
  1443. if STANCE == True:
  1444. if SWAG > 1 and SWAG < 2:
  1445. rotation = [ 0.0, 0, (SWAG / 200)]
  1446. own.applyRotation( rotation, True)
  1447. elif SWAG > 2:
  1448. rotation = [ 0.0, 0, (SWAG / 50)]
  1449. own.applyRotation( rotation, True)
  1450. elif SWAG < -1 and SWAG > -2:
  1451. rotation = [ 0.0, 0, (SWAG / 200)]
  1452. own.applyRotation( rotation, True)
  1453. elif SWAG < -2:
  1454. rotation = [ 0.0, 0, (SWAG / 50)]
  1455. own.applyRotation( rotation, True)
  1456. if STANCE == False:
  1457. if SWAG > 1 and SWAG < 2:
  1458. rotation = [ 0.0, 0, (-SWAG / 200)]
  1459. own.applyRotation( rotation, True)
  1460. elif SWAG > 2:
  1461. rotation = [ 0.0, 0, (-SWAG / 50)]
  1462. own.applyRotation( rotation, True)
  1463. elif SWAG < -1 and SWAG > -2:
  1464. rotation = [ 0.0, 0, (-SWAG / 200)]
  1465. own.applyRotation( rotation, True)
  1466. elif SWAG < -2:
  1467. rotation = [ 0.0, 0, (-SWAG / 50)]
  1468. own.applyRotation( rotation, True)
  1469. def air():
  1470. if r_ground.triggered == False and own['airup'] == 0:
  1471. distance = own.getDistanceTo(gray.hitPosition)
  1472. since_grind_buf = 3
  1473. if gray.hitObject != None and grindDar2.triggered == False and (frame - lgf) > since_grind_buf:
  1474. if distance < .5:
  1475. own.alignAxisToVect(gray.hitNormal, 2, .1)
  1476. elif distance >= .5 and distance < 1.75:
  1477. own.alignAxisToVect(gray.hitNormal, 2, .05)
  1478. elif distance >= 1.75:
  1479. own.alignAxisToVect([0.0,0.0,1.0], 2, .03)
  1480. if grindDar2.triggered and (frame - lgf) > since_grind_buf:
  1481. if distance < .5:
  1482. own.alignAxisToVect(gray.hitNormal, 2, .1)
  1483. elif distance >= .5 and distance < 1.75:
  1484. own.alignAxisToVect(gray.hitNormal, 2, .03)
  1485. elif distance >= 1.75:
  1486. own.alignAxisToVect([0.0,0.0,1.0], 2, .03)
  1487. elif r_ground.triggered == True:
  1488. pass
  1489. def stopAnims():
  1490. pass
  1491. def isplaying():
  1492. # for x in range(9000):
  1493. # l1 = deck.isPlayingAction(x)
  1494. # if l1 == True:
  1495. # print(x)
  1496. pass
  1497. def nextframe():
  1498. framenumber = own["framenum"]
  1499. framenumber = framenumber + 1
  1500. if framenumber == 900000:
  1501. framenumber = 0
  1502. own["framenum"] = framenumber
  1503. own['last_roll_frame'] = framenumber
  1504. def push():
  1505. local = True
  1506. #print("push")
  1507. linVelocity15 = own.linearVelocity
  1508. if linVelocity15.x < MAX_VEL and linVelocity15.x >= -0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0 and own['last_footplant'] == False:
  1509. countdown = COUNTDOWN
  1510. yvel = linVelocity15.x + SPEEDUP
  1511. own['countdown'] = countdown
  1512. force = [(yvel), 0, linVelocity15.z]
  1513. own.setLinearVelocity(force, local)
  1514. own['requestAction'] = 'fak_push_goof'
  1515. #switch
  1516. if linVelocity15.x > -MAX_VEL and linVelocity15.x < 0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0:
  1517. countdown = COUNTDOWN
  1518. yvel = linVelocity15.x - SPEEDUP
  1519. own['countdown'] = countdown
  1520. force = [(yvel), 0, linVelocity15.z]
  1521. own.setLinearVelocity(force, local)
  1522. own['requestAction'] = 'reg_push'
  1523. def push_goof():
  1524. linVelocity15 = own.linearVelocity
  1525. local = True
  1526. #print("push goof")
  1527. if linVelocity15.x < MAX_VEL and linVelocity15.x >= -0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0:
  1528. countdown = COUNTDOWN
  1529. yvel = linVelocity15.x + SPEEDUP
  1530. own['countdown'] = countdown
  1531. force = [(yvel), 0, linVelocity15.z]
  1532. own.setLinearVelocity(force, local)
  1533. own['requestAction'] = 'fak_push'
  1534. #switch
  1535. if linVelocity15.x > -MAX_VEL and linVelocity15.x < 0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0:
  1536. countdown = COUNTDOWN
  1537. yvel = linVelocity15.x - SPEEDUP
  1538. own['countdown'] = countdown
  1539. force = [(yvel), 0, linVelocity15.z]
  1540. own.setLinearVelocity(force, local)
  1541. own['requestAction'] = 'reg_push_goof'
  1542. def brfoot():
  1543. lay = grablay + 40
  1544. if STANCE == 0:
  1545. own['requestAction'] = 'reg_brfoot'
  1546. if STANCE == 1:
  1547. own['requestAction'] = 'fak_brfoot'
  1548. jump()
  1549. def frfoot():
  1550. lay = grablay + 40
  1551. killact(5)
  1552. if STANCE == 0:
  1553. own['requestAction'] = 'reg_frfoot'
  1554. if STANCE == 1:
  1555. own['requestAction'] = 'fak_frfoot'
  1556. jump()
  1557. def blfoot():
  1558. lay = grablay + 40
  1559. killact(5)
  1560. if STANCE == 0:
  1561. own['requestAction'] = 'reg_blfoot'
  1562. if STANCE == 1:
  1563. own['requestAction'] = 'fak_blfoot'
  1564. jump()
  1565. def flfoot():
  1566. lay = grablay + 40
  1567. killact(5)
  1568. if STANCE == 0:
  1569. own['requestAction'] = 'reg_flfoot'
  1570. if STANCE == 1:
  1571. own['requestAction'] = 'fak_flfoot'
  1572. jump()
  1573. def rollsound():
  1574. #onground
  1575. if r_ground.triggered == 1 and grindDar == 0 and own['invert_on'] == 0:
  1576. num1 = .05
  1577. num2 = .25
  1578. if linVelocity.x <= -num1 and linVelocity.x >= num1:
  1579. own.actuators["sroll"].volume = .0001
  1580. cont.deactivate(own.actuators["sroll"])
  1581. own.actuators["sroll"].stopSound()
  1582. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1583. own.actuators["sroll"].volume = .02
  1584. own.actuators["sroll"].pitch = .65
  1585. num1 = .25
  1586. num2 = .5
  1587. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1588. own.actuators["sroll"].volume = .03
  1589. own.actuators["sroll"].pitch = .7
  1590. num1 = .5
  1591. num2 = .75
  1592. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1593. own.actuators["sroll"].volume = .04
  1594. own.actuators["sroll"].pitch = .75
  1595. num1 = .75
  1596. num2 = 1
  1597. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1598. own.actuators["sroll"].volume = .05
  1599. own.actuators["sroll"].pitch = .8
  1600. num1 = 1
  1601. num2 = 1.5
  1602. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1603. own.actuators["sroll"].volume = .06
  1604. own.actuators["sroll"].pitch = .85
  1605. num1 = 1.5
  1606. num2 = 2
  1607. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1608. own.actuators["sroll"].volume = .07
  1609. own.actuators["sroll"].pitch = .9
  1610. num1 = 2
  1611. num2 = 3
  1612. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1613. own.actuators["sroll"].volume = .08
  1614. own.actuators["sroll"].pitch = .95
  1615. num1 = 3
  1616. num2 = 4
  1617. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1618. own.actuators["sroll"].volume = .09
  1619. own.actuators["sroll"].pitch = 1
  1620. num1 = 4
  1621. num2 = 5
  1622. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1623. own.actuators["sroll"].volume = .11
  1624. own.actuators["sroll"].pitch = 1.05
  1625. num1 = 5
  1626. num2 = 6
  1627. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1628. own.actuators["sroll"].volume = .1
  1629. own.actuators["sroll"].pitch = 1.1
  1630. own.actuators['sroll'].mode = 2
  1631. cont.activate(own.actuators["sroll"])
  1632. if grindDar == 1 or own['invert_on'] == 1:
  1633. own.actuators["sroll"].volume = .0001
  1634. cont.deactivate(own.actuators["sroll"])
  1635. own.actuators["sroll"].stopSound()
  1636. #in air
  1637. if r_ground.triggered == False:
  1638. own.actuators["sroll"].volume = .0001
  1639. cont.deactivate(own.actuators["sroll"])
  1640. own.actuators["sroll"].stopSound()
  1641. act = cont.actuators["sroll"]
  1642. own['sroll_vol'] = act.volume
  1643. own['sroll_pitch'] = act.pitch
  1644. def wheelroll():
  1645. #still
  1646. if linVelocity.x <= -0.05 and linVelocity.x >= 0.05:
  1647. wheel1.stopAction(2)
  1648. wheel2.stopAction(2)
  1649. wheel3.stopAction(2)
  1650. wheel4.stopAction(2)
  1651. #regular
  1652. if linVelocity.x > 0.05 and linVelocity.x < .5:
  1653. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=0, speed=.25)
  1654. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=0, speed=.25)
  1655. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=0, speed=.25)
  1656. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=0, speed=.25)
  1657. if linVelocity.x > 0.5 and linVelocity.x < 1:
  1658. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=1, speed=1)
  1659. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=1, speed=1)
  1660. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=1, speed=1)
  1661. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=1, speed=1)
  1662. if linVelocity.x > 1 and linVelocity.x < 4:
  1663. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1664. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1665. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1666. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1667. if linVelocity.x > 4:
  1668. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=1, speed=2)
  1669. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=1, speed=2)
  1670. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=1, speed=2)
  1671. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=1, speed=2)
  1672. #switch
  1673. if linVelocity.x < -0.05 and linVelocity.x > -.5:
  1674. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=0, speed=.25)
  1675. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=0, speed=.25)
  1676. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=0, speed=.25)
  1677. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=0, speed=.25)
  1678. if linVelocity.x < -0.5 and linVelocity.x > -1:
  1679. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=1, speed=1)
  1680. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=1)
  1681. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=1)
  1682. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=1)
  1683. if linVelocity.x < -1 and linVelocity > -4:
  1684. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1685. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1686. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1687. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1688. if linVelocity.x < -4:
  1689. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=1, speed=2)
  1690. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=2)
  1691. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=2)
  1692. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=2)
  1693. def transspeed():
  1694. num1 = .1
  1695. num2 = .4
  1696. speed = 20
  1697. def turn():
  1698. rotamt = .02
  1699. linVelocity2 = own.getLinearVelocity(True)
  1700. speed = .002
  1701. manual = 0
  1702. if own['manual_v2'] == 1:
  1703. manual = 1
  1704. if abs(linVelocity.x) < 2:
  1705. speed = .005
  1706. jumpstance = own['jump_stance']
  1707. if lLR > turnsens or lLR < -turnsens:
  1708. own["turn"] = 1
  1709. else:
  1710. own["turn"] = 0
  1711. if lUD > turnsens or lUD < -turnsens:
  1712. own["turnud"] = 1
  1713. else:
  1714. own["turnud"] = 0
  1715. #light
  1716. #if manual and grindhit = true
  1717. if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  1718. rotation = [ 0.0, 0.0, (-rotamt)]
  1719. local = False # use world axis
  1720. own.applyRotation( rotation, local)
  1721. if r_ground.triggered == True:
  1722. #print("light turn")
  1723. if STANCE == 0:
  1724. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  1725. if STANCE == 1:
  1726. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  1727. if lLR < -turnsens and lLR > (turnsens * -1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  1728. rotation = [ 0.0, 0.0, rotamt]
  1729. local = False # use world axis
  1730. own.applyRotation( rotation, local)
  1731. if r_ground.triggered == True:
  1732. #print("light turn")
  1733. if STANCE == 0:
  1734. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  1735. if STANCE == 1:
  1736. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  1737. #medium
  1738. if lLR > (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  1739. #turn left
  1740. if rot.z < .4:
  1741. rotation = [ 0.0, 0.0, (-rotamt * 5)]
  1742. if rot.z < .6 and rot.z > .4:
  1743. rotation = [ 0.0, 0.0, (-rotamt * 2)]
  1744. else:
  1745. rotation = [ 0.0, 0.0, (-rotamt * 1.6)]
  1746. local = True # use world axis
  1747. own.applyRotation( rotation, local)
  1748. if r_ground.triggered == True:
  1749. #print("med turn")
  1750. if STANCE == 0:
  1751. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  1752. if STANCE == 1:
  1753. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  1754. if lLR < (-turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  1755. #turn right
  1756. if rot.z < .4:
  1757. rotation = [ 0.0, 0.0, (rotamt * 5)]
  1758. if rot.z < .6 and rot.z > .4:
  1759. rotation = [ 0.0, 0.0, (rotamt * 2)]
  1760. else:
  1761. rotation = [ 0.0, 0.0, (rotamt * 1.6)]
  1762. local = True # use world axis
  1763. own.applyRotation( rotation, local)
  1764. if r_ground.triggered == True:
  1765. #print("med turn")
  1766. if STANCE == 0:
  1767. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  1768. if STANCE == 1:
  1769. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  1770. #air
  1771. if r_ground.triggered == False and lLR > turnsens and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
  1772. rotamt = .07
  1773. if STANCE == 0:
  1774. own.applyRotation([0,0,-rotamt], 1)
  1775. if STANCE == 1:
  1776. own.applyRotation([0,0,-rotamt], 1)
  1777. if r_ground.triggered == False and lLR < -turnsens and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
  1778. rotamt = .07
  1779. if STANCE == 0:
  1780. own.applyRotation([0,0,rotamt], 1)
  1781. if STANCE == 1:
  1782. own.applyRotation([0,0,rotamt], 1)
  1783. ###########
  1784. def grindsound():
  1785. dropin = own['dropinTimer']
  1786. lif = own['last_invert_frame']
  1787. if grindSound != None and grindHit == True and own['nogrindsound'] == 0:
  1788. if abs(linVelocity.x) > abs(linVelocity.y):
  1789. vel = linVelocity.x
  1790. elif abs(linVelocity.x) < abs(linVelocity.y):
  1791. vel = linVelocity.y
  1792. else:
  1793. vel = 0
  1794. if grindSound == "rail":
  1795. cont.deactivate(own.actuators['grind_cement'])
  1796. num1 = .000
  1797. num2 = .05
  1798. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1799. own.actuators["grind_rail"].volume = .0001
  1800. own.actuators["grind_rail"].pitch = .6
  1801. num1 = .05
  1802. num2 = .25
  1803. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1804. own.actuators["grind_rail"].volume = .05
  1805. own.actuators["grind_rail"].pitch = .7
  1806. num1 = .25
  1807. num2 = .5
  1808. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1809. own.actuators["grind_rail"].volume = .1
  1810. own.actuators["grind_rail"].pitch = .75
  1811. num1 = .5
  1812. num2 = .75
  1813. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1814. own.actuators["grind_rail"].volume = .14
  1815. own.actuators["grind_rail"].pitch = .8
  1816. num1 = .75
  1817. num2 = 1
  1818. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1819. own.actuators["grind_rail"].volume = .17
  1820. own.actuators["grind_rail"].pitch = .85
  1821. num1 = 1
  1822. num2 = 1.25
  1823. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1824. own.actuators["grind_rail"].volume = .18
  1825. own.actuators["grind_rail"].pitch = .9
  1826. num1 = 1.25
  1827. num2 = 2
  1828. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1829. own.actuators["grind_rail"].volume = .19
  1830. own.actuators["grind_rail"].pitch = .95
  1831. num1 = 2
  1832. num2 = 40
  1833. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1834. own.actuators["grind_rail"].volume = .19
  1835. own.actuators["grind_rail"].pitch = 1
  1836. cont.activate(own.actuators['grind_rail'])
  1837. if grindSound == "concrete":
  1838. #play sound
  1839. cont.deactivate(own.actuators['grind_rail'])
  1840. num1 = .000
  1841. num2 = .05
  1842. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1843. own.actuators["grind_cement"].volume = .01
  1844. own.actuators["grind_cement"].pitch = .6
  1845. num1 = .05
  1846. num2 = .25
  1847. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1848. own.actuators["grind_cement"].volume = .05
  1849. own.actuators["grind_cement"].pitch = .7
  1850. num1 = .25
  1851. num2 = .5
  1852. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1853. own.actuators["grind_cement"].volume = .1
  1854. own.actuators["grind_cement"].pitch = .75
  1855. num1 = .5
  1856. num2 = .75
  1857. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1858. own.actuators["grind_cement"].volume = .14
  1859. own.actuators["grind_cement"].pitch = .8
  1860. num1 = .75
  1861. num2 = 1
  1862. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1863. own.actuators["grind_cement"].volume = .17
  1864. own.actuators["grind_cement"].pitch = .85
  1865. num1 = 1
  1866. num2 = 1.25
  1867. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1868. own.actuators["grind_cement"].volume = .18
  1869. own.actuators["grind_cement"].pitch = .9
  1870. num1 = 1.25
  1871. num2 = 2
  1872. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1873. own.actuators["grind_cement"].volume = .19
  1874. own.actuators["grind_cement"].pitch = .95
  1875. num1 = 2
  1876. num2 = 40
  1877. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  1878. own.actuators["grind_cement"].volume = .19
  1879. own.actuators["grind_cement"].pitch = 1
  1880. cont.activate(own.actuators['grind_cement'])
  1881. else:
  1882. cont.deactivate(own.actuators['grind_cement'])
  1883. cont.deactivate(own.actuators['grind_rail'])
  1884. def record_grindsound():
  1885. dropin = own['dropinTimer']
  1886. lif = own['last_invert_frame']
  1887. if grindHit == True and dropin == 0 and own['invert_on'] == 0 and own["LAST_GRIND"] == True and own["nogrindsound"] == 0 and (frame - lif > 13):
  1888. if grindSound == "concrete":
  1889. act = own.actuators["grind_cement"]
  1890. own['grindcement_vol'] = act.volume
  1891. own['grindcement_pitch'] = act.pitch
  1892. elif grindSound == "rail":
  1893. act = own.actuators["grind_rail"]
  1894. own['grindrail_vol'] = act.volume
  1895. own['grindrail_pitch'] = act.pitch
  1896. if own["LAST_GRIND"] == False:
  1897. own['grindcement_vol'] = 0
  1898. own['grindcement_pitch'] = 0
  1899. own['grindrail_vol'] = 0
  1900. own['grindrail_pitch'] = 0
  1901. def grind():
  1902. grindsound()
  1903. STANCE = own["stance"]
  1904. jumpstance = own["jump_stance"]
  1905. lif = frame - own['last_invert_frame']
  1906. giniter = 0
  1907. if own['LAST_GRIND'] == False and grindHit == True:
  1908. own['grindstartFrame'] = own['framenum']
  1909. giniter = 1
  1910. #print(own['grindstartFrame'])
  1911. if grindHit == True and own['invert_on'] == 0 and own['footplant_on'] == False and own['manual'] == 0 and lif > 40 and own['dropinTimer'] < 30 and giniter == 0:
  1912. control_bottom = scene.objects['control_bottom']
  1913. grindTouch = control_bottom.sensors['grindCol_bottom']
  1914. edge = 0
  1915. try:
  1916. if 'edge' in grindTouch.hitObject:
  1917. #print('Edge')
  1918. edge = 1
  1919. except:
  1920. pass
  1921. gblend = 1
  1922. if LAST_GRIND == 0:
  1923. gt = own['grindType']
  1924. tempstance = 3
  1925. if jumpstance != 3:
  1926. tempstance = jumpstance
  1927. else:
  1928. tempstance = STANCE
  1929. grindpos = own['grindpos']
  1930. if grindpos == "reg_5050" and own['grindType'] == "empty":
  1931. own['grindType'] = grindpos
  1932. if own['grindType'] == "empty" and grindpos == 'reg_board':
  1933. if STANCE == 0:
  1934. own['grindType'] = "reg_bsboard"
  1935. else:
  1936. own['grindType'] = "fak_bsboard"
  1937. if STANCE == True:
  1938. if own['grindType'] == "reg_bsboard":
  1939. own['grind_stance'] = 0
  1940. own['requestAction'] = 'reg_bsboard'
  1941. elif own['grindType'] == "fak_bsboard":
  1942. own['grind_stance'] = 1
  1943. own['requestAction'] = 'fak_bsboard'
  1944. elif own['grindType'] == "reg_fsboard":
  1945. own['grind_stance'] = 0
  1946. own['requestAction'] = 'reg_fsboard'
  1947. elif own['grindType'] == "reg_tailg":
  1948. own['requestAction'] = 'reg_tailg'
  1949. elif own['grindType'] == "reg_tailgR":
  1950. own['requestAction'] = 'reg_tailgr'
  1951. elif own['grindType'] == "reg_tailgL":
  1952. own['requestAction'] = 'reg_tailgl'
  1953. elif own['grindType'] == "reg_noseg":
  1954. own['requestAction'] = 'reg_noseg'
  1955. elif own['grindType'] == "reg_nosegR":
  1956. own['requestAction'] = 'reg_nosegr'
  1957. elif own['grindType'] == "reg_nosegL":
  1958. own['requestAction'] = 'reg_nosegl'
  1959. elif own['grindType'] == "fak_noseg":
  1960. own['requestAction'] = 'fak_noseg'
  1961. elif own['grindType'] == "fak_nosegR":
  1962. own['requestAction'] = 'fak_nosegr'
  1963. elif own['grindType'] == "fak_nosegL":
  1964. own['requestAction'] = 'fak_nosegl'
  1965. elif own['grindType'] == "fak_tailg":
  1966. own['requestAction'] = 'fak_tailg'
  1967. elif own['grindType'] == "fak_tailgR":
  1968. own['requestAction'] = 'fak_tailgr'
  1969. elif own['grindType'] == "fak_tailgL":
  1970. own['requestAction'] = 'fak_tailgl'
  1971. elif own['grindType'] == "reg_tailslide":
  1972. own['requestAction'] = 'reg_tailslide'
  1973. elif own['grindType'] == "reg_noseslide":
  1974. own['requestAction'] = 'reg_noseslide'
  1975. elif own['grindType'] == "fak_tailslide":
  1976. own['requestAction'] = 'fak_tailslide'
  1977. elif own['grindType'] == "fak_noseslide":
  1978. own['requestAction'] = 'fak_noseslide'
  1979. elif own['grindType'] == "reg_tailslide" and edge == 1:
  1980. #own['requestAction'] = 'reg_tailslide'
  1981. own['requestAction'] = 'fak_noseslide'
  1982. STANCE = 0
  1983. elif own['grindType'] == "fak_tailslide":
  1984. own['requestAction'] = 'fak_tailslide'
  1985. own['grind_stance'] = 1
  1986. elif own['grindType'] == "reg_noseslide" and edge == 1:
  1987. #own['requestAction'] = 'reg_noseslide'
  1988. own['requestAction'] = 'fak_tailslide'
  1989. own['grind_stance'] = 0
  1990. elif own['grindType'] == "fak_noseslide":
  1991. own['requestAction'] = 'fak_noseslide'
  1992. own['grind_stance'] = 1
  1993. else:
  1994. if STANCE == 0:
  1995. own['requestAction'] = 'reg_5050'
  1996. if STANCE == 1:
  1997. own['requestAction'] = 'fak_5050'
  1998. elif STANCE == False:
  1999. if own['grindType'] == "reg_bsboard":
  2000. own['grind_stance'] = 0
  2001. own['requestAction'] = 'reg_bsboard'
  2002. elif own['grindType'] == "fak_bsboard":
  2003. own['grind_stance'] = 1
  2004. own['requestAction'] = 'fak_bsboard'
  2005. elif own['grindType'] == "reg_tailg":
  2006. own['grind_stance'] = 0
  2007. own['requestAction'] = 'reg_tailg'
  2008. elif own['grindType'] == "reg_tailgR":
  2009. own['requestAction'] = 'reg_tailgr'
  2010. elif own['grindType'] == "reg_tailgL":
  2011. own['requestAction'] = 'reg_tailgl'
  2012. elif own['grindType'] == "reg_noseg":
  2013. own['requestAction'] = 'reg_noseg'
  2014. elif own['grindType'] == "reg_nosegR":
  2015. own['requestAction'] = 'reg_nosegr'
  2016. elif own['grindType'] == "reg_nosegL":
  2017. own['requestAction'] = 'reg_nosegl'
  2018. elif own['grindType'] == "fak_noseg":
  2019. own['requestAction'] = 'fak_noseg'
  2020. elif own['grindType'] == "fak_nosegR":
  2021. own['requestAction'] = 'fak_nosegr'
  2022. elif own['grindType'] == "fak_nosegL":
  2023. own['requestAction'] = 'fak_nosegl'
  2024. elif own['grindType'] == "fak_tailg":
  2025. own['requestAction'] = 'fak_tailg'
  2026. elif own['grindType'] == "fak_tailgR":
  2027. own['requestAction'] = 'fak_tailgr'
  2028. elif own['grindType'] == "fak_tailgL":
  2029. own['requestAction'] = 'fak_tailgl'
  2030. elif own['grindType'] == "reg_tailslide":
  2031. own['requestAction'] = 'reg_tailslide'
  2032. elif own['grindType'] == "reg_noseslide":
  2033. own['requestAction'] = 'reg_noseslide'
  2034. elif own['grindType'] == "fak_tailslide":
  2035. own['requestAction'] = 'fak_tailslide'
  2036. elif own['grindType'] == "fak_noseslide":
  2037. own['requestAction'] = 'fak_noseslide'
  2038. elif own['grindType'] == "fak_tailslide" and edge == 1:
  2039. own['grind_stance'] = 1
  2040. own['requestAction'] = 'reg_noseslide'
  2041. elif own['grindType'] == "reg_noseslide":
  2042. own['grind_stance'] = 0
  2043. own['requestAction'] = 'reg_noseslide'
  2044. elif own['grindType'] == "fak_noseslide" and edge == 1:
  2045. own['grind_stance'] = 1
  2046. own['requestAction'] = 'reg_tailslide'
  2047. else:
  2048. if STANCE == 0:
  2049. own['requestAction'] = 'reg_5050'
  2050. if STANCE == 1:
  2051. own['requestAction'] = 'fak_5050'
  2052. if 'fak' in own['l_actionState']:
  2053. STANCE = 1
  2054. own['lg_stance'] = 1
  2055. lg_stance = 1
  2056. #print('changing stance 1')
  2057. if 'reg' in own['l_actionState']:
  2058. STANCE = 0
  2059. own['lg_stance'] = 0
  2060. lg_stance = 0
  2061. #print('changing stance 0')
  2062. own['stance'] = STANCE
  2063. def rotmult():
  2064. if r_ground.triggered:
  2065. num = ((rot.z * -1) +1)
  2066. num = num * 100
  2067. def airup():
  2068. if r_ground.triggered == False:
  2069. pos = own.worldPosition
  2070. pos = own.worldPosition.z
  2071. last_pos = own['last_posz']
  2072. if last_pos - pos > 0:
  2073. own['airup'] = 0
  2074. if last_pos - pos < 0:
  2075. own['airup'] = 1
  2076. if pos > own['last_posz']:
  2077. own["air_height"] = pos
  2078. own['last_posz'] = pos
  2079. def onramp():
  2080. if r_ground.positive:
  2081. if 'ramp' in r_ground.hitObject:
  2082. own['onramp'] = 1
  2083. else:
  2084. own['onramp'] = 0
  2085. else:
  2086. own['onramp'] = 0
  2087. def grindtype(gtype):
  2088. own['grindType'] = gtype
  2089. def transmult():
  2090. lastrotz = own["rotz"]
  2091. linvel = own.getLinearVelocity(True)
  2092. newx = (linvel.x + (linvel.x * .039))
  2093. if linvel.x < 7 and linvel.x > -7 and rot.z > lastrotz and r_ground.triggered == 1 and rot.z > .3 and rot.z < .93:
  2094. own.setLinearVelocity([newx, linvel.y, linvel.z], True)
  2095. def speedmult():
  2096. vel = own.getLinearVelocity(True)
  2097. xyz = own.worldOrientation.to_euler()
  2098. roty = math.degrees(xyz[1])
  2099. roty = abs(roty)
  2100. roty = roty * .0005
  2101. if abs(vel.x) > 1:
  2102. mult = .0015 + roty
  2103. else:
  2104. mult = .000
  2105. mult2 = .018
  2106. mult3 = .007
  2107. lastrotz = own["rotz"]
  2108. x = vel.x * mult
  2109. x2 = x + vel.x
  2110. x3 = vel.x * mult2
  2111. x4 = x3 + vel.x
  2112. x5 = vel.x * mult3
  2113. x6 = x5 + vel.x
  2114. if r_ground.triggered and vel.x < 4 and vel.x > -4:
  2115. own.setLinearVelocity([x2, vel.y, vel.z], True)
  2116. def coping():
  2117. if invertTouch.positive:
  2118. own["coping"] = 1
  2119. else:
  2120. own["coping"] = 0
  2121. #print(own['dropinTimer'], 'dtimer')
  2122. def onboard():
  2123. if own['walk'] == 1 and own['lasty'] == False and own['requestAction'] not in ['reg_dropin', 'fak_dropin']:
  2124. cont.deactivate(cam.actuators['replayCam'])
  2125. cont.activate(cam.actuators['Camera'])
  2126. killall()
  2127. walklay = 40
  2128. fliplay3 = 2060
  2129. ob_speed = .5
  2130. if STANCE == 0:
  2131. skater.stopAction(fliplay)
  2132. deck.stopAction(fliplay)
  2133. trucks.stopAction(fliplay)
  2134. killall()
  2135. if own['dropinCol'] == True:
  2136. own['requestAction'] = 'reg_dropin'
  2137. own['dropinTimer'] = 60
  2138. else:
  2139. own['requestAction'] = 'reg_onboard'
  2140. force = (linVelocity.x -1, linVelocity.y, linVelocity.z)
  2141. if own['dropinTimer'] == 0:
  2142. own.setLinearVelocity(force, True)
  2143. if STANCE == 1:
  2144. skater.stopAction(fliplay)
  2145. deck.stopAction(fliplay)
  2146. trucks.stopAction(fliplay)
  2147. killall()
  2148. if own['dropinCol'] == True:
  2149. own['requestAction'] = 'fak_dropin'
  2150. own['dropinTimer'] = 60
  2151. else:
  2152. own['requestAction'] = 'fak_onboard'
  2153. force = (linVelocity.x +1, linVelocity.y, linVelocity.z)
  2154. if own['dropinTimer'] == 0:
  2155. own.setLinearVelocity(force, True)
  2156. #force = (linVelocity.x +1, linVelocity.y, linVelocity.z)
  2157. #own.setLinearVelocity(force, True)
  2158. #own['dropinTimer'] = 60
  2159. else:
  2160. num = own['dropinTimer']
  2161. if num > 0:
  2162. num = num - 1
  2163. own['dropinTimer'] = num
  2164. def offboard():
  2165. wheel1.stopAction(2)
  2166. wheel2.stopAction(2)
  2167. wheel3.stopAction(2)
  2168. wheel4.stopAction(2)
  2169. cont.deactivate(own.actuators["sroll"])
  2170. sact = own.actuators["sroll"]
  2171. sact.volume = .0001
  2172. own.actuators["sroll"].stopSound()
  2173. own['offboard_vel'] = own.linearVelocity
  2174. own['walk_timer'] = 0
  2175. def resetjumpstance():
  2176. if LAST_GRIND == True and grindHit == False:
  2177. own["lF_ground_frame"] = own['framenum']
  2178. lfg = own["lF_ground_frame"]
  2179. #print(lfg, "----- this?")
  2180. if own['jump_stance'] != 3:
  2181. own['jump_stance'] = 3
  2182. def grass():
  2183. try:
  2184. if 'grass' in r_ground.hitObject:
  2185. linVel = own.getLinearVelocity(True)
  2186. linvelx = linVel.x * .98
  2187. own.setLinearVelocity((linvelx, linVel.y, linVel.z), 1)
  2188. except:
  2189. pass
  2190. def grindoutair():
  2191. skippy = 0
  2192. linVel = own.getLinearVelocity(True)
  2193. STANCE = own['stance']
  2194. if own['LAST_GRIND'] == True and grindHit == True:
  2195. own['lg_stance'] = STANCE
  2196. lg_stance = own['lg_stance']
  2197. own.actuators["grindoutair"].useLocalLinV = True
  2198. if own['grindjumpturn'] == True and own['grindCountdown'] > 12 and skippy == 0:
  2199. if 'fak' in own['l_actionState']:
  2200. STANCE = 1
  2201. own['lg_stance'] = 1
  2202. lg_stance = 1
  2203. #print('changing stance 1')
  2204. if 'reg' in own['l_actionState']:
  2205. STANCE = 0
  2206. own['lg_stance'] = 0
  2207. lg_stance = 0
  2208. #print('changing stance 0')
  2209. own['stance'] = STANCE
  2210. grindoutspeed = .1
  2211. grindoutspeed2 = 5.4
  2212. if lLR > turnsens:
  2213. if own['last_grindpos'] == 'reg_5050':
  2214. if STANCE == 0:
  2215. own.actuators["grindoutair"].linV = [0, grindoutspeed, 0]
  2216. else:
  2217. own.actuators["grindoutair"].linV = [0, -grindoutspeed, 0]
  2218. cont.activate(own.actuators["grindoutair"])
  2219. if lLR < -turnsens:
  2220. if own['last_grindpos'] == 'reg_5050':
  2221. if STANCE == 0:
  2222. own.actuators["grindoutair"].linV = [0, -grindoutspeed, 0]
  2223. else:
  2224. own.actuators["grindoutair"].linV = [0, grindoutspeed, 0]
  2225. cont.activate(own.actuators["grindoutair"])
  2226. if lUD > turnsens:
  2227. js = own['lg_stance']
  2228. linvelx = own.getLinearVelocity(True)
  2229. if own['last_grindpos'] == 'reg_board':
  2230. if js == 1:
  2231. own.actuators["grindoutair"].linV = [-grindoutspeed, 0, 0]
  2232. cont.activate(own.actuators["grindoutair"])
  2233. else:
  2234. own.actuators["grindoutair"].linV = [grindoutspeed, 0, 0]
  2235. cont.activate(own.actuators["grindoutair"])
  2236. if lUD < -turnsens:
  2237. js = own['lg_stance']
  2238. if own['last_grindpos'] == 'reg_board':
  2239. if js == 0:
  2240. own.actuators["grindoutair"].linV = [-grindoutspeed, 0, 0]
  2241. cont.activate(own.actuators["grindoutair"])
  2242. else:
  2243. own.actuators["grindoutair"].linV = [grindoutspeed, 0, 0]
  2244. cont.activate(own.actuators["grindoutair"])
  2245. if LAST_GRIND == False and r_ground.triggered and own['grindjumpturn'] == True and own['grindCountdown'] < 1:
  2246. own['grindjumpturn'] = False
  2247. if r_ground.triggered:
  2248. own['grind_jump'] = False
  2249. if own['grindjumpturn'] == False or own['grindCountdown'] < 19:
  2250. cont.deactivate(own.actuators["grindoutair"])
  2251. #print(STANCE)
  2252. def set_last_grindpos():
  2253. if own['grindpos'] != None:
  2254. own['last_grindpos'] = own['grindpos']
  2255. def air_pos():
  2256. grindpos = own['grindpos']
  2257. GRAB_ON = own["GRAB_ON"]
  2258. wr = own["wallride"]
  2259. jump_timer = own['jump_timer']
  2260. if rUD > .040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 30:
  2261. killact(2)
  2262. killact(4)
  2263. if STANCE == 0:
  2264. own['requestAction'] = 'reg_air_tail'
  2265. else:
  2266. own['requestAction'] = 'fak_air_tail'
  2267. elif rUD < -.040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 30:
  2268. killact(2)
  2269. killact(4)
  2270. if STANCE == 0:
  2271. own['requestAction'] = 'reg_air_nose'
  2272. else:
  2273. own['requestAction'] = 'fak_air_nose'
  2274. def air_turn_boost():
  2275. pass
  2276. def revert():
  2277. own["Q3oncdl"] = 0
  2278. own["Q4oncdl"] = 0
  2279. own["Q5oncdl"] = 0
  2280. own["Q6oncdl"] = 0
  2281. own["Q7oncdl"] = 0
  2282. local = True
  2283. rot = [ 0.0, 0.0, 3.14]
  2284. own.applyRotation(rot,local)
  2285. framenum = own['framenum']
  2286. last_ground_frame = own['lF_ground_frame']
  2287. lF_air_frame = own['lF_air_frame']
  2288. frames_since_ground = framenum - lF_air_frame
  2289. if own['manual_v2_type'] == 'reg manual':
  2290. own['requestAction'] = 'reg_manual_revert_ccw'
  2291. elif own['manual_v2_type'] == 'reg nose manual':
  2292. own['requestAction'] = 'reg_nmanual_revert_ccw'
  2293. elif own['manual_v2_type'] == 'fak manual':
  2294. own['requestAction'] = 'fak_manual_revert_ccw'
  2295. elif own['manual_v2_type'] == 'fak nose manual':
  2296. own['requestAction'] = 'fak_nmanual_revert_ccw'
  2297. else:
  2298. if STANCE == 0:
  2299. own['requestAction'] = 'revert1'
  2300. else:
  2301. own['requestAction'] = 'fak_revert1'
  2302. own['revert_timer'] = 20
  2303. cont.activate(own.actuators["revertSound"])
  2304. own['revert_sound'] = 1
  2305. def revert2():
  2306. own["Q3oncdl"] = 0
  2307. own["Q4oncdl"] = 0
  2308. own["Q5oncdl"] = 0
  2309. own["Q6oncdl"] = 0
  2310. own["Q7oncdl"] = 0
  2311. local = True
  2312. rot = [ 0.0, 0.0, -3.14]
  2313. own.applyRotation(rot,local)
  2314. if own['manual_v2_type'] == 'reg manual':
  2315. own['requestAction'] = 'reg_manual_revert_cw'
  2316. elif own['manual_v2_type'] == 'reg nose manual':
  2317. own['requestAction'] = 'reg_nmanual_revert_cw'
  2318. elif own['manual_v2_type'] == 'fak manual':
  2319. own['requestAction'] = 'fak_manual_revert_cw'
  2320. elif own['manual_v2_type'] == 'fak nose manual':
  2321. own['requestAction'] = 'fak_nmanual_revert_cw'
  2322. else:
  2323. if STANCE == 0:
  2324. own['requestAction'] = 'revert2'
  2325. else:
  2326. own['requestAction'] = 'fak_revert2'
  2327. own['revert_timer'] = 20
  2328. cont.activate(own.actuators["revertSound"])
  2329. own['revert_sound'] = 1
  2330. def revert3():
  2331. own["Q7oncdl"] = 0
  2332. own["Q8oncdl"] = 0
  2333. own["Q1oncdl"] = 0
  2334. own["Q2oncdl"] = 0
  2335. own["Q3oncdl"] = 0
  2336. local = True
  2337. rot = [ 0.0, 0.0, 3.14]
  2338. own.applyRotation(rot,local)
  2339. if own['manual_v2_type'] == 'reg manual':
  2340. own['requestAction'] = 'reg_manual_revert_ccw'
  2341. elif own['manual_v2_type'] == 'reg nose manual':
  2342. own['requestAction'] = 'reg_nmanual_revert_ccw'
  2343. elif own['manual_v2_type'] == 'fak manual':
  2344. own['requestAction'] = 'fak_manual_revert_ccw'
  2345. elif own['manual_v2_type'] == 'fak nose manual':
  2346. own['requestAction'] = 'fak_nmanual_revert_ccw'
  2347. else:
  2348. if STANCE == 0:
  2349. own['requestAction'] = 'revert3'
  2350. else:
  2351. own['requestAction'] = 'fak_revert1'
  2352. own['revert_timer'] = 20
  2353. cont.activate(own.actuators["revertSound"])
  2354. own['revert_sound'] = 1
  2355. def revert4():
  2356. own["Q7oncdl"] = 0
  2357. own["Q8oncdl"] = 0
  2358. own["Q1oncdl"] = 0
  2359. own["Q2oncdl"] = 0
  2360. own["Q3oncdl"] = 0
  2361. local = True
  2362. rot = [ 0.0, 0.0, 3.14]
  2363. own.applyRotation(rot,local)
  2364. if own['manual_v2_type'] == 'reg manual':
  2365. own['requestAction'] = 'reg_manual_revert_cw'
  2366. elif own['manual_v2_type'] == 'reg nose manual':
  2367. own['requestAction'] = 'reg_nmanual_revert_cw'
  2368. elif own['manual_v2_type'] == 'fak manual':
  2369. own['requestAction'] = 'fak_manual_revert_cw'
  2370. elif own['manual_v2_type'] == 'fak nose manual':
  2371. own['requestAction'] = 'fak_nmanual_revert_cw'
  2372. else:
  2373. if STANCE == 0:
  2374. own['requestAction'] = 'revert4'
  2375. else:
  2376. own['requestAction'] = 'fak_revert2'
  2377. own['revert_timer'] = 20
  2378. cont.activate(own.actuators["revertSound"])
  2379. own['revert_sound'] = 1
  2380. def powerslide():
  2381. own['powerslide_counter'] = own['powerslide_counter'] + 1
  2382. since_walk = own['framenum'] - own['last_walk_frame']
  2383. since_grind = own['framenum'] - own['last_grind_frame']
  2384. if own['powerslide_counter'] > 15 and since_walk > 100 and since_grind > 40:
  2385. own['powerslide_on'] = 1
  2386. if STANCE == 0:
  2387. own['powerslide'] = "reg2"
  2388. if STANCE == 1:
  2389. own['powerslide'] = "fak1"
  2390. linVelocity4 = own.getLinearVelocity(True)
  2391. if own['powerslide_counter'] > 15 and own['powerslide_counter'] < 18:
  2392. newx = linVelocity4.x * .9
  2393. else:
  2394. newx = linVelocity4.x * .98
  2395. force = [newx, linVelocity4.y, linVelocity4.z]
  2396. own.setLinearVelocity(force, True)
  2397. def powerslide2():
  2398. own['powerslide_counter'] = own['powerslide_counter'] + 1
  2399. since_walk = own['framenum'] - own['last_walk_frame']
  2400. since_grind = own['framenum'] - own['last_grind_frame']
  2401. if own['powerslide_counter'] > 15 and since_walk > 100 and since_grind > 100:
  2402. own['powerslide_on'] = 1
  2403. if STANCE == 0:
  2404. own['powerslide'] = "reg1"
  2405. if STANCE == 1:
  2406. own['powerslide'] = "fak2"
  2407. linVelocity4 = own.getLinearVelocity(True)
  2408. if own['powerslide_counter'] > 15 and own['powerslide_counter'] < 18:
  2409. newx = linVelocity4.x * .9
  2410. else:
  2411. newx = linVelocity4.x * .98
  2412. force = [newx, linVelocity4.y, linVelocity4.z]
  2413. own.setLinearVelocity(force, True)
  2414. def powerslide_state():
  2415. ####powerslide on#####
  2416. if own['powerslide_on'] == 1:
  2417. if own['powerslide'] == "reg2":
  2418. own['requestAction'] = 'reg_fs_powerslide'
  2419. if own['powerslide'] == "fak1":
  2420. own['requestAction'] = 'fak_fs_powerslide'
  2421. if own['powerslide'] == "reg1":
  2422. own['requestAction'] = 'reg_powerslide'
  2423. if own['powerslide'] == "fak2":
  2424. own['requestAction'] = 'fak_powerslide'
  2425. def powerslide_sound():
  2426. sact = own.actuators["powerslide_sound"]
  2427. if own['powerslide_on'] == 1:
  2428. sact = own.actuators["powerslide_sound"]
  2429. sact.volume = .2
  2430. new_pitch = (abs(linVelocity.x) / 3)
  2431. if new_pitch < 1.1 and new_pitch > .5:
  2432. sact.pitch = new_pitch
  2433. elif new_pitch <= .5:
  2434. sact.pitch = .5
  2435. else:
  2436. sact.pitch = 1.1
  2437. cont.activate(own.actuators["powerslide_sound"])
  2438. else:
  2439. sact.volume = .0
  2440. cont.deactivate(own.actuators["powerslide_sound"])
  2441. def check_powerslide():
  2442. try:
  2443. own['last_powerslide_on'] = own['powerslide_on']
  2444. except:
  2445. pass
  2446. psxvel = abs(linVelocity.x)
  2447. if (lUD > .08 or lUD < -.08) and own['manual_v2'] == False and r_ground.triggered == True and psxvel > .1:
  2448. if lUD > .08:
  2449. powerslide()
  2450. else:
  2451. powerslide2()
  2452. else:
  2453. own['powerslide_on'] = 0
  2454. own['powerslide_counter'] = 0
  2455. if own['last_powerslide_on'] == 0:
  2456. own['powerslide'] = None
  2457. def killmanuals():
  2458. if own['last_manual_v2'] == 1 and own['manual_v2'] == 0:
  2459. fak_manual_off()
  2460. reg_manual_off()
  2461. fak_nmanual_off()
  2462. reg_nmanual_off()
  2463. def killopos():
  2464. pass
  2465. stopAnims()
  2466. #nextframe()
  2467. air()
  2468. stance()
  2469. turn()
  2470. #grind()
  2471. rotmult()
  2472. airup()
  2473. onramp()
  2474. speedmult()
  2475. coping()
  2476. resetjumpstance()
  2477. grass()
  2478. grindoutair()
  2479. set_last_grindpos()
  2480. air_pos()
  2481. air_turn_boost()
  2482. record_grindsound()
  2483. check_powerslide()
  2484. powerslide_state()
  2485. powerslide_sound()
  2486. killmanuals()
  2487. killopos()
  2488. grind()
  2489. #onboard()
  2490. ##################
  2491. ###realcontrols###
  2492. ##################
  2493. # q1
  2494. # q8 q2
  2495. # q7 q3
  2496. # q6 q4
  2497. # q5
  2498. ##################
  2499. #lq6
  2500. if lUD > .04 and lLR < -0.04 :
  2501. lq6on = 1
  2502. q6oncdl = countdown
  2503. own["Q6oncdl"] = q6oncdl
  2504. #print("lq6on")
  2505. elif q6oncdl > 0:
  2506. lq6on = 0
  2507. q6oncdl = q6oncdl - 1
  2508. own["Q6oncdl"] = q6oncdl
  2509. #lq8
  2510. if lUD < -.04 and lLR < -0.04 :
  2511. lq8on = 1
  2512. q8oncdl = countdown
  2513. own["Q8oncdl"] = q8oncdl
  2514. #print("lq8on")
  2515. elif q8oncdl > 0:
  2516. lq8on = 0
  2517. q8oncdl = q8oncdl - 1
  2518. own["Q8oncdl"] = q8oncdl
  2519. #lq2
  2520. if lUD < -.04 and lLR > 0.04 :
  2521. lq2on = 1
  2522. q2oncdl = countdown
  2523. own["Q2oncdl"] = q2oncdl
  2524. #print("lq2on")
  2525. elif q2oncdl > 0:
  2526. lq2on = 0
  2527. q2oncdl = q2oncdl - 1
  2528. own["Q2oncdl"] = q2oncdl
  2529. #q4
  2530. if lUD > 0.04 and lLR > 0.04 :
  2531. lq4on = 1
  2532. q4oncdl = countdown
  2533. own["Q4oncdl"] = q4oncdl
  2534. #print("lq4on")
  2535. elif q4oncdl > 0:
  2536. lq4on = 0
  2537. q4oncdl = q4oncdl - 1
  2538. own["Q4oncdl"] = q4oncdl
  2539. #q5
  2540. if lUD > .070 and lq4on == 0 and lq6on == 0:
  2541. lq5on = 1
  2542. q5oncdl = countdown
  2543. own["Q5oncdl"] = q5oncdl
  2544. #print("lq5on")
  2545. elif q5oncdl > 0:
  2546. lq5on = 0
  2547. q5oncdl = q5oncdl - 1
  2548. own["Q5oncdl"] = q5oncdl
  2549. #q1
  2550. if lUD < -0.070 and lq8on !=1 and lq2on != 1:
  2551. lq1on = 1
  2552. q1oncdl = countdown
  2553. own["Q1oncdl"] = q1oncdl
  2554. #print("lq1on")
  2555. elif q1oncdl > 0:
  2556. lq1on = 0
  2557. q1oncdl = q1oncdl - 1
  2558. own["Q1oncdl"] = q1oncdl
  2559. #q7
  2560. if lLR < -0.070 and lq8on != 1 and lq6on != 1:
  2561. lq7on = 1
  2562. q7oncdl = countdown
  2563. own["Q7oncdl"] = q7oncdl
  2564. #print("lq7on")
  2565. elif q7oncdl > 0:
  2566. lq7on = 0
  2567. q7oncdl = q7oncdl - 1
  2568. own["Q7oncdl"] = q7oncdl
  2569. #q3
  2570. if lLR > 0.070 and lq2on !=1 and lq4on != 1:
  2571. lq3on = 1
  2572. q3oncdl = countdown
  2573. own["Q3oncdl"] = q3oncdl
  2574. #print("lq3on")
  2575. elif q3oncdl > 0:
  2576. lq3on = 0
  2577. q3oncdl = q3oncdl - 1
  2578. own["Q3oncdl"] = q3oncdl
  2579. #34567
  2580. own['set_revert_timer'] = 0
  2581. ground_since = own["framenum"] - own['lF_air_frame']
  2582. if ground_since > 40 and frames_since_grinding > 40:
  2583. if q3oncdl < q4oncdl < q5oncdl < q6oncdl < q7oncdl:
  2584. if r_ground.triggered == True:
  2585. revert()
  2586. own['set_revert_timer'] = 1
  2587. if q3oncdl > q4oncdl > q5oncdl > q6oncdl > q7oncdl:
  2588. if r_ground.triggered == True:
  2589. revert2()
  2590. own['set_revert_timer'] = 1
  2591. if q7oncdl < q8oncdl < q1oncdl < q2oncdl < q3oncdl:
  2592. if r_ground.triggered == True:
  2593. revert3()
  2594. own['set_revert_timer'] = 1
  2595. if q7oncdl > q8oncdl > q1oncdl > q2oncdl > q3oncdl:
  2596. if r_ground.triggered == True:
  2597. revert4()
  2598. own['set_revert_timer'] = 1
  2599. ################
  2600. #q6
  2601. if rUD > .04 and rLR < -0.04 :
  2602. q6on = 1
  2603. q6oncd = countdown
  2604. own["Q6oncd"] = q6oncd
  2605. #print("q6on")
  2606. elif q6oncd > 0:
  2607. q6on = 0
  2608. q6oncd = q6oncd - 1
  2609. own["Q6oncd"] = q6oncd
  2610. #q8
  2611. if rUD < -.04 and rLR < -0.04 :
  2612. q8on = 1
  2613. q8oncd = countdown
  2614. own["Q8oncd"] = q8oncd
  2615. #print("q8on")
  2616. elif q8oncd > 0:
  2617. q8on = 0
  2618. q8oncd = q8oncd - 1
  2619. own["Q8oncd"] = q8oncd
  2620. #q2
  2621. if rUD < -.04 and rLR > 0.04 :
  2622. q2on = 1
  2623. q2oncd = countdown
  2624. own["Q2oncd"] = q2oncd
  2625. #print("q2on")
  2626. elif q2oncd > 0:
  2627. q2on = 0
  2628. q2oncd = q2oncd - 1
  2629. own["Q2oncd"] = q2oncd
  2630. #q4
  2631. if rUD > 0.04 and rLR > 0.04 :
  2632. q4on = 1
  2633. q4oncd = countdown
  2634. own["Q4oncd"] = q4oncd
  2635. #print("q4on")
  2636. elif q4oncd > 0:
  2637. q4on = 0
  2638. q4oncd = q4oncd - 1
  2639. own["Q4oncd"] = q4oncd
  2640. #q5
  2641. if rUD > .070:
  2642. if q4on == 0 and q6on == 0:
  2643. #print("q5on")
  2644. q5on = 1
  2645. q5oncd = countdown
  2646. own["Q5oncd"] = q5oncd
  2647. oposin()
  2648. ground_since = own["framenum"] - own['lF_air_frame']
  2649. if (rTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1) or (lTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1) and ground_since > 10:
  2650. pump()
  2651. else:
  2652. own["lastPump"] = False
  2653. own["Pump"] = False
  2654. own['jump_stance'] = STANCE
  2655. if rUD > .02 and grindHit == True:
  2656. grindpos = own['grindpos']
  2657. jumpstance = own["jump_stance"]
  2658. if LAST_GRIND == False:
  2659. if grindpos == "reg_stall":
  2660. grindtype("nose_stall") #change
  2661. elif grindpos == "fak_stall":
  2662. grindtype("nose_stall")
  2663. elif grindpos == "reg_5050":
  2664. if jumpstance != 3:
  2665. if jumpstance == 0:
  2666. if rLR > .02:
  2667. grindtype("reg_tailgR")
  2668. elif rLR < -.02:
  2669. grindtype("reg_tailgL")
  2670. else:
  2671. grindtype("reg_tailg")
  2672. if jumpstance == 1:
  2673. if rLR > .02:
  2674. grindtype("fak_tailgR")
  2675. elif rLR < -.02:
  2676. grindtype("fak_tailgL")
  2677. else:
  2678. grindtype("fak_tailg")
  2679. else:
  2680. if STANCE == 0:
  2681. if rLR > .03:
  2682. grindtype("reg_tailgR")
  2683. elif rLR < -.02:
  2684. grindtype("reg_tailgL")
  2685. else:
  2686. grindtype("reg_tailg")
  2687. if STANCE == 1:
  2688. grindtype("fak_tailg")
  2689. elif grindpos == "reg_board":
  2690. if jumpstance != 3:
  2691. if jumpstance == 0:
  2692. grindtype("reg_tailslide")
  2693. if jumpstance == 1:
  2694. grindtype("fak_tailslide")
  2695. STANCE = jumpstance
  2696. own['stance'] = STANCE
  2697. else:
  2698. if STANCE == 0:
  2699. grindtype("reg_tailslide")
  2700. if STANCE == 1:
  2701. grindtype("fak_tailslide")
  2702. else:
  2703. if jumpstance == 0:
  2704. grindtype("reg_tailg")
  2705. if jumpstance == 1:
  2706. grindtype("fak_tailg")
  2707. if q5oncd > 0:
  2708. q5on = 0
  2709. q5oncd = q5oncd - 1
  2710. own["Q5oncd"] = q5oncd
  2711. own["last_Opos"] = False
  2712. #q1
  2713. if rUD < -0.070:
  2714. if q2on == 0 and q8on == 0:
  2715. #print("q1on")
  2716. q1on = 1
  2717. q1oncd = countdown
  2718. own["Q1oncd"] = q1oncd
  2719. noposin()
  2720. if rUD < -0.020 and grindHit == True:
  2721. grindpos = own['grindpos']
  2722. jumpstance = own["jump_stance"]
  2723. if LAST_GRIND == False:
  2724. if grindpos == "reg_5050":
  2725. #print("nose something")
  2726. if jumpstance != 3:
  2727. if jumpstance == 0:
  2728. if rLR > .02:
  2729. grindtype("reg_nosegR")
  2730. elif rLR < -.02:
  2731. grindtype("reg_nosegL")
  2732. else:
  2733. grindtype("reg_noseg")
  2734. if jumpstance == 1:
  2735. if rLR > .02:
  2736. grindtype("fak_nosegR")
  2737. elif rLR < -.02:
  2738. grindtype("fak_nosegL")
  2739. else:
  2740. grindtype("fak_noseg")
  2741. else:
  2742. if STANCE == 0:
  2743. if rLR > .02:
  2744. grindtype("reg_nosegR")
  2745. elif rLR < -.02:
  2746. grindtype("reg_nosegL")
  2747. else:
  2748. grindtype("reg_noseg")
  2749. if STANCE == 1:
  2750. if rLR > .02:
  2751. grindtype("fak_nosegR")
  2752. elif rLR < -.02:
  2753. grindtype("fak_nosegL")
  2754. else:
  2755. grindtype("fak_noseg")
  2756. elif grindpos == "reg_board":
  2757. if jumpstance != 3:
  2758. if jumpstance == 0:
  2759. grindtype("reg_noseslide")
  2760. if jumpstance == 1:
  2761. grindtype("fak_noseslide")
  2762. STANCE = jumpstance
  2763. own['stance'] = STANCE
  2764. else:
  2765. if STANCE == 0:
  2766. grindtype("reg_noseslide")
  2767. if STANCE == 1:
  2768. grindtype("fak_noseslide")
  2769. if rUD > -0.020 and rUD <= .020 and LAST_GRIND == False:
  2770. if own['grindpos'] == 'reg_5050':
  2771. grindtype("reg_5050")
  2772. if own['grindpos'] == 'fak_5050':
  2773. grindtype("fak_5050")
  2774. if q1oncd > 0:
  2775. q1on = 0
  2776. q1oncd = q1oncd - 1
  2777. own["Q1oncd"] = q1oncd
  2778. own["last_nOpos"] = False
  2779. #print(q1oncd)
  2780. #q7
  2781. if rLR < -0.070:
  2782. if q8on == 0 and q6on == 0:
  2783. q7on = 1
  2784. q7oncd = countdown
  2785. own["Q7oncd"] = q7oncd
  2786. #print("q7on")
  2787. elif q7oncd > 0:
  2788. q7on = 0
  2789. q7oncd = q7oncd - 1
  2790. own["Q7oncd"] = q7oncd
  2791. #q3
  2792. if rLR > 0.070:
  2793. if q4on == 0 and q2on == 0:
  2794. q3on = 1
  2795. q3oncd = countdown
  2796. own["Q3oncd"] = q3oncd
  2797. #print("q3on")
  2798. elif q3oncd > 0:
  2799. q3on = 0
  2800. q3oncd = q3oncd - 1
  2801. own["Q3oncd"] = q3oncd
  2802. #trick calls
  2803. # 360 flip
  2804. # 3 > 4 > 5 > 8
  2805. # laser flip
  2806. # 7 > 6 > 5 > 2
  2807. #nollie 360 shovit
  2808. if q7oncd > 0 and q8oncd > 0 and q1oncd > 0 and q2oncd > 0 and q3oncd > 0 and q7oncd <= q8oncd <= q1oncd <= q2oncd <= q3oncd:
  2809. print ("Nollie 360 shovit")
  2810. dict['trick_string'] = 'Nollie 360 Shovit'
  2811. nollie_shovit360()
  2812. q7oncd = 0
  2813. q8oncd = 0
  2814. q1oncd = 0
  2815. q2oncd = 0
  2816. q3oncd = 0
  2817. own["Q7oncd"] = q7oncd
  2818. own["Q8oncd"] = q8oncd
  2819. own["Q1oncd"] = q1oncd
  2820. own["Q2oncd"] = q2oncd
  2821. own["Q3oncd"] = q3oncd
  2822. #nollie fs 360 shovit
  2823. if q7oncd > 0 and q8oncd > 0 and q1oncd > 0 and q2oncd > 0 and q3oncd > 0 and q3oncd <= q2oncd <= q1oncd <= q8oncd <= q7oncd:
  2824. #print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  2825. print ("Nollie Front Side 360 shovit")
  2826. dict['trick_string'] = 'Nollie FS 360 Shovit'
  2827. nollie_fsshovit360()
  2828. q7oncd = 0
  2829. q8oncd = 0
  2830. q1oncd = 0
  2831. q2oncd = 0
  2832. q3oncd = 0
  2833. own["Q7oncd"] = q7oncd
  2834. own["Q8oncd"] = q8oncd
  2835. own["Q1oncd"] = q1oncd
  2836. own["Q2oncd"] = q2oncd
  2837. own["Q3oncd"] = q3oncd
  2838. # varial heelflip
  2839. # 7 < 6 < 2
  2840. if q7oncd > 0 and q6oncd > 0 and q2oncd > 0 and q7oncd < q6oncd < q2oncd:
  2841. dict['trick_string'] = 'Varial Heelflip'
  2842. varial_heelflip()
  2843. reset_rtimers()
  2844. # varial kickflip
  2845. # 3 < 4 < 8
  2846. if q3oncd > 0 and q4oncd > 0 and q8oncd > 0 and q3oncd < q4oncd < q8oncd:
  2847. dict['trick_string'] = 'Varial Kickflip'
  2848. varial_kickflip()
  2849. reset_rtimers()
  2850. # nollie varial kickflip
  2851. # 3 < 2 < 6
  2852. if q3oncd > 0 and q2oncd > 0 and q6oncd > 0 and q3oncd <= q2oncd <= q6oncd:
  2853. dict['trick_string'] = 'Nollie Varial Kickflip'
  2854. print('Nollie Varial Kickflip')
  2855. nollie_varial_kickflip()
  2856. reset_rtimers()
  2857. # nollie varial heelflip
  2858. # 7 < 8 < 4
  2859. if q7oncd > 0 and q8oncd > 0 and q4oncd > 0 and q7oncd <= q8oncd <= q4oncd:
  2860. dict['trick_string'] = 'Nollie Varial Heelflip'
  2861. print('Nollie Varial Heelflip')
  2862. nollie_varial_heelflip()
  2863. reset_rtimers()
  2864. #360 shovit
  2865. if q3oncd > 0 and q4oncd > 0 and q5oncd > 0 and q6oncd > 0 and q7oncd > 0 and q7oncd >= q6oncd >= q5oncd >= q4oncd >= q3oncd:
  2866. # print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  2867. #print ("______-------360 shovit")
  2868. dict['trick_string'] = '360 Shovit'
  2869. shovit360()
  2870. q3oncd = 0
  2871. q4oncd = 0
  2872. q5oncd = 0
  2873. q6oncd = 0
  2874. q7oncd = 0
  2875. own["Q3oncd"] = q3oncd
  2876. own["Q4oncd"] = q4oncd
  2877. own["Q5oncd"] = q5oncd
  2878. own["Q6oncd"] = q6oncd
  2879. own["Q7oncd"] = q7oncd
  2880. #360 fs shovit
  2881. if q3oncd > 0 and q4oncd > 0 and q5oncd > 0 and q6oncd >= 0 and q7oncd > 0 and q7oncd <= q6oncd <= q5oncd <= q4oncd <= q3oncd:
  2882. dict['trick_string'] = '360 Frontside Shovit'
  2883. fsshovit360()
  2884. q3oncd = 0
  2885. q4oncd = 0
  2886. q5oncd = 0
  2887. q6oncd = 0
  2888. q7oncd = 0
  2889. own["Q3oncd"] = q3oncd
  2890. own["Q4oncd"] = q4oncd
  2891. own["Q5oncd"] = q5oncd
  2892. own["Q6oncd"] = q6oncd
  2893. own["Q7oncd"] = q7oncd
  2894. #ollie
  2895. if q5oncd > 0 and q1oncd > 0 and q5oncd < q1oncd:
  2896. JUMPSTRENGTH = q1oncd - q5oncd
  2897. #4,7
  2898. if JUMPSTRENGTH <= 4:
  2899. JUMPSTRENGTH = 1.1
  2900. if JUMPSTRENGTH > 4 and JUMPSTRENGTH < 7:
  2901. JUMPSTRENGTH = 1
  2902. if JUMPSTRENGTH >= 7:
  2903. JUMPSTRENGTH = .9
  2904. aollie()
  2905. q1oncd = 0
  2906. q5oncd = 0
  2907. own["Q1oncd"] = q1oncd
  2908. own["Q5oncd"] = q5oncd
  2909. #nollie
  2910. if q5oncd > 0 and q1oncd > 0 and q5oncd > q1oncd:
  2911. JUMPSTRENGTH = q5oncd - q1oncd
  2912. #4,7
  2913. if JUMPSTRENGTH <= 4:
  2914. JUMPSTRENGTH = 1.1
  2915. if JUMPSTRENGTH > 4 and JUMPSTRENGTH < 7:
  2916. JUMPSTRENGTH = 1
  2917. if JUMPSTRENGTH >= 7:
  2918. JUMPSTRENGTH = .9
  2919. nollie()
  2920. q1oncd = 0
  2921. q5oncd = 0
  2922. own["Q1oncd"] = q1oncd
  2923. own["Q5oncd"] = q5oncd
  2924. print("nollie")
  2925. #kickflip
  2926. if q5oncd > 0 and q8oncd > 0 and q5oncd < q8oncd and q3oncd < 1:
  2927. kickflip()
  2928. q8oncd = 0
  2929. q5oncd = 0
  2930. own["Q8oncd"] = q8oncd
  2931. own["Q5oncd"] = q5oncd
  2932. #nollie kickflip
  2933. if q1oncd > 0 and q6oncd > 0 and q1oncd < q6oncd:
  2934. nollie_kickflip()
  2935. q6oncd = 0
  2936. q1oncd = 0
  2937. own["Q6oncd"] = q6oncd
  2938. own["Q1oncd"] = q1oncd
  2939. #heelflip
  2940. if q5oncd > 0 and q2oncd > 0 and q5oncd < q2oncd:
  2941. heelflip()
  2942. q2oncd = 0
  2943. q5oncd = 0
  2944. own["Q2oncd"] = q2oncd
  2945. own["Q5oncd"] = q5oncd
  2946. #nollie_heelflip
  2947. if q1oncd > 0 and q4oncd > 0 and q1oncd < q4oncd:
  2948. nollie_heelflip()
  2949. q1oncd = 0
  2950. q4oncd = 0
  2951. own["Q1oncd"] = q1oncd
  2952. own["Q4oncd"] = q4oncd
  2953. #shovit
  2954. if q4oncd > 0 and q5oncd > 0 and q6oncd > 0 and q4oncd <= q5oncd <= q6oncd and q3oncd < 1:
  2955. shovit()
  2956. q4oncd = 0
  2957. q5oncd = 0
  2958. q6oncd = 0
  2959. own["Q4oncd"] = q4oncd
  2960. own["Q5oncd"] = q5oncd
  2961. own["Q6oncd"] = q6oncd
  2962. #nollie_shovit
  2963. if q2oncd > 0 and q1oncd > 0 and q8oncd > 0 and q2oncd <= q1oncd <= q8oncd and q3oncd == 0:
  2964. nollie_shovit()
  2965. print('nollie shuvit')
  2966. #nollie_fsshovit()
  2967. q2oncd = 0
  2968. q1oncd = 0
  2969. q8oncd = 0
  2970. own["Q2oncd"] = q2oncd
  2971. own["Q1oncd"] = q1oncd
  2972. own["Q8oncd"] = q8oncd
  2973. #fsshovit
  2974. if q4oncd > 0 and q5oncd > 0 and q6oncd > 0 and q6oncd <= q5oncd <= q4oncd and q7oncd < 1:
  2975. fsshovit()
  2976. q4oncd = 0
  2977. q5oncd = 0
  2978. q6oncd = 0
  2979. own["Q4oncd"] = q4oncd
  2980. own["Q5oncd"] = q5oncd
  2981. own["Q6oncd"] = q6oncd
  2982. #nollie_fsshovit
  2983. if q8oncd > 0 and q1oncd > 0 and q2oncd > 0 and q8oncd <= q1oncd <= q2oncd and q7oncd == 0:
  2984. print ("nollie fsshovit")
  2985. nollie_fsshovit()
  2986. q8oncd = 0
  2987. q1oncd = 0
  2988. q2oncd = 0
  2989. own["Q8oncd"] = q4oncd
  2990. own["Q1oncd"] = q5oncd
  2991. own["Q2oncd"] = q6oncd
  2992. #360 shovit
  2993. # 360 shovit
  2994. # 3 > 4 > 5 >6 > 7
  2995. # fs 360 shovit
  2996. # 7 > 6 > 5 > 4 > 3
  2997. def hippy_jump():
  2998. STANCE = own["stance"]
  2999. if own['hippy'] == 1 and own['last_hippy'] == 0:
  3000. if STANCE == 0:
  3001. own['requestAction'] = 'reg_hippy_in'
  3002. if STANCE == 1:
  3003. own['requestAction'] = 'fak_hippy_in'
  3004. if own['hippy'] == 1 and own['last_hippy'] == 1:
  3005. if STANCE == 0:
  3006. own['requestAction'] = 'reg_hippy_in'
  3007. if STANCE == 1:
  3008. own['requestAction'] = 'fak_hippy_in'
  3009. if own['hippy'] == 0 and own['last_hippy'] == 1:
  3010. killact(1100)
  3011. if rLR > turnsens:
  3012. local = True
  3013. rot = [ 0.0, 0.0, 3.14]
  3014. own.applyRotation(rot,local)
  3015. if STANCE == 0:
  3016. own['requestAction'] = 'reg_hippy_ncw'
  3017. if STANCE == 1:
  3018. own['requestAction'] = 'fak_hippy_ncw'
  3019. elif rLR < -turnsens:
  3020. local = True
  3021. rot = [ 0.0, 0.0, -3.14]
  3022. own.applyRotation(rot,local)
  3023. if STANCE == 0:
  3024. own['requestAction'] = 'fak_hippy_nccw'
  3025. if STANCE == 1:
  3026. own['requestAction'] = 'reg_hippy_nccw'
  3027. ##straight
  3028. else:
  3029. if STANCE == 0:
  3030. own['requestAction'] = 'reg_hippy'
  3031. if STANCE == 1:
  3032. own['requestAction'] = 'fak_hippy'
  3033. #pushing and hippy jumps
  3034. since_a = frame - lastaf
  3035. since_x = frame - lastxf
  3036. cush = 10
  3037. hippy = 0
  3038. own['hippy'] = 0
  3039. if xBut == 1 and aBut == 1 and (lTrig < 0.02 and rTrig < 0.02) and r_ground.triggered == True:
  3040. #F"hippy")
  3041. hippy = 1
  3042. own['hippy'] = 1
  3043. hippy_jump()
  3044. if since_a > cush and aBut == 1 and lasta == 1 and (lTrig < 0.02 and rTrig < 0.02) and own['last_hippy'] == 0:
  3045. if xBut == 0 and hippy == 0 and lastaBut_ground == True:
  3046. push()
  3047. if since_x > cush and xBut == 1 and lastx == 1 and (lTrig < 0.02 and rTrig < 0.02) and own['last_hippy'] == 0:
  3048. if aBut == 0 and hippy == 0 and lastxBut_ground == True:
  3049. push_goof()
  3050. #cavemans
  3051. if LAST_GRIND == False and grindHit == False and r_ground.triggered:
  3052. if (aBut ==0 and own['lastaBut_ground'] == 1) and lTrig > 0.02:
  3053. brfoot()
  3054. if (aBut ==0 and own['lastaBut_ground'] == 1) and rTrig > 0.02:
  3055. frfoot()
  3056. if (xBut ==0 and own['lastxBut_ground'] == 1) and lTrig > 0.02:
  3057. blfoot()
  3058. if (xBut ==0 and own['lastxBut_ground'] == 1) and rTrig > 0.02:
  3059. flfoot()
  3060. #push b button
  3061. if bBut == 1:
  3062. if linVelocity.x > .05 or linVelocity.x < -.05:
  3063. stop()
  3064. elif linVelocity.x < .05 or linVelocity.x > -.05:
  3065. if own["lastStop"] == True:
  3066. own["lastStop"] = False
  3067. elif bBut ==0:
  3068. own["lastStop"] = False
  3069. ##### falls
  3070. if own['fall'] == 1:
  3071. offboard()
  3072. own['getoffboard'] = True
  3073. ####
  3074. #y button
  3075. if own['lasty'] == 1 and yBut ==0:
  3076. offboard()
  3077. if own["GRAB_ON"] == True:
  3078. playing = skater.isPlayingAction(fliplay)
  3079. if playing == 1:
  3080. frame = skater.getActionFrame(fliplay)
  3081. if frame > 16:
  3082. skater.stopAction(fliplay)
  3083. flipping = skater.isPlayingAction(fliplay)
  3084. #reg_ollie_north
  3085. if rTrig < .02 and lTrig <.02 and r_ground.triggered == 0 and flipping == False and aBut == True:
  3086. if STANCE == 0:
  3087. own['requestAction'] = 'reg_ollie_south'
  3088. else:
  3089. own['requestAction'] = 'fak_ollie_north'
  3090. if rTrig < .02 and lTrig <.02 and r_ground.triggered == 0 and flipping == False and xBut == True:
  3091. if STANCE == 0:
  3092. own['requestAction'] = 'reg_ollie_north'
  3093. else:
  3094. own['requestAction'] = 'fak_ollie_south'
  3095. #frontside grab
  3096. if rTrig > 0.02 and r_ground.triggered == 0 and flipping == False:
  3097. GRAB_ON = True
  3098. own["GRAB_ON"] = GRAB_ON
  3099. #print(rTrig, GRAB_ON)
  3100. if STANCE == False and rUD >= -.07 and rUD <= .07:
  3101. frontside_grab_on()
  3102. elif STANCE == True and rUD >= -.07 and rUD <= .07:
  3103. fakbackside_grab_on()
  3104. #front_nose
  3105. if STANCE == True and rUD < -0.070:
  3106. fak_backside_nose_grab_on()
  3107. #front_tail
  3108. elif STANCE == True and rUD > 0.07:
  3109. fak_backside_tail_grab_on()
  3110. #
  3111. if STANCE == False and rUD < -0.070:
  3112. frontside_nose_grab_on()
  3113. #front_tail
  3114. elif STANCE == False and rUD > 0.07:
  3115. frontside_tail_grab_on()
  3116. #backside grab
  3117. if lTrig > 0.02 and r_ground.triggered == 0 and flipping == False:
  3118. GRAB_ON = True
  3119. own["GRAB_ON"] = GRAB_ON
  3120. #print(rTrig)
  3121. if aBut == False and xBut == False:
  3122. if STANCE == False and rUD >= -.07 and rUD <= .07:
  3123. backside_grab_on()
  3124. elif STANCE == True and rUD >= -.07 and rUD <= .07:
  3125. fakfrontside_grab_on()
  3126. #front_nose
  3127. if STANCE == True and rUD < -0.070:
  3128. fak_frontside_nose_grab_on()
  3129. #front_tail
  3130. elif STANCE == True and rUD > 0.07:
  3131. fak_frontside_tail_grab_on()
  3132. #front_nose
  3133. if STANCE == False and rUD < -0.070:
  3134. backside_nose_grab_on()
  3135. #front_tail
  3136. elif STANCE == False and rUD > 0.07:
  3137. backside_tail_grab_on()
  3138. else:
  3139. if STANCE == False:
  3140. reg_judo_grab_on()
  3141. elif STANCE == True:
  3142. fak_judo_grab_on()
  3143. #kill grabs
  3144. if lTrig <= 0.02 and GRAB_ON == True and lTrig >= -.02 and rTrig <= .02 and rTrig >= -.2:
  3145. GRAB_ON = False
  3146. own["GRAB_ON"] = GRAB_ON
  3147. GRAB_PLAYED = False
  3148. own["GRAB_PLAYED"] = GRAB_PLAYED
  3149. #frontside pump #backside pump
  3150. def footplant():
  3151. framenum = own['framenum']
  3152. last_ground_frame = own['lF_ground_frame']
  3153. lF_air_frame = own['lF_air_frame']
  3154. frames_since_ground = framenum - lF_air_frame
  3155. frames_since_grind = framenum - own['last_grind_frame']
  3156. if grindHit == True and aBut == True:
  3157. own.linearVelocity.x = 0
  3158. own.linearVelocity.y = 0
  3159. own['footplant_on'] = 1
  3160. if grindHit == False:
  3161. own['footplant_on'] = 0
  3162. if own['footplant_on'] == True and rUD < turnsens and rUD > -turnsens:
  3163. own.linearVelocity.x = 0
  3164. own.linearVelocity.y = 0
  3165. if own['footplant_on'] == 1 and own['last_footplant'] == True and own['jump_timer'] < 50:
  3166. if skater.isPlayingAction(2925) == False:
  3167. if STANCE == 0:
  3168. own['requestAction'] = 'reg_fp_rback'
  3169. if STANCE == 1:
  3170. own['requestAction'] = 'fak_fp_rback'
  3171. def invert():
  3172. if grindHit == True and own['grindpos'] == 'reg_board':
  3173. if lBump == 1:
  3174. own['invert_on'] = 1
  3175. own.linearVelocity.x = 0
  3176. own.linearVelocity.y = 0
  3177. if own["coping"] == 1 and own['invert_on'] == 1:
  3178. if own['invert_on'] == 1 and own['last_invert'] == False:
  3179. cont.activate(own.actuators['invertOn_sound'])
  3180. if STANCE == False:
  3181. own['invert_type'] = "reg_back_invert_in"
  3182. if STANCE == True:
  3183. own['invert_type'] = "fak_fr_invert"
  3184. if own['invert_on'] == 0 and own['last_invert'] == True:
  3185. own['last_invert_frame'] = frame
  3186. cont.activate(own.actuators['invertOff_Sound'])
  3187. if own['invert_on'] == 1 and own['invert_type'] != None:
  3188. if own['invert_type'] == "reg_back_invert_in":
  3189. own['requestAction'] = 'reg_back_invert'
  3190. if own['invert_type'] == "fak_fr_invert":
  3191. own['requestAction'] = 'fak_fr_invert'
  3192. lif = own['last_invert_frame']
  3193. if frame - lif > 3 and own['invert_on'] == 0:
  3194. own['invert_type'] = None
  3195. invert()
  3196. footplant()
  3197. if own['invert_on'] == 0:
  3198. killact(900)
  3199. def reset_pos():
  3200. #reset
  3201. if ddPad == 1:
  3202. spawn_pos = own['spawn_pos']
  3203. spawn_rot = own['spawn_rot']
  3204. spawn_cam_pos = own['spawn_cam_pos']
  3205. spawn_cam_rot = own['spawn_cam_rot']
  3206. try:
  3207. own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
  3208. own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
  3209. cam.worldPosition = (spawn_cam_pos[0], spawn_cam_pos[1], (spawn_cam_pos[2]))
  3210. cam.worldOrientation = [[spawn_cam_rot[0][0],spawn_cam_rot[0][1],spawn_cam_rot[0][2]], [spawn_cam_rot[1][0],spawn_cam_rot[1][1],spawn_cam_rot[1][2]], [0.0, 0.0, 1.0]]
  3211. except:
  3212. own.worldPosition = (0, 0, .1)
  3213. own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
  3214. if own["spawn_stance"] == 1:
  3215. own.setLinearVelocity([.1,0,0], 1)
  3216. else:
  3217. own.setLinearVelocity([-.1,0,0], 1)
  3218. if udPad == 1:
  3219. own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]]
  3220. own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
  3221. own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]]
  3222. own['spawn_cam_rot'] = [[cam.worldOrientation[0][0],cam.worldOrientation[0][1],cam.worldOrientation[0][2]], [cam.worldOrientation[1][0],cam.worldOrientation[1][1],cam.worldOrientation[1][2]], cam.worldOrientation[2][2]]
  3223. stance = own["stance"]
  3224. own["spawn_stance"] = stance
  3225. #start button
  3226. if stBut == True:
  3227. own.actuators["sroll"].volume = .0001
  3228. cont.deactivate(own.actuators["sroll"])
  3229. own.actuators["sroll"].stopSound()
  3230. if stBut == False and own['last_stBut'] == True:
  3231. if own['pause_on'] == True:
  3232. own['pause_on'] = False
  3233. else:
  3234. own['pause_on'] = True
  3235. own['last_stBut'] = stBut
  3236. def ylimit():
  3237. lgf = own['last_grind_frame']
  3238. frame = own['framenum']
  3239. frames_since_grinding = frame - lgf
  3240. if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:
  3241. linVelocity4 = own.getLinearVelocity(True)
  3242. newy = linVelocity4.y * .8 #.4
  3243. force = [linVelocity4.x, newy, linVelocity4.z]
  3244. own.setLinearVelocity(force, True)
  3245. def getoffboard():
  3246. lasty = own['lasty']
  3247. getoffboard = own['getoffboard']
  3248. if getoffboard == 1 and own['fall'] == False:
  3249. own['getoffboard'] = 0
  3250. if yBut == False and lasty == True:
  3251. own['getoffboard'] = 1
  3252. def switchcam():
  3253. pass
  3254. # if ltsBut == False and own['lastlts'] == True and rtsBut == False:
  3255. # if own['camera'] == 1:
  3256. # own['camera'] = 0
  3257. # else:
  3258. # own['camera'] = 1
  3259. # if rtsBut == False and own['lastrts'] == True and ltsBut == False:
  3260. # if own['camera'] == 2:
  3261. # own['camera'] = 0
  3262. # else:
  3263. # own['camera'] = 2
  3264. #followcam
  3265. def move_followcam():
  3266. if own['camera'] == 2:
  3267. #if rtsBut == False and own['lastrts'] == True:
  3268. if own['lastbkBut'] == True and bkBut == False:
  3269. #print("activate move followcam")
  3270. if own['move_followcam'] == False:
  3271. own['move_followcam'] = True
  3272. else:
  3273. own['move_followcam'] = False
  3274. if own['move_followcam'] == True:
  3275. #act = followcam.actuators[
  3276. camspeed1 = .015
  3277. camspeed2 = .055
  3278. camrot1 = .005
  3279. camrot2 = .02
  3280. #up
  3281. if lUD < -0.080:
  3282. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  3283. cont.activate(followcam.actuators["up"])
  3284. else:
  3285. cont.deactivate(followcam.actuators["up"])
  3286. # #down
  3287. if lUD > .080:
  3288. followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  3289. cont.activate(followcam.actuators["down"])
  3290. else:
  3291. cont.deactivate(followcam.actuators["down"])
  3292. # #left
  3293. if lLR < -0.080:
  3294. followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  3295. cont.activate(followcam.actuators["left"])
  3296. else:
  3297. cont.deactivate(followcam.actuators["left"])
  3298. # #right
  3299. if lLR > 0.080:
  3300. followcam.actuators["right"].dLoc = [camspeed2, 0, 0]
  3301. cont.activate(followcam.actuators["right"])
  3302. else:
  3303. cont.deactivate(followcam.actuators["right"])
  3304. #up
  3305. if rUD < -0.080:
  3306. followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
  3307. cont.activate(followcam.actuators["rotup"])
  3308. else:
  3309. cont.deactivate(followcam.actuators["rotup"])
  3310. # #down
  3311. if rUD > .080:
  3312. followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]
  3313. cont.activate(followcam.actuators["rotdown"])
  3314. else:
  3315. cont.deactivate(followcam.actuators["rotdown"])
  3316. # #left
  3317. if rLR < -0.080:
  3318. followcam.actuators["rotleft"].dRot = [0, 0, camrot2]
  3319. cont.activate(followcam.actuators["rotleft"])
  3320. else:
  3321. cont.deactivate(followcam.actuators["rotleft"])
  3322. # #right
  3323. if rLR > 0.080:
  3324. followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
  3325. cont.activate(followcam.actuators["rotright"])
  3326. else:
  3327. cont.deactivate(followcam.actuators["rotright"])
  3328. #*********************************************
  3329. if lUD > -0.080 and lUD < -0.030:
  3330. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  3331. cont.activate(followcam.actuators["up"])
  3332. else:
  3333. cont.deactivate(followcam.actuators["up"])
  3334. # #down
  3335. if lUD < .080 and lUD > .03:
  3336. followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  3337. cont.activate(followcam.actuators["down"])
  3338. else:
  3339. cont.deactivate(followcam.actuators["down"])
  3340. # #left
  3341. if lLR > -0.080 and lLR < -0.030:
  3342. followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  3343. cont.activate(followcam.actuators["left"])
  3344. else:
  3345. cont.deactivate(followcam.actuators["left"])
  3346. # #right
  3347. if lLR < .080 and lLR > .03:
  3348. followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
  3349. cont.activate(followcam.actuators["right"])
  3350. else:
  3351. cont.deactivate(followcam.actuators["right"])
  3352. #up
  3353. if rUD > -0.080 and rUD < -0.030:
  3354. followcam.actuators["rotup"].dRot = [camrot1, 0, 0]
  3355. cont.activate(followcam.actuators["rotup"])
  3356. else:
  3357. cont.deactivate(followcam.actuators["rotup"])
  3358. # #down
  3359. if rUD < .080 and rUD > .03:
  3360. followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  3361. cont.activate(followcam.actuators["rotdown"])
  3362. else:
  3363. cont.deactivate(followcam.actuators["rotdown"])
  3364. # #left
  3365. if rLR > -0.080 and rLR < -0.030:
  3366. followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
  3367. cont.activate(followcam.actuators["rotleft"])
  3368. else:
  3369. cont.deactivate(followcam.actuators["rotleft"])
  3370. # #right
  3371. if rLR < .080 and rLR > .03:
  3372. followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
  3373. cont.activate(followcam.actuators["rotright"])
  3374. else:
  3375. cont.deactivate(followcam.actuators["rotright"])
  3376. def move_flycam():
  3377. if own['camera'] == 1:
  3378. if own['lastbkBut'] == True and bkBut == False:
  3379. if own['move_freecam'] == False:
  3380. own['move_freecam'] = True
  3381. else:
  3382. own['move_freecam'] = False
  3383. if own['move_freecam'] == True:
  3384. camspeed1 = .015
  3385. camspeed2 = .055
  3386. camrot1 = .005
  3387. camrot2 = .02
  3388. #up
  3389. if lUD < -0.080:
  3390. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  3391. cont.activate(freecam.actuators["up"])
  3392. else:
  3393. cont.deactivate(freecam.actuators["up"])
  3394. # #down
  3395. if lUD > .080:
  3396. freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  3397. cont.activate(freecam.actuators["down"])
  3398. else:
  3399. cont.deactivate(freecam.actuators["down"])
  3400. # #left
  3401. if lLR < -0.080:
  3402. freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  3403. cont.activate(freecam.actuators["left"])
  3404. else:
  3405. cont.deactivate(freecam.actuators["left"])
  3406. # #right
  3407. if lLR > 0.080:
  3408. freecam.actuators["right"].dLoc = [camspeed2, 0, 0]
  3409. cont.activate(freecam.actuators["right"])
  3410. else:
  3411. cont.deactivate(freecam.actuators["right"])
  3412. #up
  3413. if rUD < -0.080:
  3414. freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
  3415. cont.activate(freecam.actuators["rotup"])
  3416. else:
  3417. cont.deactivate(freecam.actuators["rotup"])
  3418. # #down
  3419. if rUD > .080:
  3420. freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]
  3421. cont.activate(freecam.actuators["rotdown"])
  3422. else:
  3423. cont.deactivate(freecam.actuators["rotdown"])
  3424. # #left
  3425. if rLR < -0.080:
  3426. freecam.actuators["rotleft"].dRot = [0, 0, camrot2]
  3427. cont.activate(freecam.actuators["rotleft"])
  3428. else:
  3429. cont.deactivate(freecam.actuators["rotleft"])
  3430. # #right
  3431. if rLR > 0.080:
  3432. freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
  3433. cont.activate(freecam.actuators["rotright"])
  3434. else:
  3435. cont.deactivate(freecam.actuators["rotright"])
  3436. #*********************************************
  3437. if lUD > -0.080 and lUD < -0.030:
  3438. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  3439. cont.activate(freecam.actuators["up"])
  3440. else:
  3441. cont.deactivate(freecam.actuators["up"])
  3442. # #down
  3443. if lUD < .080 and lUD > .03:
  3444. freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  3445. cont.activate(freecam.actuators["down"])
  3446. else:
  3447. cont.deactivate(freecam.actuators["down"])
  3448. # #left
  3449. if lLR > -0.080 and lLR < -0.030:
  3450. freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  3451. cont.activate(freecam.actuators["left"])
  3452. else:
  3453. cont.deactivate(freecam.actuators["left"])
  3454. # #right
  3455. if lLR < .080 and lLR > .03:
  3456. freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
  3457. cont.activate(freecam.actuators["right"])
  3458. else:
  3459. cont.deactivate(freecam.actuators["right"])
  3460. #up
  3461. if rUD > -0.080 and rUD < -0.030:
  3462. freecam.actuators["rotup"].dRot = [camrot1, 0, 0]
  3463. cont.activate(freecam.actuators["rotup"])
  3464. else:
  3465. cont.deactivate(freecam.actuators["rotup"])
  3466. # #down
  3467. if rUD < .080 and rUD > .03:
  3468. freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  3469. cont.activate(freecam.actuators["rotdown"])
  3470. else:
  3471. cont.deactivate(freecam.actuators["rotdown"])
  3472. # #left
  3473. if rLR > -0.080 and rLR < -0.030:
  3474. freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
  3475. cont.activate(freecam.actuators["rotleft"])
  3476. else:
  3477. cont.deactivate(freecam.actuators["rotleft"])
  3478. # #right
  3479. if rLR < .080 and rLR > .03:
  3480. freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
  3481. cont.activate(freecam.actuators["rotright"])
  3482. else:
  3483. cont.deactivate(freecam.actuators["rotright"])
  3484. if r_ground.triggered == False:
  3485. own["lF_air_frame"] = own["framenum"]
  3486. if r_ground.triggered == True:
  3487. own["lF_ground_frame"] = own["framenum"]
  3488. if own['LAST_GRIND'] == True:
  3489. own['last_grind_frame'] = own['framenum']
  3490. if own['LAST_GRIND'] == False and r_ground.triggered and own['jump_timer'] == 0:
  3491. if own['jump_stance'] != 3:
  3492. own['jump_stance'] = 3
  3493. def control_calib():
  3494. #controller calibration test
  3495. scenes = bge.logic.getSceneList()
  3496. controller_calib = [scene for scene in scenes if scene.name=="controller_calib"][0]
  3497. cq1 = controller_calib.objects['q1']
  3498. cq2 = controller_calib.objects['q2']
  3499. cq3 = controller_calib.objects['q3']
  3500. cq4 = controller_calib.objects['q4']
  3501. cq5 = controller_calib.objects['q5']
  3502. cq6 = controller_calib.objects['q6']
  3503. cq7 = controller_calib.objects['q7']
  3504. cq8 = controller_calib.objects['q8']
  3505. if lq1on == 1:
  3506. cq1["q1"] = 1
  3507. else:
  3508. cq1["q1"] = 0
  3509. if lq2on == 1:
  3510. cq2["q2"] = 1
  3511. else:
  3512. cq2["q2"] = 0
  3513. if lq3on == 1:
  3514. cq3["q3"] = 1
  3515. else:
  3516. cq3["q3"] = 0
  3517. if lq4on == 1:
  3518. cq4["q4"] = 1
  3519. else:
  3520. cq4["q4"] = 0
  3521. if lq5on == 1:
  3522. cq5["q5"] = 1
  3523. else:
  3524. cq5["q5"] = 0
  3525. if lq6on == 1:
  3526. cq6["q6"] = 1
  3527. else:
  3528. cq6["q6"] = 0
  3529. if lq7on == 1:
  3530. cq7["q7"] = 1
  3531. else:
  3532. cq7["q7"] = 0
  3533. if lq8on == 1:
  3534. cq8["q8"] = 1
  3535. else:
  3536. cq8["q8"] = 0
  3537. def grind_turn():
  3538. jumping = None
  3539. gotcd = 25
  3540. force = [0,0,0]
  3541. grindHit = own['grindTouch']
  3542. sincegrinding = own['framenum'] - own['grindstartFrame']
  3543. STANCE = own['stance']
  3544. if rUD > turnsens or rLR > turnsens or rUD < -turnsens or rLR < -turnsens:
  3545. jumping = True
  3546. if grindHit == False:
  3547. cont.deactivate(own.actuators['grindoutRight'])
  3548. cont.deactivate(own.actuators['grindoutLeft'])
  3549. if (grindHit == True and jumping == None and sincegrinding > 20)or own['invert_on'] == True:
  3550. outloc = 0.022
  3551. bsoutloc = .07
  3552. bsoutvel = .1
  3553. outrot = .06#2 #0.012
  3554. outrot2 = .24
  3555. outact = own.actuators["grindoutRight"]
  3556. STANCE = own['grind_stance']
  3557. if 'fak' in own['l_actionState']:
  3558. STANCE = 1
  3559. if 'reg' in own['l_actionState']:
  3560. STANCE = 0
  3561. if own['grindpos'] == 'reg_5050':
  3562. if lq3on == 1 or lq2on:
  3563. if own['gt_cd2'] == 0:
  3564. own['gt_cd2'] = 60
  3565. if STANCE == True:
  3566. if own['grind_out_type'] == None:
  3567. own['grind_out_type'] = 'fak right'
  3568. if STANCE == False:
  3569. if own['grind_out_type'] == None:
  3570. own['grind_out_type'] = 'reg right'
  3571. own["grindoutturn"] = gotcd
  3572. if lq7on == 1 or lq8on:
  3573. if own['gt_cd2'] == 0:
  3574. own['gt_cd2'] = 60
  3575. if STANCE == True:
  3576. if own['grind_out_type'] == None:
  3577. own['grind_out_type'] = 'fak left'
  3578. if STANCE == False:
  3579. if own['grind_out_type'] == None:
  3580. own['grind_out_type'] = 'reg left'
  3581. own["grindoutturn"] = gotcd
  3582. if lq4on == 1:
  3583. if own['gt_cd2'] == 0:
  3584. own['gt_cd2'] = 60
  3585. if STANCE == True:
  3586. if own['grind_out_type'] == None:
  3587. own['grind_out_type'] = 'fak fak right'
  3588. if STANCE == False:
  3589. if own['grind_out_type'] == None:
  3590. own['grind_out_type'] = 'reg fak right'
  3591. own["grindoutturn"] = gotcd
  3592. if lq6on == 1:
  3593. if own['gt_cd2'] == 0:
  3594. own['gt_cd2'] = 60
  3595. if STANCE == True:
  3596. if own['grind_out_type'] == None:
  3597. own['grind_out_type'] = 'fak fak left'
  3598. if STANCE == False:
  3599. if own['grind_out_type'] == None:
  3600. own['grind_out_type'] = 'reg fak left'
  3601. own["grindoutturn"] = gotcd
  3602. #use stance for 5050 and grindstance for boards
  3603. if own['grindpos'] == 'reg_board':
  3604. outvel = own.getLinearVelocity(1)
  3605. outact.dLoc = [0, 0, 0]
  3606. outact.dRot = [0, 0, 0]
  3607. if lq5on == 1:
  3608. if own['gt_cd2'] == 0:
  3609. own['gt_cd2'] = 60
  3610. if STANCE == True:
  3611. if own['footplant_on'] == True:
  3612. own.setLinearVelocity([(outvel.x + -bsoutvel), outvel.y, outvel.z], 1)
  3613. cont.activate(own.actuators["grindoutRight"])
  3614. if own['grind_out_type'] == None:
  3615. own['grind_out_type'] = 'bs fak back'
  3616. if STANCE == False:
  3617. if own['footplant_on'] == True:
  3618. own.setLinearVelocity([(outvel.x + bsoutvel), outvel.y, outvel.z], 1)
  3619. cont.activate(own.actuators["grindoutRight"])
  3620. if own['grind_out_type'] == None:
  3621. own['grind_out_type'] = 'bs reg back'
  3622. own["grindoutturn"] = gotcd
  3623. own['invert_on'] = 0
  3624. if lq1on == 1:
  3625. if own['gt_cd2'] == 0:
  3626. own['gt_cd2'] = 60
  3627. if STANCE == True:
  3628. if own['footplant_on'] == True:
  3629. own.setLinearVelocity([(outvel.x + bsoutvel), outvel.y, outvel.z], 1)
  3630. cont.activate(own.actuators["grindoutRight"])
  3631. if own['grind_out_type'] == None:
  3632. own['grind_out_type'] = 'bs fak forward'
  3633. if STANCE == False:
  3634. if own['footplant_on'] == True:
  3635. own.setLinearVelocity([(outvel.x + -bsoutvel), outvel.y, outvel.z], 1)
  3636. cont.activate(own.actuators["grindoutRight"])
  3637. if own['grind_out_type'] == None:
  3638. own['grind_out_type'] = 'bs reg forward'
  3639. own["grindoutturn"] = gotcd
  3640. own['invert_on'] = 0
  3641. if lq1on or lq2on or lq3on or lq4on or lq5on or lq6on or lq7on or lq8on:
  3642. gt_cd = own['gt_cd']
  3643. if gt_cd == 0:
  3644. gt_cd = 30
  3645. own['gt_cd'] = gt_cd
  3646. if own['grindoutturn'] == 0:
  3647. cont.deactivate(own.actuators["grindoutRight"])
  3648. own["grindoutturn"] = 0
  3649. gt_cd = own['gt_cd']
  3650. if gt_cd > 0:
  3651. own['gt_cd'] = gt_cd - 1
  3652. else:
  3653. own['gt_cd'] = 0
  3654. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  3655. reg_move = .05
  3656. reg_rot = 0.02#2
  3657. reg_rot2 = .26
  3658. reg_move2 = .13
  3659. bsforce = 50
  3660. bs_dloc = .03
  3661. outvel = own.linearVelocity
  3662. if own["coping"] == 1:
  3663. reg_rot = reg_rot *3
  3664. print('coping on')
  3665. if own['gt_cd2'] > 50 and own['jump_timer'] < 20:
  3666. if own['grind_out_type'] == 'reg right':
  3667. print("do reg right")
  3668. own.applyMovement([0,reg_move,0], True)
  3669. own.applyRotation([0,0,-reg_rot],True)
  3670. if own['grind_out_type'] == 'fak right':
  3671. own.applyMovement([0,-reg_move,0], True)
  3672. own.applyRotation([0,0,-reg_rot],True)
  3673. print("do fak right")
  3674. if own['grind_out_type'] == 'reg left':
  3675. print("do reg left")
  3676. own.applyMovement([0,-reg_move,0], True)
  3677. own.applyRotation([0,0,reg_rot],True)
  3678. if own['grind_out_type'] == 'fak left':
  3679. own.applyMovement([0,reg_move,0], True)
  3680. own.applyRotation([0,0,reg_rot],True)
  3681. print("do fak left")
  3682. if own['grind_out_type'] == 'reg fak right':
  3683. if own['gt_cd2'] > 55:
  3684. own.applyMovement([0,reg_move2,0], True)
  3685. own.applyRotation([0,0,reg_rot2],True)
  3686. print("do reg fak right")
  3687. if own['grind_out_type'] == 'fak fak right':
  3688. if own['gt_cd2'] > 55:
  3689. own.applyMovement([0,-reg_move2,0], True)
  3690. own.applyRotation([0,0,reg_rot2],True)
  3691. print("do fak fak right")
  3692. if own['grind_out_type'] == 'reg fak left':
  3693. if own['gt_cd2'] > 55:
  3694. own.applyMovement([0,-reg_move2,0], True)
  3695. own.applyRotation([0,0,-reg_rot2],True)
  3696. print("do reg fak left")
  3697. if own['grind_out_type'] == 'fak fak left':
  3698. if own['gt_cd2'] > 55:
  3699. own.applyMovement([0,reg_move2,0], True)
  3700. own.applyRotation([0,0,-reg_rot2],True)
  3701. print("do fak fak left")
  3702. if own['grind_out_type'] == 'reg right' or own['grind_out_type'] == 'reg left' or own['grind_out_type'] == 'fak right' or own['grind_out_type'] == 'fak left':
  3703. own.setLinearVelocity([outvel.x * 1.01, outvel.y, outvel.z], True)
  3704. if own['grind_out_type'] == 'reg fak right' or own['grind_out_type'] == 'reg fak left' or own['grind_out_type'] == 'fak fak right' or own['grind_out_type'] == 'fak fak left':
  3705. if own['gt_cd2'] == 51:
  3706. if STANCE == False:
  3707. own.applyForce([-200, 0, 0], True)
  3708. own['stance'] = True
  3709. STANCE = True
  3710. if STANCE == True:
  3711. own.applyForce([200, 0, 0], True)
  3712. own['stance'] = False
  3713. STANCE = False
  3714. if own['grind_out_type'] == 'bs reg back' or own['grind_out_type'] == 'bs fak forward':
  3715. if own['gt_cd2'] > 50:
  3716. if STANCE == True:
  3717. own.applyForce([bsforce, 0, 0], True)
  3718. if STANCE == False:
  3719. own.applyForce([bsforce, 0, 0], True)
  3720. own.applyMovement([bs_dloc,0,0], True)
  3721. if own['grind_out_type'] == 'bs fak back' or own['grind_out_type'] == 'bs reg forward':
  3722. if own['gt_cd2'] > 50:
  3723. if STANCE == True:
  3724. own.applyForce([-bsforce, 0, 0], True)
  3725. if STANCE == False:
  3726. own.applyForce([-bsforce, 0, 0], True)
  3727. own.applyMovement([-bs_dloc,0,0], True)
  3728. if own['gt_cd2'] > 0:
  3729. own['gt_cd2'] -= 1
  3730. if own['gt_cd2'] == 0:
  3731. own['grind_out_type'] = None
  3732. if own["grindoutturn"] > 0:
  3733. own["grindoutturn"] = own["grindoutturn"] - 1
  3734. def air_height():
  3735. height = own["air_height"]
  3736. if lf_ground == True and r_ground.triggered == False:
  3737. height = 0
  3738. #wallride
  3739. def wallride():
  3740. wallride_off = own['wallride_off']
  3741. distance = own.getDistanceTo(gray.hitPosition)
  3742. upforce = 25
  3743. sideforce = 15
  3744. try:
  3745. obj = gray.hitObject
  3746. objpos = obj.worldPosition
  3747. ownpos = own.worldPosition
  3748. distance = ownpos.z - objpos.z
  3749. except:
  3750. pass
  3751. if wallrideL.triggered and wallride_off == 0 and r_ground.triggered == False:
  3752. own['jump_timer'] = 0
  3753. if r_ground.triggered == False:
  3754. own["wallride"] = "L"
  3755. cont.activate(wallrideconstL)
  3756. force = [0,sideforce,upforce]
  3757. own.applyForce(force,1)
  3758. #align
  3759. if STANCE == 0:
  3760. own['requestAction'] = 'reg_wall_r'
  3761. else:
  3762. own['requestAction'] = 'fak_wall_l'
  3763. else:
  3764. if own["wallride"] != "R":
  3765. own["wallride"] = None
  3766. cont.deactivate(wallrideconstL)
  3767. killact(3000)
  3768. killact(3001)
  3769. killact(3002)
  3770. if wallrideR.triggered and wallride_off == 0:
  3771. own['jump_timer'] = 0
  3772. if r_ground.triggered == False:
  3773. own["wallride"] = "R"
  3774. cont.activate(wallrideconstR)
  3775. force = [0,-sideforce,upforce]
  3776. own.applyForce(force,1)
  3777. if STANCE == 0:
  3778. own['requestAction'] = 'reg_wall_l'
  3779. else:
  3780. own['requestAction'] = 'fak_wall_r'
  3781. else:
  3782. if own["wallride"] != "L":
  3783. own["wallride"] = None
  3784. cont.deactivate(wallrideconstR)
  3785. killact(3003)
  3786. killact(3004)
  3787. killact(3005)
  3788. def wallride_sound():
  3789. sact = own.actuators["wallSound"]
  3790. if own["wallride"] != None and (own['actionState'] == 'reg_wall_r' or own['actionState'] == 'reg_wall_l' or own['actionState'] == 'fak_wall_r' or own['actionState'] == 'fak_wall_l'):
  3791. sact.volume = .2
  3792. cont.activate(own.actuators["wallSound"])
  3793. else:
  3794. sact.volume = .001
  3795. sact.stopSound()
  3796. if own['revert_timer'] > 0:
  3797. own['revert_timer'] = own['revert_timer'] - 1
  3798. def shutoff_timers():
  3799. if (LAST_GRIND == False and grindHit == True) or (jump_timer > 10 and own['wallride'] == None):
  3800. own["Q1oncd"] = 0
  3801. own["Q2oncd"] = 0
  3802. own["Q3oncd"] = 0
  3803. own["Q4oncd"] = 0
  3804. own["Q5oncd"] = 0
  3805. own["Q6oncd"] = 0
  3806. own["Q7oncd"] = 0
  3807. own["Q8oncd"] = 0
  3808. def grindout_cleanup():
  3809. lgf = own['last_grind_frame']
  3810. def trans_jump():
  3811. if own['jump_from_trans'] == 1:
  3812. ground_ray = cont.sensors['ground_look']
  3813. jump_obj = own['trans_jump_obj']
  3814. jump_obj = scene.objects[str(own['trans_jump_obj'])]
  3815. #print(jump_obj)
  3816. worldVect = [1, 0, 0]
  3817. vect = jump_obj.getAxisVect(worldVect)
  3818. go = jump_obj.worldOrientation
  3819. grinder_axis = [0,1,0]
  3820. player_pos = own.worldPosition
  3821. jump_obj = jump_obj.worldPosition
  3822. try:
  3823. delta = player_pos - jump_obj
  3824. except:
  3825. pass
  3826. delta = delta.cross(vect)
  3827. deltamove = delta[1] * .25
  3828. move = [deltamove, 0, 0]
  3829. if abs(deltamove) < 1 and delta[1] < 1:
  3830. own.applyMovement(move, True)
  3831. def air_mover():
  3832. if r_ground.triggered == False and jump_timer > 53 and frames_since_grinding > 50:
  3833. if lUD > 0.075:
  3834. if STANCE == 0:
  3835. force2 = [120, 0, 10]
  3836. if STANCE == 1:
  3837. force2 = [-120, 0, 10]
  3838. own.applyForce(force2, True)
  3839. own['no_grind_pull'] = 1
  3840. if r_ground.triggered == False and jump_timer > 10 and lUD > 0.075 and frames_since_grinding > 50:
  3841. if STANCE == 0:
  3842. force2 = [7, 0, 10]
  3843. if STANCE == 1:
  3844. force2 = [-7, 0, 10]
  3845. own.applyForce(force2, True)
  3846. own.applyForce([0,0,5], False)
  3847. own['air_mover'] = True
  3848. own['no_grind_pull'] = 1
  3849. else:
  3850. own['air_mover'] = False
  3851. def dropinRotate():
  3852. if own['dropinTimer'] > 30 and own['dropinTimer'] < 40:
  3853. rot = [ 0.01, 0.0, 0]
  3854. vel = [linVelocity.x - .25, linVelocity.y, linVelocity.z - .01]
  3855. if STANCE == 1:
  3856. rot = [-0.01, 0.0, 0]
  3857. vel = [linVelocity.x + .25, linVelocity.y, linVelocity.z - .01]
  3858. local = True
  3859. own.applyRotation(rot,local)
  3860. own.setLinearVelocity(vel, local)
  3861. if own['dropinTimer'] == 50:
  3862. if STANCE == 1:
  3863. force = (linVelocity.x +1, linVelocity.y, linVelocity.z )
  3864. else:
  3865. force = (linVelocity.x -1, linVelocity.y, linVelocity.z )
  3866. own.setLinearVelocity(force, True)
  3867. framenum = own['framenum']
  3868. last_ground_frame = own['lF_ground_frame']
  3869. lF_air_frame = own['lF_air_frame']
  3870. frames_since_ground = framenum - lF_air_frame
  3871. if framenum - lF_air_frame > 30:
  3872. own['no_grind_pull'] = 0
  3873. def wallhit():
  3874. linvelx = linVelocity.x
  3875. lastx = own["linvelx"]
  3876. if frames_since_ground > 20 and (abs(lastx) - abs(linvelx)) > .5:
  3877. print('::::::wallhit')
  3878. force = (linVelocity.x * -.7, linVelocity.y, linVelocity.z )
  3879. own.setLinearVelocity(force, True)
  3880. jump_Timer()
  3881. check_landing()
  3882. nextframe()
  3883. wheelroll()
  3884. rollsound()
  3885. reset_pos()
  3886. ylimit()
  3887. getoffboard()
  3888. #switchcam()
  3889. move_flycam()
  3890. move_followcam()
  3891. grind_turn()
  3892. air_height()
  3893. wallride()
  3894. wallride_sound()
  3895. shutoff_timers()
  3896. grindout_cleanup()
  3897. air_mover()
  3898. dropinRotate()
  3899. onboard()
  3900. #wallhit()
  3901. linvelx = own.getLinearVelocity(True)
  3902. own["linvelx"] = linvelx.x
  3903. LAST_STANCE = STANCE
  3904. LAST_STANCE = own["stance"]
  3905. own["last_stance"] = STANCE
  3906. own["lastGrab"] = GRAB_ON
  3907. own['ground'] = r_ground.triggered
  3908. own['last_ground'] = r_ground.triggered
  3909. own["LAST_GRIND"] = grindHit
  3910. own["rotz"] = rot.z
  3911. own['walk'] = 0
  3912. own['lasty'] = yBut
  3913. own['lastlts'] = ltsBut
  3914. own['lastrts'] = rtsBut
  3915. own["lF_ground2"] = own["lF_ground"]
  3916. own['last_invert'] = invert_on
  3917. own['lastbkBut'] = bkBut
  3918. own['grab_type'] = grab_type
  3919. own['last_last_manual'] = own['last_manual']
  3920. own['last_manual'] = own['manual']
  3921. own['last_reg_manual'] = own['reg_manual']
  3922. own['last_fak_manual'] = own['fak_manual']
  3923. own['last_fak_nmanual'] = own['fak_nmanual']
  3924. own['last_reg_nmanual'] = own['reg_nmanual']
  3925. if own['manual'] == 1:
  3926. own['last_manual_frame'] = frame
  3927. own['last_hippy'] = own['hippy']
  3928. if aBut == 1 and own["lasta"] == 0:
  3929. own["lastaf"] = frame
  3930. if xBut == 1 and own["lastx"] == 0:
  3931. own["lastxf"] = frame
  3932. own["lasta"] = aBut
  3933. own["lastx"] = xBut
  3934. own['lastaBut_ground'] = aBut_ground
  3935. own['lastxBut_ground'] = xBut_ground
  3936. own["last_sel"] = own["sel"]
  3937. own["sel"] = bkBut
  3938. if r_ground.triggered and own["jump_timer"] < 20:
  3939. force2 = [0.0, 0, -10]
  3940. own.applyForce(force2, True)
  3941. if (grindDar == False and r_ground.triggered and own['grindTouch'] == False) or own['jump_timer'] > 40:
  3942. own['grindType'] = ''