Skip to content
Snippets Groups Projects
Commit d3393aa4 authored by dg's avatar dg
Browse files

AI will not target/stop attacking invulnerable creatures (like those affected by Time Prison)

git-svn-id: http://svn.net-core.org/repos/t-engine4@3275 51575b47-30f0-44d4-a5cc-537603b46e54
parent 8771749e
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
-- Engine Version
engine.version = {0,9,25,"te4",14}
engine.version = {0,9,26,"te4",14}
engine.require_c_core = engine.version[5]
engine.version_id = ("%s-%d_%d.%d.%d"):format(engine.version[4], engine.require_c_core, engine.version[1], engine.version[2], engine.version[3])
......
......@@ -23,8 +23,8 @@ short_name = "boot"
author = { "DarkGod", "darkgod@te4.org" }
homepage = "http://te4.org/"
is_boot = true
version = {0,9,25}
engine = {0,9,25,"te4"}
version = {0,9,26}
engine = {0,9,26,"te4"}
description = [[
Bootmenu!
]]
......
......@@ -23,7 +23,7 @@ short_name = "example"
author = { "DarkGod", "darkgod@te4.org" }
homepage = "http://te4.org/modules:example"
version = {1,0,0}
engine = {0,9,25,"te4"}
engine = {0,9,26,"te4"}
description = [[
This is *NOT* a game, just an example/template to make your own using the T-Engine4.
]]
......
......@@ -23,7 +23,7 @@ short_name = "example_realtime"
author = { "DarkGod", "darkgod@te4.org" }
homepage = "http://te4.org/modules:example"
version = {1,0,0}
engine = {0,9,25,"te4"}
engine = {0,9,26,"te4"}
description = [[
This is *NOT* a game, just an example/template to make your own using the T-Engine4.
]]
......
......@@ -21,7 +21,7 @@
-- this requires the ActorFOV interface, or an interface that provides self.fov.actors*
-- This is ToME specific, overriding the engine default target_simple to account for lite, infravision, ...
newAI("target_simple", function(self)
if self.ai_target.actor and not self.ai_target.actor.dead and game.level:hasEntity(self.ai_target.actor) and rng.percent(90) then return true end
if self.ai_target.actor and not self.ai_target.actor.dead and game.level:hasEntity(self.ai_target.actor) and rng.percent(90) and not self.ai_target.actor:attr("invulnerable") then return true end
-- Find closer enemy and target it
-- Get list of actors ordered by distance
......@@ -40,7 +40,7 @@ newAI("target_simple", function(self)
or
-- Otherwise check if we can see it with our "senses"
(self:canSee(act) and (self.fov.actors[act].sqdist <= sqsense) or game.level.map.lites(act.x, act.y))
) then
) and not act:attr("invulnerable") then
self.ai_target.actor = act
self:check("on_acquire_target", act)
......
......@@ -1067,8 +1067,8 @@ function _M:onTakeHit(value, src)
-- Frozen: absorb some damage into the iceblock
if self:attr("encased_in_ice") then
local eff = self:hasEffect(self.EFF_FROZEN)
value = value / 2
eff.hp = eff.hp - value
eff.hp = eff.hp - value * 0.25
value = value * 0.75
if eff.hp < 0 then self:removeEffect(self.EFF_FROZEN) end
end
......
......@@ -126,6 +126,10 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
dam = t.on_damage(target, t, type, dam)
end
if src:attr("stunned") then
dam = dam * 0.2
end
print("[PROJECTOR] final dam", dam)
local dead
......
......@@ -260,7 +260,7 @@ newEffect{
newEffect{
name = "FROZEN",
desc = "Frozen",
long_desc = function(self, eff) return ("The target is encased in ice. All damage done to you will be split in half, a part absorbed by the ice. Your defense is nullified while in the ice and you may only attack the ice. %d HP on the iceblock remaining."):format(eff.hp) end,
long_desc = function(self, eff) return ("The target is encased in ice. All damage done to you will be split, 25% absorbed by the ice and 75% by yourself. Your defense is nullified while in the ice and you may only attack the ice. %d HP on the iceblock remaining."):format(eff.hp) end,
type = "magical",
status = "detrimental",
parameters = {},
......
......@@ -22,8 +22,8 @@ long_name = "Tales of Maj'Eyal: Age of Ascendancy"
short_name = "tome"
author = { "DarkGod", "darkgod@te4.org" }
homepage = "http://tome.te4.org/"
version = {3,9,25}
engine = {0,9,25,"te4"}
version = {3,9,26}
engine = {0,9,26,"te4"}
description = [[
Welcome to Maj'Eyal.
......
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