I had wanted to do a spell that would modify its damage based on the amount of health the caster has but I couldn't get it to work, so as a workaround I made this, it's a projectile spell that has 200 attack power but can only be cast is the caster has under 10% health, a big gun to pull out when close to death.
the Particle definition: for this to work you need to put a texture called energy_particle in mod_assets/textures/particles
Code: Select all
defineParticleSystem{
name = "energy_bolt",
emitters = {
-- ball
{
emissionRate = 400,
emissionTime = 0,
maxParticles = 1800,
boxMin = { 0, 0, 0},
boxMax = { 0, 0, 0},
sprayAngle = {0,360},
velocity = {0.1,0.2},
objectSpace = false,
texture = "mod_assets/textures/particles/energy_particle.tga",
lifetime = {0.2,0.4},
color0 = {0.58, 0.588, 0.6},
opacity = 0.45,
fadeIn = 0.01,
fadeOut = 0.6,
size = {0.28, 0.38},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 3,
blendMode = "Translucent",
},
--pour
{
emissionRate = 300,
emissionTime = 0,
spawnBurst = false,
maxParticles =3000,
boxMin = {-0.35,-1,-0.35},
boxMax = {0.35,0.5,0.35},
objectSpace = false,
sprayAngle = {0,120},
velocity = {0,0},
texture = "assets/textures/particles/glitter_silver.tga",
lifetime = {100, 100},
colorAnimation = false,
color0 = {0.5, 0.6, 1},
opacity = 0.65,
fadeIn = 1,
fadeOut = 2.5,
size = {0.05, 0.1},
gravity = {0,-3,0},
airResistance = 1,
rotationSpeed = 0.7,
blendMode = "Additive",
},
--spray
{
emissionRate = 900,
emissionTime = 0,
spawnBurst = false,
maxParticles =1500,
boxMin = {-0.2,-1,-0.2},
boxMax = {0.2,0.2,0.2},
objectSpace = false,
sprayAngle = {0,120},
velocity = {-1,-1.5},
texture = "assets/textures/particles/glitter_silver.tga",
lifetime = {100, 100},
colorAnimation = false,
color0 = {0.5, 0.6, 1},
opacity = 0.65,
fadeIn = 1,
fadeOut = 2.5,
size = {0.06, 0.12},
gravity = {0,-2,0},
airResistance = 1,
rotationSpeed = 0.7,
blendMode = "Additive",
},
}
}
defineParticleSystem{
name = "energy_bolt_hit",
emitters = {
-- splash
{
spawnBurst = true,
maxParticles = 20,
sprayAngle = {0,360},
velocity = {0.2,0.9},
objectSpace = true,
texture = "mod_assets/textures/particles/energy_particle.tga",
lifetime = {0.2,0.7},
color0 = {0.49, 0.45, 0.6},
opacity = 0.4,
fadeIn = 0.05,
fadeOut = 0.5,
size = {0.6, 1.0},
gravity = {0,0,0},
airResistance = 0.5,
rotationSpeed = 1,
blendMode = "Translucent",
},
--spray
{
emissionRate = 900,
emissionTime = 0,
spawnBurst = true,
maxParticles =1500,
boxMin = {-0.2,-1,-0.2},
boxMax = {0.2,0.2,0.2},
objectSpace = false,
sprayAngle = {0,120},
velocity = {-1,-1.5},
texture = "assets/textures/particles/glitter_silver.tga",
lifetime = {1.1, 1.7},
colorAnimation = false,
color0 = {0.5, 0.5, 1},
opacity = 0.65,
fadeIn = 1,
fadeOut = 2.7,
size = {0.06, 0.12},
gravity = {0,-2,0},
airResistance = 1,
rotationSpeed = 0.7,
blendMode = "Additive",
},
-- fog 2
{
spawnBurst = true,
maxParticles = 20,
sprayAngle = {0,360},
velocity = {0.2,0.9},
objectSpace = true,
texture = "mod_assets/textures/particles/energy_particle.tga",
lifetime = {0.2,0.7},
color0 = {0.49, 0.45, 0.6},
opacity = 0.4,
fadeIn = 0.05,
fadeOut = 0.3,
size = {0.4, 0.6},
gravity = {0,0,0},
airResistance = 0.5,
rotationSpeed = 2,
blendMode = "Translucent",
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {0.5, 0.5},
colorAnimation = false,
color0 = {0.42, 0.42, 0.6},
opacity = 0.2,
fadeIn = 0.01,
fadeOut = 0.5,
size = {1, 1},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
}
}
}
defineParticleSystem{
name = "energy_bolt_screen",
emitters = {
{
spawnBurst = true,
maxParticles = 300,
sprayAngle = {0,360},
velocity = {0,0.3},
boxMin = {-1.1,-0.9,1},
boxMax = {1.1,0.9,1},
objectSpace = true,
texture = "assets/textures/particles/glow.tga",
lifetime = {0.3, 0.5},
color0 = {0.5, 0.6, 1},
opacity = 0.38,
fadeIn = 0.001,
fadeOut = 1,
size = {0.005, 0.3},
gravity = {0,0,0},
airResistance = 0.5,
rotationSpeed = 6,
blendMode = "Additive",
},
--spray
{
emissionRate = 900,
emissionTime = 0,
spawnBurst = true,
maxParticles =1500,
boxMin = {-0.2,-1,-0.2},
boxMax = {0.2,0.2,0.2},
objectSpace = false,
sprayAngle = {0,120},
velocity = {-1,-1.5},
texture = "assets/textures/particles/glitter_silver.tga",
lifetime = {100, 100},
colorAnimation = false,
color0 = {0.5, 0.6, 1},
opacity = 0.65,
fadeIn = 1,
fadeOut = 2.5,
size = {0.03, 0.06},
gravity = {0,-2,0},
airResistance = 1,
rotationSpeed = 0.7,
blendMode = "Additive",
},
{
spawnBurst = true,
maxParticles = 1500,
sprayAngle = {0,360},
velocity = {0,0.3},
boxMin = {-1.1,-0.9,1},
boxMax = {1.1,0.9,1},
objectSpace = true,
texture = "mod_assets/textures/particles/energy_particle.tga",
lifetime = {0.3, 0.5},
color0 = {0.5, 0.6, 1},
opacity = 0.35,
fadeIn = 0.001,
fadeOut = 1,
size = {0.03, 0.6},
gravity = {0,0,0},
airResistance = 0.5,
rotationSpeed = 1,
blendMode = "Additive",
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,1},
boxMax = {0,0,1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {0.5, 0.5},
colorAnimation = false,
color0 = {0.5, 0.6, 1},
opacity = 0.2,
fadeIn = 0.001,
fadeOut = 0.1,
size = {3.2, 3.2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
}
}
}