From 9e91c51e4ece0002b58e22e27ec57fd8d23176a9 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 29 八月 2025 15:24:42 +0800
Subject: [PATCH] 125 【战斗】战斗系统 协议更新
---
Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs | 74 +++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 3 deletions(-)
diff --git a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs b/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
index 9216cdf..228ea08 100644
--- a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
+++ b/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
@@ -1,11 +1,14 @@
using UnityEngine;
+// 鍙湁涓荤嚎鎴樻枟鐢ㄥ埌 鎵�浠ヨ繖閲屽彲鑳戒細鏀句竴浜涗富绾跨殑鐗规畩澶勭悊
public class HandModeOperationAgent : IOperationAgent
{
+ protected StoryBattleField storyBattleField;
+
public HandModeOperationAgent(BattleField battleField) : base(battleField)
{
-
+ storyBattleField = battleField as StoryBattleField;
}
public override void Run()
@@ -16,15 +19,80 @@
// 閫氳繃涓荤晫闈㈢殑鎸夐挳鎺ㄥ姩(璋冪敤)DoNext
public override void DoNext()
{
+ BattleDebug.LogError("HandModeOperationAgent DoNext");
+
base.DoNext();
+ // 褰撳墠娌℃湁鍦ㄦ挱鏀炬垬鏂楀綍鍍�
if (!battleField.recordPlayer.IsPlaying())
{
- // ask for next action
+ BattleDebug.LogError("HandModeOperationAgent DoNext 1");
+ // 娌℃湁涓嬩竴涓寘鍙互鍙戜簡
+ if (!BattleManager.Instance.DistributeNextPackage())
+ {
+ // 璇锋眰涓嬩竴涓垬鏂楀寘 鎴栬�呮鏌ユ垬鏂楁槸鍚︾粨鏉�
+ // ReqType; // 0-鍋滄鎴樻枟鍥炲煄锛�1-璁剧疆娑堣�楀�嶅�硷紱2-鎸戞垬鍏冲崱灏忔�紱3-鎸戞垬鍏冲崱boss锛�4-缁х画鎴樻枟锛�
+
+ // 濡傛灉鍦ㄤ紤鎭� 鐐逛竴涓嬩箣鍚庡簲璇ユ槸鎸戞垬灏忔�垨鑰呮寫鎴樺叧鍗�
+ // 濡傛灉鍦ㄦ垬鏂� 鎴樻枟鏄惁缁撴潫/鎴樻枟鎸佺画涓� 缁撴潫搴旇鏄寫鎴樹笅涓�鍏� 鎸佺画搴旇鏄户缁垬鏂�
+
+
+ // 妫�鏌ヤ竴涓嬮敜瀛愮殑娑堣��
+ //useHarmerCount 鐢ㄤ簬璁板綍娑堣�楁垬閿ゅ�嶆暟锛屽皬浜庣瓑浜�1鏃堕粯璁�1鍊嶏紝澶т簬1鏃朵负瀵瑰簲娑堣�楀�嶅�硷紝0418鍒锋柊绫诲瀷22
+ BattleDebug.LogError("HandModeOperationAgent DoNext 2");
+ long costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.UseHarmerCount);
+
+ long cost = (costRate > 1 ? costRate : 1) * 1; // 1鏄粯璁ゆ秷鑰�
+
+
+
+ BattleDebug.LogError("HandModeOperationAgent DoNext 3");
+ byte reqType;
+
+ if (storyBattleField.battleState == StoryBattleState.Break)
+ {
+ reqType = 2;
+ }
+ else if (storyBattleField.battleState == StoryBattleState.Battle)
+ {
+ if (battleField.IsBattleEnd())
+ {
+ reqType = 2; // 缁х画鎸戞垬灏忔��
+ }
+ else
+ {
+ reqType = 4; // 缁х画鎴樻枟
+ }
+ }
+ else
+ {
+ BattleDebug.LogError("unknown battle state");
+ return;
+ }
+
+ BattleDebug.LogError("HandModeOperationAgent DoNext 4 reqType is " + reqType);
+
+ // 妫�鏌ヤ竴涓嬮敜瀛愮殑娑堣��
+ if (!ItemLogicUtility.CheckCurrencyCount(41, cost, true))
+ {
+ return;
+ }
+
+ // 濡傛灉璇锋眰鐨勬槸2 璇存槑瑕佸垵濮嬪寲涓�涓嬫垬鍦�
+ BattleManager.Instance.MainFightRequest(reqType);
+
+ // 鍒濆鍖栨垬鍦哄悗鏈潵涓嶄細鑷姩鎵� 閭d箞灏遍渶瑕佸啀璇锋眰涓�娆�4缁х画鎴樻枟 鏉ュ紑濮嬫垬鏂�
+ if (reqType == 2)
+ {
+ BattleManager.Instance.MainFightRequest(4);
+ }
+ }
}
else
{
- Debug.LogError("action doesnt finish, wait a moment please");
+ BattleDebug.LogError("action doesnt finish, wait a moment please");
}
}
+
+
}
\ No newline at end of file
--
Gitblit v1.8.0