shuvit 5 years ago
parent
commit
94b7087d06
5 changed files with 580 additions and 134 deletions
  1. 234
    15
      co_ActionState.py
  2. 182
    55
      controller2.py
  3. 9
    4
      grindV2.py
  4. 6
    0
      scene_init.py
  5. 149
    60
      walk.py

+ 234
- 15
co_ActionState.py
File diff suppressed because it is too large
View File


+ 182
- 55
controller2.py View File

949
         trigger = r_ground.triggered
949
         trigger = r_ground.triggered
950
         STANCE = own["stance"]
950
         STANCE = own["stance"]
951
         wallride = own["wallride"]
951
         wallride = own["wallride"]
952
+        dict['trick_string'] = 'Ollie'
952
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
953
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
953
             own["wallride_off"] = 1
954
             own["wallride_off"] = 1
954
             own['requestAction'] = 'reg_ollie'
955
             own['requestAction'] = 'reg_ollie'
976
 
977
 
977
     def kickflip():
978
     def kickflip():
978
         print("kickflip")
979
         print("kickflip")
979
-        dict['trick_string'] = 'Kickflip'
980
+        
980
         STANCE = own["stance"]
981
         STANCE = own["stance"]
981
         print(flip_start_lay)
982
         print(flip_start_lay)
982
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
983
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
983
             own["wallride_off"] = 1
984
             own["wallride_off"] = 1
984
             own['requestAction'] = 'reg_kickflip'       
985
             own['requestAction'] = 'reg_kickflip'       
985
             jump()
986
             jump()
987
+            dict['trick_string'] = 'Kickflip'
986
         elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
988
         elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
987
             own["wallride_off"] = 1
989
             own["wallride_off"] = 1
988
-            own['requestAction'] = 'fak_kickflip'       
990
+            own['requestAction'] = 'fak_heelflip'       
989
             jump()
991
             jump()
990
             if own["wallride"] !=1: jump()
992
             if own["wallride"] !=1: jump()
993
+            dict['trick_string'] = 'Heelflip'
991
         if r_ground.triggered == 0 and STANCE == False:
994
         if r_ground.triggered == 0 and STANCE == False:
992
             own["wallride_off"] = 1
995
             own["wallride_off"] = 1
993
             own['requestAction'] = 'reg_kickflip'
996
             own['requestAction'] = 'reg_kickflip'
994
             if own["wallride"] != None: 
997
             if own["wallride"] != None: 
995
                 jump()  
998
                 jump()  
999
+            dict['trick_string'] = 'Kickflip'
996
         elif r_ground.triggered == 0 and STANCE == True:
1000
         elif r_ground.triggered == 0 and STANCE == True:
997
             own["wallride_off"] = 1
1001
             own["wallride_off"] = 1
998
-            own['requestAction'] = 'fak_kickflip'
1002
+            own['requestAction'] = 'fak_heelflip'
999
             if own["wallride"] != None: 
1003
             if own["wallride"] != None: 
1000
                 jump()
1004
                 jump()
1005
+            dict['trick_string'] = 'Heelflip'    
1001
 
1006
 
1002
     def inward_heelflip():
1007
     def inward_heelflip():
1003
         print("inward heelflip")
1008
         print("inward heelflip")
1187
         
1192
         
1188
     def heelflip():
1193
     def heelflip():
1189
         print("heelflip")
1194
         print("heelflip")
1190
-        dict['trick_string'] = 'Heelflip'
1195
+        
1191
         STANCE = own["stance"]
1196
         STANCE = own["stance"]
1192
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1197
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1193
             own["wallride_off"] = 1
1198
             own["wallride_off"] = 1
1194
             own['requestAction'] = 'reg_heelflip'
1199
             own['requestAction'] = 'reg_heelflip'
1195
             jump()
1200
             jump()
1201
+            dict['trick_string'] = 'Heelflip'
1196
         elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
1202
         elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
1197
             own["wallride_off"] = 1
1203
             own["wallride_off"] = 1
1198
-            own['requestAction'] = 'fak_heelflip'
1204
+            own['requestAction'] = 'fak_kickflip'
1199
             jump()
1205
             jump()
1206
+            dict['trick_string'] = 'Kickflip'
1200
         if r_ground.triggered == 0 and STANCE == False:
1207
         if r_ground.triggered == 0 and STANCE == False:
1201
             own["wallride_off"] = 1
1208
             own["wallride_off"] = 1
1202
         elif r_ground.triggered == 0 and STANCE == True:
1209
         elif r_ground.triggered == 0 and STANCE == True:
1225
 
1232
 
1226
     def shuvit():
1233
     def shuvit():
1227
         print("shuvit")
1234
         print("shuvit")
1228
-        dict['trick_string'] = 'shuvit'
1235
+        dict['trick_string'] = 'Shuvit'
1229
         STANCE = own["stance"]
1236
         STANCE = own["stance"]
1230
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1237
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1231
             own["wallride_off"] = 1
1238
             own["wallride_off"] = 1
1245
 
1252
 
1246
     def shuvit360():
1253
     def shuvit360():
1247
         print("360shuvit")
1254
         print("360shuvit")
1248
-        dict['trick_string'] = '360 shuvit'
1255
+        dict['trick_string'] = '360 Shuvit'
1249
         STANCE = own["stance"]
1256
         STANCE = own["stance"]
1250
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1257
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1251
             own["wallride_off"] = 1
1258
             own["wallride_off"] = 1
1266
 
1273
 
1267
     def fsshuvit360():
1274
     def fsshuvit360():
1268
         print("360shuvit")
1275
         print("360shuvit")
1269
-        dict['trick_string'] = '360 shuvit'
1276
+        dict['trick_string'] = 'FS 360 Shuvit'
1270
         STANCE = own["stance"]
1277
         STANCE = own["stance"]
1271
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1278
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1272
             own["wallride_off"] = 1
1279
             own["wallride_off"] = 1
1287
 
1294
 
1288
     def nollie_shuvit():
1295
     def nollie_shuvit():
1289
         print("shuvit")
1296
         print("shuvit")
1290
-        dict['trick_string'] = 'Nollie shuvit'
1297
+        dict['trick_string'] = 'Nollie Shuvit'
1291
         STANCE = own["stance"]
