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

molds, skeletons, artefacts, fixes, remove sdl_gfx dependency

git-svn-id: http://svn.net-core.org/repos/t-engine4@149 51575b47-30f0-44d4-a5cc-537603b46e54
parent 23f7a35d
No related branches found
No related tags found
No related merge requests found
Showing
with 292 additions and 43 deletions
......@@ -61,6 +61,8 @@ function _M:init(t, no_default)
self.color_bb = self.color_bb or -1
end
if self.unique and type(self.unique) ~= "string" then self.unique = self.name end
next_uid = next_uid + 1
self.changed = true
......
......@@ -127,8 +127,13 @@ end
--- Replace some markers in a string with info on the talent
function _M:useTalentMessage(ab)
local str = ab.message
local _, _, target = self:getTarget()
local tname = "unknown"
if target then tname = target.name end
str = str:gsub("@Source@", self.name:capitalize())
str = str:gsub("@source@", self.name)
str = str:gsub("@target@", tname)
str = str:gsub("@Target@", tname:capitalize())
return str
end
......
......@@ -159,7 +159,7 @@ function _M:display()
-- Display the map and compute FOV for the player if needed
if self.level.map.changed then
self.level.map:fov(self.player.x, self.player.y, 20)
self.level.map:fovLite(self.player.x, self.player.y, 4)
self.level.map:fovLite(self.player.x, self.player.y, self.player.lite)
end
self.level.map:display()
......@@ -235,6 +235,8 @@ function _M:setupCommands()
self:targetMode(false, false)
end,
_RETURN = {"alias", "_t"},
_SPACE = {"alias", "_t"},
_KP_ENTER = {"alias", "_t"},
_ESCAPE = function()
self.target.target.entity = nil
self.target.target.x = nil
......
require "engine.class"
require "engine.Object"
local Stats = require("engine.interface.ActorStats")
module(..., package.seeall, class.inherit(engine.Object))
function _M:init(t, no_default)
......@@ -8,7 +10,7 @@ function _M:init(t, no_default)
end
function _M:tooltip()
return self:getName()
return self:getDesc()
end
--- Gets the full name of the object
......@@ -22,5 +24,27 @@ end
--- Gets the full desc of the object
function _M:getDesc()
return self:getName()
local c = ""
if self.egoed then c = "#00FFFF#"
elseif self.unique then c = "#FFFF00#"
end
local desc = { c..self:getName().."#FFFFFF#", self.desc }
if self.combat then
local dm = {}
for stat, i in pairs(self.combat.dammod or {}) do
dm[#dm+1] = ("+%d%% %s"):format(i * 100, Stats.stats_def[stat].name)
end
desc[#desc+1] = ("%d Damage (%s), %d Attack, %d Armor Peneration, Crit %d%%"):format(self.combat.dam or 0, table.concat(dm, ','), self.combat.atk or 0, self.combat.apr or 0, self.combat_physcrit or 0)
desc[#desc+1] = ""
end
local w = self.wielder or {}
if w.combat_armor or w.combat_def then desc[#desc+1] = ("Armor %d, Defense %d"):format(w.combat_armor or 0, w.combat_def or 0) end
if w.combat_spellpower or w.combat_spellcrit then desc[#desc+1] = ("Spellpower %d, Spell Crit %d%%"):format(w.combat_spellpower or 0, w.combat_spellcrit or 0) end
if w.lite then desc[#desc+1] = ("Light radius %d"):format(w.lite) end
return table.concat(desc, "\n")
end
......@@ -39,6 +39,8 @@ function _M:init(t, no_default)
self.unused_talents = 0
self.move_others=true
self.lite = 4
self.descriptor = {}
self.hotkey = {}
end
......@@ -46,7 +48,7 @@ end
function _M:move(x, y, force)
local moved = mod.class.Actor.move(self, x, y, force)
if moved then
game.level.map:moveViewSurround(self.x, self.y, 4, 4)
game.level.map:moveViewSurround(self.x, self.y, 8, 8)
local obj = game.level.map(self.x, self.y, Map.OBJECT)
if obj then
......
......@@ -38,7 +38,7 @@ The ToME combat system has the following attributes:
- armor penetration: reduction of target's armor
- damage: raw damage done
]]
function _M:attackTarget(target, damtype, mult)
function _M:attackTarget(target, damtype, mult, noenergy)
damtype = damtype or DamageType.PHYSICAL
mult = mult or 1
local speed = nil
......@@ -68,7 +68,7 @@ function _M:attackTarget(target, damtype, mult)
end
-- We use up our own energy
if speed then
if speed and not noenergy then
self:useEnergy(game.energy_to_act * speed)
self.did_energy = true
end
......
......@@ -37,6 +37,9 @@ newDamageType{
newDamageType{
name = "lightning", type = "LIGHTNING",
}
newDamageType{
name = "acid", type = "ACID",
}
-- Light up the room
newDamageType{
......
local Talents = require("engine.interface.ActorTalents")
newEntity{
define_as = "BASE_NPC_MOLD",
group = "molds",
display = "m", color=colors.WHITE,
desc = "A strange growth on the dungeon floor.",
body = { INVEN = 10 },
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
stats = { str=10, dex=15, mag=3, con=3 },
energy = { mod=0.5 },
combat_armor = 1, combat_def = 1,
never_move = true,
}
newEntity{ base = "BASE_NPC_MOLD",
name = "grey mold", color=colors.SLATE,
desc = "A strange brey growth on the dungeon floor.",
level_range = {1, 5}, exp_worth = 1,
rarity = 4,
max_life = resolvers.rngavg(5,9),
combat = { dam=5, atk=15, apr=10 },
}
newEntity{ base = "BASE_NPC_MOLD",
name = "brown mold", color=colors.UMBER,
desc = "A strange brown growth on the dungeon floor.",
level_range = {2, 5}, exp_worth = 1,
rarity = 4,
max_life = resolvers.rngavg(5,9),
combat = { dam=5, atk=15, apr=10 },
}
newEntity{ base = "BASE_NPC_MOLD",
name = "shining mold", color=colors.YELLOW,
desc = "A strange luminescent growth on the dungeon floor.",
level_range = {3, 15}, exp_worth = 1,
rarity = 7,
max_life = resolvers.rngavg(1,1),
combat = { dam=5, atk=15, apr=10 },
talents = resolvers.talents{ Talents.T_SPORE_BLIND },
}
newEntity{ base = "BASE_NPC_MOLD",
name = "green mold", color=colors.GREEN,
desc = "A strange sickly green growth on the dungeon floor.",
level_range = {5, 15}, exp_worth = 1,
rarity = 4,
max_life = resolvers.rngavg(5,9),
combat = { dam=5, atk=15, apr=10 },
talents = resolvers.talents{ Talents.T_SPORE_POISON },
}
local Talents = require("engine.interface.ActorTalents")
newEntity{
define_as = "BASE_NPC_SKELETON",
group = "skeletons",
display = "s", color=colors.WHITE,
combat = { dam=1, atk=1, apr=1 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="weapon", subtype="longsword"} },
drops = resolvers.drops{chance=100, nb=5, {ego_chance=50} },
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
energy = { mod=1 },
stats = { str=14, dex=12, mag=10, con=12 },
}
newEntity{ base = "BASE_NPC_SKELETON",
name = "degenerated skeleton warrior", color=colors.WHITE,
level_range = {1, 50}, exp_worth = 1,
rarity = 4,
max_life = resolvers.rngavg(30,40),
combat_armor = 5, combat_def = 1,
}
newEntity{ base = "BASE_NPC_SKELETON",
name = "skeleton warrior", color=colors.SLATE,
level_range = {2, 50}, exp_worth = 1,
rarity = 3,
max_life = resolvers.rngavg(40,50),
combat_armor = 5, combat_def = 1,
}
newEntity{ base = "BASE_NPC_SKELETON",
name = "skeleton mage", color=colors.LIGHT_RED,
level_range = {4, 50}, exp_worth = 1,
rarity = 6,
max_life = resolvers.rngavg(20,25),
max_mana = resolvers.rngavg(40,50),
combat_armor = 3, combat_def = 1,
stats = { str=10, dex=12, cun=14, mag=14, con=10 },
talents = resolvers.talents{ Talents.T_FLAME, Talents.T_MANATHRUST },
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=6, },
}
......@@ -6,35 +6,30 @@ newEntity{
display = "w", color=colors.WHITE,
can_multiply = 2,
body = { INVEN = 10 },
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
energy = { mod=0.9 },
stats = { str=10, dex=15, mag=3, con=3 },
combat_armor = 1, combat_def = 1,
}
newEntity{ base = "BASE_NPC_VERMIN",
name = "white worm mass", color=colors.WHITE,
level_range = {1, 15}, exp_worth = 1,
rarity = 4,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
max_life = resolvers.rngavg(5,9),
energy = { mod=0.9 },
combat = { dam=5, atk=15, apr=10 },
stats = { str=10, dex=15, mag=3, con=3 },
combat_armor = 1, combat_def = 1,
talents = resolvers.talents{ Talents.T_CRAWL_POISON },
}
newEntity{ base = "BASE_NPC_VERMIN",
name = "green worm mass", color=colors.GREEN,
level_range = {2, 15}, exp_worth = 1,
rarity = 5,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
max_life = resolvers.rngavg(5,9),
energy = { mod=0.9 },
combat = { dam=5, atk=15, apr=10 },
stats = { str=10, dex=15, mag=3, con=3 },
combat_armor = 1, combat_def = 1,
talents = resolvers.talents{ Talents.T_CRAWL_POISON },
talents = resolvers.talents{ Talents.T_CRAWL_ACID },
}
load("/data/general/objects/staves.lua")
load("/data/general/objects/swords.lua")
load("/data/general/objects/shields.lua")
load("/data/general/objects/massive-armor.lua")
load("/data/general/objects/massive-armors.lua")
newEntity{
name = "& Staff of Olorin",
type = "weapon",
display = "/", color_r=255, color_b=255,
level_range = {10,10},
rarity = 15,
encumber = 3,
unique = "STAFF_OLORIN",
combat = {
dam = 3,
atk = 1,
apr = 0,
dammod = {wil=1},
},
wielder = {
stats = {mag=3, wil=2},
}
}
load("/data/general/objects/world-artifacts.lua")
-- This file describes artifact not bound to a special location, they can be found anywhere
newEntity{
unique = true,
slot = "MAINHAND",
type = "weapon", subtype="staff",
name = "Staff of Destruction",
level_range = {20, 25},
display = "\\", color=colors.VIOLET,
encumber = 6,
rarity = 20,
desc = [[This unique looking staff is carved with runes of destruction.]],
require = { stat = { mag=24 }, },
combat = {
dam = 15,
apr = 4,
dammod = {mag=1.5},
},
wielder = {
combat_spellpower = 10,
combat_spellcrit = 15,
},
}
newEntity{
unique = true,
slot = "LITE",
type = "jewelery", subtype="lite",
name = "Phial of Galadriel",
level_range = {1, 10},
display = "~", color=colors.YELLOW,
encumber = 1,
rarity = 10,
desc = [[A small crystal phial, with the light of Earendil's Star contained inside. Its light is imperishable, and near it darkness cannot endure.]],
wielder = {
lite = 3,
},
}
newEntity{
unique = true,
slot = "LITE",
type = "jewelery", subtype="lite",
name = "Arkenstone of Thrain",
level_range = {20, 30},
display = "~", color=colors.YELLOW,
encumber = 1,
rarity = 25,
desc = [[A great globe seemingly filled with moonlight, the famed Heart of the Mountain, which splinters the light that falls upon it into a thousand glowing shards.]],
wielder = {
lite = 5,
},
}
newEntity{
unique = true,
slot = "AMULET",
type = "jewelery", subtype="amulet",
name = "Shifting Amulet",
level_range = {1, 10},
display = '"', color=colors.VIOLET,
encumber = 1,
rarity = 10,
desc = [[A crystal clear stone hangs on the chain. It displays images of your surroundings, but somehow they seem closer.]],
use = function(self, o)
game.logSeen(self, "%s uses the Shifting Amulet and blinks away!", self.name:capitalize())
self:teleportRandom(self.x, self.y, 10)
self:useEnergy()
end,
}
......@@ -41,15 +41,70 @@ newTalent{
short_name = "CRAWL_POISON",
name = "Poisonous Crawl",
type = {"physical/other", 1},
message = "@Source@ crawls poison onto @target@.",
cooldown = 5,
range = 1,
action = function(self, t)
local x, y, target = self:getTarget()
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self:attackTarget(target, DamageType.POISON, 2, true)
return true
end,
info = function(self)
return ([[Crawl onto the target, convering it in poison.]])
end,
}
newTalent{
short_name = "CRAWL_ACID",
name = "Acidic Crawl",
type = {"physical/other", 1},
message = "@Source@ crawls acid onto @target@.",
cooldown = 2,
range = 1,
action = function(self, t)
local x, y, target = self:getTarget()
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self:attackTarget(target, DamageType.POISON, 1)
self:attackTarget(target, DamageType.POISON, 1.5, true)
return true
end,
info = function(self)
return ([[Multiply yourself!]])
return ([[Crawl onto the target, convering it in acid.]])
end,
}
newTalent{
short_name = "SPORE_BLIND",
name = "Blinding Spores",
type = {"physical/other", 1},
message = "@Source@ releases blinding spores at @target@.",
cooldown = 2,
range = 1,
action = function(self, t)
local x, y, target = self:getTarget()
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self:attackTarget(target, DamageType.LIGHT, 0.5, true)
return true
end,
info = function(self)
return ([[Releases blinding spores at the target.]])
end,
}
newTalent{
short_name = "SPORE_POISON",
name = "Poisonous Spores",
type = {"physical/other", 1},
message = "@Source@ releases poisonous spores at @target@.",
cooldown = 2,
range = 1,
action = function(self, t)
local x, y, target = self:getTarget()
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self:attackTarget(target, DamageType.POISON, 1.5, true)
return true
end,
info = function(self)
return ([[Releases poisonous spores at the target.]])
end,
}
......@@ -34,7 +34,7 @@ newTalent{
name = "Flame",
type = {"spell/fire",1},
mana = 12,
cooldown = 4,
cooldown = 3,
tactical = {
ATTACK = 10,
},
......
......@@ -15,7 +15,7 @@ newTalent{
newTalent{
name = "Freeze",
type = {"spell/water", 1},
mana = 4,
mana = 14,
cooldown = 3,
tactical = {
ATTACK = 10,
......
load("/data/general/npcs/vermin.lua")
--load("/data/general/npcs/skeleton.lua")
load("/data/general/npcs/molds.lua")
load("/data/general/npcs/skeleton.lua")
--load("/data/general/npcs/.lua")
--[[
......
......@@ -54,7 +54,7 @@ configuration "macosx"
targetdir "."
configuration "not macosx"
links { "SDL", "SDL_ttf", "SDL_image", "SDL_gfx", "SDL_mixer", "GL", "GLU" }
links { "SDL", "SDL_ttf", "SDL_image", "SDL_mixer", "GL", "GLU" }
configuration "windows"
defines { [[TENGINE_HOME_PATH='"T-Engine"']] }
......
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