diff --git a/LegendaryDogsGenerateFriendOrFoe.cs b/LegendaryDogsGenerateFriendOrFoe.cs index ae6ea93..b69986f 100644 --- a/LegendaryDogsGenerateFriendOrFoe.cs +++ b/LegendaryDogsGenerateFriendOrFoe.cs @@ -78,15 +78,7 @@ public static string getLikeReason() public static string getRandomFaction(GameObject parent) { - List list = new List(Factions.FactionList.Count); - foreach (KeyValuePair Faction in Factions.FactionList) - { - if (Faction.Value.bVisible && !parent.pBrain.FactionMembership.ContainsKey(Faction.Key)) - { - list.Add(Faction.Key); - } - } - return list.GetRandomElement(); + return GenerateFriendOrFoe.getRandomFaction(parent); } } } diff --git a/LegendaryDogsGivesRep.cs b/LegendaryDogsGivesRep.cs index 26a4dd2..8817d65 100644 --- a/LegendaryDogsGivesRep.cs +++ b/LegendaryDogsGivesRep.cs @@ -19,23 +19,23 @@ public void ReplaceFactions() if (HeroPart.GoodFactionPenalty > 0) { GivesRepPart.ResetRelatedFactions(); - foreach (KeyValuePair Faction in Factions.FactionList) + foreach (FactionInfo Faction in Factions.loop()) { - if (Faction.Value.bVisible && !ParentObject.pBrain.FactionMembership.ContainsKey(Faction.Value.Name)) + if (Faction.bVisible && !ParentObject.pBrain.FactionMembership.ContainsKey(Faction.Name)) { FriendorFoe FoF = new FriendorFoe(); - FoF.faction = Faction.Value.Name; + FoF.faction = Faction.Name; FoF.status = "friend"; FoF.reason = "for being a " + HeroPart.VeryGoodText + " dog"; GivesRepPart.relatedFactions.Add(FoF); - if (ParentObject.pBrain.FactionFeelings.ContainsKey(Faction.Value.Name)) + if (ParentObject.pBrain.FactionFeelings.ContainsKey(Faction.Name)) { Dictionary factionFeelings = ParentObject.pBrain.FactionFeelings; - factionFeelings[Faction.Value.Name] += HeroPart.GoodFactionPenalty; + factionFeelings[Faction.Name] += HeroPart.GoodFactionPenalty; } else { - ParentObject.pBrain.FactionFeelings.Add(Faction.Value.Name, HeroPart.GoodFactionPenalty); + ParentObject.pBrain.FactionFeelings.Add(Faction.Name, HeroPart.GoodFactionPenalty); } } } diff --git a/workshop.json b/workshop.json index 5c94aab..d2516bb 100644 --- a/workshop.json +++ b/workshop.json @@ -1 +1 @@ -{"workshopId":1802123778,"Title":"Legendary Dogs","Description":"Ever think there aren't enough dogs in Qud? This mod fixes that!\n\nIntroducing: Legedary Dogs! This mod introduces a new type of dog, the Worg, a dog that has supernatural intelligence and ego, tapped into the psychic aether under the nose of Ptoh.\n\nAny place you can potentially find a dog you should also be able to find legendary dogs of the same type!\n\nTitle guide for legendary dogs (not worgs):\n\n- Playful, Energetic, Exciting, Wild: Increases move speed\n- Funny, Awkward, Clueless, Floppy-tongued: Has a unique descriptor\n- Clever: Can dig up water on the surface\n- Soft, Fluffy, Smooth, Warm: has a unique pet action descriptor\n- Loving, Caring, Loyal: Spawns with 5 extra dogsin their pack\n- Good: Friendly with all factions. Don't hurt them!\n\nAnything not listed here has no bonus associated with them.","Tags":"dog,pack,creature,animal,monster,legendary,good","Visibility":"0","ImagePath":"preview.png"} \ No newline at end of file +{"workshopId":1802123778,"Title":"Legendary Dogs","Description":"Ever think there aren't enough dogs in Qud? This mod fixes that!\n\nIntroducing: Legedary Dogs! This mod introduces a new type of dog, the Worg, a dog that has supernatural intelligence and ego, tapped into the psychic aether under the nose of Ptoh.\n\nAny place you can potentially find a dog you should also be able to find legendary dogs of the same type!\n\nTitle guide for legendary dogs (not worgs):\n\n- Playful, Energetic, Exciting, Wild: Increases move speed\n- Funny, Awkward, Clueless, Floppy-tongued: Has a unique descriptor\n- Clever: Can dig up water on the surface\n- Soft, Fluffy, Smooth, Warm: has a unique pet action descriptor\n- Loving, Caring, Loyal: Spawns with 5 extra dogsin their pack\n- Good: Friendly with all factions. Don't hurt them!\n\nAnything not listed here has no bonus associated with them.","Tags":"dog,pack,creature,animal,monster,legendary,good","Visibility":"2","ImagePath":"preview.png"} \ No newline at end of file