Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TOOL.Category = "Mineral Mining";
- TOOL.Name = "Mining Storage";
- TOOL.DeviceName = "Mining Storage Device"
- TOOL.DeviceNamePlural = "Mining Storage Devices"
- TOOL.ClassName = "mining_storage_tool"
- TOOL.DevSelect = true
- TOOL.CCVar_type = "storage_ore"
- TOOL.CCVar_sub_type = "ore_storage"
- TOOL.CCVar_model = "models/mandrac/ore_container/ore_large.mdl"
- TOOL.Limited = true
- TOOL.LimitName = "mining_storage_limit"
- TOOL.Limit = 30
- CAFToolSetup.SetLang("Mining Storage Devices","Create Mining Storage Devices attached to any surface.","Left-Click: Spawn a Mining Storage Device.")
- if (CLIENT and GetConVarNumber("CAF_UseTab") == 1) then TOOL.Tab = "Custom Addon Framework" end
- function TOOL.EnableFunc()
- if not CAF then
- return false;
- end
- if not CAF.GetAddon("Resource Distribution") or not CAF.GetAddon("Resource Distribution").GetStatus() then
- return false;
- end
- return true;
- end
- TOOL.ExtraCCVars = {
- }
- function TOOL.ExtraCCVarsCP( tool, panel )
- end
- function TOOL:GetExtraCCVars()
- local Extra_Data = {}
- return Extra_Data
- end
- local function ore_func(ent,type,sub_type,devinfo,Extra_Data,ent_extras)
- local volume_mul = 1
- local base_volume = 600
- local base_mass = 5
- local base_health = 200
- local phys = ent:GetPhysicsObject()
- if phys:IsValid() and phys.GetVolume then
- local vol = phys:GetVolume()
- vol = math.Round(vol)
- volume_mul = vol/base_volume
- end
- CAF.GetAddon("Resource Distribution").AddResource(ent, "Ore", math.Round(3600 * volume_mul))
- ent.MAXRESOURCE = math.Round(3600 * volume_mul)
- local mass = math.Round(base_mass * volume_mul)
- ent.mass = mass
- local maxhealth = math.Round(base_health * volume_mul)
- return mass, maxhealth
- end
- local function crystal_func(ent,type,sub_type,devinfo,Extra_Data,ent_extras)
- local volume_mul = 1
- local base_volume = 600
- local base_mass = 5
- local base_health = 200
- local phys = ent:GetPhysicsObject()
- if phys:IsValid() and phys.GetVolume then
- local vol = phys:GetVolume()
- vol = math.Round(vol)
- volume_mul = vol/base_volume
- end
- CAF.GetAddon("Resource Distribution").AddResource(ent, "Crystals", math.Round(3600 * volume_mul))
- ent.MAXRESOURCE = math.Round(3600 * volume_mul)
- local mass = math.Round(base_mass * volume_mul)
- ent.mass = mass
- local maxhealth = math.Round(base_health * volume_mul)
- return mass, maxhealth
- end
- local function pnfuel_func(ent,type,sub_type,devinfo,Extra_Data,ent_extras)
- local volume_mul = 1
- local base_volume = 8671.24
- local base_mass = 5
- local base_health = 200
- local phys = ent:GetPhysicsObject()
- if phys:IsValid() and phys.GetVolume then
- local vol = phys:GetVolume()
- vol = math.Round(vol)
- volume_mul = math.Clamp(vol,0,867124)/base_volume
- end
- local PAmount = 0
- if ent:GetModel() == "models/ce_ls3additional/resource_tanks/resource_tank_tiny.mdl" then
- PAmount = 10000
- elseif ent:GetModel() == "models/ce_ls3additional/resource_tanks/resource_tank_small.mdl" then
- PAmount = 30000
- elseif ent:GetModel() == "models/ce_ls3additional/resource_tanks/resource_tank_medium.mdl" then
- PAmount = 100000
- elseif ent:GetModel() == "models/ce_ls3additional/resource_tanks/resource_tank_large.mdl" then
- PAmount = 500000
- end
- CAF.GetAddon("Resource Distribution").AddResource(ent, "PN-Fuel", PAmount)
- local mass = math.Round(base_mass * volume_mul)
- ent.mass = mass
- local maxhealth = math.Round(base_health * volume_mul)
- return mass, maxhealth
- end
- TOOL.Devices = {
- /*
- storage_ore = {
- Name = "Ore Container",
- type = "storage_ore",
- class = "storage_ore",
- func = ore_func,
- devices = {
- ore_storage = {
- Name = "Ore Container ",
- model = "models/mandrac/ore_container/ore_large.mdl",
- skin = 0,
- res = { Ore = 1500000 },
- mass = 300,
- legacy = false, --these two vars must be defined per ent as the old tanks (defined in external file) require different values
- }
- }
- },
- storage_crystals = {
- Name = "Crystal Container",
- type = "storage_crystals",
- class = "storage_crystals",
- func = crystal_func,
- devices = {
- ore_storage = {
- Name = "Crystal Container ",
- model = "models/mandrac/ore_container/ore_medium.mdl",
- skin = 0,
- res = { Crystals = 100000 },
- mass = 200,
- legacy = false,
- }
- }
- },
- */
- storage_pnfuel = {
- Name = "PN-Fuel Tanks",
- type = "storage_pnfuel",
- class = "storage_pnfuel",
- func = pnfuel_func,
- devices = {
- pnfuel_storage_small = {
- Name = "Small PN-Fuel Tank ",
- model = "models/ce_ls3additional/resource_tanks/resource_tank_tiny.mdl",
- skin = 0,
- res = {},
- mass = 200,
- ent_extras = { TankPoints = 1 },
- legacy = false,
- },
- pnfuel_storage_medium = {
- Name = "Medium PN-Fuel Tank ",
- model = "models/ce_ls3additional/resource_tanks/resource_tank_small.mdl",
- skin = 0,
- res = {},
- mass = 600,
- ent_extras = { TankPoints = 3 },
- legacy = false,
- },
- pnfuel_storage_large = {
- Name = "Large PN-Fuel Tank ",
- model = "models/ce_ls3additional/resource_tanks/resource_tank_medium.mdl",
- skin = 0,
- res = {},
- mass = 1500,
- ent_extras = { TankPoints = 6 },
- legacy = false,
- },
- pnfuel_storage_station = {
- Name = "Station PN-Fuel Tank ",
- model = "models/ce_ls3additional/resource_tanks/resource_tank_large.mdl",
- skin = 0,
- res = {},
- mass = 5000,
- ent_extras = { TankPoints = 20 },
- legacy = false,
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement