public ArtifactLost(List <Property> properties, World world) : base(properties, world) { int sitePropertyId = -1; foreach (Property property in properties) { switch (property.Name) { case "artifact_id": Artifact = world.GetArtifact(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_property_id": sitePropertyId = Convert.ToInt32(property.Value); break; } } if (Site != null && sitePropertyId != -1) { SiteProperty = Site.SiteProperties.FirstOrDefault(sp => sp.Id == sitePropertyId); } Artifact.AddEvent(this); Site.AddEvent(this); Region.AddEvent(this); UndergroundRegion.AddEvent(this); }
public HfViewedArtifact(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; } } if (Site != null) { Structure = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId); } Artifact.AddEvent(this); HistoricalFigure.AddEvent(this); Site.AddEvent(this); Structure.AddEvent(this); }
public ArtifactClaimFormed(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 "entity_id": Entity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "claim": switch (property.Value) { case "symbol": Claim = Claim.Symbol; break; case "heirloom": Claim = Claim.Heirloom; break; case "treasure": Claim = Claim.Heirloom; break; default: property.Known = false; break; } break; case "position_profile_id": PositionProfileId = Convert.ToInt32(property.Value); break; case "circumstance": Circumstance = property.Value; break; } } Artifact.AddEvent(this); HistoricalFigure.AddEvent(this); Entity.AddEvent(this); }
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 HfLearnsSecret(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "student_hfid": Student = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "teacher_hfid": Teacher = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "artifact_id": Artifact = world.GetArtifact(Convert.ToInt32(property.Value)); break; case "interaction": Interaction = property.Value; break; case "student": if (Student == null) { Student = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "teacher": if (Teacher == null) { Teacher = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "artifact": if (Artifact == null) { Artifact = world.GetArtifact(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "secret_text": SecretText = property.Value.Replace("[IS_NAME:", "").Replace("]", ""); break; } } Student.AddEvent(this); Student?.CreatureTypes.Add(new HistoricalFigure.CreatureType("necromancer", this)); Teacher.AddEvent(this); Artifact.AddEvent(this); }
public ArtifactLost(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 "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; } } Artifact.AddEvent(this); Site.AddEvent(this); }
public ArtifactCopied(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 "dest_site_id": DestSite = world.GetSite(Convert.ToInt32(property.Value)); break; case "dest_structure_id": DestStructureId = Convert.ToInt32(property.Value); break; case "dest_entity_id": DestEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "source_site_id": SourceSite = world.GetSite(Convert.ToInt32(property.Value)); break; case "source_structure_id": SourceStructureId = Convert.ToInt32(property.Value); break; case "source_entity_id": SourceEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "from_original": FromOriginal = true; property.Known = true; break; } } if (DestSite != null) { DestStructure = DestSite.Structures.FirstOrDefault(structure => structure.Id == DestStructureId); } if (SourceSite != null) { SourceStructure = SourceSite.Structures.FirstOrDefault(structure => structure.Id == SourceStructureId); } Artifact.AddEvent(this); DestSite.AddEvent(this); DestStructure.AddEvent(this); DestEntity.AddEvent(this); SourceSite.AddEvent(this); SourceStructure.AddEvent(this); SourceEntity.AddEvent(this); }
// http://www.bay12games.com/dwarves/mantisbt/view.php?id=11350 // 0011350: "artifact given" event sometimes has the same <giver_hist_figure_id> and <receiver_hist_figure_id> public ArtifactGiven(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 "giver_hist_figure_id": HistoricalFigureGiver = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "receiver_hist_figure_id": HistoricalFigureReceiver = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "giver_entity_id": EntityGiver = world.GetEntity(Convert.ToInt32(property.Value)); break; case "receiver_entity_id": EntityReceiver = world.GetEntity(Convert.ToInt32(property.Value)); break; case "reason": switch (property.Value) { case "cement bonds of friendship": ArtifactReason = ArtifactReason.CementBondsOfFriendship; break; case "part of trade negotiation": ArtifactReason = ArtifactReason.PartOfTradeNegotiation; break; default: property.Known = false; break; } break; } } Artifact.AddEvent(this); HistoricalFigureGiver.AddEvent(this); if (HistoricalFigureGiver != HistoricalFigureReceiver) { HistoricalFigureReceiver.AddEvent(this); } EntityGiver.AddEvent(this); EntityReceiver.AddEvent(this); }
public ArtifactDestroyed(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 "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; case "destroyer_enid": Destroyer = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; } } Site.AddEvent(this); Artifact.AddEvent(this); Destroyer.AddEvent(this); }
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); }
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); }
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); }
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); }
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); }
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); }