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

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