From c58483178f92d2c976e01107abb00af5ef9b1ca1 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Fri, 30 Nov 2012 00:47:36 +0000
Subject: [PATCH] Dialogs are slightly translucent Arcane Vortex now explodes
 in a ball when the affected creature dies before the end of the effect

git-svn-id: http://svn.net-core.org/repos/t-engine4@5861 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/ui/Base.lua          |  2 +-
 game/modules/tome/class/Actor.lua                |  6 ++++++
 game/modules/tome/data/timed_effects/magical.lua | 11 ++++++++++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/game/engines/default/engine/ui/Base.lua b/game/engines/default/engine/ui/Base.lua
index 39f27c3eef..037ac96287 100644
--- a/game/engines/default/engine/ui/Base.lua
+++ b/game/engines/default/engine/ui/Base.lua
@@ -48,7 +48,7 @@ sounds = {
 _M.ui_conf = {
 	metal = {
 		frame_shadow = {x=15, y=15, a=0.5},
-		frame_alpha = 1,
+		frame_alpha = 0.9,
 		frame_ox1 = -42,
 		frame_ox2 =  42,
 		frame_oy1 = -42,
diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index dd39304aef..4c3a507810 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -2119,6 +2119,12 @@ function _M:die(src, death_note)
 
 	mod.class.interface.ActorLife.die(self, src, death_note)
 
+	-- Trigegr on_die effects if any
+	for eff_id, p in pairs(self.tmp) do
+		local e = self.tempeffect_def[eff_id]
+		if e.on_die then e.on_die(self, p) end
+	end
+
 	-- Gives the killer some exp for the kill
 	local killer = nil
 	if src and src.resolveSource and src:resolveSource().gainExp then
diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua
index 02211fdbe2..d4a5ab1a9a 100644
--- a/game/modules/tome/data/timed_effects/magical.lua
+++ b/game/modules/tome/data/timed_effects/magical.lua
@@ -1788,7 +1788,7 @@ newEffect{
 newEffect{
 	name = "ARCANE_VORTEX", image = "talents/arcane_vortex.png",
 	desc = "Arcane Vortex",
-	long_desc = function(self, eff) return ("An arcane vortex followes the target. Each turn a manathrust fires from it to a random foe in sight doing %0.2f arcane damage to all. If no foes are found the main target takes 150%% more arcane damage this turn."):format(eff.dam) end,
+	long_desc = function(self, eff) return ("An arcane vortex followes the target. Each turn a manathrust fires from it to a random foe in sight doing %0.2f arcane damage to all. If no foes are found the main target takes 150%% more arcane damage this turn. If the target dies the remaining damage is deal as a radius 2 ball of arcane."):format(eff.dam) end,
 	type = "magical",
 	subtype = { arcane=true },
 	status = "detrimental",
@@ -1813,6 +1813,15 @@ newEffect{
 
 		game:playSoundNear(self, "talents/arcane")
 	end,
+	on_die = function(self, eff)
+		local tg = {type="ball", radius=2, selffire=false, x=self.x, y=self.y}
+		eff.src:project(tg, self.x, self.y, DamageType.ARCANE, eff.dam * eff.dur)
+		if core.shader.active(4) then
+			game.level.map:particleEmitter(self.x, self.y, 2, "shader_ring", {radius=4, life=12}, {type="sparks", zoom=1, time_factor=400, hide_center=0, color1={0.6, 0.3, 0.8, 1}, color2={0.8, 0, 0.8, 1}})
+		else
+			game.level.map:particleEmitter(self.x, self.y, 2, "generic_ball", {rm=150, rM=180, gm=20, gM=60, bm=180, bM=200, am=80, aM=150, radius=2})
+		end
+	end,
 	activate = function(self, eff)
 		eff.particle = self:addParticles(Particles.new("arcane_vortex", 1))
 	end,
-- 
GitLab