Exemplo n.º 1
0
        public ArtifactStored(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 "unit_id": UnitId = 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;
                }
            }

            Artifact.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
        }
Exemplo n.º 2
0
        public MasterpieceLost(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "histfig": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

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

                case "creation_event": CreationEvent = world.GetEvent(Convert.ToInt32(property.Value)) as MasterpieceItem; break;

                case "method":
                    Method = property.Value;
                    break;
                }
            }
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
        }
        public HfAskedAboutArtifact(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_fig_id":
                    HistoricalFigure = 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);
            }
            Artifact.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
Exemplo n.º 4
0
        }                               // TODO // legends_plus.xml

        public CreateEntityPosition(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "histfig": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

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

                case "site_civ": SiteCiv = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "position": Position = property.Value; break;

                case "reason": Reason = Convert.ToInt32(property.Value); break;
                }
            }
            HistoricalFigure.AddEvent(this);
            Civ.AddEvent(this);
            SiteCiv.AddEvent(this);
        }
Exemplo n.º 5
0
        public AddHfEntityHonor(List <Property> properties, World world) : base(properties, world)
        {
            HonorId = -1;
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "entity_id": Entity = world.GetEntity(Convert.ToInt32(property.Value)); break;

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

                case "honor_id": HonorId = Convert.ToInt32(property.Value); break;
                }
            }

            if (HonorId >= 0)
            {
                Honor = Entity.Honors.FirstOrDefault(h => h.Id == HonorId);
            }
            Entity.AddEvent(this);
            HistoricalFigure.AddEvent(this);
        }
Exemplo n.º 6
0
        public KnowledgeDiscovered(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 "knowledge":
                    Knowledge = property.Value.Split(':');
                    break;

                case "first":
                    First          = true;
                    property.Known = true;
                    break;
                }
            }

            HistoricalFigure.AddEvent(this);
        }
Exemplo n.º 7
0
        public ChangeHfJob(List <Property> properties, World world)
            : base(properties, world)
        {
            NewJob = "UNKNOWN JOB";
            OldJob = "UNKNOWN JOB";
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "hfid": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                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 "new_job": NewJob = string.Intern(property.Value.Replace("_", " ")); break;

                case "old_job": OldJob = string.Intern(property.Value.Replace("_", " ")); break;

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

            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
Exemplo n.º 8
0
        public CreatedSite(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "civ_id": Civ = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "resident_civ_id": ResidentCiv = 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;
                }
            }

            if (SiteEntity != null)
            {
                SiteEntity.Parent = Civ;
                Site.OwnerHistory.Add(new OwnerPeriod(Site, SiteEntity, Year, "founded"));
            }
            else if (Civ != null)
            {
                Site.OwnerHistory.Add(new OwnerPeriod(Site, Civ, Year, "founded"));
            }
            else if (Builder != null)
            {
                Site.OwnerHistory.Add(new OwnerPeriod(Site, Builder, Year, "constructed"));
            }
            Site.AddEvent(this);
            SiteEntity.AddEvent(this);
            Civ.AddEvent(this);
            Builder.AddEvent(this);
        }
Exemplo n.º 9
0
        public HfRecruitedUnitTypeForEntity(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 "entity_id": Entity = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "unit_type":
                    switch (property.Value)
                    {
                    case "monk":
                        UnitType = UnitType.Monk;
                        break;

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

                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;
                }
            }
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
Exemplo n.º 10
0
        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 => body.AddEvent(this));
            HistoricalFigure.AddEvent(this);
            Abuser.AddEvent(this);
        }
