/// <summary> /// Sets extended data about billboard from RDB flat resource data. /// </summary> public void SetRDBResourceData(DFBlock.RdbFlatResource resource) { // Add common data summary.Flags = resource.Flags; summary.FactionOrMobileID = (int)resource.FactionOrMobileId; summary.FixedEnemyType = MobileTypes.None; // TEMP: Add name seed summary.NameSeed = (int)resource.Position; // Set data of fixed mobile types (e.g. non-random enemy spawn) if (resource.TextureArchive == 199) { if (resource.TextureRecord == 16) { summary.IsMobile = true; summary.EditorFlatType = EditorFlatTypes.FixedMobile; summary.FixedEnemyType = (MobileTypes)(summary.FactionOrMobileID & 0xff); } else if (resource.TextureRecord == 10) // Start marker. Holds data for dungeon block water level and castle block status. { if (resource.SoundIndex != 0) { summary.WaterLevel = (short)(-8 * resource.SoundIndex); } else { summary.WaterLevel = 10000; // no water } summary.CastleBlock = (resource.Magnitude != 0); } } }
private static void AddActionFlatHelper( GameObject go, Dictionary <int, ActionLink> actionLinkDict, ref DFBlock blockData, DFBlock.RdbObject rdbObj, bool serialize = true) { DFBlock.RdbFlatResource obj = rdbObj.Resources.FlatResource; string description = "FLT"; int soundID_Index = obj.Sound_index; float duration = 0.0f; float magnitude = obj.Magnitude; int axis = obj.Magnitude; DFBlock.RdbTriggerFlags triggerFlag = DFBlock.RdbTriggerFlags.None; DFBlock.RdbActionFlags actionFlag = DFBlock.RdbActionFlags.None; //set action flag if valid / known if (Enum.IsDefined(typeof(DFBlock.RdbActionFlags), (DFBlock.RdbActionFlags)obj.Action)) { actionFlag = (DFBlock.RdbActionFlags)obj.Action; } //set trigger flag if valid / known if (Enum.IsDefined(typeof(DFBlock.RdbTriggerFlags), (DFBlock.RdbTriggerFlags)obj.TriggerFlag)) { triggerFlag = (DFBlock.RdbTriggerFlags)obj.TriggerFlag; } //add action node to actionLink dictionary if (!actionLinkDict.ContainsKey(rdbObj.This)) { ActionLink link; link.nextKey = obj.NextObjectOffset; link.prevKey = -1; link.gameObject = go; actionLinkDict.Add(rdbObj.This, link); } // Create unique LoadID for save sytem long loadID = 0; if (serialize) { loadID = (blockData.Index << 24) + rdbObj.This; } AddAction(go, description, soundID_Index, duration, magnitude, axis, triggerFlag, actionFlag, loadID); }
/// <summary> /// Sets extended data about billboard from RDB flat resource data. /// </summary> public void SetResourceData(DFBlock.RdbFlatResource resource) { // Fixed mobile types if (resource.TextureArchive == 199 && resource.TextureRecord == 16) { summary.IsMobile = true; summary.Gender = (int)resource.Gender; summary.FactionMobileID = (int)resource.FactionMobileId; summary.EditorFlatType = EditorFlatTypes.FixedMobile; summary.FixedEnemyType = (MobileTypes)(summary.FactionMobileID & 0xff); } else { summary.FixedEnemyType = MobileTypes.None; } }
/// <summary> /// Sets extended data about billboard from RDB flat resource data. /// </summary> public void SetRDBResourceData(DFBlock.RdbFlatResource resource) { // Add common data summary.Flags = resource.Flags; summary.FactionOrMobileID = (int)resource.FactionOrMobileId; summary.FixedEnemyType = MobileTypes.None; // TEMP: Add name seed summary.NameSeed = (int)resource.Position; // Set data of fixed mobile types (e.g. non-random enemy spawn) if (resource.TextureArchive == 199 && resource.TextureRecord == 16) { summary.IsMobile = true; summary.EditorFlatType = EditorFlatTypes.FixedMobile; summary.FixedEnemyType = (MobileTypes)(summary.FactionOrMobileID & 0xff); } }
/// <summary> /// Sets extended data about billboard from RDB flat resource data. /// </summary> public void SetResourceData(DFBlock.RdbFlatResource resource) { // Add common data summary.Gender = (int)resource.Gender; summary.FactionMobileID = (int)resource.FactionMobileId; summary.FixedEnemyType = MobileTypes.None; // If flat has gender and faction this is an NPC if (summary.Gender != 0 && summary.FactionMobileID != 0) { summary.FlatType = FlatTypes.NPC; } // Set data of fixed mobile types (e.g. non-random enemy spawn) if (resource.TextureArchive == 199 && resource.TextureRecord == 16) { summary.IsMobile = true; summary.EditorFlatType = EditorFlatTypes.FixedMobile; summary.FixedEnemyType = (MobileTypes)(summary.FactionMobileID & 0xff); } }
/// <summary> /// Sets extended data about billboard from RDB flat resource data. /// </summary> public void SetResourceData(DFBlock.RdbFlatResource resource) { // Add common data summary.Gender = (int)resource.Gender; summary.FactionMobileID = (int)resource.FactionMobileId; summary.FixedEnemyType = MobileTypes.None; // If flat has gender and faction this is an NPC // Exlude editor flats, currently unknown why some start markers have gender or faction if (summary.Archive != Utility.TextureReader.EditorFlatsTextureArchive && summary.Gender != 0 && summary.FactionMobileID != 0) { summary.FlatType = FlatTypes.NPC; } // Set data of fixed mobile types (e.g. non-random enemy spawn) if (resource.TextureArchive == 199 && resource.TextureRecord == 16) { summary.IsMobile = true; summary.EditorFlatType = EditorFlatTypes.FixedMobile; summary.FixedEnemyType = (MobileTypes)(summary.FactionMobileID & 0xff); } }
/// <summary> /// Sets extended data about billboard from RDB flat resource data. /// </summary> public abstract void SetRDBResourceData(DFBlock.RdbFlatResource resource);