Skip to content

Commit

Permalink
Added description for DAMAGE_NP_AND_CHECK_INDIVIDUALITY
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresmile committed Aug 20, 2024
1 parent 247a01b commit 1b3df00
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const funcDescriptions = new Map<Func.FuncType, string>([
[Func.FuncType.DAMAGE_NP_RARE, "Deal Damage with Bonus to Rarity"],
[Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX, "Deal Damage with Bonus to Trait"],
[Func.FuncType.DAMAGE_NP_BATTLE_POINT_PHASE, "Deal Damage with bonus based on battle point"],
[Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY, "Deal Damage with Bonus to Traits"],
[Func.FuncType.DAMAGE_VALUE, "Deal Damage"],
[Func.FuncType.DELAY_NPTURN, "Drain Charge"],
[Func.FuncType.EVENT_DROP_UP, "Increase Drop Amount"],
Expand Down Expand Up @@ -90,6 +91,7 @@ export default function (func: Func.Func): BasePartial[] {
case Func.FuncType.DAMAGE_NP_PIERCE:
case Func.FuncType.DAMAGE_NP_RARE:
case Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX:
case Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY:
case Func.FuncType.DAMAGE_NP_BATTLE_POINT_PHASE:
addPartials(partials, [new TextPartial("Deal damage")]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ export default function (func: Func.Func, dataVal: DataVal.DataVal): BasePartial
new ParticlePartial(")"),
]);
break;
case Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY:
addPartials(partials, [
new ParticlePartial("("),
new TextPartial("additional to targets"),
new ParticlePartial(" with "),
...(dataVal.AndCheckIndividualityList ?? []).map((t) => new TraitReferencePartial(t)),
new ParticlePartial(")"),
]);
break;
case Func.FuncType.DAMAGE_NP_INDIVIDUAL_SUM:
const traitDescriptions: BasePartial[] = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default function (func: Func.Func): Sections {
case Func.FuncType.DAMAGE_NP_PIERCE:
case Func.FuncType.DAMAGE_NP_RARE:
case Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX:
case Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY:
case Func.FuncType.DAMAGE_NP_COUNTER:
flags.amount.preposition = "of";

Expand Down
3 changes: 3 additions & 0 deletions packages/api-descriptor/src/Func/describeValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default function (
case Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX:
case Func.FuncType.DAMAGE_NP_COUNTER:
case Func.FuncType.DAMAGE_NP_BATTLE_POINT_PHASE:
case Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY:
case Func.FuncType.GAIN_HP_PER:
case Func.FuncType.QP_DROP_UP:
case Func.FuncType.GAIN_MULTIPLY_NP:
Expand Down Expand Up @@ -147,6 +148,7 @@ export default function (
case Func.FuncType.DAMAGE_NP_INDIVIDUAL:
case Func.FuncType.DAMAGE_NP_RARE:
case Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX:
case Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY:
if (dataVal.Rate !== undefined) {
// Full detailed in NP page
addPartials([
Expand Down Expand Up @@ -181,6 +183,7 @@ export default function (
case Func.FuncType.DAMAGE_NP_INDIVIDUAL:
case Func.FuncType.DAMAGE_NP_RARE:
case Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX:
case Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY:
case Func.FuncType.DAMAGE_NP_INDIVIDUAL_SUM:
case Func.FuncType.DAMAGE_NP_BATTLE_POINT_PHASE:
case Func.FuncType.SERVANT_FRIENDSHIP_UP:
Expand Down
4 changes: 3 additions & 1 deletion packages/db/src/Descriptor/Func/handleActionSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const funcDescriptions = new Map<Func.FuncType, string>([
[Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX, "Deal Damage with Bonus to Trait"],
[Func.FuncType.DAMAGE_NP_COUNTER, "Reflect Damage Received"],
[Func.FuncType.DAMAGE_NP_BATTLE_POINT_PHASE, "Deal Damage with bonus based on Master Affection"],
[Func.FuncType.DAMAGE_NP_BATTLE_POINT_PHASE, "Deal Damage with Bonus to Traits"],
[Func.FuncType.DAMAGE_VALUE, "Deal Damage"],
[Func.FuncType.DELAY_NPTURN, "Drain Charge"],
[Func.FuncType.EVENT_DROP_UP, "Increase Drop Amount"],
Expand Down Expand Up @@ -318,7 +319,8 @@ export default function handleActionSection(
func.funcType === Func.FuncType.DAMAGE_NP_INDIVIDUAL ||
func.funcType === Func.FuncType.DAMAGE_NP_PIERCE ||
func.funcType === Func.FuncType.DAMAGE_NP_RARE ||
func.funcType === Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX
func.funcType === Func.FuncType.DAMAGE_NP_STATE_INDIVIDUAL_FIX ||
func.funcType === Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY
) {
parts.push("Deal damage");
sections.amount.preposition = "of";
Expand Down
14 changes: 14 additions & 0 deletions packages/db/src/Descriptor/Func/handleAffectsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ export default function handleAffectsSection(
against <TraitDescription region={region} trait={dataVal.Target} />
</span>
);
} else if (
func.funcType === Func.FuncType.DAMAGE_NP_AND_CHECK_INDIVIDUALITY &&
dataVal.AndCheckIndividualityList &&
dataVal.AndCheckIndividualityList.length > 0
) {
parts.push(
<span>
against enemy with {dataVal.AndCheckIndividualityList.length === 2 ? "both" : "all"} of{" "}
{mergeElements(
dataVal.AndCheckIndividualityList.map((t) => <TraitDescription region={region} trait={t} />),
" and "
)}
</span>
);
} else if (
dataVal.TargetList !== undefined &&
dataVal.TargetList.length > 0 &&
Expand Down

0 comments on commit 1b3df00

Please sign in to comment.