shuvit 6 years ago
parent
commit
2ce5698ff9
4 changed files with 87 additions and 31 deletions
  1. 40
    18
      co_ActionState.py
  2. 21
    7
      controller2.py
  3. 5
    4
      grindV2.py
  4. 21
    2
      walk.py

+ 40
- 18
co_ActionState.py
File diff suppressed because it is too large
View File


+ 21
- 7
controller2.py View File

@@ -1987,10 +1987,23 @@ def main():
1987 1987
         STANCE = own["stance"]
1988 1988
         jumpstance = own["jump_stance"]
1989 1989
         lif = frame - own['last_invert_frame']
1990
+        giniter = 0
1990 1991
         if own['LAST_GRIND'] == False and grindHit == True:
1991 1992
             own['grindstartFrame'] = own['framenum']
1993
+            giniter = 1
1992 1994
         #print(own['grindstartFrame'])    
1993
-        if grindHit == True and own['invert_on'] == 0 and own['footplant_on'] == False and own['manual'] == 0 and lif > 40 and own['dropinTimer'] < 30:  
1995
+        if grindHit == True and own['invert_on'] == 0 and own['footplant_on'] == False and own['manual'] == 0 and lif > 40 and own['dropinTimer'] < 30 and giniter == 0: 
1996
+            
1997
+            control_bottom = scene.objects['control_bottom']
1998
+            grindTouch = control_bottom.sensors['grindCol_bottom']
1999
+            edge = 0
2000
+            try:
2001
+                if 'edge' in grindTouch.hitObject:
2002
+                    print('Edge')
2003
+                    edge = 1
2004
+            except:
2005
+                pass               
2006
+             
1994 2007
             gblend = 1    
1995 2008
             if LAST_GRIND == 0:
1996 2009
                 gt = own['grindType']
@@ -2043,14 +2056,14 @@ def main():
2043 2056
                 elif own['grindType'] == "fak_tailgL":
2044 2057
                     own['requestAction'] = 'fak_tailgl' 
2045 2058
                 
2046
-                elif own['grindType'] == "reg_tailslide":
2059
+                elif own['grindType'] == "reg_tailslide" and edge == 1:
2047 2060
                     #own['requestAction'] = 'reg_tailslide'
2048 2061
                     own['requestAction'] = 'fak_noseslide'  
2049 2062
                     own['grind_stance'] = 0                
2050 2063
                 elif own['grindType'] == "fak_tailslide":
2051 2064
                     own['requestAction'] = 'fak_tailslide'                
2052 2065
                     own['grind_stance'] = 1
2053
-                elif own['grindType'] == "reg_noseslide":
2066
+                elif own['grindType'] == "reg_noseslide" and edge == 1:
2054 2067
                     #own['requestAction'] = 'reg_noseslide'
2055 2068
                     own['requestAction'] = 'fak_tailslide'  
2056 2069
                     own['grind_stance'] = 0
@@ -2097,13 +2110,14 @@ def main():
2097 2110
                     own['requestAction'] = 'fak_tailgl' 
2098 2111
                 elif own['grindType'] == "reg_tailslide":
2099 2112
                     own['requestAction'] = 'reg_tailslide'
2100
-                elif own['grindType'] == "fak_tailslide":
2113
+                    
2114
+                elif own['grindType'] == "fak_tailslide" and edge == 1:
2101 2115
                     own['grind_stance'] = 1
2102 2116
                     own['requestAction'] = 'reg_noseslide'
2103 2117
                 elif own['grindType'] == "reg_noseslide":
2104 2118
                     own['grind_stance'] = 0
2105 2119
                     own['requestAction'] = 'reg_noseslide'
2106
-                elif own['grindType'] == "fak_noseslide":  
2120
+                elif own['grindType'] == "fak_noseslide" and edge == 1:  
2107 2121
                     own['grind_stance'] = 1              
2108 2122
                     own['requestAction'] = 'reg_tailslide'                                
2109 2123
                 else:
@@ -2325,10 +2339,10 @@ def main():
2325 2339
             killact(4)
2326 2340
             if STANCE == 0:
2327 2341
                 own['requestAction'] = 'reg_air_nose' 
2328
-                print("reg_air_nose")
2342
+                #print("reg_air_nose")
2329 2343
             else:
2330 2344
                 own['requestAction'] = 'fak_air_nose' 
2331
-                print("fak_air_nose")
2345
+                #print("fak_air_nose")
2332 2346
 
2333 2347
     def air_turn_boost():
2334 2348
         pass

+ 5
- 4
grindV2.py View File

@@ -227,7 +227,7 @@ def main():
227 227
             #player.applyForce([0, 0, 0], True)            
228 228
             player.setLinearVelocity([velxb, 0.0, zvel], 1)  
229 229
             grindpos = "reg_5050"
230
-            print("50-1")
230
+            #print("50-1")
231 231
 
232 232
 
233 233
         elif rot >= 45 and rot < 90:  
@@ -519,9 +519,7 @@ def main():
519 519
                     own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
520 520
                     print('moving world')
521 521
 
522
-            grindold = True
523
-            own['grindold_timer'] = 0
524
-            own["grindHit"] = True
522
+
525 523
             #print("grinding")
526 524
             grind_height_dif = (own.worldPosition[2] - nearestObject.worldPosition[2]) - .287
527 525
             worldPos = own.worldPosition
@@ -529,6 +527,9 @@ def main():
529 527
                 grindvect(nearestObject)          
530 528
                 grindrotvel(nearestObject)
531 529
                 grind(nearestObject)
530
+                grindold = True
531
+                own['grindold_timer'] = 0
532
+                own["grindHit"] = True                
532 533
 
533 534
 
534 535
     else:

+ 21
- 2
walk.py View File

@@ -930,10 +930,12 @@ def throwdeck():
930 930
         wheel4act.visibility = False
931 931
         act = throw_deck_empty.actuators['throw_dec_act']
932 932
         if STANCE == True:
933
-            skater.playAction("fak_throw", 10,30, layer=29, priority=0, play_mode=0, speed=.5)
933
+            #skater.playAction("fak_throw", 10,30, layer=29, priority=0, play_mode=0, speed=.5)
934
+            own['requestAction'] = 'fak_throw'
934 935
             act.linearVelocity = [0.0, 5.0, 5.0]
935 936
         if STANCE == False:
936
-            skater.playAction("reg_throw", 10,30, layer=29, priority=0, play_mode=0, speed=.5)  
937
+            #skater.playAction("reg_throw", 10,30, layer=29, priority=0, play_mode=0, speed=.5)  
938
+            own['requestAction'] = 'fak_throw'
937 939
             act.linearVelocity = [0.0, 5.0, -5.0]  
938 940
         cont.activate(act)
939 941
     else:
@@ -1288,6 +1290,23 @@ if yBut == True:
1288 1290
     own['walk_idling'] = 0
1289 1291
     own["walk_idle_frame"] = 0
1290 1292
 
1293
+
1294
+if own['requestAction'] == None:
1295
+    if own['throw_deck'] == False:
1296
+        if STANCE == 1:
1297
+            own['requestAction'] = reg_idle
1298
+        else:
1299
+            own['requestAction'] = fak_idle        
1300
+    else:
1301
+        if STANCE == 1:
1302
+            own['requestAction'] = reg_idle_nb
1303
+        else:
1304
+            own['requestAction'] = fak_idle_nb                            
1305
+   
1306
+if deck.visible:
1307
+    own['deckvis'] = 1
1308
+else:
1309
+    own['deckvis'] = 0       
1291 1310
                     
1292 1311
 onboard() 
1293 1312
 jump()

Loading…
Cancel
Save