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

Allow updateMap to be customized

git-svn-id: http://svn.net-core.org/repos/t-engine4@1495 51575b47-30f0-44d4-a5cc-537603b46e54
parent 236ea552
No related branches found
No related tags found
No related merge requests found
......@@ -355,54 +355,58 @@ end
--- Updates the map on the given spot
-- This updates many things, from the C map object, the FOV caches, the minimap if it exists, ...
function _M:updateMap(x, y)
local g = self(x, y, TERRAIN)
local o = self(x, y, OBJECT)
local a = self(x, y, ACTOR)
local t = self(x, y, TRAP)
local p = self(x, y, PROJECTILE)
-- Update minimap if any
local mm = MM_FLOOR
local mos = {}
if g then
-- Update path caches from path strings
for i = 1, #self.path_strings do
local ps = self.path_strings[i]
self._fovcache.path_caches[ps]:set(x, y, g:check("block_move", x, y, ps, false, true))
end
if not self.updateMapDisplay then
local g = self(x, y, TERRAIN)
local o = self(x, y, OBJECT)
local a = self(x, y, ACTOR)
local t = self(x, y, TRAP)
local p = self(x, y, PROJECTILE)
if g then
-- Update path caches from path strings
for i = 1, #self.path_strings do
local ps = self.path_strings[i]
self._fovcache.path_caches[ps]:set(x, y, g:check("block_move", x, y, ps, false, true))
end
mm = mm + (g:check("block_move") and MM_BLOCK or 0)
mm = mm + (g:check("change_level") and MM_LEVEL_CHANGE or 0)
g:getMapObjects(self.tiles, mos, 1)
end
if t then
-- Handles invisibility and telepathy and other such things
if not self.actor_player or t:knownBy(self.actor_player) then
t:getMapObjects(self.tiles, mos, 4)
mm = mm + MM_TRAP
else
t = nil
mm = mm + (g:check("block_move") and MM_BLOCK or 0)
mm = mm + (g:check("change_level") and MM_LEVEL_CHANGE or 0)
g:getMapObjects(self.tiles, mos, 1)
end
end
if o then
o:getMapObjects(self.tiles, mos, 7)
if self.object_stack_count then
local mo = o:getMapStackMO(self, x, y)
if mo then mos[9] = mo end
if t then
-- Handles trap being known
if not self.actor_player or t:knownBy(self.actor_player) then
t:getMapObjects(self.tiles, mos, 4)
mm = mm + MM_TRAP
else
t = nil
end
end
mm = mm + MM_OBJECT
end
if a then
-- Handles invisibility and telepathy and other such things
if not self.actor_player or self.actor_player:canSee(a) then
local r = self.actor_player:reactionToward(a)
mm = mm + (r > 0 and MM_FRIEND or (r == 0 and MM_NEUTRAL or MM_HOSTILE))
a:getMapObjects(self.tiles, mos, 10)
if o then
o:getMapObjects(self.tiles, mos, 7)
if self.object_stack_count then
local mo = o:getMapStackMO(self, x, y)
if mo then mos[9] = mo end
end
mm = mm + MM_OBJECT
end
end
if p then
p:getMapObjects(self.tiles, mos, 13)
if a then
-- Handles invisibility and telepathy and other such things
if not self.actor_player or self.actor_player:canSee(a) then
local r = self.actor_player:reactionToward(a)
mm = mm + (r > 0 and MM_FRIEND or (r == 0 and MM_NEUTRAL or MM_HOSTILE))
a:getMapObjects(self.tiles, mos, 10)
end
end
if p then
p:getMapObjects(self.tiles, mos, 13)
end
else
mm = self:updateMapDisplay(x, y, mos)
end
-- Update entities checker for this spot
......
......@@ -74,3 +74,40 @@ newBirthDescriptor{
},
},
}
newBirthDescriptor{
type = "subclass",
name = "Blood Mage",
desc = {
"A blood mage is a terrible foe, wielding dark magics that can sap the very soul of her targets.",
"They can harness the blight of evil, crushing their sould, stealing their life force to replenish themselves.",
"Their most important stats are: Magic and Willpower",
"#GOLD#Stats modifiers:",
"#LIGHT_BLUE# * +0 Strength, +0 Dexterity, +2 Constitution",
"#LIGHT_BLUE# * +4 Magic, +3 Willpower, +0 Cunning",
},
stats = { mag=4, wil=3, con=2, },
talents_types = {
["cunning/survival"]={false, 0},
["corruption/sanguisuge"]={true, 0.3},
["corruption/hexes"]={false, 0.3},
["corruption/curses"]={false, 0.3},
["corruption/bone"]={true, 0.3},
["corruption/blood"]={true, 0.3},
["corruption/udun"]={true, 0.3},
["corruption/blood"]={true, 0.3},
},
talents = {
[ActorTalents.T_CORRUPTED_STRENGTH] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_BLOOD_SACRIFICE] = 1,
[ActorTalents.T_REND] = 1,
},
copy = {
resolvers.equip{ id=true,
{type="weapon", subtype="waraxe", name="iron waraxe", autoreq=true},
{type="weapon", subtype="waraxe", name="iron waraxe", autoreq=true},
{type="armor", subtype="heavy", name="iron mail armour", autoreq=true}
},
},
}
......@@ -17,6 +17,9 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
-- Configure Map
--dofile("/mod/map_config.lua")
-- Entities that are ASCII are outline
local Entity = require "engine.Entity"
Entity.ascii_outline = {x=2, y=2, r=0, g=0, b=0, a=0.8}
......
No preview for this file type
No preview for this file type
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