Skip to content
Snippets Groups Projects
Commit 1235c704 authored by DarkGod's avatar DarkGod
Browse files

Merge branch 'summon_ai_fix' into 'master'

Summon AI fix

A bug which became much more prominent with introduction of temporal clones (which have high chance to have access to less-than-a-turn talents) and Temporal Fugue in particular (where turns not ticking down AT ALL when AI is far from player becomes a serious concern.)

This commit makes for a more predictable and accurate summon_time behaviour, making it tick down in NPC.actBase if ai is "summoned" and the creature isn't out of timeflow.

IMPORTANT: considerations need to be made for Mucus Oozes (which have 70% global speed) and Bloated Oozes (50%), as it effectively brings their summon time to what's advertised (6-10 turns.) Whether this is desirable needs to be decided.
parents ac66335b a37a208d
No related branches found
No related tags found
No related merge requests found
......@@ -17,19 +17,8 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
-- "summoned" AI is checked in mod.class.NPC to count down summon timer.
newAI("summoned", function(self)
-- Run out of time ?
if self.summon_time then
self.summon_time = self.summon_time - 1
if self.summon_time <= 0 then
if not self.summon_quiet then
game.logPlayer(self.summoner, "#PINK#Your summoned %s disappears.", self.name)
end
self:die()
self.dead_by_unsummon = true
end
end
if self:runAI(self.ai_state.ai_target or "target_simple") then
return self:runAI(self.ai_real)
end
......
......@@ -45,6 +45,17 @@ function _M:actBase()
self.shove_pressure = self.shove_pressure / 2
end
end
-- Run out of time ?
if self.ai and self.ai == "summoned" and not self:attr("no_timeflow") and self.summon_time then
self.summon_time = self.summon_time - 1
if self.summon_time <= 0 then
if not self.summon_quiet then
game.logPlayer(self.summoner, "#PINK#Your summoned %s disappears.", self.name)
end
self:die()
self.dead_by_unsummon = true
end
end
return mod.class.Actor.actBase(self)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment