Add logic for using items on the Spotted Mudpuppy in 'Factual Folklore'
This commit is contained in:
parent
e0f416a5cd
commit
4b9eae916a
@ -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
|
||||
|
@ -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": {
|
||||
|
@ -9,5 +9,6 @@ public sealed class CombatItemUseConditionConverter() : EnumConverter<ECombatIte
|
||||
{
|
||||
{ ECombatItemUseCondition.Incapacitated, "Incapacitated" },
|
||||
{ ECombatItemUseCondition.HealthPercent, "Health%" },
|
||||
{ ECombatItemUseCondition.MissingStatus, "MissingStatus" },
|
||||
};
|
||||
}
|
||||
|
@ -5,4 +5,5 @@ public enum ECombatItemUseCondition
|
||||
None,
|
||||
Incapacitated,
|
||||
HealthPercent,
|
||||
MissingStatus,
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user