summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-05-24 18:14:13 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:12:55 +0100
commitda8679de9bef2713b91542a813d20eacb47e7a2b (patch)
tree825b6c38a4cb3993df0238fec733128d32d4e1ed /play.js
parentcb9d248f17e332f5d73cce0e1e14ea95f8867868 (diff)
downloadrichard-iii-da8679de9bef2713b91542a813d20eacb47e7a2b.tar.gz
Past tense log.
Diffstat (limited to 'play.js')
-rw-r--r--play.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/play.js b/play.js
index 92bab6e..d359eb9 100644
--- a/play.js
+++ b/play.js
@@ -69,18 +69,22 @@ function on_log(text) {
text = text.replace(/^([A-Z]):/, '<span class="$1"> $1 </span>');
- if (text.match(/^Scenario: /))
+ if (text.match(/^Scenario: /)) {
p.className = 'st', text = text.substring(10);
- else if (text.match(/^~ .* ~$/))
+ } else if (text.match(/^~ .* ~$/)) {
p.className = 'br', text = text.substring(2, text.length-2);
- else if (text.match(/^Start Lancaster turn/))
+ } else if (text.match(/^Start Lancaster turn/)) {
+ text = "Lancaster";
p.className = 'L';
- else if (text.match(/^Start York turn/))
+ } else if (text.match(/^Start York turn/)) {
+ text = "York";
p.className = 'Y';
- else if (text.match(/^Start /))
+ } else if (text.match(/^Start /)) {
p.className = 'st', text = text.replace(/\.$/, "");
- else if (text.match(/^Battle in/))
+ } else if (text.match(/^Battle in/)) {
+ text = text.substring(0,text.length-1);
p.className = 'bs';
+ }
if (text.match(/^Start /))
text = text.substring(6);