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

fix error for unarmed attacks

add old forest
new terrain gfx


git-svn-id: http://svn.net-core.org/repos/t-engine4@244 51575b47-30f0-44d4-a5cc-537603b46e54
parent cbfde446
No related branches found
No related tags found
No related merge requests found
Showing
with 167 additions and 27 deletions
......@@ -3,6 +3,7 @@ require "engine.Object"
require "engine.interface.ObjectActivable"
local Stats = require("engine.interface.ActorStats")
local DamageType = require("engine.DamageType")
module(..., package.seeall, class.inherit(engine.Object, engine.interface.ObjectActivable))
......@@ -91,6 +92,14 @@ function _M:getDesc()
desc[#desc+1] = ("Increases stats: %s."):format(table.concat(dm, ','))
end
if w.resists then
local rs = {}
for res, i in pairs(w.resists) do
rs[#rs+1] = ("%d%% %s"):format(i, DamageType.dam_def[res].name)
end
desc[#desc+1] = ("Increases resistances: %s."):format(table.concat(dm, ','))
end
if w.max_life then desc[#desc+1] = ("Maximun life %d"):format(w.max_life) end
if w.max_mana then desc[#desc+1] = ("Maximun mana %d"):format(w.max_mana) end
if w.max_stamina then desc[#desc+1] = ("Maximun stamina %d"):format(w.max_stamina) end
......
......@@ -77,7 +77,9 @@ function _M:attackTarget(target, damtype, mult, noenergy)
-- Barehanded ?
if not speed then
speed = self:attackTargetWith(target, self.combat, damtype, mult)
local s, h = self:attackTargetWith(target, self.combat, damtype, mult)
speed = math.max(speed or 0, s)
hit = hit or h
end
-- We use up our own energy
......
......@@ -62,25 +62,3 @@ newEntity{
block_sight = false,
door_closed = "DOOR",
}
newEntity{
define_as = "GRASS",
name = "grass", image = "terrain/grass.png",
display = '.', color=colors.LIGHT_GREEN,
}
newEntity{
define_as = "FLOWER",
name = "flower", image = "terrain/grass_flower3.png",
display = ';', color=colors.YELLOW,
}
newEntity{
define_as = "TREE",
name = "tree", image = "terrain/tree.png",
display = '#', color=colors.LIGHT_GREEN,
always_remember = true,
block_move = true,
block_sight = true,
dig = "GRASS",
}
newEntity{
define_as = "GRASS",
name = "grass", image = "terrain/grass.png",
display = '.', color=colors.LIGHT_GREEN,
}
newEntity{
define_as = "TREE",
name = "tree", image = "terrain/tree.png",
display = '#', color=colors.LIGHT_GREEN,
always_remember = true,
block_move = true,
block_sight = true,
dig = "GRASS",
}
newEntity{
define_as = "GRASS_DARK1",
name = "grass", image = "terrain/grass_dark1.png",
display = '.', color=colors.GREEN,
}
newEntity{
define_as = "TREE_DARK1",
name = "tree", image = "terrain/tree_dark1.png",
display = '#', color=colors.GREEN,
always_remember = true,
block_move = true,
block_sight = true,
dig = "GRASS_DARK1",
}
newEntity{
define_as = "FLOWER",
name = "flower", image = "terrain/grass_flower3.png",
display = ';', color=colors.YELLOW,
}
game/modules/tome/data/gfx/terrain/grass_dark1.png

805 B

game/modules/tome/data/gfx/terrain/pinetree.png

859 B

game/modules/tome/data/gfx/terrain/pinetree_dark1.png

800 B

game/modules/tome/data/gfx/terrain/tree_dark1.png

804 B

game/modules/tome/data/gfx/terrain/tree_yellow.png

1019 B

game/modules/tome/data/gfx/terrain/tree_yellow_dark1.png

972 B

......@@ -3,6 +3,7 @@ quickEntity('m', {name='misty mountains', display='^', color=colors.UMBER, image
quickEntity('g', {name='grey mountains', display='^', color=colors.SLATE, image="terrain/mountain.png", block_move=true})
quickEntity('u', {name='deep forest', display='#', color=colors.GREEN, image="terrain/tree.png", block_move=true})
quickEntity('t', {name='forest', display='#', color=colors.LIGHT_GREEN, image="terrain/tree.png", block_move=true})
quickEntity('v', {name='old forest', display='#', color=colors.GREEN, image="terrain/tree_dark1.png", block_move=true})
quickEntity('i', {name='iron mountains', display='^', color=colors.SLATE, image="terrain/mountain.png", block_move=true})
quickEntity('=', {name='the great sea', display='~', color=colors.BLUE, image="terrain/river.png", block_move=true})
quickEntity('.', {name='plains', display='.', color=colors.LIGHT_GREEN, image="terrain/grass.png"})
......@@ -16,9 +17,10 @@ quickEntity('_', {name='river', display='~', color={r=0, g=80, b=255}, image="te
quickEntity('~', {name='Anduin river', display='~', color={r=0, g=30, b=255}, image="terrain/river.png"})
quickEntity('A', {name="Caves below the tower of Amon Sûl", display='>', color={r=0, g=255, b=255}, change_level=1, change_zone="tower-amon-sul"})
quickEntity('B', {name="Ettenmoors's cavern", display='>', color={r=80, g=255, b=255}})
--quickEntity('B', {name="Ettenmoors's cavern", display='>', color={r=80, g=255, b=255}})
quickEntity('C', {name="Passageway into the Trollshaws", display='>', color={r=0, g=255, b=0}, change_level=1, change_zone="trollshaws"})
quickEntity('D', {name="A gate into a maze", display='>', color={r=0, g=255, b=255}, change_level=1, change_zone="maze"})
quickEntity('E', {name="A path into the Old Forest", display='>', color={r=0, g=255, b=155}, change_level=1, change_zone="old-forest"})
return {
[[========q=qqqqqqqqqgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg]],
......@@ -43,9 +45,9 @@ return {
[[====...__..ubbb._......hh.._.....|.hh...._.t^^^._mm..~..uuu&f&&&u._........._......................]],
[[=====..._.....__......hho+-_.2---x1hh-------_L...mm---------------_........_.......................]],
[[======..==..=__....h....h|.._.hh.|ih....._..^^^._m...~..uuuuuuuuuu._........_......................]],
[[=============.....hhh....|.._.ttt|h......_.._.._mmm...~..uuuuuuuuu.._........_....................t]],
[[======........bb...h.....|..._ttt|hh...._.._...mm.....~..uuuuuuuu...._......_....................tt]],
[[=====.........bb.........[---_.t.|.h...._._..mmmmm.s._~..uuuuuuuu....._......_..................ttt]],
[[=============.....hhh....|.._.vvE|h......_.._.._mmm...~..uuuuuuuuu.._........_....................t]],
[[======........bb...h.....|..._vvv|hh...._.._...mm.....~..uuuuuuuu...._......_....................tt]],
[[=====.........bb.........[---_.v.|.h...._._..mmmmm.s._~..uuuuuuuu....._......_..................ttt]],
[[=====.........bb............._[--|....._.._..mmmm___s.~~.uuuuuuuu......_.._._..................tttt]],
[[======........bb...Db......._....|....._._...mmmm.....~~.uuuuu.u........._.._.................ttttt]],
[[=======.....ubbb..bbbb....._.....|....._....mmmmm....~~...uuuu.............._...............ttttttt]],
......
load("/data/general/grids/basic.lua")
load("/data/general/grids/forest.lua")
load("/data/general/npcs/rodent.lua")
load("/data/general/npcs/vermin.lua")
load("/data/general/npcs/wolf.lua")
load("/data/general/npcs/troll.lua")
load("/data/general/npcs/snake.lua")
local Talents = require("engine.interface.ActorTalents")
-- The boss of trollshaws, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "OLD_MAN_WILLOW",
type = "giant", subtype = "ent", unique = true,
name = "Old Man Willow",
display = "#", color=colors.OLIVE_DRAB,
desc = [[The ancient grey willow tree, ruler of the Old Forest. He despises
trespassers in his territory. "...a huge willow-tree, old and hoary
Enormous it looked, its sprawling branches going up like racing arms
with may long-fingered hands, its knotted and twisted trunk gaping in
wide fissures that creaked faintly as the boughs moved."]],
level_range = {7, 10}, exp_worth = 2,
max_life = 200, life_rating = 17, fixed_rating = true,
max_stamina = 85,
max_mana = 200,
stats = { str=25, dex=10, cun=8, mag=20, wil=20, con=20 },
resists = { [DamageType.FIRE] = -50 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="armor", subtype="shield", defined="OLD_MAN_WILLOW_SHIELD"}, },
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
talents = resolvers.talents{
[Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=2,
[Talents.T_MANA_POOL]=1,
[Talents.T_ICE_STORM]=1,
[Talents.T_TIDAL_WAVE]=1,
[Talents.T_FREEZE]=1,
},
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
}
load("/data/general/objects/objects.lua")
-- Artifact, droped (and used!) by Bill the Stone Troll
newEntity{ base = "BASE_SHIELD",
define_as = "OLD_MAN_WILLOW_SHIELD",
name = "Old Man's Willow Barkwood", unique=true,
require = { stat = { str=25 }, },
cost = 20,
special_combat = {
dam = resolvers.rngavg(20,30),
physcrit = 2,
dammod = {str=1.5},
},
wielder = {
combat_armor = 5,
combat_def = 9,
fatigue = 14,
resists = {
[DamageType.FIRE] = -20,
[DamageType.COLD] = 20,
[DamageType.NATURE] = 20,
},
},
}
return {
name = "Old Forest",
level_range = {7, 18},
level_scheme = "player",
max_level = 7,
width = 50, height = 50,
-- all_remembered = true,
all_lited = true,
-- persistant = true,
generator = {
map = {
class = "engine.generator.map.Roomer",
nb_rooms = 10,
rooms = {"simple", "pilar"},
['.'] = "GRASS_DARK1",
['#'] = "TREE_DARK1",
up = "UP",
down = "DOWN",
door = "GRASS_DARK1",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
adjust_level = {-1, 2},
guardian = "TROLL_BILL",
},
object = {
class = "engine.generator.object.Random",
nb_object = {400, 600},
filters = { {type="potion" }, {type="potion" }, {}, {}, {} }
},
},
levels =
{
[1] = {
generator = { map = {
up = "UP_WILDERNESS",
}, },
},
},
}
load("/data/general/grids/basic.lua")
load("/data/general/grids/forest.lua")
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