예제 #1
0
        public HfAbducted(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "target_hfid": Target = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "snatcher_hfid": Snatcher = 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;
                }
            }

            Target.AddEvent(this);
            Snatcher.AddEvent(this);
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
예제 #2
0
        public HfRelationShipDenied(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 "seeker_hfid":
                    Seeker = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

                case "target_hfid":
                    Target = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

                case "relationship":
                    Relationship = property.Value;
                    break;

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

                case "reason_id":
                    ReasonHf = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;
                }
            }

            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
            Seeker.AddEvent(this);
            Target.AddEvent(this);
            if (ReasonHf != null && !ReasonHf.Equals(Seeker) && !ReasonHf.Equals(Target))
            {
                ReasonHf.AddEvent(this);
            }
        }
예제 #3
0
        public HfDoesInteraction(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "doer_hfid": Doer = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "target_hfid": Target = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "interaction": Interaction = property.Value; break;

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

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

                case "interaction_action": InteractionAction = property.Value.Replace("[IS_HIST_STRING_1:", "").Replace("[IS_HIST_STRING_2:", "").Replace("]", ""); break;

                case "interaction_string": InteractionString = property.Value.Replace("[IS_HIST_STRING_2:", "").Replace("[I_TARGET:A:CREATURE", "").Replace("]", ""); break;

                case "source": Source = property.Value; break;

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

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

            if (Target != null)
            {
                string creatureType = "";
                if (!string.IsNullOrWhiteSpace(Interaction))
                {
                    if (!Target.ActiveInteractions.Contains(Interaction))
                    {
                        Target.ActiveInteractions.Add(Interaction);
                    }
                    if (Doer != null)
                    {
                        Doer.LineageCurseChilds.Add(Target);
                        Target.LineageCurseParent = Doer;
                    }

                    if (Interaction.Contains("VAMPIRE"))
                    {
                        creatureType = "vampire";
                    }
                    if (Interaction.Contains("WEREBEAST"))
                    {
                        creatureType = "werebeast";
                    }
                    if (Interaction.Contains("SECRET"))
                    {
                        creatureType = "necromancer";
                    }
                    if (Interaction.Contains("ANIMATE"))
                    {
                        creatureType = "animated corpse";
                    }
                    if (Interaction.Contains("UNDEAD_RES"))
                    {
                        creatureType = "resurrected undead";
                    }
                }
                if (!string.IsNullOrWhiteSpace(InteractionAction) && InteractionAction.Contains(", passing on the "))
                {
                    Target.Interaction = InteractionAction.Replace(", passing on the ", "");
                    if (!string.IsNullOrEmpty(Target.Interaction))
                    {
                        creatureType = "were" + Target.Interaction.Replace(" monster curse", " ");
                    }
                }
                else if (!string.IsNullOrWhiteSpace(InteractionString) && InteractionString.Contains(" to assume the form of a "))
                {
                    Target.Interaction = InteractionString.Replace(" to assume the form of a ", "").Replace("-like", "").Replace(" every full moon", " curse");
                    if (!string.IsNullOrEmpty(Target.Interaction))
                    {
                        creatureType = "were" + Target.Interaction.Replace(" monster curse", " ");
                    }
                }

                if (!string.IsNullOrEmpty(creatureType))
                {
                    Target.CreatureTypes.Add(new HistoricalFigure.CreatureType(creatureType, this));
                }
            }
            Doer.AddEvent(this);
            Target.AddEvent(this);
            Region.AddEvent(this);
            Site.AddEvent(this);
        }
예제 #4
0
        public HfDoesInteraction(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "doer_hfid": Doer = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "target_hfid": Target = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "interaction": Interaction = property.Value; break;

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

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

                case "interaction_action": InteractionAction = property.Value.Replace("[IS_HIST_STRING_1:", "").Replace("[IS_HIST_STRING_2:", "").Replace("]", ""); break;

                case "interaction_string": InteractionString = property.Value.Replace("[IS_HIST_STRING_2:", "").Replace("[I_TARGET:A:CREATURE", "").Replace("]", ""); break;

                case "source": Source = property.Value; break;

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

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

            if (Target != null && !string.IsNullOrWhiteSpace(Interaction))
            {
                if (!Target.ActiveInteractions.Contains(Interaction))
                {
                    Target.ActiveInteractions.Add(Interaction);
                }
                if (Doer != null)
                {
                    Doer.LineageCurseChilds.Add(Target);
                    Target.LineageCurseParent = Doer;
                }
            }
            if (Target != null && !string.IsNullOrWhiteSpace(InteractionAction))
            {
                if (InteractionAction.Contains(", passing on the "))
                {
                    Target.Interaction = InteractionAction.Replace(", passing on the ", "");
                }
                else if (InteractionString.Contains(" to assume the form of a "))
                {
                    Target.Interaction = InteractionString.Replace(" to assume the form of a ", "").Replace("-like", "").Replace(" every full moon", " curse");
                }
            }
            Doer.AddEvent(this);
            Target.AddEvent(this);
            Region.AddEvent(this);
            Site.AddEvent(this);
        }
예제 #5
0
        public AssumeIdentity(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "identity_id":
                    IdentityId = Convert.ToInt32(property.Value);
                    break;

                case "target_enid":
                    Target = world.GetEntity(Convert.ToInt32(property.Value));
                    break;

                case "identity_histfig_id":
                case "identity_nemesis_id":
                case "trickster_hfid":
                case "trickster":
                    if (Trickster == null)
                    {
                        Trickster = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    }
                    break;

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

                case "identity_name":
                    IdentityName = property.Value;
                    break;

                case "identity_race":
                    IdentityRace = world.GetCreatureInfo(property.Value);
                    break;

                case "identity_caste":
                    IdentityCaste = string.Intern(Formatting.InitCaps(property.Value.ToLower().Replace('_', ' ')));
                    break;
                }
            }

            Trickster.AddEvent(this);
            Target.AddEvent(this);
            if (!string.IsNullOrEmpty(IdentityName))
            {
                Identity = new Identity(IdentityName, IdentityRace, IdentityCaste);
            }
        }