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

Lore can now have pictures attached

git-svn-id: http://svn.net-core.org/repos/t-engine4@3751 51575b47-30f0-44d4-a5cc-537603b46e54
parent a5fd9648
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ function _M:init(t)
self.image = Tiles:loadImage(self.file)
local iw, ih = 0, 0
if self.image then iw, ih = self.image:getSize() end
self.iw, self.ih = iw, ih
if t.auto_width then t.width = iw end
if t.auto_height then t.height = ih end
end
......@@ -56,5 +57,5 @@ function _M:display(x, y)
self.item[1]:toScreenFull(x + 5, y + 5, self.w, self.h, self.item[2], self.item[3], 0, 0, 0, 0.5)
end
self.item[1]:toScreenFull(x, y, self.w, self.h, self.item[2], self.item[3])
self.item[1]:toScreenFull(x, y, self.w, self.h, self.item[2] * self.w / self.iw, self.item[3] * self.h / self.ih)
end
......@@ -735,6 +735,10 @@ function _M:getTextualDesc(compare_with)
compare_fields(w, compare_with, field, "size_category", "%+d", "Size category: ")
if w.speaks_shertul then
desc:add("Allows you to speak and read the old Sher'Tul language.", true)
end
local can_combat_unarmed = false
local compare_unarmed = {}
for i, v in ipairs(compare_with) do
......
game/modules/tome/data/gfx/lore/shertul_fortress_lore5.png

527 KiB | W: | H:

game/modules/tome/data/gfx/lore/shertul_fortress_lore5.png

539 KiB | W: | H:

