shuvit 6 years ago
parent
commit
eb58766561
2 changed files with 45 additions and 13 deletions
  1. 42
    10
      co_ActionState.py
  2. 3
    3
      controller2.py

+ 42
- 10
co_ActionState.py View File

@@ -30,12 +30,14 @@ def main():
30 30
         actionState = own['actionState']
31 31
         l_actionState = own['l_actionState']
32 32
         requestAction = own['requestAction']
33
+        og_request = requestAction
33 34
         l_requestAction = own['l_requestAction']
34 35
         queueAction = own['queueAction']
35 36
         actionTimer = own['actionTimer']
36 37
     except:
37 38
         own['actionState'] = 'reg_walk'
38
-        own['l_actionState'] = 'empty'        
39
+        own['l_actionState'] = 'empty'  
40
+        og_request = 'empty'              
39 41
         own['requestAction'] = 'reg_walk'    
40 42
         own['l_requestAction'] = 'empty'
41 43
         own['queueAction'] = 'empty'
@@ -109,7 +111,8 @@ def main():
109 111
             own['l_actionState'] = requestAction
110 112
             actionState = requestAction
111 113
             own['actionTimer'] = 0
112
-            actionTimer = 0            
114
+            actionTimer = 0 
115
+    #print(own['manual_v2_timer'], 'man_timer###@!')                   
113 116
     if (own['l_requestAction'] == 'reg_air_nose' or own['l_requestAction'] == 'reg_air_tail' or own['l_requestAction'] == 'fak_air_nose' or own['l_requestAction'] == 'fak_air_tail') and (requestAction == 'reg_land' or requestAction == 'fak_land') and own['manual_v2_timer'] > 2:
114 117
     #if (requestAction == 'reg_land' or requestAction == 'fak_land') and own['manual_v2_timer'] > 2:
115 118
         requestAction = own['l_requestAction']
@@ -494,8 +497,36 @@ def main():
494 497
         if l_actionState in ('reg_air_tail', 'reg_air_nose') and requestAction in ('fak_opos', 'fak_nopos'):
495 498
             requestAction = 'reg_land'
496 499
         if l_actionState in ('fak_air_tail', 'fak_air_nose') and requestAction in ('reg_opos', 'reg_nopos'):
497
-            requestAction = 'fak_land'            
498
-                                                                                                                                                                                        
500
+            requestAction = 'fak_land'    
501
+            
502
+            
503
+        if l_actionState == 'reg_air' and requestAction == 'fak_air':
504
+            requestAction = 'reg_air'
505
+        if l_actionState == 'fak_air' and requestAction == 'reg_air':
506
+            requestAction = 'fak_air'   
507
+        if l_actionState == 'reg_air' and requestAction == 'fak_land':
508
+            requestAction = 'reg_land'
509
+        if l_actionState == 'fak_air' and requestAction == 'reg_land':
510
+            requestAction = 'fak_land'
511
+            
512
+        
513
+        if l_actionState == 'fak_5050-roll' and requestAction == 'reg_land':
514
+            requestAction = 'fak_land'
515
+        if l_actionState == 'reg_5050-roll' and requestAction == 'fak_land':
516
+            requestAction = 'reg_land'            
517
+        
518
+        
519
+        if requestAction in ('reg_pump', 'reg_opos', 'reg_nopos', 'reg_turnL', 'reg_turnR') and l_actionState in ('fak_nmanual_out', 'fak_manual_out'):
520
+            requestAction = 'fak-reg_roll'  
521
+        if requestAction in ('fak_pump', 'fak_opos', 'fak_nopos', 'fak_turnL', 'fak_turnR') and l_actionState in ('fak_nmanual_out', 'fak_manual_out'):
522
+            requestAction = 'reg-fak_roll'             
523
+                                             
524
+                                             
525
+        if l_actionState in ('reg_noseslide_out', 'regtailslide_out') and requestAction == ' fak_roll':
526
+            requestAction = 'reg-fak_roll'
527
+        if l_actionState in ('fak_noseslide_out', 'faktailslide_out') and requestAction == ' reg_roll':
528
+            requestAction = 'fak-reg_roll'            
529
+                                                                                                                                                        
499 530
     else:
