예제 #1
0
        public CreatureDevoured(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 "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break;

                case "feature_layer_id": UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value)); break;

                case "victim": Victim = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "eater": Eater = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "entity": Entity = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "race": Race = property.Value.Replace("_", " "); break;

                case "caste": Caste = property.Value; break;

                case "site": if (Site == null)
                    {
                        Site = world.GetSite(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;
                }
            }

            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
            Eater.AddEvent(this);
            Victim.AddEvent(this);
            Entity.AddEvent(this);
        }
예제 #2
0
        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);
            }
        }