summaryrefslogtreecommitdiff
path: root/gamemode/structuresystem/structures/stonefurnace.lua
blob: 5914ed2ec5b67c64937756712e06ae651e2c31a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
local STRUCT = {}

STRUCT.Name = "Stone Furnace"
STRUCT.Model = "models/props/de_inferno/ClayOven.mdl"

STRUCT.Structure = {
  {"models/props/de_inferno/ClayOven.mdl",Vector(0,0,0),Angle(0,0,0)}
}

STRUCT.onInitialize = function(self)
  print("Initalize called!")
end

STRUCT.uniquedata = false

STRUCT.onUse = function(self, ply)
  if CLIENT and ply != LocalPlayer() then return end
  print("onUse called!")
end

STRUCT.timemult = 0.5
STRUCT.skillease = 0.25

local timefunc = function(ply, num)
  print("Inputs: num=" .. num)
  local time = math.pow(num,STRUCT.timemult) - ((num * STRUCT.timemult) * math.pow(ply:GetSkill("Smelting"),STRUCT.skillease ))
  time = time * num / 5
  print("Time was: " .. time)
  return time
end

local genericRecipe = {
  ["Name"] = "Copper",
  ["Description"] = "Smelt some copper or into copper!",
  ["Requirements"] = {["Copper Ore"] = 1},
  ["Results"] = {["Copper"] = 1},
  ["Ratio"] = {1,1},
  ["Time"] = timefunc
}

genericGiveRecipie(STRUCT,genericRecipe)
genericMakeFurnace(STRUCT)

registerStructure(STRUCT)