1298
         STANCE = own["stance"]
1292
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1299
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1293
             own["wallride_off"] = 1
1300
             own["wallride_off"] = 1
1307
                 jump()        
1314
                 jump()        
1308
 
1315
 
1309
     def fsshuvit():
1316
     def fsshuvit():
1310
-        dict['trick_string'] = 'Frontside shuvit'
1317
+        dict['trick_string'] = 'FS Shuvit'
1311
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1318
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1312
             own["wallride_off"] = 1
1319
             own["wallride_off"] = 1
1313
             own['requestAction'] = 'reg_fsshuvit'
1320
             own['requestAction'] = 'reg_fsshuvit'
1326
                 jump()
1333
                 jump()
1327
             
1334
             
1328
     def nollie_fsshuvit():
1335
     def nollie_fsshuvit():
1329
-        dict['trick_string'] = 'Nollie Frontside shuvit'
1336
+        dict['trick_string'] = 'Nollie FS Shuvit'
1330
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1337
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1331
             own["wallride_off"] = 1
1338
             own["wallride_off"] = 1
1332
             own['requestAction'] = 'reg_nollie_fsshuvit'
1339
             own['requestAction'] = 'reg_nollie_fsshuvit'
1346
      
1353
      
1347
     #nollie_shuvit360()
1354
     #nollie_shuvit360()
1348
     def nollie_shuvit360():
1355
     def nollie_shuvit360():
1349
-        dict['trick_string'] = 'Nollie Frontside shuvit 360'
1356
+        dict['trick_string'] = 'Nollie FS Shuvit 360'
1350
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1357
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1351
             own["wallride_off"] = 1
1358
             own["wallride_off"] = 1
1352
             own['requestAction'] = 'reg_nollie_shuvit360'
1359
             own['requestAction'] = 'reg_nollie_shuvit360'
1366
 
1373
 
1367
     #nollie_fsshuvit360()
1374
     #nollie_fsshuvit360()
1368
     def nollie_fsshuvit360():
1375
     def nollie_fsshuvit360():
1369
-        dict['trick_string'] = 'Nollie Frontside shuvit 360'
1376
+        dict['trick_string'] = 'Nollie FS Shuvit 360'
1370
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1377
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1371
             own["wallride_off"] = 1
1378
             own["wallride_off"] = 1
1372
             own['requestAction'] = 'reg_nollie_fsshuvit_360'
1379
             own['requestAction'] = 'reg_nollie_fsshuvit_360'
1383
             own["wallride_off"] = 1
1390
             own["wallride_off"] = 1
1384
             if own["wallride"] != None: 
1391
             if own["wallride"] != None: 
1385
                 jump()             
1392
                 jump()             
1386
-        
1393
+#-------
1394
+    def reg_frigid_grab_on():
1395
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1396
+        GRAB_ON = own["GRAB_ON"]
1397
+        dict['trick_string'] = 'Frigid'
1398
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1399
+            own['requestAction'] = 'reg_frigid'
1400
+            grablay2 = grablay + 1
1401
+            GRAB_PLAYED = True
1402
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1403
+    def reg_fsonefoot_grab_on():
1404
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1405
+        GRAB_ON = own["GRAB_ON"]
1406
+        dict['trick_string'] = 'FS One Foot'
1407
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1408
+            own['requestAction'] = 'reg_fsonefoot'
1409
+            grablay2 = grablay + 1
1410
+            GRAB_PLAYED = True
1411
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1412
+    def reg_onefoot_grab_on():
1413
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1414
+        GRAB_ON = own["GRAB_ON"]
1415
+        dict['trick_string'] = 'One Foot'
1416
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1417
+            own['requestAction'] = 'reg_onefoot'
1418
+            grablay2 = grablay + 1
1419
+            GRAB_PLAYED = True
1420
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1421
+
1422
+    def fak_frigid_grab_on():
1423
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1424
+        GRAB_ON = own["GRAB_ON"]
1425
+        dict['trick_string'] = 'Frigid'
1426
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1427
+            own['requestAction'] = 'fak_frigid'
1428
+            grablay2 = grablay + 1
1429
+            GRAB_PLAYED = True
1430
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1431
+    def fak_fsonefoot_grab_on():
1432
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1433
+        GRAB_ON = own["GRAB_ON"]
1434
+        dict['trick_string'] = 'FS One Foot'
1435
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1436
+            own['requestAction'] = 'fak_fsonefoot'
1437
+            grablay2 = grablay + 1
1438
+            GRAB_PLAYED = True
1439
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1440
+    def fak_onefoot_grab_on():
1441
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1442
+        GRAB_ON = own["GRAB_ON"]
1443
+        dict['trick_string'] = 'One Foot'
1444
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1445
+            own['requestAction'] = 'fak_onefoot'
1446
+            grablay2 = grablay + 1
1447
+            GRAB_PLAYED = True
1448
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1449
+
1450
+#----        
1387
     def reg_judo_grab_on():
1451
     def reg_judo_grab_on():
1388
         GRAB_PLAYED = own["GRAB_PLAYED"]
1452
         GRAB_PLAYED = own["GRAB_PLAYED"]
1389
         GRAB_ON = own["GRAB_ON"]
1453
         GRAB_ON = own["GRAB_ON"]
1390
-        dict['trick_string'] = 'Judo Grab'
1454
+        dict['trick_string'] = 'Judo'
1391
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1455
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1392
             own['requestAction'] = 'reg_judo'
1456
             own['requestAction'] = 'reg_judo'
1393
             grablay2 = grablay + 1
1457
             grablay2 = grablay + 1
1397
     def fak_judo_grab_on():
1461
     def fak_judo_grab_on():
1398
         GRAB_PLAYED = own["GRAB_PLAYED"]
1462
         GRAB_PLAYED = own["GRAB_PLAYED"]
1399
         GRAB_ON = own["GRAB_ON"]
1463
         GRAB_ON = own["GRAB_ON"]
1400
-        dict['trick_string'] = 'Fak Judo Grab'
1464
+        dict['trick_string'] = 'Judo'
1401
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1465
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1402
             own['requestAction'] = 'fak_judo'
1466
             own['requestAction'] = 'fak_judo'
1403
             grablay2 = grablay + 1
1467
             grablay2 = grablay + 1
