Here is a custom mini-lightning spell. This is not a perfect copy of the real lightning spell; it might have unintended issues that I haven't foreseen.
Noteably, it does not simulate the dynamic lighting effect of a normal lightning spell; but it works well enough.
Place this model in your models folder. [I wish there was a blank model in the default game files, but I don't know of one.]
Place this code in your spells.lua script.
Code: Select all
defineSpell{
name = "mini-lightning_bolt",
uiName = "Mini-Lightning Bolt",
skill = "air_magic",
level = 10,
runes = "CDE",
manaCost = 20,
onCast = function(champion)
local dx,dy = getForward(party.facing)
--~ local damage = 10
local Xoffset = -0.5
local Yoffset = 0.5
if champion:getOrdinal() == party:getChampion(2):getOrdinal() or champion:getOrdinal() == party:getChampion(4):getOrdinal() then
Yoffset = -0.5
end
if champion:getOrdinal() == party:getChampion(3):getOrdinal() or champion:getOrdinal() == party:getChampion(1):getOrdinal() then
Xoffset = 0.5
end
playSoundAt("lightning_bolt_launch", party.level, party.x, party.y)
shootProjectile("mini-lightning_bolt", party.level, party.x+dx, party.y+dy, party.facing, 9, 0, 0, Xoffset, 0.2, Yoffset, 0, nil, true, champion:getOrdinal())
end,
}
cloneObject{
name = "mini-lightning_bolt",
baseObject = "shock_bomb",
uiName = "na",
impactSound = "lightning_bolt_hit",
stackable = false,
bombPower = 25,
model = "mod_assets/models/Isaac_empty_space.fbx",
glitterEffect = "mini-lightning_bolt",
}
defineParticleSystem{
name = "mini-lightning_bolt",
emitters = {
{
emissionRate = 15,
emissionTime = 10,
maxParticles = 1000,
boxMin = { 0,0,0 },
boxMax = { 0,0,0 },
sprayAngle = {0,360},
velocity = {0,0},
objectSpace = true,
texture = "assets/textures/particles/lightning01.tga",
frameRate = 4,
frameSize = 256,
frameCount = 4,
lifetime = {20.1,20.3},
color0 = {1.5,1.5,1.5},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {0.075, 0.5},
gravity = {0,0,0},
airResistance = 5,
rotationSpeed = 1,
blendMode = "Additive",
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,0.0},
boxMax = {0,0,0.0},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {0.25,0.32,0.5},
opacity = 0.3,
fadeIn = 0.1,
fadeOut = 0.1,
size = {0.075, 0.5},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
}
}
}