-
Notifications
You must be signed in to change notification settings - Fork 2
/
LevelObjectSet.cs
132 lines (126 loc) · 5.36 KB
/
LevelObjectSet.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace sth1edwv
{
public class LevelObjectSet
{
public class LevelObject
{
public byte type;
public byte X;
public byte Y;
public LevelObject(byte t, byte x, byte y)
{
type = t;
X = x;
Y = y;
}
public TreeNode ToNode()
{
string s = "PosX = " + X + " PosY = " + Y + " Type = 0x" + type + "(";
if (objNames.ContainsKey(type))
s += objNames[type] + ")";
else
s += "UNKNOWN)";
return new TreeNode(s);
}
public static Dictionary<byte, string> objNames = new Dictionary<byte, string>()
{
{0x00,"NONE"},
{0x01,"Super Ring monitor"},
{0x02,"Power Sneakers monitor"},
{0x03,"One-Up monitor"},
{0x04,"Shield monitor"},
{0x05,"Invincibility monitor"},
{0x06,"Chaos Emerald"},
{0x07,"End sign"},
{0x08,"Badnik 'Crabmeat' (GH)"},
{0x09,"Wooden platform - Swinging (GH)"},
{0x0A,"Explosion"},
{0x0B,"Wooden platform (GH)"},
{0x0C,"Wooden platform - Falls when touched (GH)"},
{0x0E,"Badnik 'Buzz Bomber' (GH/B)"},
{0x0F,"Wooden platform - Sliding left-right (GH)"},
{0x10,"Badnik 'Moto Bug' (GH)"},
{0x11,"Badnik 'Newtron' (GH)"},
{0x12,"Robotnik - Green Hill Boss (GH)"},
{0x16,"Flame Thrower (SB)"},
{0x17,"Door - Opens from left only (SB)"},
{0x18,"Door - Opens from right only (SB)"},
{0x19,"Door - Two ways (SB)"},
{0x1A,"Electric sphere (SB)"},
{0x1B,"Badnik 'Ball Hog' (SB)"},
{0x1C,"Unknown - Ball from the 'Ball Hog' ?"},
{0x1D,"Switch (SB, L, others ?)"},
{0x1E,"Switch Activated Door (SB)"},
{0x1F,"Badnik 'Caterkiller' (SB)"},
{0x21,"Bumper - Sliding left-right (Bonus Stage ?)"},
{0x22,"Robotnik - Scrap Brain Boss (SB)"},
{0x23,"Free animal - Rabbit"},
{0x24,"Free animal - Bird"},
{0x25,"Animal Cell"},
{0x26,"Badnik 'Chopper' (J, B)"},
{0x27,"Vertical Step - Falling from a waterfall (J)"},
{0x28,"Horizontal Step - Falling from a waterfall (J)"},
{0x29,"Floating Step - Sonic can travel with it (J)"},
{0x2C,"Robotnik - Jungle Boss (J)"},
{0x2D,"Badnik 'Yadrin' (B)"},
{0x2E,"Falling Bridge (B)"},
{0x30,"Passing Clouds (SKYB)"},
{0x31,"Propeller (SKYB)"},
{0x32,"Badnik 'Bomb' (SKYB)"},
{0x33,"Cannon Ball (SKYB)"},
{0x35,"Badnik 'Unidus' (SKYB)"},
{0x37,"Rotating cannon (SKYB)"},
{0x38,"Flying platform (SKYB)"},
{0x39,"Spiked wall slowly moving right (SKYB)"},
{0x3A,"Small cannon in Sky Base Act 1 (SKYB)"},
{0x3B,"Flying platform moving up-down (SKYB)"},
{0x3C,"Badnik 'Jaws' (L)"},
{0x3D,"Rotating spiked ball (L)"},
{0x3E,"Spear, shifting up-down (L)"},
{0x3F,"Fire ball thrower (L)"},
{0x40,"Water Level Object (L)"},
{0x41,"Bubble Maker (L)"},
{0x44,"Badnik 'Burrobot' (L)"},
{0x45,"Platform, move up when touched (L)"},
{0x46,"Electrical Hazard for the Sky Base Boss (SKYB)"},
{0x48,"Robotnik - Bridge Boss (SB)"},
{0x49,"Robotnik - Labyrinth Boss (L)"},
{0x4A,"Robotnik - Sky Base Boss (SKYB)"},
{0x4B,"Zone that makes you fall (like in GH2)"},
{0x4C,"Flipper (Bonus Stage)"},
{0x4D,"RESET!"},
{0x4E,"Balance (B)"},
{0x4F,"RESET!"},
{0x50,"Flower (GH)"},
{0x51,"Box - Starpost"},
{0x52,"Box - Continue"},
{0x53,"Final animation in GH, when Sonic falls on Robotnik (then, goes to the next level)"},
{0x54,"Emeralds animation (on the map), when Sonic has them all (and goes to the next level)"},
{0x55,"Makes Sonic blink for a short time"},
{0xFF,"NONE"}
};
}
public List<LevelObject> objs;
public LevelObjectSet(int offset)
{
objs = new List<LevelObject>();
byte count = Cartridge.memory[offset];
for (int i = 0; i < count; i++)
objs.Add(new LevelObject(Cartridge.memory[offset + i * 3 + 1], Cartridge.memory[offset + i * 3 + 2], Cartridge.memory[offset + i * 3 + 3]));
}
public TreeNode ToNode()
{
TreeNode result = new TreeNode("Objects");
foreach (LevelObject obj in objs)
result.Nodes.Add(obj.ToNode());
return result;
}
}
}