summaryrefslogtreecommitdiff
path: root/data/artery/global/sh_minerock.txt
diff options
context:
space:
mode:
authorApickx <apickx@cogarr.com>2025-02-12 16:41:17 -0600
committerApickx <apickx@cogarr.com>2025-02-12 16:41:17 -0600
commit94cc3813c462df5f7bfd875d5a817b0da42006e6 (patch)
treede80af0fe1300e822c6b553d15dbf2136f31f1b9 /data/artery/global/sh_minerock.txt
parentd22897e044a422e125f46e52c3467473a3656378 (diff)
downloadartery_stranded-master.tar.gz
artery_stranded-master.tar.bz2
artery_stranded-master.zip
Final commitHEADmaster
Diffstat (limited to 'data/artery/global/sh_minerock.txt')
-rw-r--r--data/artery/global/sh_minerock.txt59
1 files changed, 31 insertions, 28 deletions
diff --git a/data/artery/global/sh_minerock.txt b/data/artery/global/sh_minerock.txt
index 0e6bcaf..b73748b 100644
--- a/data/artery/global/sh_minerock.txt
+++ b/data/artery/global/sh_minerock.txt
@@ -47,7 +47,7 @@ local function findmatchesfortile(puzzle,x,y)
matches[#matches+1] = v
end
end
-
+
--Find verticle matches
local matchesverticle = 1
cursor = y + 1
@@ -94,39 +94,39 @@ local oremap = {
"materials/svg/faithtoken/originals/svg/000000/transparent/minerals.svg",
"materials/svg/delapouite/originals/svg/000000/transparent/stone-pile.svg",
"materials/svg/lorc/originals/svg/000000/transparent/fossil.svg"
-
+
}
if SERVER then
local itm = nrequire("item.lua")
-
+
for k,v in pairs(oremap) do
resource.AddSingleFile(v)
end
-
+
util.AddNetworkString("artery_mine_rock_start")
util.AddNetworkString("artery_mine_rock_new")
util.AddNetworkString("artery_mine_rock_quit")
util.AddNetworkString("artery_mine_rock_action")
util.AddNetworkString("artery_mine_rocks_update")
-
+
local function genpuzzle(width,height,variety)
local puzzle = {}
puzzle.width = width
puzzle.height = height
puzzle.variety = variety
puzzle.tiles = {}
-
+
for i = 0,puzzle.width do
puzzle.tiles[i] = {}
for j = 0,puzzle.height do
puzzle.tiles[i][j] = math.random(0,puzzle.variety)
end
end
-
+
return puzzle
end
-
+
local function del_and_replace(puzzle,matches)
local tp = puzzle.tiles
local function dropcolumn(x,y,spaces)
@@ -139,9 +139,9 @@ if SERVER then
dropcolumn(v[1],v[2],1)
end
end
-
-
-
+
+
+
local function findmatchesfor(puzzle)
local duped = {}
for i = 0, puzzle.width-1 do
@@ -165,7 +165,7 @@ if SERVER then
end
return m
end
-
+
local puzzles = {}
local scores = {}
function meta:MineRock()
@@ -182,11 +182,11 @@ if SERVER then
net.WriteTable(p)
net.Send(self)
end
-
+
local function kick_cheating_player(who)
error(who:Nick() .. " was cheating!")
end
-
+
net.Receive("artery_mine_rock_action",function(ln,ply)
local p = puzzles[ply]
local x1 = net.ReadUInt(8)
@@ -210,9 +210,9 @@ if SERVER then
net.WriteTable(p)
net.WriteDouble(scores[ply])
net.Send(ply)
- ply:StartAnimation("stranded_mine_rock")
+ --ply:StartAnimation("stranded_mine_rock")
end)
-
+
net.Receive("artery_mine_rock_quit",function(ln,ply)
local s = scores[ply]
local cursor = 1
@@ -224,7 +224,7 @@ if SERVER then
local togive = itm.GetItemByName(n)
ply:GiveItem(togive)
ply:AddSkill("Mineing",s)
- ply:StopAnimation("stranded_mine_rock")
+ ply:StopAnimation("stranded_mine_rocks")
end)
else
local svg = nrequire("cl_svg.lua")
@@ -254,34 +254,34 @@ else
net.Start("artery_mine_rock_quit")
net.SendToServer()
end
-
+
local puzzlepane = vgui.Create( "DPanel", puzzleview )
puzzlepane:Dock(FILL)
-
+
local help = vgui.Create("DLabel",puzzlepane)
help:SetText("Click two cells to switch them.\nCreate runs of 3 or more to clear them from the board\nNew numbers come in from the top\nQuit at any time to receive the resource you have worked towards.")
help:SetDark(true)
help:SizeToContents()
help:Dock(RIGHT)
-
+
local rocklayout = vgui.Create("DPanel",puzzlepane)
rocklayout:Dock(BOTTOM)
-
+
local rockprogress = vgui.Create( "DProgress",rocklayout )
rockprogress:Dock(FILL)
-
+
local rocknameleft = vgui.Create("DLabel",rocklayout)
rocknameleft:Dock(LEFT)
rocknameleft:SetDark(true)
rocknameleft:SetText("")
-
+
local rocknameright = vgui.Create("DLabel",rocklayout)
rocknameright:Dock(RIGHT)
rocknameright:SetDark(true)
rocknameright:SetText(rockdata[2][1])
-
+
rocks = {rockprogress,rocknameleft,rocknameright}
-
+
local puzzlegrid = vgui.Create( "DGrid", puzzlepane )
puzzlegrid:SetCols(tbl.width)
puzzlegrid:Dock(TOP)
@@ -307,6 +307,9 @@ else
self:SetMaterial(oremats[tbl.tiles[x][y]].material)
end
end
+ tile.Paint = function(self,w,h)
+
+ end
tile.DoClick = function(self)
if selected == nil then
selected = self
@@ -339,9 +342,9 @@ else
puzzlegrid:AddItem(tile)
end
end
-
+
end)
-
+
net.Receive("artery_mine_rocks_update",function()
tbl = net.ReadTable()
local score = net.ReadDouble()
@@ -367,5 +370,5 @@ else
end
end
end)
-
+
end