diff --git a/server/entities/characters/player.gd b/server/entities/characters/player.gd index 2a3a6cf6bad7ab9c29f527bf6b55c3b91dde0dda..fd3308578c7b973f4e3bfda520584615c8da2b9d 100644 --- a/server/entities/characters/player.gd +++ b/server/entities/characters/player.gd @@ -53,7 +53,8 @@ enum { ID_PUNCH_1 = 0, ID_PUNCH_2 = 1, ID_KICK_1 = 2, - ID_KICK_2 = 3 + ID_KICK_2 = 3, + ID_KICK_JUMP_SIDE = 4 } var lastPunchId:int = 0 # Detect a new punch (of any type) var idleTime:float = 0 # Stun when hit + prevent spam @@ -75,9 +76,11 @@ onready var kickHitArea:Area = $kickHitArea var kickAttackDmg:float = 10.0 var kick1AttackDist:float = 1.7 var kick2AttackDist:float = 1.4 +var kickJumpSideAttackDist:float = 1.2 var kickAttackWait:float = 0.75 var kick1AttackDuration:float = 0.2 var kick2AttackDuration:float = 0.3 +var kickJumpSideAttackDuration:float = 0.3 var kickAttackDirection:Vector3 = Vector3(1.2,1,0) var kickAttackStrength:float = 1 @@ -244,7 +247,7 @@ func processAttack(attackType:int): attack(ID_PUNCH_2) else: broadcastAnimation(ANIM_JUMP_KICK_SIDE) - attack(ID_KICK_1) + attack(ID_KICK_JUMP_SIDE) KICK: if self.is_on_floor(): if (!animSequence): @@ -255,6 +258,9 @@ func processAttack(attackType:int): broadcastAnimation(ANIM_KICK_2) animSequence = 0 attack(ID_KICK_2) + else: + broadcastAnimation(ANIM_JUMP_KICK_SIDE) + attack(ID_KICK_JUMP_SIDE) func attack(idAttack:int): @@ -277,9 +283,12 @@ func attack(idAttack:int): if (idAttack == ID_KICK_1): distance = kick1AttackDist duration = kick1AttackDuration - else: + elif (idAttack == ID_KICK_2): distance = kick2AttackDist duration = kick2AttackDuration + else: + distance = kickJumpSideAttackDist + duration = kickJumpSideAttackDuration # Set active the hitbox of the attack, its visual feedback on server hitArea.set_monitoring(true)