1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-10 00:28:31 +02:00
Rampant/prototypes/utils/AttackBobs.lua

461 lines
8.5 KiB
Lua
Raw Normal View History

2017-04-02 01:40:47 +02:00
-- bobs replacement attacks
-- import
local fireUtils = require("FireUtils")
local stickerUtils = require("StickerUtils")
2018-02-06 10:01:20 +02:00
local attackBall = require("AttackBall")
-- constants
local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"].value
-- imported functions
local makeSpreadEffect = fireUtils.makeSpreadEffect
local makeFire = fireUtils.makeFire
local makeSticker = stickerUtils.makeSticker
2018-02-06 10:01:20 +02:00
local createAttackBall = attackBall.createAttackBall
-- module code
local softSmoke = "the-soft-smoke-rampant"
local smokeGlow = "the-glow-smoke-rampant"
local smokeWithoutGlow = "the-without-glow-smoke-rampant"
local smokeFuel = "the-adding-fuel-rampant"
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = "bob-explosive-ball",
2018-02-06 10:01:20 +02:00
pTint = {r=1, g=0.97, b=0.34, a=0.5},
sTint = {r=1, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "small-scorchmark",
check_buildability = true
},
{
type = "create-entity",
entity_name = "big-explosion",
check_buildability = true
},
{
type = "create-entity",
entity_name = "small-fire-cloud"
}
}
end,
radius = 3,
areaEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "damage",
damage = { amount = 25, type = "explosion" }
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end
}
)
2017-04-02 01:40:47 +02:00
--
2017-04-02 01:40:47 +02:00
local name = "bob-fire-ball"
local spawnEntityName = makeSpreadEffect({
name = name,
smokeWithoutGlowName = smokeWithoutGlow
})
local fireName = makeFire({
name = name,
fireTint = {r=0, g=0.9, b=0, a=0.5},
smokeWithGlowName = smokeGlow,
smokeAddingFuelName = smokeFuel,
spawnEntityName = spawnEntityName
})
local stickerName = makeSticker({
name = name,
spawnEntityName = spawnEntityName
})
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = name,
2018-02-06 10:01:20 +02:00
pTint = {r=1, g=0.17, b=0.17, a=0.5},
sTint = {r=1, g=0.43, b=0.17, a=0.5},
2018-02-06 03:50:36 +02:00
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return {
{
type = "create-fire",
entity_name = fireName
}
}
end,
radius = 2,
areaEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "create-sticker",
sticker = stickerName,
},
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "damage",
damage = { amount = 20, type = "fire" }
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end
}
)
2017-04-02 01:40:47 +02:00
--
2017-04-02 01:40:47 +02:00
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = "bob-poison-ball",
2018-02-06 10:01:20 +02:00
pTint = {r=0.1, g=0.5, b=1, a=0.5},
sTint = {r=0, g=0, b=1, a=0.5},
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "small-poison-cloud"
}
}
end,
radius = 2,
areaEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "damage",
damage = { amount = 20, type = "poison" }
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end
}
)
2017-04-02 01:40:47 +02:00
-- piercing
2017-04-02 01:40:47 +02:00
data:extend({
{
type = "projectile",
name = "piercing-spike-rampant",
flags = {"not-on-map"},
collision_box = {{-0.05, -0.25}, {0.05, 0.25}},
acceleration = 0.005,
action =
{
type = "direct",
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
2017-04-02 01:40:47 +02:00
action_delivery =
{
type = "instant",
target_effects =
{
type = "damage",
damage = {amount = 8, type = "bob-pierce"}
}
}
},
animation =
{
filename = "__base__/graphics/entity/piercing-bullet/piercing-bullet.png",
frame_count = 1,
width = 3,
height = 50,
priority = "high"
},
}
})
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = "bob-piercing-ball",
2018-02-06 10:01:20 +02:00
pTint = {r=0.1, g=0.1, b=0.1, a=0.8},
sTint = {r=0.1, g=0.1, b=0.1, a=0.8},
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return
{
type = "nested-result",
action = {
type = "cluster",
cluster_count = 10,
distance = 4,
distance_deviation = 3,
action_delivery =
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "projectile",
projectile = "piercing-spike-rampant",
direction_deviation = 0.6,
starting_speed = 1,
starting_speed_deviation = 0.0
2017-04-02 01:40:47 +02:00
}
}
2018-02-06 10:01:20 +02:00
}
end,
radius = 3,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 30, type = "bob-pierce" }
}
}
end
}
)
2017-04-02 01:40:47 +02:00
--
2017-04-02 01:40:47 +02:00
data:extend({
{
type = "projectile",
name = "electric-spike-rampant",
flags = {"not-on-map"},
collision_box = {{-0.03, -0.20}, {0.03, 0.20}},
acceleration = 0.005,
action =
{
type = "direct",
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
2017-04-02 01:40:47 +02:00
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = "laser-bubble"
},
{
type = "damage",
damage = { amount = 8, type = "electric"}
}
}
}
},
light = {intensity = 0.5, size = 10},
animation =
{
filename = "__base__/graphics/entity/laser/laser-to-tint-medium.png",
tint = {r=0.0, g=0.0, b=1.0},
frame_count = 1,
width = 12,
height = 33,
priority = "high",
blend_mode = "additive"
},
speed = 0.15
}
})
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = "bob-electric-ball",
2018-02-06 10:01:20 +02:00
pTint = {r=0, g=0.1, b=1, a=1},
sTint = {r=0, g=0.1, b=1, a=1},
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return
{
type = "nested-result",
action = {
type = "cluster",
cluster_count = 5,
distance = 2,
distance_deviation = 2,
action_delivery =
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "projectile",
projectile = "electric-spike-rampant",
direction_deviation = 0.6,
starting_speed = 0.65,
starting_speed_deviation = 0.0
2017-04-02 01:40:47 +02:00
}
}
2018-02-06 10:01:20 +02:00
}
end,
radius = 3,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 25, type = "electric" }
}
}
end
}
)
2017-04-02 01:40:47 +02:00
--
2017-04-02 01:40:47 +02:00
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = "bob-titan-ball",
2018-02-06 10:01:20 +02:00
pTint = {r=0, g=0.1, b=1, a=1},
sTint = {r=0, g=0.1, b=1, a=1},
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "create-entity",
entity_name = "small-fire-cloud"
},
{
type = "create-entity",
entity_name = "big-explosion"
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end,
radius = 3,
areaEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "damage",
damage = { amount = 10, type = "electric" }
},
{
type = "damage",
damage = { amount = 10, type = "explosion" }
},
{
type = "damage",
damage = { amount = 10, type = "fire" }
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end
}
)
2017-04-02 01:40:47 +02:00
--
2017-04-02 01:40:47 +02:00
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = "bob-behemoth-ball",
2018-02-06 10:01:20 +02:00
pTint = {r=0, g=0.1, b=1, a=1},
sTint = {r=0, g=0.1, b=1, a=1},
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "create-entity",
entity_name = "small-poison-cloud"
},
{
type = "create-entity",
entity_name = "big-explosion"
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end,
radius = 3,
areaEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "damage",
damage = { amount = 15, type = "electric" }
},
{
type = "damage",
damage = { amount = 15, type = "explosion" }
},
{
type = "damage",
damage = { amount = 15, type = "fire" }
},
{
type = "damage",
damage = { amount = 15, type = "poison" }
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end
}
)
2017-04-02 01:40:47 +02:00
--
2017-04-02 01:40:47 +02:00
2018-02-06 10:01:20 +02:00
createAttackBall(
{
name = "bob-leviathan-ball",
2018-02-06 10:01:20 +02:00
pTint = {r=0, g=0.1, b=1, a=1},
sTint = {r=0, g=0.1, b=1, a=1},
softSmokeName = softSmoke,
2018-02-07 09:57:41 +02:00
type = "stream",
2018-02-06 10:01:20 +02:00
pointEffects = function (attributes)
return
{
type = "nested-result",
action =
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "cluster",
cluster_count = 4,
distance = 3,
distance_deviation = 1,
action_delivery ={
type = "instant",
target_effects = {
{
type = "create-entity",
entity_name = "big-explosion",
direction_deviation = 0.6,
starting_speed = 1,
starting_speed_deviation = 0.0
}
}
}
2017-04-02 01:40:47 +02:00
}
}
2018-02-06 10:01:20 +02:00
end,
radius = 3,
areaEffects = function (attributes)
return
{
2017-04-02 01:40:47 +02:00
{
2018-02-06 10:01:20 +02:00
type = "damage",
damage = { amount = 15, type = "electric" }
},
{
type = "damage",
damage = { amount = 15, type = "explosion" }
},
{
type = "damage",
damage = { amount = 15, type = "fire" }
},
{
type = "damage",
damage = { amount = 15, type = "poison" }
},
{
type = "damage",
damage = { amount = 15, type = "bob-pierce" }
},
{
type = "damage",
damage = { amount = 15, type = "acid" }
2017-04-02 01:40:47 +02:00
}
2018-02-06 10:01:20 +02:00
}
end
}
)