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

Gems can now simply be 'u'sed to regain mana (this is a regen effect over 5 turns, it stacks)

Kor's Fury now has ESP


git-svn-id: http://svn.net-core.org/repos/t-engine4@1889 51575b47-30f0-44d4-a5cc-537603b46e54
parent 05911e4f
No related branches found
No related tags found
No related merge requests found
......@@ -135,9 +135,9 @@ function _M:displayAtMap(tmx, tmy, mx, my, text)
local remember = game.level.map.remembers(tmx, tmy)
tt[#tt+1] = seen and game.level.map:checkEntity(tmx, tmy, Map.PROJECTILE, "tooltip", game.level.map.actor_player) or nil
tt[#tt+1] = seen and game.level.map:checkEntity(tmx, tmy, Map.ACTOR, "tooltip", game.level.map.actor_player) or nil
tt[#tt+1] = remember and game.level.map:checkEntity(tmx, tmy, Map.OBJECT, "tooltip", game.level.map.actor_player) or nil
tt[#tt+1] = remember and game.level.map:checkEntity(tmx, tmy, Map.TRAP, "tooltip", game.level.map.actor_player) or nil
tt[#tt+1] = remember and game.level.map:checkEntity(tmx, tmy, Map.TERRAIN, "tooltip", game.level.map.actor_player) or nil
tt[#tt+1] = (seen or remember) and game.level.map:checkEntity(tmx, tmy, Map.OBJECT, "tooltip", game.level.map.actor_player) or nil
tt[#tt+1] = (seen or remember) and game.level.map:checkEntity(tmx, tmy, Map.TRAP, "tooltip", game.level.map.actor_player) or nil
tt[#tt+1] = (seen or remember) and game.level.map:checkEntity(tmx, tmy, Map.TERRAIN, "tooltip", game.level.map.actor_player) or nil
if #tt > 0 then
self:set("%s", table.concat(tt, "\n---\n"))
self:display()
......
......@@ -82,7 +82,7 @@ function _M:computeFOV(radius, block, apply, force, no_store, cache)
fov.actors_dist[#fov.actors_dist+1] = a
a.__sqdist = sqdist
a:check("seen_by", self)
a:updateFOV(self, t.sqdist)
-- a:updateFOV(self, t.sqdist)
end
end, cache and game.level.map._fovcache[block])
......@@ -117,6 +117,7 @@ function _M:updateFOV(a, sqdist)
fov.actors[a] = t
-- print("Updated FOV for", self.uid, self.name, ":: seen ", #fov.actors_dist, "actors closeby; from", a, sqdist)
table.sort(fov.actors_dist, function(a, b) if a and b then return fov.actors[a].sqdist < fov.actors[b].sqdist elseif a then return 1 else return nil end end)
-- table.sort(fov.actors_dist, "__sqdist")
self.fov_last_change = game.turn
end
......
......@@ -396,6 +396,10 @@ function _M:getTextualDesc()
if self.combat then desc_combat(self.combat) end
if self.no_teleport then
desc:add("It is immune to teleportation, if you teleport it will fall on the ground.", true)
end
if self.basic_ammo then
desc:add({"color","YELLOW"}, "Default ammo(infinite):", {"color", "LAST"}, true)
desc_combat(self.basic_ammo)
......
......@@ -41,9 +41,6 @@ newBirthDescriptor{
mana_regen = 0.5,
mana_rating = 7,
},
talents = {
[ActorTalents.T_MANA_GEM] = 1,
}
}
newBirthDescriptor{
......
......@@ -110,7 +110,6 @@ newBirthDescriptor{
[ActorTalents.T_SHADOW_COMBAT] = 1,
[ActorTalents.T_PHASE_DOOR] = 1,
[ActorTalents.T_LETHALITY] = 1,
[ActorTalents.T_MANA_GEM] = 1,
},
copy = {
resolvers.inventory{ id=true,
......
......@@ -159,7 +159,6 @@ newBirthDescriptor{
[ActorTalents.T_ARCANE_COMBAT] = 1,
[ActorTalents.T_STUNNING_BLOW] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_MANA_GEM] = 1,
},
copy = {
max_life = 100,
......
......@@ -39,6 +39,12 @@ local function newGem(name, image, cost, rarity, color, min_level, max_level, ti
mana_consume = mana_consume,
material_level = tier,
imbue_powers = imbue,
use_simple = { name="restore mana over 5 turns", use = function(self, who)
who:setEffect(who.EFF_MANAFLOW, 5, {power=(self.mana_consume + who:getMag()) / 5})
game.logSeen(who, "%s crushs a %s to regain mana!", who.name:capitalize(), self:getName{no_count=true})
return "destroy", true
end},
}
-- Alchemist gems, not lootable, only created by talents
newEntity{ base = "BASE_GEM", define_as = "ALCHEMIST_GEM_"..name:upper(),
......
......@@ -153,29 +153,6 @@ newTalent{
The spell will take time to activate, you must be out of sight of any creature when you cast it and when the teleportation takes effect.]]
}
-- All mana users get to destroy gems to suck up mana
newTalent{
short_name = "MANA_GEM",
name = "Mana Gem",
type = {"base/class", 1},
cooldown = 8,
no_npc_use = true,
is_spell=true,
action = function(self, t)
self:showEquipInven("Crush which gem?", function(o) return not o.unique and not o.quest and o.mana_consume and o.type == "gem" end, function(o, inven, item)
self:removeObject(inven, item)
self:incMana(o.mana_consume + self:getMag() * 1.3)
game.logPlayer(self, "You absorb the mana of your %s.", o:getName{do_color=true, no_count=false})
return true
end)
game:playSoundNear(self, "talents/arcane")
return true
end,
info = [[Crush a gem to free the magical energies contained inside to restore some of your own mana.
Different gems provide different amounts of mana.
The amount regenerated also increases with the Magic stat.]]
}
-- Highers's power, a "weak" regeneration
newTalent{
short_name = "HIGHER_HEAL",
......
......@@ -52,6 +52,18 @@ newEffect{
parameters = { power=10 },
on_gain = function(self, err) return "#Target# starts to surge mana.", "+Manaflow" end,
on_lose = function(self, err) return "#Target# stops surging mana.", "-Manaflow" end,
on_merge = function(self, old_eff, new_eff)
-- Merge the mana
local olddam = old_eff.power * old_eff.dur
local newdam = new_eff.power * new_eff.dur
local dur = math.ceil((old_eff.dur + new_eff.dur) / 2)
old_eff.dur = dur
old_eff.power = (olddam + newdam) / dur
self:removeTemporaryValue("mana_regen", old_eff.tmpid)
old_eff.tmpid = self:addTemporaryValue("mana_regen", old_eff.power)
return old_eff
end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("mana_regen", eff.power)
end,
......
......@@ -118,5 +118,5 @@ newEntity{ define_as = "KOR_FURY",
},
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=1, ai_move="move_astar" },
ai = "dumb_talented_simple", ai_state = { ai_target="target_player_radius", sense_radius=50, talent_in=1, },
}
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