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

fix invis

git-svn-id: http://svn.net-core.org/repos/t-engine4@170 51575b47-30f0-44d4-a5cc-537603b46e54
parent 61593685
No related branches found
No related tags found
No related merge requests found
......@@ -210,12 +210,12 @@ end
-- @return nil if v was specified. If not then it returns the current value if it exists and is not 0 otherwise returns nil
function _M:attr(prop, v, fix)
if v then
if fix then self.prop = v
else self.prop = (self.prop or 0) + v
if fix then self[prop] = v
else self[prop] = (self[prop] or 0) + v
end
else
if self.prop and self.prop ~= 0 then
return self.prop
if self[prop] and self[prop] ~= 0 then
return self[prop]
else
return nil
end
......
......@@ -113,14 +113,15 @@ end
function _M:aiSeeTargetPos(target)
local tx, ty = target.x, target.y
local see, chance = self:canSee(target)
-- Directly seeing it, no spread at all
if see then
return tx, ty
-- Ok we can see it, spread coords around, the less chance to see it we had the more we spread
else
chance = math.floor((100 - chance) / 10)
tx = tx + rng.range(chance * 2) - chance
ty = ty + rng.range(chance * 2) - chance
tx = tx + rng.range(0, chance * 2) - chance
ty = ty + rng.range(0, chance * 2) - chance
return tx, ty
end
end
......@@ -124,11 +124,6 @@ function _M:setTarget(target)
game.target.target.y = target.y
end
--- Quick way to check if the player can see the target
function _M:canSee(entity)
if entity.x and entity.y and game.level.map.seens(entity.x, entity.y) then return true end
end
--- Uses an hotkeyed talent
function _M:activateHotkey(id)
if self.hotkey[id] then
......
--[[
newBirthDescriptor{
type = "class",
name = "Warrior",
......@@ -15,7 +14,11 @@ newBirthDescriptor{
},
talents = { ActorTalents.T_STAMINA_POOL, },
copy = {
equipment = resolvers.equip{ {type="weapon", subtype="longsword"} },
equipment = resolvers.equip{
{type="weapon", subtype="longsword", name="iron longsword"},
{type="armor", subtype="shield", name="iron shield"},
{type="armor", subtype="massive", name="iron massive armor"}
},
},
}
......@@ -33,7 +36,7 @@ newBirthDescriptor{
["physical/1hweapon"]=true,
},
}
]]
newBirthDescriptor{
type = "class",
name = "Mage",
......@@ -50,7 +53,10 @@ newBirthDescriptor{
},
talents = { ActorTalents.T_MANA_POOL, },
copy = {
equipment = resolvers.equip{ {type="weapon", subtype="staff", name="elm staff"}, {type="armor", subtype="cloth", name="robe"} },
equipment = resolvers.equip{
{type="weapon", subtype="staff", name="elm staff"},
{type="armor", subtype="cloth", name="robe"}
},
},
}
......
......@@ -5,9 +5,7 @@ newBirthDescriptor{
},
talents = {},
experience = 1.0,
body = {
INVEN=1000,
},
body = { INVEN = 1000, MAINHAND=1, OFFHAND=1, BODY=1 },
}
load("/data/birth/races.lua")
......
......@@ -138,7 +138,7 @@ newEntity{ base = "BASE_POTION",
use_simple = { name="cures poison", use = function(self, who)
if who:hasEffect(who.EFF_POISONED) then
who:removeEffect(who.EFF_POISONED)
game.logSeen(who, "%s cures %s from poisoning!", self:getName(), who.name:capitalize())
game.logSeen(who, "%s cures %s from poisoning!", self:getName():capitalize(), who.name)
return "destroy", true
end
return "destroy", false
......
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