public BodyAbused(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break; case "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break; case "feature_layer_id": UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value)); break; case "site": if (Site == null) { Site = world.GetSite(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "civ": Abuser = world.GetEntity(Convert.ToInt32(property.Value)); break; case "bodies": Body = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "histfig": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "props_item_type": ItemType = property.Value; break; case "props_item_subtype": ItemSubType = property.Value; break; case "props_item_mat": Material = property.Value; break; case "abuse_type": AbuseTypeId = Convert.ToInt32(property.Value); break; case "props_pile_type": PileTypeId = Convert.ToInt32(property.Value); break; case "props_item_mat_type": MaterialTypeId = Convert.ToInt32(property.Value); break; case "props_item_mat_index": MaterialIndex = Convert.ToInt32(property.Value); break; } } Site.AddEvent(this); Region.AddEvent(this); UndergroundRegion.AddEvent(this); Body.AddEvent(this); HistoricalFigure.AddEvent(this); Abuser.AddEvent(this); }
public BodyAbused(List <Property> properties, World world) : base(properties, world) { Bodies = new List <HistoricalFigure>(); int structureId = -1; foreach (Property property in properties) { switch (property.Name) { case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break; case "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break; case "feature_layer_id": UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value)); break; case "site": if (Site == null) { Site = world.GetSite(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "civ": Abuser = world.GetEntity(Convert.ToInt32(property.Value)); break; case "victim_entity": Victim = world.GetEntity(Convert.ToInt32(property.Value)); break; case "bodies": Bodies.Add(world.GetHistoricalFigure(Convert.ToInt32(property.Value))); break; case "histfig": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "props_item_type": case "item_type": ItemType = property.Value; break; case "props_item_subtype": case "item_subtype": ItemSubType = property.Value; break; case "props_item_mat": case "item_mat": Material = property.Value; break; case "abuse_type": switch (property.Value) { case "0": case "impaled": AbuseType = AbuseType.Impaled; break; case "1": case "piled": AbuseType = AbuseType.Piled; break; case "2": case "flayed": AbuseType = AbuseType.Flayed; break; case "3": case "hung": AbuseType = AbuseType.Hung; break; case "4": case "mutilated": AbuseType = AbuseType.Mutilated; break; case "5": case "animated": AbuseType = AbuseType.Animated; break; default: property.Known = false; break; } break; case "pile_type": switch (property.Value) { case "gruesomesculpture": PileType = PileType.GruesomeSculpture; break; case "grislymound": PileType = PileType.GrislyMound; break; case "grotesquepillar": PileType = PileType.GrotesquePillar; break; default: property.Known = false; break; } break; case "props_pile_type": PileTypeId = Convert.ToInt32(property.Value); break; case "props_item_mat_type": MaterialTypeId = Convert.ToInt32(property.Value); break; case "props_item_mat_index": MaterialIndex = Convert.ToInt32(property.Value); break; case "tree": property.Known = true; // TODO no idea what this is break; case "structure": structureId = Convert.ToInt32(property.Value); break; case "interaction": property.Known = true; // TODO no idea what this is break; } } Site.AddEvent(this); Region.AddEvent(this); UndergroundRegion.AddEvent(this); Bodies.ForEach(body => { if (body != HistoricalFigure.Unknown) { body.AddEvent(this); if (AbuseType == AbuseType.Animated) { body.CreatureTypes.Add(new HistoricalFigure.CreatureType("animated corpse", this)); } } }); HistoricalFigure.AddEvent(this); Abuser.AddEvent(this); Victim.AddEvent(this); if (structureId != -1 && Site != null) { Structure = Site.Structures.FirstOrDefault(structure => structure.Id == structureId); Structure.AddEvent(this); } }
public BodyAbused(List <Property> properties, World world) : base(properties, world) { Bodies = new List <HistoricalFigure>(); foreach (Property property in properties) { switch (property.Name) { case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break; case "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break; case "feature_layer_id": UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value)); break; case "site": if (Site == null) { Site = world.GetSite(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "civ": Abuser = world.GetEntity(Convert.ToInt32(property.Value)); break; case "bodies": Bodies.Add(world.GetHistoricalFigure(Convert.ToInt32(property.Value))); break; case "histfig": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "props_item_type": ItemType = property.Value; break; case "props_item_subtype": ItemSubType = property.Value; break; case "props_item_mat": Material = property.Value; break; case "abuse_type": switch (property.Value) { case "0": AbuseType = AbuseType.Impaled; break; case "1": AbuseType = AbuseType.Piled; break; case "2": AbuseType = AbuseType.Flayed; break; case "3": AbuseType = AbuseType.Hung; break; case "4": AbuseType = AbuseType.Mutilated; break; case "5": AbuseType = AbuseType.Animated; break; default: property.Known = false; break; } break; case "props_pile_type": PileTypeId = Convert.ToInt32(property.Value); break; case "props_item_mat_type": MaterialTypeId = Convert.ToInt32(property.Value); break; case "props_item_mat_index": MaterialIndex = Convert.ToInt32(property.Value); break; } } Site.AddEvent(this); Region.AddEvent(this); UndergroundRegion.AddEvent(this); Bodies.ForEach(body => { if (body != HistoricalFigure.Unknown) { body.AddEvent(this); if (AbuseType == AbuseType.Animated) { body.CreatureTypes.Add(new HistoricalFigure.CreatureType("animated corpse", this)); } } }); HistoricalFigure.AddEvent(this); Abuser.AddEvent(this); }