Revert "Merging DarkholmeTenk & my branches back to main"
22
.gitattributes
vendored
|
@ -1,22 +0,0 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
*.sln merge=union
|
||||
*.csproj merge=union
|
||||
*.vbproj merge=union
|
||||
*.fsproj merge=union
|
||||
*.dbproj merge=union
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
2
.gitignore
vendored
|
@ -161,3 +161,5 @@ pip-log.txt
|
|||
|
||||
# Mac crap
|
||||
.DS_Store
|
||||
src/cr0s/WarpDrive/client/ClientProxy.java
|
||||
src/cr0s/WarpDrive/client/ClientProxy.java
|
||||
|
|
|
@ -3,8 +3,6 @@ WarpDrive
|
|||
|
||||
A warp drive mod for minecraft
|
||||
|
||||
See mcmod.info for credits
|
||||
|
||||
Minecraft forum:
|
||||
http://www.minecraftforum.net/topic/1938578-164-warpdrive-mod-ships-space-lasers
|
||||
|
||||
|
@ -18,7 +16,7 @@ Installation
|
|||
============
|
||||
1. Download fresh build: http://kubach.tk/1.6.4/WarpDrive.zip
|
||||
2. Download fresh Core build: http://kubach.tk/1.6.4/WarpDriveCore.jar
|
||||
3. Install last version of IC2, Applied Energistics and Computer Craft
|
||||
3. Install last version of IC2 and Computer Craft
|
||||
|
||||
Contact Us
|
||||
=============
|
||||
|
|
|
@ -5,16 +5,18 @@ import cpw.mods.fml.client.FMLClientHandler;
|
|||
import cr0s.WarpDrive.CommonProxy;
|
||||
import cr0s.WarpDrive.FXBeam;
|
||||
import cr0s.WarpDrive.Vector3;
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void registerRenderers() {
|
||||
public void registerRenderers()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy) {
|
||||
// WarpDrive.debugPrint("Rendering beam...");
|
||||
public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy)
|
||||
{
|
||||
System.out.println("Rendering beam...");
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, red, green, blue, age, energy));
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
item.warpdrive.crafting.Malformed.name=Bad Item
|
||||
item.warpdrive.crafting.EmptyCore.name=Empty Core
|
||||
item.warpdrive.crafting.TeleCore.name=Teleportation Core
|
||||
item.warpdrive.crafting.WarpCore.name=Warp Core
|
||||
item.warpdrive.crafting.LaserCore.name=Laser Core
|
||||
item.warpdrive.crafting.ReactorCore.name=Reactor Core
|
||||
item.warpdrive.crafting.InterfaceComputer.name=Computer Interface
|
||||
item.warpdrive.crafting.InterfacePower.name=Power Interface
|
||||
|
||||
tile.warpdrive.blocks.Air.name=Air Block
|
||||
tile.warpdrive.blocks.Gas.name=Gas Block
|
||||
tile.warpdrive.blocks.WarpIsolation.name=Warp-field Isolation Block
|
||||
tile.warpdrive.blocks.IridiumBlock.name=Iridium Block
|
||||
item.warpdrive.items.ReactorLaserFocus.name=Reactor Laser Focus
|
||||
tile.warpdrive.power.Reactor.name=Enantiomorphic Reactor
|
||||
tile.warpdrive.power.Laser.name=Aurbis Reactor Stabilisation Laser
|
||||
tile.warpdrive.machines.WarpCore.name=Warp Drive Core
|
||||
tile.warpdrive.machines.WarpProtocol.name=Warp Drive Controller
|
||||
tile.warpdrive.machines.WarpRadar.name=Warp Radar
|
||||
tile.warpdrive.machines.Laser.name=Laser
|
||||
tile.warpdrive.machines.LaserCamera.name=Laser + Camera
|
||||
tile.warpdrive.machines.LaserTreeFarm.name=Laser Tree Farm
|
||||
tile.warpdrive.machines.CloakingCoil.name=Cloaking Coil
|
||||
tile.warpdrive.machines.Camera.name=Camera
|
||||
tile.warpdrive.machines.CloakingDeviceCore.name=Cloaking Device Core
|
||||
tile.warpdrive.machines.ParticleBooster.name=Laser Particle Booster
|
||||
tile.warpdrive.machines.Monitor.name=Monitor
|
||||
tile.warpdrive.machines.MiningLaser.name=Mining Laser
|
||||
tile.warpdrive.machines.LaserLift.name=Laser Lift
|
||||
tile.warpdrive.machines.Transporter.name=Transporter
|
||||
tile.warpdrive.machines.Scanner.name=Ship Scanner
|
||||
tile.warpdrive.machines.AirGenerator.name=Air Generator
|
||||
tile.warpdrive.machines.LaserReactorMonitor.name=Laser Reactor Monitor
|
|
@ -1,43 +0,0 @@
|
|||
if not term.isColor() then
|
||||
print("Advanced computer required")
|
||||
exit()
|
||||
end
|
||||
|
||||
Side = { "bottom", "top", "back", "left", "right" }
|
||||
for i = 1,5 do
|
||||
if peripheral.getType(Side[i]) == "cloakingdevicecore" then
|
||||
warp = peripheral.wrap(Side[i])
|
||||
break
|
||||
else
|
||||
warp = nil
|
||||
end
|
||||
end
|
||||
|
||||
if warp == nil then
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("No cloak core detected")
|
||||
else
|
||||
warp.setFieldFrequency(1337)
|
||||
warp.setFieldTier(0)
|
||||
warp.enableCloakingField()
|
||||
if warp.isAssemblyValid() then
|
||||
term.setBackgroundColor(colors.lime)
|
||||
term.setTextColor(colors.blue)
|
||||
term.write("Tier 1 cloak enabled")
|
||||
else
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("Invalid assembly!")
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
print()
|
||||
print("In each of the 6 directions, you need to place exactly 2 Cloaking device coils, for a total of 12 coils.")
|
||||
print("The 6 inner coils shall be exactly one block away from the core.")
|
||||
print("The cloaking field will extend 5 blocks past the outer 6 coils.")
|
||||
print("Power consumption scales with the amount of cloaked blocks.")
|
||||
end
|
||||
end
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
print()
|
|
@ -1,43 +0,0 @@
|
|||
if not term.isColor() then
|
||||
print("Advanced computer required")
|
||||
exit()
|
||||
end
|
||||
|
||||
Side = { "bottom", "top", "back", "left", "right" }
|
||||
for i = 1,5 do
|
||||
if peripheral.getType(Side[i]) == "cloakingdevicecore" then
|
||||
warp = peripheral.wrap(Side[i])
|
||||
break
|
||||
else
|
||||
warp = nil
|
||||
end
|
||||
end
|
||||
|
||||
if warp == nil then
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("No cloak core detected")
|
||||
else
|
||||
warp.setFieldFrequency(1337)
|
||||
warp.setFieldTier(2)
|
||||
warp.enableCloakingField()
|
||||
if warp.isAssemblyValid() then
|
||||
term.setBackgroundColor(colors.lime)
|
||||
term.setTextColor(colors.red)
|
||||
term.write("Tier 2 cloak enabled")
|
||||
else
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("Invalid assembly!")
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
print()
|
||||
print("In each of the 6 directions, you need to place exactly 2 Cloaking device coils, for a total of 12 coils.")
|
||||
print("The 6 inner coils shall be exactly one block away from the core.")
|
||||
print("The cloaking field will extend 5 blocks past the outer 6 coils.")
|
||||
print("Power consumption scales with the amount of cloaked blocks.")
|
||||
end
|
||||
end
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
print()
|
|
@ -1,28 +0,0 @@
|
|||
if not term.isColor() then
|
||||
print("Advanced computer required")
|
||||
exit()
|
||||
end
|
||||
|
||||
Side = { "bottom", "top", "back", "left", "right" }
|
||||
for i = 1,5 do
|
||||
if peripheral.getType(Side[i]) == "cloakingdevicecore" then
|
||||
warp = peripheral.wrap(Side[i])
|
||||
break
|
||||
else
|
||||
warp = nil
|
||||
end
|
||||
end
|
||||
|
||||
if warp == nil then
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("No cloak core detected")
|
||||
else
|
||||
warp.disableCloakingField()
|
||||
term.setBackgroundColor(colors.lightGray)
|
||||
term.setTextColor(colors.black)
|
||||
term.write("Cloak disabled")
|
||||
end
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
print()
|
|
@ -1,119 +0,0 @@
|
|||
if not term.isColor() then
|
||||
print("Advanced computer required")
|
||||
exit()
|
||||
end
|
||||
|
||||
sides = peripheral.getNames()
|
||||
mininglasers = {}
|
||||
for key,side in pairs(sides) do
|
||||
if peripheral.getType(side) == "mininglaser" then
|
||||
print("Wrapping " .. side)
|
||||
table.insert(mininglasers, peripheral.wrap(side))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
noExit = true
|
||||
layerOffset = 1
|
||||
mineAll = true
|
||||
useDeuterium = false
|
||||
args = {...}
|
||||
if #args > 0 then
|
||||
if args[1] == "help" or args[1] == "?" then
|
||||
print("Usage: mine <layerOffset> <oreOnly> <useDeuterium>")
|
||||
print()
|
||||
print("Miner always mine below it, down to bedrock.")
|
||||
print("Set layerOffset to define starting level.")
|
||||
print("Power consumption will be much lower in space.")
|
||||
print("Mining only ores is faster but more expensive...")
|
||||
print("Use deuterium from ME system for silk touch.")
|
||||
print("Mining laser can't go through forcefields.")
|
||||
print("Mined chests will drop their contents.")
|
||||
print()
|
||||
noExit = false
|
||||
else
|
||||
layerOffset = tonumber( args[1] ) or 1
|
||||
end
|
||||
|
||||
if #args > 1 then
|
||||
if args[2] == "false" or args[2] == "0" then
|
||||
mineAll = false
|
||||
end
|
||||
end
|
||||
|
||||
if #args > 2 then
|
||||
if args[3] == "true" or args[3] == "1" then
|
||||
useDeuterium = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if #mininglasers == 0 then
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("No mining laser detected")
|
||||
|
||||
noExit = false
|
||||
end
|
||||
if noExit then
|
||||
for key,mininglaser in pairs(mininglasers) do
|
||||
if not mininglaser.isMining() then
|
||||
mininglaser.offset(layerOffset)
|
||||
if mineAll then
|
||||
if useDeuterium then
|
||||
mininglaser.quarry(useDeuterium)
|
||||
else
|
||||
mininglaser.quarry()
|
||||
end
|
||||
else
|
||||
if useDeuterium then
|
||||
mininglaser.mine(useDeuterium)
|
||||
else
|
||||
mininglaser.mine()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
sleep(1)
|
||||
end
|
||||
|
||||
label = os.getComputerLabel()
|
||||
if label then
|
||||
else
|
||||
label = "" .. os.getComputerID()
|
||||
end
|
||||
|
||||
term.setTextColor(colors.blue)
|
||||
if noExit then
|
||||
repeat
|
||||
isMining = false
|
||||
for key,mininglaser in pairs(mininglasers) do
|
||||
status, energy, currentLayer, mined, total = mininglaser.state()
|
||||
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.clear()
|
||||
term.setBackgroundColor(colors.lime)
|
||||
term.setCursorPos(1, 1)
|
||||
term.write(label .. " - Mining laser " .. key .. " of " .. #mininglasers)
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setCursorPos(1, 3)
|
||||
term.write("Status: " .. status .. " ")
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setCursorPos(1, 5)
|
||||
term.write("Energy level is " .. energy .. " EU")
|
||||
term.setCursorPos(1, 7)
|
||||
term.write("Mined " .. mined .. " out of " .. total .. " blocks at layer " .. currentLayer .. " ")
|
||||
|
||||
if mininglaser.isMining() then
|
||||
sleep(1)
|
||||
isMining = true
|
||||
else
|
||||
sleep(0.1)
|
||||
end
|
||||
end
|
||||
until not isMining
|
||||
end
|
||||
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
print()
|
|
@ -1,48 +0,0 @@
|
|||
if not term.isColor() then
|
||||
print("Advanced computer required")
|
||||
exit()
|
||||
end
|
||||
|
||||
sides = peripheral.getNames()
|
||||
mininglasers = {}
|
||||
for key,side in pairs(sides) do
|
||||
if peripheral.getType(side) == "mininglaser" then
|
||||
print("Wrapping " .. side)
|
||||
table.insert(mininglasers, peripheral.wrap(side))
|
||||
end
|
||||
end
|
||||
|
||||
label = os.getComputerLabel()
|
||||
if label then
|
||||
else
|
||||
label = "" .. os.getComputerID()
|
||||
end
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.clear()
|
||||
term.setBackgroundColor(colors.lime)
|
||||
term.setCursorPos(1, 1)
|
||||
term.write(label)
|
||||
|
||||
if #mininglasers == 0 then
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("No mining laser detected")
|
||||
else
|
||||
for key,mininglaser in pairs(mininglasers) do
|
||||
term.setCursorPos(1, 2 + key)
|
||||
if not mininglaser.isMining() then
|
||||
term.setBackgroundColor(colors.red)
|
||||
term.setTextColor(colors.white)
|
||||
term.write("Mining laser " .. key .. " of " .. #mininglasers .. " is already stopped")
|
||||
else
|
||||
mininglaser.stop()
|
||||
term.setBackgroundColor(colors.lime)
|
||||
term.setTextColor(colors.blue)
|
||||
term.write("Mining laser " .. key .. " of " .. #mininglasers .. " has been stopped")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
print()
|
|
@ -1,42 +0,0 @@
|
|||
side = "bottom"
|
||||
|
||||
local argv = { ... }
|
||||
if #argv ~= 1 then
|
||||
print("Usage: scan <radius>")
|
||||
return
|
||||
end
|
||||
|
||||
local radius = tonumber(argv[1])
|
||||
|
||||
if radius < 1 or radius > 9999 then
|
||||
print("Radius must be between 1 and 9999")
|
||||
return
|
||||
end
|
||||
|
||||
radar = peripheral.wrap(side)
|
||||
|
||||
if radar.getEnergyLevel() < radius * radius then
|
||||
print("Low energy level. Sasaj")
|
||||
return
|
||||
end
|
||||
radar.scanRadius(radius)
|
||||
sleep(2)
|
||||
|
||||
print("Scanning...")
|
||||
|
||||
local seconds = 2
|
||||
repeat
|
||||
local count = radar.getResultsCount()
|
||||
sleep(1)
|
||||
seconds = seconds + 1
|
||||
until count ~= nil or seconds > 10
|
||||
print("took "..seconds.." seconds")
|
||||
|
||||
if count ~= nil then
|
||||
for i=0, count-1 do
|
||||
freq, x, y, z = radar.getResult(i)
|
||||
print("Shit: "..freq.." ("..x.. " " .. y .. " " .. z .. ")")
|
||||
end
|
||||
else
|
||||
print("Nothing is found =(")
|
||||
end
|
|
@ -1,101 +0,0 @@
|
|||
radar = peripheral.wrap("bottom")
|
||||
radius = 500
|
||||
scale = 50
|
||||
|
||||
w, h = term.getSize()
|
||||
|
||||
term.clear()
|
||||
|
||||
function colorScreen(color)
|
||||
for a = 2,w-1 do
|
||||
for b = 1,h do
|
||||
paintutils.drawPixel(a,b,color)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function textOut(x, y, text, fg, bg)
|
||||
term.setCursorPos(x, y)
|
||||
term.setTextColor(fg)
|
||||
term.setBackgroundColor(bg)
|
||||
term.write(text)
|
||||
local xt,yt = term.getCursorPos()
|
||||
term.setCursorPos(1, yt + 1)
|
||||
end
|
||||
|
||||
function translateXZ(oldX, oldZ, i)
|
||||
local x = radarX - oldX
|
||||
local z = radarZ - oldZ
|
||||
|
||||
x = x / (radius / scale)
|
||||
z = z / (radius / scale)
|
||||
|
||||
x = x + (w / 2)
|
||||
z = z + (h / 2)
|
||||
|
||||
|
||||
x = math.floor(x);
|
||||
z = math.floor(z);
|
||||
|
||||
return x,z
|
||||
end
|
||||
|
||||
function drawContact(x, y, z, name, color)
|
||||
local newX, newZ = translateXZ(x, z)
|
||||
|
||||
paintutils.drawPixel(newX, newZ, color)
|
||||
textOut(newX - 3, newZ + 1, "[" .. name .. "]", colors.white, colors.black)
|
||||
end
|
||||
|
||||
function scanAndDraw()
|
||||
if (radar.getEnergyLevel() < radius*radius) then
|
||||
hh = math.floor(h / 2);
|
||||
hw = math.floor(w / 2);
|
||||
|
||||
paintutils.drawLine(hw - 5, hh - 1, hw + 5, hh - 1, colors.red);
|
||||
paintutils.drawLine(hw - 5, hh, hw + 5, hh, colors.red);
|
||||
textOut(hw - 4, hh,"LOW POWER", colors.white, colors.red);
|
||||
paintutils.drawLine(hw - 5, hh + 1, hw + 5, hh + 1, colors.red);
|
||||
sleep(1);
|
||||
|
||||
return 0;
|
||||
end;
|
||||
radar.scanRadius(radius);
|
||||
sleep(2);
|
||||
|
||||
redraw();
|
||||
|
||||
numResults = radar.getResultsCount();
|
||||
|
||||
if (numResults ~= 0) then
|
||||
for i = 0, numResults-1 do
|
||||
freq, cx, cy, cz = radar.getResult(i);
|
||||
|
||||
drawContact(cx, cy, cz, freq, colors.red)
|
||||
end
|
||||
end
|
||||
|
||||
drawContact(radarX, radarY, radarZ, "RAD", colors.yellow);
|
||||
end
|
||||
|
||||
function redraw()
|
||||
--shell.run("clear")
|
||||
colorScreen(colors.green)
|
||||
|
||||
paintutils.drawLine(1, 1, w, 1, colors.black)
|
||||
|
||||
textOut(h, 1, "= Q-Radar v0.1 =", colors.white, colors.black)
|
||||
|
||||
textOut(w - 3, 1, "[X]", colors.white, colors.red)
|
||||
|
||||
paintutils.drawLine(1, h, w, h, colors.black);
|
||||
textOut(4, h, "Energy: " .. radar.getEnergyLevel() .. " Eu | Scan radius: " .. radius, colors.white, colors.black)
|
||||
end
|
||||
|
||||
mrun = true
|
||||
while (mrun) do
|
||||
radarX, radarY, radarZ = radar.pos();
|
||||
scanAndDraw();
|
||||
end
|
||||
|
||||
term.clear();
|
|
@ -1,483 +0,0 @@
|
|||
if not term.isColor() then
|
||||
print("Advanced computer required")
|
||||
exit()
|
||||
end
|
||||
print("loading...")
|
||||
|
||||
-- set alarm side if you need this
|
||||
Alarm = "top"
|
||||
|
||||
Style = {
|
||||
CDeflt = colors.white,
|
||||
BGDeflt = colors.blue,
|
||||
CTitle = colors.black,
|
||||
BGTitle = colors.cyan,
|
||||
CWarn = colors.white,
|
||||
BGWarn = colors.red
|
||||
}
|
||||
|
||||
function SetColorDeflt()
|
||||
term.setBackgroundColor(Style.BGDeflt)
|
||||
term.setTextColor(Style.CDeflt)
|
||||
end
|
||||
|
||||
function SetColorTitle()
|
||||
term.setBackgroundColor(Style.BGTitle)
|
||||
term.setTextColor(Style.CTitle)
|
||||
end
|
||||
|
||||
function SetColorWarn()
|
||||
term.setBackgroundColor(Style.BGWarn)
|
||||
term.setTextColor(Style.CWarn)
|
||||
end
|
||||
|
||||
function Clear()
|
||||
term.clear()
|
||||
term.setCursorPos(1,1)
|
||||
end
|
||||
|
||||
function Show(Text)
|
||||
term.write(Text)
|
||||
local xt,yt = term.getCursorPos()
|
||||
term.setCursorPos(1, yt+1)
|
||||
end
|
||||
|
||||
function ShowTitle(Text)
|
||||
SetColorTitle()
|
||||
term.setCursorPos(12, 1)
|
||||
Show(Text)
|
||||
SetColorDeflt()
|
||||
end
|
||||
|
||||
function ShowMenu(Text)
|
||||
term.write(Text)
|
||||
local xt, yt = term.getCursorPos()
|
||||
for i = xt, 51 do
|
||||
term.write(" ")
|
||||
end
|
||||
term.setCursorPos(1, yt+1)
|
||||
end
|
||||
|
||||
function ShowWarning(Text)
|
||||
SetColorWarn()
|
||||
term.setCursorPos(10, 19)
|
||||
term.write(" "..Text.." ")
|
||||
SetColorDeflt()
|
||||
end
|
||||
|
||||
function SaveData()
|
||||
local file = fs.open("shipdata.txt", "w")
|
||||
file.writeLine(textutils.serialize(SData))
|
||||
file.close()
|
||||
end
|
||||
|
||||
function ReadData()
|
||||
local file = fs.open("shipdata.txt", "r")
|
||||
SData = textutils.unserialize(file.readAll())
|
||||
file.close()
|
||||
end
|
||||
|
||||
function Explode(d, p)
|
||||
local t, ll
|
||||
t = {}
|
||||
ll = 0
|
||||
if(#p == 1) then return {p} end
|
||||
while true do
|
||||
l = string.find(p ,d, ll, true)
|
||||
if l ~= nil then
|
||||
table.insert(t, string.sub(p, ll, l-1))
|
||||
ll = l+1
|
||||
else
|
||||
table.insert(t, string.sub(p, ll))
|
||||
break
|
||||
end
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
function ShowDirection()
|
||||
if SData.Direction == 1 then
|
||||
Show(" Direction = Up")
|
||||
elseif SData.Direction == 2 then
|
||||
Show(" Direction = Down")
|
||||
elseif SData.Direction == 0 then
|
||||
Show(" Direction = Front")
|
||||
elseif SData.Direction == 180 then
|
||||
Show(" Direction = Back")
|
||||
elseif SData.Direction == 90 then
|
||||
Show(" Direction = Left")
|
||||
elseif SData.Direction == 255 then
|
||||
Show(" Direction = Right")
|
||||
end
|
||||
end
|
||||
|
||||
function CalcRealDistance()
|
||||
if IsInHyper then
|
||||
RealDistance = SData.Distance * 100
|
||||
MinimumDistance = 1
|
||||
JumpCost = (1000 * Weight) + (1000 * SData.Distance)
|
||||
else
|
||||
if SData.Direction == 1 or SData.Direction == 2 then
|
||||
MinimumDistance = GUp + GDown
|
||||
RealDistance = SData.Distance + MinimumDistance
|
||||
elseif SData.Direction == 0 or SData.Direction == 180 then
|
||||
MinimumDistance = GFront + GBack
|
||||
RealDistance = SData.Distance + MinimumDistance
|
||||
elseif SData.Direction == 90 or SData.Direction == 255 then
|
||||
MinimumDistance = GLeft + GRight
|
||||
RealDistance = SData.Distance + MinimumDistance
|
||||
end
|
||||
MinimumDistance = MinimumDistance + 1
|
||||
JumpCost = (10 * Weight) + (100 * SData.Distance)
|
||||
end
|
||||
end
|
||||
|
||||
function CalcNewCoords(cx, cy, cz)
|
||||
local res = {x=cx, y=cy, z=cz}
|
||||
if SData.Direction == 1 then
|
||||
res.y = res.y + RealDistance
|
||||
elseif SData.Direction == 2 then
|
||||
res.y = res.y - RealDistance
|
||||
end
|
||||
local dx = warp.get_dx()
|
||||
local dz = warp.get_dz()
|
||||
if dx ~= 0 then
|
||||
if SData.Direction == 0 then
|
||||
res.x = res.x + (RealDistance * dx)
|
||||
elseif SData.Direction == 180 then
|
||||
res.x = res.x - (RealDistance * dx)
|
||||
elseif SData.Direction == 90 then
|
||||
res.z = res.z + (RealDistance * dx)
|
||||
elseif SData.Direction == 255 then
|
||||
res.z = res.z - (RealDistance * dx)
|
||||
end
|
||||
else
|
||||
if SData.Direction == 0 then
|
||||
res.z = res.z + (RealDistance * dz)
|
||||
elseif SData.Direction == 180 then
|
||||
res.z = res.z - (RealDistance * dz)
|
||||
elseif SData.Direction == 90 then
|
||||
res.x = res.x + (RealDistance * dz)
|
||||
elseif SData.Direction == 255 then
|
||||
res.x = res.x - (RealDistance * dz)
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
function ShowInfo()
|
||||
ShowTitle(Title)
|
||||
Show("Core:")
|
||||
Show(" x, y, z = "..X..", "..Y..", "..Z)
|
||||
local energy = warp.get_energy_level()
|
||||
Show(" Energy = "..math.floor(energy / 1000000).." % ("..energy.."EU)")
|
||||
Show(" Attached players = "..warp.get_attached_players())
|
||||
Show("Dimensions:")
|
||||
Show(" Front, Right, Up = "..GFront..", "..GRight..", "..GUp)
|
||||
Show(" Back, Left, Down = "..GBack..", "..GLeft..", "..GDown)
|
||||
Show(" Size = "..Weight.." blocks")
|
||||
Show("Warp data:")
|
||||
ShowDirection()
|
||||
local dest = CalcNewCoords(X, Y, Z)
|
||||
Show(" Distance = "..RealDistance.." ("..JumpCost.."EU, "..math.floor(energy/JumpCost).." jumps)")
|
||||
Show(" Dest.coordinates = "..dest.x..", "..dest.y..", "..dest.z)
|
||||
if SData.Summon then
|
||||
Show(" Summon after = Yes")
|
||||
else
|
||||
Show(" Summon after = No")
|
||||
end
|
||||
end
|
||||
|
||||
function Confirm()
|
||||
ShowWarning("Are you sure? (y/n)")
|
||||
local event, keycode = os.pullEvent("key")
|
||||
if keycode == 21 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function Warp()
|
||||
rs.setOutput(Alarm, false)
|
||||
sleep(1)
|
||||
warp.set_direction(SData.Direction)
|
||||
if IsInHyper then
|
||||
warp.set_mode(2)
|
||||
else
|
||||
warp.set_mode(1)
|
||||
end
|
||||
warp.do_jump()
|
||||
end
|
||||
|
||||
function SetDistance()
|
||||
Clear()
|
||||
ShowTitle("<==== Set distance ====>")
|
||||
SData.Distance = 0
|
||||
CalcRealDistance()
|
||||
MaximumDistance = MinimumDistance + 127
|
||||
if IsInHyper then
|
||||
term.write("Distance * 100 (min "..MinimumDistance..", max "..MaximumDistance.."): ")
|
||||
else
|
||||
term.write("Distance (min "..MinimumDistance..", max "..MaximumDistance.."): ")
|
||||
end
|
||||
sleep(0.3)
|
||||
SData.Distance = tonumber(read())
|
||||
if SData.Distance == nil then SData.Distance = 1 end
|
||||
if SData.Distance < MinimumDistance or SData.Distance > MaximumDistance then
|
||||
SData.Distance = 1
|
||||
ShowWarning("Wrong distance. Try again.")
|
||||
os.pullEvent("key")
|
||||
CalcRealDistance()
|
||||
else
|
||||
if not IsInHyper then
|
||||
SData.Distance = SData.Distance - RealDistance
|
||||
end
|
||||
warp.set_distance(SData.Distance)
|
||||
CalcRealDistance()
|
||||
end
|
||||
end
|
||||
|
||||
function SetDirection()
|
||||
local drun = true
|
||||
while(drun) do
|
||||
Clear()
|
||||
ShowTitle("<==== Set direction ====>")
|
||||
ShowDirection()
|
||||
term.setCursorPos(1, 16)
|
||||
SetColorTitle()
|
||||
ShowMenu("Use directional keys")
|
||||
ShowMenu("W/S keys for Up/Down")
|
||||
ShowMenu("Enter - confirm")
|
||||
SetColorDeflt()
|
||||
local event, keycode = os.pullEvent("key")
|
||||
if keycode == 200 then
|
||||
SData.Direction = 0
|
||||
elseif keycode == 17 then
|
||||
SData.Direction = 1
|
||||
elseif keycode == 203 then
|
||||
SData.Direction = 90
|
||||
elseif keycode == 205 then
|
||||
SData.Direction = 255
|
||||
elseif keycode == 208 then
|
||||
SData.Direction = 180
|
||||
elseif keycode == 31 then
|
||||
SData.Direction = 2
|
||||
elseif keycode == 28 then
|
||||
drun = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SetDimensions()
|
||||
Clear()
|
||||
sleep(0.3)
|
||||
ShowTitle("<==== Set dimensions ====>")
|
||||
term.write(" Front ("..GFront..") : ")
|
||||
GFront = tonumber(read())
|
||||
term.write(" Right ("..GRight..") : ")
|
||||
GRight = tonumber(read())
|
||||
term.write(" Up ("..GUp..") : ")
|
||||
GUp = tonumber(read())
|
||||
term.write(" Back ("..GBack..") : ")
|
||||
GBack = tonumber(read())
|
||||
term.write(" Left ("..GLeft..") : ")
|
||||
GLeft = tonumber(read())
|
||||
term.write(" Down ("..GDown..") : ")
|
||||
GDown = tonumber(read())
|
||||
term.write("Setting dimensions...")
|
||||
warp.dim_setp(GFront, GRight, GUp)
|
||||
warp.dim_setn(GBack, GLeft, GDown)
|
||||
Weight = warp.get_ship_size()
|
||||
end
|
||||
|
||||
function Summon()
|
||||
Clear()
|
||||
ShowTitle("<==== Summon players ====>")
|
||||
local players = Explode(",", warp.get_attached_players())
|
||||
for i = 1, #players do
|
||||
Show(i..". "..players[i])
|
||||
end
|
||||
SetColorTitle()
|
||||
ShowMenu("Enter player number")
|
||||
ShowMenu("or press enter to summon everyone")
|
||||
SetColorDeflt()
|
||||
sleep(0.3)
|
||||
term.write(":")
|
||||
local input = read()
|
||||
if input == "" then
|
||||
warp.summon_all()
|
||||
else
|
||||
input = tonumber(input)
|
||||
warp.summon(input - 1)
|
||||
end
|
||||
end
|
||||
|
||||
function JumpToBeacon()
|
||||
Clear()
|
||||
ShowTitle("<==== Jump to beacon ====>")
|
||||
sleep(0.3)
|
||||
term.write("Enter beacon frequency: ")
|
||||
local freq = tostring(read())
|
||||
rs.setOutput(Alarm, true)
|
||||
if Confirm() then
|
||||
rs.setOutput(Alarm, false)
|
||||
warp.set_mode(4)
|
||||
warp.set_beacon_frequency(freq)
|
||||
warp.do_jump()
|
||||
end
|
||||
rs.setOutput(Alarm, false)
|
||||
end
|
||||
|
||||
function JumpToGate()
|
||||
Clear()
|
||||
ShowTitle("<==== Jump to JumpGate ====>")
|
||||
sleep(0.3)
|
||||
term.write("Enter jumpgate name: ")
|
||||
local name = tostring(read())
|
||||
rs.setOutput(Alarm, true)
|
||||
if Confirm() then
|
||||
rs.setOutput(Alarm, false)
|
||||
warp.set_mode(6)
|
||||
warp.set_target_jumpgate(name)
|
||||
warp.do_jump()
|
||||
end
|
||||
rs.setOutput(Alarm, false)
|
||||
end
|
||||
|
||||
function SetShipName()
|
||||
Clear()
|
||||
ShowTitle("<==== Set ship name ====>")
|
||||
sleep(0.3)
|
||||
term.write("Enter ship name: ")
|
||||
SData.Shipname = tostring(read())
|
||||
os.setComputerLabel(SData.Shipname)
|
||||
warp.set_core_frequency(SData.Shipname)
|
||||
SaveData()
|
||||
os.reboot()
|
||||
end
|
||||
|
||||
if fs.exists("shipdata.txt") then
|
||||
ReadData()
|
||||
else
|
||||
SData = {
|
||||
Summon = false,
|
||||
Distance = 1,
|
||||
Direction = 0,
|
||||
Shipname = ""
|
||||
}
|
||||
end
|
||||
|
||||
SetColorDeflt()
|
||||
|
||||
Side = { "bottom", "top", "back", "left", "right" }
|
||||
for i = 1,5 do
|
||||
if peripheral.getType(Side[i]) == "warpcore" then
|
||||
warp = peripheral.wrap(Side[i])
|
||||
break
|
||||
else
|
||||
warp = nil
|
||||
end
|
||||
end
|
||||
|
||||
if warp == nil then
|
||||
ShowWarning("No warpcore controller detected")
|
||||
os.pullEvent("key")
|
||||
os.reboot()
|
||||
end
|
||||
|
||||
if SData.Shipname == "" then
|
||||
SetShipName()
|
||||
end
|
||||
|
||||
Title = "<JumpShip \""..SData.Shipname.."\">"
|
||||
|
||||
if SData.Summon then
|
||||
warp.summon_all()
|
||||
end
|
||||
|
||||
GFront, GRight, GUp = warp.dim_getp()
|
||||
GBack, GLeft, GDown = warp.dim_getn()
|
||||
IsInHyper = warp.is_in_hyperspace()
|
||||
repeat
|
||||
X = warp.get_x()
|
||||
sleep(0.3)
|
||||
until X ~= nil
|
||||
Y = warp.get_y()
|
||||
Z = warp.get_z()
|
||||
repeat
|
||||
isAttached = warp.isAttached()
|
||||
sleep(0.3)
|
||||
until isAttached ~= false
|
||||
|
||||
repeat
|
||||
Weight = warp.get_ship_size()
|
||||
sleep(0.3)
|
||||
until Weight ~= nil
|
||||
|
||||
CalcRealDistance()
|
||||
|
||||
warp.set_mode(1)
|
||||
|
||||
mainloop = true
|
||||
while(mainloop) do
|
||||
Clear()
|
||||
ShowInfo()
|
||||
term.setCursorPos(1, 15)
|
||||
SetColorTitle()
|
||||
ShowMenu("D - Dimensions, M - Toggle summon, N - Ship name")
|
||||
ShowMenu("S - Set Warp Data, J - Jump, G - Jump to JumpGate")
|
||||
ShowMenu("B - Jump to Beacon, H - Jump to Hyperspace")
|
||||
ShowMenu("C - Summon crew, X - Shutdown WarpCore and Exit")
|
||||
SetColorDeflt()
|
||||
local event, keycode = os.pullEvent("key")
|
||||
if keycode == 31 then
|
||||
SetDirection()
|
||||
SetDistance()
|
||||
SaveData()
|
||||
elseif keycode == 50 then
|
||||
if SData.Summon then
|
||||
SData.Summon = false
|
||||
else
|
||||
SData.Summon = true
|
||||
end
|
||||
SaveData()
|
||||
elseif keycode == 32 then
|
||||
SetDimensions()
|
||||
SaveData()
|
||||
elseif keycode == 36 then
|
||||
rs.setOutput(Alarm, true)
|
||||
if Confirm() then
|
||||
Warp()
|
||||
end
|
||||
rs.setOutput(Alarm, false)
|
||||
elseif keycode == 46 then
|
||||
Summon()
|
||||
elseif keycode == 48 then
|
||||
JumpToBeacon()
|
||||
elseif keycode == 34 then
|
||||
JumpToGate()
|
||||
elseif keycode == 35 then
|
||||
rs.setOutput(Alarm, true)
|
||||
if Confirm() then
|
||||
rs.setOutput(Alarm, false)
|
||||
warp.set_mode(5)
|
||||
warp.do_jump()
|
||||
end
|
||||
rs.setOutput(Alarm, false)
|
||||
elseif keycode == 45 then
|
||||
mainloop = false
|
||||
elseif keycode == 49 then
|
||||
SetShipName()
|
||||
end
|
||||
end
|
||||
|
||||
if SData.Summon then
|
||||
SData.Summon = false
|
||||
SaveData()
|
||||
end
|
||||
Clear()
|
||||
print("wish you good")
|
||||
warp.set_mode(0)
|
||||
sleep(0.5)
|
||||
os.shutdown()
|
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
BIN
src/assets/warpdrive/textures/blocks/airgenTopActive.png
Normal file
After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 734 B |
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"animation": {
|
||||
"frametime": 4
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 1.2 KiB |
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"animation": {
|
||||
}
|
||||
}
|
BIN
src/assets/warpdrive/textures/blocks/energy.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
src/assets/warpdrive/textures/blocks/energy_green.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/warpdrive/textures/blocks/energy_orange.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
src/assets/warpdrive/textures/blocks/energy_red.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/warpdrive/textures/blocks/energy_sy.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/warpdrive/textures/blocks/energy_violet.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/warpdrive/textures/blocks/energy_yellow.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/warpdrive/textures/blocks/miningLaserSide0.png
Normal file
After Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 441 B |
Before Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 446 B |
Before Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 4.9 KiB |
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"animation": {
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1 +0,0 @@
|
|||
{ "animation": { "frames": [0,1,2,3,2,1] } }
|
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 2.8 KiB |