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

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@1335 51575b47-30f0-44d4-a5cc-537603b46e54
parent c51ed58a
No related branches found
No related tags found
No related merge requests found
...@@ -59,9 +59,10 @@ end ...@@ -59,9 +59,10 @@ end
function _M:useObject(who, ...) function _M:useObject(who, ...)
if self.use_power then if self.use_power then
if self.power >= self.use_power.power then if self.power >= self.use_power.power then
local ret, no_power = self.use_power.use(self, who, ...) local rets = { self.use_power.use(self, who, ...) }
local no_power = rets[3]
if not no_power then self.power = self.power - self.use_power.power end if not no_power then self.power = self.power - self.use_power.power end
return ret return unpack(rets)
else else
if self.power_regen and self.power_regen ~= 0 then if self.power_regen and self.power_regen ~= 0 then
game.logPlayer(who, "%s is still recharging.", self:getName{no_count=true}) game.logPlayer(who, "%s is still recharging.", self:getName{no_count=true})
...@@ -70,8 +71,7 @@ function _M:useObject(who, ...) ...@@ -70,8 +71,7 @@ function _M:useObject(who, ...)
end end
end end
elseif self.use_simple then elseif self.use_simple then
local ret = self.use_simple.use(self, who, ...) return self.use_simple.use(self, who, ...)
return ret
elseif self.use_talent then elseif self.use_talent then
if not self.use_talent.power or self.power >= self.use_talent.power then if not self.use_talent.power or self.power >= self.use_talent.power then
self.power = self.power - self.use_talent.power self.power = self.power - self.use_talent.power
......
...@@ -36,7 +36,7 @@ function _M:activateHotkey(id) ...@@ -36,7 +36,7 @@ function _M:activateHotkey(id)
if self.hotkey[id] then if self.hotkey[id] then
self["hotkey"..self.hotkey[id][1]:capitalize()](self, self.hotkey[id][2]) self["hotkey"..self.hotkey[id][1]:capitalize()](self, self.hotkey[id][2])
else else
Dialog:simplePopup("Hotkey not defined", "You may define a hotkey by pressing 'm' and following the inscructions there.") Dialog:simplePopup("Hotkey not defined", "You may define a hotkey by pressing 'm' and following the instructions there.")
end end
end end
......
...@@ -609,8 +609,8 @@ function _M:playerUseItem(object, item, inven) ...@@ -609,8 +609,8 @@ function _M:playerUseItem(object, item, inven)
local use_fct = function(o, inven, item) local use_fct = function(o, inven, item)
local co = coroutine.create(function() local co = coroutine.create(function()
self.changed = true self.changed = true
local ret, no_id = o:use(self, nil, inven, item) local ret, id = o:use(self, nil, inven, item)
if not no_id then if id then
o:identify(true) o:identify(true)
end end
if ret and ret == "destroy" then if ret and ret == "destroy" then
......
...@@ -139,5 +139,6 @@ newEntity{ ...@@ -139,5 +139,6 @@ newEntity{
who:teleportRandom(who.x, who.y, 200) who:teleportRandom(who.x, who.y, 200)
game.level.map:particleEmitter(who.x, who.y, 1, "teleport") game.level.map:particleEmitter(who.x, who.y, 1, "teleport")
game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true}) game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true})
return nil, true
end} end}
} }
...@@ -44,6 +44,7 @@ newEntity{ ...@@ -44,6 +44,7 @@ newEntity{
local power = 100 + who:getMag(120) local power = 100 + who:getMag(120)
who:setEffect(who.EFF_DAMAGE_SHIELD, 10, {power=power}) who:setEffect(who.EFF_DAMAGE_SHIELD, 10, {power=power})
game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true}) game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true})
return nil, true
end} end}
} }
......
...@@ -31,6 +31,7 @@ newEntity{ ...@@ -31,6 +31,7 @@ newEntity{
who:teleportRandom(who.x, who.y, 10 + who:getMag(5)) who:teleportRandom(who.x, who.y, 10 + who:getMag(5))
game.level.map:particleEmitter(who.x, who.y, 1, "teleport") game.level.map:particleEmitter(who.x, who.y, 1, "teleport")
game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true}) game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true})
return nil, true
end} end}
} }
......
...@@ -191,6 +191,7 @@ newEntity{ ...@@ -191,6 +191,7 @@ newEntity{
use = function(self, who) use = function(self, who)
who:heal(150 + who:getMag()) who:heal(150 + who:getMag())
game.logSeen(who, "%s quaffs an %s!", who.name:capitalize(), self:getName()) game.logSeen(who, "%s quaffs an %s!", who.name:capitalize(), self:getName())
return nil, true
end end
}, },
} }
...@@ -212,6 +213,7 @@ newEntity{ ...@@ -212,6 +213,7 @@ newEntity{
use = function(self, who) use = function(self, who)
who:incMana(150 + who:getMag()) who:incMana(150 + who:getMag())
game.logSeen(who, "%s quaffs an %s!", who.name:capitalize(), self:getName()) game.logSeen(who, "%s quaffs an %s!", who.name:capitalize(), self:getName())
return nil, true
end end
}, },
} }
......
...@@ -30,7 +30,7 @@ newTalent{ ...@@ -30,7 +30,7 @@ newTalent{
sustain_stamina = 30, sustain_stamina = 30,
activate = function(self, t) activate = function(self, t)
return { return {
speed = self:addTemporaryValue("combat_physspeed", self:combatSpeed() - 1 / (1 + self:getTalentLevel(t) * 0.08)), speed = self:addTemporaryValue("combat_physspeed", self:combatSpeed() - 1 / (1 + 0.08 * 1.3)),
atk = self:addTemporaryValue("combat_atk", 4 + (self:getTalentLevel(t) * self:getDex()) / 15), atk = self:addTemporaryValue("combat_atk", 4 + (self:getTalentLevel(t) * self:getDex()) / 15),
crit = self:addTemporaryValue("combat_physcrit", 4 + (self:getTalentLevel(t) * self:getDex()) / 25), crit = self:addTemporaryValue("combat_physcrit", 4 + (self:getTalentLevel(t) * self:getDex()) / 25),
} }
...@@ -43,7 +43,7 @@ newTalent{ ...@@ -43,7 +43,7 @@ newTalent{
end, end,
info = function(self, t) info = function(self, t)
return ([[You focus your strikes, reducing your attack speed by %d%% and increasing your attack by %d and critical chance by %d%%.]]): return ([[You focus your strikes, reducing your attack speed by %d%% and increasing your attack by %d and critical chance by %d%%.]]):
format((self:getTalentLevel(t) * 8), 4 + (self:getTalentLevel(t) * self:getDex()) / 15, 4 + (self:getTalentLevel(t) * self:getDex()) / 25) format((1.3 * 8), 4 + (self:getTalentLevel(t) * self:getDex()) / 15, 4 + (self:getTalentLevel(t) * self:getDex()) / 25)
end, 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