1407
     def frontside_grab_on():
1471
     def frontside_grab_on():
1408
         GRAB_PLAYED = own["GRAB_PLAYED"]
1472
         GRAB_PLAYED = own["GRAB_PLAYED"]
1409
         GRAB_ON = own["GRAB_ON"]
1473
         GRAB_ON = own["GRAB_ON"]
1410
-        dict['trick_string'] = 'Mute Grab'
1474
+        dict['trick_string'] = 'Mute'
1411
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1475
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1412
             own['requestAction'] = 'frontside_grab'
1476
             own['requestAction'] = 'frontside_grab'
1413
             #skater.playAction("reg_fg", 10,30, layer=400, priority=5, play_mode=1, speed=.5)
1477
             #skater.playAction("reg_fg", 10,30, layer=400, priority=5, play_mode=1, speed=.5)
1419
     def backside_grab_on():
1483
     def backside_grab_on():
1420
         GRAB_PLAYED = own["GRAB_PLAYED"]
1484
         GRAB_PLAYED = own["GRAB_PLAYED"]
1421
         GRAB_ON = own["GRAB_ON"]
1485
         GRAB_ON = own["GRAB_ON"]
1486
+        dict['trick_string'] = 'Backside'
1422
         if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
1487
         if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
1423
             own['requestAction'] = 'reg_fp_rback'          
1488
             own['requestAction'] = 'reg_fp_rback'          
1424
         elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
1489
         elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
1429
     def fakfrontside_grab_on():
1494
     def fakfrontside_grab_on():
1430
         GRAB_PLAYED = own["GRAB_PLAYED"]
1495
         GRAB_PLAYED = own["GRAB_PLAYED"]
1431
         GRAB_ON = own["GRAB_ON"]
1496
         GRAB_ON = own["GRAB_ON"]
1497
+        dict['trick_string'] = 'Mute'
1432
         if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
1498
         if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
1433
             own['requestAction'] = 'fak_fp_rback'         
1499
             own['requestAction'] = 'fak_fp_rback'         
1434
         
1500
         
1440
     def fakbackside_grab_on():
1506
     def fakbackside_grab_on():
1441
         GRAB_PLAYED = own["GRAB_PLAYED"]
1507
         GRAB_PLAYED = own["GRAB_PLAYED"]
1442
         GRAB_ON = own["GRAB_ON"]
1508
         GRAB_ON = own["GRAB_ON"]
1509
+        dict['trick_string'] = 'Backside'
1443
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1510
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1444
             own['requestAction'] = 'fak_backside_grab' 
1511
             own['requestAction'] = 'fak_backside_grab' 
1445
             GRAB_PLAYED = True
1512
             GRAB_PLAYED = True
1449
     def frontside_nose_grab_on():
1516
     def frontside_nose_grab_on():
1450
         GRAB_PLAYED = own["GRAB_PLAYED"]
1517
         GRAB_PLAYED = own["GRAB_PLAYED"]
1451
         GRAB_ON = own["GRAB_ON"]
1518
         GRAB_ON = own["GRAB_ON"]
1519
+        dict['trick_string'] = 'FS Nose'
1452
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
1520
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
1453
             own['requestAction'] = 'frontside_nose_grab' 
1521
             own['requestAction'] = 'frontside_nose_grab' 
1454
             GRAB_PLAYED = True
1522
             GRAB_PLAYED = True
1456
     def frontside_tail_grab_on():
1524
     def frontside_tail_grab_on():
1457
         GRAB_PLAYED = own["GRAB_PLAYED"]
1525
         GRAB_PLAYED = own["GRAB_PLAYED"]
1458
         GRAB_ON = own["GRAB_ON"]
1526
         GRAB_ON = own["GRAB_ON"]
1527
+        dict['trick_string'] = 'FS Tail'
1459
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1528
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1460
             own['requestAction'] = 'frontside_tail_grab' 
1529
             own['requestAction'] = 'frontside_tail_grab' 
1461
             GRAB_PLAYED = True
1530
             GRAB_PLAYED = True
1463
     def backside_nose_grab_on():
1532
     def backside_nose_grab_on():
1464
         GRAB_PLAYED = own["GRAB_PLAYED"]
1533
         GRAB_PLAYED = own["GRAB_PLAYED"]
1465
         GRAB_ON = own["GRAB_ON"]
1534
         GRAB_ON = own["GRAB_ON"]
