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
|
"Z": 89.58569
|
||||||
},
|
},
|
||||||
"TerritoryId": 155,
|
"TerritoryId": 155,
|
||||||
"InteractionType": "Instruction",
|
"InteractionType": "Combat",
|
||||||
"Comment": "Use Quest item on enemy to weaken it first",
|
|
||||||
"$": "Status Effects: 22 (HP Penalty) + 62 (Damage Down)",
|
|
||||||
"EnemySpawnType": "AfterInteraction",
|
"EnemySpawnType": "AfterInteraction",
|
||||||
|
"CombatItemUse": {
|
||||||
|
"ItemId": 2000961,
|
||||||
|
"Condition": "MissingStatus",
|
||||||
|
"Value": 22
|
||||||
|
},
|
||||||
"ComplexCombatData": [
|
"ComplexCombatData": [
|
||||||
{
|
{
|
||||||
"DataId": 2196
|
"DataId": 2196
|
||||||
|
@ -183,7 +183,8 @@
|
|||||||
"null"
|
"null"
|
||||||
],
|
],
|
||||||
"description": "The Item to use",
|
"description": "The Item to use",
|
||||||
"exclusiveMinimum": 0
|
"exclusiveMinimum": 0,
|
||||||
|
"maximum": 2010000
|
||||||
},
|
},
|
||||||
"SkipConditions": {
|
"SkipConditions": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -648,13 +649,15 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ItemId": {
|
"ItemId": {
|
||||||
"type": "integer"
|
"type": "integer",
|
||||||
|
"maximum": 2010000
|
||||||
},
|
},
|
||||||
"Condition": {
|
"Condition": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"Incapacitated",
|
"Incapacitated",
|
||||||
"Health%"
|
"Health%",
|
||||||
|
"MissingStatus"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Value": {
|
"Value": {
|
||||||
|
@ -9,5 +9,6 @@ public sealed class CombatItemUseConditionConverter() : EnumConverter<ECombatIte
|
|||||||
{
|
{
|
||||||
{ ECombatItemUseCondition.Incapacitated, "Incapacitated" },
|
{ ECombatItemUseCondition.Incapacitated, "Incapacitated" },
|
||||||
{ ECombatItemUseCondition.HealthPercent, "Health%" },
|
{ ECombatItemUseCondition.HealthPercent, "Health%" },
|
||||||
|
{ ECombatItemUseCondition.MissingStatus, "MissingStatus" },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,4 +5,5 @@ public enum ECombatItemUseCondition
|
|||||||
None,
|
None,
|
||||||
Incapacitated,
|
Incapacitated,
|
||||||
HealthPercent,
|
HealthPercent,
|
||||||
|
MissingStatus,
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,7 @@ internal sealed class ItemUseModule : ICombatModule
|
|||||||
_delegate.Stop();
|
_delegate.Stop();
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("Using item {ItemId}", _combatData.CombatItemUse.ItemId);
|
||||||
AgentInventoryContext.Instance()->UseItem(_combatData.CombatItemUse.ItemId);
|
AgentInventoryContext.Instance()->UseItem(_combatData.CombatItemUse.ItemId);
|
||||||
}
|
}
|
||||||
_continueAt = DateTime.Now.AddSeconds(2);
|
_continueAt = DateTime.Now.AddSeconds(2);
|
||||||
@ -147,6 +148,9 @@ internal sealed class ItemUseModule : ICombatModule
|
|||||||
|
|
||||||
if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.HealthPercent)
|
if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.HealthPercent)
|
||||||
return (100f * battleChara->Health / battleChara->MaxHealth) < _combatData.CombatItemUse.Value;
|
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;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user