Browse Source

everythings broke

shuvit 6 years ago
parent
commit
5930487841
3 changed files with 339 additions and 55 deletions
  1. 274
    21
      co_ActionState.py
  2. 64
    34
      controller2.py
  3. 1
    0
      scene_init.py

+ 274
- 21
co_ActionState.py
File diff suppressed because it is too large
View File


+ 64
- 34
controller2.py View File

559
         LAST_RIGHT = own["LAST_RIGHT"]
559
         LAST_RIGHT = own["LAST_RIGHT"]
560
         own["LAST_RIGHT"] = 0  
560
         own["LAST_RIGHT"] = 0  
561
         
561
         
562
-    def reg_stance_on():
562
+    def reg_stance_on(inc):
563
         #revert_timer
563
         #revert_timer
564
         playing = deck.isPlayingAction(40)
564
         playing = deck.isPlayingAction(40)
565
         if own["revert_timer"] < 1 and own['manual_v2'] == 0 and playing == 0:
565
         if own["revert_timer"] < 1 and own['manual_v2'] == 0 and playing == 0:
566
-            own['requestAction'] = 'reg_roll'
566
+            if inc == 1:
567
+                print('inc stance')
568
+                own['requestAction'] = 'reg_pump'
569
+            else:    
570
+                own['requestAction'] = 'reg_roll'
567
     def reg_stance_off():
571
     def reg_stance_off():
568
         pass 
572
         pass 
569
         
573
         
612
                     
616
                     
613
     def reg_stance_left_on():
617
     def reg_stance_left_on():
614
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
618
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
615
-            own['requestAction'] = 'reg_turnLeft'    
619
+            if own["Pump"] == 1:
620
+                own['requestAction'] = 'reg_pump_left'
621
+            else:    
622
+                own['requestAction'] = 'reg_turnLeft'    
616
             LAST_LEFT = own["LAST_LEFT"]
623
             LAST_LEFT = own["LAST_LEFT"]
617
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
624
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
618
             if LAST_LEFT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
625
             if LAST_LEFT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
622
              
629
              
623
     def reg_stance_right_on():
630
     def reg_stance_right_on():
624
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
631
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
625
-            own['requestAction'] = 'reg_turnRight' 
632
+            if own["Pump"] == 1:
633
+                own['requestAction'] = 'reg_pump_right'
634
+            else:               
635
+                own['requestAction'] = 'reg_turnRight' 
626
             LAST_RIGHT = own["LAST_RIGHT"]
636
             LAST_RIGHT = own["LAST_RIGHT"]
627
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
637
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
628
             if LAST_RIGHT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
638
             if LAST_RIGHT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
629
                 LAST_RIGHT = 1
639
                 LAST_RIGHT = 1
630
             own["LAST_RIGHT"] = 1                   
640
             own["LAST_RIGHT"] = 1                   
631
        
641
        
632
-    def fak_stance_on():
642
+    def fak_stance_on(inc):
633
         playing = deck.isPlayingAction(40)
643
         playing = deck.isPlayingAction(40)
634
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and playing == 0 and own['gt_cd2'] < 1:
644
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and playing == 0 and own['gt_cd2'] < 1:
635
-            own['requestAction'] = 'fak_roll'
645
+            if inc == 1:
646
+                own['requestAction'] = 'fak_pump'
647
+            else:    
648
+                own['requestAction'] = 'fak_roll'
636
     def fak_stance_off():
649
     def fak_stance_off():
637
         pass
650
         pass
638
         
651
         
639
     def fak_stance_left_on():
652
     def fak_stance_left_on():
640
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
653
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
641
-            own['requestAction'] = 'fak_turnLeft'     
654
+            if own["Pump"] == 1:
655
+                own['requestAction'] = 'fak_pump_left'
656
+            else:               
657
+                own['requestAction'] = 'fak_turnLeft'     
642
             LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
658
             LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
643
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
659
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
644
             if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
660
             if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
650
         
666
         
651
     def fak_stance_right_on():
667
     def fak_stance_right_on():
652
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
668
         if own['manual_v2'] == 0 and own["revert_timer"] < 1 and own['gt_cd2'] < 1 and ground_since > 30:
653
-            own['requestAction'] = 'fak_turnRight' 
669
+            if own["Pump"] == 1:
670
+                own['requestAction'] = 'fak_pump_right'
671
+            else:               
672
+                own['requestAction'] = 'fak_turnRight' 
654
             LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
673
             LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
655
             own["LAST_RIGHT_FAK"] = 1        
674
             own["LAST_RIGHT_FAK"] = 1        
656
     def fak_stance_right_off():
675
     def fak_stance_right_off():
681
         #print(flipping)
700
         #print(flipping)
682
         #ground
701
         #ground
683
         ground_since = own["framenum"] - own['lF_air_frame']
702
         ground_since = own["framenum"] - own['lF_air_frame']
703
+        inc = 0
704
+        if rot.z < .98:
705
+            inc = 1
706
+        
684
         if r_ground.triggered == True and grindHit == False and flipping == False and own["wallride"] == None and own['revert_timer'] < 2:    
707
         if r_ground.triggered == True and grindHit == False and flipping == False and own["wallride"] == None and own['revert_timer'] < 2:    
685
             if STANCE == 0:
708
             if STANCE == 0:
686
                 reg_manual = own['reg_manual']
709
                 reg_manual = own['reg_manual']
696
                     if last_manual == 1:
719
                     if last_manual == 1:
697
                         reg_manual_off()                   
720
                         reg_manual_off()                   
698
                         fak_manual_off()
721
                         fak_manual_off()
699
-                    reg_stance_on()
722
+                    reg_stance_on(inc)
700
                 if own['manual_v2_type'] == 'reg manual':    
723
                 if own['manual_v2_type'] == 'reg manual':    
701
                     reg_manual_on()                   
724
                     reg_manual_on()                   
702
                 elif own['manual_v2_type'] == 'reg nose manual':    
725
                 elif own['manual_v2_type'] == 'reg nose manual':    
719
                     if last_manual == 1:
742
                     if last_manual == 1:
720
                         fak_manual_off()
743
                         fak_manual_off()
721
                         reg_manual_off()
744
                         reg_manual_off()
722
-                    fak_stance_on()                    
745
+                    fak_stance_on(inc)                    
723
                 if own['manual_v2_type'] == 'fak manual':
746
                 if own['manual_v2_type'] == 'fak manual':
724
                     fak_manual_on()
747
                     fak_manual_on()
725
                 elif own['manual_v2_type'] == 'fak nose manual':
748
                 elif own['manual_v2_type'] == 'fak nose manual':
728
                     reg_manual_on()
751
                     reg_manual_on()
729
                 elif own['manual_v2_type'] == 'reg nose manual':
752
                 elif own['manual_v2_type'] == 'reg nose manual':
730
                     reg_nmanual_on()                     
753
                     reg_nmanual_on()                     
731
-            if own["Pump"] == False:
732
-                
733
-                if (lLR < -turnsens or dict['kb_la'] == 2) and STANCE == 0:
734
-                    reg_stance_left_on()
735
-                if lLR > -turnsens or LAST_GRIND != grindHit or dict['kb_la'] == 0:
736
-                    reg_stance_left_off()    
737
-                if (lLR > turnsens or dict['kb_ra'] == 2) and STANCE == 0:
738
-                    reg_stance_right_on()
739
-                if lLR < turnsens or LAST_GRIND != grindHit or dict['kb_ra'] == 0:
740
-                    reg_stance_right_off()   
741
-                if (lLR < -turnsens or dict['kb_la'] == 2) and STANCE == 1: 
742
-                    fak_stance_left_on()
743
-                if lLR > -turnsens or LAST_GRIND != grindHit or dict['kb_la'] == 0:
744
-                    fak_stance_left_off()    
745
-                if (lLR > turnsens or dict['kb_ra'] == 2) and STANCE == 1:
746
-                    fak_stance_right_on()
747
-                if lLR < turnsens or LAST_GRIND != grindHit or dict['kb_ra'] == 0:
748
-                    fak_stance_right_off()                       
754
+            #if own["Pump"] == False:
755
+            if (lLR < -turnsens or dict['kb_la'] == 2) and STANCE == 0:
756
+                reg_stance_left_on()
757
+            if lLR > -turnsens or LAST_GRIND != grindHit or dict['kb_la'] == 0:
758
+                reg_stance_left_off()    
759
+            if (lLR > turnsens or dict['kb_ra'] == 2) and STANCE == 0:
760
+                reg_stance_right_on()
761
+            if lLR < turnsens or LAST_GRIND != grindHit or dict['kb_ra'] == 0:
762
+                reg_stance_right_off()   
763
+            if (lLR < -turnsens or dict['kb_la'] == 2) and STANCE == 1: 
764
+                fak_stance_left_on()
765
+            if lLR > -turnsens or LAST_GRIND != grindHit or dict['kb_la'] == 0:
766
+                fak_stance_left_off()    
767
+            if (lLR > turnsens or dict['kb_ra'] == 2) and STANCE == 1:
768
+                fak_stance_right_on()
769
+            if lLR < turnsens or LAST_GRIND != grindHit or dict['kb_ra'] == 0:
770
+                fak_stance_right_off()                       
749
         #air
