From 38f37a646f25dc3ce81e540419fe63f215c43068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 30 Oct 2023 10:48:28 +0100 Subject: FLNRules : may_agitate_in? only if terror || \!oppose --- lib/colonial_twilight/fln_rules.rb | 2 +- spec/fln_rules_spec.rb | 4 ++-- spec/mock_board.rb | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/colonial_twilight/fln_rules.rb b/lib/colonial_twilight/fln_rules.rb index 49a591e..2c5c00b 100644 --- a/lib/colonial_twilight/fln_rules.rb +++ b/lib/colonial_twilight/fln_rules.rb @@ -13,7 +13,7 @@ module ColonialTwilight end def may_agitate_in?(space) - !space.country? && (space.fln_control? || space.fln_bases.positive?) + !space.country? && (space.fln_control? || space.fln_bases.positive?) && (space.terror.positive? || !space.oppose?) end def agitate_spaces(board) diff --git a/spec/fln_rules_spec.rb b/spec/fln_rules_spec.rb index 1b55288..ce9b384 100644 --- a/spec/fln_rules_spec.rb +++ b/spec/fln_rules_spec.rb @@ -69,8 +69,8 @@ describe ColonialTwilight::FLNRules do it 'collects spaces where operation can be conducted' do @board.load :short - # 6 with bases + 1 in fln control - expect(rules.agitate_spaces(@board).size).to eq(5) + # 4 with bases + 1 in fln control : but only 1 without fln control + expect(rules.agitate_spaces(@board).size).to eq(1) end end diff --git a/spec/mock_board.rb b/spec/mock_board.rb index 34c5272..e03be2b 100644 --- a/spec/mock_board.rb +++ b/spec/mock_board.rb @@ -30,7 +30,11 @@ class Sector end def support? - @data[:support] + @data[:support] || false + end + + def oppose? + @data[:oppose] || false end def terror -- cgit v1.1-2-g2b99