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

tree; stores

git-svn-id: http://svn.net-core.org/repos/t-engine4@377 51575b47-30f0-44d4-a5cc-537603b46e54
parent 860bc594
No related branches found
No related tags found
No related merge requests found
Showing
with 165 additions and 126 deletions
......@@ -128,8 +128,8 @@ end
function _M:drawSelectionList(s, x, y, hskip, list, sel, prop, scroll, max, color, selcolor)
selcolor = selcolor or {0,255,255}
color = color or {255,255,255}
scroll = util.bound(scroll or 1, 1, max)
max = max or 99999
scroll = util.bound(scroll or 1, 1, max)
for i = scroll, math.min(#list, scroll + max - 1) do
local v = list[i]
......
......@@ -79,8 +79,8 @@ end
function _M:defineHotkey(id)
if not self.actor or not self.actor.hotkey then return end
self.actor.hotkey[id] = {"inventory", self.list[self.sel].object:getName()}
self:simplePopup("Hotkey "..id.." assigned", self.list[self.sel].object:getName():capitalize().." assigned to hotkey "..id)
self.actor.hotkey[id] = {"inventory", self.list[self.sel].object:getName{no_count=true}}
self:simplePopup("Hotkey "..id.." assigned", self.list[self.sel].object:getName{no_count=true}:capitalize().." assigned to hotkey "..id)
self.actor.changed = true
end
......
......@@ -23,7 +23,10 @@ function _M:loadMap(file)
t[char] = {grid=grid, obj=obj, actor=actor}
end,
quickEntity = function(char, e)
t[char] = {grid=Grid.new(e)}
local e = Grid.new(e)
e:resolve()
e:resolve(nil, true)
t[char] = {grid=e}
end,
}, {__index=_G}))
local ret, err = f()
......
......@@ -80,8 +80,6 @@ function _M:run()
end
function _M:newGame()
self.stores_def = Store:loadList("/data/general/stores/basic.lua")
self.zone = Zone.new("wilderness")
self.player = Player.new{name=self.player_name}
Map:setViewerActor(self.player)
......@@ -145,7 +143,7 @@ function _M:setupDisplayMode()
end
function _M:save()
return class.save(self, self:defaultSavedFields{stores_def=true}, true)
return class.save(self, self:defaultSavedFields{}, true)
end
function _M:getSaveDescription()
......@@ -155,6 +153,10 @@ function _M:getSaveDescription()
}
end
function _M:getStore(def)
return Store.stores_def[def]:clone()
end
function _M:leaveLevel(level, lev, old_lev)
if level:hasEntity(self.player) then
level.exited = level.exited or {}
......@@ -264,8 +266,7 @@ function _M:display()
local mx, my = core.mouse.get()
local tmx, tmy = self.level.map:getMouseTile(mx, my)
local tt = self.level.map:checkEntity(tmx, tmy, Map.ACTOR, "tooltip") or self.level.map:checkEntity(tmx, tmy, Map.OBJECT, "tooltip") or self.level.map:checkEntity(tmx, tmy, Map.TRAP, "tooltip") or self.level.map:checkEntity(tmx, tmy, Map.TERRAIN, "tooltip")
-- if tt and self.level.map.seens(tmx, tmy) then
if tt then
if tt and self.level.map.seens(tmx, tmy) then
self.tooltip:set("%s", tt)
local t = self.tooltip:display()
mx = mx - self.tooltip.w
......
......@@ -19,7 +19,7 @@ function _M:block_move(x, y, e, act)
end
function _M:tooltip()
-- local mx, my = core.mouse.get()
-- local tmx, tmy = game.level.map:getMouseTile(mx, my)
-- return tmx.."x"..tmy
if self.show_tooltip then
return (self.show_tooltip == true) and self.name or self.show_tooltip
end
end
......@@ -6,6 +6,10 @@ module(..., package.seeall, class.inherit(Store))
_M.stores_def = {}
function _M:loadStores(f)
self.stores_def = self:loadList(f)
end
function _M:init(t, no_default)
Store.init(self, t, no_default)
end
......
......@@ -5,8 +5,8 @@ newEntity{
store = {
restock_after = 200,
buy_percent = 10,
min_fill = 10,
max_fill = 20,
min_fill = 40,
max_fill = 60,
filters = {
{type="potion", id=true},
{type="scroll", id=true},
......@@ -15,3 +15,33 @@ newEntity{
-- },
},
}
newEntity{
define_as = "POTION",
name = "alchemist store",
display = '4', color=colors.LIGHT_BLUE,
store = {
restock_after = 200,
buy_percent = 10,
min_fill = 40,
max_fill = 60,
filters = {
{type="potion", id=true},
},
},
}
newEntity{
define_as = "SCROLL",
name = "scribe store",
display = '5', color=colors.WHITE,
store = {
restock_after = 200,
buy_percent = 10,
min_fill = 40,
max_fill = 60,
filters = {
{type="scroll", id=true},
},
},
}
game/modules/tome/data/gfx/terrain/stone_road1.png

751 B

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

813 B

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

891 B

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

478 B

quickEntity('S', {name='brick roof top', display='#', color=colors.RED, block_move=true, block_sight=true})
quickEntity('s', {name='brick roof', display='#', color=colors.RED, block_move=true, block_sight=true})
quickEntity('t', {name='brick roof chimney', display='#', color=colors.LIGHT_RED, block_move=true, block_sight=true})
quickEntity('#', {name='wall', display='#', color=colors.WHITE, block_move=true, block_sight=true})
quickEntity('<', {name='into the wild', display='<', color=colors.WHITE, change_level=1, change_zone="wilderness"})
quickEntity('S', {name='brick roof top', display='#', color=colors.RED, block_move=true, block_sight=true, image="terrain/wood_wall1.png"})
quickEntity('s', {name='brick roof', display='#', color=colors.RED, block_move=true, block_sight=true, image="terrain/wood_wall1.png"})
quickEntity('t', {name='brick roof chimney', display='#', color=colors.LIGHT_RED, block_move=true, block_sight=true, image="terrain/wood_wall1.png"})
quickEntity('#', {name='wall', display='#', color=colors.WHITE, block_move=true, block_sight=true, image="terrain/wood_wall1.png"})
quickEntity('C', {name='dark pit', display='#', color=colors.LIGHT_DARK, block_move=true, block_sight=true})
quickEntity('T', {name='tree', display='#', color=colors.LIGHT_GREEN, block_move=true, block_sight=true})
quickEntity(' ', {name='forest', display='#', color=colors.GREEN, block_move=true, block_sight=true})
quickEntity('V', {name='river', display='~', color=colors.BLUE, block_move=true,})
quickEntity('O', {name='cooblestone road', display='.', color=colors.WHITE})
quickEntity('.', {name='road', display='.', color=colors.WHITE})
quickEntity(',', {name='dirt', display='.', color=colors.LIGHT_UMBER})
quickEntity('-', {name='grass', display='.', color=colors.LIGHT_GREEN})
quickEntity('T', {name='tree', display='#', color=colors.LIGHT_GREEN, block_move=true, block_sight=true, image="terrain/tree.png"})
quickEntity(' ', {name='forest', display='#', color=colors.GREEN, block_move=true, block_sight=true, image="terrain/tree.png"})
quickEntity('V', {name='river', display='~', color=colors.BLUE, block_move=true, image="terrain/river.png"})
quickEntity('O', {name='cooblestone road', display='.', color=colors.WHITE, image="terrain/stone_road1.png"})
quickEntity('.', {name='road', display='.', color=colors.WHITE, image="terrain/stone_road1.png"})
quickEntity(',', {name='dirt', display='.', color=colors.LIGHT_UMBER, image="terrain/sand.png"})
quickEntity('-', {name='grass', display='.', color=colors.LIGHT_GREEN, image="terrain/grass.png"})
quickEntity('^', {name='hills', display='^', color=colors.SLATE, image="terrain/mountain.png", block_move=true})
quickEntity('1', {name="General Store", display='1', color={r=0, g=255, b=255},
on_move = function(self, x, y, who)
self.store:loadup(game.level, game.zone)
self.store:interact(who)
end,
store = game.stores_def[1]:clone(),
})
quickEntity('4', {name="Alchemist", display='4', color=colors.LIGHT_BLUE, resolvers.store("POTION"), image="terrain/wood_store_potion.png"})
quickEntity('5', {name="Scribe", display='5', color=colors.WHITE, resolvers.store("SCROLL"), image="terrain/wood_store_book.png"})
startx = 131
starty = 33
startx = 31
starty = 13
return {
[[ VV -- ]],
[[ VV -- ]],
[[ V -- ]],
[[ VV -- ]],
[[ VVV -- ]],
[[ VV -- ]],
[[OOOOO V -- ]],
[[ OOOO V -- ]],
[[---- OOOOO VVV --- VV ]],
[[------- OOOOOO V -- VVVV ]],
[[----------- OO V -- VVWWVVV ]],
[[--------------- OO VVV -- VVVWWWWWVVV ]],
[[---------------- OOO VVV -- VVWWWWWWWWWVV ]],
[[------------------ OO VVVVVVV VVWWWWWWWWWWWV ]],
[[-------------------- OOOOO --VVVV VVVVV VVWWWWWWWWWWWVV ]],
[[###------------------ OO ,,,,,,,,,,,,,,,,,, -- VVVVV VV VVVVVVVWWWWWWWVVV ]],
[[CCC####------------------ OOO ,,,,,CCCCCCCCCCCCCCCCCC,,,,,,,,, -- VVVVVV VVVVWWVVV ]],
[[TTTCCCC###---------------,, OO ,,,CCCCCCTTTTTTTTTTTTTTTTCCCCCCCCCC,,,, -- VVVV ]],
[[---TTTTCCC###---------,,,-- OO ,,CCCCTTTTTT--------------TTTTTTTTTTCCCCC,,,,, ^-- ]],
[[-------TTTCCC##-----,,------ O ,,CCCTTTT&.................----------TTTTTCCCCCC,, ^^^ -- ]],
[[----------TTTCC##,,,-------- OO ,CCCTTT....--ssssssss-..---..........-----TTTTTTCCC,,, ^^ -- ]],
[[-------------TC,,###- --- OO ,CCTTT...-----SSSSSSSS--.----------,,....&------TTTCCCC,, ^^ -- ]],
[[--------------,TTCCC### -- OOO ,,CCTT...-,,,,--ssssssss-..-sssssssssss,---......---TTTTCCT,, ^^ -- ]],
[[---------- ,,,--TTTCCC -- OO ,,CCCTT..-------,,##9#####-.--sssssssssss-,-------...----TTCCTT, ^^^ -- ]],
[[--------- ,, ,,----TTTCC O ,CCC T..--sssSsss,,,,------.--StSStSSSStS--,------.-....--TTCCTT,^^^ -- ]],
[[------- ,, , OO ,CCTTT...---ssstSSS---,,,----.--sssssssssss---,---...----..--TTCCT^^^^ ^^ -- ]],
[[-------- ,, ,, OO ,CCTT...-----sssssss--,,-,,---.--sssssssssss---,-...-------..--TTC^^^ ^ ---- ]],
[[-------- {, OO ,CTT..---,,,,###6###,,,---,,--.--###########----.&----------..--T^^^^ ^ --- -- ]],
[[---------- OOO ,CT..,,,,----,,,,,,,,------,,-.--###b###e###-....,---sssss---.--T^^ ^ -- -- ]],
[[----------- OO ,CCT.,sssssss----,-----------,,.-----.-----....-,--,,-StSSS---&-T^^^ ^ -- ----- ]],
[[-------------- OO ,CCTT.-StStSSS---,-----ssssss--..-----.--....--,,,,,,-,sssss---.-T^^^ ^ -- -- ,,& ]],
[[------------ OOOOO ,CTT-.-sssssss---,-----SSSSSS--.------.-..--,,,-ssss--,#####---.-T^^ ^ -- ----- ,, ]],
[[--------- OO ,CCT-.&-##5####----,----ssssss-..&.......--XXXX,-ssss--,------...-^^^ ^ ^^ ^ --- ---- ,,, ]],
[[-- ---- OOOOOOOO ,C OOOO--OOOOO----,----#c##4#-.---.,----,-UUUU,-SSSS--,-----..---^^ ^ ^ --- -----, OOOOOOOOOOOOOOO]],
[[-- ---- OOOOOOO ,CT-OssOOOO---OOOOOOOOO--OOOO--.-T-.-sss--,XXXX,-ssss---,---..--T^^ -- -- OOO ]],
[[-- ----- OOOOOOOOSt.---------XXXX-OOOO--OOOO---.-StS--,#0##,-ssss---,---.---^^ ^ ^ -- --- OOOO ]],
[[ - --- ----- ,,CT--.ss.-sssss---XXXX,---------OOOO.-sss---,,,,,-####--,---..-T^^ ^ ^ -- --- OO ]],
[[ ---- ---- ,,CT--.##.-SStSS---####,------------OO-#>#-ssssss-,,,---,----.--T^^ ^ -,- OOOOO ]],
[[ ------- ---- ,,CTT-....-sssss--,,,,,,----------F--OO-,--SSSSSt-ss-,-,---...-T^^ ^ ^ -, OOOO ]],
[[ ------- ------ ,,CCTT---..#2###-,sssss,-SSSSSSSS-----OO,--ssssss-tS--,.&...---^^ ^^ ^^^ -, OOOOOOOO ]],
[[ ----- ----- ,,CCT----..,,,,,-StSSS,-ssssssss------OOO-#1##a#-ss....-----T^^ ^^ -,- OOOOO ]],
[[ ---- -------- ,,CCTT----.&----,sssss,-##7#####--------OO,.,,.,-##.----TTTT^^ ^ ^^ -, OOOOO ]],
[[ --------------- ,,,CCTTTT--..---,##3##-,--,&,---------..&OOOOOOOOOOOTTTTTCC^^^ ^^ ^^ ,- OOO ]],
[[ -------- ,,,CCCC --..........,-,,---,--.......-------TTTTTOCCCCC,,^^^^^^^^^^^ -.- OOOOO ]],
[[ ---------- ,, ,,CCCTT----------.....-......-------TTTTTTTCCCCO,,,,, ^^^^^^^ -.- O ]],
[[ ------- ,, ,,CCTTTTTTTTTT-----...------TTTTTTTCCCCCC,,,,OOO -.- OOOO ]],
[[ ---- ,,, ,CCCCCCCCCCTTTTT-----TTTTTTCCCCCC,,,,,, OOO OOOOOOOOO ]],
[[ ^^ ---- ,, ,,,,,,,,,,CCCCCTTTTTTCCCCC,,,,,, OO OOO-- ]],
[[ ^^^^^ ,,, ,,,,,CCCCCC,,,,, OOOO OOO-- ]],
[[ ^^^^^^^^^ ,, ,,,,,, OOOOOOO OOO--- ]],
[[ ^^^^^^^^^ ,, OOOOOOO---- ]],
[[ ^^^^^^^^^^^^^^^ ,,, ..------ ]],
[[ ^^^^^^^^^^^^^^ ,,, ...... ....----- ]],
[[ ^^^^^^^^^^^^^^^ ,,, ........... ............ ............-------,,,, ]],
[[ ^^^^^^^^^^^^^^^^^ ,, ... .........-------------- ,,,,,,, ,,,,,,,,, ]],
[[ ^^^^^^^^^^^^^ ,, . ,,,,,, ,,,,,,,,, ]],
[[ ^^^^^^^^^^^^^^ ,, ... ,,,,, ------ --- ]],
[[ ^^^^^^^^^^^^^^^ ,, . ,,,,,,,,------- ----- ]],
[[ ^^^^^^^^^^^^^^ , .. ---------------- ]],
[[ ^^^^^^^^^^^^^^^^ ,, .. ------------------ ]],
[[ ^^^^^^^^^^^^^^^ , .. ----------------& ]],
[[ ^^^^^^^^^^^^^^^^ ,,. --- ---- ---- ]],
[[ ^^^^^^^^^^^^^ ,. - -- -- ]],
[[ ^^^^^^^^^^^^^^ . ]],
[[ ^^^^^^^^^^^^^^ . ]],
[[ ]],
}
\ No newline at end of file
[[ ]],
[[ ,,,,,,,,,,,,,,,,,, ]],
[[ ,,,,,------------------,,,,,,,,, ]],
[[ ,,,------TTTTTTTTTTTTTTTT----------,,,, ]],
[[ ,,----TTTTTT--------------TTTTTTTTTT-----,,,,, ]],
[[ ,,---TTTT..................----------TTTTT------,, ]],
[[ ,---TTT....--ssssssss-..---..........-----TTTTTT---,,, ]],
[[ ,--TTT...-----SSSSSSSS--.----------,,.....------TTT----,, ]],
[[ ,,--TT...-,,,,--ssssssss-..-sssssssssss,---......---TTTT--T,, ]],
[[ ,,---TT..-------,,##9#####-.--sssssssssss-,-------...----TT--TT, ]],
[[ ,--- T..--sssSsss,,,,------.--StSStSSSStS--,------.-....--TT--TT,^]],
[[ ,--TTT...---ssstSSS---,,,----.--sssssssssss---,---...----..--TT--T^^]],
[[ ,--TT...-----sssssss--,,-,,---.--sssssssssss---,-...-------..--TT-^^^]],
[[ ,-TT..---,,,,###6###,,,---,,--.--###########----..----------..--T^^^^]],
[[ ,-T..,,,,----,,,,,,,,------,,-.--###b###e###-....,---sssss---.--T^^ ]],
[[ ,--T.,sssssss----,-----------,,.-----.-----....-,--,,-StSSS---.-T^^^ ]],
[[ ,--TT.-StStSSS---,-----ssssss--..-----.--....--,,,,,,-,sssss---.-T^^^ ]],
[[ ,-TT-.-sssssss---,-----SSSSSS--.------.-..--,,,-ssss--,#####---.-T^^ ]],
[[ ,--T-..-##5####----,----ssssss-..........--ssss,-ssss--,------...-^^^ ^]],
[[ ,- OOOO--OOOOO----,----#c##4#-.---.,----,-SStS,-SSSS--,-----..---^^ ^]],
[[<OO ,-T-OssOOOO---OOOOOOOOO--OOOO--.-T-.-sss--,ssss,-ssss---,---..--T^^ ]],
[[ OOOOOOOOSt.---------XXXX-OOOO--OOOO---.-StS--,#0##,-ssss---,---.---^^ ^]],
[[ ,,-T--.ss.-sssss---XXXX,---------OOOO.-sss---,,,,,-####--,---..-T^^ ^ ^ ]],
[[ ,,-T--.##.-SStSS---####,------------OO-#>#-ssssss-,,,---,----.--T^^ ^ ]],
[[ ,,-TT-....-sssss--,,,,,,----------F--OO-,--SSSSSt-ss-,-,---...-T^^ ^ ^ ]],
[[ ,,--TT---..#2###-,sssss,-SSSSSSSS-----OO,--ssssss-tS--,.....---^^ ^^ ^]],
[[ ,,--T----..,,,,,-StSSS,-ssssssss------OOO-#1##a#-ss....-----T^^ ^^]],
[[ ,,--TT----..----,sssss,-##7#####--------OO,.,,.,-##.----TTTT^^ ^ ^^ ]],
[[ ,,,--TTTT--..---,##3##-,--,.,---------...OOOOOOOOOOOTTTTT--^^^ ^^ ^^ ]],
[[ ,,,---- --..........,-,,---,--.......-------TTTTTO-----,,^^^^^^^^^^^ ]],
[[ ,, ,,---TT----------.....-......-------TTTTTTT----O,,,,, ^^^^^^^ ]],
[[ ,, ,,--TTTTTTTTTT-----...------TTTTTTT------,,,,OOO ]],
[[ ,,, ,----------TTTTT-----TTTTTT------,,,,,, OOO ]],
[[ ,, ,,,,,,,,,,-----TTTTTT-----,,,,,, OO ]],
[[ ,,, ,,,,,------,,,,, OOOO ]],
[[ ,, ,,,,,, OOOOOOO ]],
[[ OOOOOOO<]],
}
quickEntity('b', {name='blue mountains', display='^', color=colors.LIGHT_BLUE, image="terrain/mountain.png", block_move=true})
quickEntity('m', {name='misty mountains', display='^', color=colors.UMBER, image="terrain/mountain.png", block_move=true})
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", equilibrium_level=-10})
quickEntity('g', {name='Forodwaith, the cold lands', display='.', color=colors.LIGHT_BLUE, equilibrium_level=-10})
quickEntity('q', {name='Icebay of Forochel', display=';', color=colors.LIGHT_BLUE, equilibrium_level=-10})
quickEntity('w', {name='ash', display='.', color=colors.WHITE})
quickEntity('&', {name='hills', display='^', color=colors.GREEN, image="terrain/hills.png", equilibrium_level=-10})
quickEntity('h', {name='low hills', display='^', color=colors.GREEN, image="terrain/hills.png", equilibrium_level=-10})
quickEntity(' ', {name='sea of Rhun', display='~', color=colors.BLUE, image="terrain/river.png", block_move=true})
quickEntity('_', {name='river', display='~', color={r=0, g=80, b=255}, image="terrain/river.png", equilibrium_level=-10})
quickEntity('~', {name='Anduin river', display='~', color={r=0, g=30, b=255}, image="terrain/river.png", equilibrium_level=-10})
quickEntity('b', {show_tooltip=true, name='blue mountains', display='^', color=colors.LIGHT_BLUE, image="terrain/mountain.png", block_move=true})
quickEntity('m', {show_tooltip=true, name='misty mountains', display='^', color=colors.UMBER, image="terrain/mountain.png", block_move=true})
quickEntity('g', {show_tooltip=true, name='grey mountains', display='^', color=colors.SLATE, image="terrain/mountain.png", block_move=true})
quickEntity('u', {show_tooltip=true, name='deep forest', display='#', color=colors.GREEN, image="terrain/tree.png", block_move=true})
quickEntity('t', {show_tooltip=true, name='forest', display='#', color=colors.LIGHT_GREEN, image="terrain/tree.png", block_move=true})
quickEntity('v', {show_tooltip=true, name='old forest', display='#', color=colors.GREEN, image="terrain/tree_dark1.png", block_move=true})
quickEntity('i', {show_tooltip=true, name='iron mountains', display='^', color=colors.SLATE, image="terrain/mountain.png", block_move=true})
quickEntity('=', {show_tooltip=true, name='the great sea', display='~', color=colors.BLUE, image="terrain/river.png", block_move=true})
quickEntity('.', {show_tooltip=true, name='plains', display='.', color=colors.LIGHT_GREEN, image="terrain/grass.png", equilibrium_level=-10})
quickEntity('g', {show_tooltip=true, name='Forodwaith, the cold lands', display='.', color=colors.LIGHT_BLUE, equilibrium_level=-10})
quickEntity('q', {show_tooltip=true, name='Icebay of Forochel', display=';', color=colors.LIGHT_BLUE, equilibrium_level=-10})
quickEntity('w', {show_tooltip=true, name='ash', display='.', color=colors.WHITE})
quickEntity('&', {show_tooltip=true, name='hills', display='^', color=colors.GREEN, image="terrain/hills.png", equilibrium_level=-10})
quickEntity('h', {show_tooltip=true, name='low hills', display='^', color=colors.GREEN, image="terrain/hills.png", equilibrium_level=-10})
quickEntity(' ', {show_tooltip=true, name='sea of Rhun', display='~', color=colors.BLUE, image="terrain/river.png", block_move=true})
quickEntity('_', {show_tooltip=true, name='river', display='~', color={r=0, g=80, b=255}, image="terrain/river.png", equilibrium_level=-10})
quickEntity('~', {show_tooltip=true, name='Anduin river', display='~', color={r=0, g=30, b=255}, image="terrain/river.png", equilibrium_level=-10})
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="Passageway into the Trollshaws", display='>', color={r=0, g=255, b=0}, change_level=1, change_zone="trollshaws"})
quickEntity('C', {name="A gate into a maze", display='>', color={r=0, g=255, b=255}, change_level=1, change_zone="maze"})
quickEntity('D', {name="A path into the Old Forest", display='>', color={r=0, g=255, b=155}, change_level=1, change_zone="old-forest"})
quickEntity('E', {name="A mysterious hole in the beach", display='>', color={r=200, g=255, b=55}, change_level=1, change_zone="sandworm-lair"})
quickEntity('F', {name="The entry to the old tower of Tol Falas",display='>', color={r=0, g=255, b=255}, change_level=1, change_zone="tol-falas"})
quickEntity('A', {show_tooltip=true, 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', {show_tooltip=true, name="Passageway into the Trollshaws", display='>', color={r=0, g=255, b=0}, change_level=1, change_zone="trollshaws"})
quickEntity('C', {show_tooltip=true, name="A gate into a maze", display='>', color={r=0, g=255, b=255}, change_level=1, change_zone="maze"})
quickEntity('D', {show_tooltip=true, name="A path into the Old Forest", display='>', color={r=0, g=255, b=155}, change_level=1, change_zone="old-forest"})
quickEntity('E', {show_tooltip=true, name="A mysterious hole in the beach", display='>', color={r=200, g=255, b=55}, change_level=1, change_zone="sandworm-lair"})
quickEntity('F', {show_tooltip=true, name="The entry to the old tower of Tol Falas",display='>', color={r=0, g=255, b=255}, change_level=1, change_zone="tol-falas"})
quickEntity('1', {name="Bree (Town)", display='*', color={r=255, g=255, b=255}, change_level=1, change_zone="town-bree"})
quickEntity('1', {show_tooltip=true, name="Bree (Town)", display='*', color={r=255, g=255, b=255}, change_level=1, change_zone="town-bree"})
return {
[[========q=qqqqqqqqqgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg]],
......
load("/data/general/objects/objects.lua")
......@@ -2,7 +2,7 @@ return {
name = "Bree",
level_range = {1, 1},
max_level = 1,
width = 196, height = 66,
width = 196, height = 80,
all_remembered = true,
all_lited = true,
generator = {
......@@ -10,5 +10,14 @@ return {
class = "engine.generator.map.Static",
map = "towns/bree",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {0, 0},
adjust_level = {0, 0},
},
object = {
class = "engine.generator.object.Random",
nb_object = {0, 0},
},
}
}
......@@ -9,6 +9,7 @@ local ActorAI = require "engine.interface.ActorAI"
local ActorInventory = require "engine.interface.ActorInventory"
local ActorLevel = require "engine.interface.ActorLevel"
local Birther = require "engine.Birther"
local Store = require "mod.class.Store"
-- Usefull keybinds
KeyBind:load("move,hotkeys,inventory,actions,debug")
......@@ -73,6 +74,9 @@ ActorAI:loadDefinition("/mod/ai/")
-- Birther descriptor
Birther:loadDefinition("/data/birth/descriptors.lua")
-- Stores
Store:loadStores("/data/general/stores/basic.lua")
------------------------------------------------------------------------
-- Count the number of talents per types
------------------------------------------------------------------------
......
......@@ -99,3 +99,22 @@ function resolvers.calc.drops(t, e)
-- Delete the origin field
return nil
end
--- Resolves drops creation for an actor
function resolvers.store(def)
return {__resolver="store", def}
end
--- Actually resolve the drops creation
function resolvers.calc.store(t, e)
t = t[1]
e.on_move = function(self, x, y, who)
self.store:loadup(game.level, game.zone)
self.store:interact(who)
end
e.store = game:getStore(t)
print("[STORE] created for entity", t, e, e.name)
-- Delete the origin field
return nil
end
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