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

hourglass

git-svn-id: http://svn.net-core.org/repos/t-engine4@4804 51575b47-30f0-44d4-a5cc-537603b46e54
parent 3dcdd58d
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,7 @@ newAI("move_quest_limmir", function(self)
end
else
game.level.turn_counter = 370 * 10
game.level.max_turn_counter = 370 * 10
game.player.changed = true
self.ai = "none"
self:doEmote("This place is corrupted! I will cleanse it! Protect me while I do it!", 120)
......
......@@ -105,6 +105,11 @@ fshat_psi_dark = {core.display.loadImage("/data/gfx/ui/resources/front_psi_dark.
fshat_air = {core.display.loadImage("/data/gfx/ui/resources/front_air.png"):glTexture()}
fshat_air_dark = {core.display.loadImage("/data/gfx/ui/resources/front_air_dark.png"):glTexture()}
fshat_hourglass = {core.display.loadImage("/data/gfx/ui/resources/hourglass_front.png"):glTexture()}
sshat_hourglass = {core.display.loadImage("/data/gfx/ui/resources/hourglass_shadow.png"):glTexture()}
shat_hourglass_top = {core.display.loadImage("/data/gfx/ui/resources/hourglass_top.png"):glTexture()}
shat_hourglass_bottom = {core.display.loadImage("/data/gfx/ui/resources/hourglass_bottom.png"):glTexture()}
ammo_shadow_default = {core.display.loadImage("/data/gfx/ui/resources/ammo_shadow_default.png"):glTexture()}
ammo_default = {core.display.loadImage("/data/gfx/ui/resources/ammo_default.png"):glTexture()}
ammo_shadow_arrow = {core.display.loadImage("/data/gfx/ui/resources/ammo_shadow_arrow.png"):glTexture()}
......@@ -810,6 +815,36 @@ function _M:displayResources(scale, bx, by)
if y > stop then x = x + fshat[6] y = 0 end
end
-----------------------------------------------------------------------------------
-- Hourglass
if game.level and game.level.turn_counter then
sshat_hourglass[1]:toScreenFull(x-6, y+8, sshat_hourglass[6], sshat_hourglass[7], sshat_hourglass[2], sshat_hourglass[3])
local c = game.level.turn_counter
local m = math.max(game.level.max_turn_counter, c)
local p = 1 - c / m
shat_hourglass_top[1]:toScreenPrecise(x+11, y+32 + shat_hourglass_top[7] * p, shat_hourglass_top[6], shat_hourglass_top[7] * (1-p), 0, 1/shat_hourglass_top[4], p/shat_hourglass_top[5], 1/shat_hourglass_top[5], save_c[1], save_c[2], save_c[3], 1)
shat_hourglass_bottom[1]:toScreenPrecise(x+12, y+72 + shat_hourglass_bottom[7] * (1-p), shat_hourglass_bottom[6], shat_hourglass_bottom[7] * p, 0, 1/shat_hourglass_bottom[4], (1-p)/shat_hourglass_bottom[5], 1/shat_hourglass_bottom[5], save_c[1], save_c[2], save_c[3], 1)
if not self.res.hourglass or self.res.hourglass.vc ~= c or self.res.hourglass.vm ~= m then
self.res.hourglass = {
vc = c, vm = m,
cur = {core.display.drawStringBlendedNewSurface(font_sha, ("%d"):format(c/10), 255, 255, 255):glTexture()},
}
end
local front = fshat_hourglass
local dt = self.res.hourglass.cur
dt[1]:toScreenFull(2+x+(front[6]-dt[6])/2, 2+y+90, dt[6], dt[7], dt[2], dt[3], 0, 0, 0, 0.7)
dt[1]:toScreenFull(x+(front[6]-dt[6])/2, y+90, dt[6], dt[7], dt[2], dt[3])
front[1]:toScreenFull(x, y, front[6], front[7], front[2], front[3])
y = y + front[7]
if y > stop then x = x + fshat[6] y = 0 end
end
-- Compute how much space to reserve on the side
self.side_4 = x + fshat[6]
-- Map.viewport_padding_4 = math.floor(scale * (self.side_4 / Map.tile_w))
-----------------------------------------------------------------------------------
-- Saving
if savefile_pipe.saving then
......
game/modules/tome/data/gfx/ui/resources/hourglass_bottom.png

796 B

game/modules/tome/data/gfx/ui/resources/hourglass_front.png

16.9 KiB

game/modules/tome/data/gfx/ui/resources/hourglass_shadow.png

5.05 KiB

game/modules/tome/data/gfx/ui/resources/hourglass_top.png

919 B

......@@ -109,6 +109,7 @@ return {
game.player:learnTalent(game.player.T_SHOOT, true, nil, {no_unlearn=true})
game.player.changed = true
level.turn_counter = 60 --5 turns before action starts.
level.max_turn_counter = 60 --5 turns before action starts.
--world.arena = nil
if not world.arena or not world.arena.ver then
local emptyScore = {name = nil, score = 0, perk = nil, wave = 1, sex = nil, race = nil, class = nil}
......@@ -418,6 +419,7 @@ return {
end
end
game.level.turn_counter = rest_time * 10
game.level.max_turn_counter = rest_time * 10
game.level.arena.initWave(val)
end,
checkPinch = function ()
......
......@@ -59,6 +59,7 @@ return {
post_process = function(level)
level.turn_counter = 600 * 10
level.max_turn_counter = 600 * 10
end,
on_enter = function(lev, old_lev, newzone)
......
......@@ -68,6 +68,7 @@ return {
require("engine.ui.Dialog"):simplePopup("Crypt", "The chanting grows louder. You hear a sudden high-pitched scream.")
elseif lev == 5 then
game.level.turn_counter = 20 * 10
game.level.max_turn_counter = 20 * 10
game.player:grantQuest("kryl-feijan-escape")
game.player:learnLore("kryl-feijan-altar")
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