500 531
         print("action over written")               
501 532
     def updateAction(requestAction, actionState):
@@ -1053,7 +1084,7 @@ def main():
1053 1084
                     skater.playAction("reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1054 1085
                     deck.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1055 1086
                     trucks.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1056
-                    own['actionTimer'] = cur_frame
1087
+                    #own['actionTimer'] = cur_frame
1057 1088
                 else:                      
1058 1089
                     skater.playAction("reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1059 1090
                     deck.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
@@ -1070,7 +1101,7 @@ def main():
1070 1101
                     skater.playAction("fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1071 1102
                     deck.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1072 1103
                     trucks.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1073
-                    own['actionTimer'] = cur_frame
1104
+                    #own['actionTimer'] = cur_frame
1074 1105
                 else:                      
1075 1106
                     skater.playAction("fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1076 1107
                     deck.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
@@ -1086,7 +1117,7 @@ def main():
1086 1117
                     skater.playAction("reg_nmanual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1087 1118
                     deck.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1088 1119
                     trucks.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1089
-                    own['actionTimer'] = cur_frame
1120
+                    #own['actionTimer'] = cur_frame
1090 1121
                 else:                      
1091 1122
                     skater.playAction("reg_nmanual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1092 1123
                     deck.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
@@ -1103,7 +1134,7 @@ def main():
1103 1134
                     skater.playAction("fak_nmanual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1104 1135
                     deck.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1105 1136
                     trucks.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1106
-                    own['actionTimer'] = cur_frame
1137
+                    #own['actionTimer'] = cur_frame
1107 1138
                 else:                      
1108 1139
                     skater.playAction("fak_nmanual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1109 1140
                     deck.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
@@ -3672,8 +3703,9 @@ def main():
3672 3703
     cur_frame = -1
3673 3704
     trans_playing = skater.isPlayingAction(trans_layer)
3674 3705
     if trans_playing:
3675
-        cur_frame = skater.getActionFrame(trans_layer)       
3676
-    #print("rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
3706
+        cur_frame = skater.getActionFrame(trans_layer)  
3707
+        cur_frame = round(cur_frame, 2)     
3708
+    print("oG: ", og_request, "rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
3677 3709
     cur_frame = skater.getActionFrame(trans_layer)
3678 3710
     #print(cur_frame)
3679 3711
     def printplaying():

+ 3
- 3
controller2.py View File

@@ -947,7 +947,7 @@ def main():
947 947
         lF_air_frame = own['lF_air_frame']
948 948
         frames_since_ground = own['framenum'] - own['lF_air_frame']     
949 949
 
950
-        if linVelocity.x < MAX_VEL and linVelocity.x >= -0 and STANCE == 1 and grindHit == False and frames_since_ground > 30:            
950
+        if linVelocity.x < MAX_VEL and linVelocity.x >= -0 and STANCE == 1 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:            
951 951
             countdown = COUNTDOWN
952 952
             yvel = linVelocity.x + SPEEDPUMP
953 953
             yvel2 = linVelocity.x + SPEEDPUMPFAST
@@ -960,7 +960,7 @@ def main():
960 960
                 own.setLinearVelocity(force2, local)
961 961
             own['requestAction'] = 'fak_pump'
962 962
         #switch
963
-        if linVelocity.x > -MAX_VEL and linVelocity.x <= 0 and STANCE == 0 and grindHit == False and frames_since_ground > 30:
963
+        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:
964 964
             countdown = COUNTDOWN
965 965
             yvel = linVelocity.x - SPEEDPUMP
966 966
             yvel2 = linVelocity.x - SPEEDPUMPFAST
@@ -2739,7 +2739,7 @@ def main():
2739 2739
     #34567
2740 2740
     own['set_revert_timer'] = 0
2741 2741
     ground_since = own["framenum"] - own['lF_air_frame']
2742
-    if ground_since > 40 and frames_since_grinding > 40:
2742
+    if ground_since > 80 and frames_since_grinding > 40:
2743 2743
 
2744 2744
         if q3oncdl < q4oncdl < q5oncdl < q6oncdl < q7oncdl:
2745 2745
             if r_ground.triggered == True:

Loading…
Cancel
Save