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

light damage exists

git-svn-id: http://svn.net-core.org/repos/t-engine4@683 51575b47-30f0-44d4-a5cc-537603b46e54
parent a4fafe39
No related merge requests found
......@@ -488,7 +488,7 @@ function _M:newLevel(level_data, lev, old_lev, game)
-- Check for connectivity from entrance to exit
local a = Astar.new(map, game:getPlayer())
print("[LEVEL GENERATION] checking entrance to exit A*", ux, uy, "to", dx, dy)
if ux and uy and dx and dy and (ux ~= dx or uy ~= dy) and not a:calc(ux, uy, dx, dy) then
if ux and uy and dx and dy and (ux ~= dx or uy ~= dy) and not spot.no_level_connectivity and not a:calc(ux, uy, dx, dy) then
print("Level unconnected, no way from entrance to exit", ux, uy, "to", dx, dy)
level:removed()
return self:newLevel(level_data, lev, old_lev, game)
......
......@@ -181,6 +181,7 @@ function _M:archeryShoot(damtype, mult, on_hit, tg, params)
local atk, def = self:combatAttack(weapon), target:combatDefense()
local dam, apr, armor = self:combatDamage(ammo), self:combatAPR(ammo), target:combatArmor()
print("[ATTACK] to ", target.name, " :: ", dam, apr, armor, "::", mult)
if not self:canSee(target) then atk = atk / 3 end
-- If hit is over 0 it connects, if it is 0 we still have 50% chance
local hitted = false
......@@ -262,6 +263,7 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
-- Does the blow connect? yes .. complex :/
local atk, def = self:combatAttack(weapon), target:combatDefenseRanged()
if not self:canSee(target) then atk = atk / 3 end
local dam, apr, armor = self:combatDamage(weapon), self:combatAPR(weapon), target:combatArmor()
print("[ATTACK] to ", target.name, " :: ", dam, apr, armor, "::", mult)
......
......@@ -144,14 +144,19 @@ newDamageType{
end,
}
-- Light up the room
-- Lite up the room
newDamageType{
name = "light", type = "LIGHT", text_color = "#YELLOW#",
name = "lite", type = "LITE", text_color = "#YELLOW#",
projector = function(src, x, y, type, dam)
game.level.map.lites(x, y, true)
end,
}
-- Light damage
newDamageType{
name = "light", type = "LIGHT", text_color = "#YELLOW#",
}
-- Darkness damage
newDamageType{
name = "darkness", type = "DARKNESS", text_color = "#DARK_GREY#",
......
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local Talents = require("engine.interface.ActorTalents")
newEntity{
define_as = "BASE_NPC_SUNWALL_HUMAN",
type = "humanoid", subtype = "human",
display = "p", color=colors.WHITE,
faction = "sunwall",
combat = { dam=resolvers.rngavg(1,2), atk=2, apr=0, dammod={str=0.4} },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
resolvers.drops{chance=20, nb=1, {} },
life_rating = 10,
rank = 2,
size_category = 3,
open_door = true,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
energy = { mod=1 },
stats = { str=12, dex=8, mag=6, con=10 },
}
newEntity{ base = "BASE_NPC_SUNWALL_HUMAN",
name = "human sun-paladin", color=colors.GOLD,
desc = [[A human in a shiny plate armour.]],
level_range = {1, 50}, exp_worth = 1,
rarity = 6,
max_life = resolvers.rngavg(70,80),
resolvers.equip{
{type="weapon", subtype="longsword", autoreq=true},
{type="armor", subtype="shield", autoreq=true},
{type="armor", subtype="heavy", autoreq=true},
},
resolvers.talents{ [Talents.T_HEAVY_ARMOUR_TRAINING]=1, [Talents.T_PERFECT_STRIKE]=1, },
}
......@@ -54,7 +54,7 @@ newEntity{ base = "BASE_NPC_INSECT",
max_life = resolvers.rngavg(1,3),
combat = { dam=2, atk=15, apr=20 },
resolvers.talents{ [Talents.T_SPORE_POISON]=1 },
resolvers.talents{ [Talents.T_BITE_POISON]=1 },
}
newEntity{ base = "BASE_NPC_INSECT",
......@@ -65,7 +65,7 @@ newEntity{ base = "BASE_NPC_INSECT",
max_life = resolvers.rngavg(3,5),
combat = { dam=5, atk=15, apr=20 },
resolvers.talents{ [Talents.T_SPORE_POISON]=2 },
resolvers.talents{ [Talents.T_BITE_POISON]=2 },
}
newEntity{ base = "BASE_NPC_INSECT",
......@@ -77,5 +77,5 @@ newEntity{ base = "BASE_NPC_INSECT",
combat = { dam=10, atk=15, apr=20 },
can_multiply = 4,
resolvers.talents{ [Talents.T_SPORE_POISON]=3 },
resolvers.talents{ [Talents.T_BITE_POISON]=3 },
}
......@@ -37,7 +37,7 @@ newEntity{ base = "BASE_SCROLL",
cost = 1,
use_simple = { name="light up the surrounding area", use = function(self, who)
who:project({type="ball", range=0, friendlyfire=true, radius=15}, who.x, who.y, engine.DamageType.LIGHT, 1)
who:project({type="ball", range=0, friendlyfire=true, radius=15}, who.x, who.y, engine.DamageType.LITE, 1)
game.logSeen(who, "%s reads a %s!", who.name:capitalize(), self:getName())
return "destroy", true
end}
......
......@@ -122,7 +122,7 @@ newEntity{ base = "BASE_LITE",
max_power = 15, power_regen = 1,
use_power = { name = "call light", power = 10,
use = function(self, who)
who:project({type="ball", range=0, friendlyfire=false, radius=20}, who.x, who.y, DamageType.LIGHT, 1)
who:project({type="ball", range=0, friendlyfire=false, radius=20}, who.x, who.y, DamageType.LITE, 1)
game.logSeen(who, "%s brandishes the %s and banishes all shadows!", who.name:capitalize(), self:getName())
end
},
......
......@@ -26,7 +26,7 @@ newTalent{
cooldown = 14,
action = function(self, t)
local tg = {type="ball", range=0, friendlyfire=true, radius=5 + self:getTalentLevel(t), talent=t}
self:project(tg, self.x, self.y, DamageType.LIGHT, 1)
self:project(tg, self.x, self.y, DamageType.LITE, 1)
if self:getTalentLevel(t) >= 3 then
tg.friendlyfire = false
self:project(tg, self.x, self.y, DamageType.BLIND, 3 + self:getTalentLevel(t))
......
......@@ -56,7 +56,7 @@ function _M:init(runmod)
-- And now run it!
_G.game:run()
else
engine.Dialog:simplePopup("Error", "Character name must be between 3 and 25 characters.")
engine.Dialog:simplePopup("Error", "Character name must be between 2 and 25 characters.")
end
end,
_BACKSPACE = function()
......
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