game/modules/tome/data/gfx/lore/shertul_fortress_lore5.png
game/modules/tome/data/gfx/lore/shertul_fortress_lore5.png
game/modules/tome/data/gfx/lore/shertul_fortress_lore5.png
game/modules/tome/data/gfx/lore/shertul_fortress_lore5.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -24,72 +24,87 @@
newLore{
id = "shertul-fortress-1",
category = "sher'tul",
name = "mural painting",
name = "first mural painting",
image = "shertul_fortress_lore1.png",
lore = [[You see here a mural showing a dark and tortured world. Large, god-like figures with powerful auras fight each other, and the earth is torn beneath their feet.
There is some text underneath which you do not understand: #{italic}#'Sho ch'zun Eyal mor donuth, ik ranaheli donoth trun ze.'#{normal}#]],
lore = function() return [[You see here a mural showing a dark and tortured world. Large, god-like figures with powerful auras fight each other, and the earth is torn beneath their feet.
There is some text underneath ]]..(not game.player:attr("speaks_shertul") and [[which you do not understand: #{italic}#'Sho ch'zun Eyal mor donuth, ik ranaheli donoth trun ze.'#{normal}#]] or [[#{italic}#'In the beginning the world was dark, and the petty gods fought over their broken lands.'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-2",
category = "sher'tul",
name = "mural painting",
name = "second mural painting",
image = "shertul_fortress_lore2.png",
lore = [[In this picture a huge god with glowing eyes towers above the land, and in his right hand he holds high the sun. The other gods are running from him, wincing from the light. There is some text underneath which you do not understand: #{italic}#'Fa AMAKTHEL tabak, ik koru bazan tro yu, ik ranaheli tobol don schek ruun. Ik blana dem Soli as banafel ik goriz uf Eyal ik blod, "Tro fasa goru domus asam, ik goru domit tro Eyal."'#{normal}#]],
lore = function() return [[In this picture a huge god with glowing eyes towers above the land, and in his right hand he holds high the sun. The other gods are running from him, wincing from the light.
There is some text underneath ]]..(not game.player:attr("speaks_shertul") and [[which you do not understand: #{italic}#'Fa AMAKTHEL tabak, ik koru bazan tro yu, ik ranaheli tobol don schek ruun. Ik blana dem Soli as banafel ik goriz uf Eyal ik blod, "Tro fasa goru domus asam, ik goru domit tro Eyal."'#{normal}#]] or [[#{italic}#'But AMAKTHEL came, and his might surpassed all else, and the petty gods fled before his glory. And he made the Sun from his breath and held it above the world and said, "All that this light touches shall be mine, and this light shall touch all the world.'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-3",
category = "sher'tul",
name = "mural painting",
name = "third mural painting",
image = "shertul_fortress_lore3.png",
lore = [[This picture shows the huge god holding some smaller figures in his hands and pointing out at the lands beyond. You imagine these figures must be the Sher'Tul. There is some text beneath which you do not understand: #{italic}#'Ik AMAKTHEL cosio SHER'TUL, ik baladath peris furko masa bren doth benna zi, ik blod is "Fen makel ath goru domus ik denz tro ala fron."'#{normal}#]],
lore = function() return [[This picture shows the huge god holding some smaller figures in his hands and pointing out at the lands beyond. You imagine these figures must be the Sher'Tul.
There is some text beneath ]]..(not game.player:attr("speaks_shertul") and [[which you do not understand: #{italic}#'Ik AMAKTHEL cosio SHER'TUL, ik baladath peris furko masa bren doth benna zi, ik blod is "Fen makel ath goru domus ik denz tro ala fron."'#{normal}#]] or [[#{italic}#'And AMAKTHEL made the SHER'TUL, and gave unto us the powers to achieve all that we set our will to, and said to us "Go forth to where the light touches and take all for your own."'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-4",
category = "sher'tul",
name = "mural painting",
name = "fourth mural painting",
image = "shertul_fortress_lore4.png",
lore = [[You see a mural showing a huge metropolis made of crystal, with small islands of stone floating in the air behind it. In the foreground is sitting a Sher'Tul, with a hand stretched up to the sky. There is some text beneath which you do not understand: #{italic}#'Batialatoth ro Eyal, ik rinsi akan fronseth sumit kurameth ik linnet pora gasios aeren. Ach nen beswar goreg.'#{normal}#]],
lore = function() return [[You see a mural showing a huge metropolis made of crystal, with small islands of stone floating in the air behind it. In the foreground is sitting a Sher'Tul, with a hand stretched up to the sky.
There is some text beneath ]]..(not game.player:attr("speaks_shertul") and [[which you do not understand: #{italic}#'Batialatoth ro Eyal, ik rinsi akan fronseth sumit kurameth ik linnet pora gasios aeren. Ach nen beswar goreg.'#{normal}#]] or [[#{italic}#'We conquered the world, and built for ourselves towering cities of crystal and fortresses that travelled the skies. But some were not content...'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-5",
category = "sher'tul",
name = "mural painting",
name = "fifth mural painting",
image = "shertul_fortress_lore5.png",
lore = [[This mural shows nine Sher'Tul standing side by side, each holding aloft a dark weapon. Your eyes are drawn to a runed staff held by the purple-robed figure in the centre. It seems familiar somehow... There is some text beneath which you do not understand: #{italic}#'Zubadon koref noch hesen, ik dorudon koref noch pasor. Cosief maro dondreth karatu \u2013 Ranaduzil \u2013 ik jein belsan ovrienis.'#{normal}#]],
lore = function() return [[This mural shows nine Sher'Tul standing side by side, each holding aloft a dark weapon. Your eyes are drawn to a runed staff held by the purple-robed figure in the centre. It seems familiar somehow...
There is some text beneath ]]..(not game.player:attr("speaks_shertul") and [[which you do not understand: #{italic}#'Zubadon koref noch hesen, ik dorudon koref noch pasor. Cosief maro dondreth karatu - Ranaduzil - ik jein belsan ovrienis.'#{normal}#]] or [[#{italic}#'Of pride we accepted no equals, and of greed we accepted no servitude. We made for ourselves terrible weapons - the Godslayers - and nine were chosen to wield them.'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-6",
category = "sher'tul",
name = "mural painting",
name = "sixth mural painting",
image = "shertul_fortress_lore6.png",
lore = [[You see images of epic battles, with Sher'Tul warriors fighting and slaying god-like figures over ten times their size. There is some text underneath you do not understand: #{italic}#'Ranaheli meth dondruil ik duzin, ik leisif konru as neremin. Eyal matath bre sun. Ach unu rana soriton\u2026'#{normal}#]],
lore = function() return [[You see images of epic battles, with Sher'Tul warriors fighting and slaying god-like figures over ten times their size.
There is some text underneath ]]..(not game.player:attr("speaks_shertul") and [[which you do not understand: #{italic}#'Ranaheli meth dondruil ik duzin, ik leisif konru as neremin. Eyal matath bre sun. Ach unu rana soriton...'#{normal}#]] or [[#{italic}#'The petty gods were hunted down and slain, and their spirits rent to nothing. The land became our own. But one god remained...'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-7",
category = "sher'tul",
name = "mural painting",
name = "seventh mural painting",
image = "shertul_fortress_lore7.png",
lore = [[You see images of epic battles, with Sher'Tul warriors fighting and slaying god-like figures over ten times their size. There is some text underneath you do not understand: #{italic}#'Ranaheli meth dondruil ik duzin, ik leisif konru as neremin. Eyal matath bre sun. Ach unu rana soriton\u2026'#{normal}#]],
lore = function() return [[You see the purple-robed Sher'Tul striking the huge god with the dark, runed staff. Bodies litter the floor around them, and the golden throne behind is bathed in blood. The light in the god's eyes seems faded.
There is some text underneath ]]..(not game.player:attr("speaks_shertul") and [[which you do not understand: #{italic}#'Trobazan AMAKTHEL konruata as va aurin leas, ik mab peli zort akan hun, penetar dondeberoth.'#{normal}#]] or [[#{italic}#'The almighty AMAKTHEL was assaulted on his golden throne, and though many died before his feet, he was finally felled.'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-8",
category = "sher'tul",
name = "mural painting",
name = "eighth mural painting",
image = "shertul_fortress_lore8.png",
lore = [[The large mural shows the great god spread on the ground, with the dark staff held against his chest. Sher'Tul surround him, some hacking off his limbs, cutting out his tongue, and binding him with chains. A burst of light flares up from where a tall Sher'Tul warrior is gouging his eye with a black-bladed halberd. In the background a Sher'Tul mage beckons to a huge chasm in the ground. The text beneath says simply #{italic}#'Meas Abar.'#{normal}#]],
lore = function() return [[The large mural shows the great god spread on the ground, with the dark staff held against his chest. Sher'Tul surround him, some hacking off his limbs, cutting out his tongue, and binding him with chains. A burst of light flares up from where a tall Sher'Tul warrior is gouging his eye with a black-bladed halberd. In the background a Sher'Tul mage beckons to a huge chasm in the ground.
The text beneath says simply ]]..(not game.player:attr("speaks_shertul") and [[#{italic}#'Meas Abar.'#{normal}#]] or [[#{italic}#'The Great Sin.'#{normal}#]])
end,
}
newLore{
id = "shertul-fortress-9",
category = "sher'tul",
name = "mural painting",
name = "ninth mural painting",
image = "shertul_fortress_lore9.png",
lore = [[This final mural has been ruined, with deep scores and scratches etched across its surface. All you can see of the original appears to be flames.]],
lore = function() return [[This final mural has been ruined, with deep scores and scratches etched across its surface. All you can see of the original appears to be flames.]] end,
}
......@@ -49,6 +49,7 @@ The Sorcerers seem to have awakened its power.
max_positive = 50,
max_negative = 50,
inc_stats = { [Stats.STAT_MAG] = 10, [Stats.STAT_WIL] = 10 },
speaks_shertul = 1,
},
-- This is not a simple artifact, it is a godslayer, show off!
......
......@@ -56,8 +56,9 @@ function _M:init(l, w, force_height)
c_text:setTextShadow(false)
local uis = { {left = 3, top = 3, ui=c_text} }
local image
if l.image then
local image = Image.new{file="lore/"..l.image, auto_width=true, auto_height=true}
image = Image.new{file="lore/"..l.image, auto_width=true, auto_height=true}
uis = {
{hcenter = 0, top = 3, ui=image},
{left = 3, top = 3 + image.h, ui=c_text},
......@@ -68,5 +69,19 @@ function _M:init(l, w, force_height)
self.key:addBind("EXIT", function() game:unregisterDialog(self) if fct then fct() end end)
self.key:addBind("ACCEPT", function() game:unregisterDialog(self) if fct then fct() end end)
self:setupUI(true, true)
if self.w >= game.w or self.h >= game.h then
if l.image then
image.w = math.floor(image.w / 2)
image.h = math.floor(image.h / 2)
uis = {
{hcenter = 0, top = 3, ui=image},
{left = 3, top = 3 + image.h, ui=c_text},
}
end
self:loadUI(uis)
self:setupUI(true, true)
end
game:registerDialog(self)
end
......@@ -22,6 +22,7 @@ local Dialog = require "engine.ui.Dialog"
local ListColumns = require "engine.ui.ListColumns"
local TextzoneList = require "engine.ui.TextzoneList"
local Separator = require "engine.ui.Separator"
local Image = require "engine.ui.Image"
module(..., package.seeall, class.inherit(Dialog))
......@@ -63,7 +64,7 @@ function _M:generateList()
local i = 0
for id, _ in pairs(self.actor.lore_known) do
local l = self.actor:getLore(id)
list[#list+1] = { name=l.name, desc=util.getval(l.lore), cat=l.category, order=l.order }
list[#list+1] = { name=l.name, desc=util.getval(l.lore), cat=l.category, order=l.order, image=l.image }
i = i + 1
end
-- Add known artifacts
......@@ -74,5 +75,24 @@ end
function _M:select(item)
if item then
self.c_desc:switchItem(item, ("#GOLD#Category:#AQUAMARINE# %s\n#GOLD#Found as:#0080FF# %s\n#GOLD#Text:#ANTIQUE_WHITE# %s"):format(item.cat, item.name, item.desc))
if item.image then
if type(item.image) == "string" then
self.image = Image.new{file="lore/"..item.image, auto_width=true, auto_height=true}
local r = self.image.w / self.image.h
self.image.w = self.iw / 2 - 20
self.image.h = self.image.w / r
item.image = self.image
else
self.image = item.image
end
else
self.image = nil
end
end
end
function _M:innerDisplay(x, y, nb_keyframes)
if self.image then
self.image:display(x + self.iw - self.image.w, y + self.ih - self.image.h)
end
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