public override void LoadData(ItemSeeker data) { base.LoadData(data); Side = data.DoorSide; Type = data.DoorType; }
private void DisassmScreen(ItemSeeker seeker) { result.AppendLine(); result.AppendLine(); // Byte, map X result.AppendLine(FormatLine( byteCode + " " + FormatByte(seeker.MapX), "Map X = " + seeker.MapX.ToString())); if (seeker.ScreenEntrySizeByte == 0xFF) { // Byte indicates last screen WriteLine(ByteDirective(0xFF), "Last screen in row"); } else { // Byte, screen data size result.AppendLine(FormatLine( byteCode + " " + FormatByte(seeker.ScreenEntrySizeByte), seeker.ScreenEntrySize + " bytes of data for this screen")); } DisassmItem(seeker); while (seeker.MoreItemsPresent) { seeker.NextItem(); DisassmItem(seeker); } WriteLine(ByteDirective(0), "End of screen data"); }
private void LoadScreen(ItemSeeker seeker, int mapY) { var data = new ItemScreenData(); data.MapX = seeker.MapX; data.MapY = mapY; var item = LoadItem(seeker); if (item != null) { data.Items.Add(item); } while (seeker.MoreItemsPresent) { seeker.NextItem(); item = LoadItem(seeker); if (item != null) { data.Items.Add(item); } } Add(data); }
public override void LoadData(ItemSeeker data) { base.LoadData(data); Difficult = data.EnemyIsHard; enemyType = data.EnemyTypeIndex; }
private ItemData LoadItem(ItemSeeker seeker) { ItemData result; switch (seeker.ItemType) { case ItemTypeIndex.Enemy: result = new ItemEnemyData(); break; case ItemTypeIndex.PowerUp: result = new ItemPowerupData(); break; case ItemTypeIndex.Mella: case ItemTypeIndex.Rinkas: case ItemTypeIndex.MotherBrain: case ItemTypeIndex.PalSwap: case ItemTypeIndex.Zebetite: result = new ItemSingleByteData(); break; case ItemTypeIndex.Elevator: result = new ItemElevatorData(); break; case ItemTypeIndex.Turret: result = new ItemTurretData(); break; case ItemTypeIndex.Door: result = new ItemDoorData(); break; case ItemTypeIndex.Nothing: case ItemTypeIndex.Unused_b: case ItemTypeIndex.Unused_c: case ItemTypeIndex.Unused_d: case ItemTypeIndex.Unused_e: case ItemTypeIndex.Unused_f: default: return(null); } result.LoadData(seeker); return(result); }
public int GetRemainingItemsCount() { ItemSeeker i = this; int count = 1; while (i.MoreItemsPresent) { count++; i.NextItem(); if (count >= 16) { return(count); } } return(count); }
private void DisassmItem(ItemSeeker seeker) { result.AppendLine(); switch (seeker.ItemType) { case ItemTypeIndex.Nothing: throw new ItemDisassmException("Encountered an unexpected item type when disassembling an item."); case ItemTypeIndex.Enemy: // byte: Enemy code and sprite slot WriteLine(ByteDirective(seeker.ItemTypeByte), "Enemy, sprite slot = " + seeker.SpriteSlot.ToString()); // byte: hard flag (0x80), enemy type WriteLine(ByteDirective(seeker.SubTypeByte), "Enemy type = " + seeker.EnemyTypeIndex + (seeker.EnemyIsHard ? ", hard enemy" : "")); // Byte: screen position WriteLine(ByteDirective(seeker.ScreenPosition.Value), "Screen X = " + seeker.ScreenPosition.X.ToString() + " Y = " + seeker.ScreenPosition.Y.ToString()); break; case ItemTypeIndex.PowerUp: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Power Up"); // byte: Item type WriteLine(ByteDirective(seeker.SubTypeByte), "Type = " + seeker.PowerUpName); // Byte: screen position WriteLine(ByteDirective(seeker.ScreenPosition.Value), "Screen X = " + seeker.ScreenPosition.X.ToString() + " Y = " + seeker.ScreenPosition.Y.ToString()); break; case ItemTypeIndex.Mella: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Mella"); break; case ItemTypeIndex.Elevator: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Elevator"); // byte: Item type WriteLine(ByteDirective(seeker.SubTypeByte), "Type = " + seeker.Destination.ToString()); break; case ItemTypeIndex.Turret: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Turret, type = " + seeker.SpriteSlot.ToString()); // Byte: screen position WriteLine(ByteDirective(seeker.ScreenPosition.Value), "Screen X = " + seeker.ScreenPosition.X.ToString() + " Y = " + seeker.ScreenPosition.Y.ToString()); break; case ItemTypeIndex.MotherBrain: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Mother Brain"); break; case ItemTypeIndex.Zebetite: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Zebetite, index = " + seeker.SpriteSlot.ToString()); break; case ItemTypeIndex.Rinkas: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Rinka " + seeker.SpriteSlot.ToString()); break; case ItemTypeIndex.Door: // byte: Door WriteLine(ByteDirective(seeker.ItemTypeByte), "Doop"); // byte: Door type var doorType = seeker.SubTypeByte; DoorSide side = (DoorSide)(doorType & 0xF0); DoorType type = (DoorType)(doorType & 0x0F); WriteLine(ByteDirective(seeker.SubTypeByte), "Door: " + side.ToString() + " " + type.ToString()); break; case ItemTypeIndex.PalSwap: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Palette Swap"); break; case ItemTypeIndex.Unused_b: case ItemTypeIndex.Unused_c: case ItemTypeIndex.Unused_d: case ItemTypeIndex.Unused_e: case ItemTypeIndex.Unused_f: // byte: Item code WriteLine(ByteDirective(seeker.ItemTypeByte), "Invalid Item Type!"); break; default: throw new ItemDisassmException("Unexpected item type in DisassmItem"); break; } }
public override void LoadData(ItemSeeker data) { base.LoadData(data); PowerUp = data.PowerUp; }
public override void LoadData(ItemSeeker data) { base.LoadData(data); screenPosition = new Point(data.ScreenPosition.X, data.ScreenPosition.Y); }
public override void LoadData(ItemSeeker data) { base.LoadData(data); ElevatorType = data.Destination; }
public virtual void LoadData(ItemSeeker data) { this.type = data.ItemType; this.SpriteSlot = data.SpriteSlot; }
public ScreenEnumerator(ItemSeeker data, int mapY) { this.data = data; this.next = new ScreenItems(data, mapY); this.mapY = mapY; }