From 1db6b5c1b91ce7fcf4c49fc12ffedac91271222b Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Mon, 2 Dec 2024 17:54:57 +0100 Subject: [PATCH 1/4] ConsumeCorpseGoals add precondition to check if damage is neither done nor taken always --- Core/Goals/ConsumeCorpseGoal.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Core/Goals/ConsumeCorpseGoal.cs b/Core/Goals/ConsumeCorpseGoal.cs index 25d32eaf..d80df9b6 100644 --- a/Core/Goals/ConsumeCorpseGoal.cs +++ b/Core/Goals/ConsumeCorpseGoal.cs @@ -23,11 +23,8 @@ public ConsumeCorpseGoal(ILogger logger, { AddPrecondition(GoapKey.consumablecorpsenearby, true); } - else - { - AddPrecondition(GoapKey.damagedone, false); - AddPrecondition(GoapKey.damagetaken, false); - } + AddPrecondition(GoapKey.damagedone, false); + AddPrecondition(GoapKey.damagetaken, false); AddPrecondition(GoapKey.producedcorpse, true); AddPrecondition(GoapKey.consumecorpse, false); From cf37039a309c1b4dfa2d3d48c9f9ea7b0e8a3fe2 Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Mon, 2 Dec 2024 17:59:52 +0100 Subject: [PATCH 2/4] CorpseConsumedGoal make damagedone or damagetaken is false --- Core/Goals/CorpseConsumedGoal.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Core/Goals/CorpseConsumedGoal.cs b/Core/Goals/CorpseConsumedGoal.cs index cdfe1bde..cef4ccf5 100644 --- a/Core/Goals/CorpseConsumedGoal.cs +++ b/Core/Goals/CorpseConsumedGoal.cs @@ -30,11 +30,8 @@ public CorpseConsumedGoal(ILogger logger, { AddPrecondition(GoapKey.consumablecorpsenearby, true); } - else - { - AddPrecondition(GoapKey.damagedone, false); - AddPrecondition(GoapKey.damagetaken, false); - } + AddPrecondition(GoapKey.damagedone, false); + AddPrecondition(GoapKey.damagetaken, false); AddPrecondition(GoapKey.consumecorpse, true); @@ -70,4 +67,4 @@ public override void OnEnter() Level = LogLevel.Information, Message = "Total: {total} | Remaining: {remains}")] static partial void LogConsumed(ILogger logger, int total, int remains); -} \ No newline at end of file +} From 3acdd7ddc6325baf72af00da1e98097272969731 Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Mon, 2 Dec 2024 19:11:53 +0100 Subject: [PATCH 3/4] CorpseConsumedGoal make sure !Pulled, !Danger, !inCombat --- Core/Goals/CorpseConsumedGoal.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/Goals/CorpseConsumedGoal.cs b/Core/Goals/CorpseConsumedGoal.cs index cef4ccf5..ff39e82a 100644 --- a/Core/Goals/CorpseConsumedGoal.cs +++ b/Core/Goals/CorpseConsumedGoal.cs @@ -30,8 +30,9 @@ public CorpseConsumedGoal(ILogger logger, { AddPrecondition(GoapKey.consumablecorpsenearby, true); } - AddPrecondition(GoapKey.damagedone, false); - AddPrecondition(GoapKey.damagetaken, false); + AddPrecondition(GoapKey.pulled, false); + AddPrecondition(GoapKey.dangercombat, false); + AddPrecondition(GoapKey.incombat, false); AddPrecondition(GoapKey.consumecorpse, true); From 4e50e45537095e17b3995387e68464075d243db5 Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Mon, 2 Dec 2024 19:12:57 +0100 Subject: [PATCH 4/4] ConsumedCorpseGoal make sure !Pulled, !Danger, !inCombat --- Core/Goals/ConsumeCorpseGoal.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/Goals/ConsumeCorpseGoal.cs b/Core/Goals/ConsumeCorpseGoal.cs index d80df9b6..3fabbd01 100644 --- a/Core/Goals/ConsumeCorpseGoal.cs +++ b/Core/Goals/ConsumeCorpseGoal.cs @@ -23,8 +23,9 @@ public ConsumeCorpseGoal(ILogger logger, { AddPrecondition(GoapKey.consumablecorpsenearby, true); } - AddPrecondition(GoapKey.damagedone, false); - AddPrecondition(GoapKey.damagetaken, false); + AddPrecondition(GoapKey.pulled, false); + AddPrecondition(GoapKey.dangercombat, false); + AddPrecondition(GoapKey.incombat, false); AddPrecondition(GoapKey.producedcorpse, true); AddPrecondition(GoapKey.consumecorpse, false);