Fixed and expanded QTE type definitions (!206)

Co-authored-by: Terkoiz <terkoiz@spt.dev>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/206
Co-authored-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-committed-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
This commit is contained in:
Terkoiz 2024-01-24 16:35:23 +00:00 committed by chomp
parent 852849aeb1
commit d2254249e6
7 changed files with 151 additions and 23 deletions

View File

@ -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<string, IQteResult>;
id: string;
type: QteActivityType;
area: HideoutAreas;
areaLevel: number;
quickTimeEvents: IQuickTimeEvent[];
requirements: (IAreaRequirement
| IItemRequirement
| ITraderUnlockRequirement
| ITraderLoyaltyRequirement
| ISkillRequirement
| IResourceRequirement
| IToolRequirement
| IQuestRequirement
| IHealthRequirement
| IBodyPartBuffRequirement)[];
results: Record<QteEffectType, IQteResult>;
}
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,
}

View File

@ -0,0 +1,3 @@
export enum QteActivityType {
GYM = 0,
}

View File

@ -0,0 +1,5 @@
export enum QteEffectType {
FINISH_EFFECT = "FinishEffect",
SINGLE_SUCCESS_EFFECT = "SingleSuccessEffect",
SINGLE_FAIL_EFFECT = "SingleFailEffect",
}

View File

@ -0,0 +1,4 @@
export enum QteResultType {
NONE = "None",
EXIT = "Exit",
}

View File

@ -0,0 +1,6 @@
export enum QteRewardType {
SKILL = "Skill",
HEALTH_EFFECT = "HealthEffect",
MUSCLE_PAIN = "MusclePain",
GYM_ARM_TRAUMA = "GymArmTrauma",
}

View File

@ -0,0 +1,3 @@
export enum QteType {
SHRINKING_CIRCLE = 0,
}

View File

@ -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",
}