Skip to content

Commit

Permalink
SSR「ようこそ初星温泉」千奈を追加
Browse files Browse the repository at this point in the history
合わせて、multiplyModifier へ focus を追加
  • Loading branch information
kjirou committed Sep 12, 2024
1 parent a54f1a4 commit de38ce4
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 13 deletions.
40 changes: 40 additions & 0 deletions src/data/cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7101,6 +7101,46 @@ export const cardsAsConst = [
{},
],
},
{
id: "kokuritohitokuchi",
name: "こくりとひとくち",
cardPossessionKind: "sense",
cardSummaryKind: "mental",
cardProviderKind: "idol",
nonDuplicative: true,
rarity: "ssr",
contents: [
{
cost: { kind: "normal", value: 5 },
effects: [
{ kind: "getModifier", modifier: { kind: "focus", amount: 3 } },
{
kind: "getModifier",
modifier: { kind: "additionalCardUsageCount", amount: 1 },
},
],
innate: true,
usableOncePerLesson: true,
},
{
effects: [
{ kind: "getModifier", modifier: { kind: "focus", amount: 4 } },
{
kind: "getModifier",
modifier: { kind: "halfLifeConsumption", duration: 1 },
},
{
kind: "getModifier",
modifier: { kind: "additionalCardUsageCount", amount: 1 },
},
],
},
// TODO: ++
{},
// TODO: +++
{},
],
},
{
id: "yosomihadame",
name: "よそ見はダメ♪",
Expand Down
12 changes: 12 additions & 0 deletions src/data/idols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,18 @@ export const idolsAsConst = [
specificProducerItemId: "midorinoosoroiburesu",
title: "学園生活",
},
{
id: "kuramotochina-ssr-3",
characterId: "kuramotochina",
producePlan: {
kind: "sense",
recommendedModifierKind: "focus",
},
rarity: "ssr",
specificCardId: "kokuritohitokuchi",
specificProducerItemId: "onsennoatonootanoshimi",
title: "ようこそ初星温泉",
},
{
id: "kuramotochina-ssr-2",
characterId: "kuramotochina",
Expand Down
37 changes: 37 additions & 0 deletions src/data/producer-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,43 @@ export const producerItemsAsConst = [
trigger: { kind: "turnStart" },
},
},
{
id: "onsennoatonootanoshimi",
name: "温泉の後のお楽しみ",
producerItemPossessionKind: "sense",
producerItemProviderKind: "idol",
rarity: "ssr",
base: {
effects: [
{
kind: "multiplyModifier",
modifierKind: "focus",
multiplier: 1.3,
},
{
kind: "perform",
vitality: { fixedValue: true, value: 2 },
},
],
times: 2,
trigger: { kind: "beforeCardEffectActivationEveryNTimes", interval: 4 },
},
enhanced: {
effects: [
{
kind: "multiplyModifier",
modifierKind: "focus",
multiplier: 1.3,
},
{
kind: "perform",
vitality: { fixedValue: true, value: 7 },
},
],
times: 2,
trigger: { kind: "beforeCardEffectActivationEveryNTimes", interval: 4 },
},
},
{
id: "piggudorimuchokimbako",
name: "ピッグドリーム貯金箱",
Expand Down
31 changes: 30 additions & 1 deletion src/lesson-mutation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,36 @@ describe("activateEffectIf", () => {
],
},
{
name: "multiplyModifier",
name: "multiplyModifier - focus",
args: [
(() => {
const lesson = createLessonForTest();
lesson.idol.modifiers = [
{ kind: "focus", amount: 10, id: "m1" },
{ kind: "positiveImpression", amount: 100, id: "m2" },
];
return lesson;
})(),
{
kind: "multiplyModifier",
modifierKind: "focus",
multiplier: 1.5,
},
() => 0,
createIdGenerator(),
],
expected: [
{
kind: "modifiers.update",
propertyNameKind: "amount",
id: "m1",
actual: 5,
max: 5,
},
],
},
{
name: "multiplyModifier - positiveImpression",
args: [
(() => {
const lesson = createLessonForTest();
Expand Down
44 changes: 33 additions & 11 deletions src/lesson-mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1091,17 +1091,39 @@ export const activateEffect = <
const modifier = lesson.idol.modifiers.find(
(e) => e.kind === effect.modifierKind,
);
// 現在は、好印象に対してしか存在しない効果なので、そのこと前提で実装している
if (modifier?.kind === "positiveImpression") {
const amount =
Math.ceil(modifier.amount * effect.multiplier) - modifier.amount;
diffs.push({
kind: "modifiers.update",
propertyNameKind: "amount",
id: modifier.id,
actual: amount,
max: amount,
});
switch (effect.modifierKind) {
case "focus": {
if (modifier && "amount" in modifier) {
const amount =
Math.ceil(modifier.amount * effect.multiplier) - modifier.amount;
diffs.push({
kind: "modifiers.update",
propertyNameKind: "amount",
id: modifier.id,
actual: amount,
max: amount,
});
}
break;
}
case "positiveImpression": {
if (modifier && "amount" in modifier) {
const amount =
Math.ceil(modifier.amount * effect.multiplier) - modifier.amount;
diffs.push({
kind: "modifiers.update",
propertyNameKind: "amount",
id: modifier.id,
actual: amount,
max: amount,
});
}
break;
}
default: {
const unreachable: never = effect;
throw new Error(`Unreachable statement`);
}
}
break;
}
Expand Down
28 changes: 28 additions & 0 deletions src/text-generation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,17 @@ describe("generateCardDescription", () => {
"{{レッスン中1回}}{{重複不可}}",
].join("\n"),
},
{
cardId: "kokuritohitokuchi",
enhancements: [{ kind: "original" }],
expected: [
"レッスン開始時手札に入る",
"{{集中}}+4",
"{{消費体力減少}}1ターン",
"{{スキルカード使用数追加}}+1",
"{{レッスン中1回}}{{重複不可}}",
].join("\n"),
},
];
test.each(testParameters)(
'$cardId => "$expected"',
Expand Down Expand Up @@ -1348,6 +1359,23 @@ describe("generateProducerItemDescription", () => {
"(レッスン内2回)",
].join("\n"),
},
{
producerItemId: "onsennoatonootanoshimi",
expected: [
"スキルカードを4回使用するごとに、{{集中}}1.3倍",
"{{固定元気}}+2",
"(レッスン内2回)",
].join("\n"),
},
{
producerItemId: "onsennoatonootanoshimi",
enhanced: true,
expected: [
"スキルカードを4回使用するごとに、{{集中}}1.3倍",
"{{固定元気}}+7",
"(レッスン内2回)",
].join("\n"),
},
];
test.each(testParameters)(
'$producerItemId => "$expected"',
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ export type EffectWithoutCondition = Readonly<
* - 現状は「夢へのライフログ」の1.5倍しかないので、本実装では切り上げる
*/
kind: "multiplyModifier";
modifierKind: "positiveImpression";
modifierKind: "focus" | "positiveImpression";
multiplier: number;
}
| {
Expand Down

0 comments on commit de38ce4

Please sign in to comment.