summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--events.txt2
-rw-r--r--rules.js28
2 files changed, 22 insertions, 8 deletions
diff --git a/events.txt b/events.txt
index a190471..e892bf5 100644
--- a/events.txt
+++ b/events.txt
@@ -170,7 +170,7 @@ EVENT 9
current VE
prompt "Compel in a Province adjacent to Warangal that you do not control and then Build there."
add_influence VE
- space 1 (is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current))
+ space 1 (is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current) && can_compel_in_space(s))
free_compel
mark_space
endspace
diff --git a/rules.js b/rules.js
index 71401ec..b71fe62 100644
--- a/rules.js
+++ b/rules.js
@@ -499,20 +499,23 @@ function goto_cavalry(n, next) {
}
function end_cavalry() {
+ if (game.vm && is_succession())
+ pop_summary()
+ else if (game.vm)
+ upop_summary()
+ else if (game.decree && game.decree.type === "Compel")
+ pop_summary()
+ else
+ upop_summary()
+
if (game.vm) {
- if (is_succession())
- pop_summary()
- else
- upop_summary()
vm_next()
} else if (game.cav.next) {
- upop_summary()
if (game.cav.next === "end_card")
end_card()
else
game.state = game.cav.next
} else {
- upop_summary()
goto_eligible()
}
}
@@ -2296,6 +2299,8 @@ states.compel_space = {
} else if (game.inf[VE] < 2) {
view.prompt = "Compel: Done."
view.actions.end_compel = 1
+ } else {
+ view.prompt = "Compel: Exercice your influence over other kingdoms."
}
if (game.inf[VE] >= 2 && game.decree.count < 2) {
@@ -2306,6 +2311,7 @@ states.compel_space = {
},
piece(p) {
+ push_undo()
set_add(game.decree.pieces, p)
if (piece_space(p) === AVAILABLE)
log_summary_place(p)
@@ -2329,6 +2335,11 @@ states.compel_space_influencial = {
gen_piece_in_space(game.decree.where, DS, TROOPS)
gen_piece_in_space(game.decree.where, DS, ELITE)
gen_piece_in_space(game.decree.where, BK, ELITE)
+
+ if (count_faction_units(game.decree.where, DS) + count_faction_units(game.decree.where, BK) === 0) {
+ view.prompt = "Compel: No enemy unit in the selected Province"
+ view.actions.skip = 1
+ }
},
piece(p) {
logi("Removed " + piece_name(p) + " from S" + piece_space(p))
@@ -2340,6 +2351,9 @@ states.compel_space_influencial = {
to_rebel(r)
goto_cavalry(1, end_decree)
+ },
+ skip() {
+ goto_cavalry(1, end_decree)
}
}
@@ -5888,7 +5902,7 @@ CODE[9 * 2 + 0] = [
[ vm_current, VE ],
[ vm_prompt, "Compel in a Province adjacent to Warangal that you do not control and then Build there." ],
[ vm_add_influence, VE ],
- [ vm_space, true, 1, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current)) ],
+ [ vm_space, true, 1, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current) && can_compel_in_space(s)) ],
[ vm_free_compel ],
[ vm_mark_space ],
[ vm_endspace ],