mirror of
https://github.com/pandorabox-io/spacecannon.git
synced 2024-12-30 01:27:29 +01:00
8450e4ac70
fixes #10 |
||
---|---|---|
.github/workflows | ||
sounds | ||
textures | ||
.luacheckrc | ||
cannon.lua | ||
digiline.lua | ||
init.lua | ||
mod.conf | ||
node_resilience.lua | ||
readme.md | ||
screenshot_1.png | ||
screenshot_2.png | ||
screenshot_3.png | ||
util.lua |
Spacecannon mod
Overview
Adds three scifi/space cannons with various projectile-speed and explosion-strength.
The cannons need HV-Power from a technic
network and can be controlled via formspec/hand, mesecons or digilines.
They also need to charge first, which can take a couple of seconds depending on cannon-type.
The projectile detonates on impact but only in non-protected areas!
Screenshots
Dependencies
Depends on:
technic
Supports:
mesecons
digilines
Mesecons
An "on" signal triggers a fire-action.
Digilines
Fire a cannon:
if event.type == "program" then
digiline_send("cannon", { command="fire" })
end
Example response from a "get" request:
{
type = "digiline",
channel = "c7",
msg = {
HV_EU_input = 0,
HV_EU_demand = 0,
dir = {
y = 0,
x = 0,
z = 1
},
powerstorage = 10000,
ready = true,
origin = "c7",
name = "spacecannon:cannon_green",
pos = {
y = 10,
x = -64,
z = -53
}
}
}
Example response from a "fire" request:
{
type = "digiline",
channel = "c2",
msg = {
pos = {
y = 10,
x = -59,
z = -53
},
origin = "c2",
success = true
}
}
Api
Modify the ability to shoot depending on position or playername:
spacecannon.can_shoot = function(pos, playername)
return true
end
Contributors
- @BuckarooBanzay
- @dennisjenkins75
License
Code: MIT Textures: CC-BY-SA 3.0
Attributions
- sounds/spacecannon_shoot.ogg https://freesound.org/people/jonccox/sounds/175261/