From 4adfba03f3a89d78dba38529e913588259e74882 Mon Sep 17 00:00:00 2001 From: xianyi Date: Mon, 1 Sep 2025 11:30:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=8F=8D=E5=87=BB=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E5=8F=8D=E5=87=BB=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activate_counterattack_2turns.asset | 38 +++++++++++++++++++ .../activate_counterattack_2turns.asset.meta | 8 ++++ .../ongoing/alwaysCounterattack.asset | 37 ++++++++++++++++++ .../ongoing/alwaysCounterattack.asset.meta | 8 ++++ .../Resources/Status/counterattack.asset | 20 ++++++++++ .../Resources/Status/counterattack.asset.meta | 8 ++++ Assets/TcgEngine/Scripts/Data/StatusData.cs | 3 +- .../TcgEngine/Scripts/GameLogic/GameLogic.cs | 5 ++- .../Scripts/Network/ResourceDownloader.cs | 4 +- 9 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset create mode 100644 Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset.meta create mode 100644 Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset create mode 100644 Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset.meta create mode 100644 Assets/TcgEngine/Resources/Status/counterattack.asset create mode 100644 Assets/TcgEngine/Resources/Status/counterattack.asset.meta diff --git a/Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset b/Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset new file mode 100644 index 0000000..111cb87 --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset @@ -0,0 +1,38 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8ce5f81e5cc37f547af6923758602c8c, type: 3} + m_Name: activate_counterattack_2turns + m_EditorClassIdentifier: + id: activate_counterattack_2turns + trigger: 5 + conditions_trigger: [] + target: 1 + conditions_target: [] + filters_target: [] + effects: + - {fileID: 11400000, guid: 4c4c317ae3dd4cf4982e8d7c7f1043b9, type: 2} + status: + - {fileID: 11400000, guid: e536240f3421c48a49c3ef0eb19b1042, type: 2} + value: 0 + duration: 2 + chain_abilities: [] + mana_cost: 3 + exhaust: 0 + board_fx: {fileID: 0} + caster_fx: {fileID: 0} + target_fx: {fileID: 0} + projectile_fx: {fileID: 0} + cast_audio: {fileID: 0} + target_audio: {fileID: 0} + charge_target: 0 + title: "\u5141\u8BB8\u53CD\u51FB" + desc: "\u5141\u8BB8\u53CD\u51FB \u6301\u7EED2\u56DE\u5408" diff --git a/Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset.meta b/Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset.meta new file mode 100644 index 0000000..12f8706 --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/activated/activate_counterattack_2turns.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7e1a976297b94e0b935f5e6126d8d11 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset b/Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset new file mode 100644 index 0000000..064bfb3 --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8ce5f81e5cc37f547af6923758602c8c, type: 3} + m_Name: alwaysCounterattack + m_EditorClassIdentifier: + id: alwaysCounterattack + trigger: 2 + conditions_trigger: [] + target: 1 + conditions_target: [] + filters_target: [] + effects: [] + status: + - {fileID: 11400000, guid: e536240f3421c48a49c3ef0eb19b1042, type: 2} + value: 0 + duration: 0 + chain_abilities: [] + mana_cost: 0 + exhaust: 0 + board_fx: {fileID: 0} + caster_fx: {fileID: 0} + target_fx: {fileID: 0} + projectile_fx: {fileID: 0} + cast_audio: {fileID: 0} + target_audio: {fileID: 0} + charge_target: 0 + title: "\u59CB\u7EC8\u53CD\u51FB" + desc: "\u59CB\u7EC8\u53CD\u51FB" diff --git a/Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset.meta b/Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset.meta new file mode 100644 index 0000000..a12fc7e --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/ongoing/alwaysCounterattack.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2db8435fd93e4777a91deee49c478b4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TcgEngine/Resources/Status/counterattack.asset b/Assets/TcgEngine/Resources/Status/counterattack.asset new file mode 100644 index 0000000..5db7949 --- /dev/null +++ b/Assets/TcgEngine/Resources/Status/counterattack.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edf116efdfa73646a6de43812f81a4a, type: 3} + m_Name: counterattack + m_EditorClassIdentifier: + effect: 38 + title: counterattack + icon: {fileID: 0} + desc: "\u5141\u8BB8\u53CD\u51FB" + status_fx: {fileID: 0} + hvalue: 1 diff --git a/Assets/TcgEngine/Resources/Status/counterattack.asset.meta b/Assets/TcgEngine/Resources/Status/counterattack.asset.meta new file mode 100644 index 0000000..4334b93 --- /dev/null +++ b/Assets/TcgEngine/Resources/Status/counterattack.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e536240f3421c48a49c3ef0eb19b1042 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TcgEngine/Scripts/Data/StatusData.cs b/Assets/TcgEngine/Scripts/Data/StatusData.cs index e0d4120..d86af57 100644 --- a/Assets/TcgEngine/Scripts/Data/StatusData.cs +++ b/Assets/TcgEngine/Scripts/Data/StatusData.cs @@ -32,8 +32,7 @@ namespace TcgEngine Paralysed = 32, //Cant do any actions for X turns Poisoned = 34, //Lose hp each start of turn Sleep = 36, //Doesnt untap at the start of turn - - + Counterattack = 38, // 允许反击 } /// diff --git a/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs b/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs index 41f5b82..7400f48 100644 --- a/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs +++ b/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs @@ -569,7 +569,10 @@ namespace TcgEngine.Gameplay DamageCard(attacker, target, datt1); //Counter Damage - if (!attacker.HasStatus(StatusType.Intimidate)) + // if (!attacker.HasStatus(StatusType.Intimidate)) // 威慑时不会反击 + // DamageCard(target, attacker, datt2); + + if (attacker.HasStatus(StatusType.Counterattack)) // 允许反击 DamageCard(target, attacker, datt2); //Save attack and exhaust diff --git a/Assets/TcgEngine/Scripts/Network/ResourceDownloader.cs b/Assets/TcgEngine/Scripts/Network/ResourceDownloader.cs index 5dca260..bce4d20 100644 --- a/Assets/TcgEngine/Scripts/Network/ResourceDownloader.cs +++ b/Assets/TcgEngine/Scripts/Network/ResourceDownloader.cs @@ -117,10 +117,10 @@ namespace TcgEngine return false; } - Debug.Log($"版本匹配,开始检查MD5校验... 当前版本: {currentVersion} 目标版本: {targetVersion} 当前MD5: {currentMd5} 目标MD5: {targetMd5}"); string localMd5 = await CalculateDirectoryMd5(spritesPath); - + Debug.Log($"版本匹配,开始检查MD5校验... 当前版本: {currentVersion} 目标版本: {targetVersion} 当前MD5: {localMd5} 目标MD5: {targetMd5}"); + if (localMd5 != targetMd5) { Debug.Log("MD5校验失败,正在删除损坏的文件并重新下载..."); From 6d40a8075f468e872d4c9c58dcb518d490c90088 Mon Sep 17 00:00:00 2001 From: xianyi Date: Mon, 1 Sep 2025 15:41:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A6=81=E7=96=97=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activate_damage_notreatment.asset | 42 +++++++++++++++++++ .../activate_damage_notreatment.asset.meta | 8 ++++ .../Abilities/other/notreatment.asset | 37 ++++++++++++++++ .../Abilities/other/notreatment.asset.meta | 8 ++++ .../Resources/Status/notreatment.asset | 20 +++++++++ .../Resources/Status/notreatment.asset.meta | 8 ++++ Assets/TcgEngine/Scripts/Data/StatusData.cs | 2 + .../Scripts/Effects/EffectAddStat.cs | 4 +- .../TcgEngine/Scripts/GameLogic/GameLogic.cs | 3 ++ 9 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset create mode 100644 Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset.meta create mode 100644 Assets/TcgEngine/Resources/Abilities/other/notreatment.asset create mode 100644 Assets/TcgEngine/Resources/Abilities/other/notreatment.asset.meta create mode 100644 Assets/TcgEngine/Resources/Status/notreatment.asset create mode 100644 Assets/TcgEngine/Resources/Status/notreatment.asset.meta diff --git a/Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset b/Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset new file mode 100644 index 0000000..f6a015d --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8ce5f81e5cc37f547af6923758602c8c, type: 3} + m_Name: activate_damage_notreatment + m_EditorClassIdentifier: + id: activate_damage_notreatment + trigger: 5 + conditions_trigger: [] + target: 30 + conditions_target: + - {fileID: 11400000, guid: ef09540f94d8428408b69fea46ec3334, type: 2} + - {fileID: 11400000, guid: 47221d412dc0a014b8a33abb0cbfc773, type: 2} + - {fileID: 11400000, guid: a1fb3a7171663234280fdfb41c99ab0a, type: 2} + filters_target: [] + effects: + - {fileID: 11400000, guid: 4369324687c62ca488c57afd73a2be36, type: 2} + status: [] + value: 2 + duration: 0 + chain_abilities: + - {fileID: 11400000} + mana_cost: 3 + exhaust: 0 + board_fx: {fileID: 0} + caster_fx: {fileID: 0} + target_fx: {fileID: 9125387663047351618, guid: b66600b51774daa49964ead5c6a00c49, + type: 3} + projectile_fx: {fileID: 0} + cast_audio: {fileID: 0} + target_audio: {fileID: 0} + charge_target: 0 + title: "\u4F24\u5BB3+\u7981\u7597" + desc: "\u9020\u62102\u70B9\u4F24\u5BB3\u3002" diff --git a/Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset.meta b/Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset.meta new file mode 100644 index 0000000..22ffd97 --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/activated/activate_damage_notreatment.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2f41339738bf94e3bb86a85423f6cd44 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TcgEngine/Resources/Abilities/other/notreatment.asset b/Assets/TcgEngine/Resources/Abilities/other/notreatment.asset new file mode 100644 index 0000000..a82b7fd --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/other/notreatment.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8ce5f81e5cc37f547af6923758602c8c, type: 3} + m_Name: notreatment + m_EditorClassIdentifier: + id: notreatment + trigger: 0 + conditions_trigger: [] + target: 72 + conditions_target: [] + filters_target: [] + effects: [] + status: + - {fileID: 11400000, guid: 6ed88dbafd8814aa89ec79d6c6a6087c, type: 2} + value: 0 + duration: 2 + chain_abilities: [] + mana_cost: 0 + exhaust: 0 + board_fx: {fileID: 0} + caster_fx: {fileID: 0} + target_fx: {fileID: 0} + projectile_fx: {fileID: 0} + cast_audio: {fileID: 0} + target_audio: {fileID: 0} + charge_target: 0 + title: "\u4E24\u56DE\u5408\u7981\u7597" + desc: "\u4E24\u56DE\u5408\u7981\u7597" diff --git a/Assets/TcgEngine/Resources/Abilities/other/notreatment.asset.meta b/Assets/TcgEngine/Resources/Abilities/other/notreatment.asset.meta new file mode 100644 index 0000000..fc5d261 --- /dev/null +++ b/Assets/TcgEngine/Resources/Abilities/other/notreatment.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3fdf35a57c8d9478dbd36a8c2c83857e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TcgEngine/Resources/Status/notreatment.asset b/Assets/TcgEngine/Resources/Status/notreatment.asset new file mode 100644 index 0000000..8eb2c1e --- /dev/null +++ b/Assets/TcgEngine/Resources/Status/notreatment.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edf116efdfa73646a6de43812f81a4a, type: 3} + m_Name: notreatment + m_EditorClassIdentifier: + effect: 39 + title: Notreatment + icon: {fileID: 0} + desc: "\u8FDB\u6599" + status_fx: {fileID: 0} + hvalue: 1 diff --git a/Assets/TcgEngine/Resources/Status/notreatment.asset.meta b/Assets/TcgEngine/Resources/Status/notreatment.asset.meta new file mode 100644 index 0000000..253cf51 --- /dev/null +++ b/Assets/TcgEngine/Resources/Status/notreatment.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ed88dbafd8814aa89ec79d6c6a6087c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TcgEngine/Scripts/Data/StatusData.cs b/Assets/TcgEngine/Scripts/Data/StatusData.cs index d86af57..0c1c159 100644 --- a/Assets/TcgEngine/Scripts/Data/StatusData.cs +++ b/Assets/TcgEngine/Scripts/Data/StatusData.cs @@ -33,6 +33,8 @@ namespace TcgEngine Poisoned = 34, //Lose hp each start of turn Sleep = 36, //Doesnt untap at the start of turn Counterattack = 38, // 允许反击 + NoTreatment = 39, // 禁疗 + } /// diff --git a/Assets/TcgEngine/Scripts/Effects/EffectAddStat.cs b/Assets/TcgEngine/Scripts/Effects/EffectAddStat.cs index a605388..2752cb9 100644 --- a/Assets/TcgEngine/Scripts/Effects/EffectAddStat.cs +++ b/Assets/TcgEngine/Scripts/Effects/EffectAddStat.cs @@ -36,7 +36,9 @@ namespace TcgEngine { if (type == EffectStatType.Attack) target.attack += ability.value; - if (type == EffectStatType.HP) + if (type == EffectStatType.HP) + if (target.HasStatus(StatusType.NoTreatment)) // 禁疗时不会增加hp + return; target.hp += ability.value; if (type == EffectStatType.Mana) target.mana += ability.value; diff --git a/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs b/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs index 7400f48..63c7537 100644 --- a/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs +++ b/Assets/TcgEngine/Scripts/GameLogic/GameLogic.cs @@ -856,6 +856,9 @@ namespace TcgEngine.Gameplay if (target.HasStatus(StatusType.Invincibility)) return; + if (target.HasStatus(StatusType.NoTreatment)) // 禁疗时不会治疗 + return; + target.damage -= value; target.damage = Mathf.Max(target.damage, 0);