shuvit 6 years ago
parent
commit
6e430bf206
3 changed files with 19 additions and 6 deletions
  1. 2
    2
      co_ActionState.py
  2. 10
    1
      controller2.py
  3. 7
    3
      grindV2.py

+ 2
- 2
co_ActionState.py View File

@@ -312,7 +312,7 @@ def main():
312 312
                 deck.stopAction(trans_layer)
313 313
                 print("stopping loop and trans")                                
314 314
                 actionState = 'reg_land'
315
-                own['actionTimer'] = 39
315
+                own['actionTimer'] = 37
316 316
                 skater.playAction("reg_land", 1,20, layer=trans_layer, play_mode=0, speed=.5)
317 317
                 deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
318 318
                 trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)                        
@@ -325,7 +325,7 @@ def main():
325 325
                 skater.stopAction(trans_layer)
326 326
                 trucks.stopAction(trans_layer)
327 327
                 deck.stopAction(trans_layer)                                
328
-                own['actionTimer'] = 39
328
+                own['actionTimer'] = 37
329 329
                 skater.playAction("fak_land", 1,20, layer=trans_layer, play_mode=0, speed=.5)                        
330 330
                 deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
331 331
                 trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)        

+ 10
- 1
controller2.py View File

@@ -4152,6 +4152,7 @@ def air_mover():
4152 4152
             
4153 4153
             own.applyForce(force2, True)
4154 4154
             #own.applyForce([0,0,5], False)
4155
+            own['no_grind_pull'] = 1
4155 4156
     if r_ground.triggered == False and jump_timer > 10 and lUD > 0.075 and frames_since_grinding > 50:
4156 4157
         #print(lUD)
4157 4158
         print("air_mover", jump_timer)
@@ -4163,9 +4164,17 @@ def air_mover():
4163 4164
         own.applyForce(force2, True)
4164 4165
         own.applyForce([0,0,5], False)
4165 4166
         own['air_mover'] = True
4167
+        own['no_grind_pull'] = 1
4166 4168
     else:
4167
-        own['air_mover'] = False        
4169
+        own['air_mover'] = False 
4168 4170
         
4171
+        
4172
+framenum = own['framenum']
4173
+last_ground_frame = own['lF_ground_frame']
4174
+lF_air_frame = own['lF_air_frame']
4175
+frames_since_ground = framenum - lF_air_frame               
4176
+if framenum - lF_air_frame > 30:
4177
+    own['no_grind_pull'] = 0           
4169 4178
 #if grindHit == 1:
4170 4179
 #    skater.applyRotation([0,0,.05], False)
4171 4180
 #    deck.applyRotation([0,0,.05], False)

+ 7
- 3
grindV2.py View File

@@ -80,7 +80,11 @@ def main():
80 80
     #print("--------frame: ", own['framenum'])
81 81
     #inertia = player.linearVelocity
82 82
     #print(rotz)
83
-
83
+    try:
84
+        no_grind_pull = own['no_grind_pull']
85
+    except:    
86
+        own['no_grind_pull'] = 0
87
+        no_grind_pull = 0
84 88
     #no grind
85 89
     no_grind = 0
86 90
     if jump_timer > 50:
@@ -564,7 +568,7 @@ def main():
564 568
             #print('invertOn')
565 569
 
566 570
         grind_dist = .8#.6
567
-        if dist < grind_dist and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0 and invert_on == False and own['air_mover'] == False:
571
+        if dist < grind_dist and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0:
568 572
         #if grindold == 0 and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject:    
569 573
             print("new grind trigger")           
570 574
             npos = nearestObject.worldPosition
@@ -582,7 +586,7 @@ def main():
582 586
 
583 587
         #grind
584 588
         #print(dist)
585
-        if dist < grind_dist and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and own['airup'] == 0 and own['grindoutturn'] == 0 and own['grindjumpturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 50 and invert_on == False and own['air_mover'] == False:
589
+        if dist < grind_dist and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and own['airup'] == 0 and own['grindoutturn'] == 0 and own['grindjumpturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 50 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0:
586 590
             #print("grind")    
587 591
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
588 592
             if grindold == 0:

Loading…
Cancel
Save