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

ahahhahahahahhahahahha

git-svn-id: http://svn.net-core.org/repos/t-engine4@6054 51575b47-30f0-44d4-a5cc-537603b46e54
parent 052c2635
No related branches found
No related tags found
No related merge requests found
......@@ -3463,6 +3463,10 @@ function _M:preUseTalent(ab, silent, fake)
if not silent then game.logPlayer(self, "You do not have enough feedback to use %s.", ab.name) end
return false
end
if ab.fortress_energy and game:getPlayer(true):hasQuest("shertul-fortress") and game:getPlayer(true):hasQuest("shertul-fortress").shertul_energy < ab.fortress_energy then
if not silent then game.logPlayer(self, "You do not have enough fortress energy to use %s.", ab.name) end
return false
end
end
-- Equilibrium is special, it has no max, but the higher it is the higher the chance of failure (and loss of the turn)
......@@ -3725,6 +3729,9 @@ function _M:postUseTalent(ab, ret)
if ab.feedback and not self:attr("zero_resource_cost") then
trigger = true; self:incFeedback(-ab.feedback * (100 + 2 * self:combatFatigue()) / 100)
end
if ab.fortress_energy and game:getPlayer(true):hasQuest("shertul-fortress") and not self:attr("zero_resource_cost") then
trigger = true; game:getPlayer(true):hasQuest("shertul-fortress").shertul_energy = game:getPlayer(true):hasQuest("shertul-fortress").shertul_energy - ab.fortress_energy
end
end
if trigger and self:hasEffect(self.EFF_BURNING_HEX) then
......@@ -3884,6 +3891,7 @@ function _M:getTalentFullDescription(t, addlevel, config, fake_mastery)
if t.paradox then d:add({"color",0x6f,0xff,0x83}, "Paradox cost: ", {"color", 176, 196, 222}, ("%0.2f"):format(t.paradox * (1 + (self.paradox / 300))), true) end
if t.psi then d:add({"color",0x6f,0xff,0x83}, "Psi cost: ", {"color",0x7f,0xff,0xd4}, ""..(t.psi * (100 + 2 * self:combatFatigue()) / 100), true) end
if t.feedback then d:add({"color",0x6f,0xff,0x83}, "Feedback cost: ", {"color",0xFF, 0xFF, 0x00}, ""..(t.feedback * (100 + 2 * self:combatFatigue()) / 100), true) end
if t.fortress_energy then d:add({"color",0x6f,0xff,0x83}, "Fortress Energy cost: ", {"color",0x00,0xff,0xa0}, ""..(t.fortress_energy), true) end
if t.sustain_mana then d:add({"color",0x6f,0xff,0x83}, "Sustain mana cost: ", {"color",0x7f,0xff,0xd4}, ""..(util.getval(t.sustain_mana, self, t)), true) end
if t.sustain_stamina then d:add({"color",0x6f,0xff,0x83}, "Sustain stamina cost: ", {"color",0xff,0xcc,0x80}, ""..(t.sustain_stamina), true) end
......
......@@ -53,6 +53,8 @@ function _M:init(t, no_default)
self.life = 10000
self.energy.mod = 2
self.shader = "moving_transparency"
self:learnTalent(self.T_SHERTUL_FORTRESS_GETOUT, true)
self:learnTalent(self.T_SHERTUL_FORTRESS_BEAM, true)
......
......@@ -149,6 +149,14 @@ function _M:defineDisplayCallback()
end)
end
function _M:takePowerHit(val, src)
self.unit_power = (self.unit_power or 0) - val
if self.unit_power <= 0 then
game.logSeen(self, "%s kills %s.", src.name:capitalize(), self.name)
self:die(src)
end
end
function _M:encounterAttack(target, x, y)
if target.player then target:onWorldEncounter(self, self.x, self.y) return end
......
// Most source from http://www.geeks3d.com/20100831/shader-library-noise-and-pseudo-random-number-generator-in-glsl/
// With some changes to make it affect an existing texture
#extension GL_EXT_gpu_shader4: enable
uniform sampler2D tex;
uniform float a_min;
uniform float a_max;
uniform float base;
uniform float time_factor;
uniform float tick;
uniform vec2 p2 = vec2(1.0, 1.0);
int LFSR_Rand_Gen(in int n)
{
// <<, ^ and & require GL_EXT_gpu_shader4.
n = (n << 13) ^ n;
return (n * (n*n*15731+789221) + 1376312589) & 0x7fffffff;
}
float LFSR_Rand_Gen_f( in int n )
{
return float(LFSR_Rand_Gen(n));
}
float noise3f(in vec3 p)
{
ivec3 ip = ivec3(floor(p));
vec3 u = fract(p);
u = u*u*(3.0-2.0*u);
int n = ip.x + ip.y*57 + ip.z*113;
float res = mix(mix(mix(LFSR_Rand_Gen_f(n+(0+57*0+113*0)),
LFSR_Rand_Gen_f(n+(1+57*0+113*0)),u.x),
mix(LFSR_Rand_Gen_f(n+(0+57*1+113*0)),
LFSR_Rand_Gen_f(n+(1+57*1+113*0)),u.x),u.y),
mix(mix(LFSR_Rand_Gen_f(n+(0+57*0+113*1)),
LFSR_Rand_Gen_f(n+(1+57*0+113*1)),u.x),
mix(LFSR_Rand_Gen_f(n+(0+57*1+113*1)),
LFSR_Rand_Gen_f(n+(1+57*1+113*1)),u.x),u.y),u.z);
return 1.0 - res*(1.0/1073741824.0);
}
#define ty(x,y) (pow(.5+sin((x)*y*6.2831)/2.0,2.0)-.5)
#define t2(x,y) \
ty(y + 2.0*ty(x+2.0*noise3f(vec3(cos((x)/3.0)+x,y+tick/time_factor,(x)*.1)),.3),.7)
#define tx(x,y,a,d) \
((t2(x, y) * (a - x) * (d - y) + \
t2(x - a, y) * x * (d - y) + t2(x, y - d) * (a - x) * y + \
t2(x - a, y - d) * x * y) / (a * d))
float fx(vec2 x)
{
float a=0.0,d=32.0;
// Modified FBM functions to generate a blob texture
for(;d>=1.0;d/=2.0)
a += abs(tx(x.x*2.0*d, x.y*2.0*d, 2.0*d, 2.0*d)/(2.0*d));
return a*2.0;
}
void main(void)
{
vec2 uv = gl_TexCoord[0].xy * p2;
uv -= floor(uv);
gl_FragColor = texture2D(tex, gl_TexCoord[0].xy);
gl_FragColor.a *= mix(a_min, a_max, fx(uv));
}
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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 = "moving_transparency",
vert = nil,
args = {
a_min = 0.4,
a_max = 1.5,
base = base or 0.3,
time_factor = time_factor or 3000,
},
clone = false,
}
......@@ -327,19 +327,25 @@ newTalent{
short_name = "SHERTUL_FORTRESS_BEAM",
name = "Fire a blast of energy", --FINISH ME
type = {"base/race", 1},
fortress_energy = 10,
no_npc_use = true,
no_unlearn_last = true,
action = function(self, t)
for i = 1, 5 do
local rad = rng.float(0.5, 1)
local bx = rng.range(-24, 24)
local by = rng.range(-24, 24)
local bx = rng.range(-12, 12)
local by = rng.range(-12, 12)
if core.shader.active(4) then game.level.map:particleEmitter(self.x, self.y, 1, "shader_ring", {radius=rad * 2, life=12, x=bx, y=by}, {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, 1, "generic_ball", {rm=150, rM=180, gm=20, gM=60, bm=180, bM=200, am=80, aM=150, radius=rad, x=bx, y=by})
end
end
local target = game.level.map(self.x, self.y, Map.ACTOR)
if target and target.takePowerHit then
target:takePowerHit(20, self)
end
game:playSoundNear(self, "talents/arcane")
return true
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