M src/objects/RadioObject.lua => src/objects/RadioObject.lua +8 -0
@@ 32,6 32,14 @@ function RadioObject:get_power_usage()
return self.power_usage
end
+function RadioObject:get_object_type()
+ return self.object_type
+end
+
+function RadioObject:get_tonnage()
+ return 0.002
+end
+
function RadioObject:update(game_state, dt)
end
M src/objects/hull/EMFieldObject.lua => src/objects/hull/EMFieldObject.lua +12 -1
@@ 3,9 3,12 @@ EMFieldObject.__index = EMFieldObject
local constants = require("src/Constants")
+local ObjectType = require("src/objects/ObjectType")
+
function EMFieldObject:init(initial_state)
local this = {
power_usage = 15,
+ object_type = ObjectType.BASE
}
setmetatable(this, self)
@@ 13,11 16,19 @@ function EMFieldObject:init(initial_state)
end
function EMFieldObject:get_name()
- return "EM FIELD"
+ return "EM FIELD GEN"
end
function EMFieldObject:get_power_usage()
return self.power_usage
end
+function EMFieldObject:get_tonnage()
+ return 0.8
+end
+
+function EMFieldObject:get_object_type()
+ return self.object_type
+end
+
return EMFieldObject
M src/objects/hull/HullObject.lua => src/objects/hull/HullObject.lua +6 -0
@@ 43,6 43,12 @@ function HullObject:init(initial_state)
}
table.insert(this.powered_on, this.radio)
+ table.insert(this.cargo, this.radio)
+ for i in pairs(this.powered_on) do
+ local item = this.powered_on[i]
+ table.insert(this.cargo, item)
+ end
+
return this
end
M src/objects/hull/LatticeCommunicationsArray.lua => src/objects/hull/LatticeCommunicationsArray.lua +10 -0
@@ 2,10 2,12 @@ local LatticeCommunicationsArrayObject = {}
LatticeCommunicationsArrayObject.__index = LatticeCommunicationsArrayObject
local constants = require("src/Constants")
+local ObjectType = require("src/objects/ObjectType")
function LatticeCommunicationsArrayObject:init(initial_state)
local this = {
power_usage = 10,
+ object_type = ObjectType.BASE
}
setmetatable(this, self)
@@ 20,4 22,12 @@ function LatticeCommunicationsArrayObject:get_power_usage()
return self.power_usage
end
+function LatticeCommunicationsArrayObject:get_tonnage()
+ return 0.8
+end
+
+function LatticeCommunicationsArrayObject:get_object_type()
+ return self.object_type
+end
+
return LatticeCommunicationsArrayObject
M src/objects/hull/SleeperObject.lua => src/objects/hull/SleeperObject.lua +10 -0
@@ 2,10 2,12 @@ local SleeperObject = {}
SleeperObject.__index = SleeperObject
local constants = require("src/Constants")
+local ObjectType = require("src/objects/ObjectType")
function SleeperObject:init(initial_state)
local this = {
power_usage = 10,
+ object_type = ObjectType.BASE
}
setmetatable(this, self)
@@ 20,4 22,12 @@ function SleeperObject:get_power_usage()
return self.power_usage
end
+function SleeperObject:get_tonnage()
+ return 5
+end
+
+function SleeperObject:get_object_type()
+ return self.object_type
+end
+
return SleeperObject