示例#1
0
        public RemoveHfSiteLink(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 "structure": StructureId = Convert.ToInt32(property.Value); break;

                case "civ": Civ = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "histfig": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "link_type":
                    switch (property.Value)
                    {
                    case "lair": LinkType = SiteLinkType.Lair; break;

                    case "hangout": LinkType = SiteLinkType.Hangout; break;

                    case "home_site_building": LinkType = SiteLinkType.HomeSiteBuilding; break;

                    case "home_site_underground": LinkType = SiteLinkType.HomeSiteUnderground; break;

                    case "home_structure": LinkType = SiteLinkType.HomeStructure; break;

                    case "seat_of_power": LinkType = SiteLinkType.SeatOfPower; break;

                    case "occupation": LinkType = SiteLinkType.Occupation; break;

                    case "home_site_realization_building": LinkType = SiteLinkType.HomeSiteRealizationBuilding; break;

                    case "home_site_abstract_building": LinkType = SiteLinkType.HomeSiteAbstractBuilding; break;

                    default:
                        property.Known = false;
                        break;
                    }
                    break;

                case "site": if (Site == null)
                    {
                        Site = world.GetSite(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;
                }
            }
            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            HistoricalFigure.AddEvent(this);
            Civ.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
        }
示例#2
0
        public HfCarouse(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "group_hfid":
                    GroupHf = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

                case "site_id":
                    Site = world.GetSite(Convert.ToInt32(property.Value));
                    break;

                case "structure_id":
                    StructureId = 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;
                }
            }

            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            GroupHf.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
示例#3
0
        public EntityCreated(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "entity_id": Entity = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "structure_id": StructureId = Convert.ToInt32(property.Value); break;

                case "creator_hfid": Creator = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;
                }
            }
            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
                if (Entity != null && Structure != null)
                {
                    Entity.OriginStructure = Structure;
                }
            }
            Entity.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
        }
示例#4
0
        public ArtifactFound(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "artifact_id":
                    Artifact = world.GetArtifact(Convert.ToInt32(property.Value));
                    break;

                case "hist_figure_id":
                    HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

                case "site_id":
                    Site = world.GetSite(Convert.ToInt32(property.Value));
                    break;

                case "site_property_id":
                    SitePropertyId = Convert.ToInt32(property.Value);
                    break;

                case "structure_id":
                    StructureId = Convert.ToInt32(property.Value);
                    break;

                case "unit_id":
                    UnitId = Convert.ToInt32(property.Value);
                    if (UnitId != -1)
                    {
                        property.Known = false;
                    }
                    break;

                case "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break;

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

            if (Site != null)
            {
                Structure    = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
                SiteProperty = Site.SiteProperties.FirstOrDefault(sp => sp.Id == SitePropertyId);
            }
            Artifact.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
        public HfPrayedInsideStructure(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "histfig":
                case "hist_fig_id":
                    if (HistoricalFigure == null)
                    {
                        HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    }
                    break;

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

                case "structure":
                case "structure_id":
                    StructureId = Convert.ToInt32(property.Value);
                    break;

                case "action":
                    Action = property.Value;
                    break;
                }
            }

            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
        }
示例#6
0
        public ChangeHfBodyState(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "hfid": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "body_state":
                    switch (property.Value)
                    {
                    case "entombed at site": BodyState = BodyState.EntombedAtSite; break;

                    default:
                        BodyState         = BodyState.Unknown;
                        _unknownBodyState = property.Value;
                        world.ParsingErrors.Report("Unknown HF Body State: " + _unknownBodyState);
                        break;
                    }
                    break;

                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "structure_id":
                case "building_id":
                    StructureId = 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 "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break;
                }
            }
            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            Structure.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
示例#7
0
        public ModifiedBuilding(List <Property> properties, World world) : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "modifier_hfid": ModifierHf = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "structure_id": StructureId = Convert.ToInt32(property.Value); break;

                case "modification": Modification = property.Value; break;
                }
            }

            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            ModifierHf.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
        }
示例#8
0
        public ItemStolen(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "histfig": Thief = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

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

                case "item":
                    Artifact = world.GetArtifact(Convert.ToInt32(property.Value));
                    break;

                case "item_type": ItemType = property.Value.Replace("_", " "); break;

                case "item_subtype": ItemSubType = property.Value; break;

                case "mat": Material = property.Value; break;

                case "mattype": MaterialType = Convert.ToInt32(property.Value); break;

                case "matindex": MaterialIndex = Convert.ToInt32(property.Value); break;

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

                case "structure": StructureId = Convert.ToInt32(property.Value); break;

                case "circumstance":
                    switch (property.Value)
                    {
                    case "historical event collection":
                        Circumstance = Circumstance.HistoricalEventCollection;
                        break;

                    case "defeated hf":
                        Circumstance = Circumstance.DefeatedHf;
                        break;

                    case "murdered hf":
                        Circumstance = Circumstance.MurderedHf;
                        break;

                    default:
                        if (property.Value != "-1")
                        {
                            property.Known = false;
                        }
                        break;
                    }
                    break;

                case "circumstance_id":
                    CircumstanceId = Convert.ToInt32(property.Value);
                    break;

                case "reason":
                    if (property.Value != "-1")
                    {
                        property.Known = false;
                    }
                    break;

                case "reason_id":
                    if (property.Value != "-1")
                    {
                        property.Known = false;
                    }
                    break;
                }
            }
            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            Thief.AddEvent(this);
            Site.AddEvent(this);
            Entity.AddEvent(this);
            Structure.AddEvent(this);
            Artifact.AddEvent(this);
        }
示例#9
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);
            }
        }
示例#10
0
        public TacticalSituation(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "a_tactician_hfid": AttackerTactician = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "d_tactician_hfid": DefenderTactician = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "a_tactics_roll": AttackerTacticsRoll = Convert.ToInt32(property.Value); break;

                case "d_tactics_roll": DefenderTacticsRoll = Convert.ToInt32(property.Value); break;

                case "situation":
                    switch (property.Value)
                    {
                    case "neither favored":
                        Situation = TacticalSituationType.NeitherFavored;
                        break;

                    case "a slightly favored":
                        Situation = TacticalSituationType.AttackersSlightlyFavored;
                        break;

                    case "d slightly favored":
                        Situation = TacticalSituationType.DefendersSlightlyFavored;
                        break;

                    case "a strongly favored":
                        Situation = TacticalSituationType.AttackersStronglyFavored;
                        break;

                    case "d strongly favored":
                        Situation = TacticalSituationType.DefendersStronglyFavored;
                        break;

                    default:
                        property.Known = false;
                        break;
                    }
                    break;

                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "structure_id": StructureId = 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 "start":
                    // TODO last checked in version 0.44.10
                    property.Known = true;
                    break;
                }
            }
            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            AttackerTactician.AddEvent(this);
            DefenderTactician.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
示例#11
0
        public CreatedStructure(List <Property> properties, World world) : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "structure_id": StructureId = Convert.ToInt32(property.Value); break;

                case "civ_id": Civ = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "site_civ_id": SiteEntity = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "builder_hfid": Builder = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "structure": StructureId = Convert.ToInt32(property.Value); break;

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

                case "civ": if (Civ == null)
                    {
                        Civ = world.GetEntity(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

                case "site_civ": if (SiteEntity == null)
                    {
                        SiteEntity = world.GetEntity(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

                case "builder_hf": if (Builder == null)
                    {
                        Builder = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

                case "rebuilt":
                    property.Known = true;
                    Rebuilt        = true;
                    break;
                }
            }

            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            Civ.AddEvent(this);
            SiteEntity.AddEvent(this);
            Site.AddEvent(this);
            Builder.AddEvent(this);
            Structure.AddEvent(this);
        }
示例#12
0
        public SquadVsSquad(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "a_hfid": AttackerHistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "d_hfid": DefenderHistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "a_squad_id": AttackerSquadId = Convert.ToInt32(property.Value); break;

                case "d_squad_id": DefenderSquadId = Convert.ToInt32(property.Value); break;

                case "d_race": DefenderRaceId = Convert.ToInt32(property.Value); break;

                case "d_interaction":
                    // TODO last checked in version 0.44.10
                    property.Known = true;
                    break;

                case "d_effect":
                    // TODO last checked in version 0.44.10
                    property.Known = true;
                    break;

                case "d_number": DefenderNumber = Convert.ToInt32(property.Value); break;

                case "d_slain": DefenderSlain = Convert.ToInt32(property.Value); break;

                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "structure_id": StructureId = 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 "a_leader_hfid": AttackerLeader = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "d_leader_hfid": DefenderLeader = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "a_leadership_roll": AttackerLeadershipRoll = Convert.ToInt32(property.Value); break;

                case "d_leadership_roll": DefenderLeadershipRoll = Convert.ToInt32(property.Value); break;
                }
            }
            if (Site != null)
            {
                Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
            }
            AttackerHistoricalFigure.AddEvent(this);
            DefenderHistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
            if (AttackerLeader != AttackerHistoricalFigure)
            {
                AttackerLeader.AddEvent(this);
            }

            if (DefenderLeader != DefenderHistoricalFigure)
            {
                DefenderLeader.AddEvent(this);
            }
        }