Skip to content

Commit 9330c15

Browse files
committed
!
1 parent a382ee6 commit 9330c15

1 file changed

Lines changed: 34 additions & 2 deletions

File tree

events.js

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const eventPool = [
2727
loser.status = "dead"; // Randomly pick a servant to die
2828
}
2929
},
30-
// Add more events here as needed...
3130
{
3231
id: "event_betrayal",
3332
description: "{servant1} betrays {master}. The master is left defenseless and killed.",
@@ -40,8 +39,41 @@ const eventPool = [
4039
}
4140
}
4241
},
42+
{
43+
id: "poison_mushroom",
44+
description: "{master.name} eats a poisonous mushroom!",
45+
valid: (participants) => participants.filter(p => p.type === "master" && p.status === "alive"),
46+
effects: (master, servant, participants) => {
47+
// no persistent state; just logs the event
48+
}
49+
},
50+
{
51+
id: "poison_death",
52+
description: "{master.name} succumbs to the poison and dies.",
53+
followUpFor: ["poison_mushroom"],
54+
valid: (participants, pastEvents) =>
55+
pastEvents.includes("poison_mushroom") &&
56+
participants.filter(p => p.type === "master" && p.status === "alive"),
57+
effects: (master, servant, participants) => {
58+
master.status = "dead";
59+
if (servant && !servant.hasIndependentAction) {
60+
servant.status = "dead";
61+
}
62+
}
63+
},
64+
{
65+
id: "poison_heal",
66+
description: "{master.name} miraculously recovers from the poison!",
67+
followUpFor: ["poison_mushroom"],
68+
valid: (participants, pastEvents) =>
69+
pastEvents.includes("poison_mushroom") &&
70+
participants.filter(p => p.type === "master" && p.status === "alive"),
71+
effects: (master, servant, participants) => {
72+
// healed, no death
73+
}
74+
},
4375

4476
];
4577

4678
// Export the eventPool so it can be used in other files
47-
export { eventPool };
79+
export { events };

0 commit comments

Comments
 (0)