Skip to content

Commit 117eee9

Browse files
committed
bottle tracking
1 parent fbc1001 commit 117eee9

11 files changed

+215
-53
lines changed

images/items/bottle_bee.png

2.91 KB
Loading

images/items/bottle_blue.png

2.91 KB
Loading

images/items/bottle_empty.png

2.87 KB
Loading

images/items/bottle_fairy.png

2.92 KB
Loading

images/items/bottle_goodbee.png

2.91 KB
Loading

images/items/bottle_green.png

2.92 KB
Loading

images/items/bottle_red.png

2.9 KB
Loading

items/items.json

+136
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,142 @@
296296
}
297297
]
298298
},
299+
{
300+
"name": "Bottle 1",
301+
"type": "progressive",
302+
"allow_disabled": "false",
303+
"loop": true,
304+
"stages": [
305+
{
306+
"img": "images/items/bottle_empty.png",
307+
"img_mods": "@disabled"
308+
},
309+
{
310+
"img": "images/items/bottle_empty.png",
311+
"codes": "bottle0,bottle"
312+
},
313+
{
314+
"img": "images/items/bottle_red.png"
315+
},
316+
{
317+
"img": "images/items/bottle_green.png"
318+
},
319+
{
320+
"img": "images/items/bottle_blue.png"
321+
},
322+
{
323+
"img": "images/items/bottle_fairy.png"
324+
},
325+
{
326+
"img": "images/items/bottle_bee.png"
327+
},
328+
{
329+
"img": "images/items/bottle_goodbee.png"
330+
}
331+
]
332+
},
333+
{
334+
"name": "Bottle 2",
335+
"type": "progressive",
336+
"allow_disabled": "false",
337+
"loop": true,
338+
"stages": [
339+
{
340+
"img": "images/items/bottle_empty.png",
341+
"img_mods": "@disabled"
342+
},
343+
{
344+
"img": "images/items/bottle_empty.png",
345+
"codes": "bottle1,bottle"
346+
},
347+
{
348+
"img": "images/items/bottle_red.png"
349+
},
350+
{
351+
"img": "images/items/bottle_green.png"
352+
},
353+
{
354+
"img": "images/items/bottle_blue.png"
355+
},
356+
{
357+
"img": "images/items/bottle_fairy.png"
358+
},
359+
{
360+
"img": "images/items/bottle_bee.png"
361+
},
362+
{
363+
"img": "images/items/bottle_goodbee.png"
364+
}
365+
]
366+
},
367+
{
368+
"name": "Bottle 3",
369+
"type": "progressive",
370+
"allow_disabled": "false",
371+
"loop": true,
372+
"stages": [
373+
{
374+
"img": "images/items/bottle_empty.png",
375+
"img_mods": "@disabled"
376+
},
377+
{
378+
"img": "images/items/bottle_empty.png",
379+
"codes": "bottle2,bottle"
380+
},
381+
{
382+
"img": "images/items/bottle_red.png"
383+
},
384+
{
385+
"img": "images/items/bottle_green.png"
386+
},
387+
{
388+
"img": "images/items/bottle_blue.png"
389+
},
390+
{
391+
"img": "images/items/bottle_fairy.png"
392+
},
393+
{
394+
"img": "images/items/bottle_bee.png"
395+
},
396+
{
397+
"img": "images/items/bottle_goodbee.png"
398+
}
399+
]
400+
},
401+
{
402+
"name": "Bottle 4",
403+
"type": "progressive",
404+
"allow_disabled": "false",
405+
"loop": true,
406+
"stages": [
407+
{
408+
"img": "images/items/bottle_empty.png",
409+
"img_mods": "@disabled"
410+
},
411+
{
412+
"img": "images/items/bottle_empty.png",
413+
"codes": "bottle3,bottle"
414+
},
415+
{
416+
"img": "images/items/bottle_red.png"
417+
},
418+
{
419+
"img": "images/items/bottle_green.png"
420+
},
421+
{
422+
"img": "images/items/bottle_blue.png"
423+
},
424+
{
425+
"img": "images/items/bottle_fairy.png"
426+
},
427+
{
428+
"img": "images/items/bottle_bee.png"
429+
},
430+
{
431+
"img": "images/items/bottle_goodbee.png"
432+
}
433+
]
434+
},
299435
// Somaria
300436
{
301437
"name": "Cane of Somaria",

layouts/broadcast.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"armor"
3737
],
3838
[
39-
"bottle",
39+
"",
4040
"somaria",
4141
"byrna",
4242
"cape",
@@ -69,6 +69,16 @@
6969
"item": "mushroom_used",
7070
"width": 24,
7171
"margin": "88,18,0,0"
72+
},
73+
{
74+
"type": "itemgrid",
75+
"item_size": 16,
76+
"item_margin": "0,1",
77+
"margin": "-101,65,0,0",
78+
"rows":[
79+
[ "bottle0", "bottle1" ],
80+
[ "bottle2", "bottle3" ]
81+
]
7282
}
7383
]
7484
},

