Skip to content

Commit

Permalink
Added new buff type and NotPierceIndividuality description
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresmile committed Sep 11, 2024
1 parent 974212d commit aac6306
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/api-connector/src/Schema/Buff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export enum BuffAction {
FUNCTION_TREASURE_DEVICE_BEFORE = "functionTreasureDeviceBefore",
FUNCTION_STEP_IN_AFTER = "functionStepInAfter",
SHORTEN_SKILL_AFTER_USE_SKILL = "shortenSkillAfterUseSkill",
PIERCE_SPECIAL_INVINCIBLE = "pierceSpecialInvincible",
}

export enum BuffLimit {
Expand Down Expand Up @@ -349,6 +350,7 @@ export enum BuffType {
TREASURE_DEVICE_BEFORE_FUNCTION = "treasureDeviceBeforeFunction",
STEP_IN_AFTER_FUNCTION = "stepInAfterFunction",
SHORTEN_SKILL_AFTER_USE_SKILL = "shortenSkillAfterUseSkill",
PIERCE_SPECIAL_INVINCIBLE = "pierceSpecialInvincible",
TO_FIELD_CHANGE_FIELD = "toFieldChangeField",
TO_FIELD_AVOID_BUFF = "toFieldAvoidBuff",
TO_FIELD_SUB_INDIVIDUALITY_FIELD = "toFieldSubIndividualityField",
Expand Down Expand Up @@ -434,6 +436,7 @@ export interface BuffScript<T> {
useFirstTimeInTurn?: number;
fromCommandSpell?: number;
fromMasterEquip?: number;
NotPierceIndividuality?: Trait[][];
}

export interface BasicBuff {
Expand Down
1 change: 1 addition & 0 deletions packages/api-descriptor/src/Buff/BuffTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const buffTypeDescriptions = new Map<Buff.BuffType, string>([
[Buff.BuffType.INVINCIBLE, "Invincible"],
[Buff.BuffType.MULTIATTACK, "Multiple Hits"],
[Buff.BuffType.PIERCE_INVINCIBLE, "Ignore Invincible"],
[Buff.BuffType.PIERCE_SPECIAL_INVINCIBLE, "Ignore Special invincible"],
[Buff.BuffType.PIERCE_DEFENCE, "Ignore DEF"],
[Buff.BuffType.PIERCE_SUBDAMAGE, "Ignore Damage Cut"],
[Buff.BuffType.PREVENT_DEATH_BY_DAMAGE, "Prevent death by damage"],
Expand Down
10 changes: 10 additions & 0 deletions packages/api-descriptor/src/Buff/describe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,15 @@ export default function (buff: Buff.BasicBuff): Descriptor {
partials.push(new TextPartial(" from Master Mystic Codes"));
}

if (buff.script.NotPierceIndividuality !== undefined) {
partials.push(new TextPartial(" except for "));
buff.script.NotPierceIndividuality.forEach((traitGroup, i) => {
if (traitGroup.length > 1) partials.push(new TextPartial("("));
partials.push(...traitReferences(traitGroup, 1));
if (traitGroup.length > 1) partials.push(new TextPartial(")"));
if (i > 1) partials.push(new TextPartial(" or "));
});
}

return new Descriptor(partials);
}

0 comments on commit aac6306

Please sign in to comment.