From c88979589d322a2549109049b51759ab88927533 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 24 Jun 2023 16:51:18 +0200 Subject: Misc bugs. --- play.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'play.js') diff --git a/play.js b/play.js index a860eb3..1b72d44 100644 --- a/play.js +++ b/play.js @@ -82,6 +82,25 @@ const CARD_INFO = [ { name: "P4X", type: 2, cost: 4, event: "Demagogue" }, ] +const EVENT_NAME = [ + "None", + "Plague of Cyprian", + "Ardashir", + "Priest King", + "Palmyra Allies", + "Shapur I", + "Postumus", + "Ludi Saeculares", + "Cniva", + "Zenobia", + "Bad Auguries", + "Raiding Parties", + "Preparing for War", + "Inflation", + "Good Auguries", + "Diocletian", +] + const ITALIA = 0 const ASIA = 1 const GALLIA = 2 @@ -1362,7 +1381,7 @@ function sub_region_name(match, p1) { function sub_event_name(match, p1) { let x = p1 | 0 // TODO: tooltip? - return CARD_INFO[CARD_INDEX[x]].event + return EVENT_NAME[x] } function sub_dice_image(match) { @@ -1382,6 +1401,7 @@ function on_log(text) { text = text.replace(/>/g, ">") text = text.replace(/%(\d+)/g, sub_region_name) + text = text.replace(/\bE(\d+)/g, sub_event_name) text = text.replace(/\b[BW]\d\b/g, sub_dice_image) if (text.match(/^.turn/)) { -- cgit v1.2.3