771
         #air
750
         playing = deck.isPlayingAction(fliplay)
772
         playing = deck.isPlayingAction(fliplay)
751
         if r_ground.triggered == False and playing == False and flipping == False:
773
         if r_ground.triggered == False and playing == False and flipping == False:
883
 
905
 
884
     def pump():
906
     def pump():
885
         velocity = own['velocity']
907
         velocity = own['velocity']
886
-        #regular
908
+        #switch
887
         local = True
909
         local = True
888
         downforce = -.1        
910
         downforce = -.1        
889
         lF_air_frame = own['lF_air_frame']
911
         lF_air_frame = own['lF_air_frame']
899
                 own.setLinearVelocity(force, local)
921
                 own.setLinearVelocity(force, local)
900
             if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
922
             if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
901
                 own.setLinearVelocity(force2, local)
923
                 own.setLinearVelocity(force2, local)
902
-            own['requestAction'] = 'fak_pump'
903
-        #switch
924
+            if own['requestAction'] not in ['fak_pump_left', 'fak_pump_right'] and own['l_actionState'] not in ['fak_turnLeft', 'fak_turnRight']:
925
+                own['requestAction'] = 'fak_pump'
926
+        #reg
904
         if linVelocity.x > -MAX_VEL and linVelocity.x <= 0 and STANCE == 0 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
927
         if linVelocity.x > -MAX_VEL and linVelocity.x <= 0 and STANCE == 0 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
905
             countdown = COUNTDOWN
928
             countdown = COUNTDOWN
906
             yvel = linVelocity.x - SPEEDPUMP
929
             yvel = linVelocity.x - SPEEDPUMP
912
                 own.setLinearVelocity(force, local)
935
                 own.setLinearVelocity(force, local)
913
             if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
936
             if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
914
                 own.setLinearVelocity(force2, local)
937
                 own.setLinearVelocity(force2, local)
915
-            own['requestAction'] = 'reg_pump'    
938
+            if own['requestAction'] not in ['reg_pump_left', 'reg_pump_right'] and own['l_actionState'] not in ['reg_turnLeft', 'reg_turnRight']:  
939
+                own['requestAction'] = 'reg_pump'    
916
         own["Pump"] = True
940
         own["Pump"] = True
917
         own["lastPump"] = True
941
         own["lastPump"] = True
918
                 
942
                 
1806
     def turn():   
1830
     def turn():   
1807
         rotamt = .02
1831
         rotamt = .02
1808
         linVelocity2 = own.getLinearVelocity(True)
1832
         linVelocity2 = own.getLinearVelocity(True)
1809
-        speed = .002
1833
+        speed = .004
1810
         manual = 0
1834
         manual = 0
1811
         if own['manual_v2'] == 1:     
1835
         if own['manual_v2'] == 1:     
1812
             manual = 1       
1836
             manual = 1       
2213
         if r_ground.positive:
2237
         if r_ground.positive:
2214
             if 'ramp' in r_ground.hitObject:
2238
             if 'ramp' in r_ground.hitObject:
2215
                 own['onramp'] = 1
2239
                 own['onramp'] = 1
2240
+                own['last_ramp'] = frame
2216
             else:
2241
             else:
2217
                 own['onramp'] = 0   
2242
                 own['onramp'] = 0   
2218
         else:
2243
         else:
2219
-            own['onramp'] = 0        
2244
+            own['onramp'] = 0   
2245
+    #num = frame - own['last_ramp']
2246
+    #print(num)             
2247
+    
2220
     def grindtype(gtype):
2248
     def grindtype(gtype):
2221
         own['grindType'] = gtype
2249
         own['grindType'] = gtype
2222
         
2250
         
2607
 
2635
 
2608
     def killopos():
2636
     def killopos():
2609
         pass    
2637
         pass    
2638
+    
2639
+
2610
                     
2640
                     
2611
     stopAnims() 
2641
     stopAnims() 
2612
     #nextframe()  
2642
     #nextframe()  

+ 1
- 0
scene_init.py View File

152
     cam['dof_on'] = dict['dof_on']
152
     cam['dof_on'] = dict['dof_on']
153
     cam['bloom_on'] = dict['bloom_on'] 
153
     cam['bloom_on'] = dict['bloom_on'] 
154
     own['grindnew_timer'] = 0   
154
     own['grindnew_timer'] = 0   
155
+    own['last_ramp'] = 0
155
            
156
            
156
 main()
157
 main()

Loading…
Cancel
Save