|
@@ -243,11 +243,11 @@ def main():
|
243
|
243
|
balance = 0
|
244
|
244
|
#print(balance)
|
245
|
245
|
#if ground_since > 0 and ground_since < 5 and jump_timer < 30:
|
246
|
|
- if ground_since > -1 and ground_since < 200:
|
|
246
|
+ if ground_since > -1 and ground_since < 60:
|
247
|
247
|
#print(balance, 'balance')
|
248
|
|
- sens = 1.8
|
249
|
|
- sens2 = .2
|
250
|
|
- sens3 = 1.2
|
|
248
|
+ sens = 2
|
|
249
|
+ sens2 = .8
|
|
250
|
+ sens3 = 1.5
|
251
|
251
|
if balance > sens or balance < - sens:
|
252
|
252
|
#fall
|
253
|
253
|
#if ground_since > -1 and ground_since < 10:
|
|
@@ -3649,11 +3649,14 @@ def main():
|
3649
|
3649
|
own['requestAction'] = 'fak_fp_rback'
|
3650
|
3650
|
|
3651
|
3651
|
def invert():
|
3652
|
|
- if grindHit == True and own['grindpos'] == 'reg_board' and gsf < 10:
|
3653
|
|
- if lBump == 1:
|
3654
|
|
- own['invert_on'] = 1
|
3655
|
|
- own.linearVelocity.x = 0
|
3656
|
|
- own.linearVelocity.y = 0
|
|
3652
|
+ if grindHit == True and own['grindpos'] == 'reg_board' and gsf < 10 and lBump == 1 and rBump == 0:
|
|
3653
|
+
|
|
3654
|
+ own['invert_on'] = 1
|
|
3655
|
+ own.linearVelocity.x = 0
|
|
3656
|
+ own.linearVelocity.y = 0
|
|
3657
|
+ else:
|
|
3658
|
+ if lBump == 0:
|
|
3659
|
+ own['invert_on'] = 0
|
3657
|
3660
|
if own["coping"] == 1 and own['invert_on'] == 1:
|
3658
|
3661
|
if own['invert_on'] == 1 and own['last_invert'] == False:
|
3659
|
3662
|
cont.activate(own.actuators['invertOn_sound'])
|
|
@@ -3677,7 +3680,7 @@ def main():
|
3677
|
3680
|
|
3678
|
3681
|
invert()
|
3679
|
3682
|
footplant()
|
3680
|
|
-
|
|
3683
|
+ #print(own['invert_on'], 'invert_on')
|
3681
|
3684
|
def reset_pos():
|
3682
|
3685
|
#reset
|
3683
|
3686
|
if ddPad == 1:
|
|
@@ -4067,8 +4070,8 @@ def main():
|
4067
|
4070
|
cont.deactivate(own.actuators['grindoutLeft'])
|
4068
|
4071
|
if (LAST_GRIND == True and jumping == None and sincegrinding > 35 and ground_since > 20) or own['invert_on'] == True and LAST_GRIND == 1:
|
4069
|
4072
|
outloc = 0.022
|
4070
|
|
- bsoutloc = .07
|
4071
|
|
- bsoutvel = .1
|
|
4073
|
+ bsoutloc = .001#.07
|
|
4074
|
+ bsoutvel = .01#.1
|
4072
|
4075
|
outrot = .06#2 #0.012
|
4073
|
4076
|
outrot2 = .24
|
4074
|
4077
|
outact = own.actuators["grindoutRight"]
|
|
@@ -4155,17 +4158,17 @@ def main():
|
4155
|
4158
|
if STANCE == True:
|
4156
|
4159
|
if own['footplant_on'] == True:
|
4157
|
4160
|
own.setLinearVelocity([(outvel.x + bsoutvel), outvel.y, outvel.z], 1)
|
4158
|
|
- cont.activate(own.actuators["grindoutRight"])
|
|
4161
|
+ #cont.activate(own.actuators["grindoutRight"])
|
4159
|
4162
|
if own['grind_out_type'] == None:
|
4160
|
4163
|
own['grind_out_type'] = 'bs fak forward'
|
4161
|
|
- own.applyRotation((0, .15, 0), True)
|
|
4164
|
+ #own.applyRotation((0, .15, 0), True)
|
4162
|
4165
|
if STANCE == False:
|
4163
|
4166
|
if own['footplant_on'] == True:
|
4164
|
4167
|
own.setLinearVelocity([(outvel.x + -bsoutvel), outvel.y, outvel.z], 1)
|
4165
|
|
- cont.activate(own.actuators["grindoutRight"])
|
|
4168
|
+ #cont.activate(own.actuators["grindoutRight"])
|
4166
|
4169
|
if own['grind_out_type'] == None:
|
4167
|
4170
|
own['grind_out_type'] = 'bs reg forward'
|
4168
|
|
- own.applyRotation((0, -.15, 0), True)
|
|
4171
|
+ #own.applyRotation((0, -.15, 0), True)
|
4169
|
4172
|
own["grindoutturn"] = gotcd
|
4170
|
4173
|
own['invert_on'] = 0
|
4171
|
4174
|
if lq1on or lq2on or lq3on or lq4on or lq5on or lq6on or lq7on or lq8on:
|
|
@@ -4187,7 +4190,7 @@ def main():
|
4187
|
4190
|
reg_rot = 0.02#2
|
4188
|
4191
|
reg_rot2 = .26
|
4189
|
4192
|
reg_move2 = .13
|
4190
|
|
- bsforce = 50
|
|
4193
|
+ bsforce = 1#50
|
4191
|
4194
|
bs_dloc = .04
|
4192
|
4195
|
outvel = own.linearVelocity
|
4193
|
4196
|
if own["coping"] == 1:
|
|
@@ -4529,12 +4532,13 @@ def main():
|
4529
|
4532
|
if localHitDist < .4:
|
4530
|
4533
|
if own['jump_timer'] < 30:
|
4531
|
4534
|
own.localLinearVelocity.z *= .9
|
|
4535
|
+
|
4532
|
4536
|
#if localHitDist < .287:
|
4533
|
|
- if localHitDist < .32:
|
|
4537
|
+ if localHitDist < .295:
|
4534
|
4538
|
if own['jump_timer'] < 30:
|
4535
|
4539
|
own.localLinearVelocity.z = 0
|
4536
|
|
- #own.applyMovement((0, 0, (.287 - (localHitDist))), True)
|
4537
|
|
- own.applyMovement((0, 0, (.32 - (localHitDist))), True)
|
|
4540
|
+ own.applyMovement((0, 0, (.295 - (localHitDist))), True)
|
|
4541
|
+ #own.applyMovement((0, 0, (.32 - (localHitDist))), True)
|
4538
|
4542
|
#own.applyMovement((0, 0, (.5 - localHitDist)), True)
|
4539
|
4543
|
#print('moving new ray a')
|
4540
|
4544
|
#if localRay[2] != [0, 0, -1] and grindHit == 0:
|
|
@@ -4580,9 +4584,12 @@ def main():
|
4580
|
4584
|
End = Vector.copy(own.worldPosition + (own.worldOrientation.col[Axis]*Distance))
|
4581
|
4585
|
Start = Vector.copy(own.worldPosition)
|
4582
|
4586
|
localRay_v = own.rayCast(End, Start, 0, 'vert', 1, 0, 0, 61439)
|
4583
|
|
- if localRay_v[0] and own['LAST_GRIND'] == False and rBump == 0 and ((own['framenum'] - own['last_transition_frame'] < 10) or (own['framenum'] - own['last_vert_frame'] < 10)):
|
|
4587
|
+
|
|
4588
|
+ if lBump == 1 and rBump == 1:
|
|
4589
|
+ own.alignAxisToVect([0.0, 0.0, 1.0], 2, .05)
|
|
4590
|
+ if localRay_v[0] and own['LAST_GRIND'] == False and rBump == 0 and lBump == 0 and ((own['framenum'] - own['last_transition_frame'] < 10) or (own['framenum'] - own['last_vert_frame'] < 10)):
|
4584
|
4591
|
own['vert'] = 1
|
4585
|
|
- print('vert hit')
|
|
4592
|
+ #print('vert hit')
|
4586
|
4593
|
own['last_vert_frame'] = own['framenum']
|
4587
|
4594
|
localHitDist = Vector.copy(Start - localRay_v[1]).length
|
4588
|
4595
|
own.linearVelocity.x *= .98
|
|
@@ -4624,7 +4631,7 @@ def main():
|
4624
|
4631
|
print('rayb hit')
|
4625
|
4632
|
|
4626
|
4633
|
|
4627
|
|
- if not aligned:
|
|
4634
|
+ if not aligned or (lBump == 1):
|
4628
|
4635
|
own.alignAxisToVect([0.0, 0.0, 1.0], 2, .00003)
|
4629
|
4636
|
|
4630
|
4637
|
if own.linearVelocity.x > 12:
|
|
@@ -4636,34 +4643,55 @@ def main():
|
4636
|
4643
|
|
4637
|
4644
|
|
4638
|
4645
|
|
|
4646
|
+ if own['actionState'] in ['frontside_grab_out', 'backside_grab_out', 'frontside_nose_grab_out', 'frontside_tail_grab_out', 'backside_nose_grab_out', 'backside_tail_grab_out', 'reg_walk_air_out', 'reg_air-walk_air', 'reg_judo_out', 'reg_frigid_out', 'reg_fsonefoot_out', 'reg_onefoot_out', 'reg_airwalk_out'] and own['requestAction'] in ['fak_land', 'reg_land']:
|
|
4647
|
+ own['requestAction'] = 'reg_land'
|
|
4648
|
+
|
|
4649
|
+ elif own['actionState'] in ['fak_backside_grab_out', 'fak_frontside_grab_out', 'fak_frontside_nose_grab_out', 'fak_frontside_tail_grab_out', 'fak_backside_nose_grab_out', 'fak_backside_tail_grab_out', 'fak_walk_air_out', 'fak_air-walk_air', 'fak_judo_out', 'fak_frigid_out', 'fak_fsonefoot_out', 'fak_onefoot_out'] and own['requestAction'] in ['reg_land', 'fak_land']:
|
|
4650
|
+ own['requestAction'] = 'fak_land'
|
|
4651
|
+
|
|
4652
|
+
|
|
4653
|
+
|
|
4654
|
+
|
4639
|
4655
|
if own['requestAction'] == 'reg_land':
|
4640
|
4656
|
print('*****************ra', land_overRideL, land_overRideR, land_overRideLb, land_overRideRb)
|
4641
|
4657
|
if land_overRideL == True:
|
4642
|
4658
|
own['requestAction'] = 'reg_landL'
|
4643
|
4659
|
print('requesting unbalanced land1')
|
|
4660
|
+ own['lland'] = own['requestAction']
|
4644
|
4661
|
elif land_overRideR == True:
|
4645
|
4662
|
own['requestAction'] = 'reg_landR'
|
4646
|
4663
|
print('requesting unbalanced land2')
|
4647
|
|
- if land_overRideLb == True:
|
|
4664
|
+ own['lland'] = own['requestAction']
|
|
4665
|
+ elif land_overRideLb == True:
|
4648
|
4666
|
own['requestAction'] = 'reg_landLb'
|
4649
|
4667
|
print('requesting unbalanced land1b')
|
|
4668
|
+ own['lland'] = own['requestAction']
|
4650
|
4669
|
elif land_overRideRb == True:
|
4651
|
4670
|
own['requestAction'] = 'reg_landRb'
|
4652
|
4671
|
print('requesting unbalanced land2b')
|
|
4672
|
+ own['lland'] = own['requestAction']
|
|
4673
|
+ else:
|
|
4674
|
+ own['lland'] = own['requestAction']
|
4653
|
4675
|
|
4654
|
4676
|
if own['requestAction'] == 'fak_land':
|
4655
|
4677
|
print('*****************ra', land_overRideL, land_overRideR, land_overRideLb, land_overRideRb)
|
4656
|
4678
|
if land_overRideL == True:
|
4657
|
4679
|
own['requestAction'] = 'fak_landL'
|
4658
|
|
- print('requesting unbalanced land1')
|
|
4680
|
+ print('requesting unbalanced landf1')
|
|
4681
|
+ own['lland'] = own['requestAction']
|
4659
|
4682
|
elif land_overRideR == True:
|
4660
|
4683
|
own['requestAction'] = 'fak_landR'
|
4661
|
|
- print('requesting unbalanced land2')
|
4662
|
|
- if land_overRideLb == True:
|
|
4684
|
+ print('requesting unbalanced landf2')
|
|
4685
|
+ own['lland'] = own['requestAction']
|
|
4686
|
+ elif land_overRideLb == True:
|
4663
|
4687
|
own['requestAction'] = 'fak_landLb'
|
4664
|
|
- print('requesting unbalanced land1b')
|
|
4688
|
+ print('requesting unbalanced landf1b')
|
|
4689
|
+ own['lland'] = own['requestAction']
|
4665
|
4690
|
elif land_overRideRb == True:
|
4666
|
4691
|
own['requestAction'] = 'fak_landRb'
|
4667
|
|
- print('requesting unbalanced land2b')
|
4668
|
|
- if own['requestAction'] in ['fak_land', 'reg_land', 'fak_landL', 'reg_landR', 'fak_landRb', 'reg_landLb']:
|
4669
|
|
- own['lland'] = own['requestAction']
|
|
4692
|
+ print('requesting unbalanced landf2b')
|
|
4693
|
+ own['lland'] = own['requestAction']
|
|
4694
|
+ else:
|
|
4695
|
+ own['lland'] = own['requestAction']
|
|
4696
|
+ # if own['requestAction'] in ['fak_land', 'reg_land', 'fak_landL', 'fak_landLb', 'reg_landR', 'reg_landRb', 'fak_landR' 'fak_landRb', 'reg_landL', 'reg_landLb']:
|
|
4697
|
+
|