1466
-        #airwalk
1467
-        if GRAB_ON == True and r_ground.triggered == 0 and (aBut == True):    
1468
-            print("airwalk")
1469
-            skater.playAction("reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
1470
-            deck.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
1471
-            trucks.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
1472
-        
1473
-        #norm
1474
-        elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:   
1535
+        dict['trick_string'] = 'BS Nose'
1536
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:   
1475
             own['requestAction'] = 'backside_nose_grab' 
1537
             own['requestAction'] = 'backside_nose_grab' 
1476
             GRAB_PLAYED = True
1538
             GRAB_PLAYED = True
1477
             own["GRAB_PLAYED)"] = GRAB_PLAYED 
1539
             own["GRAB_PLAYED)"] = GRAB_PLAYED 
1478
     def backside_tail_grab_on():
1540
     def backside_tail_grab_on():
1479
         GRAB_PLAYED = own["GRAB_PLAYED"]
1541
         GRAB_PLAYED = own["GRAB_PLAYED"]
1480
         GRAB_ON = own["GRAB_ON"]
1542
         GRAB_ON = own["GRAB_ON"]
1543
+        dict['trick_string'] = 'BS Tail'
1481
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1544
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1482
             own['requestAction'] = 'backside_tail_grab' 
1545
             own['requestAction'] = 'backside_tail_grab' 
1483
             GRAB_PLAYED = True
1546
             GRAB_PLAYED = True
1484
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1547
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1548
+            
1549
+    def reg_airwalk():
1550
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1551
+        GRAB_ON = own["GRAB_ON"]
1552
+        dict['trick_string'] = 'Airwalk'
1553
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1554
+            own['requestAction'] = 'reg_airwalk' 
1555
+            GRAB_PLAYED = True
1556
+            own["GRAB_PLAYED)"] = GRAB_PLAYED            
1557
+            
1485
     #switch    
1558
     #switch    
1486
     def fak_frontside_nose_grab_on():
1559
     def fak_frontside_nose_grab_on():
1487
         GRAB_PLAYED = own["GRAB_PLAYED"]
1560
         GRAB_PLAYED = own["GRAB_PLAYED"]
1488
         GRAB_ON = own["GRAB_ON"]
1561
         GRAB_ON = own["GRAB_ON"]
1562
+        dict['trick_string'] = 'FS Nose'
1489
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:  
1563
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:  
1490
             own['requestAction'] = 'fak_frontside_nose_grab' 
1564
             own['requestAction'] = 'fak_frontside_nose_grab' 
1491
             GRAB_PLAYED = True
1565
             GRAB_PLAYED = True
1494
     def fak_frontside_tail_grab_on():
1568
     def fak_frontside_tail_grab_on():
1495
         GRAB_PLAYED = own["GRAB_PLAYED"]
1569
         GRAB_PLAYED = own["GRAB_PLAYED"]
1496
         GRAB_ON = own["GRAB_ON"]
1570
         GRAB_ON = own["GRAB_ON"]
1571
+        dict['trick_string'] = 'FS Tail'
1497
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1572
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1498
             own['requestAction'] = 'fak_frontside_tail_grab' 
1573
             own['requestAction'] = 'fak_frontside_tail_grab' 
1499
             GRAB_PLAYED = True
1574
             GRAB_PLAYED = True
1502
     def fak_backside_nose_grab_on():
1577
     def fak_backside_nose_grab_on():
1503
         GRAB_PLAYED = own["GRAB_PLAYED"]
1578
         GRAB_PLAYED = own["GRAB_PLAYED"]
1504
         GRAB_ON = own["GRAB_ON"]
1579
         GRAB_ON = own["GRAB_ON"]
1580
+        dict['trick_string'] = 'BS Nose'
1505
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1581
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1506
             own['requestAction'] = 'fak_backside_nose_grab' 
1582
             own['requestAction'] = 'fak_backside_nose_grab' 
1507
             GRAB_PLAYED = True
1583
             GRAB_PLAYED = True
1510
     def fak_backside_tail_grab_on():
1586
     def fak_backside_tail_grab_on():
1511
         GRAB_PLAYED = own["GRAB_PLAYED"]
1587
         GRAB_PLAYED = own["GRAB_PLAYED"]
1512
         GRAB_ON = own["GRAB_ON"]
1588
         GRAB_ON = own["GRAB_ON"]
1589
+        dict['trick_string'] = 'BS Tail'
1513
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1590
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1514
             own['requestAction'] = 'fak_backside_tail_grab' 
1591
             own['requestAction'] = 'fak_backside_tail_grab' 
1515
             GRAB_PLAYED = True
1592
             GRAB_PLAYED = True
2101
                 else:
2178
                 else:
2102
                     if STANCE == 0:
2179
                     if STANCE == 0:
2103
                         own['requestAction'] = 'reg_5050'
2180
                         own['requestAction'] = 'reg_5050'
2181
+                        dict['trick_string'] = '5050'
2104
                     if STANCE == 1:
2182
                     if STANCE == 1:
2105
                         own['requestAction'] = 'fak_5050'
2183
                         own['requestAction'] = 'fak_5050'
2184
+                        dict['trick_string'] = '5050'
2106
                 
2185
                 
2107
             elif STANCE == False:
2186
             elif STANCE == False:
2108
                 if own['grindType'] == "reg_bsboard":
2187
                 if own['grindType'] == "reg_bsboard":
2420
         own['revert_timer'] = 20 
2499
         own['revert_timer'] = 20 
2421
         cont.activate(own.actuators["revertSound"]) 
2500
         cont.activate(own.actuators["revertSound"]) 
2422
         own['revert_sound'] = 1 
2501
         own['revert_sound'] = 1 
2502
+        dict['trick_string'] = 'Revert'
2423
 
2503
 
2424
     def revert2():
2504
     def revert2():
2425
         own["Q3oncdl"] = 0
2505
         own["Q3oncdl"] = 0
2446
         own['revert_timer'] = 20 
2526
         own['revert_timer'] = 20 
2447
         cont.activate(own.actuators["revertSound"])   
2527
         cont.activate(own.actuators["revertSound"])   
2448
         own['revert_sound'] = 1 
2528
         own['revert_sound'] = 1 
2529
+        dict['trick_string'] = 'Revert'
2449
 
2530
 
2450
     def revert3():
2531
     def revert3():
2451
         own["Q7oncdl"] = 0
2532
         own["Q7oncdl"] = 0
2472
         own['revert_timer'] = 20 
2553
         own['revert_timer'] = 20 
2473
         cont.activate(own.actuators["revertSound"]) 
2554
         cont.activate(own.actuators["revertSound"]) 
2474
         own['revert_sound'] = 1  
2555
         own['revert_sound'] = 1  
2556
+        dict['trick_string'] = 'Revert'
2475
 
2557
 
2476
     def revert4():
2558
     def revert4():
2477
         own["Q7oncdl"] = 0
2559
         own["Q7oncdl"] = 0
2498
         own['revert_timer'] = 20 
2580
         own['revert_timer'] = 20 
2499
         cont.activate(own.actuators["revertSound"]) 
2581
         cont.activate(own.actuators["revertSound"]) 
2500
         own['revert_sound'] = 1      
2582
         own['revert_sound'] = 1      
2583
+        dict['trick_string'] = 'Revert'
2501
 
2584
 
2502
     def powerslide():
2585
     def powerslide():
2503
         own['powerslide_counter'] = own['powerslide_counter'] + 1
2586
         own['powerslide_counter'] = own['powerslide_counter'] + 1
3410
         GRAB_ON = True
3493
         GRAB_ON = True
3411
         own["GRAB_ON"] = GRAB_ON
3494
         own["GRAB_ON"] = GRAB_ON
3412
         #print(rTrig, GRAB_ON)
3495
         #print(rTrig, GRAB_ON)
3413
-
3414
-        if STANCE == False and rUD >= -.07 and rUD <= .07:
3415
-            frontside_grab_on()
3416
-        elif STANCE == True and rUD >= -.07 and rUD <= .07:
3417
-            fakbackside_grab_on()
3418
-        #front_nose    
3419
-        if STANCE == True and rUD < -0.070:
3420
-            fak_backside_nose_grab_on()
3421
-        #front_tail    
3422
-        elif STANCE == True and rUD > 0.07:
3423
-            fak_backside_tail_grab_on() 
3424
-        #    
3425
-        if STANCE == False and rUD < -0.070:
3426
-            frontside_nose_grab_on()
3427
-        #front_tail    
3428
-        elif STANCE == False and rUD > 0.07:
3429
-            frontside_tail_grab_on()                
3496
+        if aBut == False and xBut == False:
3497
+            if STANCE == False and rUD >= -.07 and rUD <= .07:
3498
+                frontside_grab_on()
3499
+            elif STANCE == True and rUD >= -.07 and rUD <= .07:
3500
+                fakbackside_grab_on()
3501
+            #front_nose    
3502
+            if STANCE == True and rUD < -0.070:
3503
+                fak_backside_nose_grab_on()
3504
+            #front_tail    
3505
+            elif STANCE == True and rUD > 0.07:
3506
+                fak_backside_tail_grab_on() 
3507
+            #    
3508
+            if STANCE == False and rUD < -0.070:
3509
+                if bBut == True:
3510
+                    reg_airwalk()
3511
+                else:    
3512
+                    frontside_nose_grab_on()
3513
+            #front_tail    
3514
+            elif STANCE == False and rUD > 0.07:
3515
+                frontside_tail_grab_on()     
3516
+        elif aBut == True and xBut == False:
3517
+            if STANCE == False:
3518
+                reg_fsonefoot_grab_on()        
3519
+            else:
3520
+                fak_onefoot_grab_on()
3521
+        elif aBut == False and xBut == True:
3522
+            if STANCE == False:
3523
+                reg_frigid_grab_on()        
3524
+            else:
3525
+                fak_judo_grab_on()                  
3526
+                
3527
+                
3528
+                           
3430
 
3529
 
3431
     #backside grab
3530
     #backside grab
3432
     if lTrig > 0.02 and r_ground.triggered == 0 and flipping == False:    
3531
     if lTrig > 0.02 and r_ground.triggered == 0 and flipping == False:    
3446
                 fak_frontside_tail_grab_on() 
3545
                 fak_frontside_tail_grab_on() 
3447
             #front_nose    
3546
             #front_nose    
3448
             if STANCE == False and rUD < -0.070:
3547
             if STANCE == False and rUD < -0.070:
3449
-                backside_nose_grab_on()
3548
+                if bBut == True:
3549
+                    reg_airwalk()
3550
+                else:                  
3551
+                    backside_nose_grab_on()
3450
             #front_tail    
3552
             #front_tail    
3451
             elif STANCE == False and rUD > 0.07:
3553
             elif STANCE == False and rUD > 0.07:
3452
-                backside_tail_grab_on()  
3453
-        else:
3554
+                backside_tail_grab_on() 
3555
+                
3556
+        elif aBut == True and xBut == False:
3454
             if STANCE == False:
3557
             if STANCE == False:
3455
-                reg_judo_grab_on()
3456
-            elif STANCE == True:
3457
-                fak_judo_grab_on()            
3558
+                reg_judo_grab_on()        
3559
+            else:
3560
+                fak_frigid_grab_on()
3561
+        elif aBut == False and xBut == True:
3562
+            if STANCE == False:
3563
+                reg_onefoot_grab_on()        
3564
+            else:
3565
+                fak_frigid_grab_on()                    
3566
+                 
3567
+#        else:
3568
+#            if STANCE == False:
3569
+#                reg_judo_grab_on()
3570
+#            elif STANCE == True:
3571
+#                fak_judo_grab_on()            
3458
                                             
3572
                                             
3459
             
3573
             
3460
     #kill grabs        
3574
     #kill grabs        
3565
         lgf = own['last_grind_frame']
3679
         lgf = own['last_grind_frame']
3566
         frame = own['framenum']
3680
         frame = own['framenum']
3567
         frames_since_grinding = frame - lgf
3681
         frames_since_grinding = frame - lgf
3568
-        ylimit = .8
3569
-        if ground_since < 15:
3682
+        ylimit = .84
3683
+        #print(ground_since, 'ground_since')
3684
+        if ground_since < 20 and ground_since > 1 and grindHit == 0:
3570
             ylimit = ylimit + ((ground_since - 15) * -.005)
3685
             ylimit = ylimit + ((ground_since - 15) * -.005)
3571
-            if ylimit > .99999:
3572
-                ylimit = .9999
3573
-               
3686
+            
3687
+            yvel = own.linearVelocity.y
3688
+            yvel = yvel *.03
3689
+            if STANCE == 0:
3690
+                yvel *= -1
3691
+            try:    
3692
+                dist = r_ground.hitObject.worldPosition - own.worldPosition
3693
+                #print('ground dist', dist)
3694
+                if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3695
+                    own.applyRotation([0,0,yvel], True)
3696
+                
3697
+                if ylimit > .99999:
3698
+                    ylimit = .9999
3699
+            except:
3700
+                pass       
3574
         else:    
3701
         else:    
3575
             if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3702
             if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3576
                 linVelocity4 = own.getLinearVelocity(True)
3703
                 linVelocity4 = own.getLinearVelocity(True)
3577
                 newy = linVelocity4.y * ylimit   
3704
                 newy = linVelocity4.y * ylimit   
3578
                 force = [linVelocity4.x, newy, linVelocity4.z]
3705
                 force = [linVelocity4.x, newy, linVelocity4.z]
3579
                 own.setLinearVelocity(force, True) 
3706
                 own.setLinearVelocity(force, True) 
3580
-        print(ylimit, 'ylimit')       
3707
+        #print(ylimit, 'ylimit')       
3581
 
3708
 
3582
     def getoffboard():
3709
     def getoffboard():
3583
         lasty = own['lasty']
3710
         lasty = own['lasty']

+ 9
- 4
grindV2.py View File

403
                 delta = delta.cross(vect)
403
                 delta = delta.cross(vect)
404
                 if delta[2] >= 0:
404
                 if delta[2] >= 0:
405
                     grindside = "right"
405
                     grindside = "right"
406
+
406
                 else:
407
                 else:
407
                     grindside = "left"
408
                     grindside = "left"
409
+                edge = 0
410
+                if 'edge' in obj:
411
+                    edge = 1    
412
+                #print('grind on', grindside, edge)
408
                 if (delta[2] > .00001 or delta[2] < -.00001) and (delta[2] < .8 or delta[2] < -.8):
413
                 if (delta[2] > .00001 or delta[2] < -.00001) and (delta[2] < .8 or delta[2] < -.8):
409
                     rotation = own.worldOrientation[2] - obj.worldOrientation[2]
414
                     rotation = own.worldOrientation[2] - obj.worldOrientation[2]
410
                     player_e = own.worldOrientation.to_euler()
415
                     player_e = own.worldOrientation.to_euler()
513
         if dist < grind_dist and dropin == 0 and manual == 0 and no_grind == 0 and own['grindoutturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 40 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0 and own['last_invert'] == False and own['grindjumpturn'] == 0 and grind_jump == 0 and own['airup'] == 0:
518
         if dist < grind_dist and dropin == 0 and manual == 0 and no_grind == 0 and own['grindoutturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 40 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0 and own['last_invert'] == False and own['grindjumpturn'] == 0 and grind_jump == 0 and own['airup'] == 0:
514
             #print('grind')      
519
             #print('grind')      
515
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
520
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
516
-            if grindold == 0:
521
+            if grindold == 0:     
517
                 if grindTouch.triggered:
522
                 if grindTouch.triggered:
518
                     nearpos = nearestObject.worldPosition
523
                     nearpos = nearestObject.worldPosition
519
                     if hitNormal != None:
524
                     if hitNormal != None:
520
-                        stre = .05
525
+                        stre = .45
521
                         own.alignAxisToVect(hitNormal, 2, stre) 
526
                         own.alignAxisToVect(hitNormal, 2, stre) 
522
                         #print("align")                   
527
                         #print("align")                   
523
                     own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
528
                     own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
538
                     if grindTouch.triggered:
543
                     if grindTouch.triggered:
539
                         nearpos = nearestObject.worldPosition
544
                         nearpos = nearestObject.worldPosition
540
                         if hitNormal != None:
545
                         if hitNormal != None:
541
-                            stre = .05
546
+                            stre = .15
542
                             own.alignAxisToVect(hitNormal, 2, stre) 
547
                             own.alignAxisToVect(hitNormal, 2, stre) 
543
                             #print("align")                   
548
                             #print("align")                   
544
-                        own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
549
+                        #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
545
                         print('new moving world')                    
550
                         print('new moving world')                    
546
 
551
 
547
     else:
552
     else:

+ 6
- 0
scene_init.py View File

179
     own['driving'] = False
179
     own['driving'] = False
180
     dict['last_driving'] = False
180
     dict['last_driving'] = False
181
     own['last_roty'] = 0.0
181
     own['last_roty'] = 0.0
182
+    
183
+    own['walk_targ_speed'] = 2
184
+    own['walk_fast_targ_speed'] = 5
185
+    own['walk_speed'] = 0
186
+    own['walk_inc'] = .05
187
+    own['walk_jump_timer'] = 0
182
        
188
        
183
 main()
189
 main()

+ 149
- 60
walk.py View File

83
 
83
 
84
 #if skater.isPlayingAction(460):  
84
 #if skater.isPlayingAction(460):  
85
 #    noidle = 1  
85
 #    noidle = 1  
86
+walk_inc = own['walk_inc'] 
87
+if own['stair_counter'] != 0:
88
+    walk_inc = own['walk_inc']  *10
86
 
89
 
87
 if own["stance"] == None:
90
 if own["stance"] == None:
88
     own["stance"] = True
91
     own["stance"] = True
161
     lRight = 1
164
     lRight = 1
162
 else:
165
 else:
163
     lRight = 0        
166
     lRight = 0        
167
+
168
+
169
+
170
+#turning
171
+turning = False
172
+if r_ground.positive:
173
+    num = .5
174
+    tilt = .015
175
+    if STANCE == 1:
176
+        num *= -1
177
+        tilt *= -1
178
+    if lRight == 1 or dict['kb_ra'] == 2:
179
+        #cont.activate(own.actuators['right'])
180
+        own.linearVelocity.y = num
181
+        if own['stair_counter'] > 0:
182
+            if STANCE == 0:
183
+                own.applyRotation([0,0,.05], True)
184
+            else:
185
+                own.applyRotation([0,0,-.05], True)                
186
+        else:
187
+            own.applyRotation([-tilt, 0, 0], True)
188
+        turning = True
189
+    else:
190
+        #cont.deactivate(own.actuators['right']) 
191
+        pass  
192
+        
193
+    if lLeft == 1 or dict['kb_la'] == 2:
194
+        #cont.activate(own.actuators['left']) 
195
+        own.linearVelocity.y = -num
196
+        if own['stair_counter'] > 0:
197
+            if STANCE == 0:
198
+                own.applyRotation([0,0,.05], True)
199
+            else:
200
+                own.applyRotation([0,0,-.05], True)                                
201
+        else:        
202
+            own.applyRotation([tilt, 0, 0], True)        
203
+        turning = True
204
+    else:
205
+        #cont.deactivate(own.actuators['left'])        
206
+        pass
207
+
208
+#in air        
209
+#if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
210
+if r_ground.positive == False:
211
+    airrot = .05
212
+    if lLeft == 1 or dict['kb_la'] == 2:
213
+        if stance == 0:
214
+            own.applyRotation([0,0,airrot], True)
215
+        if stance == 1:    
216
+            own.applyRotation([0,0,airrot], True)
217
+    if lRight == 1 or dict['kb_ra'] == 2:
218
+        if stance == 0:
219
+            own.applyRotation([0,0,-airrot], True)
220
+        if stance == 1:    
221
+            own.applyRotation([0,0,-airrot], True)            
222
+    own['lF_air_frame'] = own['framenum']  
223
+
224
+
164
     
225
     
165
 #walking
226
 #walking
166
 
227
 
169
 if own['walk_timer'] < 50:
230
 if own['walk_timer'] < 50:
170
     velx = vel.x * .95             
231
     velx = vel.x * .95             
171
     own.setLinearVelocity([velx, 0, vel.z], True)
232
     own.setLinearVelocity([velx, 0, vel.z], True)
233
+    #print('y is zero')
172
 else:
234
 else:
173
-    own.setLinearVelocity([0, 0, vel.z], True)
235
+    pass
236
+    #own.setLinearVelocity([0, 0, vel.z], True)
174
     
237
     
175
 wf = 1
238
 wf = 1
176
 if own['last_walk_frame'] - own['last_roll_frame'] > 55:
239
 if own['last_walk_frame'] - own['last_roll_frame'] > 55:
188
     walking = None
251
     walking = None
189
    
252
    
190
 if walking == "regular":
253
 if walking == "regular":
191
-    cont.deactivate(own.actuators['forward2']) 
192
-    cont.deactivate(own.actuators['backward2'])    
193
-    if stance == 0:
194
-        cont.activate(own.actuators['forward'])
254
+    #if linvel.x < own['walk_targ_speed']:
255
+    #cont.deactivate(own.actuators['forward2']) 
256
+    #cont.deactivate(own.actuators['backward2'])    
257
+    if stance == 1:
258
+        if linvel.x < own['walk_targ_speed']:
259
+            own.linearVelocity.x = linvel.x + walk_inc
260
+        else:
261
+            own.linearVelocity.x = own['walk_targ_speed']    
262
+        #cont.activate(own.actuators['forward'])
195
     else:
263
     else:
196
-        cont.activate(own.actuators['backward'])
264
+        if linvel.x > -own['walk_targ_speed']:
265
+            own.linearVelocity.x = linvel.x - walk_inc       
266
+        else:
267
+            own.linearVelocity.x = -own['walk_targ_speed']                
268
+        #cont.activate(own.actuators['backward'])
197
 if walking == "fast":
269
 if walking == "fast":
198
-    cont.deactivate(own.actuators['forward']) 
199
-    cont.deactivate(own.actuators['backward'])    
200
-    if stance == 0:
201
-        cont.activate(own.actuators['forward2'])
270
+    #cont.deactivate(own.actuators['forward']) 
271
+    #cont.deactivate(own.actuators['backward'])    
272
+    if stance == 1:
273
+        if linvel.x < own['walk_fast_targ_speed']:
274
+            own.linearVelocity.x = linvel.x + walk_inc
275
+        else:
276
+            own.linearVelocity.x = own['walk_fast_targ_speed']  
202
     else:
277
     else:
203
-        cont.activate(own.actuators['backward2'])                 
278
+        if linvel.x > -own['walk_fast_targ_speed']:
279
+            own.linearVelocity.x = linvel.x - walk_inc      
280
+        else:
281
+            own.linearVelocity.x = -own['walk_fast_targ_speed'] 
204
 
282
 
205
-if walking == None:
206
-    cont.deactivate(own.actuators['forward2']) 
207
-    cont.deactivate(own.actuators['backward2'])
208
-    cont.deactivate(own.actuators['forward']) 
209
-    cont.deactivate(own.actuators['backward'])        
210
-    if own['walk_timer'] < 50:
283
+if walking == None and r_ground.positive and own['walk_jump_timer'] == 0:
284
+    #cont.deactivate(own.actuators['forward2']) 
285
+    #cont.deactivate(own.actuators['backward2'])
286
+    #cont.deactivate(own.actuators['forward']) 
287
+    #cont.deactivate(own.actuators['backward'])        
288
+    if own['walk_timer'] < 50 and turning == False:
211
         velx = vel.x * .95             
289
         velx = vel.x * .95             
212
         own.setLinearVelocity([velx, 0, vel.z], True)
290
         own.setLinearVelocity([velx, 0, vel.z], True)
291
+        #print('minusvel', velx)
213
     else:
292
     else:
214
-        own.setLinearVelocity([0, 0, vel.z], True) 
293
+        #pass
294
+        print('minusvel')
295
+        if own.linearVelocity.x > .1 or own.linearVelocity.x < -.1:
296
+            own.linearVelocity.x *= .01
297
+        else:
298
+            own.linearVelocity.x = 0
299
+        if turning == False:    
300
+            if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
301
+                own.linearVelocity.y *= .01
302
+            else:
303
+                own.linearVelocity.y = 0                
304
+        #own.setLinearVelocity([0, 0, vel.z], True) 
215
     
305
     
216
 #old walking
306
 #old walking
217
-if (lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
307
+if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 0):
218
     own.actuators["walkondirt"].volume = .2
308
     own.actuators["walkondirt"].volume = .2
219
     own.actuators["walkondirt"].pitch = 1
309
     own.actuators["walkondirt"].pitch = 1
220
     cont.activate(own.actuators["walkondirt"])
310
     cont.activate(own.actuators["walkondirt"])
233
         else:
323
         else:
234
             own['requestAction'] = 'fak_walk'
324
             own['requestAction'] = 'fak_walk'
235
        
325
        
236
-elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
326
+elif (((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 1):
237
     own.actuators["walkondirt"].volume = .2
327
     own.actuators["walkondirt"].volume = .2
238
     own.actuators["walkondirt"].pitch = 1.3
328
     own.actuators["walkondirt"].pitch = 1.3
239
     cont.activate(own.actuators["walkondirt"])
329
     cont.activate(own.actuators["walkondirt"])
330
+    print('fastwalk')
240
     if stance == 0 and skater.isPlayingAction(fliplay) == False:        
331
     if stance == 0 and skater.isPlayingAction(fliplay) == False:        
241
         if own['throw_deck'] == True:
332
         if own['throw_deck'] == True:
242
             own['requestAction'] = 'reg_walkFast_nb'
333
             own['requestAction'] = 'reg_walkFast_nb'
252
     vel = own.getLinearVelocity(True)
343
     vel = own.getLinearVelocity(True)
253
     cont.deactivate(own.actuators["walkondirt"])       
344
     cont.deactivate(own.actuators["walkondirt"])       
254
 
345
 
255
-#turning
256
-if lRight == 1 or dict['kb_ra'] == 2:
257
-    cont.activate(own.actuators['right'])
258
-else:
259
-    cont.deactivate(own.actuators['right'])    
260
-    
261
-if lLeft == 1 or dict['kb_la'] == 2:
262
-    cont.activate(own.actuators['left'])    
263
-else:
264
-    cont.deactivate(own.actuators['left'])        
265
-
266
-#in air        
267
-if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
268
-    if stance == 0:
269
-        cont.deactivate(own.actuators['forward'])
270
-        cont.deactivate(own.actuators['forward2'])
271
-        killact(4)
272
-        killact(5)
273
-        killact(6)
274
-        killact(7)        
275
-        velx = linvel.x - 1
276
-        own.setLinearVelocity([-1.5, linvel.y, linvel.z], 1)
277
-    if stance == 1:    
278
-        cont.deactivate(own.actuators['backward'])
279
-        cont.deactivate(own.actuators['backward2'])
280
-        killact(4)
281
-        killact(5)
282
-        killact(6)
283
-        killact(7)        
284
-        velx = linvel.x + 1
285
-        own.setLinearVelocity([1.5, linvel.y, linvel.z], 1)  
286
-    own['lF_air_frame'] = own['framenum']         
346
+       
287
 #---------------
347
 #---------------
288
 if rLR > .05:
348
 if rLR > .05:
289
     cont.activate(camobj.actuators['camRight'])
349
     cont.activate(camobj.actuators['camRight'])
341
         own.linearVelocity.z = -10
401
         own.linearVelocity.z = -10
342
     if xBut == True or dict['kb_space'] == 1: 
402
     if xBut == True or dict['kb_space'] == 1: 
343
         if own['lastx'] == 0:
403
         if own['lastx'] == 0:
344
-            killact(3)
345
-            killact(4)
346
-            killact(5)
347
-            killact(6)
348
-            killact(7)      
404
+            #killact(3)
405
+            #killact(4)
406
+            #killact(5)
407
+            #killact(6)
408
+            #killact(7)      
349
             if STANCE == 0:  
409
             if STANCE == 0:  
350
                 own['requestAction'] ='reg_jump'  
410
                 own['requestAction'] ='reg_jump'  
351
                 print('jump') 
411
                 print('jump') 
358
             local = False
418
             local = False
359
             # apply force -- limit jump speed
419
             # apply force -- limit jump speed
360
             if linvel.z < 10:
420
             if linvel.z < 10:
361
-                own.applyForce(force, local)
421
+                #own.applyForce(force, local)
422
+                own.linearVelocity.z += 5
423
+                own.linearVelocity.x = linvel.x
424
+                own.linearVelocity.y = linvel.y
425
+                own['walk_jump_timer'] = 20
362
         own['lastx'] = 1
426
         own['lastx'] = 1
363
     else:
427
     else:
364
         own['lastx'] = 0
428
         own['lastx'] = 0
1006
     try:
1070
     try:
1007
         if 'stair' in r_ground.hitObject:
1071
         if 'stair' in r_ground.hitObject:
1008
             own['stair_counter'] = 20
1072
             own['stair_counter'] = 20
1073
+            
1009
     except:
1074
     except:
1010
         pass        
1075
         pass        
1011
     if own['stair_counter'] > 0:
1076
     if own['stair_counter'] > 0:
1012
-       own['stair_counter'] -= 1     
1077
+        own.linearVelocity.z += .1
1078
+        own['stair_counter'] -= 1     
1013
 
1079
 
1014
 if yBut == True:
1080
 if yBut == True:
1015
     own['walk_idling'] = 0
1081
     own['walk_idling'] = 0
1038
             if own['framenum'] - own['last_fall_frame'] < 90:
1104
             if own['framenum'] - own['last_fall_frame'] < 90:
1039
                 own.applyForce([0,100,0], True)
1105
                 own.applyForce([0,100,0], True)
1040
                 #print('moving away from rail')
1106
                 #print('moving away from rail')
1107
+                
1108
+        yvel = own.linearVelocity.y
1109
+        yvel = yvel *.1
1110
+        if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01 and own['stair_counter'] == 0:
1111
+            if STANCE == 0:
1112
+                own.applyRotation([0,0,-yvel], True) 
1113
+            else:
1114
+                own.applyRotation([0,0,yvel], True) 
1115
+        else:
1116
+            own.linearVelocity.y = 0                           
1041
 
1117
 
1042
     else:
1118
     else:
1043
         #print('in air')            
1119
         #print('in air')            
1050
     if cb.positive:
1126
     if cb.positive:
1051
         if own['framenum'] - own['last_fall_frame'] < 90:
1127
         if own['framenum'] - own['last_fall_frame'] < 90:
1052
             own['lF_ground_frame'] = own['framenum']
1128
             own['lF_ground_frame'] = own['framenum']
1129
+            
1130
+            
1053
 
1131
 
1054
 def get_in_car():
1132
 def get_in_car():
1055
     vehicleNear = cont.sensors["vehicleNear"]
1133
     vehicleNear = cont.sensors["vehicleNear"]
1124
     cont.actuators['Camera'].object = camobj2
1202
     cont.actuators['Camera'].object = camobj2
1125
     cont.activate(own.actuators['walk'])
1203
     cont.activate(own.actuators['walk'])
1126
     #dict['driving_reset'] = False
1204
     #dict['driving_reset'] = False
1127
-    #print('reseting driving')                
1205
+    #print('reseting driving')   
1206
+if own['walk_jump_timer'] != 0:
1207
+    own['walk_jump_timer'] = own['walk_jump_timer'] - 1    
1208
+wts = own['walk_targ_speed'] +1                 
1209
+if own['requestAction'] == 'reg_walkFast' and own.linearVelocity.x > (wts * -1):
1210
+    own['requestAction'] = 'reg_walk' 
1211
+if own['requestAction'] == 'fak_walkFast' and own.linearVelocity.x < wts:
1212
+    own['requestAction'] = 'fak_walk' 
1213
+if own['requestAction'] == 'reg_walkFast_nb' and own.linearVelocity.x > (wts * -1):
1214
+    own['requestAction'] = 'reg_walk_nb' 
1215
+if own['requestAction'] == 'fak_walkFast_nb' and own.linearVelocity.x < wts:
1216
+    own['requestAction'] = 'fak_walk_nb'                         
1128
 onboard() 
1217
 onboard() 
1129
 jump()
1218
 jump()
1130
 dropin()
1219
 dropin()

Loading…
Cancel
Save