Add logic for using items on the Spotted Mudpuppy in 'Factual Folklore'

This commit is contained in:
Liza 2025-01-19 22:58:14 +01:00
parent e0f416a5cd
commit 4b9eae916a
Signed by: liza
GPG Key ID: 2C41B84815CF6445
5 changed files with 18 additions and 6 deletions

View File

@ -35,10 +35,13 @@
"Z": 89.58569
},
"TerritoryId": 155,
"InteractionType": "Instruction",
"Comment": "Use Quest item on enemy to weaken it first",
"$": "Status Effects: 22 (HP Penalty) + 62 (Damage Down)",
"InteractionType": "Combat",
"EnemySpawnType": "AfterInteraction",
"CombatItemUse": {
"ItemId": 2000961,
"Condition": "MissingStatus",
"Value": 22
},
"ComplexCombatData": [
{
"DataId": 2196

View File

@ -183,7 +183,8 @@
"null"
],
"description": "The Item to use",
"exclusiveMinimum": 0
"exclusiveMinimum": 0,
"maximum": 2010000
},
"SkipConditions": {
"type": "object",
@ -648,13 +649,15 @@
"type": "object",
"properties": {
"ItemId": {
"type": "integer"
"type": "integer",
"maximum": 2010000
},
"Condition": {
"type": "string",
"enum": [
"Incapacitated",
"Health%"
"Health%",
"MissingStatus"
]
},
"Value": {

View File

@ -9,5 +9,6 @@ public sealed class CombatItemUseConditionConverter() : EnumConverter<ECombatIte
{
{ ECombatItemUseCondition.Incapacitated, "Incapacitated" },
{ ECombatItemUseCondition.HealthPercent, "Health%" },
{ ECombatItemUseCondition.MissingStatus, "MissingStatus" },
};
}

View File

@ -5,4 +5,5 @@ public enum ECombatItemUseCondition
None,
Incapacitated,
HealthPercent,
MissingStatus,
}

View File

@ -108,6 +108,7 @@ internal sealed class ItemUseModule : ICombatModule
_delegate.Stop();
unsafe
{
_logger.LogInformation("Using item {ItemId}", _combatData.CombatItemUse.ItemId);
AgentInventoryContext.Instance()->UseItem(_combatData.CombatItemUse.ItemId);
}
_continueAt = DateTime.Now.AddSeconds(2);
@ -147,6 +148,9 @@ internal sealed class ItemUseModule : ICombatModule
if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.HealthPercent)
return (100f * battleChara->Health / battleChara->MaxHealth) < _combatData.CombatItemUse.Value;
if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.MissingStatus)
return !battleChara->StatusManager.HasStatus((uint)_combatData.CombatItemUse.Value);
}
return false;