summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <devnull@localhost>2011-04-09 23:49:10 +0000
committerunknown <devnull@localhost>2011-04-09 23:49:10 +0000
commit2434aca0321544a9906427932135f0d475ea460c (patch)
treed32ed4878d09e73900ce93fdb79189ff5b290665
parentfd815ec7391efb18bd729ab15a082aaa62bc713f (diff)
Added some object definitions to Marble Zone for S2LVL
-- Added Buss Bomber -- Added Bazaran -- Added Movable Block -- Added Green Glass Pillar Thing -- Started work on platforms but not finished yet
-rw-r--r--S1LVL INI Files/MZ/MovingPlatform.cs188
-rw-r--r--S1LVL INI Files/S1LVL.ini1
-rw-r--r--S1LVL INI Files/objMZ.ini25
3 files changed, 214 insertions, 0 deletions
diff --git a/S1LVL INI Files/MZ/MovingPlatform.cs b/S1LVL INI Files/MZ/MovingPlatform.cs
new file mode 100644
index 0000000..9c97562
--- /dev/null
+++ b/S1LVL INI Files/MZ/MovingPlatform.cs
@@ -0,0 +1,188 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Drawing;
+using Extensions;
+using SonicRetro.S2LVL;
+
+namespace S1ObjectDefinitions.MZ
+{
+ class MovingPlatform : ObjectDefinition
+ {
+ private string[] labels = { "@wide", "@sloped", "@narrow" };
+ private List<Point> offsets = new List<Point>();
+ private List<Bitmap> imgs = new List<Bitmap>();
+ private List<int> imgws = new List<int>();
+ private List<int> imghs = new List<int>();
+
+ public override void Init(Dictionary<string, string> data)
+ {
+ byte[] artfile = ObjectHelper.LevelArt;
+ Point off;
+ Bitmap im;
+ im = ObjectHelper.MapASMToBmp(artfile, "../_maps/MZ Large Grassy Platforms.asm", "@wide", 2, out off);
+ imgs.Add(im);
+ offsets.Add(off);
+ imgws.Add(im.Width);
+ imghs.Add(im.Height);
+ im = ObjectHelper.MapASMToBmp(artfile, "../_maps/MZ Large Grassy Platforms.asm", "@sloped", 2, out off);
+ imgs.Add(im);
+ offsets.Add(off);
+ imgws.Add(im.Width);
+ imghs.Add(im.Height);
+ im = ObjectHelper.MapASMToBmp(artfile, "../_maps/MZ Large Grassy Platforms.asm", "@narrow", 2, out off);
+ imgs.Add(im);
+ offsets.Add(off);
+ imgws.Add(im.Width);
+ imghs.Add(im.Height);
+ }
+
+ public override ReadOnlyCollection<byte> Subtypes()
+ {
+ return new ReadOnlyCollection<byte>(new byte[] { 0x00, 0x15, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29});
+ }
+
+ public override string Name()
+ {
+ return "Grass Platform";
+ }
+
+ public override bool RememberState()
+ {
+ return false;
+ }
+
+ public override string SubtypeName(byte subtype)
+ {
+ switch (subtype)
+ {
+ case 0x00:
+ return "Large Oscillating";
+ case 0x15:
+ return "Sinking";
+ case 0x20:
+ return "Small Oscillating(Speed 0)";
+ case 0x21:
+ return "Small Oscillating(Speed 1)";
+ case 0x22:
+ return "Small Oscillating(Speed 2)";
+ case 0x23:
+ return "Small Oscillating(Speed 3)";
+ case 0x24:
+ return "Small Oscillating(Speed 4)";
+ case 0x25:
+ return "Small Oscillating(Speed 5)";
+ case 0x26:
+ return "Small Oscillating(Speed 6)";
+ case 0x27:
+ return "Small Oscillating(Speed 7)";
+ case 0x28:
+ return "Small Oscillating(Speed 8)";
+ case 0x29:
+ return "Small Oscillating(Speed 9)";
+ default:
+ return string.Empty;
+ }
+ }
+
+ public override string FullName(byte subtype)
+ {
+ return Name() + " - " + SubtypeName(subtype);
+ }
+
+ public override Bitmap Image()
+ {
+ return imgs[0];
+ }
+
+ public override Bitmap Image(byte subtype)
+ {
+ if (subtype < labels.Length)
+ return imgs[subtype];
+ else
+ return imgs[0];
+ }
+
+ private int imgindex(byte SubType)
+ {
+ return 0;
+ }
+
+ public override void Draw(Graphics gfx, Point loc, byte subtype, bool XFlip, bool YFlip)
+ {
+ gfx.DrawImageFlipped(imgs[imgindex(subtype)], loc.X + offsets[imgindex(subtype)].X, loc.Y + offsets[imgindex(subtype)].Y, XFlip, YFlip);
+ }
+
+ public override Rectangle Bounds(Point loc, byte subtype)
+ {
+ return new Rectangle(loc.X + offsets[imgindex(subtype)].X, loc.Y + offsets[imgindex(subtype)].Y, imgws[imgindex(subtype)], imghs[imgindex(subtype)]);
+ }
+
+ public override Type ObjectType
+ {
+ get
+ {
+ return typeof(MZPlatformS1ObjectEntry);
+ }
+ }
+
+ public override void PaletteChanged(System.Drawing.Imaging.ColorPalette pal)
+ {
+ foreach (Bitmap item in imgs)
+ {
+ item.Palette = pal;
+ }
+ }
+
+
+ public class MZPlatformS1ObjectEntry : S1ObjectEntry
+ {
+ public MZPlatformS1ObjectEntry() : base() { }
+ public MZPlatformS1ObjectEntry(byte[] file, int address) : base(file, address) { }
+
+ public PlatformMovement Movement
+ {
+ get
+ {
+ return (PlatformMovement)(SubType & 0xF);
+ }
+ set
+ {
+ SubType = (byte)((SubType & ~0xF) | (int)value);
+ }
+ }
+
+ public byte SwitchID
+ {
+ get
+ {
+ return (byte)(SubType >> 4);
+ }
+ set
+ {
+ SubType = (byte)((SubType & ~0xF0) | (value << 4));
+ }
+ }
+ }
+
+ public enum PlatformMovement
+ {
+ Stationary,
+ RightLeft,
+ DownUp,
+ FallStand,
+ Fall,
+ LeftRight,
+ UpDown,
+ SwitchUp,
+ MoveUp,
+ Stationary2,
+ Large,
+ DownUpSlow,
+ UpDownSlow,
+ Invalid1,
+ Invalid2,
+ Invalid3
+ }
+ }
+}
diff --git a/S1LVL INI Files/S1LVL.ini b/S1LVL INI Files/S1LVL.ini
index e17c4b5..a41bb38 100644
--- a/S1LVL INI Files/S1LVL.ini
+++ b/S1LVL INI Files/S1LVL.ini
@@ -48,6 +48,7 @@ objects=../objpos/mz1.bin
palette=../palette/Sonic.bin:0:0:16|../palette/Marble Zone.bin:0:16:48
startpos=../startpos/mz1.bin:Sonic:Level Start
colind=../collide/MZ.bin
+objlst=objMZ.ini
[Marble Zone Act 2]
tile8=../artnem/8x8 - MZ.bin
block16=../map16/MZ.bin
diff --git a/S1LVL INI Files/objMZ.ini b/S1LVL INI Files/objMZ.ini
new file mode 100644
index 0000000..b78fd05
--- /dev/null
+++ b/S1LVL INI Files/objMZ.ini
@@ -0,0 +1,25 @@
+[22]
+name=Buzz Bomber
+art=../artnem/Enemy Buzz Bomber.bin
+mapasm=../_maps/Buzz Bomber.asm
+mapasmlbl=@Fly1
+pal=0
+rememberstate=True
+[30]
+name=Large Glass Pillar
+art=../artnem/MZ Green Glass Block.bin
+mapasm=../_maps/MZ Large Green Glass Blocks.asm
+mapasmlbl=@tall
+pal=2
+[33]
+name=Movable Block
+art=../artnem/MZ Green Pushable Block.bin
+mapasm=../_maps/Pushable Blocks.asm
+mapasmlbl=@single
+pal=2
+[55]
+name=Basaran
+art=../artnem/Enemy Basaran.bin
+mapasm=../_maps/Basaran.asm
+mapasmlbl=@still
+pal=1