Exemplo n.º 11
0
        public ArtifactCreated(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":
                case "creator_hfid":
                    HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

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

                case "name_only": ReceivedName = true; property.Known = true; break;

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

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

                case "unit_id":
                case "creator_unit_id":
                    if (property.Value != "-1")
                    {
                        property.Known = true;
                    }
                    break;

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

                case "anon_4":
                case "sanctify_hf":
                    SanctifyFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

                case "reason":
                    switch (property.Value)
                    {
                    case "sanctify_hf":
                        Reason = ArtifactReason.SanctifyHistoricalFigure;
                        break;

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

                case "circumstance":
                    foreach (var subProperty in property.SubProperties)
                    {
                        switch (subProperty.Name)
                        {
                        case "type":
                            switch (subProperty.Value)
                            {
                            case "defeated":
                                Circumstance = Circumstance.DefeatedHf;
                                break;

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

                        case "defeated":
                            DefeatedFigure = world.GetHistoricalFigure(Convert.ToInt32(subProperty.Value));
                            break;
                        }
                    }
                    property.Known = true;
                    break;
                }
            }

            if (Artifact != null && HistoricalFigure != null)
            {
                Artifact.Creator = HistoricalFigure;
            }
            Artifact.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            SanctifyFigure.AddEvent(this);
            DefeatedFigure.AddEvent(this);
        }
Exemplo n.º 12
0
        public AddHfSiteLink(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                LinkType = SiteLinkType.Unknown;
                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.Replace("_", " "))
                    {
                    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);
        }
Exemplo n.º 13
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);
            }
        }
Exemplo n.º 14
0
        public HfDied(List <Property> properties, World world)
            : base(properties, world)
        {
            ItemId              = -1;
            ShooterItemId       = -1;
            SlayerItemId        = -1;
            SlayerShooterItemId = -1;
            SlayerRace          = "UNKNOWN";
            SlayerCaste         = "UNKNOWN";
            Cause = DeathCause.Unknown;
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "slayer_item_id": SlayerItemId = Convert.ToInt32(property.Value); break;

                case "slayer_shooter_item_id": SlayerShooterItemId = Convert.ToInt32(property.Value); break;

                case "cause":
                    switch (property.Value)
                    {
                    case "hunger": Cause = DeathCause.Starved; break;

                    case "struck": Cause = DeathCause.Struck; break;

                    case "murdered": Cause = DeathCause.Murdered; break;

                    case "old age": Cause = DeathCause.OldAge; break;

                    case "dragonfire": Cause = DeathCause.DragonsFire; break;

                    case "shot": Cause = DeathCause.Shot; break;

                    case "fire": Cause = DeathCause.Burned; break;

                    case "thirst": Cause = DeathCause.Thirst; break;

                    case "air": Cause = DeathCause.Suffocated; break;

                    case "blood": Cause = DeathCause.Bled; break;

                    case "cold": Cause = DeathCause.Cold; break;

                    case "crushed bridge": Cause = DeathCause.CrushedByABridge; break;

                    case "drown": Cause = DeathCause.Drowned; break;

                    case "infection": Cause = DeathCause.Infection; break;

                    case "obstacle": Cause = DeathCause.CollidedWithAnObstacle; break;

                    case "put to rest": Cause = DeathCause.PutToRest; break;

                    case "quitdead": Cause = DeathCause.StarvedQuit; break;

                    case "trap": Cause = DeathCause.Trap; break;

                    case "crushed": Cause = DeathCause.CaveIn; break;

                    case "cage blasted": Cause = DeathCause.InACage; break;

                    case "freezing water": Cause = DeathCause.FrozenInWater; break;

                    case "exec generic": Cause = DeathCause.ExecutedGeneric; break;

                    case "exec fed to beasts": Cause = DeathCause.ExecutedFedToBeasts; break;

                    case "exec burned alive": Cause = DeathCause.ExecutedBurnedAlive; break;

                    case "exec crucified": Cause = DeathCause.ExecutedCrucified; break;

                    case "exec drowned": Cause = DeathCause.ExecutedDrowned; break;

                    case "exec hacked to pieces": Cause = DeathCause.ExecutedHackedToPieces; break;

                    case "exec buried alive": Cause = DeathCause.ExecutedBuriedAlive; break;

                    case "exec beheaded": Cause = DeathCause.ExecutedBeheaded; break;

                    case "blood drained": Cause = DeathCause.DrainedBlood; break;

                    case "collapsed": Cause = DeathCause.Collapsed; break;

                    case "scared to death": Cause = DeathCause.ScaredToDeath; break;

                    case "scuttled": Cause = DeathCause.Scuttled; break;

                    case "flying object": Cause = DeathCause.FlyingObject; break;

                    case "slaughtered": Cause = DeathCause.Slaughtered; break;

                    case "melt": Cause = DeathCause.Melted; break;

                    case "spikes": Cause = DeathCause.Spikes; break;

                    case "heat": Cause = DeathCause.Heat; break;

                    case "vanish": Cause = DeathCause.Vanish; break;

                    case "cooling magma": Cause = DeathCause.CoolingMagma; break;

                    case "vehicle": Cause = DeathCause.Vehicle; break;

                    case "suicide drowned": Cause = DeathCause.SuicideDrowned; break;

                    case "suicide leaping": Cause = DeathCause.SuicideLeaping; break;

                    case "chasm": Cause = DeathCause.Chasm; break;

                    default: Cause = DeathCause.Unknown; UnknownCause = property.Value; world.ParsingErrors.Report("|==> Events 'hf died'/ \nUnknown Death Cause: " + UnknownCause); break;
                    }
                    break;

                case "slayer_race": SlayerRace = Formatting.FormatRace(property.Value); break;

                case "slayer_caste": SlayerCaste = property.Value; break;

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

                case "slayer_hfid": Slayer = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                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_hf": if (HistoricalFigure == null)
                    {
                        HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

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

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

                case "death_cause": property.Known = true; break;

                case "item": ItemId = Convert.ToInt32(property.Value); break;

                case "item_type": ItemType = property.Value; break;

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

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

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

                case "shooter_item": ShooterItemId = Convert.ToInt32(property.Value); break;

                case "shooter_item_type": ShooterItemType = property.Value; break;

                case "shooter_item_subtype": ShooterItemSubType = property.Value; break;

                case "shooter_mat": ShooterItemMaterial = property.Value; break;

                case "shooter_artifact_id": ShooterArtifact = world.GetArtifact(Convert.ToInt32(property.Value)); break;
                }
            }

            HistoricalFigure.AddEvent(this);
            if (HistoricalFigure.DeathCause == DeathCause.None)
            {
                HistoricalFigure.DeathCause = Cause;
            }

            if (Slayer != null)
            {
                if (HistoricalFigure != Slayer)
                {
                    Slayer.AddEvent(this);
                }
                Slayer.NotableKills.Add(this);
            }
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
            Artifact.AddEvent(this);
        }
