Skip to content

Commit 36ecb80

Browse files
committed
「スタイリッシュモード」Pアイテムを追加
合わせて、「やる気減少1」のために drainModifier effect を追加。
1 parent a8529f3 commit 36ecb80

File tree

6 files changed

+150
-0
lines changed

6 files changed

+150
-0
lines changed

src/data/producer-items.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,57 @@ export const producerItemsAsConst = [
18021802
},
18031803
},
18041804
},
1805+
{
1806+
id: "sutairisshumodo",
1807+
name: "スタイリッシュモード",
1808+
producerItemPossessionKind: "logic",
1809+
producerItemProviderKind: "idol",
1810+
rarity: "ssr",
1811+
base: {
1812+
condition: {
1813+
kind: "countModifier",
1814+
modifierKind: "motivation",
1815+
range: { min: 3 },
1816+
},
1817+
effects: [
1818+
{
1819+
kind: "getModifier",
1820+
modifier: { kind: "positiveImpression", amount: 3 },
1821+
},
1822+
{
1823+
kind: "drainModifier",
1824+
modifierKind: "motivation",
1825+
value: 1,
1826+
},
1827+
],
1828+
times: 3,
1829+
trigger: {
1830+
kind: "turnStart",
1831+
},
1832+
},
1833+
enhanced: {
1834+
condition: {
1835+
kind: "countModifier",
1836+
modifierKind: "motivation",
1837+
range: { min: 3 },
1838+
},
1839+
effects: [
1840+
{
1841+
kind: "getModifier",
1842+
modifier: { kind: "positiveImpression", amount: 3 },
1843+
},
1844+
{
1845+
kind: "drainModifier",
1846+
modifierKind: "motivation",
1847+
value: 1,
1848+
},
1849+
],
1850+
times: 4,
1851+
trigger: {
1852+
kind: "turnStart",
1853+
},
1854+
},
1855+
},
18051856
{
18061857
id: "etainoshirenaimono",
18071858
name: "得体の知れないモノ",

src/lesson-mutation.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,41 @@ describe("activateEffectIf", () => {
7676
},
7777
],
7878
},
79+
{
80+
name: "drainModifier - motivation - 現在値より減少値が高い時、0になるまで減らす",
81+
args: [
82+
(() => {
83+
const lesson = createLessonForTest();
84+
lesson.idol.modifiers = [{ kind: "motivation", amount: 2, id: "m1" }];
85+
return lesson;
86+
})(),
87+
{ kind: "drainModifier", modifierKind: "motivation", value: 5 },
88+
() => 0,
89+
createIdGenerator(),
90+
],
91+
expected: [
92+
{
93+
kind: "modifiers.update",
94+
propertyNameKind: "amount",
95+
id: "m1",
96+
actual: -2,
97+
max: -5,
98+
},
99+
],
100+
},
101+
{
102+
name: "drainModifier - motivation - 現在値が0の時、何もしない",
103+
args: [
104+
(() => {
105+
const lesson = createLessonForTest();
106+
return lesson;
107+
})(),
108+
{ kind: "drainModifier", modifierKind: "motivation", value: 1 },
109+
() => 0,
110+
createIdGenerator(),
111+
],
112+
expected: [],
113+
},
79114
{
80115
name: "generateCard - 手札0枚で実行した時、強化されたSSRのスキルカードを追加して、手札はその1枚になる",
81116
args: [

src/lesson-mutation.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,30 @@ export const activateEffect = <
844844
];
845845
break;
846846
}
847+
case "drainModifier": {
848+
switch (effect.modifierKind) {
849+
case "motivation": {
850+
const motivation = lesson.idol.modifiers.find(
851+
(e) => e.kind === "motivation",
852+
);
853+
if (motivation) {
854+
diffs.push({
855+
kind: "modifiers.update",
856+
propertyNameKind: "amount",
857+
id: motivation.id,
858+
actual: Math.max(-effect.value, -motivation.amount) + 0,
859+
max: -effect.value + 0,
860+
});
861+
}
862+
break;
863+
}
864+
default: {
865+
const unreachable: never = effect;
866+
throw new Error(`Unreachable statement`);
867+
}
868+
}
869+
break;
870+
}
847871
case "drawCards": {
848872
const { deck, discardPile, drawnCards } = drawCardsFromDeck(
849873
lesson.deck,

src/text-generation.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,11 @@ describe("generateEffectText", () => {
649649
expected: "体力減少1",
650650
name: "drainLife",
651651
},
652+
{
653+
args: [{ kind: "drainModifier", modifierKind: "motivation", value: 1 }],
654+
expected: "{{やる気減少}}1",
655+
name: "drainModifier - motivation",
656+
},
652657
{
653658
args: [{ kind: "drawCards", amount: 1 }],
654659
expected: "スキルカードを引く",
@@ -1399,6 +1404,23 @@ describe("generateProducerItemDescription", () => {
13991404
"(レッスン内2回)",
14001405
].join("\n"),
14011406
},
1407+
{
1408+
producerItemId: "sutairisshumodo",
1409+
expected: [
1410+
"ターン開始時{{やる気}}が3以上の場合、{{好印象}}+3",
1411+
"{{やる気減少}}1",
1412+
"(レッスン内3回)",
1413+
].join("\n"),
1414+
},
1415+
{
1416+
producerItemId: "sutairisshumodo",
1417+
enhanced: true,
1418+
expected: [
1419+
"ターン開始時{{やる気}}が3以上の場合、{{好印象}}+3",
1420+
"{{やる気減少}}1",
1421+
"(レッスン内4回)",
1422+
].join("\n"),
1423+
},
14021424
];
14031425
test.each(testParameters)(
14041426
'$producerItemId => "$expected"',

src/text-generation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const globalKeywords = {
104104
delayedEffect: metaModifierDictioanry.delayedEffect.label,
105105
doubleEffect: metaModifierDictioanry.doubleEffect.label,
106106
doubleLifeConsumption: metaModifierDictioanry.doubleLifeConsumption.label,
107+
drainMotivationModifier: "やる気減少",
107108
enhanceHand: "レッスン中強化",
108109
excellentCondition: metaModifierDictioanry.excellentCondition.label,
109110
fixedValueVitality: "固定元気",
@@ -434,6 +435,9 @@ const generateEffectWithoutConditionText = (effect: Effect): string => {
434435
switch (effect.kind) {
435436
case "drainLife":
436437
return `体力減少${effect.value}`;
438+
case "drainModifier":
439+
// TODO: 現状はやる気だけなので決め打ち
440+
return `${kwd("drainMotivationModifier")}${effect.value}`;
437441
case "drawCards":
438442
return effect.amount === 1
439443
? "スキルカードを引く"

src/types.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,20 @@ export type EffectWithoutCondition = Readonly<
609609
kind: "drainLife";
610610
value: number;
611611
}
612+
| {
613+
/**
614+
* 状態修正を減少する
615+
*
616+
* - 原文の構文は、「{modifierKind}減少{value}」
617+
* - 「スタイリッシュモード」は、「やる気減少1」
618+
* - 現状はスキルカードには存在しない効果
619+
* - 減少する値が不足している場合は、0になるまで減少する
620+
* - 本家仕様は未調査
621+
*/
622+
kind: "drainModifier";
623+
modifierKind: "motivation";
624+
value: number;
625+
}
612626
| {
613627
/**
614628
* スキルカードを引く

0 commit comments

Comments
 (0)