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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387
  1. #scale = .3
  2. #action layers
  3. #0-14 rolling
  4. #grablay = 400
  5. #fliplay = 500
  6. #grindlay = 700
  7. os = 'Windows'
  8. from sys import platform
  9. if platform != "win32":
  10. os = 'Linux'
  11. def onWindows():
  12. return os == 'Windows'
  13. from mathutils import Vector
  14. import bge
  15. import GameLogic
  16. import ctypes
  17. import math
  18. #import bpy
  19. #build global dict (move this to separate script that runs once)
  20. scene = bge.logic.getCurrentScene()
  21. objList = scene.objects
  22. try:
  23. GameLogic.DictObjects
  24. init=1
  25. except:
  26. init=0
  27. if init:
  28. cont.GameLogic.getCurrentController()
  29. own = cont.getOwner()
  30. name = own.getName()
  31. if not GameLogic.DictObjects.has_key(name):
  32. GameLogic.DictObjects[name]=cont
  33. own.init=0
  34. reduction = 400000
  35. axisTh = 0.03
  36. ############
  37. ##vibration#
  38. ############
  39. ## Define necessary structures
  40. #class XINPUT_VIBRATION(ctypes.Structure):
  41. # _fields_ = [("wLeftMotorSpeed", ctypes.c_ushort), ("wRightMotorSpeed", ctypes.c_ushort)]
  42. #xinput = ctypes.windll.xinput1_3 # Load Xinput.dll
  43. ## Set up function argument types and return type
  44. #XInputSetState = xinput.XInputSetState
  45. #XInputSetState.argtypes = [ctypes.c_uint, ctypes.POINTER(XINPUT_VIBRATION)]
  46. #XInputSetState.restype = ctypes.c_uint
  47. ## Now we're ready to call it. Set left motor to 100%, right motor to 50%
  48. ## for controller 0
  49. ##vibration = XINPUT_VIBRATION(65535, 32768)
  50. ##XInputSetState(0, ctypes.byref(vibration))
  51. ## You can also create a helper function like this:
  52. #def set_vibration(controller, left_motor, right_motor):
  53. # vibration = XINPUT_VIBRATION(int(left_motor * 65535), int(right_motor * 65535))
  54. # XInputSetState(controller, ctypes.byref(vibration))
  55. ## ... and use it like so
  56. ##set_vibration(0, 0.2, 0.2)
  57. ################
  58. ##end vibration#
  59. ################
  60. #initialize quadrant variables
  61. q1on = 0
  62. q2on = 0
  63. q3on = 0
  64. q4on = 0
  65. q5on = 0
  66. q6on = 0
  67. q7on = 0
  68. q8on = 0
  69. lq1on = 0
  70. lq2on = 0
  71. lq3on = 0
  72. lq4on = 0
  73. lq5on = 0
  74. lq6on = 0
  75. lq7on = 0
  76. lq8on = 0
  77. #number of frames / length of the location timers
  78. countdown = 20
  79. cont = GameLogic.getCurrentController()
  80. obj = bge.logic.getCurrentScene().objects
  81. char = bge.constraints.getCharacter
  82. own = cont.owner
  83. dict = bge.logic.globalDict #Get the global dictionary
  84. #dict['trick_string'] = ''
  85. #last frame stuff
  86. lGRAB_ON = own["lGRAB_ON"]
  87. lastgrab = own["lastGrab"]
  88. lastpump = own["lastPump"]
  89. lf_ground = own["lF_ground"]
  90. lastopos = own["last_Opos"]
  91. lastnopos = own["last_nOpos"]
  92. LAST_STANCE = own["last_stance"]
  93. LAST_GROUND = own["last_ground"]
  94. lastStop = own["lastStop"]
  95. LAST_LEFT = own["LAST_LEFT"]
  96. last_trick_string = dict.get('last_trick_sting')
  97. lasta = own["lasta"]
  98. lastx = own["lastx"]
  99. lastaf = own["lastaf"]
  100. lastxf = own["lastxf"]
  101. lgf = own['last_grind_frame']
  102. frame = own['framenum']
  103. frames_since_grinding = frame - lgf
  104. own['last_footplant'] = own['footplant_on']
  105. lastaBut_ground = own['lastaBut_ground']
  106. lastxBut_ground = own['lastxBut_ground']
  107. aBut_ground = own['aBut_ground']
  108. xBut_ground = own['xBut_ground']
  109. own['last_manual_v2'] = own['manual_v2']
  110. #current frame stuff
  111. GRAB_ON = own["GRAB_ON"]
  112. pumpon = own["Pump"]
  113. vib_countdown = own["vib_Countdown"]
  114. grindold = own['grindOld']
  115. #grindHit = own["LAST_GRIND"]
  116. LAST_GRIND = own["LAST_GRIND"]
  117. #grindTouch = cont.sensors['grindCol']
  118. grindTouch = cont.sensors['grindCol_bottom']
  119. touched = grindTouch.triggered
  120. leftgrabon = own["Leftgrabon"]
  121. rightgrabon = own["Rightgrabon"]
  122. linvel = own.getLinearVelocity
  123. zvel = own.worldLinearVelocity.z
  124. own["Zvel"] = zvel
  125. r_ground = cont.sensors["r_Ground"]
  126. trigger = r_ground.triggered
  127. STANCE = own["stance"]
  128. motion = cont.actuators['MotionPump']
  129. linVelocity = own.getLinearVelocity(True)
  130. countdown = own['countdown']
  131. jump_timer = own['jump_timer']
  132. pos = own.localPosition
  133. rot = own.getAxisVect( [0.0, 0.0, 1.0])
  134. gray = cont.sensors["gRay"]
  135. #airconst = cont.actuators["airConst"]
  136. pop = cont.actuators["pop"]
  137. grindHit = own["grindHit"]
  138. grindCement = cont.actuators["grind_cement"]
  139. grindRail = cont.actuators["grind_rail"]
  140. grindSound = own["grindSound"]
  141. skater = scene.objects["Char4"]
  142. deck = scene.objects["deck"]
  143. trucks = scene.objects["trucks"]
  144. wheel1 = scene.objects["rollen.000"]
  145. wheel2 = scene.objects["rollen.001"]
  146. wheel3 = scene.objects["rollen.002"]
  147. wheel4 = scene.objects["rollen.003"]
  148. turnsens = .04
  149. turnsens2 = .06 #air_turn_boost
  150. grindDar = own["grindDar_hit"]
  151. grindEmpty = scene.objects["grindEmpty"]
  152. grindDar2 = grindEmpty.sensors["grindDar2"]
  153. #invertCol = cont.sensors["invertCol"]
  154. cam = scene.objects["Camera.003"]
  155. freecam = scene.objects["freecam"]
  156. followcam = scene.objects["followcam"]
  157. coping_on = own["coping"]
  158. invert_on = own['invert_on']
  159. grab_type = own['grab_type']
  160. c_ground = cont.sensors['c_ground']
  161. #
  162. control_bottom = scene.objects['control_bottom']
  163. invertTouch = control_bottom.sensors['grindCol_bottom']
  164. wallride = own["wallride"]
  165. wallride_col = cont.sensors['wallride']
  166. wallrideL = cont.sensors['wallrideL']
  167. wallrideR = cont.sensors['wallrideR']
  168. wallrideconstL = cont.actuators['wallrideconstL']
  169. wallrideconstR = cont.actuators['wallrideconstR']
  170. if r_ground.triggered: own['wallride_off'] = 0
  171. own['pop_sound'] = 0
  172. own['land_sound'] = 0
  173. #own['fall'] = 0
  174. #joystick location timers
  175. q1oncd = own["Q1oncd"]
  176. q2oncd = own["Q2oncd"]
  177. q3oncd = own["Q3oncd"]
  178. q4oncd = own["Q4oncd"]
  179. q5oncd = own["Q5oncd"]
  180. q6oncd = own["Q6oncd"]
  181. q7oncd = own["Q7oncd"]
  182. q8oncd = own["Q8oncd"]
  183. q1oncdl = own["Q1oncdl"]
  184. q2oncdl = own["Q2oncdl"]
  185. q3oncdl = own["Q3oncdl"]
  186. q4oncdl = own["Q4oncdl"]
  187. q5oncdl = own["Q5oncdl"]
  188. q6oncdl = own["Q6oncdl"]
  189. q7oncdl = own["Q7oncdl"]
  190. q8oncdl = own["Q8oncdl"]
  191. #setable
  192. grablay = 600 #this plus 1
  193. fliplay = 470
  194. MAX_VEL = 6.7
  195. SPEEDUP = .055
  196. SPEEDPUMP = .09 #.075
  197. SPEEDPUMPFAST = .13 #.09
  198. PUMP_SPEED_SENS = .4
  199. PUMP_SENS = .98
  200. ACCEL = 10
  201. CRUISE = 9
  202. COUNTDOWN = 20 #pump and speed stuff
  203. JUMPHEIGHT = 800 #775#750
  204. JUMPSTRENGTH = 0
  205. own['flip_manual_stance'] = 0
  206. CAVEMAN_SPEED = .75
  207. LAND_LAYER = 100
  208. LAND_END = 20
  209. #Sensor logic bricks connected to the python Controller
  210. aXis = cont.sensors["sControla"]
  211. bUtt = cont.sensors["sControlb"]
  212. onW = onWindows()
  213. # windows stuff
  214. lar_lts = 0
  215. uad_lts = 1
  216. lar_rts = 2 if onW else 2
  217. uad_rts = 3 if onW else 3
  218. lt = 4 if onW else 4
  219. rt = 5 if onW else 5
  220. # These are the numerical values associated with the buttons on the Xbox Controller
  221. # Called with - SensorName.getButtonStatus(buttonnumber) -
  222. # A joystick sensor logic brick (with the 'Button' Event Type; 'All Events' selected; and 'Tap' enabled) must be connected to the Python Controller logic brick to call these buttons
  223. a_but = 0 if onW else 0
  224. b_but = 1 if onW else 1
  225. x_but = 2 if onW else 2
  226. y_but = 3 if onW else 3
  227. l_bump = 9 if onW else 9
  228. r_bump = 10 if onW else 10
  229. bk_but = 4 if onW else 4
  230. st_but = 6 if onW else 6
  231. xb_but = 5 if onW else 5
  232. lts_pr = 7 if onW else 7
  233. rts_pr = 8 if onW else 8
  234. l_dp = 13 if onW else 13
  235. r_dp = 14 if onW else 14
  236. u_dp = 11 if onW else 11
  237. d_dp = 12 if onW else 12
  238. lLR = aXis.axisValues[lar_lts] / reduction
  239. lUD = aXis.axisValues[uad_lts] / reduction
  240. rLR = aXis.axisValues[lar_rts] / reduction
  241. rUD = aXis.axisValues[uad_rts] / reduction
  242. lTrig = aXis.axisValues[lt] / reduction
  243. rTrig = aXis.axisValues[rt] / reduction
  244. aBut = bUtt.getButtonStatus(a_but)
  245. bBut = bUtt.getButtonStatus(b_but)
  246. xBut = bUtt.getButtonStatus(x_but)
  247. yBut = bUtt.getButtonStatus(y_but)
  248. lBump = bUtt.getButtonStatus(l_bump)
  249. rBump = bUtt.getButtonStatus(r_bump)
  250. bkBut = bUtt.getButtonStatus(bk_but)
  251. stBut = bUtt.getButtonStatus(st_but)
  252. xbBut = bUtt.getButtonStatus(xb_but)
  253. ltsBut = bUtt.getButtonStatus(lts_pr)
  254. rtsBut = bUtt.getButtonStatus(rts_pr)
  255. ldPad = bUtt.getButtonStatus(l_dp)
  256. rdPad = bUtt.getButtonStatus(r_dp)
  257. udPad = bUtt.getButtonStatus(u_dp)
  258. ddPad = bUtt.getButtonStatus(d_dp)
  259. ## -End- ##
  260. list = bUtt.getButtonActiveList()
  261. #print(list)
  262. #no input
  263. def cutOff():
  264. if (abs(lLR) < axisTh
  265. and abs(lUD) < axisTh
  266. and abs(rLR) < axisTh
  267. and abs(rUD) < axisTh
  268. and aBut == False):
  269. return True
  270. #fliptricks after manuals
  271. if (frame - own['last_manual_frame']) < 25:
  272. flip_start_lay = 8
  273. flipspeed = .4
  274. own['flipspeed'] = .4
  275. own['flip_start_lay'] = 8
  276. #print("chopping flip start")
  277. else:
  278. flip_start_lay = 1
  279. own['flip_start_lay'] = 1
  280. flipspeed = .6
  281. own['flipspeed'] = .6
  282. def printplaying():
  283. splaying_layers = "S: "
  284. playing_layers = "D: "
  285. tplaying_layers = "T: "
  286. for x in range(9900):
  287. if skater.isPlayingAction(x):
  288. #if trucks.isPlayingAction(x):
  289. #if skater.isPlayingAction(x):
  290. splaying_layers += str(x)
  291. splaying_layers += " "
  292. if deck.isPlayingAction(x):
  293. #if trucks.isPlayingAction(x):
  294. #if skater.isPlayingAction(x):
  295. playing_layers += str(x)
  296. playing_layers += " "
  297. if trucks.isPlayingAction(x):
  298. #if trucks.isPlayingAction(x):
  299. #if skater.isPlayingAction(x):
  300. tplaying_layers += str(x)
  301. tplaying_layers += " "
  302. print(splaying_layers, playing_layers, tplaying_layers)
  303. if aBut == True and lasta == False and r_ground.triggered:
  304. aBut_ground = True
  305. own['aBut_ground'] = True
  306. #else:
  307. if aBut == False:
  308. aBut_ground = False
  309. own['aBut_ground'] = False
  310. if xBut == True and lastx == False and r_ground.triggered:
  311. xBut_ground = True
  312. own['xBut_ground'] = True
  313. #else:
  314. if xBut == False:
  315. xBut_ground = False
  316. own['xBut_ground'] = False
  317. def killact(layer):
  318. if skater.isPlayingAction(layer):
  319. skater.stopAction(layer)
  320. if deck.isPlayingAction(layer):
  321. deck.stopAction(layer)
  322. if trucks.isPlayingAction(layer):
  323. trucks.stopAction(layer)
  324. def killall():
  325. for x in range(9000):
  326. skater.stopAction(x)
  327. deck.stopAction(x)
  328. trucks.stopAction(x)
  329. def grind_stance():
  330. #own["last_grind_stance"] = own["grind_stance"]
  331. # if grindHit == 1 and LAST_GRIND == 1 and (own['grindCountdown'] < 15 or own['grindCountdown'] >19):
  332. # own["last_grind_stance"] = own["grind_stance"]
  333. #own["grind_stance"] = STANCE
  334. pass
  335. grind_stance()
  336. def reset_rtimers():
  337. own["Q1oncd"] = 0
  338. own["Q2oncd"] = 0
  339. own["Q3oncd"] = 0
  340. own["Q4oncd"] = 0
  341. own["Q5oncd"] = 0
  342. own["Q6oncd"] = 0
  343. own["Q7oncd"] = 0
  344. own["Q8oncd"] = 0
  345. q1oncd = 0
  346. q2oncd = 0
  347. q3oncd = 0
  348. q4oncd = 0
  349. q5oncd = 0
  350. q6oncd = 0
  351. q7oncd = 0
  352. q8oncd = 0
  353. def check_fall():
  354. playing_frame = 20
  355. if skater.isPlayingAction(fliplay):
  356. playing_frame = skater.getActionFrame(fliplay)
  357. if r_ground.triggered == True and skater.isPlayingAction(fliplay) and own['jump_timer'] < 40 and playing_frame < 14 and playing_frame > 3:
  358. own['fall'] = 1
  359. print("fall: ", playing_frame, own['jump_timer'])
  360. check_fall()
  361. def check_landing():
  362. lf_ground = own["lF_ground"]
  363. #zvel = own.getLinearVelocity
  364. #print(zvel)
  365. STANCE = own["stance"]
  366. #if lf_ground == False and r_ground.triggered == True and grindDar == 0:
  367. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  368. #if playing_action_frame < (LAND_END):
  369. #own["lastPump"] = False
  370. #own["Pump"] = False
  371. if lf_ground == False and r_ground.triggered == True:
  372. #resetjumpstance()
  373. #print(r_ground.hitObject)
  374. own['jump_from_trans'] = 0
  375. nearestObject = None
  376. minDist = None
  377. detectedObjects = grindDar2.hitObjectList
  378. #if grindHit == False and gray.triggered == False and touched == False:
  379. # if grindDar2.positive:
  380. # for obj in detectedObjects:
  381. # dist = own.getDistanceTo(obj)
  382. # if (minDist is None or dist < minDist):
  383. # nearestObject = obj
  384. # minDist = dist
  385. # if nearestObject != None and 'rail' in scene.objects[nearestObject]:
  386. # cont.activate(own.actuators["landonrail"])
  387. # print("landonrail***************")
  388. #play landing sound
  389. if grindDar == 0:
  390. #print("you are not grinding", grindHit)
  391. lastheight = own["air_height"]
  392. pos = own.worldPosition.z
  393. dist = lastheight - pos
  394. dist = dist * 2
  395. #print(dist, "-------------dist")
  396. if dist > 1:
  397. dist = 1
  398. own.actuators["land"].volume = dist
  399. #cont.deactivate(own.actuators["land"])
  400. sact = own.actuators["land"]
  401. sact.stopSound()
  402. cont.activate(own.actuators["land"])
  403. own['land_sound'] = 1
  404. if grindDar == 1:
  405. pass
  406. #cont.activate(own.actuators["landonrail"])
  407. #vibrate
  408. #set_vibration(0, 0.3, 0.3)
  409. own["vib_Countdown"] = 14
  410. cont.activate(own.actuators["Vibration"])
  411. #print("vibrate")
  412. #killall()
  413. #if own["reg_nmanual"] == 0 and own["fak_nmanual"] == 0 and own["reg_manual"] == 0 and own["fak_manual"] == 0:
  414. if own['manual_v2'] == 0 and grindDar == 0:
  415. if STANCE == 0:
  416. own['requestAction'] = 'reg_land'
  417. #skater.playAction("reg_land", 1,20, layer=LAND_LAYER, blendin=5, priority=7, layer_weight=0, play_mode=0, speed=.5)
  418. elif STANCE == 1:
  419. own['requestAction'] = 'fak_land'
  420. #skater.playAction("fak_land", 1,20, layer=LAND_LAYER, blendin=5, priority=7, layer_weight=0, play_mode=0, speed=.5)
  421. killact(2)
  422. killact(3)
  423. killact(4)
  424. killact(5)
  425. lf_ground = r_ground.triggered
  426. own["lF_ground"] = lf_ground
  427. vib_countdown = own["vib_Countdown"]
  428. if vib_countdown == 0:
  429. pass
  430. #set_vibration(0, 0, 0)
  431. elif vib_countdown > 0:
  432. vib_countdown = vib_countdown - 1
  433. own["vib_Countdown"] = vib_countdown
  434. if vib_countdown == 1:
  435. stopAnims()
  436. stance()
  437. # if touched == False and lf_ground == True:
  438. # if own['jump_stance'] != 3:
  439. # own['jump_stance'] = 3
  440. #air anim
  441. if r_ground.triggered == False:
  442. if STANCE == 0:
  443. own['requestAction'] = 'reg_air'
  444. if STANCE == 1:
  445. own['requestAction'] = 'fak_air'
  446. else:
  447. if STANCE == 0:
  448. own['requestAction'] = 'reg_roll'
  449. if STANCE == 1:
  450. own['requestAction'] = 'fak_roll'
  451. #check manual_v2
  452. if (rUD > .04 and rUD < .07) or (rUD < -.04 and rUD > -.07):
  453. #if (rUD > .04 and rUD < .07):
  454. #print("zoned")
  455. timer = own['manual_v2_timer']
  456. timer = timer + 1
  457. if timer > 20:
  458. own['manual_v2'] = 1
  459. own['manual_v2_timer'] = timer
  460. if rUD < .04 and rUD > -.04:
  461. own['manual_v2_timer'] = 0
  462. own['manual_v2'] = 0
  463. own['manual_v2_type'] = None
  464. if own['manual_v2'] == 1:
  465. if own['last_manual_v2'] == 0:
  466. #print("don't flip")
  467. if STANCE == 0:
  468. if rUD > .04 and rUD < .07:
  469. #print("reg manual")
  470. own['manual_v2_type'] = 'reg manual'
  471. own['requestAction'] = 'reg_manual'
  472. if rUD < -.04 and rUD > -.07:
  473. #print("reg nose manual")
  474. own['manual_v2_type'] = 'reg nose manual'
  475. own['requestAction'] = 'reg_nose_manual'
  476. if STANCE == 1:
  477. if rUD > .04 and rUD < .07:
  478. #print("fak manual")
  479. own['manual_v2_type'] = 'fak manual'
  480. own['requestAction'] = 'fak_manual'
  481. if rUD < -.04 and rUD > -.07:
  482. #print("fak nose manual")
  483. own['manual_v2_type'] = 'fak nose manual'
  484. own['requestAction'] = 'fak_nose_manual'
  485. else:
  486. #print("flip stance")
  487. if STANCE == 0:
  488. if own['manual_v2_type'] == 'fak manual':
  489. own['manual_v2_type'] = 'reg nose manual'
  490. if own['manual_v2_type'] == 'fak nose manual':
  491. own['manual_v2_type'] = 'reg manual'
  492. if STANCE == 1:
  493. if own['manual_v2_type'] == 'reg manual':
  494. own['manual_v2_type'] = 'fak nose manual'
  495. if own['manual_v2_type'] == 'reg nose manual':
  496. own['manual_v2_type'] = 'fak manual'
  497. #print(own['manual_v2'], own['manual_v2_type'])
  498. #check manual
  499. ####
  500. #reg
  501. if rUD > .04 and rUD < .07 and STANCE == 0 and rLR < .035 and rLR > -.035:
  502. timer = own["reg_manual_timer"]
  503. timer = timer + 1
  504. own["reg_manual_timer"] = timer
  505. if timer > 20 and rUD < .04:
  506. own["reg_manual"] = 0
  507. #print("reg_man off")
  508. if rUD <= .04 and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
  509. own["reg_manual_timer"] = 0
  510. own["reg_manual"] = 0
  511. #print("reg_man off2")
  512. #####
  513. if own["reg_manual_timer"] > 10 and own["fak_manual"] == 0 and own['reg_nmanual'] == 0:
  514. #if own["reg_manual_timer"] > 10 and own["fak_manual"] == 0:
  515. #if own['fak_nmanual'] == 0:
  516. own["reg_manual"] = 1
  517. ######
  518. if own["reg_manual_timer"] == 0:
  519. own["reg_manual"] = 0
  520. if own['last_reg_manual'] == 1 and own['reg_manual'] == 0:
  521. killall()
  522. #print(own["reg_manual"])
  523. ####
  524. #fak
  525. if rUD > .04 and rUD < .07 and STANCE == 1 and rLR < .035 and rLR > -.035:
  526. timer = own["fak_manual_timer"]
  527. timer = timer + 1
  528. own["fak_manual_timer"] = timer
  529. if timer > 20:
  530. own["fak_manual"] = 0
  531. if rUD <= .04 and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
  532. own["fak_manual_timer"] = 0
  533. own["fak_manual"] = 0
  534. if own["fak_manual_timer"] > 10 and own["reg_manual"] == 0:
  535. own["fak_manual"] = 1
  536. if own["fak_manual_timer"] == 0:
  537. own["fak_manual"] = 0
  538. if own['last_fak_manual'] == 1 and own['fak_manual'] == 0:
  539. killall()
  540. #print(own["reg_manual"], own["fak_manual"])
  541. #####
  542. #reg nmanual
  543. if rUD < -.04 and rUD > -.07 and STANCE == 0 and rLR < .035 and rLR > -.035:
  544. timer = own["reg_nmanual_timer"]
  545. timer = timer + 1
  546. own["reg_nmanual_timer"] = timer
  547. if timer > 20:
  548. own["reg_nmanual"] = 0
  549. if rUD >= -.04 and (STANCE == 1 or STANCE == 0) and rUD <= .04:
  550. own["reg_nmanual_timer"] = 0
  551. own["reg_nmanual"] = 0
  552. if own["reg_nmanual_timer"] > 10 and own["fak_nmanual"] == 0 and own['reg_manual'] == 0 and own['fak_manual'] == 0:
  553. if own['last_fak_manual'] == False and own['last_reg_manual'] == False and own['last_fak_manual'] == False:
  554. own["reg_nmanual"] = 1
  555. #print("baaad", own['reg_manual'], own['last_reg_manual'])
  556. if own["reg_nmanual_timer"] == 0:
  557. own["reg_nmanual"] = 0
  558. if own['last_reg_nmanual'] == 1 and own['reg_nmanual'] == 0:
  559. killall()
  560. #####
  561. #fak nmanual
  562. #print (rUD)
  563. if rUD < -.04 and rUD > -.07 and STANCE == 1 and rLR < .035 and rLR > -.035:
  564. timer = own["fak_nmanual_timer"]
  565. timer = timer + 1
  566. own["fak_nmanual_timer"] = timer
  567. if timer > 20:
  568. own["fak_nmanual"] = 0
  569. if rUD >= -.04 and (STANCE == 1 or STANCE == 0) and rUD <= .04:
  570. own["fak_nmanual_timer"] = 0
  571. own["fak_nmanual"] = 0
  572. #print('@@@@@@@@@fak_man_off_1')
  573. if own["fak_nmanual_timer"] > 10 and own["reg_nmanual"] == 0 and own['fak_manual'] == 0 and own ['reg_manual'] == 0:
  574. own["fak_nmanual"] = 1
  575. if own["fak_nmanual_timer"] == 0 and own['reg_manual'] == 0:
  576. #if own['flip_manual_stance'] == 0:
  577. own["fak_nmanual"] = 0
  578. if own['last_fak_nmanual'] == 1 and own['fak_nmanual'] == 0:
  579. killall()
  580. #print("rm ", own["reg_manual"], "rnm ", own["reg_nmanual"], "fm ", own["fak_manual"], "fnm ", own["fak_nmanual"])
  581. def reg_stance_left_off():
  582. killact(10)
  583. killact(32)
  584. LAST_LEFT = own["LAST_LEFT"]
  585. if LAST_LEFT == 1 and rUD < .06:
  586. skater.playAction("nreg_left", 30,40, layer=33, blendin=10, layer_weight=0, play_mode=0, speed=2)
  587. #deck.playAction("a_reg_left", 30,40, layer=33, play_mode=0, speed=2)
  588. #deck.playAction("a_reg_right", 30,40, layer=501, play_mode=0, speed=.5)
  589. own["LAST_LEFT"] = 0
  590. def reg_stance_right_off():
  591. killact(11)
  592. killact(34)
  593. LAST_RIGHT = own["LAST_RIGHT"]
  594. #if LAST_RIGHT == 1 and rUD < .06:
  595. #skater.playAction("nreg_right", 30,40, layer=35, blendin=10, layer_weight=0, play_mode=0, speed=2)
  596. #deck.playAction("a_reg_left", 30,40, layer=33, blendin=10, layer_weight=0, priority=7, play_mode=0, speed=.5)
  597. #deck.playAction("a_reg_right", 30,40, layer=501, play_mode=0, speed=.5)
  598. own["LAST_RIGHT"] = 0
  599. def reg_stance_on():
  600. #revert_timer
  601. playing = deck.isPlayingAction(40)
  602. if own["revert_timer"] < 1 and own['manual_v2'] == 0 and playing == 0:
  603. own['requestAction'] = 'reg_roll'
  604. # skater.playAction("nreg", 1,60, layer=2, blendin=4, layer_weight=0, play_mode=1, speed=.5)
  605. # deck.playAction("a_reg", 1,40, layer=2, blendin=0, blend_mode=0, play_mode=1, speed=.5)
  606. # trucks.playAction("a_reg", 1,40, layer=2, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  607. def reg_stance_off():
  608. killact(2)
  609. def reg_manual_on():
  610. own['requestAction'] = 'reg_manual'
  611. # skater.playAction("reg_manual", 10,70, layer=222, blendin=0, layer_weight=.1, play_mode=1, speed=.5)
  612. # deck.playAction("a_reg_manual", 10,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  613. # trucks.playAction("a_reg_manual", 10,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  614. # if own["last_reg_manual"] == 0:
  615. # reg_stance_left_off()
  616. # reg_stance_right_off()
  617. # skater.playAction("reg_manual", 1,10, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  618. # deck.playAction("a_reg_manual", 1,10, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  619. # trucks.playAction("a_reg_manual", 1,10, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  620. if own["reg_manual_timer"] == 41:
  621. killact(3000)
  622. killact(3001)
  623. killact(3002)
  624. def reg_manual_off():
  625. killact(222)
  626. killact(223)
  627. killact(224)
  628. killact(3000)
  629. killact(3001)
  630. killact(3002)
  631. killact(10)
  632. killact(32)
  633. killact(11)
  634. killact(34)
  635. def fak_manual_on():
  636. #killall()
  637. own['requestAction'] = 'fak_manual'
  638. # skater.playAction("fak_manual", 10,70, layer=222, blendin=0, layer_weight=.1, play_mode=1, speed=.5)
  639. # deck.playAction("a_fak_manual", 10,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  640. # trucks.playAction("a_fak_manual", 10,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  641. # if own["last_fak_manual"] == 0:
  642. # fak_stance_left_off()
  643. # fak_stance_right_off()
  644. # skater.playAction("fak_manual", 1,10, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  645. # deck.playAction("a_fak_manual", 1,10, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  646. # trucks.playAction("a_fak_manual", 1,10, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  647. if own["fak_manual_timer"] == 41:
  648. killact(3000)
  649. killact(3001)
  650. killact(3002)
  651. def fak_manual_off():
  652. killact(222)
  653. killact(223)
  654. killact(224)
  655. killact(3000)
  656. killact(3001)
  657. killact(3002)
  658. killact(10)
  659. killact(32)
  660. killact(11)
  661. killact(34)
  662. #######
  663. #######
  664. #######
  665. #######
  666. def reg_nmanual_on():
  667. own['requestAction'] = 'reg_nmanual'
  668. # skater.playAction("reg_nmanual", 12,70, layer=222, blendin=0, layer_weight=.1, play_mode=1, speed=.5)
  669. # deck.playAction("a_fak_manual", 12,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  670. # trucks.playAction("a_fak_manual", 12,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  671. # if own["last_reg_nmanual"] == 0:
  672. # reg_stance_left_off()
  673. # reg_stance_right_off()
  674. # skater.playAction("reg_nmanual", 1,11, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  675. # deck.playAction("a_fak_manual", 1,11, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  676. # trucks.playAction("a_fak_manual", 1,11, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  677. if own["reg_nmanual_timer"] == 41:
  678. killact(3000)
  679. killact(3001)
  680. killact(3002)
  681. def reg_nmanual_off():
  682. killact(222)
  683. killact(223)
  684. killact(224)
  685. killact(3000)
  686. killact(3001)
  687. killact(3002)
  688. killact(10)
  689. killact(32)
  690. killact(11)
  691. killact(34)
  692. def fak_nmanual_on():
  693. #killall()
  694. own['requestAction'] = 'fak_nmanual'
  695. # skater.playAction("fak_nmanual", 12,70, layer=222, blendin=0, layer_weight=.1, play_mode=1, speed=.5)
  696. # deck.playAction("a_reg_manual", 12,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  697. # trucks.playAction("a_reg_manual", 12,70, layer=222, blendin=0, layer_weight=.9, play_mode=1, speed=.5)
  698. # if own["last_fak_nmanual"] == 0:
  699. # fak_stance_left_off()
  700. # fak_stance_right_off()
  701. # skater.playAction("fak_nmanual", 1,11, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  702. # deck.playAction("a_reg_manual", 1,11, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  703. # trucks.playAction("a_reg_manual", 1,11, layer=3000, blendin=2, layer_weight=.8, play_mode=0, speed=.5)
  704. if own["fak_nmanual_timer"] == 41:
  705. killact(3000)
  706. killact(3001)
  707. killact(3002)
  708. def fak_nmanual_off():
  709. killact(222)
  710. killact(223)
  711. killact(224)
  712. killact(3000)
  713. killact(3001)
  714. killact(3002)
  715. killact(10)
  716. killact(32)
  717. killact(11)
  718. killact(34)
  719. ###########
  720. def reg_stanceinc_on():
  721. skater.playAction("nreg", 1,60, layer=3, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  722. deck.playAction("a_reg", 1,40, layer=3, blendin=0, blend_mode=0, play_mode=1, speed=.5)
  723. trucks.playAction("a_reg", 1,40, layer=3, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  724. def reg_stanceinc_off():
  725. killact(3)
  726. def reg_stance_left_on():
  727. #if own["reg_manual"] == 0 and own["fak_manual"] == 0 and own["reg_nmanual"] == 0 and own["fak_nmanual"] == 0 :
  728. if own['manual_v2'] == 0 and own["revert_timer"] < 1:
  729. own['requestAction'] = 'reg_turnLeft'
  730. # skater.playAction("nreg_left", 10,30, layer=10, blendin=10, layer_weight=0, play_mode=1, speed=.5)
  731. # deck.playAction("a_reg_left", 10,30, layer=10, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  732. LAST_LEFT = own["LAST_LEFT"]
  733. #layer 100 is frame 20
  734. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  735. #print(playing_action_frame, "PAF")
  736. if LAST_LEFT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
  737. LAST_LEFT = 1
  738. # skater.playAction("nreg_left", 1,10, layer=32, blendin=10, layer_weight=0, play_mode=0, speed=.5)
  739. # deck.playAction("a_reg_left", 1,10, layer=32, blendin=10, layer_weight=0, priority=7, play_mode=0, speed=.5)
  740. own["LAST_LEFT"] = 1
  741. def reg_stance_right_on():
  742. if own['manual_v2'] == 0 and own["revert_timer"] < 1:
  743. own['requestAction'] = 'reg_turnRight'
  744. # skater.playAction("nreg_right", 10,30, layer=11, blendin=10, layer_weight=0, play_mode=1, speed=.5)
  745. # deck.playAction("a_reg_right", 10,30, layer=11, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  746. LAST_RIGHT = own["LAST_RIGHT"]
  747. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  748. if LAST_RIGHT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
  749. LAST_RIGHT = 1
  750. # skater.playAction("nreg_right", 1,10, layer=34, blendin=10, layer_weight=0, play_mode=0, speed=.5)
  751. # deck.playAction("a_reg_right", 1,10, layer=34, blendin=10, layer_weight=0, priority=7, play_mode=0, speed=.5)
  752. own["LAST_RIGHT"] = 1
  753. def fak_stance_on():
  754. playing = deck.isPlayingAction(40)
  755. if own['manual_v2'] == 0 and own["revert_timer"] < 1 and playing == 0:
  756. own['requestAction'] = 'fak_roll'
  757. #skater.playAction("nfak", 1,60, layer=3, blendin=4, priority=9, layer_weight=0, play_mode=1, speed=.5)
  758. #deck.playAction("a_reg", 1,40, layer=3, blendin=2, priority=9, layer_weight=0, play_mode=1, speed=.5)
  759. #trucks.playAction("a_reg", 1,40, layer=3, blendin=2, priority=9, layer_weight=0, play_mode=1, speed=.5)
  760. def fak_stance_off():
  761. killact(3)
  762. def fak_stance_left_on():
  763. if own['manual_v2'] == 0 and own["revert_timer"] < 1:
  764. own['requestAction'] = 'fak_turnLeft'
  765. #skater.playAction("nfak_left", 10,30, layer=12, blendin=10, layer_weight=0, play_mode=1, speed=.5)
  766. #deck.playAction("a_reg_right", 10,30, layer=12, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  767. LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
  768. playing_action_frame = skater.getActionFrame(LAND_LAYER)
  769. if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
  770. LAST_LEFT_FAK = 1
  771. #skater.playAction("nfak_left", 1,10, layer=36, blendin=10, layer_weight=0, play_mode=0, speed=.5)
  772. #deck.playAction("a_reg_right", 1,10, layer=36, blendin=10, layer_weight=0, priority=7, play_mode=0, speed=.5)
  773. own["LAST_LEFT_FAK"] = 1
  774. def fak_stance_left_off():
  775. killact(12)
  776. killact(36)
  777. LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
  778. #if LAST_LEFT_FAK == 1 and rUD < .06:
  779. #skater.playAction("nfak_left", 30,40, layer=33, blendin=10, layer_weight=0, play_mode=0, speed=2)
  780. #deck.playAction("a_reg_left", 30,40, layer=33, blendin=10, layer_weight=0, priority=7, play_mode=0, speed=.5)
  781. #deck.playAction("a_reg_right", 30,40, layer=501, play_mode=0, speed=.5)
  782. own["LAST_LEFT_FAK"] = 0
  783. def fak_stance_right_on():
  784. if own['manual_v2'] == 0 and own["revert_timer"] < 1:
  785. own['requestAction'] = 'fak_turnRight'
  786. #skater.playAction("nfak_right", 10,30, layer=13, blendin=10, layer_weight=0, play_mode=1, speed=.5)
  787. #deck.playAction("a_reg_left", 10,30, layer=13, blendin=2, layer_weight=0, play_mode=1, speed=.5)
  788. LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
  789. #playing_action_frame = skater.getActionFrame(LAND_LAYER)
  790. #if LAST_RIGHT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
  791. #LAST_RIGHT_FAK = 1
  792. #skater.playAction("nfak_right", 1,10, layer=37, blendin=10, layer_weight=0, play_mode=0, speed=.5)
  793. #deck.playAction("a_reg_left", 1,10, layer=37, blendin=10, layer_weight=0, priority=7, play_mode=0, speed=.5)
  794. own["LAST_RIGHT_FAK"] = 1
  795. def fak_stance_right_off():
  796. killact(13)
  797. killact(37)
  798. LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
  799. #if LAST_RIGHT_FAK == 1 and rUD < .06:
  800. #skater.playAction("nfak_right", 30,40, layer=33, blendin=10, layer_weight=0, play_mode=0, speed=2)
  801. #deck.playAction("a_reg_left", 30,40, layer=33, blendin=10, layer_weight=0, priority=7, play_mode=0, speed=.5)
  802. #deck.playAction("a_reg_right", 30,40, layer=501, play_mode=0, speed=.5)
  803. own["LAST_RIGHT_FAK"] = 0
  804. def reg_air_on():
  805. playing = deck.isPlayingAction(fliplay)
  806. if playing == False:
  807. own['requestAction'] = 'reg_air'
  808. #skater.playAction("reg_air", 1,60, layer=4, blendin=2, priority=6, layer_weight=0, play_mode=1, speed=.5)
  809. def reg_air_off():
  810. killact(4)
  811. def fak_air_on():
  812. flipping = skater.isPlayingAction(fliplay)
  813. if flipping == False:
  814. own['requestAction'] = 'fak_air'
  815. #skater.playAction("fak_air", 1,60, layer=5, blendin=2, priority=9, layer_weight=0, play_mode=1, speed=.5)
  816. def fak_air_off():
  817. killact(5)
  818. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  819. def stance():
  820. # turnsens = .04
  821. # turnblend = 10
  822. rotation = .96
  823. turnsens = 0.06
  824. if rot.z < .9: inc = 1
  825. else: inc = 0
  826. flipping = skater.isPlayingAction(500)
  827. #print(flipping)
  828. #ground
  829. if r_ground.triggered == True and grindHit == False and flipping == False and own["wallride"] == None and own['revert_timer'] < 2:
  830. if STANCE == 0:
  831. reg_manual = own['reg_manual']
  832. fak_manual = own["fak_manual"]
  833. reg_nmanual = own['reg_nmanual']
  834. fak_nmanual = own["fak_nmanual"]
  835. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  836. fak_stance_off()
  837. reg_air_off()
  838. fak_air_off()
  839. if reg_manual == 0 and fak_manual == 0:
  840. last_manual = own['last_reg_manual']
  841. if last_manual == 1:
  842. reg_manual_off()
  843. fak_manual_off()
  844. reg_stance_on()
  845. # if own['last_manual'] == 1:
  846. # if STANCE == 0:
  847. # if fak_manual == 1:
  848. # fak_manual = 0
  849. # reg_nmanual = 1
  850. # own['reg_nmanual'] = 1
  851. # print("changing manual")
  852. #if reg_manual == 1 and fak_manual == 0 and reg_nmanual == 0 and fak_nmanual == 0:
  853. #if reg_manual == 1 and fak_manual == 0 and reg_nmanual == 0:
  854. if own['manual_v2_type'] == 'reg manual':
  855. reg_manual_on()
  856. #elif reg_manual == 0 and fak_manual == 0 and reg_nmanual == 1 and fak_nmanual == 0:
  857. elif own['manual_v2_type'] == 'reg nose manual':
  858. reg_nmanual_on()
  859. #elif reg_manual == 0 and fak_manual == 1 and reg_nmanual == 0 and fak_nmanual == 0:
  860. elif own['manual_v2_type'] == 'fak manual':
  861. #reg_nmanual_on()
  862. fak_manual_on()
  863. #elif reg_manual == 0 and fak_manual == 0 and reg_nmanual == 0 and fak_nmanual == 1:
  864. elif own['manual_v2_type'] == 'fak nose manual':
  865. #reg_manual_on()
  866. fak_nmanual_on()
  867. if STANCE == 1:
  868. reg_manual = own['reg_manual']
  869. fak_manual = own["fak_manual"]
  870. reg_nmanual = own['reg_nmanual']
  871. fak_nmanual = own["fak_nmanual"]
  872. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  873. #fak_manual_off()
  874. #reg_manual_off()
  875. #print("turn man off")
  876. reg_stance_off()
  877. reg_air_off()
  878. fak_air_off
  879. if fak_manual == 0:
  880. last_manual = own['last_fak_manual']
  881. if last_manual == 1:
  882. fak_manual_off()
  883. reg_manual_off()
  884. fak_stance_on()
  885. #if reg_manual == 0 and fak_manual == 1 and reg_nmanual == 0 and fak_nmanual == 0:
  886. if own['manual_v2_type'] == 'fak manual':
  887. fak_manual_on()
  888. #elif reg_manual == 0 and fak_manual == 0 and reg_nmanual == 0 and fak_nmanual == 1:
  889. elif own['manual_v2_type'] == 'fak nose manual':
  890. fak_nmanual_on()
  891. #elif reg_manual == 1 and fak_manual == 0 and reg_nmanual == 0 and fak_nmanual == 0:
  892. elif own['manual_v2_type'] == 'reg manual':
  893. #fak_nmanual_on()
  894. reg_manual_on()
  895. #elif reg_manual == 0 and fak_manual == 0 and reg_nmanual == 1 and fak_nmanual == 0:
  896. elif own['manual_v2_type'] == 'reg nose manual':
  897. #fak_manual_on()
  898. reg_nmanual_on()
  899. #fak_stance_on()
  900. if own["Pump"] == False:
  901. if lLR < -turnsens and STANCE == 0:
  902. reg_stance_left_on()
  903. if lLR > -turnsens or LAST_GRIND != grindHit:
  904. reg_stance_left_off()
  905. if lLR > turnsens and STANCE == 0:
  906. reg_stance_right_on()
  907. if lLR < turnsens or LAST_GRIND != grindHit:
  908. reg_stance_right_off()
  909. if lLR < -turnsens and STANCE == 1:
  910. fak_stance_left_on()
  911. if lLR > -turnsens or LAST_GRIND != grindHit:
  912. fak_stance_left_off()
  913. if lLR > turnsens and STANCE == 1:
  914. fak_stance_right_on()
  915. if lLR < turnsens or LAST_GRIND != grindHit:
  916. fak_stance_right_off()
  917. #air
  918. playing = deck.isPlayingAction(fliplay)
  919. #playing = False
  920. if r_ground.triggered == False and playing == False and flipping == False:
  921. if STANCE == 0:
  922. #if LAST_STANCE != STANCE or r_ground.triggered:
  923. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  924. fak_air_off()
  925. reg_stance_off()
  926. fak_stance_off()
  927. reg_stance_left_off()
  928. reg_stance_right_off()
  929. fak_stance_left_off()
  930. fak_stance_right_off()
  931. # reg_manual_off()
  932. # fak_manual_off()
  933. reg_air_on()
  934. if STANCE == 1:
  935. if LAST_STANCE != STANCE or LAST_GROUND != r_ground.triggered:
  936. reg_air_off()
  937. reg_stance_off()
  938. fak_stance_off()
  939. reg_stance_left_off()
  940. reg_stance_right_off()
  941. fak_stance_left_off()
  942. fak_stance_right_off()
  943. # reg_manual_off()
  944. # fak_manual_off()
  945. fak_air_on()
  946. if grindHit == True:
  947. reg_stance_off()
  948. fak_stance_off()
  949. ###################
  950. #trick definitions#
  951. ###################
  952. def jump():
  953. #print("jump funct")
  954. jump_timer = own['jump_timer']
  955. reg_manual_off()
  956. fak_manual_off()
  957. reg_nmanual_off()
  958. fak_nmanual_off()
  959. #grindold
  960. #fak_manual_off()
  961. #print(JUMPSTRENGTH)
  962. cont.deactivate(wallrideconstL)
  963. cont.deactivate(wallrideconstR)
  964. if JUMPSTRENGTH != 0:
  965. height = JUMPSTRENGTH * JUMPHEIGHT
  966. else:
  967. height = JUMPHEIGHT
  968. #if jump_timer == 0:
  969. if jump_timer < 50:
  970. jump_timer = 60
  971. own['jump_timer'] = jump_timer
  972. if zvel < 7 and jump_timer == 60:
  973. cont.activate(own.actuators["pop"])
  974. own['pop_sound'] = 1
  975. print("jump")
  976. #
  977. posx = own.worldPosition[0]
  978. posy = own.worldPosition[1]
  979. posz = own.worldPosition[2]
  980. jumppos = Vector((posx, posy, posz))
  981. own['jumpPos'] = jumppos
  982. force = [ 0.0, 0.0, height]
  983. # use local axis
  984. local = False
  985. # apply force
  986. try:
  987. if 'trans' in r_ground.hitObject:
  988. print('jump from trans')
  989. own['jump_from_trans'] = 1
  990. own['trans_jump_obj'] = r_ground.hitObject
  991. except:
  992. print('trans jump broke')
  993. if grindHit == False:
  994. own.applyForce(force, local)
  995. force2 = [0.0, 0, 150]
  996. own.applyForce(force2, True)
  997. #print("apply jump force1")
  998. if grindHit == True:
  999. linvelloc = own.getLinearVelocity(True)
  1000. own.applyForce(force, True)
  1001. force2 = [0.0, 0, 150]
  1002. own.applyForce(force2, True)
  1003. linvelloc2 = own.getLinearVelocity(True)
  1004. force = (linvelloc.x, linvelloc.y, linvelloc2.z)
  1005. own.setLinearVelocity(force, True)
  1006. #print("apply jump force2 grindHit")
  1007. own['jump_stance'] = STANCE
  1008. if STANCE == True:
  1009. own["jump_stance"] = 1
  1010. if STANCE == False:
  1011. own["jump_stance"] = 0
  1012. #own["jump_stance"] = own["stance"]
  1013. if grindHit == True:
  1014. own['grind_jump'] = 1
  1015. if lLR > turnsens or lLR < -turnsens or lUD > turnsens or lUD < -turnsens:
  1016. own['grindjumpturn'] = True
  1017. #print("turn on grindjumpturn")
  1018. num = 1
  1019. if num ==1:
  1020. rString = "R"
  1021. lString = "L"
  1022. cont.deactivate(wallrideconstL)
  1023. cont.deactivate(wallrideconstR)
  1024. #print("deactivating constraints")
  1025. if own["wallride"] == "R":
  1026. force = [0,170,0]
  1027. own.applyForce(force, True)
  1028. print("****walljumpforce R")
  1029. cont.activate(own.actuators["pop2"])
  1030. jump_timer = 60
  1031. own['jump_timer'] = jump_timer
  1032. if own["wallride"] == "L":
  1033. force = [0,-170,0] #325
  1034. own.applyForce(force, True)
  1035. print("****walljumpforce L")
  1036. cont.activate(own.actuators["pop2"])
  1037. jump_timer = 60
  1038. own['jump_timer'] = jump_timer
  1039. own["Q1oncd"] = 0
  1040. own["Q2oncd"] = 0
  1041. own["Q3oncd"] = 0
  1042. own["Q4oncd"] = 0
  1043. own["Q5oncd"] = 0
  1044. own["Q6oncd"] = 0
  1045. own["Q7oncd"] = 0
  1046. own["Q8oncd"] = 0
  1047. # if rot.z < .4:
  1048. # force = [-1, linVelocity.y, linVelocity.z]
  1049. # own.setLinearVelocity(force, local)
  1050. if own['jump_timer'] == 60:
  1051. own['jump_timer'] = 59
  1052. def jump_Timer():
  1053. jump_timer = own['jump_timer']
  1054. if jump_timer == 1:
  1055. pass
  1056. if jump_timer > 0:
  1057. jump_timer = jump_timer - 1
  1058. own['jump_timer'] = jump_timer
  1059. if own['grindjumpturn'] == True:
  1060. jump_timer = 30
  1061. own['jump_timer'] = jump_timer
  1062. def pump():
  1063. velocity = own['velocity']
  1064. #regular
  1065. local = True
  1066. downforce = -.1
  1067. if linVelocity.x < MAX_VEL and linVelocity.x >= -0 and STANCE == 1 and grindHit == False:
  1068. countdown = COUNTDOWN
  1069. yvel = linVelocity.x + SPEEDPUMP
  1070. yvel2 = linVelocity.x + SPEEDPUMPFAST
  1071. own['countdown'] = countdown
  1072. force = [(yvel), 0, linVelocity.z + downforce]
  1073. force2 = [(yvel2), 0, linVelocity.z + downforce]
  1074. if rot.z < PUMP_SENS and rot.z > PUMP_SPEED_SENS:
  1075. own.setLinearVelocity(force, local)
  1076. if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
  1077. own.setLinearVelocity(force2, local)
  1078. own['requestAction'] = 'fak_pump'
  1079. #skater.playAction("nfak_pump.001", 1,60, layer=20, priority=8, blendin=10, play_mode=1, speed=.5)
  1080. #skater.playAction("nopos", 1,40, layer=0, priority=7, blendin=10, play_mode=3, speed=.5)
  1081. if lastpump == False:
  1082. #skater.playAction("nfak_pump_in", 1,20, layer=350, priority=8, blendin=10, play_mode=0, speed=1)
  1083. #cont.activate(fak_pumpin)
  1084. pass
  1085. #switch
  1086. if linVelocity.x > -MAX_VEL and linVelocity.x <= 0 and STANCE == 0 and grindHit == False:
  1087. countdown = COUNTDOWN
  1088. yvel = linVelocity.x - SPEEDPUMP
  1089. yvel2 = linVelocity.x - SPEEDPUMPFAST
  1090. own['countdown'] = countdown
  1091. force = [(yvel), 0, linVelocity.z + downforce]
  1092. force2 = [(yvel2), 0, linVelocity.z + downforce]
  1093. if rot.z < PUMP_SENS and rot.z > PUMP_SPEED_SENS:
  1094. own.setLinearVelocity(force, local)
  1095. if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
  1096. own.setLinearVelocity(force2, local)
  1097. own['requestAction'] = 'reg_pump'
  1098. #skater.playAction("nreg_pump", 1,60, layer=21, priority=8, blendin=10, play_mode=1, speed=.5)
  1099. if lastpump == False:
  1100. #skater.playAction("nreg_pump_in", 1,20, layer=350, priority=8, blendin=10, play_mode=0, speed=1)
  1101. #cont.activate(reg_pumpin)
  1102. pass
  1103. #force = [ 0, 0, -200]
  1104. #own.applyForce(force, 0) # apply force
  1105. own["Pump"] = True
  1106. own["lastPump"] = True
  1107. def roll():
  1108. if r_ground.triggered == 1:
  1109. pass
  1110. def stop():
  1111. #if r_ground.triggered == 1 and STANCE == False and linVelocity.x < -.1:
  1112. if r_ground.triggered == 1 and STANCE == False:
  1113. skater.playAction("reg_stop", 1,30, layer=18, priority=59, blendin=10, play_mode=1, speed=.5)
  1114. yvel = linVelocity.x * .985
  1115. force = [(yvel), 0, linVelocity.z]
  1116. own.setLinearVelocity(force, True)
  1117. if lastStop == False:
  1118. skater.playAction("reg_stopin", 1,15, layer=61, priority=3, blendin=10, play_mode=0, speed=.5)
  1119. #elif r_ground.triggered == 1 and STANCE == True and linVelocity.x > .1:
  1120. elif r_ground.triggered == 1 and STANCE == True:
  1121. skater.playAction("fak_stop", 1,30, layer=19, priority=7, blendin=10, play_mode=1, speed=.5)
  1122. yvel = linVelocity.x * .985
  1123. force = [(yvel), 0, linVelocity.z]
  1124. own.setLinearVelocity(force, True)
  1125. if lastStop == False:
  1126. skater.playAction("fak_stopin", 1,15, layer=62, priority=3, blendin=10, play_mode=0, speed=.5)
  1127. own["lastStop"] = True
  1128. # if linVelocity.x < .1:
  1129. # force = [0, 0, linVelocity.z]
  1130. # own.setLinearVelocity(force, True)
  1131. if linVelocity.x < .05 and linVelocity.x > -.05 and own["lastStop"] == True:
  1132. own["lastStop"] == False
  1133. skater.stopAction(7)
  1134. skater.stopAction(1)
  1135. if STANCE == True:
  1136. skater.playAction("fak_stopin", 15,1, layer=63, priority=3, blendin=10, play_mode=0, speed=.5)
  1137. elif STANCE == False:
  1138. skater.playAction("reg_stopin", 15,1, layer=64, priority=3, blendin=10, play_mode=0, speed=.5)
  1139. def oposin():
  1140. if skater.isPlayingAction(30) or skater.isPlayingAction(31):
  1141. landing = 1
  1142. else:
  1143. landing = 0
  1144. if (r_ground.triggered == 1) and STANCE == False and landing == 0 and own['manual'] == 0:
  1145. if grindold == 0:
  1146. own['requestAction'] = 'reg_opos'
  1147. #if lastopos == False:
  1148. #skater.playAction("noposin", 1,20, layer=65, priority=3, blendin=10, play_mode=0, speed=.5)
  1149. #else:
  1150. #skater.playAction("nopos", 1,40, layer=67, priority=7, blendin=10, play_mode=1, speed=.5)
  1151. elif (r_ground.triggered == 1) and STANCE == True and own['manual'] == 0:
  1152. if grindold == 0:
  1153. own['requestAction'] = 'fak_opos'
  1154. #skater.playAction("fak_opos", 1,40, layer=68, priority=7, blendin=10, play_mode=1, speed=.5)
  1155. #if lastopos == False:
  1156. #skater.playAction("fak_oposin", 1,20, layer=66, priority=3, blendin=10, play_mode=0, speed=.5)
  1157. else:
  1158. killact(65)
  1159. killact(66)
  1160. killact(67)
  1161. killact(68)
  1162. own["last_Opos"] = True
  1163. def noposin():
  1164. if skater.isPlayingAction(30) or skater.isPlayingAction(31):
  1165. landing = 1
  1166. else:
  1167. landing = 0
  1168. if (r_ground.triggered == 1) and STANCE == False and landing == 0 and own['manual'] == 0:
  1169. #pass
  1170. if grindold == 0:
  1171. own['requestAction'] = 'reg_nopos'
  1172. # skater.playAction("nnopos", 1,40, layer=73, priority=8, blendin=10, play_mode=1, speed=.5)
  1173. # if lastnopos == False:
  1174. # skater.playAction("nnoposin", 1,20, layer=71, priority=4, blendin=10, play_mode=0, speed=.5)
  1175. elif (r_ground.triggered == 1) and STANCE == True and own['manual'] == 0:
  1176. if grindold == 0:
  1177. own['requestAction'] = 'fak_nopos'
  1178. # if lastnopos == False:
  1179. # skater.playAction("fak_noposin", 1,20, layer=72, priority=4, blendin=10, play_mode=0, speed=.5)
  1180. # else:
  1181. # skater.playAction("fak_nopos", 1,40, layer=74, priority=8, blendin=10, play_mode=1, speed=.5)
  1182. else:
  1183. killact(71)
  1184. killact(72)
  1185. killact(73)
  1186. killact(74)
  1187. own["last_nOpos"] = True
  1188. def aollie():
  1189. print("ollie")
  1190. dict['trick_string'] = 'Ollie'
  1191. r_ground = cont.sensors["r_Ground"]
  1192. trigger = r_ground.triggered
  1193. STANCE = own["stance"]
  1194. wallride = own["wallride"]
  1195. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1196. own["wallride_off"] = 1
  1197. own['requestAction'] = 'reg_ollie'
  1198. jump()
  1199. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1200. own["wallride_off"] = 1
  1201. own['requestAction'] = 'fak_ollie'
  1202. jump()
  1203. def nollie():
  1204. print("nollie")
  1205. dict['trick_string'] = 'Nollie'
  1206. r_ground = cont.sensors["r_Ground"]
  1207. trigger = r_ground.triggered
  1208. STANCE = own["stance"]
  1209. if (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1210. own['requestAction'] = 'fak_nollie'
  1211. own["wallride_off"] = 1
  1212. jump()
  1213. elif (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1214. own["wallride_off"] = 1
  1215. own['requestAction'] = 'reg_nollie'
  1216. jump()
  1217. def kickflip():
  1218. print("kickflip")
  1219. dict['trick_string'] = 'Kickflip'
  1220. STANCE = own["stance"]
  1221. print(flip_start_lay)
  1222. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1223. own["wallride_off"] = 1
  1224. own['requestAction'] = 'reg_kickflip'
  1225. jump()
  1226. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1227. own["wallride_off"] = 1
  1228. own['requestAction'] = 'fak_kickflip'
  1229. jump()
  1230. if own["wallride"] !=1: jump()
  1231. if r_ground.triggered == 0 and STANCE == False:
  1232. own["wallride_off"] = 1
  1233. own['requestAction'] = 'reg_kickflip'
  1234. if own["wallride"] != None:
  1235. jump()
  1236. elif r_ground.triggered == 0 and STANCE == True:
  1237. own["wallride_off"] = 1
  1238. own['requestAction'] = 'fak_kickflip'
  1239. if own["wallride"] != None:
  1240. jump()
  1241. def varial_kickflip():
  1242. print("varial kickflip")
  1243. dict['trick_string'] = 'Varial Kickflip'
  1244. STANCE = own["stance"]
  1245. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1246. own["wallride_off"] = 1
  1247. own['requestAction'] = 'reg_varial_kickflip'
  1248. jump()
  1249. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1250. own["wallride_off"] = 1
  1251. own['requestAction'] = 'fak_varial_kickflip'
  1252. jump()
  1253. if r_ground.triggered == 0 and STANCE == False:
  1254. own["wallride_off"] = 1
  1255. if own["wallride"] != None:
  1256. jump()
  1257. elif r_ground.triggered == 0 and STANCE == True:
  1258. own["wallride_off"] = 1
  1259. if own["wallride"] != None:
  1260. jump()
  1261. def nollie_varial_kickflip():
  1262. print("nollie varial kickflip")
  1263. dict['trick_string'] = 'Nollie Varial Kickflip'
  1264. STANCE = own["stance"]
  1265. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1266. own["wallride_off"] = 1
  1267. own['requestAction'] = 'reg_nollie_varial_kickflip'
  1268. jump()
  1269. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1270. own["wallride_off"] = 1
  1271. own['requestAction'] = 'fak_nollie_varial_kickflip'
  1272. jump()
  1273. if r_ground.triggered == 0 and STANCE == False:
  1274. own["wallride_off"] = 1
  1275. if own["wallride"] != None:
  1276. jump()
  1277. elif r_ground.triggered == 0 and STANCE == True:
  1278. own["wallride_off"] = 1
  1279. if own["wallride"] != None:
  1280. jump()
  1281. def nollie_varial_heelflip():
  1282. print("nollie varial heelflip")
  1283. dict['trick_string'] = 'Nollie Varial Heelflip'
  1284. STANCE = own["stance"]
  1285. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1286. own["wallride_off"] = 1
  1287. own['requestAction'] = 'reg_nollie_varial_heelflip'
  1288. jump()
  1289. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1290. own["wallride_off"] = 1
  1291. own['requestAction'] = 'fak_nollie_varial_heelflip'
  1292. jump()
  1293. if r_ground.triggered == 0 and STANCE == False:
  1294. own["wallride_off"] = 1
  1295. if own["wallride"] != None:
  1296. jump()
  1297. elif r_ground.triggered == 0 and STANCE == True:
  1298. own["wallride_off"] = 1
  1299. if own["wallride"] != None:
  1300. jump()
  1301. def varial_heelflip():
  1302. print("varial heelflip")
  1303. dict['trick_string'] = 'Varial Heelflip'
  1304. STANCE = own["stance"]
  1305. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1306. own["wallride_off"] = 1
  1307. own['requestAction'] = 'reg_varial_heelflip'
  1308. jump()
  1309. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1310. own["wallride_off"] = 1
  1311. own['requestAction'] = 'fak_varial_heelflip'
  1312. jump()
  1313. if r_ground.triggered == 0 and STANCE == False:
  1314. own["wallride_off"] = 1
  1315. if own["wallride"] != None:
  1316. jump()
  1317. elif r_ground.triggered == 0 and STANCE == True:
  1318. own["wallride_off"] = 1
  1319. if own["wallride"] != None:
  1320. jump()
  1321. def nollie_kickflip():
  1322. print("kickflip")
  1323. STANCE = own["stance"]
  1324. dict['trick_string'] = 'Nollie Kickflip'
  1325. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1326. own["wallride_off"] = 1
  1327. own['requestAction'] = 'reg_nollie_kickflip'
  1328. jump()
  1329. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1330. own["wallride_off"] = 1
  1331. own['requestAction'] = 'fak_nollie_kickflip'
  1332. jump()
  1333. if r_ground.triggered == 0 and STANCE == False:
  1334. own["wallride_off"] = 1
  1335. if own["wallride"] != None:
  1336. print("wall out trick")
  1337. #jump()
  1338. elif r_ground.triggered == 0 and STANCE == True:
  1339. own["wallride_off"] = 1
  1340. if own["wallride"] != None:
  1341. print("wall out trick")
  1342. #jump()
  1343. def heelflip():
  1344. print("heelflip")
  1345. dict['trick_string'] = 'Heelflip'
  1346. STANCE = own["stance"]
  1347. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1348. own["wallride_off"] = 1
  1349. own['requestAction'] = 'reg_heelflip'
  1350. jump()
  1351. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1352. own["wallride_off"] = 1
  1353. own['requestAction'] = 'fak_heelflip'
  1354. jump()
  1355. if r_ground.triggered == 0 and STANCE == False:
  1356. own["wallride_off"] = 1
  1357. if own["wallride"] != None:
  1358. print("wall out trick")
  1359. #jump()
  1360. elif r_ground.triggered == 0 and STANCE == True:
  1361. own["wallride_off"] = 1
  1362. if own["wallride"] != None:
  1363. print("wall out trick")
  1364. #jump()
  1365. def nollie_heelflip():
  1366. print("heelflip")
  1367. dict['trick_string'] = 'Nollie Heelflip'
  1368. STANCE = own["stance"]
  1369. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1370. own["wallride_off"] = 1
  1371. own['requestAction'] = 'reg_nollie_heelflip'
  1372. jump()
  1373. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1374. own["wallride_off"] = 1
  1375. own['requestAction'] = 'fak_nollie_heelflip'
  1376. jump()
  1377. if r_ground.triggered == 0 and STANCE == False:
  1378. own["wallride_off"] = 1
  1379. if own["wallride"] != None:
  1380. jump()
  1381. elif r_ground.triggered == 0 and STANCE == True:
  1382. own["wallride_off"] = 1
  1383. if own["wallride"] != None:
  1384. jump()
  1385. def shovit():
  1386. print("shovit")
  1387. dict['trick_string'] = 'Shovit'
  1388. STANCE = own["stance"]
  1389. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1390. own["wallride_off"] = 1
  1391. own['requestAction'] = 'reg_shovit'
  1392. jump()
  1393. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1394. own["wallride_off"] = 1
  1395. own['requestAction'] = 'fak_shovit'
  1396. jump()
  1397. if r_ground.triggered == 0 and STANCE == False:
  1398. if own["wallride"] != None:
  1399. jump()
  1400. elif r_ground.triggered == 0 and STANCE == True:
  1401. own["wallride_off"] = 1
  1402. if own["wallride"] != None:
  1403. jump()
  1404. def shovit360():
  1405. print("360shovit")
  1406. dict['trick_string'] = '360 Shovit'
  1407. STANCE = own["stance"]
  1408. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1409. own["wallride_off"] = 1
  1410. own['requestAction'] = 'reg_shovit360'
  1411. jump()
  1412. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1413. own["wallride_off"] = 1
  1414. own['requestAction'] = 'fak_shovit360'
  1415. jump()
  1416. if r_ground.triggered == 0 and STANCE == False:
  1417. own["wallride_off"] = 1
  1418. if own["wallride"] != None:
  1419. jump()
  1420. elif r_ground.triggered == 0 and STANCE == True:
  1421. own["wallride_off"] = 1
  1422. if own["wallride"] != None:
  1423. jump()
  1424. def fsshovit360():
  1425. print("360shovit")
  1426. dict['trick_string'] = '360 Shovit'
  1427. STANCE = own["stance"]
  1428. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1429. own["wallride_off"] = 1
  1430. own['requestAction'] = 'reg_fsshovit360'
  1431. jump()
  1432. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1433. own["wallride_off"] = 1
  1434. own['requestAction'] = 'fak_fsshovit360'
  1435. jump()
  1436. if r_ground.triggered == 0 and STANCE == False:
  1437. own["wallride_off"] = 1
  1438. if own["wallride"] != None:
  1439. jump()
  1440. elif r_ground.triggered == 0 and STANCE == True:
  1441. own["wallride_off"] = 1
  1442. if own["wallride"] != None:
  1443. jump()
  1444. def nollie_shovit():
  1445. print("shovit")
  1446. dict['trick_string'] = 'Nollie Shovit'
  1447. STANCE = own["stance"]
  1448. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1449. own["wallride_off"] = 1
  1450. own['requestAction'] = 'reg_nollie_shovit'
  1451. jump()
  1452. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1453. own["wallride_off"] = 1
  1454. own['requestAction'] = 'fak_nollie_shovit'
  1455. jump()
  1456. if r_ground.triggered == 0 and STANCE == False:
  1457. own["wallride_off"] = 1
  1458. if own["wallride"] != None:
  1459. jump()
  1460. elif r_ground.triggered == 0 and STANCE == True:
  1461. own["wallride_off"] = 1
  1462. if own["wallride"] != None:
  1463. jump()
  1464. def fsshovit():
  1465. dict['trick_string'] = 'Frontside Shovit'
  1466. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1467. own["wallride_off"] = 1
  1468. own['requestAction'] = 'reg_fsshovit'
  1469. jump()
  1470. elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
  1471. own["wallride_off"] = 1
  1472. own['requestAction'] = 'fak_fsshovit'
  1473. jump()
  1474. if r_ground.triggered == 0 and STANCE == False:
  1475. own["wallride_off"] = 1
  1476. if own["wallride"] != None:
  1477. jump()
  1478. elif r_ground.triggered == 0 and STANCE == True:
  1479. own["wallride_off"] = 1
  1480. if own["wallride"] != None:
  1481. jump()
  1482. def nollie_fsshovit():
  1483. dict['trick_string'] = 'Nollie Frontside Shovit'
  1484. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1485. own["wallride_off"] = 1
  1486. own['requestAction'] = 'reg_nollie_fsshovit'
  1487. jump()
  1488. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1489. own["wallride_off"] = 1
  1490. own['requestAction'] = 'fak_nollie_fsshovit'
  1491. jump()
  1492. if r_ground.triggered == 0 and STANCE == False:
  1493. own["wallride_off"] = 1
  1494. if own["wallride"] != None:
  1495. jump()
  1496. elif r_ground.triggered == 0 and STANCE == True:
  1497. own["wallride_off"] = 1
  1498. if own["wallride"] != None:
  1499. jump()
  1500. #nollie_shovit360()
  1501. def nollie_shovit360():
  1502. dict['trick_string'] = 'Nollie Frontside Shovit 360'
  1503. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1504. own["wallride_off"] = 1
  1505. own['requestAction'] = 'reg_nollie_shovit360'
  1506. jump()
  1507. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1508. own["wallride_off"] = 1
  1509. own['requestAction'] = 'fak_nollie_shovit360'
  1510. jump()
  1511. if r_ground.triggered == 0 and STANCE == False:
  1512. own["wallride_off"] = 1
  1513. if own["wallride"] != None:
  1514. jump()
  1515. elif r_ground.triggered == 0 and STANCE == True:
  1516. own["wallride_off"] = 1
  1517. if own["wallride"] != None:
  1518. jump()
  1519. #nollie_fsshovit360()
  1520. def nollie_fsshovit360():
  1521. dict['trick_string'] = 'Nollie Frontside Shovit'
  1522. if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
  1523. own["wallride_off"] = 1
  1524. own['requestAction'] = 'reg_nollie_fsshovit'
  1525. jump()
  1526. elif (r_ground.triggered == 1 and STANCE == True) or (grindHit == True and STANCE == True):
  1527. own["wallride_off"] = 1
  1528. own['requestAction'] = 'fak_nollie_fsshovit'
  1529. jump()
  1530. if r_ground.triggered == 0 and STANCE == False:
  1531. own["wallride_off"] = 1
  1532. if own["wallride"] != None:
  1533. jump()
  1534. elif r_ground.triggered == 0 and STANCE == True:
  1535. own["wallride_off"] = 1
  1536. if own["wallride"] != None:
  1537. jump()
  1538. def frontside_grab_on():
  1539. GRAB_PLAYED = own["GRAB_PLAYED"]
  1540. GRAB_ON = own["GRAB_ON"]
  1541. dict['trick_string'] = 'Mute Grab'
  1542. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1543. own['requestAction'] = 'frontside_grab'
  1544. #skater.playAction("reg_fg", 10,30, layer=400, priority=5, play_mode=1, speed=.5)
  1545. grablay2 = grablay + 1
  1546. GRAB_PLAYED = True
  1547. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1548. elif r_ground.triggered == 1:
  1549. killact(400)
  1550. killact(401)
  1551. def backside_grab_on():
  1552. GRAB_PLAYED = own["GRAB_PLAYED"]
  1553. GRAB_ON = own["GRAB_ON"]
  1554. if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
  1555. skater.playAction("reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  1556. deck.playAction("a_reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  1557. trucks.playAction("a_reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  1558. elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1559. own['requestAction'] = 'backside_grab'
  1560. #skater.playAction("reg_bsg2", 10,30, layer=402, priority=5, play_mode=1, speed=.5)
  1561. GRAB_PLAYED = True
  1562. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1563. elif r_ground.triggered == 1:
  1564. killact(402)
  1565. def fakfrontside_grab_on():
  1566. GRAB_PLAYED = own["GRAB_PLAYED"]
  1567. GRAB_ON = own["GRAB_ON"]
  1568. if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
  1569. skater.playAction("fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  1570. deck.playAction("a_fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  1571. trucks.playAction("a_fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  1572. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1573. #cont.activate(fak_frontsidegrab)
  1574. own['requestAction'] = 'fak_frontside_grab'
  1575. #skater.playAction("fak_fg", 10,30, layer=403, priority=5, play_mode=1, speed=.5)
  1576. GRAB_PLAYED = True
  1577. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1578. #print("frontside_grab_on")
  1579. elif r_ground.triggered == 1:
  1580. killact(403)
  1581. def fakbackside_grab_on():
  1582. GRAB_PLAYED = own["GRAB_PLAYED"]
  1583. GRAB_ON = own["GRAB_ON"]
  1584. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1585. #cont.activate(fak_backsidegrab)
  1586. own['requestAction'] = 'fak_backside_grab'
  1587. #skater.playAction("fak_bg", 10,30, layer=404, priority=5, play_mode=1, speed=.5)
  1588. GRAB_PLAYED = True
  1589. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1590. elif r_ground.triggered == 1:
  1591. killact(404)
  1592. #nose/tail grabs
  1593. def frontside_nose_grab_on():
  1594. GRAB_PLAYED = own["GRAB_PLAYED"]
  1595. GRAB_ON = own["GRAB_ON"]
  1596. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1597. own['requestAction'] = 'frontside_nose_grab'
  1598. #cont.activate(fak_backsidegrab)
  1599. #skater.playAction("frontside_nose_grab", 10,30, layer=400, priority=5, blendin=5, play_mode=1, speed=.5)
  1600. GRAB_PLAYED = True
  1601. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1602. elif r_ground.triggered == 1:
  1603. killact(400)
  1604. print("frontside nosegrab on")
  1605. def frontside_tail_grab_on():
  1606. GRAB_PLAYED = own["GRAB_PLAYED"]
  1607. GRAB_ON = own["GRAB_ON"]
  1608. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1609. own['requestAction'] = 'frontside_tail_grab'
  1610. #cont.activate(fak_backsidegrab)
  1611. #skater.playAction("frontside_tail_grab", 10,30, layer=409, priority=5, blendin=5, play_mode=1, speed=.5)
  1612. GRAB_PLAYED = True
  1613. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1614. elif r_ground.triggered == 1:
  1615. killact(400)
  1616. print("frontside tailgrab on")
  1617. def backside_nose_grab_on():
  1618. GRAB_PLAYED = own["GRAB_PLAYED"]
  1619. GRAB_ON = own["GRAB_ON"]
  1620. #airwalk
  1621. #if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0 and (aBut == True):
  1622. if GRAB_ON == True and r_ground.triggered == 0 and (aBut == True):
  1623. print("airwalk")
  1624. skater.playAction("reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
  1625. deck.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
  1626. trucks.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
  1627. #norm
  1628. elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1629. #cont.activate(fak_backsidegrab)
  1630. own['requestAction'] = 'backside_nose_grab'
  1631. #skater.playAction("backside_nose_grab", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
  1632. GRAB_PLAYED = True
  1633. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1634. elif r_ground.triggered == 1:
  1635. killact(405)
  1636. print("backside nosegrab on")
  1637. def backside_tail_grab_on():
  1638. GRAB_PLAYED = own["GRAB_PLAYED"]
  1639. GRAB_ON = own["GRAB_ON"]
  1640. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1641. own['requestAction'] = 'backside_tail_grab'
  1642. #cont.activate(fak_backsidegrab)
  1643. #skater.playAction("backside_tail_grab", 10,30, layer=411, priority=5, blendin=5, play_mode=1, speed=.5)
  1644. GRAB_PLAYED = True
  1645. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1646. elif r_ground.triggered == 1:
  1647. killact(411)
  1648. print("backside tailgrab on")
  1649. #switch
  1650. def fak_frontside_nose_grab_on():
  1651. GRAB_PLAYED = own["GRAB_PLAYED"]
  1652. GRAB_ON = own["GRAB_ON"]
  1653. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1654. own['requestAction'] = 'fak_frontside_nose_grab'
  1655. #cont.activate(fak_backsidegrab)
  1656. #skater.playAction("fak_frontside_nose_grab", 10,30, layer=406, priority=5, blendin=5, play_mode=1, speed=.5)
  1657. GRAB_PLAYED = True
  1658. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1659. elif r_ground.triggered == 1:
  1660. killact(406)
  1661. print("fak frontside nosegrab on")
  1662. def fak_frontside_tail_grab_on():
  1663. GRAB_PLAYED = own["GRAB_PLAYED"]
  1664. GRAB_ON = own["GRAB_ON"]
  1665. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1666. #cont.activate(fak_backsidegrab)
  1667. own['requestAction'] = 'fak_frontside_tail_grab'
  1668. #skater.playAction("fak_frontside_tail_grab", 10,30, layer=412, priority=5, blendin=5, play_mode=1, speed=.5)
  1669. GRAB_PLAYED = True
  1670. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1671. elif r_ground.triggered == 1:
  1672. killact(412)
  1673. print("fak frontside tailgrab on")
  1674. def fak_backside_nose_grab_on():
  1675. GRAB_PLAYED = own["GRAB_PLAYED"]
  1676. GRAB_ON = own["GRAB_ON"]
  1677. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1678. #cont.activate(fak_backsidegrab)
  1679. own['requestAction'] = 'fak_backside_nose_grab'
  1680. #skater.playAction("fak_backside_nose_grab", 10,30, layer=408, priority=5, blendin=5, play_mode=1, speed=.5)
  1681. GRAB_PLAYED = True
  1682. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1683. elif r_ground.triggered == 1:
  1684. killact(408)
  1685. print("fak backside nosegrab on")
  1686. def fak_backside_tail_grab_on():
  1687. GRAB_PLAYED = own["GRAB_PLAYED"]
  1688. GRAB_ON = own["GRAB_ON"]
  1689. if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
  1690. #cont.activate(fak_backsidegrab)
  1691. own['requestAction'] = 'fak_backside_tail_grab'
  1692. #skater.playAction("fak_backside_tail_grab", 10,30, layer=410, priority=5, blendin=5, play_mode=1, speed=.5)
  1693. GRAB_PLAYED = True
  1694. own["GRAB_PLAYED)"] = GRAB_PLAYED
  1695. elif r_ground.triggered == 1:
  1696. killact(410)
  1697. print("fak backside tailgrab on")
  1698. #--------------------
  1699. def SWAG():
  1700. if r_ground.triggered == 1:
  1701. SWAG = own["swag"]
  1702. SWAG = own.getLinearVelocity(True)
  1703. SWAG = SWAG[1]
  1704. own["swag"] = SWAG
  1705. #print(SWAG)
  1706. if STANCE == True:
  1707. if SWAG > 1 and SWAG < 2:
  1708. rotation = [ 0.0, 0, (SWAG / 200)]
  1709. own.applyRotation( rotation, True)
  1710. elif SWAG > 2:
  1711. rotation = [ 0.0, 0, (SWAG / 50)]
  1712. own.applyRotation( rotation, True)
  1713. elif SWAG < -1 and SWAG > -2:
  1714. rotation = [ 0.0, 0, (SWAG / 200)]
  1715. own.applyRotation( rotation, True)
  1716. elif SWAG < -2:
  1717. rotation = [ 0.0, 0, (SWAG / 50)]
  1718. own.applyRotation( rotation, True)
  1719. if STANCE == False:
  1720. if SWAG > 1 and SWAG < 2:
  1721. rotation = [ 0.0, 0, (-SWAG / 200)]
  1722. own.applyRotation( rotation, True)
  1723. elif SWAG > 2:
  1724. rotation = [ 0.0, 0, (-SWAG / 50)]
  1725. own.applyRotation( rotation, True)
  1726. elif SWAG < -1 and SWAG > -2:
  1727. rotation = [ 0.0, 0, (-SWAG / 200)]
  1728. own.applyRotation( rotation, True)
  1729. elif SWAG < -2:
  1730. rotation = [ 0.0, 0, (-SWAG / 50)]
  1731. own.applyRotation( rotation, True)
  1732. def air():
  1733. if r_ground.triggered == False and own['airup'] == 0:
  1734. distance = own.getDistanceTo(gray.hitPosition)
  1735. #print(frame - lgf, "frames since grind")
  1736. since_grind_buf = 3
  1737. if gray.hitObject != None and grindDar2.triggered == False and (frame - lgf) > since_grind_buf:
  1738. #if gray.hitObject != None and grindDar2.triggered == False:
  1739. if distance < .5:
  1740. own.alignAxisToVect(gray.hitNormal, 2, .1)
  1741. elif distance >= .5 and distance < 1.75:
  1742. own.alignAxisToVect(gray.hitNormal, 2, .05)
  1743. elif distance >= 1.75:
  1744. own.alignAxisToVect([0.0,0.0,1.0], 2, .03)
  1745. # own.alignAxisToVect(gray.hitNormal, 2, .01)
  1746. if grindDar2.triggered and (frame - lgf) > since_grind_buf:
  1747. #print("grindar2")
  1748. #own.alignAxisToVect(gray.hitNormal, 2, .075)
  1749. if distance < .5:
  1750. own.alignAxisToVect(gray.hitNormal, 2, .1)
  1751. elif distance >= .5 and distance < 1.75:
  1752. own.alignAxisToVect(gray.hitNormal, 2, .03)
  1753. elif distance >= 1.75:
  1754. own.alignAxisToVect([0.0,0.0,1.0], 2, .03)
  1755. elif r_ground.triggered == True:
  1756. pass
  1757. def stopAnims():
  1758. pass
  1759. def isplaying():
  1760. # for x in range(9000):
  1761. # l1 = deck.isPlayingAction(x)
  1762. # if l1 == True:
  1763. # print(x)
  1764. pass
  1765. def nextframe():
  1766. framenumber = own["framenum"]
  1767. framenumber = framenumber + 1
  1768. if framenumber == 900000:
  1769. framenumber = 0
  1770. own["framenum"] = framenumber
  1771. #print(framenumber)
  1772. def push():
  1773. local = True
  1774. #print("push")
  1775. linVelocity15 = own.linearVelocity
  1776. if linVelocity15.x < MAX_VEL and linVelocity15.x >= -0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0 and own['last_footplant'] == False:
  1777. countdown = COUNTDOWN
  1778. yvel = linVelocity15.x + SPEEDUP
  1779. own['countdown'] = countdown
  1780. force = [(yvel), 0, linVelocity15.z]
  1781. #killall()
  1782. own.setLinearVelocity(force, local)
  1783. own['requestAction'] = 'fak_push_goof'
  1784. #skater.playAction("fak_push_goof", 1,35, layer=100, blendin=2, play_mode=0, speed=.5)
  1785. #switch
  1786. if linVelocity15.x > -MAX_VEL and linVelocity15.x < 0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0:
  1787. countdown = COUNTDOWN
  1788. yvel = linVelocity15.x - SPEEDUP
  1789. own['countdown'] = countdown
  1790. force = [(yvel), 0, linVelocity15.z]
  1791. #killall()
  1792. own.setLinearVelocity(force, local)
  1793. own['requestAction'] = 'reg_push'
  1794. #skater.playAction("reg_push", 1,35, layer=101, blendin=2, play_mode=0, speed=.5)
  1795. def push_goof():
  1796. linVelocity15 = own.linearVelocity
  1797. local = True
  1798. #print("push goof")
  1799. if linVelocity15.x < MAX_VEL and linVelocity15.x >= -0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0:
  1800. countdown = COUNTDOWN
  1801. yvel = linVelocity15.x + SPEEDUP
  1802. own['countdown'] = countdown
  1803. force = [(yvel), 0, linVelocity15.z]
  1804. #killall()
  1805. own.setLinearVelocity(force, local)
  1806. own['requestAction'] = 'fak_push'
  1807. #skater.playAction("fak_push", 1,35, layer=100, blendin=2, play_mode=0, speed=.5)
  1808. #switch
  1809. if linVelocity15.x > -MAX_VEL and linVelocity15.x < 0 and r_ground.triggered == True and own['hippy'] == 0 and own['last_hippy'] == 0:
  1810. countdown = COUNTDOWN
  1811. yvel = linVelocity15.x - SPEEDUP
  1812. own['countdown'] = countdown
  1813. force = [(yvel), 0, linVelocity15.z]
  1814. #killall()
  1815. own.setLinearVelocity(force, local)
  1816. own['requestAction'] = 'reg_push_goof'
  1817. #skater.playAction("reg_push_goof", 1,35, layer=101, blendin=2, play_mode=0, speed=.5)
  1818. def brfoot():
  1819. lay = grablay + 40
  1820. killact(5)
  1821. #killall()
  1822. if STANCE == 0:
  1823. skater.playAction("brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1824. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1825. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1826. #print("1: Correct")
  1827. if STANCE == 1:
  1828. skater.playAction("fak_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1829. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1830. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1831. #print("2: Correct")
  1832. jump()
  1833. def frfoot():
  1834. lay = grablay + 40
  1835. killact(5)
  1836. #killall()
  1837. if STANCE == 0:
  1838. skater.playAction("frfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1839. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1840. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1841. #print("frfoot")
  1842. if STANCE == 1:
  1843. skater.playAction("fakbfrfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1844. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1845. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1846. #print("!fak_frfoot.001")
  1847. jump()
  1848. #lastpush
  1849. def blfoot():
  1850. lay = grablay + 40
  1851. killact(5)
  1852. #killall()
  1853. if STANCE == 0:
  1854. skater.playAction("blfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1855. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1856. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1857. #print("blfoot")
  1858. if STANCE == 1:
  1859. skater.playAction("fakfrfoot.001", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1860. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1861. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1862. #print("correct fakfrfoot.001")
  1863. jump()
  1864. def flfoot():
  1865. lay = grablay + 40
  1866. killact(5)
  1867. #killall()
  1868. if STANCE == 0:
  1869. skater.playAction("flfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1870. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1871. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1872. #print("3: Correct")
  1873. if STANCE == 1:
  1874. skater.playAction("fak_flfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1875. deck.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1876. trucks.playAction("a_brfoot", 1, 30, layer=lay, blendin=2, play_mode=0, speed=CAVEMAN_SPEED)
  1877. #print("4: wrong - fak_flfoot")
  1878. jump()
  1879. def rollsound():
  1880. #onground
  1881. if r_ground.triggered == 1 and grindDar == 0 and own['invert_on'] == 0:
  1882. num1 = .05
  1883. num2 = .25
  1884. if linVelocity.x <= -num1 and linVelocity.x >= num1:
  1885. own.actuators["sroll"].volume = .0001
  1886. cont.deactivate(own.actuators["sroll"])
  1887. own.actuators["sroll"].stopSound()
  1888. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1889. own.actuators["sroll"].volume = .02
  1890. own.actuators["sroll"].pitch = .65
  1891. num1 = .25
  1892. num2 = .5
  1893. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1894. own.actuators["sroll"].volume = .03
  1895. own.actuators["sroll"].pitch = .7
  1896. num1 = .5
  1897. num2 = .75
  1898. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1899. own.actuators["sroll"].volume = .04
  1900. own.actuators["sroll"].pitch = .75
  1901. num1 = .75
  1902. num2 = 1
  1903. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1904. own.actuators["sroll"].volume = .05
  1905. own.actuators["sroll"].pitch = .8
  1906. num1 = 1
  1907. num2 = 1.5
  1908. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1909. own.actuators["sroll"].volume = .06
  1910. own.actuators["sroll"].pitch = .85
  1911. num1 = 1.5
  1912. num2 = 2
  1913. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1914. own.actuators["sroll"].volume = .07
  1915. own.actuators["sroll"].pitch = .9
  1916. num1 = 2
  1917. num2 = 3
  1918. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1919. own.actuators["sroll"].volume = .08
  1920. own.actuators["sroll"].pitch = .95
  1921. num1 = 3
  1922. num2 = 4
  1923. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1924. own.actuators["sroll"].volume = .09
  1925. own.actuators["sroll"].pitch = 1
  1926. num1 = 4
  1927. num2 = 5
  1928. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1929. own.actuators["sroll"].volume = .11
  1930. own.actuators["sroll"].pitch = 1.05
  1931. num1 = 5
  1932. num2 = 6
  1933. if (linVelocity.x > num1 and linVelocity.x < num2) or (linVelocity.x < -num1 and linVelocity.x > -num2):
  1934. own.actuators["sroll"].volume = .1
  1935. own.actuators["sroll"].pitch = 1.1
  1936. #play sound
  1937. #own.actuators["sroll"].volume = .1
  1938. own.actuators['sroll'].mode = 2
  1939. cont.activate(own.actuators["sroll"])
  1940. if grindDar == 1 or own['invert_on'] == 1:
  1941. own.actuators["sroll"].volume = .0001
  1942. cont.deactivate(own.actuators["sroll"])
  1943. own.actuators["sroll"].stopSound()
  1944. #in air
  1945. if r_ground.triggered == False:
  1946. own.actuators["sroll"].volume = .0001
  1947. cont.deactivate(own.actuators["sroll"])
  1948. own.actuators["sroll"].stopSound()
  1949. act = cont.actuators["sroll"]
  1950. own['sroll_vol'] = act.volume
  1951. own['sroll_pitch'] = act.pitch
  1952. def wheelroll():
  1953. #own.actuators["sroll"].volume = .1
  1954. #still
  1955. if linVelocity.x <= -0.05 and linVelocity.x >= 0.05:
  1956. wheel1.stopAction(2)
  1957. wheel2.stopAction(2)
  1958. wheel3.stopAction(2)
  1959. wheel4.stopAction(2)
  1960. #cont.deactivate(own.actuators["sroll"])
  1961. #own.actuators["sroll"].stopSound()
  1962. #regular
  1963. if linVelocity.x > 0.05 and linVelocity.x < .5:
  1964. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=0, speed=.25)
  1965. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=0, speed=.25)
  1966. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=0, speed=.25)
  1967. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=0, speed=.25)
  1968. if linVelocity.x > 0.5 and linVelocity.x < 1:
  1969. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=1, speed=1)
  1970. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=1, speed=1)
  1971. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=1, speed=1)
  1972. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=1, speed=1)
  1973. if linVelocity.x > 1 and linVelocity.x < 4:
  1974. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1975. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1976. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1977. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=1, speed=1.5)
  1978. if linVelocity.x > 4:
  1979. wheel2.playAction("roll1.001", 1,20, layer=2, play_mode=1, speed=2)
  1980. wheel3.playAction("roll2.001", 1,20, layer=2, play_mode=1, speed=2)
  1981. wheel4.playAction("roll3.001", 1,20, layer=2, play_mode=1, speed=2)
  1982. wheel1.playAction("roll4.001", 1,20, layer=2, play_mode=1, speed=2)
  1983. #switch
  1984. if linVelocity.x < -0.05 and linVelocity.x > -.5:
  1985. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=0, speed=.25)
  1986. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=0, speed=.25)
  1987. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=0, speed=.25)
  1988. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=0, speed=.25)
  1989. if linVelocity.x < -0.5 and linVelocity.x > -1:
  1990. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=1, speed=1)
  1991. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=1)
  1992. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=1)
  1993. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=1)
  1994. if linVelocity.x < -1 and linVelocity > -4:
  1995. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1996. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1997. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1998. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=1.5)
  1999. if linVelocity.x < -4:
  2000. wheel2.playAction("roll1.001", 20,1, layer=2, play_mode=1, speed=2)
  2001. wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=2)
  2002. wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=2)
  2003. wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=2)
  2004. def transspeed():
  2005. num1 = .1
  2006. num2 = .4
  2007. speed = 20
  2008. # if rot.z > num1 and rot.z < num2 and r_ground.triggered == True:
  2009. # if STANCE == 1:
  2010. # force = [speed, 0, 0]
  2011. # else:
  2012. # force = [-speed, 0, 0]
  2013. # own.applyForce(force, True)
  2014. # num1 = .4
  2015. # num2 = .6
  2016. # speed = 40
  2017. # if rot.z > num1 and rot.z < num2 and r_ground.triggered == True:
  2018. # if STANCE == 1:
  2019. # force = [speed, 0, 0]
  2020. # else:
  2021. # force = [-speed, 0, 0]
  2022. # own.applyForce(force, True)
  2023. # num1 = .6
  2024. # num2 = .8
  2025. # speed = 20
  2026. # if rot.z > num1 and rot.z < num2 and r_ground.triggered == True:
  2027. # if STANCE == 1:
  2028. # force = [speed, 0, 0]
  2029. # else:
  2030. # force = [-speed, 0, 0]
  2031. # own.applyForce(force, True)
  2032. def turn():
  2033. rotamt = .02
  2034. linVelocity2 = own.getLinearVelocity(True)
  2035. speed = .002
  2036. #force = [speed, 0, 0]
  2037. #print(lLR)
  2038. manual = 0
  2039. #if (own['fak_nmanual'] == 1 or own['reg_nmanual'] == 1 or own['fak_manual'] == 1 or own['reg_manual'] == 1):
  2040. if own['manual_v2'] == 1:
  2041. manual = 1
  2042. if abs(linVelocity.x) < 2:
  2043. speed = .005
  2044. jumpstance = own['jump_stance']
  2045. if lLR > turnsens or lLR < -turnsens:
  2046. own["turn"] = 1
  2047. else:
  2048. own["turn"] = 0
  2049. if lUD > turnsens or lUD < -turnsens:
  2050. own["turnud"] = 1
  2051. else:
  2052. own["turnud"] = 0
  2053. #light
  2054. #if manual and grindhit = true
  2055. if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  2056. rotation = [ 0.0, 0.0, (-rotamt)]
  2057. local = False # use world axis
  2058. own.applyRotation( rotation, local)
  2059. if r_ground.triggered == True:
  2060. #print("light turn")
  2061. if STANCE == 0:
  2062. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  2063. if STANCE == 1:
  2064. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  2065. if lLR < -turnsens and lLR > (turnsens * -1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  2066. rotation = [ 0.0, 0.0, rotamt]
  2067. local = False # use world axis
  2068. own.applyRotation( rotation, local)
  2069. if r_ground.triggered == True:
  2070. #print("light turn")
  2071. if STANCE == 0:
  2072. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  2073. if STANCE == 1:
  2074. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  2075. #medium
  2076. if lLR > (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  2077. #turn left
  2078. if rot.z < .4:
  2079. rotation = [ 0.0, 0.0, (-rotamt * 5)]
  2080. if rot.z < .6 and rot.z > .4:
  2081. rotation = [ 0.0, 0.0, (-rotamt * 2)]
  2082. else:
  2083. rotation = [ 0.0, 0.0, (-rotamt * 1.6)]
  2084. local = True # use world axis
  2085. own.applyRotation( rotation, local)
  2086. if r_ground.triggered == True:
  2087. #print("med turn")
  2088. if STANCE == 0:
  2089. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  2090. if STANCE == 1:
  2091. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  2092. if lLR < (-turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
  2093. #turn right
  2094. if rot.z < .4:
  2095. rotation = [ 0.0, 0.0, (rotamt * 5)]
  2096. if rot.z < .6 and rot.z > .4:
  2097. rotation = [ 0.0, 0.0, (rotamt * 2)]
  2098. else:
  2099. rotation = [ 0.0, 0.0, (rotamt * 1.6)]
  2100. local = True # use world axis
  2101. own.applyRotation( rotation, local)
  2102. if r_ground.triggered == True:
  2103. #print("med turn")
  2104. if STANCE == 0:
  2105. own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  2106. if STANCE == 1:
  2107. own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  2108. #if lLR > (turnsens * 1.3 and grindHit == False):
  2109. #skater.playAction("nreg_right", 1,20, layer=23, priority=8, blendin=10, play_mode=0, speed=.5)
  2110. #air
  2111. if r_ground.triggered == False and lLR > turnsens and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
  2112. rotamt = .07
  2113. if STANCE == 0:
  2114. own.applyRotation([0,0,-rotamt], 1)
  2115. if STANCE == 1:
  2116. own.applyRotation([0,0,-rotamt], 1)
  2117. if r_ground.triggered == False and lLR < -turnsens and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
  2118. rotamt = .07
  2119. if STANCE == 0:
  2120. own.applyRotation([0,0,rotamt], 1)
  2121. if STANCE == 1:
  2122. own.applyRotation([0,0,rotamt], 1)
  2123. ##### rewrite attempt
  2124. # rotamt = .03
  2125. # linVelocity2 = own.getLinearVelocity(True)
  2126. # speed = .002
  2127. # turninc = .007 #.0025
  2128. # turnmult = .99
  2129. # turnmax = .043 #.043
  2130. # rlLR = 0
  2131. # rlLR = round(lLR, 2)
  2132. # rlLR2 = rlLR
  2133. # rlLR = rlLR * 20.5
  2134. # turninc = turninc * abs(rlLR)
  2135. # rlLR2 = rlLR2 * 12.5
  2136. # turnmax = turnmax * abs(rlLR2)
  2137. # if abs(rlLR2) <= .6:
  2138. # turnmax = turnmax *.7
  2139. # turninc = turninc * .7
  2140. # manual = 0
  2141. # if (own['fak_nmanual'] == 1 or own['reg_nmanual'] == 1 or own['fak_manual'] == 1 or own['reg_manual'] == 1):
  2142. # manual = 1
  2143. # if abs(linVelocity.x) < 2:
  2144. # speed = .005
  2145. # jumpstance = own['jump_stance']
  2146. # if lLR > turnsens or lLR < -turnsens:
  2147. # own["turn"] = 1
  2148. # else:
  2149. # own["turn"] = 0
  2150. # if lUD > turnsens or lUD < -turnsens:
  2151. # own["turnud"] = 1
  2152. # else:
  2153. # own["turnud"] = 0
  2154. # newz = rot.z *2
  2155. # newz = (abs(newz) -2) +1
  2156. # newz = abs(newz)
  2157. # newz = newz - 1
  2158. # newz = abs(newz) +1
  2159. # newz = round(newz,4)
  2160. # if newz > 2: newz == 2
  2161. # turninc = (turninc * newz) * newz
  2162. # turnmax = turnmax * newz
  2163. # if lLR > -turnsens and lLR < 0:
  2164. # own["leftturn"] = 0
  2165. # own['leftturnamt'] = turninc
  2166. # if lLR < -turnsens and (grindHit == False or (manual == 1 and grindHit == True)):
  2167. # turn = own["leftturn"]
  2168. # leftturnamt = own['leftturnamt']
  2169. # if turn < turnmax:
  2170. # turn = turn + leftturnamt
  2171. # leftturnamt = leftturnamt * turnmult
  2172. # rotation = [ 0.0, 0.0, (turn)]
  2173. # local = False # use world axis
  2174. # own.applyRotation( rotation, local)
  2175. # own["leftturn"] = turn
  2176. # own['leftturnamt'] = leftturnamt
  2177. # if r_ground.triggered == True and abs(linVelocity2.x) < 5:
  2178. # if STANCE == 0:
  2179. # own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  2180. # if STANCE == 1:
  2181. # own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
  2182. # #right
  2183. # if lLR < turnsens and lLR > 0:
  2184. # own["rightturn"] = 0
  2185. # own['rightturnamt'] = turninc
  2186. # if lLR > turnsens and (grindHit == False or (manual == 1 and grindHit == True)):
  2187. # turn = own["rightturn"]
  2188. # rightturnamt = own['rightturnamt']
  2189. # if turn < turnmax:
  2190. # turn = turn + rightturnamt
  2191. # rightturnamt = rightturnamt * turnmult
  2192. # rotation = [ 0.0, 0.0, (-turn)]
  2193. # local = False # use world axis
  2194. # own.applyRotation( rotation, local)
  2195. # own["rightturn"] = turn
  2196. # own['rightturnamt'] = rightturnamt
  2197. # if r_ground.triggered == True and abs(linVelocity2.x) < 5:
  2198. # if STANCE == 0:
  2199. # own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
  2200. # if STANCE == 1:
  2201. # own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1) #air
  2202. # if r_ground.triggered == False and lLR > turnsens and (grindHit == False or (manual == 1 and grindHit == True)):
  2203. # rotamt = .07
  2204. # if STANCE == 0:
  2205. # own.applyRotation([0,0,-rotamt], 1)
  2206. # if STANCE == 1:
  2207. # own.applyRotation([0,0,-rotamt], 1)
  2208. # if r_ground.triggered == False and lLR < -turnsens and (grindHit == False or (manual == 1 and grindHit == True)):
  2209. # rotamt = .07
  2210. # if STANCE == 0:
  2211. # own.applyRotation([0,0,rotamt], 1)
  2212. # if STANCE == 1:
  2213. # own.applyRotation([0,0,rotamt], 1)
  2214. ###########
  2215. def grindsound():
  2216. dropin = own['dropinTimer']
  2217. lif = own['last_invert_frame']
  2218. #if frame - lif < 3 and invert_on == 0:
  2219. if grindSound != None and grindHit == True and own['nogrindsound'] == 0:
  2220. #if grindHit == True and dropin == 0 and own['invert_on'] == 0 and own["LAST_GRIND"] == True and own["nogrindsound"] == 0 and (frame - lif > 13):
  2221. if abs(linVelocity.x) > abs(linVelocity.y):
  2222. vel = linVelocity.x
  2223. elif abs(linVelocity.x) < abs(linVelocity.y):
  2224. vel = linVelocity.y
  2225. else:
  2226. vel = 0
  2227. if grindSound == "rail":
  2228. cont.deactivate(own.actuators['grind_cement'])
  2229. num1 = .000
  2230. num2 = .05
  2231. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2232. own.actuators["grind_rail"].volume = .0001
  2233. own.actuators["grind_rail"].pitch = .6
  2234. num1 = .05
  2235. num2 = .25
  2236. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2237. own.actuators["grind_rail"].volume = .05
  2238. own.actuators["grind_rail"].pitch = .7
  2239. num1 = .25
  2240. num2 = .5
  2241. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2242. own.actuators["grind_rail"].volume = .1
  2243. own.actuators["grind_rail"].pitch = .75
  2244. num1 = .5
  2245. num2 = .75
  2246. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2247. own.actuators["grind_rail"].volume = .14
  2248. own.actuators["grind_rail"].pitch = .8
  2249. num1 = .75
  2250. num2 = 1
  2251. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2252. own.actuators["grind_rail"].volume = .17
  2253. own.actuators["grind_rail"].pitch = .85
  2254. num1 = 1
  2255. num2 = 1.25
  2256. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2257. own.actuators["grind_rail"].volume = .18
  2258. own.actuators["grind_rail"].pitch = .9
  2259. num1 = 1.25
  2260. num2 = 2
  2261. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2262. own.actuators["grind_rail"].volume = .19
  2263. own.actuators["grind_rail"].pitch = .95
  2264. num1 = 2
  2265. num2 = 40
  2266. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2267. own.actuators["grind_rail"].volume = .19
  2268. own.actuators["grind_rail"].pitch = 1
  2269. cont.activate(own.actuators['grind_rail'])
  2270. if grindSound == "concrete":
  2271. #play sound
  2272. cont.deactivate(own.actuators['grind_rail'])
  2273. num1 = .000
  2274. num2 = .05
  2275. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2276. own.actuators["grind_cement"].volume = .01
  2277. own.actuators["grind_cement"].pitch = .6
  2278. num1 = .05
  2279. num2 = .25
  2280. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2281. own.actuators["grind_cement"].volume = .05
  2282. own.actuators["grind_cement"].pitch = .7
  2283. num1 = .25
  2284. num2 = .5
  2285. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2286. own.actuators["grind_cement"].volume = .1
  2287. own.actuators["grind_cement"].pitch = .75
  2288. num1 = .5
  2289. num2 = .75
  2290. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2291. own.actuators["grind_cement"].volume = .14
  2292. own.actuators["grind_cement"].pitch = .8
  2293. num1 = .75
  2294. num2 = 1
  2295. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2296. own.actuators["grind_cement"].volume = .17
  2297. own.actuators["grind_cement"].pitch = .85
  2298. num1 = 1
  2299. num2 = 1.25
  2300. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2301. own.actuators["grind_cement"].volume = .18
  2302. own.actuators["grind_cement"].pitch = .9
  2303. num1 = 1.25
  2304. num2 = 2
  2305. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2306. own.actuators["grind_cement"].volume = .19
  2307. own.actuators["grind_cement"].pitch = .95
  2308. num1 = 2
  2309. num2 = 40
  2310. if (vel > num1 and vel < num2) or (vel < -num1 and vel > -num2):
  2311. own.actuators["grind_cement"].volume = .19
  2312. own.actuators["grind_cement"].pitch = 1
  2313. cont.activate(own.actuators['grind_cement'])
  2314. else:
  2315. cont.deactivate(own.actuators['grind_cement'])
  2316. cont.deactivate(own.actuators['grind_rail'])
  2317. def record_grindsound():
  2318. dropin = own['dropinTimer']
  2319. lif = own['last_invert_frame']
  2320. if grindHit == True and dropin == 0 and own['invert_on'] == 0 and own["LAST_GRIND"] == True and own["nogrindsound"] == 0 and (frame - lif > 13):
  2321. if grindSound == "concrete":
  2322. act = own.actuators["grind_cement"]
  2323. own['grindcement_vol'] = act.volume
  2324. own['grindcement_pitch'] = act.pitch
  2325. elif grindSound == "rail":
  2326. act = own.actuators["grind_rail"]
  2327. own['grindrail_vol'] = act.volume
  2328. own['grindrail_pitch'] = act.pitch
  2329. if own["LAST_GRIND"] == False:
  2330. own['grindcement_vol'] = 0
  2331. own['grindcement_pitch'] = 0
  2332. own['grindrail_vol'] = 0
  2333. own['grindrail_pitch'] = 0
  2334. def grind():
  2335. grindsound()
  2336. STANCE = own["stance"]
  2337. jumpstance = own["jump_stance"]
  2338. lif = frame - own['last_invert_frame']
  2339. if grindHit == True and own['invert_on'] == 0 and own['footplant_on'] == False and own['manual'] == 0 and lif > 40 and own['dropinTimer'] < 30:
  2340. #skater.stopAction(0)
  2341. #deck.stopAction(0)
  2342. #trucks.stopAction(0)
  2343. gblend = 1
  2344. #add grindstance?
  2345. #printplaying()
  2346. if LAST_GRIND == 0:
  2347. gt = own['grindType']
  2348. #print(gt)
  2349. #grind in
  2350. tempstance = 3
  2351. #print("jumpstance: ", jumpstance, "stance: ", STANCE)
  2352. if jumpstance != 3:
  2353. tempstance = jumpstance
  2354. else:
  2355. tempstance = STANCE
  2356. #print("tempstance: ", tempstance)
  2357. grindpos = own['grindpos']
  2358. if grindpos == "reg_5050" and own['grindType'] == "empty":
  2359. own['grindType'] = grindpos
  2360. if own['grindType'] == "empty" and grindpos == 'reg_board':
  2361. if jumpstance == 1:
  2362. own['grindType'] = "fak_bsboard"
  2363. own["stance"] = True
  2364. STANCE = True
  2365. elif jumpstance == 0:
  2366. own['grindType'] = "reg_bsboard"
  2367. own["stance"] = False
  2368. STANCE = False
  2369. elif jumpstance == 3:
  2370. if STANCE == True:
  2371. own['grindType'] = "fak_bsboard"
  2372. else:
  2373. own['grindType'] = "reg_bsboard"
  2374. #if STANCE == True and LAST_GRIND == False:
  2375. if STANCE == True:
  2376. #print("jumpstance =1")
  2377. if own['grindType'] == "reg_bsboard":
  2378. own['grind_stance'] = 0
  2379. own['requestAction'] = 'reg_bsboard'
  2380. #skater.playAction("reg_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2381. #deck.playAction("a_reg_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2382. #trucks.playAction("a_reg_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2383. #print("play fak reg_bsboard")
  2384. elif own['grindType'] == "fak_bsboard":
  2385. own['grind_stance'] = 1
  2386. own['requestAction'] = 'fak_bsboard'
  2387. #skater.playAction("fak_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2388. #deck.playAction("a_fak_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2389. #trucks.playAction("a_fak_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2390. #print("play fak fak_bsboard")
  2391. elif own['grindType'] == "reg_fsboard":
  2392. own['grind_stance'] = 0
  2393. own['requestAction'] = 'reg_fsboard'
  2394. #skater.playAction("reg_FS_Board", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2395. #deck.playAction("a_reg_FS_Board", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2396. #trucks.playAction("a_reg_FS_Board", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2397. #print("reg_FS_Board")
  2398. elif own['grindType'] == "reg_tailg":
  2399. own['requestAction'] = 'reg_tailg'
  2400. #skater.playAction("reg_tailg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2401. #deck.playAction("a_reg_tailg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2402. #trucks.playAction("a_reg_tailg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2403. elif own['grindType'] == "reg_tailgR":
  2404. own['requestAction'] = 'reg_tailgr'
  2405. #skater.playAction("reg_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2406. #deck.playAction("a_reg_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2407. #trucks.playAction("a_reg_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2408. elif own['grindType'] == "reg_tailgL":
  2409. own['requestAction'] = 'reg_tailgl'
  2410. #skater.playAction("reg_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2411. #deck.playAction("a_reg_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2412. #trucks.playAction("a_reg_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2413. elif own['grindType'] == "reg_noseg":
  2414. own['requestAction'] = 'reg_noseg'
  2415. # skater.playAction("reg_noseg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2416. # deck.playAction("a_reg_noseg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2417. # trucks.playAction("a_reg_noseg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2418. elif own['grindType'] == "reg_nosegR":
  2419. #print("playing reg_nosegR")
  2420. own['requestAction'] = 'reg_nosegr'
  2421. #skater.playAction("reg_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2422. #deck.playAction("a_reg_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2423. #trucks.playAction("a_reg_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2424. elif own['grindType'] == "reg_nosegL":
  2425. #print("playing reg_nosegL")
  2426. own['requestAction'] = 'reg_nosegl'
  2427. #skater.playAction("reg_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2428. #deck.playAction("a_reg_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2429. #trucks.playAction("a_reg_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2430. elif own['grindType'] == "fak_noseg":
  2431. own['requestAction'] = 'fak_noseg'
  2432. #skater.playAction("fak_noseg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2433. #deck.playAction("a_fak_noseg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2434. #trucks.playAction("a_fak_noseg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2435. elif own['grindType'] == "fak_nosegR":
  2436. own['requestAction'] = 'fak_nosegr'
  2437. #skater.playAction("fak_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2438. #deck.playAction("a_fak_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2439. #trucks.playAction("a_fak_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2440. elif own['grindType'] == "fak_nosegL":
  2441. own['requestAction'] = 'reg_nosegl'
  2442. #skater.playAction("fak_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2443. #deck.playAction("a_fak_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2444. #trucks.playAction("a_fak_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2445. #print("fak_noseg")
  2446. elif own['grindType'] == "fak_tailg":
  2447. own['requestAction'] = 'fak_tailg'
  2448. #skater.playAction("fak_tailg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2449. #deck.playAction("a_fak_tailg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2450. #trucks.playAction("a_fak_tailg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2451. elif own['grindType'] == "fak_tailgR":
  2452. own['requestAction'] = 'fak_tailgr'
  2453. #skater.playAction("fak_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2454. #deck.playAction("a_fak_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2455. #trucks.playAction("a_fak_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2456. elif own['grindType'] == "fak_tailgL":
  2457. own['requestAction'] = 'fak_tailgl'
  2458. #skater.playAction("fak_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2459. #deck.playAction("a_fak_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2460. #trucks.playAction("a_fak_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2461. elif own['grindType'] == "reg_tailslide":
  2462. own['requestAction'] = 'reg_tailslide'
  2463. own['grind_stance'] = 0
  2464. #skater.playAction("fak_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2465. #deck.playAction("a_fak_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2466. #trucks.playAction("a_fak_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2467. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2468. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2469. #own['stance'] = STANCE
  2470. elif own['grindType'] == "fak_tailslide":
  2471. own['requestAction'] = 'fak_tailslide'
  2472. own['grind_stance'] = 1
  2473. #skater.playAction("reg_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2474. #deck.playAction("a_reg_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2475. #trucks.playAction("a_reg_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2476. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2477. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2478. #own['stance'] = STANCE
  2479. elif own['grindType'] == "reg_noseslide":
  2480. own['requestAction'] = 'reg_noseslide'
  2481. own['grind_stance'] = 0
  2482. #skater.playAction("fak_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2483. #deck.playAction("a_fak_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2484. #trucks.playAction("a_fak_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2485. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2486. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2487. #own['stance'] = STANCE
  2488. elif own['grindType'] == "fak_noseslide":
  2489. own['requestAction'] = 'fak_noseslide'
  2490. own['grind_stance'] = 1
  2491. #skater.playAction("reg_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2492. #deck.playAction("a_reg_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2493. #trucks.playAction("a_reg_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2494. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2495. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2496. #own['stance'] = STANCE
  2497. elif own['grindType'] == "nose_stall":
  2498. own['requestAction'] = 'nose_stall'
  2499. skater.playAction("fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2500. deck.playAction("a_fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2501. trucks.playAction("a_fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2502. #print("fak_nose_stall")
  2503. elif own['grindType'] == "tail_stall":
  2504. own['requestAction'] = 'tail_stall'
  2505. skater.playAction("fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2506. deck.playAction("a_fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2507. trucks.playAction("a_fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2508. #print("fak_tail_stall")
  2509. else:
  2510. if STANCE == 0:
  2511. own['requestAction'] = 'reg_5050'
  2512. #skater.playAction("reg_5050", 1,30, layer=700, blendin=gblend, priority=8, layer_weight=0, play_mode=1, speed=.5)
  2513. #deck.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2514. #trucks.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2515. if STANCE == 1:
  2516. own['requestAction'] = 'fak_5050'
  2517. #skater.playAction("fak_5050", 1,30, layer=700, blendin=gblend, priority=8, layer_weight=0, play_mode=1, speed=.5)
  2518. #deck.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2519. #trucks.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2520. #print("fak_5050")
  2521. #elif STANCE == False and LAST_GRIND == False:
  2522. elif STANCE == False:
  2523. #print("jumpstance =0")
  2524. if own['grindType'] == "reg_bsboard":
  2525. own['grind_stance'] = 0
  2526. own['requestAction'] = 'reg_bsboard'
  2527. #skater.playAction("reg_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2528. #deck.playAction("a_reg_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2529. #trucks.playAction("a_reg_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2530. #print("play reg reg_bsboard")
  2531. elif own['grindType'] == "fak_bsboard":
  2532. own['grind_stance'] = 1
  2533. own['requestAction'] = 'fak_bsboard'
  2534. #skater.playAction("fak_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2535. #deck.playAction("a_fak_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2536. #trucks.playAction("a_fak_BS_Board2", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2537. #print("play reg fak_bsboard")
  2538. elif own['grindType'] == "reg_tailg":
  2539. own['grind_stance'] = 0
  2540. own['requestAction'] = 'reg_tailg'
  2541. #skater.playAction("reg_tailg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2542. #deck.playAction("a_reg_tailg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2543. #trucks.playAction("a_reg_tailg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2544. # if STANCE == True and LAST_GRIND == 0: STANCE = False
  2545. # elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2546. # own['stance'] = STANCE
  2547. elif own['grindType'] == "reg_tailgR":
  2548. own['requestAction'] = 'reg_tailgr'
  2549. #skater.playAction("reg_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2550. #deck.playAction("a_reg_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2551. #trucks.playAction("a_reg_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2552. elif own['grindType'] == "reg_tailgL":
  2553. own['requestAction'] = 'reg_tailgl'
  2554. #skater.playAction("reg_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2555. #deck.playAction("a_reg_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2556. #trucks.playAction("a_reg_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2557. elif own['grindType'] == "reg_noseg":
  2558. own['requestAction'] = 'reg_noseg'
  2559. # skater.playAction("reg_noseg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2560. # deck.playAction("a_reg_noseg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2561. # trucks.playAction("a_reg_noseg.001", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2562. #print("0 reg_noseg")
  2563. elif own['grindType'] == "reg_nosegR":
  2564. #print("playing reg_nosegR")
  2565. own['requestAction'] = 'reg_nosegr'
  2566. #skater.playAction("reg_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2567. #deck.playAction("a_reg_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2568. #trucks.playAction("a_reg_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2569. elif own['grindType'] == "reg_nosegL":
  2570. #print("playing reg_nosegL")
  2571. own['requestAction'] = 'reg_nosegl'
  2572. #skater.playAction("reg_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2573. #deck.playAction("a_reg_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2574. #trucks.playAction("a_reg_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2575. elif own['grindType'] == "fak_noseg":
  2576. own['requestAction'] = 'fak_noseg'
  2577. #skater.playAction("fak_noseg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2578. #deck.playAction("a_fak_noseg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2579. #trucks.playAction("a_fak_noseg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2580. #print("0 fak_noseg")
  2581. elif own['grindType'] == "fak_nosegR":
  2582. own['requestAction'] = 'fak_nosegr'
  2583. #skater.playAction("fak_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2584. #deck.playAction("a_fak_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2585. #trucks.playAction("a_fak_nosegR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2586. elif own['grindType'] == "fak_nosegL":
  2587. own['requestAction'] = 'fak_nosegl'
  2588. #skater.playAction("fak_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2589. #deck.playAction("a_fak_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2590. #trucks.playAction("a_fak_nosegL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2591. elif own['grindType'] == "fak_tailg":
  2592. own['requestAction'] = 'fak_tailg'
  2593. own['requestAction'] = 'fak_tailg'
  2594. own['grind_stance'] = 1
  2595. #skater.playAction("fak_tailg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2596. #deck.playAction("a_fak_tailg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2597. #trucks.playAction("a_fak_tailg", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2598. elif own['grindType'] == "fak_tailgR":
  2599. own['requestAction'] = 'fak_tailgr'
  2600. #skater.playAction("fak_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2601. #deck.playAction("a_fak_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2602. #trucks.playAction("a_fak_tailgR", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2603. elif own['grindType'] == "fak_tailgL":
  2604. own['requestAction'] = 'fak_tailgl'
  2605. #skater.playAction("fak_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2606. #deck.playAction("a_fak_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2607. #trucks.playAction("a_fak_tailgL", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2608. elif own['grindType'] == "reg_tailslide":
  2609. own['grind_stance'] = 0
  2610. own['requestAction'] = 'reg_tailslide'
  2611. #skater.playAction("fak_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2612. #deck.playAction("a_fak_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2613. #trucks.playAction("a_fak_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2614. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2615. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2616. #own['stance'] = STANCE
  2617. elif own['grindType'] == "fak_tailslide":
  2618. own['grind_stance'] = 1
  2619. own['requestAction'] = 'fak_tailslide'
  2620. #skater.playAction("reg_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2621. #deck.playAction("a_reg_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2622. #trucks.playAction("a_reg_noses", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2623. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2624. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2625. #own['stance'] = STANCE
  2626. elif own['grindType'] == "reg_noseslide":
  2627. own['grind_stance'] = 0
  2628. own['requestAction'] = 'reg_noseslide'
  2629. #skater.playAction("fak_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2630. #deck.playAction("a_fak_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2631. #trucks.playAction("a_fak_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2632. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2633. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2634. #own['stance'] = STANCE
  2635. elif own['grindType'] == "fak_noseslide":
  2636. own['grind_stance'] = 1
  2637. own['requestAction'] = 'fak_noseslide'
  2638. #skater.playAction("reg_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2639. #deck.playAction("a_reg_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2640. #trucks.playAction("a_reg_tails", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2641. #if STANCE == True and LAST_GRIND == 0: STANCE = False
  2642. #elif STANCE == False and LAST_GRIND == 0: STANCE = True
  2643. #own['stance'] = STANCE
  2644. #if STANCE == True: STANCE = False
  2645. #if STANCE == False: STANCE = True
  2646. #print("change stance")
  2647. #STANCE = own["stance"]
  2648. elif own['grindType'] == "nose_stall":
  2649. skater.playAction("nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2650. deck.playAction("a_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2651. trucks.playAction("a_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2652. #print("nose_stall")
  2653. elif own['grindType'] == "tail_stall":
  2654. skater.playAction("reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2655. deck.playAction("a_reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2656. trucks.playAction("a_reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
  2657. #print("reg_tail_stall")
  2658. else:
  2659. # print("@playing last resort")
  2660. if STANCE == 0:
  2661. own['requestAction'] = 'reg_5050'
  2662. # skater.playAction("reg_5050", 1,30, layer=700, blendin=gblend, priority=8, layer_weight=0, play_mode=1, speed=.5)
  2663. # deck.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2664. # trucks.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2665. if STANCE == 1:
  2666. own['requestAction'] = 'fak_5050'
  2667. # skater.playAction("fak_5050", 1,30, layer=700, blendin=gblend, priority=8, layer_weight=0, play_mode=1, speed=.5)
  2668. # deck.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2669. # trucks.playAction("a_reg", 1,40, layer=700, blendin=gblend, priority=9, layer_weight=0, play_mode=1, speed=.5)
  2670. else:
  2671. if own['grindCountdown'] < 16:
  2672. grindtype("empty")
  2673. killact(700)
  2674. killact(705)
  2675. killact(706)
  2676. killact(707)
  2677. killact(708)
  2678. # if LAST_GRIND ==1 and grindHit ==0:
  2679. # #print("++++out", own['grindType'])
  2680. # if own['grindType'] == "reg_tailslide":
  2681. # own['grind_stance'] = 0
  2682. # #skater.playAction("fak_noses", 30,40, layer=200, play_mode=1, speed=.5)
  2683. # #deck.playAction("a_fak_noses", 30,40, layer=200, play_mode=1, speed=.5)
  2684. # #trucks.playAction("a_fak_noses", 30,40, layer=200, play_mode=1, speed=.5)
  2685. ####
  2686. # elif own['grindType'] == "fak_tailslide":
  2687. # own['grind_stance'] = 1
  2688. # #skater.playAction("reg_noses", 30,40, layer=200, play_mode=1, speed=.5)
  2689. # #deck.playAction("a_reg_noses", 30,40, layer=200, play_mode=1, speed=.5)
  2690. # #trucks.playAction("a_reg_noses", 30,40, layer=200, play_mode=1, speed=.5)
  2691. #####
  2692. # elif own['grindType'] == "reg_noseslide":
  2693. # own['grind_stance'] = 0
  2694. # #skater.playAction("fak_tails", 30,40, layer=200, play_mode=1, speed=.5)
  2695. # #deck.playAction("a_fak_tails", 30,40, layer=200, play_mode=1, speed=.5)
  2696. # #trucks.playAction("a_fak_tails", 30,40, layer=200, play_mode=1, speed=.5)
  2697. # elif own['grindType'] == "fak_noseslide":
  2698. # own['grind_stance'] = 1
  2699. # #skater.playAction("reg_tails", 30,40, layer=200, play_mode=1, speed=.5)
  2700. # #deck.playAction("a_reg_tails", 30,40, layer=200, play_mode=1, speed=.5)
  2701. # #trucks.playAction("a_reg_tails", 30,40, layer=200, play_mode=1, speed=.5)
  2702. ####******
  2703. # elif own['grindType'] == "reg_tailg":
  2704. # #skater.playAction("reg_tailg.001",30,40, layer=200, play_mode=1, speed=.5)
  2705. # #deck.playAction("a_reg_tailg.001",30,40, layer=200, play_mode=1, speed=.5)
  2706. # #trucks.playAction("a_reg_tailg.001",30,40, layer=200, play_mode=1, speed=.5)
  2707. # elif own['grindType'] == "reg_tailgR":
  2708. # skater.playAction("reg_tailgR",30,40, layer=200, play_mode=1, speed=.5)
  2709. # #deck.playAction("a_reg_tailgR",30,40, layer=200, play_mode=1, speed=.5)
  2710. # #trucks.playAction("a_reg_tailgR",30,40, layer=200, play_mode=1, speed=.5)
  2711. # elif own['grindType'] == "reg_tailgL":
  2712. # skater.playAction("reg_tailgL",30,40, layer=200, play_mode=1, speed=.5)
  2713. # deck.playAction("a_reg_tailgL",30,40, layer=200, play_mode=1, speed=.5)
  2714. # trucks.playAction("a_reg_tailgL",30,40, layer=200, play_mode=1, speed=.5)
  2715. # elif own['grindType'] == "reg_noseg":
  2716. # skater.playAction("reg_noseg.001",30,40, layer=200, play_mode=1, speed=.5)
  2717. # deck.playAction("a_reg_noseg.001",30,40, layer=200, play_mode=1, speed=.5)
  2718. # trucks.playAction("a_reg_noseg.001",30,40, layer=200, play_mode=1, speed=.5)
  2719. # elif own['grindType'] == "reg_nosegR":
  2720. # skater.playAction("reg_nosegR",30,40, layer=200, play_mode=1, speed=.5)
  2721. # deck.playAction("a_reg_nosegR",30,40, layer=200, play_mode=1, speed=.5)
  2722. # trucks.playAction("a_reg_nosegR",30,40, layer=200, play_mode=1, speed=.5)
  2723. # elif own['grindType'] == "reg_nosegL":
  2724. # skater.playAction("reg_nosegL",30,40, layer=200, play_mode=1, speed=.5)
  2725. # deck.playAction("a_reg_nosegL",30,40, layer=200, play_mode=1, speed=.5)
  2726. # trucks.playAction("a_reg_nosegL",30,40, layer=200, play_mode=1, speed=.5)
  2727. # elif own['grindType'] == "fak_noseg":
  2728. # skater.playAction("fak_noseg",30,40, layer=200, play_mode=1, speed=.5)
  2729. # deck.playAction("a_fak_noseg",30,40, layer=200, play_mode=1, speed=.5)
  2730. # trucks.playAction("a_fak_noseg",30,40, layer=200, play_mode=1, speed=.5)
  2731. # #print("fak_noseg")
  2732. # elif own['grindType'] == "fak_nosegR":
  2733. # skater.playAction("fak_nosegR",30,40, layer=200, play_mode=1, speed=.5)
  2734. # deck.playAction("a_fak_nosegR",30,40, layer=200, play_mode=1, speed=.5)
  2735. # trucks.playAction("a_fak_nosegR",30,40, layer=200, play_mode=1, speed=.5)
  2736. # elif own['grindType'] == "fak_nosegL":
  2737. # skater.playAction("fak_nosegL",30,40, layer=200, play_mode=1, speed=.5)
  2738. # deck.playAction("a_fak_nosegL",30,40, layer=200, play_mode=1, speed=.5)
  2739. # trucks.playAction("a_fak_nosegL",30,40, layer=200, play_mode=1, speed=.5)
  2740. # elif own['grindType'] == "fak_tailg":
  2741. # skater.playAction("fak_tailg",30,40, layer=200, play_mode=1, speed=.5)
  2742. # deck.playAction("a_fak_tailg",30,40, layer=200, play_mode=1, speed=.5)
  2743. # trucks.playAction("a_fak_tailg",30,40, layer=200, play_mode=1, speed=.5)
  2744. # elif own['grindType'] == "fak_tailgR":
  2745. # skater.playAction("fak_tailgR",30,40, layer=200, play_mode=1, speed=.5)
  2746. # deck.playAction("a_fak_tailgR",30,40, layer=200, play_mode=1, speed=.5)
  2747. # trucks.playAction("a_fak_tailgR",30,40, layer=200, play_mode=1, speed=.5)
  2748. # elif own['grindType'] == "fak_tailgL":
  2749. # skater.playAction("fak_tailgL",30,40, layer=200, play_mode=1, speed=.5)
  2750. # deck.playAction("a_fak_tailgL",30,40, layer=200, play_mode=1, speed=.5)
  2751. # trucks.playAction("a_fak_tailgL",30,40, layer=200, play_mode=1, speed=.5)
  2752. def rotmult():
  2753. if r_ground.triggered:
  2754. #print(linVelocity)
  2755. num = ((rot.z * -1) +1)
  2756. num = num * 100
  2757. #print(num)
  2758. def airup():
  2759. if r_ground.triggered == False:
  2760. pos = own.worldPosition
  2761. pos = own.worldPosition.z
  2762. last_pos = own['last_posz']
  2763. #print(last_pos - pos)
  2764. if last_pos - pos > 0:
  2765. own['airup'] = 0
  2766. if last_pos - pos < 0:
  2767. own['airup'] = 1
  2768. if pos > own['last_posz']:
  2769. own["air_height"] = pos
  2770. own['last_posz'] = pos
  2771. def onramp():
  2772. if r_ground.positive:
  2773. if 'ramp' in r_ground.hitObject:
  2774. own['onramp'] = 1
  2775. else:
  2776. own['onramp'] = 0
  2777. else:
  2778. own['onramp'] = 0
  2779. # if r_ground.positive:
  2780. # own['rgroundhit'] = 1
  2781. # else:
  2782. # own['rgroundhit'] = 0
  2783. def grindtype(gtype):
  2784. own['grindType'] = gtype
  2785. def transmult():
  2786. # linvel = own.getLinearVelocity(True)
  2787. lastrotz = own["rotz"]
  2788. # lastlinvelx = own["linvelx"]
  2789. ##up
  2790. # #reg
  2791. # if rot.z < lastrotz and linvel.x > lastlinvelx and rot.z < .9 and rot.z > .3 and linvel.x > 0:
  2792. # force = [ 40, 0, 0]
  2793. # own.applyForce(force, 1) # apply force
  2794. # #fak
  2795. # if rot.z < lastrotz and linvel.x > lastlinvelx and rot.z < .9 and rot.z > .3 and linvel.x < 0:
  2796. # force = [ -40, 0, 0]
  2797. # own.applyForce(force, 1) # apply force
  2798. ##down
  2799. # #reg
  2800. # if rot.z > lastrotz and linvel.x > lastlinvelx and rot.z < .9 and rot.z > .3 and linvel.x > 0:
  2801. # force = [ 40, 0, 0]
  2802. # own.applyForce(force, 1) # apply force
  2803. # #fak
  2804. # if rot.z > lastrotz and linvel.x > lastlinvelx and rot.z < .9 and rot.z > .3 and linvel.x < 0:
  2805. # force = [ -40, 0, 0]
  2806. # own.applyForce(force, 1) # apply force
  2807. linvel = own.getLinearVelocity(True)
  2808. newx = (linvel.x + (linvel.x * .039))
  2809. if linvel.x < 7 and linvel.x > -7 and rot.z > lastrotz and r_ground.triggered == 1 and rot.z > .3 and rot.z < .93:
  2810. own.setLinearVelocity([newx, linvel.y, linvel.z], True)
  2811. #print("what the fuck")
  2812. def speedmult():
  2813. vel = own.getLinearVelocity(True)
  2814. xyz = own.worldOrientation.to_euler()
  2815. roty = math.degrees(xyz[1])
  2816. roty = abs(roty)
  2817. roty = roty * .0005
  2818. #print("Roty: ", roty)
  2819. if abs(vel.x) > 1:
  2820. #mult = .0007
  2821. mult = .0015 + roty
  2822. else:
  2823. mult = .000
  2824. mult2 = .018
  2825. mult3 = .007
  2826. lastrotz = own["rotz"]
  2827. #print(lastrotz)
  2828. x = vel.x * mult
  2829. x2 = x + vel.x
  2830. x3 = vel.x * mult2
  2831. x4 = x3 + vel.x
  2832. x5 = vel.x * mult3
  2833. x6 = x5 + vel.x
  2834. if r_ground.triggered and vel.x < 4 and vel.x > -4:
  2835. own.setLinearVelocity([x2, vel.y, vel.z], True)
  2836. #pass
  2837. # if STANCE == True:
  2838. # if lastrotz > .9 and r_ground.triggered == True and vel.x > .05 and vel.x < 4:
  2839. # own.setLinearVelocity([x6, vel.y, vel.z], True)
  2840. # if lastrotz < .9 and r_ground.triggered == True:
  2841. # own.setLinearVelocity([x2, vel.y, vel.z], True)
  2842. # if lastrotz < .85 and lastrotz > .7 and r_ground.triggered == True:
  2843. # own.setLinearVelocity([x4, vel.y, vel.z], True)
  2844. def coping():
  2845. if invertTouch.positive:
  2846. own["coping"] = 1
  2847. else:
  2848. own["coping"] = 0
  2849. def onboard():
  2850. if own['walk'] == 1:
  2851. cont.deactivate(cam.actuators['replayCam'])
  2852. cont.activate(cam.actuators['Camera'])
  2853. killall()
  2854. #set_vibration(0, 0.0, 0.0)
  2855. walklay = 40
  2856. fliplay3 = 2060
  2857. ob_speed = .5
  2858. #add dropin anim
  2859. if STANCE == 0:
  2860. skater.stopAction(fliplay)
  2861. deck.stopAction(fliplay)
  2862. trucks.stopAction(fliplay)
  2863. killall()
  2864. if own['dropinCol'] == True:
  2865. print("dropinanim")
  2866. own['requestAction'] = reg_dropin
  2867. #skater.playAction("nreg_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=.75)
  2868. #deck.playAction("a_reg_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=.75)
  2869. #trucks.playAction("a_reg_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=.75)
  2870. else:
  2871. own['requestAction'] = 'reg_onboard'
  2872. #skater.playAction("reg_noffboard", 9,0, layer=40, priority=0, play_mode=0, speed=ob_speed)
  2873. #deck.playAction("a_reg_noffboard", 9,0, layer=40, priority=0, play_mode=0, speed=ob_speed)
  2874. #trucks.playAction("a_reg_noffboard", 9,0, layer=40, priority=0, play_mode=0, speed=ob_speed)
  2875. force = (linVelocity.x -1, linVelocity.y, linVelocity.z)
  2876. own.setLinearVelocity(force, True)
  2877. own['dropinTimer'] = 60
  2878. #print("get on board")
  2879. if STANCE == 1:
  2880. skater.stopAction(fliplay)
  2881. deck.stopAction(fliplay)
  2882. trucks.stopAction(fliplay)
  2883. killall()
  2884. if own['dropinTimer'] > 30:
  2885. print("dropinanim2")
  2886. own['requestAction'] = fak_dropin
  2887. #skater.playAction("nfak_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=.75)
  2888. #deck.playAction("a_fak_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=.75)
  2889. #trucks.playAction("a_fak_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=.75)
  2890. else:
  2891. own['requestAction'] = 'fak_onboard'
  2892. #skater.playAction("nfak_offboard", 30,1, layer=40, priority=0, play_mode=0, speed=1.5)
  2893. #deck.playAction("a_fak_offboard", 30,1, layer=40, priority=0, play_mode=0, speed=1.5)
  2894. #trucks.playAction("a_fak_offboard", 30,1, layer=40, priority=0, play_mode=0, speed=1.5)
  2895. force = (linVelocity.x +1, linVelocity.y, linVelocity.z)
  2896. own.setLinearVelocity(force, True)
  2897. own['dropinTimer'] = 60
  2898. #print("get on board")
  2899. else:
  2900. num = own['dropinTimer']
  2901. if num > 0:
  2902. num = num - 1
  2903. own['dropinTimer'] = num
  2904. #if own['dropinTimer'] == 1:
  2905. #killact(6011)
  2906. #killact(6000)
  2907. #killact(6001)
  2908. #killact(2)
  2909. def offboard():
  2910. wheel1.stopAction(2)
  2911. wheel2.stopAction(2)
  2912. wheel3.stopAction(2)
  2913. wheel4.stopAction(2)
  2914. cont.deactivate(own.actuators["sroll"])
  2915. sact = own.actuators["sroll"]
  2916. sact.volume = .0001
  2917. own.actuators["sroll"].stopSound()
  2918. own['offboard_vel'] = own.linearVelocity
  2919. own['walk_timer'] = 0
  2920. def resetjumpstance():
  2921. if LAST_GRIND == True and grindHit == False:
  2922. own["lF_ground_frame"] = own['framenum']
  2923. lfg = own["lF_ground_frame"]
  2924. #print(lfg, "----- this?")
  2925. if own['jump_stance'] != 3:
  2926. own['jump_stance'] = 3
  2927. # if r_ground.positive and grindDar == 0:
  2928. # lfg = own["lF_ground_frame"]
  2929. # fn = own["framenum"]
  2930. # time = fn - lfg
  2931. # #pass
  2932. # print(LAST_GRIND)
  2933. # if time > 60:
  2934. # own["jump_stance"] = 3
  2935. # #print("resetting jumpstance")
  2936. def grass():
  2937. try:
  2938. if 'grass' in r_ground.hitObject:
  2939. #print("grass")
  2940. linVel = own.getLinearVelocity(True)
  2941. linvelx = linVel.x * .98
  2942. own.setLinearVelocity((linvelx, linVel.y, linVel.z), 1)
  2943. except:
  2944. pass
  2945. def grindoutair():
  2946. # if own['grind_jump'] == True:
  2947. # if own['grindjumpturn'] != True:
  2948. # own['grindjumpturn'] = True
  2949. skippy = 0
  2950. linVel = own.getLinearVelocity(True)
  2951. if own['LAST_GRIND'] == True and grindHit == True:
  2952. own['lg_stance'] = STANCE
  2953. #else:
  2954. #own['lg_stance'] = 0
  2955. lg_stance = own['lg_stance']
  2956. own.actuators["grindoutair"].useLocalLinV = True
  2957. if own['grindjumpturn'] == True and own['grindCountdown'] > 12 and skippy == 0:
  2958. grindoutspeed = .1
  2959. grindoutspeed2 = 5.4
  2960. if lLR > turnsens:
  2961. #followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  2962. if own['last_grindpos'] == 'reg_5050':
  2963. if STANCE == 0:
  2964. own.actuators["grindoutair"].linV = [0, grindoutspeed, 0]
  2965. else:
  2966. own.actuators["grindoutair"].linV = [0, -grindoutspeed, 0]
  2967. cont.activate(own.actuators["grindoutair"])
  2968. #print("50grindoutair")
  2969. if lLR < -turnsens:
  2970. if own['last_grindpos'] == 'reg_5050':
  2971. if STANCE == 0:
  2972. own.actuators["grindoutair"].linV = [0, -grindoutspeed, 0]
  2973. else:
  2974. own.actuators["grindoutair"].linV = [0, grindoutspeed, 0]
  2975. cont.activate(own.actuators["grindoutair"])
  2976. #print("50grindoutair")
  2977. if lUD > turnsens:
  2978. js = own['lg_stance']
  2979. linvelx = own.getLinearVelocity(True)
  2980. if own['last_grindpos'] == 'reg_board':
  2981. if js == 1:
  2982. own.actuators["grindoutair"].linV = [-grindoutspeed, 0, 0]
  2983. cont.activate(own.actuators["grindoutair"])
  2984. #print("1grindoutair*", round(linvelx.x, 2), js)
  2985. else:
  2986. own.actuators["grindoutair"].linV = [grindoutspeed, 0, 0]
  2987. cont.activate(own.actuators["grindoutair"])
  2988. #print("2grindoutair*", round(linvelx.x, 2), js)
  2989. #cont.activate(own.actuators["grindoutair"])
  2990. if lUD < -turnsens:
  2991. js = own['lg_stance']
  2992. if own['last_grindpos'] == 'reg_board':
  2993. if js == 0:
  2994. own.actuators["grindoutair"].linV = [-grindoutspeed, 0, 0]
  2995. cont.activate(own.actuators["grindoutair"])
  2996. #print("3grindoutair broke", js)
  2997. else:
  2998. own.actuators["grindoutair"].linV = [grindoutspeed, 0, 0]
  2999. cont.activate(own.actuators["grindoutair"])
  3000. #print("equal")
  3001. #print("4grindoutair broke", js)
  3002. if LAST_GRIND == False and r_ground.triggered and own['grindjumpturn'] == True and own['grindCountdown'] < 1:
  3003. own['grindjumpturn'] = False
  3004. #pass
  3005. if r_ground.triggered:
  3006. own['grind_jump'] = False
  3007. #own['grindjumpturn'] = False
  3008. #pass
  3009. if own['grindjumpturn'] == False or own['grindCountdown'] < 19:
  3010. #pass
  3011. cont.deactivate(own.actuators["grindoutair"])
  3012. #print("deactivate#################################")
  3013. # if own['grindjumpturn'] == True and r_ground.triggered:
  3014. # own['grindjumpturn'] = False
  3015. def set_last_grindpos():
  3016. if own['grindpos'] != None:
  3017. own['last_grindpos'] = own['grindpos']
  3018. def air_pos():
  3019. grindpos = own['grindpos']
  3020. GRAB_ON = own["GRAB_ON"]
  3021. wr = own["wallride"]
  3022. if rUD > .040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 50:
  3023. killact(2)
  3024. killact(4)
  3025. # if trucks.isPlayingAction(500) == False:
  3026. # if STANCE == 0:
  3027. if STANCE == 0:
  3028. own['requestAction'] = 'reg_air_tail'
  3029. # skater.playAction("reg_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3030. # deck.playAction("a_reg_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3031. # trucks.playAction("a_reg_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3032. else:
  3033. own['requestAction'] = 'fak_air_tail'
  3034. # skater.playAction("fak_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3035. # deck.playAction("a_fak_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3036. # trucks.playAction("a_fak_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3037. elif rUD < -.040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 50:
  3038. killact(2)
  3039. killact(4)
  3040. # if trucks.isPlayingAction(500) == False:
  3041. if STANCE == 0:
  3042. own['requestAction'] = 'reg_air_nose'
  3043. # skater.playAction("reg_nmanual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3044. # deck.playAction("a_fak_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3045. # trucks.playAction("a_fak_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3046. else:
  3047. own['requestAction'] = 'fak_air_nose'
  3048. # skater.playAction("fak_nmanual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3049. # deck.playAction("a_reg_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3050. # trucks.playAction("a_reg_manual", 10,70, layer=50, priority=8, play_mode=1, speed=.5)
  3051. else:
  3052. killact(50)
  3053. #killact(50)
  3054. #killact(50)
  3055. def air_turn_boost():
  3056. pass
  3057. def revert():
  3058. own["Q3oncdl"] = 0
  3059. own["Q4oncdl"] = 0
  3060. own["Q5oncdl"] = 0
  3061. own["Q6oncdl"] = 0
  3062. own["Q7oncdl"] = 0
  3063. local = True
  3064. rot = [ 0.0, 0.0, 3.14]
  3065. own.applyRotation(rot,local)
  3066. #killall()
  3067. #if own['reg_manual'] == 1 or own['reg_nmanual'] == 1:
  3068. #if own['reg_manual'] == 1:
  3069. if own['manual_v2_type'] == 'reg manual':
  3070. own['requestAction'] = 'reg_manual_revert_ccw'
  3071. # skater.playAction("reg_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3072. # deck.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3073. # trucks.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3074. print("reg")
  3075. #elif own['reg_nmanual'] == 1:
  3076. elif own['manual_v2_type'] == 'reg nose manual':
  3077. skater.playAction("fak_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3078. deck.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3079. trucks.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3080. print("reg nose manual revert")
  3081. #elif own['fak_manual'] == 1 or own['fak_nmanual'] == 1:
  3082. elif own['manual_v2_type'] == 'fak manual':
  3083. skater.playAction("fak_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3084. deck.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3085. trucks.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3086. print("fak manual revert")
  3087. elif own['manual_v2_type'] == 'fak nose manual':
  3088. skater.playAction("reg_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3089. deck.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3090. trucks.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3091. print("fak")
  3092. else:
  3093. own['requestAction'] = 'revert1'
  3094. # skater.playAction("revert1", 1,10, layer=400, priority=8, play_mode=0, speed=.5)
  3095. # deck.playAction("a_revert1", 1,10, layer=400, priority=1, play_mode=0, speed=.5)
  3096. # trucks.playAction("a_revert1", 1,10, layer=400, priority=0, play_mode=0, speed=.5)
  3097. own['revert_timer'] = 20
  3098. cont.activate(own.actuators["revertSound"])
  3099. #revert_on_timer 20
  3100. #force = [0,0,0]
  3101. #own.setLinearVelocity(force, True)
  3102. def revert2():
  3103. own["Q3oncdl"] = 0
  3104. own["Q4oncdl"] = 0
  3105. own["Q5oncdl"] = 0
  3106. own["Q6oncdl"] = 0
  3107. own["Q7oncdl"] = 0
  3108. local = True
  3109. rot = [ 0.0, 0.0, -3.14]
  3110. own.applyRotation(rot,local)
  3111. #killall()
  3112. if own['manual_v2_type'] == 'reg manual':
  3113. skater.playAction("reg_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3114. deck.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3115. trucks.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3116. print("reg")
  3117. #elif own['reg_nmanual'] == 1:
  3118. elif own['manual_v2_type'] == 'reg nose manual':
  3119. skater.playAction("fak_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3120. deck.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3121. trucks.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3122. print("reg nose manual revert")
  3123. #elif own['fak_manual'] == 1 or own['fak_nmanual'] == 1:
  3124. elif own['manual_v2_type'] == 'fak manual':
  3125. skater.playAction("fak_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3126. deck.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3127. trucks.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3128. print("fak manual revert")
  3129. elif own['manual_v2_type'] == 'fak nose manual':
  3130. skater.playAction("reg_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3131. deck.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3132. trucks.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3133. print("fak")
  3134. else:
  3135. own['requestAction'] = 'revert2'
  3136. # skater.playAction("revert2", 1,10, layer=400, priority=8, play_mode=0, speed=.5)
  3137. # deck.playAction("a_revert2", 1,10, layer=400, priority=1, play_mode=0, speed=.5)
  3138. # trucks.playAction("a_revert2", 1,10, layer=400, priority=0, play_mode=0, speed=.5)
  3139. own['revert_timer'] = 20
  3140. cont.activate(own.actuators["revertSound"])
  3141. def revert3():
  3142. own["Q7oncdl"] = 0
  3143. own["Q8oncdl"] = 0
  3144. own["Q1oncdl"] = 0
  3145. own["Q2oncdl"] = 0
  3146. own["Q3oncdl"] = 0
  3147. local = True
  3148. rot = [ 0.0, 0.0, 3.14]
  3149. own.applyRotation(rot,local)
  3150. print("real revert 3")
  3151. #killall()
  3152. if own['manual_v2_type'] == 'reg manual':
  3153. skater.playAction("reg_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3154. deck.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3155. trucks.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3156. print("reg")
  3157. #elif own['reg_nmanual'] == 1:
  3158. elif own['manual_v2_type'] == 'reg nose manual':
  3159. skater.playAction("fak_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3160. deck.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3161. trucks.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3162. print("reg nose manual revert")
  3163. #elif own['fak_manual'] == 1 or own['fak_nmanual'] == 1:
  3164. elif own['manual_v2_type'] == 'fak manual':
  3165. skater.playAction("fak_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3166. deck.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3167. trucks.playAction("a_fak_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3168. print("fak manual revert")
  3169. elif own['manual_v2_type'] == 'fak nose manual':
  3170. skater.playAction("reg_manual_revert_ccw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3171. deck.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3172. trucks.playAction("a_reg_manual_revert_ccw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3173. print("fak")
  3174. else:
  3175. own['requestAction'] = 'revert3'
  3176. # skater.playAction("revert1", 1,10, layer=400, priority=8, play_mode=0, speed=.5)
  3177. # deck.playAction("a_revert1", 1,10, layer=400, priority=1, play_mode=0, speed=.5)
  3178. # trucks.playAction("a_revert1", 1,10, layer=400, priority=0, play_mode=0, speed=.5)
  3179. own['revert_timer'] = 20
  3180. cont.activate(own.actuators["revertSound"])
  3181. def revert4():
  3182. own["Q7oncdl"] = 0
  3183. own["Q8oncdl"] = 0
  3184. own["Q1oncdl"] = 0
  3185. own["Q2oncdl"] = 0
  3186. own["Q3oncdl"] = 0
  3187. local = True
  3188. rot = [ 0.0, 0.0, 3.14]
  3189. own.applyRotation(rot,local)
  3190. #killall()
  3191. if own['manual_v2_type'] == 'reg manual':
  3192. skater.playAction("reg_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3193. deck.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3194. trucks.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3195. print("reg")
  3196. #elif own['reg_nmanual'] == 1:
  3197. elif own['manual_v2_type'] == 'reg nose manual':
  3198. skater.playAction("fak_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3199. deck.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3200. trucks.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3201. print("reg nose manual revert")
  3202. #elif own['fak_manual'] == 1 or own['fak_nmanual'] == 1:
  3203. elif own['manual_v2_type'] == 'fak manual':
  3204. skater.playAction("fak_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3205. deck.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3206. trucks.playAction("a_fak_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3207. print("fak manual revert")
  3208. elif own['manual_v2_type'] == 'fak nose manual':
  3209. skater.playAction("reg_manual_revert_cw", 70,10, layer=400, priority=8, play_mode=0, speed=4)
  3210. deck.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=1, play_mode=0, speed=4)
  3211. trucks.playAction("a_reg_manual_revert_cw", 70,10, layer=400, priority=0, play_mode=0, speed=4)
  3212. print("fak")
  3213. else:
  3214. own['requestAction'] = 'revert4'
  3215. print("normal revert")
  3216. # skater.playAction("revert2", 1,10, layer=400, priority=8, play_mode=0, speed=.5)
  3217. # deck.playAction("a_revert2", 1,10, layer=400, priority=1, play_mode=0, speed=.5)
  3218. # trucks.playAction("a_revert2", 1,10, layer=400, priority=0, play_mode=0, speed=.5)
  3219. own['revert_timer'] = 20
  3220. cont.activate(own.actuators["revertSound"])
  3221. def powerslide():
  3222. own['powerslide_counter'] = own['powerslide_counter'] + 1
  3223. since_walk = own['framenum'] - own['last_walk_frame']
  3224. since_grind = own['framenum'] - own['last_grind_frame']
  3225. if own['powerslide_counter'] > 15 and since_walk > 100 and since_grind > 40:
  3226. own['powerslide_on'] = 1
  3227. if STANCE == 0:
  3228. own['powerslide'] = "reg2"
  3229. #skater.playAction("nreg_powerslide", 20,80, layer=400, priority=8, play_mode=1, speed=.5)
  3230. #deck.playAction("a_reg_powerslide", 20,80, layer=400, priority=1, play_mode=1, speed=.5)
  3231. #trucks.playAction("a_reg_powerslide", 20,80, layer=400, priority=0, play_mode=1, speed=.5)
  3232. if STANCE == 1:
  3233. own['powerslide'] = "fak1"
  3234. #skater.playAction("nfak_powerslide", 20,80, layer=400, priority=8, play_mode=1, speed=.5)
  3235. #deck.playAction("a_fak_powerslide_d", 20,80, layer=400, priority=1, play_mode=1, speed=.5)
  3236. #trucks.playAction("a_fak_powerslide_t", 20,80, layer=400, priority=0, play_mode=1, speed=.5)
  3237. linVelocity4 = own.getLinearVelocity(True)
  3238. if own['powerslide_counter'] > 15 and own['powerslide_counter'] < 18:
  3239. newx = linVelocity4.x * .9
  3240. else:
  3241. newx = linVelocity4.x * .98
  3242. force = [newx, linVelocity4.y, linVelocity4.z]
  3243. own.setLinearVelocity(force, True)
  3244. def powerslide2():
  3245. own['powerslide_counter'] = own['powerslide_counter'] + 1
  3246. since_walk = own['framenum'] - own['last_walk_frame']
  3247. since_grind = own['framenum'] - own['last_grind_frame']
  3248. if own['powerslide_counter'] > 15 and since_walk > 100 and since_grind > 100:
  3249. own['powerslide_on'] = 1
  3250. if STANCE == 0:
  3251. own['powerslide'] = "reg1"
  3252. #skater.playAction("nreg_powerslide2", 20,80, layer=400, priority=8, play_mode=1, speed=.5)
  3253. #deck.playAction("a_reg_powerslide2_d", 20,80, layer=400, priority=1, play_mode=1, speed=.5)
  3254. #trucks.playAction("a_reg_powerslide2_t", 20,80, layer=400, priority=0, play_mode=1, speed=.5)
  3255. if STANCE == 1:
  3256. own['powerslide'] = "fak2"
  3257. #skater.playAction("nfak_powerslide2", 20,80, layer=400, priority=8, play_mode=1, speed=.5)
  3258. #deck.playAction("a_fak_powerslide2_d", 20,80, layer=400, priority=1, play_mode=1, speed=.5)
  3259. #trucks.playAction("a_fak_powerslide2_t", 20,80, layer=400, priority=0, play_mode=1, speed=.5)
  3260. linVelocity4 = own.getLinearVelocity(True)
  3261. if own['powerslide_counter'] > 15 and own['powerslide_counter'] < 18:
  3262. newx = linVelocity4.x * .9
  3263. else:
  3264. newx = linVelocity4.x * .98
  3265. force = [newx, linVelocity4.y, linVelocity4.z]
  3266. own.setLinearVelocity(force, True)
  3267. def powerslide_state():
  3268. ####powerslide on#####
  3269. if own['powerslide_on'] == 1:
  3270. if own['powerslide'] == "reg2":
  3271. own['requestAction'] = 'reg_fs_powerslide'
  3272. if own['powerslide'] == "fak1":
  3273. own['requestAction'] = 'fak_fs_powerslide'
  3274. if own['powerslide'] == "reg1":
  3275. own['requestAction'] = 'reg_powerslide'
  3276. if own['powerslide'] == "fak2":
  3277. own['requestAction'] = 'fak_powerslide'
  3278. #if own['powerslide_on'] == 1 and own['last_powerslide_on'] == 0:
  3279. #print("power_on")
  3280. #if own['powerslide'] == "reg2":
  3281. # skater.playAction("nreg_powerslide", 0,20, layer=401, priority=8, play_mode=0, speed=1.5)
  3282. # deck.playAction("a_reg_powerslide", 0,20, layer=401, priority=1, play_mode=0, speed=1.5)
  3283. # trucks.playAction("a_reg_powerslide", 0,20, layer=401, priority=0, play_mode=0, speed=1.5)
  3284. # if own['powerslide'] == "fak1":
  3285. # own['requestAction'] = 'fak_powerslide'
  3286. # skater.playAction("nfak_powerslide", 0,20, layer=401, priority=8, play_mode=0, speed=1.5)
  3287. # deck.playAction("a_fak_powerslide_d", 0,20, layer=401, priority=1, play_mode=0, speed=1.5)
  3288. # trucks.playAction("a_fak_powerslide_t", 0,20, layer=401, priority=0, play_mode=0, speed=1.5)
  3289. # if own['powerslide'] == "reg1":
  3290. # #own['requestAction'] = 'reg_fs_powerslide'
  3291. # skater.playAction("nreg_powerslide2", 0,20, layer=401, priority=8, play_mode=0, speed=1.5)
  3292. # deck.playAction("a_reg_powerslide2_d", 0,20, layer=401, priority=1, play_mode=0, speed=1.5)
  3293. # trucks.playAction("a_reg_powerslide2_t", 0,20, layer=401, priority=0, play_mode=0, speed=1.5)
  3294. # if own['powerslide'] == "fak2":
  3295. # #own['requestAction'] = 'fak_fs_powerslide'
  3296. # skater.playAction("nfak_powerslide2", 0,20, layer=401, priority=8, play_mode=0, speed=1.5)
  3297. # deck.playAction("a_fak_powerslide2_d", 0,20, layer=401, priority=1, play_mode=0, speed=1.5)
  3298. # trucks.playAction("a_fak_powerslide2_t", 0,20, layer=401, priority=0, play_mode=0, speed=1.5)
  3299. ####powerslide off#####
  3300. # if own['powerslide_on'] == 0 and own['last_powerslide_on'] == 1:
  3301. # killact(400)
  3302. # killact(401)
  3303. # linVelocity4 = own.getLinearVelocity(True)
  3304. # newx = linVelocity4.x * .9
  3305. # force = [newx, linVelocity4.y, linVelocity4.z]
  3306. # own.setLinearVelocity(force, True)
  3307. #
  3308. # if own['powerslide'] == "reg2":
  3309. # skater.playAction("nreg_powerslide", 20,0, layer=4002, priority=8, play_mode=0, speed=1.5)
  3310. # deck.playAction("a_reg_powerslide", 20,0, layer=4002, priority=1, play_mode=0, speed=1.5)
  3311. # trucks.playAction("a_reg_powerslide", 20,0, layer=4002, priority=0, play_mode=0, speed=1.5)
  3312. # if own['powerslide'] == "fak1":
  3313. # skater.playAction("nfak_powerslide", 20,0, layer=4002, priority=8, play_mode=0, speed=1.5)
  3314. # deck.playAction("a_fak_powerslide_d", 20,0, layer=4002, priority=1, play_mode=0, speed=1.5)
  3315. # trucks.playAction("a_fak_powerslide_t", 20,0, layer=4002, priority=0, play_mode=0, speed=1.5)
  3316. #
  3317. # if own['powerslide'] == "reg1":
  3318. # skater.playAction("nreg_powerslide2", 20,0, layer=4002, priority=8, play_mode=0, speed=1.5)
  3319. # deck.playAction("a_reg_powerslide2_d", 20,0, layer=4002, priority=1, play_mode=0, speed=1.5)
  3320. # trucks.playAction("a_reg_powerslide2_t", 20,0, layer=4002, priority=0, play_mode=0, speed=1.5)
  3321. # if own['powerslide'] == "fak2":
  3322. # skater.playAction("nfak_powerslide2", 20,0, layer=4002, priority=8, play_mode=0, speed=1.5)
  3323. # deck.playAction("a_fak_powerslide2_d", 20,0, layer=4002, priority=1, play_mode=0, speed=1.5)
  3324. # trucks.playAction("a_fak_powerslide2_t", 20,0, layer=4002, priority=0, play_mode=0, speed=1.5)
  3325. # #print("old power")
  3326. def powerslide_sound():
  3327. sact = own.actuators["powerslide_sound"]
  3328. if own['powerslide_on'] == 1:
  3329. sact = own.actuators["powerslide_sound"]
  3330. sact.volume = .2
  3331. new_pitch = (abs(linVelocity.x) / 3)
  3332. #new_pitch = new_pitch * 1.1
  3333. #print("np=", new_pitch)
  3334. if new_pitch < 1.1 and new_pitch > .5:
  3335. sact.pitch = new_pitch
  3336. elif new_pitch <= .5:
  3337. sact.pitch = .5
  3338. else:
  3339. sact.pitch = 1.1
  3340. cont.activate(own.actuators["powerslide_sound"])
  3341. else:
  3342. sact.volume = .0
  3343. cont.deactivate(own.actuators["powerslide_sound"])
  3344. def check_powerslide():
  3345. try:
  3346. own['last_powerslide_on'] = own['powerslide_on']
  3347. except:
  3348. pass
  3349. psxvel = abs(linVelocity.x)
  3350. #xvelsens = .1
  3351. if (lUD > .08 or lUD < -.08) and own['manual_v2'] == False and r_ground.triggered == True and psxvel > .1:
  3352. if lUD > .08:
  3353. powerslide()
  3354. else:
  3355. powerslide2()
  3356. else:
  3357. own['powerslide_on'] = 0
  3358. own['powerslide_counter'] = 0
  3359. if own['last_powerslide_on'] == 0:
  3360. own['powerslide'] = None
  3361. def killmanuals():
  3362. if own['last_manual_v2'] == 1 and own['manual_v2'] == 0:
  3363. fak_manual_off()
  3364. reg_manual_off()
  3365. fak_nmanual_off()
  3366. reg_nmanual_off()
  3367. def killopos():
  3368. if q5oncd < 1 and q1oncd <1:
  3369. killact(65)
  3370. killact(66)
  3371. killact(67)
  3372. killact(68)
  3373. killact(71)
  3374. killact(72)
  3375. killact(73)
  3376. killact(74)
  3377. stopAnims()
  3378. #nextframe()
  3379. air()
  3380. stance()
  3381. turn()
  3382. #grind()
  3383. rotmult()
  3384. airup()
  3385. onramp()
  3386. speedmult()
  3387. coping()
  3388. onboard()
  3389. resetjumpstance()
  3390. grass()
  3391. grindoutair()
  3392. set_last_grindpos()
  3393. air_pos()
  3394. air_turn_boost()
  3395. record_grindsound()
  3396. check_powerslide()
  3397. powerslide_state()
  3398. powerslide_sound()
  3399. killmanuals()
  3400. killopos()
  3401. grind()
  3402. ##################
  3403. ###realcontrols###
  3404. ##################
  3405. # q1
  3406. # q8 q2
  3407. # q7 q3
  3408. # q6 q4
  3409. # q5
  3410. ##################
  3411. #lq6
  3412. if lUD > .04 and lLR < -0.04 :
  3413. lq6on = 1
  3414. q6oncdl = countdown
  3415. own["Q6oncdl"] = q6oncdl
  3416. #print("lq6on")
  3417. elif q6oncdl > 0:
  3418. lq6on = 0
  3419. q6oncdl = q6oncdl - 1
  3420. own["Q6oncdl"] = q6oncdl
  3421. #lq8
  3422. if lUD < -.04 and lLR < -0.04 :
  3423. lq8on = 1
  3424. q8oncdl = countdown
  3425. own["Q8oncdl"] = q8oncdl
  3426. #print("lq8on")
  3427. elif q8oncdl > 0:
  3428. lq8on = 0
  3429. q8oncdl = q8oncdl - 1
  3430. own["Q8oncdl"] = q8oncdl
  3431. #lq2
  3432. if lUD < -.04 and lLR > 0.04 :
  3433. lq2on = 1
  3434. q2oncdl = countdown
  3435. own["Q2oncdl"] = q2oncdl
  3436. #print("lq2on")
  3437. elif q2oncdl > 0:
  3438. lq2on = 0
  3439. q2oncdl = q2oncdl - 1
  3440. own["Q2oncdl"] = q2oncdl
  3441. #q4
  3442. if lUD > 0.04 and lLR > 0.04 :
  3443. lq4on = 1
  3444. q4oncdl = countdown
  3445. own["Q4oncdl"] = q4oncdl
  3446. #print("lq4on")
  3447. elif q4oncdl > 0:
  3448. lq4on = 0
  3449. q4oncdl = q4oncdl - 1
  3450. own["Q4oncdl"] = q4oncdl
  3451. #q5
  3452. if lUD > .070 and lq4on == 0 and lq6on == 0:
  3453. lq5on = 1
  3454. q5oncdl = countdown
  3455. own["Q5oncdl"] = q5oncdl
  3456. #print("lq5on")
  3457. elif q5oncdl > 0:
  3458. lq5on = 0
  3459. q5oncdl = q5oncdl - 1
  3460. own["Q5oncdl"] = q5oncdl
  3461. #q1
  3462. if lUD < -0.070 and lq8on !=1 and lq2on != 1:
  3463. lq1on = 1
  3464. q1oncdl = countdown
  3465. own["Q1oncdl"] = q1oncdl
  3466. #print("lq1on")
  3467. elif q1oncdl > 0:
  3468. lq1on = 0
  3469. q1oncdl = q1oncdl - 1
  3470. own["Q1oncdl"] = q1oncdl
  3471. #q7
  3472. if lLR < -0.070 and lq8on != 1 and lq6on != 1:
  3473. lq7on = 1
  3474. q7oncdl = countdown
  3475. own["Q7oncdl"] = q7oncdl
  3476. #print("lq7on")
  3477. elif q7oncdl > 0:
  3478. lq7on = 0
  3479. q7oncdl = q7oncdl - 1
  3480. own["Q7oncdl"] = q7oncdl
  3481. #q3
  3482. if lLR > 0.070 and lq2on !=1 and lq4on != 1:
  3483. lq3on = 1
  3484. q3oncdl = countdown
  3485. own["Q3oncdl"] = q3oncdl
  3486. #print("lq3on")
  3487. elif q3oncdl > 0:
  3488. lq3on = 0
  3489. q3oncdl = q3oncdl - 1
  3490. own["Q3oncdl"] = q3oncdl
  3491. #34567
  3492. own['set_revert_timer'] = 0
  3493. if q3oncdl < q4oncdl < q5oncdl < q6oncdl < q7oncdl:
  3494. if r_ground.triggered == True:
  3495. print("REVERT!!!")
  3496. revert()
  3497. own['set_revert_timer'] = 1
  3498. if q3oncdl > q4oncdl > q5oncdl > q6oncdl > q7oncdl:
  3499. if r_ground.triggered == True:
  3500. print("REVERT2!!!")
  3501. revert2()
  3502. own['set_revert_timer'] = 1
  3503. if q7oncdl < q8oncdl < q1oncdl < q2oncdl < q3oncdl:
  3504. if r_ground.triggered == True:
  3505. print("REVERT3!!!")
  3506. revert3()
  3507. own['set_revert_timer'] = 1
  3508. if q7oncdl > q8oncdl > q1oncdl > q2oncdl > q3oncdl:
  3509. if r_ground.triggered == True:
  3510. print("REVERT4!!!")
  3511. revert4()
  3512. own['set_revert_timer'] = 1
  3513. ################
  3514. #q6
  3515. if rUD > .04 and rLR < -0.04 :
  3516. q6on = 1
  3517. q6oncd = countdown
  3518. own["Q6oncd"] = q6oncd
  3519. #print("q6on")
  3520. elif q6oncd > 0:
  3521. q6on = 0
  3522. q6oncd = q6oncd - 1
  3523. own["Q6oncd"] = q6oncd
  3524. #q8
  3525. if rUD < -.04 and rLR < -0.04 :
  3526. q8on = 1
  3527. q8oncd = countdown
  3528. own["Q8oncd"] = q8oncd
  3529. #print("q8on")
  3530. elif q8oncd > 0:
  3531. q8on = 0
  3532. q8oncd = q8oncd - 1
  3533. own["Q8oncd"] = q8oncd
  3534. #q2
  3535. if rUD < -.04 and rLR > 0.04 :
  3536. q2on = 1
  3537. q2oncd = countdown
  3538. own["Q2oncd"] = q2oncd
  3539. #print("q2on")
  3540. elif q2oncd > 0:
  3541. q2on = 0
  3542. q2oncd = q2oncd - 1
  3543. own["Q2oncd"] = q2oncd
  3544. #q4
  3545. if rUD > 0.04 and rLR > 0.04 :
  3546. q4on = 1
  3547. q4oncd = countdown
  3548. own["Q4oncd"] = q4oncd
  3549. #print("q4on")
  3550. elif q4oncd > 0:
  3551. q4on = 0
  3552. q4oncd = q4oncd - 1
  3553. own["Q4oncd"] = q4oncd
  3554. #q5
  3555. if rUD > .070:
  3556. if q4on == 0 and q6on == 0:
  3557. #print("q5on")
  3558. q5on = 1
  3559. q5oncd = countdown
  3560. own["Q5oncd"] = q5oncd
  3561. oposin()
  3562. if rUD > .02:
  3563. grindpos = own['grindpos']
  3564. jumpstance = own["jump_stance"]
  3565. if LAST_GRIND == False:
  3566. if grindpos == "reg_stall":
  3567. grindtype("nose_stall") #change
  3568. elif grindpos == "fak_stall":
  3569. grindtype("nose_stall")
  3570. elif grindpos == "reg_5050":
  3571. if jumpstance != 3:
  3572. if jumpstance == 0:
  3573. if rLR > .02:
  3574. grindtype("reg_tailgR")
  3575. elif rLR < -.02:
  3576. grindtype("reg_tailgL")
  3577. else:
  3578. grindtype("reg_tailg")
  3579. if jumpstance == 1:
  3580. if rLR > .02:
  3581. grindtype("fak_tailgR")
  3582. elif rLR < -.02:
  3583. grindtype("fak_tailgL")
  3584. else:
  3585. grindtype("fak_tailg")
  3586. else:
  3587. if STANCE == 0:
  3588. if rLR > .03:
  3589. grindtype("reg_tailgR")
  3590. elif rLR < -.02:
  3591. grindtype("reg_tailgL")
  3592. else:
  3593. grindtype("reg_tailg")
  3594. if STANCE == 1:
  3595. grindtype("fak_tailg")
  3596. elif grindpos == "reg_board":
  3597. if jumpstance != 3:
  3598. if jumpstance == 0:
  3599. grindtype("reg_tailslide")
  3600. if jumpstance == 1:
  3601. grindtype("fak_tailslide")
  3602. STANCE = jumpstance
  3603. own['stance'] = STANCE
  3604. else:
  3605. if STANCE == 0:
  3606. grindtype("reg_tailslide")
  3607. if STANCE == 1:
  3608. grindtype("fak_tailslide")
  3609. else:
  3610. if jumpstance == 0:
  3611. grindtype("reg_tailg")
  3612. if jumpstance == 1:
  3613. grindtype("fak_tailg")
  3614. elif q5oncd > 0:
  3615. q5on = 0
  3616. q5oncd = q5oncd - 1
  3617. own["Q5oncd"] = q5oncd
  3618. killact(65)
  3619. killact(66)
  3620. killact(67)
  3621. killact(68)
  3622. flipping = skater.isPlayingAction(fliplay)
  3623. # if own["last_Opos"] == True and flipping == False:
  3624. # if STANCE == False:
  3625. # skater.playAction("noposin", 20,1, layer=69, priority=3, blendin=10, play_mode=0, speed=.5)
  3626. # elif STANCE == True:
  3627. # skater.playAction("fak_oposin", 20,1, layer=70, priority=3, blendin=10, play_mode=0, speed=.5)
  3628. #skater.stopAction(7)
  3629. #skater.stopAction(0)
  3630. own["last_Opos"] = False
  3631. #q1
  3632. if rUD < -0.070:
  3633. if q2on == 0 and q8on == 0:
  3634. #print("q1on")
  3635. q1on = 1
  3636. q1oncd = countdown
  3637. own["Q1oncd"] = q1oncd
  3638. noposin()
  3639. if rUD < -0.020:
  3640. grindpos = own['grindpos']
  3641. jumpstance = own["jump_stance"]
  3642. if LAST_GRIND == False:
  3643. if grindpos == "reg_5050":
  3644. #print("nose something")
  3645. if jumpstance != 3:
  3646. if jumpstance == 0:
  3647. if rLR > .02:
  3648. grindtype("reg_nosegR")
  3649. elif rLR < -.02:
  3650. grindtype("reg_nosegL")
  3651. else:
  3652. #print("gtype reg_nosegR")
  3653. grindtype("reg_noseg")
  3654. if jumpstance == 1:
  3655. if rLR > .02:
  3656. grindtype("fak_nosegR")
  3657. elif rLR < -.02:
  3658. grindtype("fak_nosegL")
  3659. else:
  3660. grindtype("fak_noseg")
  3661. else:
  3662. if STANCE == 0:
  3663. if rLR > .02:
  3664. grindtype("reg_nosegR")
  3665. elif rLR < -.02:
  3666. grindtype("reg_nosegL")
  3667. else:
  3668. grindtype("reg_noseg")
  3669. if STANCE == 1:
  3670. if rLR > .02:
  3671. grindtype("fak_nosegR")
  3672. elif rLR < -.02:
  3673. grindtype("fak_nosegL")
  3674. else:
  3675. grindtype("fak_noseg")
  3676. elif grindpos == "reg_board":
  3677. #print("nose something")
  3678. if jumpstance != 3:
  3679. if jumpstance == 0:
  3680. grindtype("reg_noseslide")
  3681. if jumpstance == 1:
  3682. grindtype("fak_noseslide")
  3683. STANCE = jumpstance
  3684. own['stance'] = STANCE
  3685. else:
  3686. if STANCE == 0:
  3687. grindtype("reg_noseslide")
  3688. if STANCE == 1:
  3689. grindtype("fak_noseslide")
  3690. elif q1oncd > 0:
  3691. q1on = 0
  3692. q1oncd = q1oncd - 1
  3693. own["Q1oncd"] = q1oncd
  3694. killact(73)
  3695. killact(74)
  3696. killact(71)
  3697. killact(72)
  3698. flipping = skater.isPlayingAction(fliplay)
  3699. # if own["last_nOpos"] == True and flipping == False:
  3700. # if STANCE == 0 and r_ground.triggered:
  3701. # skater.playAction("nnoposin", 20,1, layer=75, priority=3, blendin=10, play_mode=0, speed=.5)
  3702. # elif STANCE == 1 and r_ground.triggered:
  3703. # skater.playAction("fak_noposin", 20,1, layer=76, priority=3, blendin=10, play_mode=0, speed=.5)
  3704. own["last_nOpos"] = False
  3705. #q7
  3706. if rLR < -0.070:
  3707. if q8on == 0 and q6on == 0:
  3708. q7on = 1
  3709. q7oncd = countdown
  3710. own["Q7oncd"] = q7oncd
  3711. #print("q7on")
  3712. elif q7oncd > 0:
  3713. q7on = 0
  3714. q7oncd = q7oncd - 1
  3715. own["Q7oncd"] = q7oncd
  3716. #q3
  3717. if rLR > 0.070:
  3718. if q4on == 0 and q2on == 0:
  3719. q3on = 1
  3720. q3oncd = countdown
  3721. own["Q3oncd"] = q3oncd
  3722. #print("q3on")
  3723. elif q3oncd > 0:
  3724. q3on = 0
  3725. q3oncd = q3oncd - 1
  3726. own["Q3oncd"] = q3oncd
  3727. #trick calls
  3728. # 360 flip
  3729. # 3 > 4 > 5 > 8
  3730. # laser flip
  3731. # 7 > 6 > 5 > 2
  3732. #nollie 360 shovit
  3733. if q7oncd > 0 and q8oncd > 0 and q1oncd > 0 and q2oncd > 0 and q3oncd > 0 and q7oncd <= q8oncd <= q1oncd <= q2oncd <= q3oncd:
  3734. print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  3735. print ("Nollie 360 shovit")
  3736. dict['trick_string'] = 'Nollie 360 Shovit'
  3737. nollie_shovit360()
  3738. q7oncd = 0
  3739. q8oncd = 0
  3740. q1oncd = 0
  3741. q2oncd = 0
  3742. q3oncd = 0
  3743. own["Q7oncd"] = q7oncd
  3744. own["Q8oncd"] = q8oncd
  3745. own["Q1oncd"] = q1oncd
  3746. own["Q2oncd"] = q2oncd
  3747. own["Q3oncd"] = q3oncd
  3748. #nollie fs 360 shovit
  3749. if q7oncd > 0 and q8oncd > 0 and q1oncd > 0 and q2oncd > 0 and q3oncd > 0 and q3oncd <= q2oncd <= q1oncd <= q8oncd <= q7oncd:
  3750. #print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  3751. print ("Nollie Front Side 360 shovit")
  3752. dict['trick_string'] = 'Nollie FS 360 Shovit'
  3753. nollie_fsshovit360()
  3754. q7oncd = 0
  3755. q8oncd = 0
  3756. q1oncd = 0
  3757. q2oncd = 0
  3758. q3oncd = 0
  3759. own["Q7oncd"] = q7oncd
  3760. own["Q8oncd"] = q8oncd
  3761. own["Q1oncd"] = q1oncd
  3762. own["Q2oncd"] = q2oncd
  3763. own["Q3oncd"] = q3oncd
  3764. # varial heelflip
  3765. # 7 < 6 < 2
  3766. if q7oncd > 0 and q6oncd > 0 and q2oncd > 0 and q7oncd < q6oncd < q2oncd:
  3767. dict['trick_string'] = 'Varial Heelflip'
  3768. varial_heelflip()
  3769. reset_rtimers()
  3770. # varial kickflip
  3771. # 3 < 4 < 8
  3772. if q3oncd > 0 and q4oncd > 0 and q8oncd > 0 and q3oncd < q4oncd < q8oncd:
  3773. dict['trick_string'] = 'Varial Kickflip'
  3774. varial_kickflip()
  3775. reset_rtimers()
  3776. # nollie varial kickflip
  3777. # 3 < 2 < 6
  3778. if q3oncd > 0 and q2oncd > 0 and q6oncd > 0 and q3oncd <= q2oncd <= q6oncd:
  3779. dict['trick_string'] = 'Nollie Varial Kickflip'
  3780. print('Nollie Varial Kickflip')
  3781. nollie_varial_kickflip()
  3782. reset_rtimers()
  3783. # nollie varial heelflip
  3784. # 7 < 8 < 4
  3785. if q7oncd > 0 and q8oncd > 0 and q4oncd > 0 and q7oncd <= q8oncd <= q4oncd:
  3786. dict['trick_string'] = 'Nollie Varial Heelflip'
  3787. print('Nollie Varial Heelflip')
  3788. nollie_varial_heelflip()
  3789. reset_rtimers()
  3790. #360 shovit
  3791. if q3oncd > 0 and q4oncd > 0 and q5oncd > 0 and q6oncd > 0 and q7oncd > 0 and q7oncd >= q6oncd >= q5oncd >= q4oncd >= q3oncd:
  3792. # print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  3793. #print ("______-------360 shovit")
  3794. dict['trick_string'] = '360 Shovit'
  3795. shovit360()
  3796. q3oncd = 0
  3797. q4oncd = 0
  3798. q5oncd = 0
  3799. q6oncd = 0
  3800. q7oncd = 0
  3801. own["Q3oncd"] = q3oncd
  3802. own["Q4oncd"] = q4oncd
  3803. own["Q5oncd"] = q5oncd
  3804. own["Q6oncd"] = q6oncd
  3805. own["Q7oncd"] = q7oncd
  3806. #360 fs shovit
  3807. if q3oncd > 0 and q4oncd > 0 and q5oncd > 0 and q6oncd >= 0 and q7oncd > 0 and q7oncd <= q6oncd <= q5oncd <= q4oncd <= q3oncd:
  3808. # print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  3809. #print ("______-------360 shovit")
  3810. dict['trick_string'] = '360 Frontside Shovit'
  3811. fsshovit360()
  3812. q3oncd = 0
  3813. q4oncd = 0
  3814. q5oncd = 0
  3815. q6oncd = 0
  3816. q7oncd = 0
  3817. own["Q3oncd"] = q3oncd
  3818. own["Q4oncd"] = q4oncd
  3819. own["Q5oncd"] = q5oncd
  3820. own["Q6oncd"] = q6oncd
  3821. own["Q7oncd"] = q7oncd
  3822. #ollie
  3823. if q5oncd > 0 and q1oncd > 0 and q5oncd < q1oncd:
  3824. JUMPSTRENGTH = q1oncd - q5oncd
  3825. #4,7
  3826. if JUMPSTRENGTH <= 4:
  3827. JUMPSTRENGTH = 1.1
  3828. if JUMPSTRENGTH > 4 and JUMPSTRENGTH < 7:
  3829. JUMPSTRENGTH = 1
  3830. if JUMPSTRENGTH >= 7:
  3831. JUMPSTRENGTH = .9
  3832. aollie()
  3833. q1oncd = 0
  3834. q5oncd = 0
  3835. own["Q1oncd"] = q1oncd
  3836. own["Q5oncd"] = q5oncd
  3837. #nollie
  3838. if q5oncd > 0 and q1oncd > 0 and q5oncd > q1oncd:
  3839. JUMPSTRENGTH = q5oncd - q1oncd
  3840. #4,7
  3841. if JUMPSTRENGTH <= 4:
  3842. JUMPSTRENGTH = 1.1
  3843. if JUMPSTRENGTH > 4 and JUMPSTRENGTH < 7:
  3844. JUMPSTRENGTH = 1
  3845. if JUMPSTRENGTH >= 7:
  3846. JUMPSTRENGTH = .9
  3847. nollie()
  3848. q1oncd = 0
  3849. q5oncd = 0
  3850. own["Q1oncd"] = q1oncd
  3851. own["Q5oncd"] = q5oncd
  3852. print("nollie")
  3853. #kickflip
  3854. if q5oncd > 0 and q8oncd > 0 and q5oncd < q8oncd and q3oncd < 1:
  3855. kickflip()
  3856. q8oncd = 0
  3857. q5oncd = 0
  3858. own["Q8oncd"] = q8oncd
  3859. own["Q5oncd"] = q5oncd
  3860. #nollie kickflip
  3861. if q1oncd > 0 and q6oncd > 0 and q1oncd < q6oncd:
  3862. nollie_kickflip()
  3863. q6oncd = 0
  3864. q1oncd = 0
  3865. own["Q6oncd"] = q6oncd
  3866. own["Q1oncd"] = q1oncd
  3867. #heelflip
  3868. if q5oncd > 0 and q2oncd > 0 and q5oncd < q2oncd:
  3869. heelflip()
  3870. q2oncd = 0
  3871. q5oncd = 0
  3872. own["Q2oncd"] = q2oncd
  3873. own["Q5oncd"] = q5oncd
  3874. #nollie_heelflip
  3875. if q1oncd > 0 and q4oncd > 0 and q1oncd < q4oncd:
  3876. nollie_heelflip()
  3877. q1oncd = 0
  3878. q4oncd = 0
  3879. own["Q1oncd"] = q1oncd
  3880. own["Q4oncd"] = q4oncd
  3881. #shovit
  3882. if q4oncd > 0 and q5oncd > 0 and q6oncd > 0 and q4oncd <= q5oncd <= q6oncd and q3oncd < 1:
  3883. shovit()
  3884. q4oncd = 0
  3885. q5oncd = 0
  3886. q6oncd = 0
  3887. own["Q4oncd"] = q4oncd
  3888. own["Q5oncd"] = q5oncd
  3889. own["Q6oncd"] = q6oncd
  3890. #nollie_shovit
  3891. if q2oncd > 0 and q1oncd > 0 and q8oncd > 0 and q2oncd <= q1oncd <= q8oncd and q3oncd == 0:
  3892. nollie_shovit()
  3893. print('nollie shuvit')
  3894. #nollie_fsshovit()
  3895. q2oncd = 0
  3896. q1oncd = 0
  3897. q8oncd = 0
  3898. own["Q2oncd"] = q2oncd
  3899. own["Q1oncd"] = q1oncd
  3900. own["Q8oncd"] = q8oncd
  3901. #fsshovit
  3902. if q4oncd > 0 and q5oncd > 0 and q6oncd > 0 and q6oncd <= q5oncd <= q4oncd and q7oncd < 1:
  3903. # print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  3904. # print ("^%*^%*^%*^%fsshovit")
  3905. fsshovit()
  3906. q4oncd = 0
  3907. q5oncd = 0
  3908. q6oncd = 0
  3909. own["Q4oncd"] = q4oncd
  3910. own["Q5oncd"] = q5oncd
  3911. own["Q6oncd"] = q6oncd
  3912. #nollie_fsshovit
  3913. if q8oncd > 0 and q1oncd > 0 and q2oncd > 0 and q8oncd <= q1oncd <= q2oncd and q7oncd == 0:
  3914. # print("q4oncd: ", q4oncd, " q5oncd: ", q5oncd, " q6oncd: ", q6oncd)
  3915. print ("nollie fsshovit")
  3916. nollie_fsshovit()
  3917. #nollie_shovit()
  3918. q8oncd = 0
  3919. q1oncd = 0
  3920. q2oncd = 0
  3921. own["Q8oncd"] = q4oncd
  3922. own["Q1oncd"] = q5oncd
  3923. own["Q2oncd"] = q6oncd
  3924. #360 shovit
  3925. # 360 shovit
  3926. # 3 > 4 > 5 >6 > 7
  3927. # fs 360 shovit
  3928. # 7 > 6 > 5 > 4 > 3
  3929. def hippy_jump():
  3930. STANCE = own["stance"]
  3931. if own['hippy'] == 1 and own['last_hippy'] == 0:
  3932. if STANCE == 0:
  3933. skater.playAction("reg_hippy", 1,10, layer=1101, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3934. if STANCE == 1:
  3935. skater.playAction("fak_hippy", 1,10, layer=1101, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3936. if own['hippy'] == 1 and own['last_hippy'] == 1:
  3937. if STANCE == 0:
  3938. skater.playAction("reg_hippy", 10,10, layer=1100, priority=0, layer_weight=0, play_mode=1, speed=.5)
  3939. if STANCE == 1:
  3940. skater.playAction("fak_hippy", 10,10, layer=1100, priority=0, layer_weight=0, play_mode=1, speed=.5)
  3941. if own['hippy'] == 0 and own['last_hippy'] == 1:
  3942. killact(1100)
  3943. if rLR > turnsens:
  3944. local = True
  3945. rot = [ 0.0, 0.0, 3.14]
  3946. own.applyRotation(rot,local)
  3947. print("hippy turn")
  3948. if STANCE == 0:
  3949. skater.playAction("reg_hippy_ncw", 10,40, layer=1102, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3950. print('%hip1')
  3951. if STANCE == 1:
  3952. skater.playAction("fak_hippy_ncw", 10,40, layer=1102, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3953. print('%hip2')
  3954. elif rLR < -turnsens:
  3955. local = True
  3956. rot = [ 0.0, 0.0, -3.14]
  3957. own.applyRotation(rot,local)
  3958. print("hippy turn neg")
  3959. if STANCE == 0:
  3960. skater.playAction("fak_hippy_nccw", 10,40, layer=1102, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3961. print('%hip3')
  3962. if STANCE == 1:
  3963. skater.playAction("reg_hippy_nccw", 10,40, layer=1102, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3964. print('%hip4')
  3965. ##straight
  3966. else:
  3967. if STANCE == 0:
  3968. skater.playAction("reg_hippy", 10,40, layer=1102, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3969. if STANCE == 1:
  3970. skater.playAction("fak_hippy", 10,40, layer=1102, priority=1, layer_weight=0, play_mode=0, speed=.5)
  3971. #pushing and hippy jumps
  3972. since_a = frame - lastaf
  3973. since_x = frame - lastxf
  3974. cush = 10
  3975. hippy = 0
  3976. own['hippy'] = 0
  3977. #print(since_a, "a", since_x, "x")
  3978. #if xBut == 1 and aBut == 1 and since_a <= cush and since_x <= cush and (lTrig < 0.02 and rTrig < 0.02):
  3979. if xBut == 1 and aBut == 1 and (lTrig < 0.02 and rTrig < 0.02) and r_ground.triggered == True:
  3980. #F"hippy")
  3981. hippy = 1
  3982. own['hippy'] = 1
  3983. #hippy_jump()
  3984. #print(hippy)
  3985. hippy_jump()
  3986. if since_a > cush and aBut == 1 and lasta == 1 and (lTrig < 0.02 and rTrig < 0.02) and own['last_hippy'] == 0:
  3987. #print("apush suckka", since_a)
  3988. if xBut == 0 and hippy == 0 and lastaBut_ground == True:
  3989. push()
  3990. if since_x > cush and xBut == 1 and lastx == 1 and (lTrig < 0.02 and rTrig < 0.02) and own['last_hippy'] == 0:
  3991. #print("push suckka", since_x)
  3992. if aBut == 0 and hippy == 0 and lastxBut_ground == True:
  3993. push_goof()
  3994. #cavemans
  3995. if LAST_GRIND == False and grindHit == False and r_ground.triggered:
  3996. if (aBut ==0 and own['lastaBut_ground'] == 1) and lTrig > 0.02:
  3997. brfoot()
  3998. if (aBut ==0 and own['lastaBut_ground'] == 1) and rTrig > 0.02:
  3999. frfoot()
  4000. if (xBut ==0 and own['lastxBut_ground'] == 1) and lTrig > 0.02:
  4001. blfoot()
  4002. if (xBut ==0 and own['lastxBut_ground'] == 1) and rTrig > 0.02:
  4003. flfoot()
  4004. #push b button
  4005. if (bBut == 0 and own["lastStop"] == True) or (bBut == 1 and own["lastStop"] == False):
  4006. skater.stopAction(7)
  4007. skater.stopAction(1)
  4008. killact(18)
  4009. killact(19)
  4010. if bBut == 0 and own["lastStop"] == True:
  4011. if STANCE == True:
  4012. skater.playAction("fak_stopin", 15,1, layer=6, priority=3, blendin=10, play_mode=0, speed=.5)
  4013. elif STANCE == False:
  4014. skater.playAction("reg_stopin", 15,1, layer=7, priority=3, blendin=10, play_mode=0, speed=.5)
  4015. if bBut == 1:
  4016. #print("push suckka")
  4017. if linVelocity.x > .05 or linVelocity.x < -.05:
  4018. stop()
  4019. elif linVelocity.x < .05 or linVelocity.x > -.05:
  4020. if own["lastStop"] == True:
  4021. if STANCE == True:
  4022. skater.playAction("fak_stopin", 15,1, layer=8, priority=3, blendin=10, play_mode=0, speed=.5)
  4023. elif STANCE == False:
  4024. skater.playAction("reg_stopin", 15,1, layer=9, priority=3, blendin=10, play_mode=0, speed=.5)
  4025. own["lastStop"] = False
  4026. elif bBut ==0:
  4027. own["lastStop"] = False
  4028. ##### falls
  4029. #space = own.sensors['space']
  4030. #if space.triggered:
  4031. # own['fall'] = 1
  4032. #else:
  4033. # own['fall'] = 0
  4034. if own['fall'] == 1:
  4035. offboard()
  4036. own['getoffboard'] = True
  4037. ####
  4038. #y button
  4039. if own['lasty'] == 1 and yBut ==0:
  4040. offboard()
  4041. if own["GRAB_ON"] == True:
  4042. playing = skater.isPlayingAction(fliplay)
  4043. if playing == 1:
  4044. frame = skater.getActionFrame(fliplay)
  4045. #print("Flipping frame: ", frame)
  4046. if frame > 16:
  4047. skater.stopAction(fliplay)
  4048. #frontside grab
  4049. flipping = skater.isPlayingAction(fliplay)
  4050. #if rTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 0:
  4051. if rTrig > 0.02 and r_ground.triggered == 0 and flipping == False:
  4052. GRAB_ON = True
  4053. own["GRAB_ON"] = GRAB_ON
  4054. #print(rTrig, GRAB_ON)
  4055. if STANCE == False and rUD >= -.07 and rUD <= .07:
  4056. frontside_grab_on()
  4057. elif STANCE == True and rUD >= -.07 and rUD <= .07:
  4058. fakbackside_grab_on()
  4059. #front_nose
  4060. if STANCE == True and rUD < -0.070:
  4061. fak_backside_nose_grab_on()
  4062. #front_tail
  4063. elif STANCE == True and rUD > 0.07:
  4064. fak_backside_tail_grab_on()
  4065. #
  4066. if STANCE == False and rUD < -0.070:
  4067. frontside_nose_grab_on()
  4068. #front_tail
  4069. elif STANCE == False and rUD > 0.07:
  4070. frontside_tail_grab_on()
  4071. #if rTrig <= 0.02 and GRAB_ON == True and lTrig >= -.02:
  4072. # GRAB_ON = False
  4073. # own["GRAB_ON"] = GRAB_ON
  4074. # GRAB_PLAYED = False
  4075. # own["GRAB_PLAYED"] = GRAB_PLAYED
  4076. if rTrig <= 0.02 and GRAB_ON == True:
  4077. killact(400)
  4078. killact(401)
  4079. #killact(403)
  4080. killact(404)
  4081. killact(408)
  4082. killact(409)
  4083. killact(410)
  4084. killact(2925)
  4085. #backside grab
  4086. #if lTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 0:
  4087. if lTrig > 0.02 and r_ground.triggered == 0 and flipping == False:
  4088. GRAB_ON = True
  4089. own["GRAB_ON"] = GRAB_ON
  4090. #print(rTrig)
  4091. if STANCE == False and rUD >= -.07 and rUD <= .07:
  4092. backside_grab_on()
  4093. elif STANCE == True and rUD >= -.07 and rUD <= .07:
  4094. fakfrontside_grab_on()
  4095. #front_nose
  4096. if STANCE == True and rUD < -0.070:
  4097. fak_frontside_nose_grab_on()
  4098. #front_tail
  4099. elif STANCE == True and rUD > 0.07:
  4100. fak_frontside_tail_grab_on()
  4101. #front_nose
  4102. if STANCE == False and rUD < -0.070:
  4103. backside_nose_grab_on()
  4104. #front_tail
  4105. elif STANCE == False and rUD > 0.07:
  4106. backside_tail_grab_on()
  4107. #kill grabs
  4108. if lTrig <= 0.02 and GRAB_ON == True and lTrig >= -.02 and rTrig <= .02 and rTrig >= -.2:
  4109. GRAB_ON = False
  4110. own["GRAB_ON"] = GRAB_ON
  4111. GRAB_PLAYED = False
  4112. own["GRAB_PLAYED"] = GRAB_PLAYED
  4113. if lTrig <= 0.02 or r_ground.triggered == 1:
  4114. killact(402)
  4115. killact(403)
  4116. killact(405)
  4117. killact(406)
  4118. killact(407)
  4119. killact(411)
  4120. killact(412)
  4121. #killact(404)
  4122. #if lTrig <= 0.02 or r_ground.triggered == 1:
  4123. # killact(402)
  4124. # killact(403)
  4125. # #killact(405)
  4126. # #killact(406)
  4127. # killact(407)
  4128. # #killact(404)
  4129. #frontside pump #backside pump
  4130. if (rTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1) or (lTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1):
  4131. pump()
  4132. else:
  4133. if own['lastPump'] == True:
  4134. #skater.stopAction(0)
  4135. killact(20)
  4136. killact(21)
  4137. killact(22)
  4138. killact(23)
  4139. # if STANCE == 0:
  4140. # skater.playAction("nreg_pump_in", 20,1, layer=24, priority=8, blendin=10, play_mode=0, speed=1)
  4141. # elif STANCE == 1:
  4142. # skater.playAction("nfak_pump_in", 20,1, layer=25, priority=8, blendin=10, play_mode=0, speed=1)
  4143. own["lastPump"] = False
  4144. own["Pump"] = False
  4145. #print("stop pumping")
  4146. def footplant():
  4147. #a_reg_fp_rback
  4148. framenum = own['framenum']
  4149. last_ground_frame = own['lF_ground_frame']
  4150. lF_air_frame = own['lF_air_frame']
  4151. frames_since_ground = framenum - lF_air_frame
  4152. frames_since_grind = framenum - own['last_grind_frame']
  4153. #print(frames_since_ground, "fsg")
  4154. if LAST_GRIND == False and grindHit == True and aBut == True and frames_since_ground < 40 and touched:
  4155. #if LAST_GRIND == False and aBut == True and frames_since_ground < 10 and r_ground.triggered == 1:
  4156. #if grindHit == True and aBut == True and frames_since_ground < 20:
  4157. own.setLinearVelocity([0,0,0],0)
  4158. killall()
  4159. if STANCE == 0:
  4160. skater.playAction("reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4161. deck.playAction("a_reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4162. trucks.playAction("a_reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4163. skater.playAction("reg_fp_rback", 1,10, layer=2928, priority=8, play_mode=0, speed=1)
  4164. deck.playAction("a_reg_fp_rback", 1,10, layer=2928, priority=8, play_mode=0, speed=1)
  4165. trucks.playAction("a_reg_fp_rback", 1,10, layer=2928, priority=8, play_mode=0, speed=1)
  4166. if STANCE == 1:
  4167. skater.playAction("fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4168. deck.playAction("a_fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4169. trucks.playAction("a_fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4170. skater.playAction("fak_fp_rback", 1,10, layer=2928, priority=8, play_mode=0, speed=1)
  4171. deck.playAction("a_fak_fp_rback", 1,10, layer=2928, priority=8, play_mode=0, speed=1)
  4172. trucks.playAction("a_fak_fp_rback", 1,10, layer=2928, priority=8, play_mode=0, speed=1)
  4173. own['footplant_on'] = 1
  4174. if grindHit == False:
  4175. own['footplant_on'] = 0
  4176. if own['footplant_on'] == True and rUD < turnsens and rUD > -turnsens:
  4177. own.setLinearVelocity([0,0,0],0)
  4178. if own['footplant_on'] == 1 and own['last_footplant'] == True:
  4179. if skater.isPlayingAction(2925) == False:
  4180. if STANCE == 0:
  4181. skater.playAction("reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4182. deck.playAction("a_reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4183. trucks.playAction("a_reg_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4184. if STANCE == 1:
  4185. skater.playAction("fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4186. deck.playAction("a_fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4187. trucks.playAction("a_fak_fp_rback", 10,10, layer=2925, priority=8, play_mode=1, speed=.5)
  4188. if own['last_footplant'] == True and own['footplant_on'] == 0:
  4189. killall()
  4190. if STANCE == 0:
  4191. skater.playAction("reg_fp_rback", 10,20, layer=2928, priority=8, play_mode=0, speed=1)
  4192. deck.playAction("a_reg_fp_rback", 10,20, layer=2928, priority=8, play_mode=0, speed=1)
  4193. trucks.playAction("a_reg_fp_rback", 10,20, layer=2928, priority=8, play_mode=0, speed=1)
  4194. if STANCE == 1:
  4195. skater.playAction("fak_fp_rback", 10,20, layer=2928, priority=8, play_mode=0, speed=1)
  4196. deck.playAction("a_fak_fp_rback", 10,20, layer=2928, priority=8, play_mode=0, speed=1)
  4197. trucks.playAction("a_fak_fp_rback", 10,20, layer=2928, priority=8, play_mode=0, speed=1)
  4198. def invert():
  4199. if LAST_GRIND == False and grindHit == True and own['grindpos'] == 'reg_board':
  4200. if lBump == 1:
  4201. #print("invert")
  4202. #if coping_on ==1 and lBump == 1:
  4203. print("IIIIIINVVERT")
  4204. own['invert_on'] = 1
  4205. own.setLinearVelocity([0,0,0],0)
  4206. if own["coping"] == 1 and invert_on == 1:
  4207. killact(25)
  4208. killact(24)
  4209. # if STANCE == False:
  4210. # skater.playAction("reg_back_invert", 0,0, layer=300, play_mode=0, speed=.5)
  4211. # deck.playAction("a_reg_back_invert", 0,0, layer=301, play_mode=0, speed=.5)
  4212. # trucks.playAction("a_reg_back_invert", 0,0, layer=302, play_mode=0, speed=.5)
  4213. # if STANCE == True:
  4214. # skater.playAction("fak_back_invert", 0,0, layer=300, play_mode=0, speed=.5)
  4215. # deck.playAction("a_fak_back_invert", 0,0, layer=301, play_mode=0, speed=.5)
  4216. # trucks.playAction("a_fak_back_invert", 0,0, layer=302, play_mode=0, speed=.5)
  4217. if own['invert_on'] == 1 and own['last_invert'] == False:
  4218. killall()
  4219. cont.activate(own.actuators['invertOn_sound'])
  4220. if STANCE == False:
  4221. own['invert_type'] = "reg_back_invert_in"
  4222. skater.playAction("reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1)
  4223. deck.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1)
  4224. trucks.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1)
  4225. if STANCE == True:
  4226. own['invert_type'] = "fak_fr_invert"
  4227. skater.playAction("fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)
  4228. deck.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)
  4229. trucks.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)
  4230. if invert_on == 0 and own['last_invert'] == True:
  4231. #print("kill invert")
  4232. own['last_invert_frame'] = frame
  4233. cont.activate(own.actuators['invertOff_Sound'])
  4234. killact(300)
  4235. killact(301)
  4236. killact(302)
  4237. killact(303)
  4238. killact(304)
  4239. killact(305)
  4240. killact(700)
  4241. killact(700)
  4242. killact(700)
  4243. killact(290)
  4244. killact(291)
  4245. killact(292)
  4246. if own['invert_type'] == "reg_back_invert_in":
  4247. skater.playAction("reg_back_invert_in", 20,0, layer=306, play_mode=0, speed=1)
  4248. deck.playAction("a_reg_back_invert_in", 20,0, layer=306, play_mode=0, speed=1)
  4249. trucks.playAction("a_reg_back_invert_in", 20,0, layer=306, play_mode=0, speed=1)
  4250. if own['invert_type'] == "fak_fr_invert":
  4251. skater.playAction("fak_fr_invert", 20,0, layer=306, play_mode=0, speed=1)
  4252. deck.playAction("a_fak_fr_invert", 20,0, layer=306, play_mode=0, speed=1)
  4253. trucks.playAction("a_fak_fr_invert", 20,0, layer=306, play_mode=0, speed=1)
  4254. if invert_on == 1:
  4255. if own['invert_type'] == "reg_back_invert_in":
  4256. skater.playAction("reg_back_invert_in", 30,30, layer=290, play_mode=1, speed=1)
  4257. deck.playAction("a_reg_back_invert_in", 30,30, layer=290, play_mode=1, speed=1)
  4258. trucks.playAction("a_reg_back_invert_in", 30,30, layer=290, play_mode=1, speed=1)
  4259. if own['invert_type'] == "fak_fr_invert":
  4260. skater.playAction("fak_fr_invert", 30,30, layer=290, play_mode=1, speed=1)
  4261. deck.playAction("a_fak_fr_invert", 30,30, layer=290, play_mode=1, speed=1)
  4262. trucks.playAction("a_fak_fr_invert", 30,30, layer=290, play_mode=1, speed=1)
  4263. lif = own['last_invert_frame']
  4264. if frame - lif > 3 and invert_on == 0:
  4265. own['invert_type'] = None
  4266. invert()
  4267. footplant()
  4268. #else:
  4269. #own['invert_on'] = 0
  4270. if own['invert_on'] == 0:
  4271. killact(900)
  4272. #killact(901)
  4273. #killact(902)
  4274. #print("l: ", lBump)
  4275. def reset_pos():
  4276. #reset
  4277. if ddPad == 1:
  4278. spawn_pos = own['spawn_pos']
  4279. spawn_rot = own['spawn_rot']
  4280. try:
  4281. own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
  4282. 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]]
  4283. except:
  4284. own.worldPosition = (0, 0, .1)
  4285. own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
  4286. if own["spawn_stance"] == 1:
  4287. own.setLinearVelocity([.1,0,0], 1)
  4288. #cam.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .25))
  4289. #cam.applyMovement([0,-1,0], True)
  4290. #lx = cam.localPosition[1]
  4291. #lx = lx - 4
  4292. #cam.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]]
  4293. #cam.localPosition[1] = lx
  4294. else:
  4295. own.setLinearVelocity([-.1,0,0], 1)
  4296. #cam.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .25))
  4297. #cam.applyMovement([0,1,0], True)
  4298. #lx = cam.localPosition[1]
  4299. #lx = lx - 4
  4300. #cam.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]]
  4301. #cam.localPosition[1] = lx
  4302. if udPad == 1:
  4303. own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]]
  4304. 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]]
  4305. stance = own["stance"]
  4306. own["spawn_stance"] = stance
  4307. #start button
  4308. if stBut == True:
  4309. own.actuators["sroll"].volume = .0001
  4310. cont.deactivate(own.actuators["sroll"])
  4311. own.actuators["sroll"].stopSound()
  4312. # print("Start")
  4313. # if own["gamepaused"] == False:
  4314. # cont.activate(own.actuators["pause"])
  4315. # own["gamepaused"] == True
  4316. # if own["gamepaused"] == True:
  4317. # cont.activate(own.actuators["resume"])
  4318. # own["gamepaused"] == False
  4319. def ylimit():
  4320. #if r_ground.triggered and touched == False and grindDar == 0:
  4321. lgf = own['last_grind_frame']
  4322. frame = own['framenum']
  4323. frames_since_grinding = frame - lgf
  4324. if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:
  4325. linVelocity4 = own.getLinearVelocity(True)
  4326. newy = linVelocity4.y * .8 #.4
  4327. force = [linVelocity4.x, newy, linVelocity4.z]
  4328. own.setLinearVelocity(force, True)
  4329. #print("limitting y")
  4330. # own["linVely"] = linVelocity.y
  4331. def getoffboard():
  4332. lasty = own['lasty']
  4333. getoffboard = own['getoffboard']
  4334. if getoffboard == 1 and own['fall'] == False:
  4335. own['getoffboard'] = 0
  4336. if yBut == False and lasty == True:
  4337. own['getoffboard'] = 1
  4338. def switchcam():
  4339. pass
  4340. # if ltsBut == False and own['lastlts'] == True and rtsBut == False:
  4341. # if own['camera'] == 1:
  4342. # own['camera'] = 0
  4343. # else:
  4344. # own['camera'] = 1
  4345. # if rtsBut == False and own['lastrts'] == True and ltsBut == False:
  4346. # if own['camera'] == 2:
  4347. # own['camera'] = 0
  4348. # else:
  4349. # own['camera'] = 2
  4350. #followcam
  4351. def move_followcam():
  4352. if own['camera'] == 2:
  4353. #if rtsBut == False and own['lastrts'] == True:
  4354. if own['lastbkBut'] == True and bkBut == False:
  4355. #print("activate move followcam")
  4356. if own['move_followcam'] == False:
  4357. own['move_followcam'] = True
  4358. else:
  4359. own['move_followcam'] = False
  4360. if own['move_followcam'] == True:
  4361. #act = followcam.actuators[
  4362. camspeed1 = .015
  4363. camspeed2 = .055
  4364. camrot1 = .005
  4365. camrot2 = .02
  4366. #up
  4367. if lUD < -0.080:
  4368. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  4369. cont.activate(followcam.actuators["up"])
  4370. #print("fastup")
  4371. else:
  4372. cont.deactivate(followcam.actuators["up"])
  4373. # #down
  4374. if lUD > .080:
  4375. followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  4376. cont.activate(followcam.actuators["down"])
  4377. else:
  4378. cont.deactivate(followcam.actuators["down"])
  4379. # #left
  4380. if lLR < -0.080:
  4381. followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  4382. cont.activate(followcam.actuators["left"])
  4383. else:
  4384. cont.deactivate(followcam.actuators["left"])
  4385. # #right
  4386. if lLR > 0.080:
  4387. followcam.actuators["right"].dLoc = [camspeed2, 0, 0]
  4388. cont.activate(followcam.actuators["right"])
  4389. else:
  4390. cont.deactivate(followcam.actuators["right"])
  4391. #up
  4392. if rUD < -0.080:
  4393. followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
  4394. cont.activate(followcam.actuators["rotup"])
  4395. #print("uppppppppppppppppppppppppppp")
  4396. else:
  4397. cont.deactivate(followcam.actuators["rotup"])
  4398. # #down
  4399. if rUD > .080:
  4400. followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]
  4401. cont.activate(followcam.actuators["rotdown"])
  4402. else:
  4403. cont.deactivate(followcam.actuators["rotdown"])
  4404. # #left
  4405. if rLR < -0.080:
  4406. followcam.actuators["rotleft"].dRot = [0, 0, camrot2]
  4407. cont.activate(followcam.actuators["rotleft"])
  4408. else:
  4409. cont.deactivate(followcam.actuators["rotleft"])
  4410. # #right
  4411. if rLR > 0.080:
  4412. followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
  4413. cont.activate(followcam.actuators["rotright"])
  4414. else:
  4415. cont.deactivate(followcam.actuators["rotright"])
  4416. #*********************************************
  4417. if lUD > -0.080 and lUD < -0.030:
  4418. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  4419. cont.activate(followcam.actuators["up"])
  4420. #print(lUD)
  4421. else:
  4422. cont.deactivate(followcam.actuators["up"])
  4423. # #down
  4424. if lUD < .080 and lUD > .03:
  4425. followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  4426. cont.activate(followcam.actuators["down"])
  4427. else:
  4428. cont.deactivate(followcam.actuators["down"])
  4429. # #left
  4430. if lLR > -0.080 and lLR < -0.030:
  4431. followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  4432. cont.activate(followcam.actuators["left"])
  4433. else:
  4434. cont.deactivate(followcam.actuators["left"])
  4435. # #right
  4436. if lLR < .080 and lLR > .03:
  4437. followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
  4438. cont.activate(followcam.actuators["right"])
  4439. else:
  4440. cont.deactivate(followcam.actuators["right"])
  4441. #up
  4442. if rUD > -0.080 and rUD < -0.030:
  4443. followcam.actuators["rotup"].dRot = [camrot1, 0, 0]
  4444. cont.activate(followcam.actuators["rotup"])
  4445. else:
  4446. cont.deactivate(followcam.actuators["rotup"])
  4447. # #down
  4448. if rUD < .080 and rUD > .03:
  4449. followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  4450. cont.activate(followcam.actuators["rotdown"])
  4451. else:
  4452. cont.deactivate(followcam.actuators["rotdown"])
  4453. # #left
  4454. if rLR > -0.080 and rLR < -0.030:
  4455. followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
  4456. cont.activate(followcam.actuators["rotleft"])
  4457. else:
  4458. cont.deactivate(followcam.actuators["rotleft"])
  4459. # #right
  4460. if rLR < .080 and rLR > .03:
  4461. followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
  4462. cont.activate(followcam.actuators["rotright"])
  4463. else:
  4464. cont.deactivate(followcam.actuators["rotright"])
  4465. def move_flycam():
  4466. if own['camera'] == 1:
  4467. #if rtsBut == False and own['lastrts'] == True:
  4468. if own['lastbkBut'] == True and bkBut == False:
  4469. if own['move_freecam'] == False:
  4470. own['move_freecam'] = True
  4471. else:
  4472. own['move_freecam'] = False
  4473. if own['move_freecam'] == True:
  4474. #act = freecam.actuators[
  4475. camspeed1 = .015
  4476. camspeed2 = .055
  4477. camrot1 = .005
  4478. camrot2 = .02
  4479. #up
  4480. if lUD < -0.080:
  4481. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  4482. cont.activate(freecam.actuators["up"])
  4483. #print("fastup")
  4484. else:
  4485. cont.deactivate(freecam.actuators["up"])
  4486. # #down
  4487. if lUD > .080:
  4488. freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  4489. cont.activate(freecam.actuators["down"])
  4490. else:
  4491. cont.deactivate(freecam.actuators["down"])
  4492. # #left
  4493. if lLR < -0.080:
  4494. freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  4495. cont.activate(freecam.actuators["left"])
  4496. else:
  4497. cont.deactivate(freecam.actuators["left"])
  4498. # #right
  4499. if lLR > 0.080:
  4500. freecam.actuators["right"].dLoc = [camspeed2, 0, 0]
  4501. cont.activate(freecam.actuators["right"])
  4502. else:
  4503. cont.deactivate(freecam.actuators["right"])
  4504. #up
  4505. if rUD < -0.080:
  4506. freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
  4507. cont.activate(freecam.actuators["rotup"])
  4508. else:
  4509. cont.deactivate(freecam.actuators["rotup"])
  4510. # #down
  4511. if rUD > .080:
  4512. freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]
  4513. cont.activate(freecam.actuators["rotdown"])
  4514. else:
  4515. cont.deactivate(freecam.actuators["rotdown"])
  4516. # #left
  4517. if rLR < -0.080:
  4518. freecam.actuators["rotleft"].dRot = [0, 0, camrot2]
  4519. cont.activate(freecam.actuators["rotleft"])
  4520. else:
  4521. cont.deactivate(freecam.actuators["rotleft"])
  4522. # #right
  4523. if rLR > 0.080:
  4524. freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
  4525. cont.activate(freecam.actuators["rotright"])
  4526. else:
  4527. cont.deactivate(freecam.actuators["rotright"])
  4528. #*********************************************
  4529. if lUD > -0.080 and lUD < -0.030:
  4530. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  4531. cont.activate(freecam.actuators["up"])
  4532. #print(lUD)
  4533. else:
  4534. cont.deactivate(freecam.actuators["up"])
  4535. # #down
  4536. if lUD < .080 and lUD > .03:
  4537. freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  4538. cont.activate(freecam.actuators["down"])
  4539. else:
  4540. cont.deactivate(freecam.actuators["down"])
  4541. # #left
  4542. if lLR > -0.080 and lLR < -0.030:
  4543. freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  4544. cont.activate(freecam.actuators["left"])
  4545. else:
  4546. cont.deactivate(freecam.actuators["left"])
  4547. # #right
  4548. if lLR < .080 and lLR > .03:
  4549. freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
  4550. cont.activate(freecam.actuators["right"])
  4551. else:
  4552. cont.deactivate(freecam.actuators["right"])
  4553. #up
  4554. if rUD > -0.080 and rUD < -0.030:
  4555. freecam.actuators["rotup"].dRot = [camrot1, 0, 0]
  4556. cont.activate(freecam.actuators["rotup"])
  4557. else:
  4558. cont.deactivate(freecam.actuators["rotup"])
  4559. # #down
  4560. if rUD < .080 and rUD > .03:
  4561. freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  4562. cont.activate(freecam.actuators["rotdown"])
  4563. else:
  4564. cont.deactivate(freecam.actuators["rotdown"])
  4565. # #left
  4566. if rLR > -0.080 and rLR < -0.030:
  4567. freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
  4568. cont.activate(freecam.actuators["rotleft"])
  4569. else:
  4570. cont.deactivate(freecam.actuators["rotleft"])
  4571. # #right
  4572. if rLR < .080 and rLR > .03:
  4573. freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
  4574. cont.activate(freecam.actuators["rotright"])
  4575. else:
  4576. cont.deactivate(freecam.actuators["rotright"])
  4577. if r_ground.triggered == False:
  4578. own["lF_air_frame"] = own["framenum"]
  4579. if r_ground.triggered == True:
  4580. own["lF_ground_frame"] = own["framenum"]
  4581. if own['LAST_GRIND'] == True:
  4582. own['last_grind_frame'] = own['framenum']
  4583. if own['LAST_GRIND'] == False and r_ground.triggered and own['jump_timer'] == 0:
  4584. if own['jump_stance'] != 3:
  4585. own['jump_stance'] = 3
  4586. def control_calib():
  4587. #controller calibration test
  4588. scenes = bge.logic.getSceneList()
  4589. controller_calib = [scene for scene in scenes if scene.name=="controller_calib"][0]
  4590. cq1 = controller_calib.objects['q1']
  4591. cq2 = controller_calib.objects['q2']
  4592. cq3 = controller_calib.objects['q3']
  4593. cq4 = controller_calib.objects['q4']
  4594. cq5 = controller_calib.objects['q5']
  4595. cq6 = controller_calib.objects['q6']
  4596. cq7 = controller_calib.objects['q7']
  4597. cq8 = controller_calib.objects['q8']
  4598. if lq1on == 1:
  4599. cq1["q1"] = 1
  4600. else:
  4601. cq1["q1"] = 0
  4602. if lq2on == 1:
  4603. cq2["q2"] = 1
  4604. else:
  4605. cq2["q2"] = 0
  4606. if lq3on == 1:
  4607. cq3["q3"] = 1
  4608. else:
  4609. cq3["q3"] = 0
  4610. if lq4on == 1:
  4611. cq4["q4"] = 1
  4612. else:
  4613. cq4["q4"] = 0
  4614. if lq5on == 1:
  4615. cq5["q5"] = 1
  4616. else:
  4617. cq5["q5"] = 0
  4618. if lq6on == 1:
  4619. cq6["q6"] = 1
  4620. else:
  4621. cq6["q6"] = 0
  4622. if lq7on == 1:
  4623. cq7["q7"] = 1
  4624. else:
  4625. cq7["q7"] = 0
  4626. if lq8on == 1:
  4627. cq8["q8"] = 1
  4628. else:
  4629. cq8["q8"] = 0
  4630. def grind_turn():
  4631. jumping = None
  4632. gotcd = 25
  4633. force = [0,0,0]
  4634. grindHit = own['grindTouch']
  4635. if rUD > turnsens or rLR > turnsens or rUD < -turnsens or rLR < -turnsens:
  4636. jumping = True
  4637. if grindHit == False:
  4638. cont.deactivate(own.actuators['grindoutRight'])
  4639. cont.deactivate(own.actuators['grindoutLeft'])
  4640. if grindHit == True and jumping == None:
  4641. outloc = 0.022
  4642. bsoutloc = .07
  4643. bsoutvel = .1
  4644. outrot = .02 #0.012
  4645. outrot2 = .24
  4646. outact = own.actuators["grindoutRight"]
  4647. if own['grindpos'] == 'reg_5050':
  4648. if lq3on == 1 or lq2on:
  4649. if own['gt_cd2'] == 0:
  4650. own['gt_cd2'] = 60
  4651. if STANCE == True:
  4652. if own['grind_out_type'] == None:
  4653. own['grind_out_type'] = 'fak right'
  4654. #outact.dLoc = [0, -outloc, 0]
  4655. #outact.dRot = [0, 0, -outrot]
  4656. if STANCE == False:
  4657. if own['grind_out_type'] == None:
  4658. own['grind_out_type'] = 'reg right'
  4659. #outact.dLoc = [0, outloc, 0]
  4660. #outact.dRot = [0, 0, -outrot]
  4661. #cont.activate(own.actuators["grindoutRight"])
  4662. own["grindoutturn"] = gotcd
  4663. if lq7on == 1 or lq8on:
  4664. if own['gt_cd2'] == 0:
  4665. own['gt_cd2'] = 60
  4666. if STANCE == True:
  4667. if own['grind_out_type'] == None:
  4668. own['grind_out_type'] = 'fak left'
  4669. #outact.dLoc = [0, outloc, 0]
  4670. #outact.dRot = [0, 0, outrot]
  4671. if STANCE == False:
  4672. if own['grind_out_type'] == None:
  4673. own['grind_out_type'] = 'reg left'
  4674. #outact.dLoc = [0, -outloc, 0]
  4675. #outact.dRot = [0, 0, outrot]
  4676. #cont.activate(own.actuators["grindoutRight"])
  4677. own["grindoutturn"] = gotcd
  4678. if lq4on == 1:
  4679. if own['gt_cd2'] == 0:
  4680. own['gt_cd2'] = 60
  4681. if STANCE == True:
  4682. if own['grind_out_type'] == None:
  4683. own['grind_out_type'] = 'fak fak right'
  4684. #outact.dLoc = [0, -outloc, 0]
  4685. #outact.dRot = [0, 0, outrot2]
  4686. if STANCE == False:
  4687. if own['grind_out_type'] == None:
  4688. own['grind_out_type'] = 'reg fak right'
  4689. #outact.dLoc = [0, outloc, 0]
  4690. #outact.dRot = [0, 0, outrot2]
  4691. #cont.activate(own.actuators["grindoutRight"])
  4692. own["grindoutturn"] = gotcd
  4693. if lq6on == 1:
  4694. if own['gt_cd2'] == 0:
  4695. own['gt_cd2'] = 60
  4696. if STANCE == True:
  4697. if own['grind_out_type'] == None:
  4698. own['grind_out_type'] = 'fak fak left'
  4699. #outact.dLoc = [0, outloc, 0]
  4700. #outact.dRot = [0, 0, -outrot2]
  4701. if STANCE == False:
  4702. if own['grind_out_type'] == None:
  4703. own['grind_out_type'] = 'reg fak left'
  4704. #outact.dLoc = [0, -outloc, 0]
  4705. #outact.dRot = [0, 0, -outrot2]
  4706. #cont.activate(own.actuators["grindoutRight"])
  4707. own["grindoutturn"] = gotcd
  4708. #use stance for 5050 and grindstance for boards
  4709. if own['grindpos'] == 'reg_board':
  4710. outvel = own.getLinearVelocity(1)
  4711. outact.dLoc = [0, 0, 0]
  4712. outact.dRot = [0, 0, 0]
  4713. if lq5on == 1:
  4714. if own['gt_cd2'] == 0:
  4715. own['gt_cd2'] = 60
  4716. if own['grind_stance'] == True:
  4717. #outact.dLoc = [-bsoutloc, 0, 0]
  4718. if own['footplant_on'] == True:
  4719. own.setLinearVelocity([(outvel.x + -bsoutvel), outvel.y, outvel.z], 1)
  4720. cont.activate(own.actuators["grindoutRight"])
  4721. if own['grind_out_type'] == None:
  4722. own['grind_out_type'] = 'bs fak back'
  4723. #force = [-40, 0, 0]
  4724. #own.applyForce(force,1)
  4725. if own['grind_stance'] == False:
  4726. #outact.dLoc = [bsoutloc, 0, 0]
  4727. if own['footplant_on'] == True:
  4728. own.setLinearVelocity([(outvel.x + bsoutvel), outvel.y, outvel.z], 1)
  4729. cont.activate(own.actuators["grindoutRight"])
  4730. if own['grind_out_type'] == None:
  4731. own['grind_out_type'] = 'bs reg back'
  4732. #force = [40, 0, 0]
  4733. #own.applyForce(force,1)
  4734. #cont.activate(own.actuators["grindoutRight"])
  4735. own["grindoutturn"] = gotcd
  4736. own['invert_on'] = 0
  4737. if lq1on == 1:
  4738. if own['gt_cd2'] == 0:
  4739. own['gt_cd2'] = 60
  4740. if own['grind_stance'] == True:
  4741. #outact.dLoc = [bsoutloc, 0, 0]
  4742. #force = [40, 0, 0]
  4743. #own.applyForce(force,1)
  4744. if own['footplant_on'] == True:
  4745. own.setLinearVelocity([(outvel.x + bsoutvel), outvel.y, outvel.z], 1)
  4746. cont.activate(own.actuators["grindoutRight"])
  4747. if own['grind_out_type'] == None:
  4748. own['grind_out_type'] = 'bs fak forward'
  4749. if own['grind_stance'] == False:
  4750. #outact.dLoc = [-bsoutloc, 0, 0]
  4751. #force = [-40, 0, 0]
  4752. #own.applyForce(force,1)
  4753. if own['footplant_on'] == True:
  4754. own.setLinearVelocity([(outvel.x + -bsoutvel), outvel.y, outvel.z], 1)
  4755. cont.activate(own.actuators["grindoutRight"])
  4756. if own['grind_out_type'] == None:
  4757. own['grind_out_type'] = 'bs reg forward'
  4758. own["grindoutturn"] = gotcd
  4759. own['invert_on'] = 0
  4760. if lq1on or lq2on or lq3on or lq4on or lq5on or lq6on or lq7on or lq8on:
  4761. gt_cd = own['gt_cd']
  4762. if gt_cd == 0:
  4763. gt_cd = 30
  4764. own['gt_cd'] = gt_cd
  4765. #else:
  4766. #else:
  4767. if own['grindoutturn'] == 0:
  4768. cont.deactivate(own.actuators["grindoutRight"])
  4769. own["grindoutturn"] = 0
  4770. gt_cd = own['gt_cd']
  4771. if gt_cd > 0:
  4772. own['gt_cd'] = gt_cd - 1
  4773. else:
  4774. own['gt_cd'] = 0
  4775. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  4776. reg_move = .05
  4777. reg_rot = 0.01
  4778. reg_rot2 = .26
  4779. reg_move2 = .13
  4780. bsforce = 50
  4781. bs_dloc = .03
  4782. outvel = own.linearVelocity
  4783. if own['gt_cd2'] > 50:
  4784. if own['grind_out_type'] == 'reg right':
  4785. #print("do reg right")
  4786. own.applyMovement([0,reg_move,0], True)
  4787. own.applyRotation([0,0,reg_rot],True)
  4788. if own['grind_out_type'] == 'fak right':
  4789. own.applyMovement([0,-reg_move,0], True)
  4790. own.applyRotation([0,0,-reg_rot],True)
  4791. #print("do fak right")
  4792. if own['grind_out_type'] == 'reg left':
  4793. #print("do reg left")
  4794. own.applyMovement([0,-reg_move,0], True)
  4795. own.applyRotation([0,0,reg_rot],True)
  4796. if own['grind_out_type'] == 'fak left':
  4797. own.applyMovement([0,reg_move,0], True)
  4798. own.applyRotation([0,0,-reg_rot],True)
  4799. #print("do fak left")
  4800. if own['grind_out_type'] == 'reg fak right':
  4801. if own['gt_cd2'] > 55:
  4802. own.applyMovement([0,reg_move2,0], True)
  4803. own.applyRotation([0,0,reg_rot2],True)
  4804. #print("do reg fak right")
  4805. if own['grind_out_type'] == 'fak fak right':
  4806. if own['gt_cd2'] > 55:
  4807. own.applyMovement([0,-reg_move2,0], True)
  4808. own.applyRotation([0,0,reg_rot2],True)
  4809. #print("do fak fak right")
  4810. if own['grind_out_type'] == 'reg fak left':
  4811. if own['gt_cd2'] > 55:
  4812. own.applyMovement([0,-reg_move2,0], True)
  4813. own.applyRotation([0,0,-reg_rot2],True)
  4814. #print("do reg fak left")
  4815. if own['grind_out_type'] == 'fak fak left':
  4816. if own['gt_cd2'] > 55:
  4817. own.applyMovement([0,reg_move2,0], True)
  4818. own.applyRotation([0,0,-reg_rot2],True)
  4819. #print("do fak fak left")
  4820. 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':
  4821. own.setLinearVelocity([outvel.x * 1.01, outvel.y, outvel.z], True)
  4822. 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':
  4823. if own['gt_cd2'] == 51:
  4824. #print('outforce')
  4825. if STANCE == 0:
  4826. own.applyForce([-200, 0, 0], True)
  4827. if STANCE == 1:
  4828. own.applyForce([200, 0, 0], True)
  4829. if own['grind_out_type'] == 'bs reg back' or own['grind_out_type'] == 'bs fak forward':
  4830. if own['gt_cd2'] > 50:
  4831. if STANCE == True:
  4832. own.applyForce([bsforce, 0, 0], True)
  4833. if STANCE == False:
  4834. own.applyForce([bsforce, 0, 0], True)
  4835. own.applyMovement([bs_dloc,0,0], True)
  4836. if own['grind_out_type'] == 'bs fak back' or own['grind_out_type'] == 'bs reg forward':
  4837. if own['gt_cd2'] > 50:
  4838. if STANCE == True:
  4839. own.applyForce([-bsforce, 0, 0], True)
  4840. if STANCE == False:
  4841. own.applyForce([-bsforce, 0, 0], True)
  4842. own.applyMovement([-bs_dloc,0,0], True)
  4843. #print("setting linvel", own.linearVelocity, outvel)
  4844. if own['gt_cd2'] > 0:
  4845. own['gt_cd2'] -= 1
  4846. if own['gt_cd2'] == 0:
  4847. own['grind_out_type'] = None
  4848. #print(own['grind_out_type'])
  4849. #print(own["gt_cd"])
  4850. if own["grindoutturn"] > 0:
  4851. own["grindoutturn"] = own["grindoutturn"] - 1
  4852. def air_height():
  4853. height = own["air_height"]
  4854. if lf_ground == True and r_ground.triggered == False:
  4855. height = 0
  4856. #if
  4857. #wallride
  4858. def wallride():
  4859. wallride_off = own['wallride_off']
  4860. distance = own.getDistanceTo(gray.hitPosition)
  4861. upforce = 25
  4862. sideforce = 15
  4863. #distance = own["air_height"]
  4864. try:
  4865. obj = gray.hitObject
  4866. objpos = obj.worldPosition
  4867. ownpos = own.worldPosition
  4868. distance = ownpos.z - objpos.z
  4869. #print(distance)
  4870. except:
  4871. pass
  4872. if wallrideL.triggered and wallride_off == 0 and r_ground.triggered == False:
  4873. #print("wallrideL", distance)
  4874. own['jump_timer'] = 0
  4875. if r_ground.triggered == False:
  4876. own["wallride"] = "L"
  4877. #print(own["wallride"])
  4878. cont.activate(wallrideconstL)
  4879. force = [0,sideforce,upforce]
  4880. own.applyForce(force,1)
  4881. #own.alignAxisToVect(obj.worldPosition, 1, .9)
  4882. #align
  4883. if STANCE == 0:
  4884. skater.playAction("reg_wall_r", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4885. else:
  4886. skater.playAction("fak_wall_l", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4887. deck.playAction("a_reg_wall_r", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4888. trucks.playAction("a_reg_wall_r", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4889. else:
  4890. if own["wallride"] != "R":
  4891. own["wallride"] = None
  4892. cont.deactivate(wallrideconstL)
  4893. killact(3000)
  4894. killact(3001)
  4895. killact(3002)
  4896. if wallrideR.triggered and wallride_off == 0:
  4897. own['jump_timer'] = 0
  4898. #print("wallrideR", distance)
  4899. if r_ground.triggered == False:
  4900. own["wallride"] = "R"
  4901. cont.activate(wallrideconstR)
  4902. force = [0,-sideforce,upforce]
  4903. own.applyForce(force,1)
  4904. #own.alignAxisToVect(obj.worldPosition, 1, .9)
  4905. if STANCE == 0:
  4906. skater.playAction("reg_wall_l", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4907. else:
  4908. skater.playAction("fak_wall_r", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4909. deck.playAction("a_reg_wall_l2", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4910. trucks.playAction("a_reg_wall_l2", 10,10, layer=3000, priority=8, play_mode=1, speed=.5)
  4911. else:
  4912. if own["wallride"] != "L":
  4913. own["wallride"] = None
  4914. cont.deactivate(wallrideconstR)
  4915. killact(3003)
  4916. killact(3004)
  4917. killact(3005)
  4918. # if wallride_col.triggered == True:
  4919. # print("wallride")
  4920. # wallobj = wallride_col.hitObject
  4921. # print(wallobj)
  4922. # xyz = own.worldOrientation.to_euler()
  4923. # rotz = math.degrees(xyz[2])
  4924. # xyz2 = wallobj.worldOrientation.to_euler()
  4925. # rotz2 = math.degrees(xyz2[2])
  4926. # print("prot: ", rotz, "wrot: ", rotz2)
  4927. # try:
  4928. # zvect = wallobj.getAxisVect( [0.0, 1.0, 0.0])
  4929. # print(zvect)
  4930. # except: pass
  4931. # rot = rotz - rotz2
  4932. # rotation = rot * -1
  4933. # rotation = [ 0.0, 0, rot]
  4934. #
  4935. # own.applyRotation( rotation, True)
  4936. #vectTo = obj.getVectTo(wallobj)
  4937. # try:
  4938. # if STANCE == 0:
  4939. # own.alignAxisToVect(zvect, 0, .9)
  4940. # if STANCE == 1:
  4941. # own.alignAxisToVect(-zvect, 0, .9)
  4942. # except: pass
  4943. #print(wallride_col.triggered)
  4944. def wallride_sound():
  4945. sact = own.actuators["wallSound"]
  4946. if own["wallride"] != None:
  4947. sact.volume = .2
  4948. cont.activate(own.actuators["wallSound"])
  4949. else:
  4950. sact.volume = .001
  4951. sact.stopSound()
  4952. if own['revert_timer'] > 0:
  4953. own['revert_timer'] = own['revert_timer'] - 1
  4954. def shutoff_timers():
  4955. #print(wallride)
  4956. if (LAST_GRIND == False and grindHit == True) or (jump_timer > 10 and own['wallride'] == None):
  4957. own["Q1oncd"] = 0
  4958. own["Q2oncd"] = 0
  4959. own["Q3oncd"] = 0
  4960. own["Q4oncd"] = 0
  4961. own["Q5oncd"] = 0
  4962. own["Q6oncd"] = 0
  4963. own["Q7oncd"] = 0
  4964. own["Q8oncd"] = 0
  4965. def grindout_cleanup():
  4966. lgf = own['last_grind_frame']
  4967. if (frame - lgf) == 20:
  4968. #print("kill grindout anims")
  4969. killact(200)
  4970. #killact(200)
  4971. #killact(200)
  4972. if skater.isPlayingAction(fliplay):
  4973. #print("flipping")
  4974. killact(700)
  4975. #killact(700)
  4976. #killact(700)
  4977. killact(200)
  4978. #killact(200)
  4979. #Ekillact(200)
  4980. def trans_jump():
  4981. if own['jump_from_trans'] == 1:
  4982. ground_ray = cont.sensors['ground_look']
  4983. #print('align transjump', own['trans_jump_obj'])
  4984. jump_obj = own['trans_jump_obj']
  4985. jump_obj = scene.objects[str(own['trans_jump_obj'])]
  4986. #print(jump_obj)
  4987. worldVect = [1, 0, 0]
  4988. vect = jump_obj.getAxisVect(worldVect)
  4989. go = jump_obj.worldOrientation
  4990. grinder_axis = [0,1,0]
  4991. player_pos = own.worldPosition
  4992. jump_obj = jump_obj.worldPosition
  4993. try:
  4994. delta = player_pos - jump_obj
  4995. except:
  4996. #print("delta broke: ", player_pos, grinder_pos)
  4997. pass
  4998. delta = delta.cross(vect)
  4999. deltamove = delta[1] * .25
  5000. move = [deltamove, 0, 0]
  5001. #print(deltamove)
  5002. if abs(deltamove) < 1 and delta[1] < 1:
  5003. own.applyMovement(move, True)
  5004. #print(deltamove, delta, "delta.......")
  5005. #pos = ground_ray.hitPosition
  5006. #print(pos)
  5007. #linvelloc6 = own.getLinearVelocity(True)
  5008. #xvel6 = linvelloc6.x * .95
  5009. #force = (xvel6, linvelloc6.y, linvelloc6.z)
  5010. #own.setLinearVelocity(force, True)
  5011. #control_calib() #scene must be enabled in main
  5012. jump_Timer()
  5013. check_landing()
  5014. #SWAG()
  5015. #isplaying()
  5016. nextframe()
  5017. wheelroll()
  5018. rollsound()
  5019. reset_pos()
  5020. ylimit()
  5021. getoffboard()
  5022. #switchcam()
  5023. move_flycam()
  5024. move_followcam()
  5025. grind_turn()
  5026. air_height()
  5027. wallride()
  5028. wallride_sound()
  5029. shutoff_timers()
  5030. grindout_cleanup()
  5031. #trans_jump()
  5032. #printplaying()
  5033. #transmult()
  5034. linvelx = own.getLinearVelocity(True)
  5035. #own["LAST_LEFT"] = LAST_LEFT
  5036. #end
  5037. #print(linvelx)
  5038. own["linvelx"] = linvelx.x
  5039. LAST_STANCE = STANCE
  5040. LAST_STANCE = own["stance"]
  5041. own["last_stance"] = STANCE
  5042. own["lastGrab"] = GRAB_ON
  5043. own['ground'] = r_ground.triggered
  5044. own['last_ground'] = r_ground.triggered
  5045. own["LAST_GRIND"] = grindHit
  5046. own["rotz"] = rot.z
  5047. own['walk'] = 0
  5048. own['lasty'] = yBut
  5049. own['lastlts'] = ltsBut
  5050. own['lastrts'] = rtsBut
  5051. own["lF_ground2"] = own["lF_ground"]
  5052. own['last_invert'] = invert_on
  5053. own['lastbkBut'] = bkBut
  5054. own['grab_type'] = grab_type
  5055. own['last_last_manual'] = own['last_manual']
  5056. own['last_manual'] = own['manual']
  5057. own['last_reg_manual'] = own['reg_manual']
  5058. own['last_fak_manual'] = own['fak_manual']
  5059. own['last_fak_nmanual'] = own['fak_nmanual']
  5060. own['last_reg_nmanual'] = own['reg_nmanual']
  5061. if own['manual'] == 1:
  5062. own['last_manual_frame'] = frame
  5063. #print(own['hippy'], own['last_hippy'])
  5064. own['last_hippy'] = own['hippy']
  5065. #last pressed down frame
  5066. if aBut == 1 and own["lasta"] == 0:
  5067. own["lastaf"] = frame
  5068. if xBut == 1 and own["lastx"] == 0:
  5069. own["lastxf"] = frame
  5070. own["lasta"] = aBut
  5071. own["lastx"] = xBut
  5072. own['lastaBut_ground'] = aBut_ground
  5073. own['lastxBut_ground'] = xBut_ground
  5074. own["last_sel"] = own["sel"]
  5075. own["sel"] = bkBut
  5076. #linVelocity = own.getLinearVelocity(1)
  5077. #print(linVelocity.z)
  5078. #newz = linVelocity.z * .9
  5079. if r_ground.triggered and own["jump_timer"] < 20:
  5080. force2 = [0.0, 0, -10]
  5081. own.applyForce(force2, True)
  5082. #own.linearVelocity = [ linVelocity.x, linVelocity.y, newz]
  5083. #print(c_ground.triggered, r_ground.triggered, gray.hitPosition[2])
  5084. #if c_ground.triggered and r_ground.triggered == False:
  5085. # print("AAAAAAAAAAAAAAlign")
  5086. #print("og - new = ", vely)
  5087. #print(r_ground.triggered)
  5088. #spawn_pos = own['spawn_pos']
  5089. #print(lUD)
  5090. #.04 to .05
  5091. #print("- ",spawn_pos.x, spawn_pos.y, spawn_pos.z)
  5092. #printplaying()
  5093. #print("-", udPad, ddPad)
  5094. #print(own["stance"])
  5095. #own["LAST_LEFT"] = LAST_LEFT
  5096. #end
  5097. #print(rLR)
  5098. #print(r_ground.triggered)
  5099. #print(own['hippy'], own['last_hippy'])
  5100. #print("x: ", round(linvelx.x, 2), "y: ", round(linvelx.y, 2))