Exemplo n.º 15
0
        public ArtifactCreated(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 "name_only": ReceivedName = true; property.Known = true; break;

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

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

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

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

                case "anon_4":
                    if (property.Value != "-1")
                    {
                        SanctifyFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    break;
                }
            }

            if (Artifact != null && HistoricalFigure != null)
            {
                Artifact.Creator = HistoricalFigure;
            }
            Artifact.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            SanctifyFigure.AddEvent(this);
        }
Exemplo n.º 16
0
        public RemoveHfEntityLink(List <Property> properties, World world)
            : base(properties, world)
        {
            LinkType = HfEntityLinkType.Unknown;
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "civ":
                case "civ_id":
                    Entity = world.GetEntity(Convert.ToInt32(property.Value));
                    break;

                case "histfig":
                    HistoricalFigure = world.GetHistoricalFigure(property.ValueAsInt());
                    break;

                case "link_type":
                    switch (property.Value.Replace("_", " "))
                    {
                    case "position":
                        LinkType = HfEntityLinkType.Position;
                        break;

                    case "prisoner":
                        LinkType = HfEntityLinkType.Prisoner;
                        break;

                    case "enemy":
                        LinkType = HfEntityLinkType.Enemy;
                        break;

                    case "member":
                        LinkType = HfEntityLinkType.Member;
                        break;

                    case "slave":
                        LinkType = HfEntityLinkType.Slave;
                        break;

                    case "squad":
                        LinkType = HfEntityLinkType.Squad;
                        break;

                    case "former member":
                        LinkType = HfEntityLinkType.FormerMember;
                        break;

                    default:
                        world.ParsingErrors.Report("Unknown HfEntityLinkType: " + property.Value);
                        break;
                    }
                    break;

                case "position":
                    Position = property.Value;
                    break;
                }
            }

            HistoricalFigure.AddEvent(this);
            Entity.AddEvent(this);
        }
