From d2254249e64e65f9e0a05b12a03e5b6e2e9d63b6 Mon Sep 17 00:00:00 2001 From: Terkoiz Date: Wed, 24 Jan 2024 16:35:23 +0000 Subject: [PATCH] Fixed and expanded QTE type definitions (!206) Co-authored-by: Terkoiz Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/206 Co-authored-by: Terkoiz Co-committed-by: Terkoiz --- project/src/models/eft/hideout/IQteData.ts | 141 +++++++++++++++--- .../models/enums/hideout/QteActivityType.ts | 3 + .../src/models/enums/hideout/QteEffectType.ts | 5 + .../src/models/enums/hideout/QteResultType.ts | 4 + .../src/models/enums/hideout/QteRewardType.ts | 6 + project/src/models/enums/hideout/QteType.ts | 3 + .../models/enums/hideout/RequirementType.ts | 12 ++ 7 files changed, 151 insertions(+), 23 deletions(-) create mode 100644 project/src/models/enums/hideout/QteActivityType.ts create mode 100644 project/src/models/enums/hideout/QteEffectType.ts create mode 100644 project/src/models/enums/hideout/QteResultType.ts create mode 100644 project/src/models/enums/hideout/QteRewardType.ts create mode 100644 project/src/models/enums/hideout/QteType.ts create mode 100644 project/src/models/enums/hideout/RequirementType.ts diff --git a/project/src/models/eft/hideout/IQteData.ts b/project/src/models/eft/hideout/IQteData.ts index 6f1f9e37..70055475 100644 --- a/project/src/models/eft/hideout/IQteData.ts +++ b/project/src/models/eft/hideout/IQteData.ts @@ -1,44 +1,66 @@ +import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; +import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; +import { QteType } from "@spt-aki/models/enums/hideout/QteType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; +import { Effect } from "@spt-aki/models/eft/health/Effect"; +import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; +import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; +import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; + export interface IQteData { - Id: string; - Type: string; - Area: string; - AreaLevel: number; - QuickTimeEvents: IQuickTimeEvent[]; - Requirements: IQteRequirement[]; - Results: Record; + id: string; + type: QteActivityType; + area: HideoutAreas; + areaLevel: number; + quickTimeEvents: IQuickTimeEvent[]; + requirements: (IAreaRequirement + | IItemRequirement + | ITraderUnlockRequirement + | ITraderLoyaltyRequirement + | ISkillRequirement + | IResourceRequirement + | IToolRequirement + | IQuestRequirement + | IHealthRequirement + | IBodyPartBuffRequirement)[]; + results: Record; } export interface IQuickTimeEvent { - Type: string; - Position: number; - StartDelay: number; - EndDelay: number; - Speed: number; - SuccessRange: string; - Key: string; + type: QteType; + position: { x: number, y: number }; + startDelay: number; + endDelay: number; + speed: number; + successRange: { x: number, y: number }; + key: string; } + export interface IQteRequirement { - type: string; + type: RequirementType; } export interface IQteResult { - Energy: number; - Hydration: number; - RewardsRange: IQteEffect[]; + energy: number; + hydration: number; + rewardsRange: IQteEffect[]; } export interface IQteEffect { - Type: string; - SkillId: string; + type: QteRewardType; + skillId: number; levelMultipliers: ISkillLevelMultiplier[]; - Time: number; - Weight: number; - Result: string; + time: number; + weight: number; + result: QteResultType; } export interface ISkillLevelMultiplier @@ -46,3 +68,76 @@ export interface ISkillLevelMultiplier level: number; multiplier: number; } + +export interface IAreaRequirement extends IQteRequirement +{ + type: RequirementType.AREA, + areaType: HideoutAreas, + requiredLevel: number, +} + +export interface ITraderUnlockRequirement extends IQteRequirement +{ + type: RequirementType.TRADER_UNLOCK, + traderId: Traders; +} + +export interface ITraderLoyaltyRequirement extends IQteRequirement +{ + type: RequirementType.TRADER_LOYALTY, + traderId: Traders; + loyaltyLevel: number; +} + +export interface ISkillRequirement extends IQteRequirement +{ + type: RequirementType.SKILL, + skillName: SkillTypes; + skillLevel: number; +} + +export interface IResourceRequirement extends IQteRequirement +{ + type: RequirementType.RESOURCE, + templateId: string, + resource: number, +} + +export interface IItemRequirement extends IQteRequirement +{ + type: RequirementType.ITEM, + templateId: string, + count: number, + isFunctional: boolean, + isEncoded: boolean, +} + +export interface IToolRequirement extends IQteRequirement +{ + type: RequirementType.TOOL, + templateId: string, + count: number, + isFunctional: boolean, + isEncoded: boolean, +} + +export interface IQuestRequirement extends IQteRequirement +{ + type: RequirementType.QUEST_COMPLETE, + questId: string, +} + +export interface IHealthRequirement extends IQteRequirement +{ + type: RequirementType.HEALTH, + energy: number, + hydration: number, +} + +export interface IBodyPartBuffRequirement extends IQteRequirement +{ + type: RequirementType.BODY_PART_BUFF, + effectName: Effect, + bodyPart: BodyPart, + excluded: boolean, +} diff --git a/project/src/models/enums/hideout/QteActivityType.ts b/project/src/models/enums/hideout/QteActivityType.ts new file mode 100644 index 00000000..bc2b48d6 --- /dev/null +++ b/project/src/models/enums/hideout/QteActivityType.ts @@ -0,0 +1,3 @@ +export enum QteActivityType { + GYM = 0, +} diff --git a/project/src/models/enums/hideout/QteEffectType.ts b/project/src/models/enums/hideout/QteEffectType.ts new file mode 100644 index 00000000..dcefc1c6 --- /dev/null +++ b/project/src/models/enums/hideout/QteEffectType.ts @@ -0,0 +1,5 @@ +export enum QteEffectType { + FINISH_EFFECT = "FinishEffect", + SINGLE_SUCCESS_EFFECT = "SingleSuccessEffect", + SINGLE_FAIL_EFFECT = "SingleFailEffect", +} diff --git a/project/src/models/enums/hideout/QteResultType.ts b/project/src/models/enums/hideout/QteResultType.ts new file mode 100644 index 00000000..c3a0e581 --- /dev/null +++ b/project/src/models/enums/hideout/QteResultType.ts @@ -0,0 +1,4 @@ +export enum QteResultType { + NONE = "None", + EXIT = "Exit", +} \ No newline at end of file diff --git a/project/src/models/enums/hideout/QteRewardType.ts b/project/src/models/enums/hideout/QteRewardType.ts new file mode 100644 index 00000000..9cda8ede --- /dev/null +++ b/project/src/models/enums/hideout/QteRewardType.ts @@ -0,0 +1,6 @@ +export enum QteRewardType { + SKILL = "Skill", + HEALTH_EFFECT = "HealthEffect", + MUSCLE_PAIN = "MusclePain", + GYM_ARM_TRAUMA = "GymArmTrauma", +} \ No newline at end of file diff --git a/project/src/models/enums/hideout/QteType.ts b/project/src/models/enums/hideout/QteType.ts new file mode 100644 index 00000000..5fc7f3bf --- /dev/null +++ b/project/src/models/enums/hideout/QteType.ts @@ -0,0 +1,3 @@ +export enum QteType { + SHRINKING_CIRCLE = 0, +} diff --git a/project/src/models/enums/hideout/RequirementType.ts b/project/src/models/enums/hideout/RequirementType.ts new file mode 100644 index 00000000..2bd50669 --- /dev/null +++ b/project/src/models/enums/hideout/RequirementType.ts @@ -0,0 +1,12 @@ +export enum RequirementType { + AREA = "Area", + ITEM = "Item", + TRADER_UNLOCK = "TraderUnlock", + TRADER_LOYALTY = "TraderLoyalty", + SKILL = "Skill", + RESOURCE = "Resource", + TOOL = "Tool", + QUEST_COMPLETE = "QuestComplete", + HEALTH = "Health", + BODY_PART_BUFF = "BodyPartBuff", +} \ No newline at end of file