summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--info/readme.html2
-rw-r--r--play.css30
-rw-r--r--rules.js75
3 files changed, 65 insertions, 42 deletions
diff --git a/info/readme.html b/info/readme.html
index abcef14..d43559d 100644
--- a/info/readme.html
+++ b/info/readme.html
@@ -39,7 +39,7 @@ Select an army (general or militia) and then the target you want to attack.
<hr>
<p>
-How do I take the Increase Support Level, Place Militia, Hold Games, or Build Improvement actions?
+How to Increase Support Level, Place Militia, Hold Games, or Build Improvement?
<p>
Select the governor in the region you want to take the action.
diff --git a/play.css b/play.css
index d5b62aa..779794a 100644
--- a/play.css
+++ b/play.css
@@ -9,21 +9,28 @@ header.your_turn { background-color: orange; }
#turn_info { background-color: gainsboro; }
.role_vp { float: right; }
-body.Red header.your_turn { background-color: salmon; }
-body.Blue header.your_turn { background-color: skyblue; }
-body.Yellow header.your_turn { background-color: khaki; }
-body.Green header.your_turn { background-color: darkseagreen; }
-
-body.Observer #hand_panel, body.Observer #draw_panel, body.Observer #discard_panel {
+body.Observer #hand_panel, body.Observer #draw_panel, body.Observer #discard_panel, body.Observer #market_panel {
display: none;
}
+#role_Red .role_name { background-color: hsl(354,85%,67%) }
+#role_Blue .role_name { background-color: hsl(207,67%,78%) }
+#role_Yellow .role_name { background-color: hsl(47,100%,73%) }
+#role_Green .role_name { background-color: hsl(99,36%,60%) }
+
+body.Red .your_turn { background-color: hsl(354,85%,72%) }
+body.Blue .your_turn { background-color: hsl(207,67%,83%) }
+body.Yellow .your_turn { background-color: hsl(47,100%,78%) }
+body.Green .your_turn { background-color: hsl(99,36%,65%) }
+
+#log .h1.p_red { background-color: hsl(354,85%,77%) }
+#log .h1.p_blue { background-color: hsl(207,67%,83%) }
+#log .h1.p_yellow { background-color: hsl(47,100%,78%) }
+#log .h1.p_green { background-color: hsl(99,36%,70%) }
+
#log { background-color: whitesmoke; }
#log .h1 { background-color: silver; font-weight: bold; padding-top:2px; padding-bottom:2px; margin: 8px 0; text-align: center; }
-#log .h1.p_red { background-color: salmon; }
-#log .h1.p_blue { background-color: skyblue; }
-#log .h1.p_yellow { background-color: khaki; }
-#log .h1.p_green { background-color: darkseagreen; }
+#log .h1 { border-bottom: 1px solid #444; border-top: 1px solid #444; }
#log .h2 { background-color: gainsboro; padding-top:2px; padding-bottom:2px; text-align: center; }
#log .h3 { text-decoration: underline; }
#log div { padding-left: 20px; text-indent: -12px; }
@@ -506,6 +513,9 @@ body.shift #zenobia { background-image: url(images/rival_back.png) }
filter: brightness(75%)
}
+#played { background-image: repeating-linear-gradient(45deg, #555, #555 40px, #444 40px, #444 80px) }
+#market { background-image: repeating-linear-gradient(135deg, darkgray, darkgray 60px, gray 60px, gray 120px) }
+
#discard .card.action {
box-shadow: 0 0 0px 3px #a00;
}
diff --git a/rules.js b/rules.js
index f79edd0..2102329 100644
--- a/rules.js
+++ b/rules.js
@@ -354,25 +354,25 @@ const CARD_INFO = [
{ name: "M1", type: 0, value: 1, event: "None" },
{ name: "S1", type: 1, value: 1, event: "None" },
{ name: "P1", type: 2, value: 1, event: "None" },
- { name: "M2 - Castra", type: 0, value: 2, event: "Castra" },
- { name: "S2 - Tribute", type: 1, value: 2, event: "Tribute" },
- { name: "P2 - Quaestor", type: 2, value: 2, event: "Quaestor" },
- { name: "M2 - Cavalry", type: 0, value: 2, event: "Cavalry" },
- { name: "S2 - Princeps Senatus", type: 1, value: 2, event: "Princeps Senatus" },
- { name: "P2 - Ambitus", type: 2, value: 2, event: "Ambitus" },
- { name: "M3 - Flanking Maneuver", type: 0, value: 3, event: "Flanking Maneuver" },
- { name: "S3 - Foederati", type: 1, value: 3, event: "Foederati" },
- { name: "P3 - Mob", type: 2, value: 3, event: "Mob" },
- { name: "M3 - Force March", type: 0, value: 3, event: "Force March" },
- { name: "S3 - Frumentarii", type: 1, value: 3, event: "Frumentarii" },
- { name: "P3 - Mobile Vulgus", type: 2, value: 3, event: "Mobile Vulgus" },
- { name: "M4 - Praetorian Guard", type: 0, value: 4, event: "Praetorian Guard" },
- { name: "S4 - Damnatio Memoriae", type: 1, value: 4, event: "Damnatio Memoriae" },
- { name: "S4 - Damnatio Memoriae", type: 1, value: 4, event: "Damnatio Memoriae (exp)" },
- { name: "P4 - Pretender", type: 2, value: 4, event: "Pretender" },
- { name: "M4 - Spiculum", type: 0, value: 4, event: "Spiculum" },
- { name: "S4 - Triumph", type: 1, value: 4, event: "Triumph" },
- { name: "P4 - Demagogue", type: 2, value: 4, event: "Demagogue" },
+ { name: "M2 Castra", type: 0, value: 2, event: "Castra" },
+ { name: "S2 Tribute", type: 1, value: 2, event: "Tribute" },
+ { name: "P2 Quaestor", type: 2, value: 2, event: "Quaestor" },
+ { name: "M2 Cavalry", type: 0, value: 2, event: "Cavalry" },
+ { name: "S2 Princeps Senatus", type: 1, value: 2, event: "Princeps Senatus" },
+ { name: "P2 Ambitus", type: 2, value: 2, event: "Ambitus" },
+ { name: "M3 Flanking Maneuver", type: 0, value: 3, event: "Flanking Maneuver" },
+ { name: "S3 Foederati", type: 1, value: 3, event: "Foederati" },
+ { name: "P3 Mob", type: 2, value: 3, event: "Mob" },
+ { name: "M3 Force March", type: 0, value: 3, event: "Force March" },
+ { name: "S3 Frumentarii", type: 1, value: 3, event: "Frumentarii" },
+ { name: "P3 Mobile Vulgus", type: 2, value: 3, event: "Mobile Vulgus" },
+ { name: "M4 Praetorian Guard", type: 0, value: 4, event: "Praetorian Guard" },
+ { name: "S4 Damnatio Memoriae", type: 1, value: 4, event: "Damnatio Memoriae" },
+ { name: "S4 Damnatio Memoriae", type: 1, value: 4, event: "Damnatio Memoriae (exp)" },
+ { name: "P4 Pretender", type: 2, value: 4, event: "Pretender" },
+ { name: "M4 Spiculum", type: 0, value: 4, event: "Spiculum" },
+ { name: "S4 Triumph", type: 1, value: 4, event: "Triumph" },
+ { name: "P4 Demagogue", type: 2, value: 4, event: "Demagogue" },
]
function card_name(c) {
@@ -1041,6 +1041,7 @@ function eliminate_barbarian(id) {
}
function eliminate_rival_emperor(id) {
+ log(RIVAL_EMPEROR_NAME[id] + " killed!")
if (game.battle)
game.battle.killed |= (1 << id)
set_rival_emperor_location(id, AVAILABLE)
@@ -1432,7 +1433,7 @@ function invade_with_barbarian_counter(id, path, where) {
function goto_crisis_event() {
game.active_event = game.events.pop()
- log("E" + game.active_event)
+ logi("E" + game.active_event)
switch (game.active_event) {
case EVENT_ARDASHIR: return goto_crisis_barbarian_leader(ARDASHIR, SASSANIDS_HOMELAND)
@@ -1920,7 +1921,7 @@ states.take_actions = {
support() {
push_undo()
- improve_support()
+ increase_support_level()
},
place_militia() {
@@ -2057,12 +2058,12 @@ states.build_improvement = {
},
}
-// ACTION: IMPROVE SUPPORT
+// ACTION: INCREASE SUPPORT LEVEL
-function improve_support() {
+function increase_support_level() {
let where = get_governor_location(game.selected_governor)
let support = get_support(where)
- log("Built Support in %" + where + ".")
+ log("Increase Support Level in %" + where + ".")
spend_populace(support + 1)
set_support(where, support + 1)
}
@@ -2780,10 +2781,11 @@ states.foederati_general = {
barbarian(id) {
let tribe = get_barbarian_tribe(id)
let from = get_barbarian_location(id)
- log("Foederati " + BARBARIAN_NAME[tribe] + " from %" + from + ".")
if (count_legions_in_army(game.count) > count_barbarians_in_army(game.count)) {
+ log("Foederati " + BARBARIAN_NAME[tribe] + " from %" + from + " to %" + game.where + ".")
set_barbarian_location(id, ARMY + game.count)
} else {
+ log("Foederati " + BARBARIAN_NAME[tribe] + " in %" + from + ".")
eliminate_barbarian(id)
}
game.state = "take_actions"
@@ -2802,7 +2804,7 @@ states.foederati_militia = {
barbarian(id) {
let tribe = get_barbarian_tribe(id)
let from = get_barbarian_location(id)
- log("Foederati " + BARBARIAN_NAME[tribe] + " from %" + from + ".")
+ log("Foederati " + BARBARIAN_NAME[tribe] + " in %" + from + ".")
eliminate_barbarian(id)
game.state = "take_actions"
},
@@ -3417,6 +3419,14 @@ function award_legacy(p, reason, n) {
game.legacy[p] += n
}
+function award_legacy_summary(p, reason, n) {
+ if (n > 0)
+ logi("+" + n + " for " + reason)
+ if (n < 0)
+ logi(n + " for " + reason)
+ game.legacy[p] += n
+}
+
function goto_combat_no_victory() {
game.battle.killed = 0
end_battle()
@@ -3662,9 +3672,10 @@ states.expand_pretender_empire = {
function goto_gain_legacy() {
log_br()
+ log("Gain Legacy")
if (is_only_pretender_player())
- award_legacy(game.current, "Pretender", count_own_breakaway_provinces())
+ award_legacy_summary(game.current, "Pretender", count_own_breakaway_provinces())
if (is_emperor_player())
goto_legitimize_claim()
@@ -3697,16 +3708,16 @@ states.legitimize_claim = {
function goto_gain_legacy_emperor() {
if (!is_any_rival_emperor_or_pretender()) {
- log(PLAYER_NAMES[game.current] + " +1 Emperor Turn.")
+ logi("+1 Emperor Turn")
game.emperor_turns[game.current] += 1
}
- award_legacy(game.current, "Emperor", Math.max(0, get_support(ITALIA) - count_pretender_provinces()))
+ award_legacy_summary(game.current, "Emperor", Math.max(0, get_support(ITALIA) - count_pretender_provinces()))
goto_gain_legacy_provinces()
}
function goto_gain_legacy_provinces() {
- award_legacy(game.current, "Provinces", count_own_provinces())
- award_legacy(game.current, "Improvements", count_own_improvements())
+ award_legacy_summary(game.current, "Provinces", count_own_provinces())
+ award_legacy_summary(game.current, "Improvements", count_own_improvements())
if (is_emperor_player() && game.legacy[game.current] >= 60) {
log_br()
@@ -4186,6 +4197,8 @@ exports.setup = function (seed, scenario, options) {
update_neutral_italia()
+ log_h1("Time of Crisis")
+
game.first = game.current = random(player_count)
return save_game()