Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/holy-war.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ This tool compares the spheres of influence represented by the gods of
nearby civilizations with those worshipped by your civilization and
represented in fortress temples. If no spheres overlap, or if the
historical record shows a ``religious_persecution_grudge`` between the
two peoples, the civilization is set to war.
two peoples, the civilization is set to war. Both your stance toward
the other civilization and their stance toward you are set to war,
ensuring a mutual declaration.

Usage
-----
Expand Down
13 changes: 10 additions & 3 deletions holy-war.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,21 @@ local function main(...)

for _, civ in ipairs(df.global.world.entities.all) do
if civ.type == 0 and civ.id ~= pciv.id then
local status
local p_status
for _, state in ipairs(pciv.relations.diplomacy.state) do
if state.group_id == civ.id then
status = state.relation
p_status = state.relation
break
end
end
if status == 0 or status == nil then -- peace or unknown
local c_status
for _, state in ipairs(civ.relations.diplomacy.state) do
if state.group_id == pciv.id then
c_status = state.relation
break
end
end
if p_status ~= 1 or c_status ~= 1 then -- not already mutually at war
local civ_spheres = get_civ_spheres(civ)
local civ_hfs = get_civ_hists(civ)
if not share(player_spheres, civ_spheres) or
Expand Down