layouts/shared_base.json

+61-45
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,66 @@
11
{
22
"shared_item_grid": {
3-
"type": "itemgrid",
4-
"h_alignment": "center",
5-
"item_margin": "1,2",
6-
"item_size": 42,
7-
"rows": [
8-
[
9-
"bow",
10-
"boomerang_red",
11-
"hookshot",
12-
"bombs",
13-
"powder_used",
14-
"mushroom_used",
15-
"boots",
16-
"owsword"
17-
],
18-
[
19-
"firerod",
20-
"icerod",
21-
"bombos",
22-
"ether",
23-
"quake",
24-
"halfmagic",
25-
"lift1",
26-
"shield"
27-
],
28-
[
29-
"lamp",
30-
"hammer",
31-
"ocarina",
32-
"net",
33-
"book",
34-
"shovel_used",
35-
"flippers",
36-
"armor"
37-
],
38-
[
39-
"bottle",
40-
"somaria",
41-
"byrna",
42-
"cape",
43-
"mirror",
44-
"agas",
45-
"moonpearl",
46-
"gomode"
47-
]
3+
"type": "container",
4+
"margin": 0,
5+
"content": [
6+
{
7+
"type": "itemgrid",
8+
"h_alignment": "center",
9+
"item_margin": "1,2",
10+
"item_size": 42,
11+
"rows": [
12+
[
13+
"bow",
14+
"boomerang_red",
15+
"hookshot",
16+
"bombs",
17+
"powder_used",
18+
"mushroom_used",
19+
"boots",
20+
"owsword"
21+
],
22+
[
23+
"firerod",
24+
"icerod",
25+
"bombos",
26+
"ether",
27+
"quake",
28+
"halfmagic",
29+
"lift1",
30+
"shield"
31+
],
32+
[
33+
"lamp",
34+
"hammer",
35+
"ocarina",
36+
"net",
37+
"book",
38+
"shovel_used",
39+
"flippers",
40+
"armor"
41+
],
42+
[
43+
"",
44+
"somaria",
45+
"byrna",
46+
"cape",
47+
"mirror",
48+
"agas",
49+
"moonpearl",
50+
"gomode"
51+
]
52+
]
53+
},
54+
{
55+
"type": "itemgrid",
56+
"item_size": 21,
57+
"item_margin": "0,1",
58+
"margin": "-153,72,0,0",
59+
"rows":[
60+
[ "bottle0", "bottle1" ],
61+
[ "bottle2", "bottle3" ]
62+
]
63+
}
4864
]
4965
},
5066
"shared_pendant_grid": {

scripts/auto/itemupdates.lua

+7-7
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ function updateFlute(segment)
9999
end
100100

101101
function updateBottles(segment)
102-
local item = Tracker:FindObjectForCode("bottle")
103-
local count = 0
104102
for i = 0, 3, 1 do
105-
if segment:ReadUInt8(0x7ef35c + i) > 0 then
106-
count = count + 1
103+
local item = Tracker:FindObjectForCode("bottle"..i)
104+
local contents = segment:ReadUInt8(0x7ef35c + i)
105+
print(string.format("bottle %d contents: %d", i, contents))
106+
if contents == 0 then
107+
item.CurrentStage = 0
108+
else
109+
item.CurrentStage = contents - 1
107110
end
108111
end
109-
if count > item.CurrentStage or not STATUS.AutotrackerInGame then
110-
item.CurrentStage = count
111-
end
112112
end
113113

114114
function updateBatIndicatorStatus(status)

0 commit comments

Comments
 (0)