public byte unknown_07; // 0x07 unknown data (always 0?) public ITEMRecord(byte[] byArrayITEMPacket) { timer = byArrayITEMPacket[0x00]; item_box = (MarioKartWii.EItemType)byArrayITEMPacket[0x01]; item_tail = (MarioKartWii.EItemType)byArrayITEMPacket[0x02]; mode = byArrayITEMPacket[0x03]; tail_mode = byArrayITEMPacket[0x04]; acknowledge = byArrayITEMPacket[0x05]; ack_timer = byArrayITEMPacket[0x06]; unknown_07 = byArrayITEMPacket[0x07]; }
/** <summary> * Tasks to be ran when a new item is obtained. * </summary> * <param name="eItemTypeNew"> * The player's new item. * </param> * <param name="byPlayerSlot"> * The player's slot. * </param> * <param name="byPlayerPosition"> * The player's position in the race. * </param> */ private void DoNewItemTasks(MarioKartWii.EItemType eItemTypeNew,byte byPlayerSlot,byte byPlayerPosition) { WavSoundPlayer wavSoundPlayer = new WavSoundPlayer(); wavSoundPlayer.PlayItemWarningSound(eItemTypeNew); string strItemLog = MarioKartWii.MakeItemLogString(g_raceHeader1Record.timer, byPlayerSlot, eItemTypeNew, byPlayerPosition); ConsoleIO.WriteLineColoured(strItemLog,ConsoleColor.Blue); FileIO.SaveItemLogToFile(gs_dateTimeLastRaceStart,gs_bySelectedTrackID,strItemLog); }
/** <summary> * Plays an item warning sound on another thread. * </summary> * <param name="eItemType"> * An item type. * </param> */ public void PlayItemWarningSound(MarioKartWii.EItemType eItemType) { ThreadPool.QueueUserWorkItem(delegate { using (UnmanagedMemoryStream unmanagedMemoryStreamItemWarningSound = GetItemWarningSoundByItemType(eItemType)) { if (unmanagedMemoryStreamItemWarningSound == null) { return; } PlaySound(unmanagedMemoryStreamItemWarningSound); } }); }
/** <summary> * Gets an item type's warning sound. * </summary> * <param name="eItemType"> * An item type. * </param> * <returns> * An UnmanagedMemoryStream containing the item type's warning sound, otherwise null if there is no sound specified for the item type. * </returns> */ private UnmanagedMemoryStream GetItemWarningSoundByItemType(MarioKartWii.EItemType eItemType) { switch (eItemType) { case MarioKartWii.EItemType.GREEN_SHELL: return(null); case MarioKartWii.EItemType.RED_SHELL: return(null); case MarioKartWii.EItemType.BANANA: return(null); case MarioKartWii.EItemType.FAKE_ITEM_BOX: return(null); case MarioKartWii.EItemType.MUSHROOM: return(null); case MarioKartWii.EItemType.TRIPLE_MUSHROOMS: return(null); case MarioKartWii.EItemType.BOB_OMB: return(null); case MarioKartWii.EItemType.BLUE_SHELL: return(Resources.ProtoBlueShell); case MarioKartWii.EItemType.LIGHTNING: return(Resources.WolfLightning); case MarioKartWii.EItemType.STAR: return(null); case MarioKartWii.EItemType.GOLDEN_MUSHROOM: return(null); case MarioKartWii.EItemType.MEGA_MUSHROOM: return(null); case MarioKartWii.EItemType.BLOOPER: return(null); case MarioKartWii.EItemType.POW_BLOCK: return(null); case MarioKartWii.EItemType.THUNDER_CLOUD: return(null); case MarioKartWii.EItemType.BULLET_BILL: return(null); case MarioKartWii.EItemType.TRIPLE_GREEN_SHELLS: return(null); case MarioKartWii.EItemType.TRIPLE_RED_SHELLS: return(null); case MarioKartWii.EItemType.TRIPLE_BANANAS: return(null); case MarioKartWii.EItemType.NO_ITEM: return(null); default: return(null); } }