Exemplo n.º 17
0
        public AddHfhfLink(List <Property> properties, World world)
            : base(properties, world)
        {
            LinkType = HistoricalFigureLinkType.Unknown;
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "hfid": HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "hfid_target": HistoricalFigureTarget = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "link_type":
                    HistoricalFigureLinkType linkType;
                    if (Enum.TryParse(Formatting.InitCaps(property.Value.Replace("_", " ")).Replace(" ", ""), out linkType))
                    {
                        LinkType = linkType;
                    }
                    else
                    {
                        world.ParsingErrors.Report("Unknown HF HF Link Type: " + property.Value);
                    }
                    break;

                case "histfig1":
                case "histfig2":
                    property.Known = true;
                    break;

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

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

            //Fill in LinkType by looking at related historical figures.
            if (LinkType == HistoricalFigureLinkType.Unknown && HistoricalFigure != HistoricalFigure.Unknown && HistoricalFigureTarget != HistoricalFigure.Unknown)
            {
                List <HistoricalFigureLink> historicalFigureToTargetLinks = HistoricalFigure.RelatedHistoricalFigures.Where(link => link.Type != HistoricalFigureLinkType.Child).Where(link => link.HistoricalFigure == HistoricalFigureTarget).ToList();
                HistoricalFigureLink        historicalFigureToTargetLink  = null;
                if (historicalFigureToTargetLinks.Count <= 1)
                {
                    historicalFigureToTargetLink = historicalFigureToTargetLinks.FirstOrDefault();
                }

                HfAbducted abduction = HistoricalFigureTarget.Events.OfType <HfAbducted>().FirstOrDefault(a => a.Snatcher == HistoricalFigure);
                if (historicalFigureToTargetLink != null && abduction == null)
                {
                    LinkType = historicalFigureToTargetLink.Type;
                }
                else if (abduction != null)
                {
                    LinkType = HistoricalFigureLinkType.Prisoner;
                }
            }

            HistoricalFigure.AddEvent(this);
            HistoricalFigureTarget.AddEvent(this);
        }
Exemplo n.º 18
0
        public ArtifactPossessed(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 "unit_id": UnitId = 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 "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break;

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

                case "reason":
                    switch (property.Value)
                    {
                    case "artifact is heirloom of family hfid":
                        ArtifactReason = ArtifactReason.ArtifactIsHeirloomOfFamilyHfid;
                        break;

                    case "artifact is symbol of entity position":
                        ArtifactReason = ArtifactReason.ArtifactIsSymbolOfEntityPosition;
                        break;

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

                case "reason_id":
                    ReasonId = Convert.ToInt32(property.Value);
                    break;

                case "circumstance":
                    switch (property.Value)
                    {
                    case "hf is dead":
                        Circumstance = Circumstance.HfIsDead;
                        break;

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

                case "circumstance_id":
                    CircumstanceId = Convert.ToInt32(property.Value);
                    break;
                }
            }
            switch (ArtifactReason)
            {
            case ArtifactReason.ArtifactIsHeirloomOfFamilyHfid:
                FamilyFigure = world.GetHistoricalFigure(ReasonId);
                FamilyFigure.AddEvent(this);
                break;

            case ArtifactReason.ArtifactIsSymbolOfEntityPosition:
                SymbolEntity = world.GetEntity(ReasonId);
                SymbolEntity.AddEvent(this);
                break;
            }
            switch (Circumstance)
            {
            case Circumstance.HfIsDead:
                FormerHolder = world.GetHistoricalFigure(CircumstanceId);
                if (FormerHolder != FamilyFigure)
                {
                    FormerHolder.AddEvent(this);
                }
                break;
            }
            Artifact.AddEvent(this);
            if (HistoricalFigure != HistoricalFigure.Unknown)
            {
                HistoricalFigure.AddEvent(this);
            }
            Site.AddEvent(this);
        }
