Browse Source

everythings broke

shuvit 5 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,11 +559,15 @@ def main():
559 559
         LAST_RIGHT = own["LAST_RIGHT"]
560 560
         own["LAST_RIGHT"] = 0  
561 561
         
562
-    def reg_stance_on():
562
+    def reg_stance_on(inc):
563 563
         #revert_timer
564 564
         playing = deck.isPlayingAction(40)
565 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 571
     def reg_stance_off():
568 572
         pass 
569 573
         
@@ -612,7 +616,10 @@ def main():
612 616
                     
613 617
     def reg_stance_left_on():
614 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 623
             LAST_LEFT = own["LAST_LEFT"]
617 624
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
618 625
             if LAST_LEFT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
@@ -622,23 +629,32 @@ def main():
622 629
              
623 630
     def reg_stance_right_on():
624 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 636
             LAST_RIGHT = own["LAST_RIGHT"]
627 637
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
628 638
             if LAST_RIGHT == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
629 639
                 LAST_RIGHT = 1
630 640
             own["LAST_RIGHT"] = 1                   
631 641
        
632
-    def fak_stance_on():
642
+    def fak_stance_on(inc):
633 643
         playing = deck.isPlayingAction(40)
634 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 649
     def fak_stance_off():
637 650
         pass
638 651
         
639 652
     def fak_stance_left_on():
640 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 658
             LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
643 659
             playing_action_frame = skater.getActionFrame(LAND_LAYER)
644 660
             if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
@@ -650,7 +666,10 @@ def main():
650 666
         
651 667
     def fak_stance_right_on():
652 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 673
             LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
655 674
             own["LAST_RIGHT_FAK"] = 1        
656 675
     def fak_stance_right_off():
@@ -681,6 +700,10 @@ def main():
681 700
         #print(flipping)
682 701
         #ground
683 702
         ground_since = own["framenum"] - own['lF_air_frame']
703
+        inc = 0
704
+        if rot.z < .98:
705
+            inc = 1
706
+        
684 707
         if r_ground.triggered == True and grindHit == False and flipping == False and own["wallride"] == None and own['revert_timer'] < 2:    
685 708
             if STANCE == 0:
686 709
                 reg_manual = own['reg_manual']
@@ -696,7 +719,7 @@ def main():
696 719
                     if last_manual == 1:
697 720
                         reg_manual_off()                   
698 721
                         fak_manual_off()
699
-                    reg_stance_on()
722
+                    reg_stance_on(inc)
700 723
                 if own['manual_v2_type'] == 'reg manual':    
701 724
                     reg_manual_on()                   
702 725
                 elif own['manual_v2_type'] == 'reg nose manual':    
@@ -719,7 +742,7 @@ def main():
719 742
                     if last_manual == 1:
720 743
                         fak_manual_off()
721 744
                         reg_manual_off()
722
-                    fak_stance_on()                    
745
+                    fak_stance_on(inc)                    
723 746
                 if own['manual_v2_type'] == 'fak manual':
724 747
                     fak_manual_on()
725 748
                 elif own['manual_v2_type'] == 'fak nose manual':
@@ -728,24 +751,23 @@ def main():
728 751
                     reg_manual_on()
729 752
                 elif own['manual_v2_type'] == 'reg nose manual':
730 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 771
         #air
750 772
         playing = deck.isPlayingAction(fliplay)
751 773
         if r_ground.triggered == False and playing == False and flipping == False:
@@ -883,7 +905,7 @@ def main():
883 905
 
884 906
     def pump():
885 907
         velocity = own['velocity']
886
-        #regular
908
+        #switch
887 909
         local = True
888 910
         downforce = -.1        
889 911
         lF_air_frame = own['lF_air_frame']
@@ -899,8 +921,9 @@ def main():
899 921
                 own.setLinearVelocity(force, local)
900 922
             if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
901 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 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 928
             countdown = COUNTDOWN
906 929
             yvel = linVelocity.x - SPEEDPUMP
@@ -912,7 +935,8 @@ def main():
912 935
                 own.setLinearVelocity(force, local)
913 936
             if rot.z < PUMP_SENS and rot.z <= PUMP_SPEED_SENS:
914 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 940
         own["Pump"] = True
917 941
         own["lastPump"] = True
918 942
                 
@@ -1806,7 +1830,7 @@ def main():
1806 1830
     def turn():   
1807 1831
         rotamt = .02
1808 1832
         linVelocity2 = own.getLinearVelocity(True)
1809
-        speed = .002
1833
+        speed = .004
1810 1834
         manual = 0
1811 1835
         if own['manual_v2'] == 1:     
1812 1836
             manual = 1       
@@ -2213,10 +2237,14 @@ def main():
2213 2237
         if r_ground.positive:
2214 2238
             if 'ramp' in r_ground.hitObject:
2215 2239
                 own['onramp'] = 1
2240
+                own['last_ramp'] = frame
2216 2241
             else:
2217 2242
                 own['onramp'] = 0   
2218 2243
         else:
2219
-            own['onramp'] = 0        
2244
+            own['onramp'] = 0   
2245
+    #num = frame - own['last_ramp']
2246
+    #print(num)             
2247
+    
2220 2248
     def grindtype(gtype):
2221 2249
         own['grindType'] = gtype
2222 2250
         
@@ -2607,6 +2635,8 @@ def main():
2607 2635
 
2608 2636
     def killopos():
2609 2637
         pass    
2638
+    
2639
+
2610 2640
                     
2611 2641
     stopAnims() 
2612 2642
     #nextframe()  

+ 1
- 0
scene_init.py View File

@@ -152,5 +152,6 @@ def main():
152 152
     cam['dof_on'] = dict['dof_on']
153 153
     cam['bloom_on'] = dict['bloom_on'] 
154 154
     own['grindnew_timer'] = 0   
155
+    own['last_ramp'] = 0
155 156
            
156 157
 main()

Loading…
Cancel
Save