summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-28 17:45:33 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-28 17:45:33 +0100
commitaf6f5046978e0808287a3eaeea090e02e7afa949 (patch)
treebd9a6a507de29c5a4878081fe5fb2403a1346368
parent93e9fab572ce3a90ad18ac83504ec3d05f3b60c2 (diff)
downloadland-and-freedom-af6f5046978e0808287a3eaeea090e02e7afa949.tar.gz
Add "medallion" source type for use with Momentum/Archives/Volunteers.
-rw-r--r--play.js5
-rw-r--r--rules.js14
-rw-r--r--rules.ts17
-rw-r--r--types.d.ts2
4 files changed, 29 insertions, 9 deletions
diff --git a/play.js b/play.js
index 91ef6c4..b2ed9e2 100644
--- a/play.js
+++ b/play.js
@@ -577,8 +577,10 @@ function on_update() { // eslint-disable-line no-unused-vars
action_button("Communist", "Communist")
action_button("Moderate", "Moderate")
+ // medallion hero point buttons
+ action_button("remove_blank_marker", "Archives")
+ action_button("add_to_front", "Volunteers")
action_button("add_glory", "Add to Bag of Glory")
- action_button("add_to_front", "+1 to a Front")
action_button("draw_card", "Draw a Card")
action_button("draw_cards", "Draw Cards")
action_button("draw_glory", "Draw from Bag of Glory")
@@ -586,7 +588,6 @@ function on_update() { // eslint-disable-line no-unused-vars
action_button("lose_hp", "Lose Hero Points")
action_button("play_to_tableau", "Action Points")
action_button("play_for_event", "Event")
- action_button("remove_blank_marker", "Remove Blank marker")
action_button("use_momentum", "Momentum")
action_button("use_ap", "Action Points")
diff --git a/rules.js b/rules.js
index 645d7b7..72edae1 100644
--- a/rules.js
+++ b/rules.js
@@ -1729,9 +1729,14 @@ states.remove_blank_marker = {
pay_hero_points(faction, 1);
const track_id = Math.floor(b / 11);
const space_id = b % 11;
- logp(`removed blank marker from ${get_track_name(track_id)} ${space_id}`);
game.triggered_track_effects = game.triggered_track_effects.filter((id) => id !== b);
- game.used_medallions.push(data_1.ARCHIVES_MEDALLION_ID);
+ if (get_active_node_args()?.src === 'medallion') {
+ logi(`M${data_1.ARCHIVES_MEDALLION_ID} removed Blank from ${get_track_name(track_id)} ${space_id}`);
+ game.used_medallions.push(data_1.ARCHIVES_MEDALLION_ID);
+ }
+ else {
+ logi(`Removed Blank from ${get_track_name(track_id)} ${space_id}`);
+ }
resolve_active_and_proceed();
},
skip() {
@@ -1885,6 +1890,7 @@ states.spend_hero_points = {
const faction = get_active_faction();
pay_hero_points(faction, 1);
insert_after_active_node(create_state_node('add_to_front', faction, {
+ src: 'medallion',
t: data_1.ANY,
v: 1,
}));
@@ -1912,7 +1918,7 @@ states.spend_hero_points = {
else {
game.used_medallions = [data_1.ARCHIVES_MEDALLION_ID];
}
- insert_after_active_node(create_state_node('remove_blank_marker', faction));
+ insert_after_active_node(create_state_node('remove_blank_marker', faction, { 'src': 'medallion' }));
resolve_active_and_proceed();
},
tr0(x) {
@@ -3007,6 +3013,8 @@ function get_source_name(source) {
case 'tr4': return tracks[4].name + ' Trigger';
case 'track_icon':
throw "UNUSED";
+ case 'medallion':
+ return "Medallion";
case data_1.MOMENTUM:
return 'Momentum';
}
diff --git a/rules.ts b/rules.ts
index 06c903e..4e21b3c 100644
--- a/rules.ts
+++ b/rules.ts
@@ -2097,13 +2097,21 @@ states.remove_blank_marker = {
const faction = get_active_faction();
pay_hero_points(faction, 1);
+
const track_id = Math.floor(b / 11);
const space_id = b % 11;
- logp(`removed blank marker from ${get_track_name(track_id)} ${space_id}`);
game.triggered_track_effects = game.triggered_track_effects.filter(
(id) => id !== b
);
- game.used_medallions.push(ARCHIVES_MEDALLION_ID);
+
+ // Used medallion
+ if (get_active_node_args()?.src === 'medallion') {
+ logi(`M${ARCHIVES_MEDALLION_ID} removed Blank from ${get_track_name(track_id)} ${space_id}`);
+ game.used_medallions.push(ARCHIVES_MEDALLION_ID);
+ } else {
+ logi(`Removed Blank from ${get_track_name(track_id)} ${space_id}`);
+ }
+
resolve_active_and_proceed();
},
skip() {
@@ -2296,6 +2304,7 @@ states.spend_hero_points = {
pay_hero_points(faction, 1);
insert_after_active_node(
create_state_node('add_to_front', faction, {
+ src: 'medallion',
t: ANY,
v: 1,
})
@@ -2323,7 +2332,7 @@ states.spend_hero_points = {
} else {
game.used_medallions = [ARCHIVES_MEDALLION_ID];
}
- insert_after_active_node(create_state_node('remove_blank_marker', faction));
+ insert_after_active_node(create_state_node('remove_blank_marker', faction, { 'src': 'medallion' }));
resolve_active_and_proceed();
},
tr0(x: number) {
@@ -3737,6 +3746,8 @@ function get_source_name(source: EffectSource): string {
case 'tr4': return tracks[4].name + ' Trigger';
case 'track_icon':
throw "UNUSED"
+ case 'medallion':
+ return "Medallion";
case MOMENTUM:
return 'Momentum';
}
diff --git a/types.d.ts b/types.d.ts
index 3d61fbd..0e6417f 100644
--- a/types.d.ts
+++ b/types.d.ts
@@ -190,7 +190,7 @@ export interface PlayerCard extends CardBase {
icons: Icon[];
}
-export type EffectSource = 'player_event' | 'fascist_event' | 'fascist_test' | 'track_icon' | 'momentum' | 'tr0' | 'tr1' | 'tr2' | 'tr3' | 'tr4';
+export type EffectSource = 'player_event' | 'fascist_event' | 'fascist_test' | 'track_icon' | 'momentum' | 'tr0' | 'tr1' | 'tr2' | 'tr3' | 'tr4' | 'medallion';
export interface Effect {
type: