Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

cxhy 1 vuosi sitten
vanhempi
commit
34b59a1622

+ 3 - 3
Assets/Scripts/Comp/BattleMainComp.cs

@@ -28,9 +28,9 @@ namespace Comp
             SoundCore.Instance.PlaySound(SoundType.BattleBgmMain, SoundCtrl.BattleBgmPlayer, true, true);
             MessageComp.Instance.OnBattleClientMsg += OnClientMsg;
             MessageComp.Instance.OnBattlePlayerQuit += OnPlayerQuit;
-// #if UNITY_EDITOR
-//             _debug = true;
-// #endif
+#if UNITY_EDITOR
+            _debug = true;
+#endif
             if (_debug)
             {
                 var logs =

+ 1 - 1
Assets/Scripts/Comp/CockMoveComp.cs

@@ -15,7 +15,7 @@ namespace Comp
 
         private const float MovingSpeed = 0.5f; // 移动速度
 
-        private const float MovingTime = 0.6f; // 移动时间
+        private const float MovingTime = 0.4f; // 移动时间
 
         // 跳跃相关
         private const float HighJumpSpeed = 2.4f; // 高跳速度

+ 4 - 1
Assets/Scripts/Comp/LiftButtonComp.cs

@@ -16,8 +16,11 @@ namespace Comp
 
         private void Update()
         {
+            if (GameCore.Instance.localPlayer == null) return;
+            var lastHpPercent = (float)GameCore.Instance.localPlayer.runTimeHp / GameCore.Instance.localPlayer.hp;
             if (GameCore.Instance.GetCurState() != null && GameCore.Instance.battleState != null &&
-                GameCore.Instance.GetCurState() == GameCore.Instance.battleState && GameCore.Instance.liftTimes > 0)
+                GameCore.Instance.GetCurState() == GameCore.Instance.battleState && GameCore.Instance.liftTimes > 0 &&
+                lastHpPercent <= 0.5f)
             {
                 _button.interactable = true;
             }

+ 4 - 0
Assets/Scripts/Game/GameBattleState.cs

@@ -104,6 +104,10 @@ namespace Game
                 var attackCockActionComp = _gameCore.GetCockActionCompByPlayerId(log.from);
                 attackCockActionComp.SetHighJump(i == 0);
                 var counterattackCockActionComp = _gameCore.GetCockActionCompByPlayerId(log.to);
+                var counterattackPlayer = _gameCore.localPlayer.playerId == log.to
+                    ? _gameCore.localPlayer
+                    : _gameCore.antiPlayer;
+                counterattackPlayer.runTimeHp -= log.value;
                 if (i == 0 && log.value == 0) // 攻击落空了
                 {
                     counterattackCockActionComp.CreateMiss();