Exemplo n.º 19
0
        public ChangeHfState(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "state":
                    switch (property.Value)
                    {
                    case "settled": State = HfState.Settled; break;

                    case "wandering": State = HfState.Wandering; break;

                    case "scouting": State = HfState.Scouting; break;

                    case "snatcher": State = HfState.Snatcher; break;

                    case "refugee": State = HfState.Refugee; break;

                    case "thief": State = HfState.Thief; break;

                    case "hunting": State = HfState.Hunting; break;

                    case "visiting": State = HfState.Visiting; break;

                    default: State = HfState.Unknown; property.Known = false; break;
                    }
                    break;

                case "substate": SubState = Convert.ToInt32(property.Value); break;

                case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break;

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

                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 "site": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "mood":
                    switch (property.Value)
                    {
                    case "macabre":
                        Mood = Mood.Macabre;
                        break;

                    case "secretive":
                        Mood = Mood.Secretive;
                        break;

                    case "insane":
                        Mood = Mood.Insane;
                        break;

                    case "possessed":
                        Mood = Mood.Possessed;
                        break;

                    case "berserk":
                        Mood = Mood.Berserk;
                        break;

                    case "fey":
                        Mood = Mood.Fey;
                        break;

                    case "melancholy":
                        Mood = Mood.Melancholy;
                        break;

                    case "fell":
                        Mood = Mood.Fell;
                        break;

                    case "catatonic":
                        Mood = Mood.Catatonic;
                        break;

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

                case "reason":
                    switch (property.Value)
                    {
                    case "failed mood":
                        Reason = ChangeHfStateReason.FailedMood;
                        break;

                    case "gather information":
                        Reason = ChangeHfStateReason.GatherInformation;
                        break;

                    case "be with master":
                        Reason = ChangeHfStateReason.BeWithMaster;
                        break;

                    case "flight":
                        Reason = ChangeHfStateReason.Flight;
                        break;

                    case "scholarship":
                        Reason = ChangeHfStateReason.Scholarship;
                        break;

                    case "on a pilgrimage":
                        Reason = ChangeHfStateReason.Pilgrimage;
                        break;

                    case "lack of sleep":
                        Reason = ChangeHfStateReason.LackOfSleep;
                        break;

                    default:
                        if (property.Value != "-1")
                        {
                            property.Known = false;
                        }
                        break;
                    }
                    break;
                }
            }
            if (HistoricalFigure != null)
            {
                HistoricalFigure.AddEvent(this);
                HistoricalFigure.States.Add(new HistoricalFigure.State(State, Year));
                HistoricalFigure.State lastState = HistoricalFigure.States.LastOrDefault();
                if (lastState != null)
                {
                    lastState.EndYear = Year;
                }

                HistoricalFigure.CurrentState = State;
            }
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
Exemplo n.º 20
0
        public HfWounded(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "woundee_hfid": Woundee = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "wounder_hfid": Wounder = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                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 "woundee": if (Woundee == null)
                    {
                        Woundee = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

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

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

                case "woundee_race": WoundeeRace = Convert.ToInt32(property.Value); break;

                case "woundee_caste": WoundeeCaste = Convert.ToInt32(property.Value); break;

                case "body_part": BodyPart = Convert.ToInt32(property.Value); break;

                case "injury_type": InjuryType = Convert.ToInt32(property.Value); break;

                case "part_lost": PartLost = Convert.ToInt32(property.Value); break;
                }
            }

            Woundee.AddEvent(this);
            Wounder.AddEvent(this);
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
Exemplo n.º 21
0
        public WrittenContentComposed(List <Property> properties, World world) : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "civ_id":
                    Civ = world.GetEntity(Convert.ToInt32(property.Value));
                    break;

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

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

                case "wc_id":
                    WrittenContentId = property.Value;
                    break;

                case "reason":
                    Reason = property.Value;
                    break;

                case "reason_id":
                    ReasonId = Convert.ToInt32(property.Value);
                    break;

                case "circumstance":
                    Circumstance = property.Value;
                    break;

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

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

            Civ.AddEvent(this);
            Site.AddEvent(this);
            Region.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            if (Reason == "glorify hf")
            {
                GlorifiedHf = world.GetHistoricalFigure(ReasonId);
                GlorifiedHf.AddEvent(this);
            }
            if (Circumstance == "pray to hf" || Circumstance == "dream about hf")
            {
                CircumstanceHf = world.GetHistoricalFigure(CircumstanceId);
                if (GlorifiedHf != null && GlorifiedHf != CircumstanceHf)
                {
                    CircumstanceHf.AddEvent(this);
                }
            }
        }