Skip to content
Snippets Groups Projects
Commit 3f224e2f authored by Hachem_Muche's avatar Hachem_Muche
Browse files

Merge branch 'master' into MiscFixes

parents d52a8827 daed93e6
No related branches found
No related tags found
No related merge requests found
Showing
with 85 additions and 2 deletions
......@@ -42,6 +42,7 @@ function _M:init(q, who)
self.status = PENDING
self.objectives = {}
if self:check("on_grant", who) then self.do_not_gain = true end
self:triggerHook{"Quest:init"}
end
--- Checks if the quest (or sub-objective) is complete
......@@ -88,6 +89,10 @@ end
-- @param[opt] sub sub-objective
-- @param who who did this??
function _M:setStatus(status, sub, who)
local hk = {"Quest:setStatus", status=status, sub=sub, who=who, ret=false}
if self:triggerHook(hk) then
return hk.ret
end
if sub then
if self.objectives[sub] and self.objectives[sub] == status then return false end
self.objectives[sub] = status
......
......@@ -275,7 +275,7 @@ function _M:effectParticles(eff, ...)
local Particles = require "engine.Particles"
if not eff.__tmpparticles then eff.__tmpparticles = {} end
for _, p in ipairs{...} do
eff.__tmpparticles[#eff.__tmpparticles+1] = self:addParticles(Particles.new(p.type, 1, p.args, ps.shader))
eff.__tmpparticles[#eff.__tmpparticles+1] = self:addParticles(Particles.new(p.type, 1, p.args, p.shader))
end
end
......
......@@ -1162,6 +1162,14 @@ function _M:bigTacticalFrame(x, y, w, h, zoom, on_map, tlx, tly)
end
end
local boss_rank_circles = {
[3.2] = { back="npc/boss_indicators/rare_circle_back.png", front="npc/boss_indicators/rare_circle_front.png" },
[3.5] = { back="npc/boss_indicators/unique_circle_back.png", front="npc/boss_indicators/unique_circle_front.png" },
[4] = { back="npc/boss_indicators/boss_circle_back.png", front="npc/boss_indicators/boss_circle_front.png" },
[5] = { back="npc/boss_indicators/elite_boss_circle_back.png", front="npc/boss_indicators/elite_boss_circle_front.png" },
[10] = { back="npc/boss_indicators/god_circle_back.png", front="npc/boss_indicators/god_circle_front.png" },
}
--- Attach or remove a display callback
-- Defines particles to display
function _M:defineDisplayCallback()
......@@ -1216,6 +1224,12 @@ function _M:defineDisplayCallback()
else self:removeParticles(e)
end
end
if boss_rank_circles[self.rank or 1] then
local b = boss_rank_circles[self.rank]
if not b.ifront then b.ifront = game.level.map.tilesTactic:get('', 0,0,0, 0,0,0, b.front) end
b.ifront:toScreen(x, y + h - w * (0.616 - 0.5), w, w / 2)
end
end
local function backparticles(x, y, w, h, zoom, on_map)
......@@ -1232,6 +1246,12 @@ function _M:defineDisplayCallback()
else self:removeParticles(e)
end
end
if boss_rank_circles[self.rank or 1] then
local b = boss_rank_circles[self.rank]
if not b.iback then b.iback = game.level.map.tilesTactic:get('', 0,0,0, 0,0,0, b.back) end
b.iback:toScreen(x, y + h - w * 0.616, w, w / 2)
end
end
if self._mo == self._last_mo or not self._last_mo then
......
......@@ -22,6 +22,7 @@ local ActorAI = require "engine.interface.ActorAI"
local Faction = require "engine.Faction"
local Emote = require("engine.Emote")
local Chat = require "engine.Chat"
local Particles = require "engine.Particles"
require "mod.class.Actor"
module(..., package.seeall, class.inherit(mod.class.Actor, engine.interface.ActorAI))
......
......@@ -21,7 +21,11 @@
-- Advanced shaders
--------------------------------------------------------------------------------------
if core.shader.allow("distort") and allow then
use_shader = {type="distort"} alterscreen = true
if distort_color then
use_shader = {type="distortcolor", distort_color=distort_color} alterscreen = true
else
use_shader = {type="distort"} alterscreen = true
end
base_size = 64
local nb = 0
......
uniform sampler2D tex;
uniform float tick;
uniform sampler2D mainfbo;
uniform vec2 texSize;
uniform float power;
uniform float power_time;
uniform float power_amp;
uniform float blacken;
uniform vec4 distort_color;
void main(void)
{
float distortionPower = power * (abs(cos(tick / power_time)) * power_amp + 1.0 - power_amp);
vec4 distortionColor = texture2D(tex, gl_TexCoord[0].xy);
vec2 distortionOffset = vec2(distortionColor.r - 0.5, distortionColor.g - 0.5) * distortionPower;
gl_FragColor = texture2D(mainfbo, gl_FragCoord.xy / texSize.xy + distortionOffset.xy);
gl_FragColor = mix(gl_FragColor, distort_color, length(distortionOffset) * blacken);
gl_FragColor.a *= gl_Color.a;
}
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2016 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
return {
frag = "distortcolor",
vert = nil,
args = {
tex = { texture = 0 },
mainfbo = { texture = 1 },
power = power or 0.06,
power_time = power_time or 100,
power_amp = power_amp or 1,
blacken = blacken or 10,
distort_color = distort_color or {1, 1, 1, 1},
},
clone = false,
}
game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/boss_circle_back.png

20.6 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/boss_circle_front.png

20.5 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/elite_boss_circle_back.png

20.6 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/elite_boss_circle_front.png

20.5 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/god_circle_back.png

20.9 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/god_circle_front.png

20.9 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/rare_circle_back.png

20.9 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/rare_circle_front.png

20.3 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/unique_circle_back.png

20.4 KiB

game/modules/tome/data/gfx/shockbolt/npc/boss_indicators/unique_circle_front.png

20.3 KiB

......@@ -87,6 +87,7 @@ newEntity{ base="BASE_NPC_ORC_RAK_SHOR", define_as = "CULTIST_RAK_SHOR",
a.rank = 4
a.name = "Doomed Shade of "..a.name
a.killer_message = "but nobody knew why #sex# suddenly became evil"
a.is_player_doomed_shade = true
a.color_r = 150 a.color_g = 150 a.color_b = 150
a:removeAllMOs()
a.ai = "tactical"
......
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