Beispiel #1
0
        static void LoadCustomPortraits()
        {
            if (!settings.ShowCustomPortraits)
            {
                return;
            }

            var charGen         = BlueprintRoot.Instance.CharGen;
            var customPortraits = new List <BlueprintPortrait>();

            using (var md5 = MD5.Create())
            {
                foreach (var id in CustomPortraitsManager.Instance.GetExistingCustomPortraitIds())
                {
                    var portrait = UnityEngine.Object.Instantiate(charGen.CustomPortrait);
                    portrait.name = $"CustomPortrait${id}";

                    BigInteger bigInt;
                    var        guid = BigInteger.TryParse(id, out bigInt) ? id : GetMd5Hash(md5, id);
                    library.AddAsset(portrait, Helpers.MergeIds("c3d4e15de2444b528c734fac8eb75ba2", guid));
                    portrait.Data = new PortraitData(id);
                    customPortraits.Add(portrait);
                }
            }

            if (customPortraits.Count > 0)
            {
                // Start a coroutine to preload the small sprite images.
                portraitLoader = new GameObject("PortraitLoader").AddComponent <PortraitLoader>();
                portraitLoader.Run(customPortraits);

                charGen.Portraits = charGen.Portraits.AddToArray(customPortraits);
            }
        }
Beispiel #2
0
        static public void create()
        {
            Main.DebugLog("Creating Flying Blade archetype");
            flying_blade = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "FlyingBladeArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Flying Blade");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "While most swashbucklers prefer their battles up close, others prefer dealing death from a distance.");
            });
            SetField(flying_blade, "m_ParentClass", Swashbuckler.swashbuckler_class);
            library.AddAsset(flying_blade, "fbe20107f5f24a47aed0dc5836862758");

            flying_blade.ReplaceStartingEquipment = true;
            flying_blade.StartingItems            = new BlueprintItem[]
            {
                library.Get <BlueprintItem>("afbe88d27a0eb544583e00fa78ffb2c7"), //StuddedStandard
                library.Get <BlueprintItem>("aa514dbf4c3d61f4e9c0738bd4d373cb"), //DaggerStandard
                library.Get <BlueprintItem>("bc93a78d71bef084fa155e529660ed0d"), //PotionOfShieldOfFaith
                library.Get <BlueprintItem>("d52566ae8cbe8dc4dae977ef51c27d91"), //PotionOfCureLightWounds
            };

            //Create Features
            createFlyingPanache();
            createFlyingBladeTraining();
            createFlyingBladeMastery();
            createSubtleThrow();
            createDisruptingCounter();
            createPreciseThrow();
            createTargetedThrow();
            createBleedingWound();
            createPerfectThrow();

            flying_blade.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, Swashbuckler.panache, Swashbuckler.dodging_panache_deed),
                                                             Helpers.LevelEntry(3, Swashbuckler.kip_up_deed, Swashbuckler.menacing_swordplay_deed),
                                                             Helpers.LevelEntry(5, Swashbuckler.swashbuckler_weapon_training),
                                                             Helpers.LevelEntry(7, Swashbuckler.targeted_strike_deed),
                                                             Helpers.LevelEntry(9, Swashbuckler.swashbuckler_weapon_training),
                                                             Helpers.LevelEntry(13, Swashbuckler.swashbuckler_weapon_training),
                                                             Helpers.LevelEntry(15, Swashbuckler.perfect_thrust_deed),
                                                             Helpers.LevelEntry(17, Swashbuckler.swashbuckler_weapon_training),
                                                             Helpers.LevelEntry(20, Swashbuckler.swashbuckler_weapon_mastery), };

            flying_blade.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, flying_panache, subtle_throw_deed_first),
                                                          Helpers.LevelEntry(3, disrupting_counter_deed, precise_throw_deed),
                                                          Helpers.LevelEntry(5, flying_blade_training),
                                                          Helpers.LevelEntry(6, subtle_throw_deed_sixth),
                                                          Helpers.LevelEntry(7, targeted_throw_deed),
                                                          Helpers.LevelEntry(9, flying_blade_training),
                                                          Helpers.LevelEntry(11, bleeding_wound_deed),
                                                          Helpers.LevelEntry(13, flying_blade_training),
                                                          Helpers.LevelEntry(15, perfect_throw_deed),
                                                          Helpers.LevelEntry(17, flying_blade_training),
                                                          Helpers.LevelEntry(20, flying_blade_mastery), };

            Swashbuckler.swashbuckler_progression.UIDeterminatorsGroup = Swashbuckler.swashbuckler_progression.UIDeterminatorsGroup.AddToArray(flying_panache);
            Swashbuckler.swashbuckler_progression.UIGroups             = Swashbuckler.swashbuckler_progression.UIGroups.AddToArray(CreateUIGroup(flying_blade_training, flying_blade_mastery));
            Swashbuckler.swashbuckler_progression.UIGroups             = Swashbuckler.swashbuckler_progression.UIGroups.AddToArray(CreateUIGroup(subtle_throw_deed_first, subtle_throw_deed_sixth));
            Swashbuckler.swashbuckler_class.Archetypes = Swashbuckler.swashbuckler_class.Archetypes.AddToArray(flying_blade);
        }
Beispiel #3
0
        static void createSoftCoverFact()
        {
            var soft_cover_unit_fact = CallOfTheWild.Helpers.Create <BlueprintUnitFact>();

            soft_cover_unit_fact.name = "SoftCoverFact";
            soft_cover_unit_fact.SetName("Soft Cover");
            soft_cover_unit_fact.SetDescription("");
            library.AddAsset(soft_cover_unit_fact, "31a5d72594eb4b49aaad3b86c88f84cb");
            soft_cover_fact = new Fact(soft_cover_unit_fact);

            var partial_soft_cover_unit_fact = CallOfTheWild.Helpers.Create <BlueprintUnitFact>();

            partial_soft_cover_unit_fact.name = "PartialSoftCoverFact";
            partial_soft_cover_unit_fact.SetName("Partial Soft Cover");
            partial_soft_cover_unit_fact.SetDescription("");
            library.AddAsset(partial_soft_cover_unit_fact, "7e1f43698239476ba573054aa200bd94");
            partial_soft_cover_fact = new Fact(partial_soft_cover_unit_fact);
        }
        static void createFlyingFact()
        {
            var flying_unit_fact = Helpers.Create <BlueprintUnitFact>();

            flying_unit_fact.name = "FlyingUnitFact";
            flying_unit_fact.SetName("Flying");
            flying_unit_fact.SetDescription("");
            library.AddAsset(flying_unit_fact, "d0c3194ee46e4b55a6ea2140ebea4e05");
            flying_fact = new Fact(flying_unit_fact);
        }
Beispiel #5
0
        static void updateAttackConsiderations()
        {
            var ac_consideration = Helpers.Create <NewConsiderations.AcConsideration>();

            ac_consideration.name = "ACConsideration";
            library.AddAsset(ac_consideration, "");

            var unit_far_consideration = Helpers.Create <Kingmaker.Controllers.Brain.Blueprints.Considerations.DistanceConsideration>();

            unit_far_consideration.name = "TargetIsFarConsideration";
            unit_far_consideration.BaseScoreModifier = 1.0f;
            unit_far_consideration.MinDistance       = 2.0f; //~6 feet
            unit_far_consideration.MaxDistance       = 6.0f; //~18 feet
            unit_far_consideration.MinDistanceScore  = 0.0f;
            unit_far_consideration.MaxDistanceScore  = 1.0f;
            library.AddAsset(unit_far_consideration, "2e7554ef535d4485960424c779b5de58");

            var attack_actions = library.GetAllBlueprints().OfType <BlueprintAiAction>().Where(f => f.name.Contains("AttackAiAction")).ToArray();
            var charge_action  = library.Get <BlueprintAiCastSpell>("05003725a881c10419530387b6de5c9a");

            charge_action.BaseScore            = 1.3f;
            charge_action.TargetConsiderations = charge_action.TargetConsiderations.AddToArray(unit_far_consideration);
            attack_actions.AddToArray(charge_action);
            foreach (var attack_action in attack_actions)
            {
                attack_action.TargetConsiderations = attack_action.TargetConsiderations.AddToArray(ac_consideration);
            }
            var brains = library.GetAllBlueprints().OfType <BlueprintBrain>().ToArray();

            attack_actions = attack_actions.RemoveFromArray(charge_action);
            foreach (var b in brains)
            {
                var first_attack = b.Actions.Where(a => attack_actions.Contains(a)).FirstOrDefault();

                if (first_attack != null && !attack_actions.Contains(charge_action))
                {
                    b.Actions = b.Actions.AddToArray(charge_action);
                }
            }
        }
Beispiel #6
0
        static public void create()
        {
            Main.DebugLog("Creating Inspired Blade archetype");
            inspired_blade = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "InspiredBladeArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Inspired Blade");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "An inspired blade is both a force of personality and a sage of swordplay dedicated to the perfection of combat with the rapier. They use the science and geometry with swordplay to beautiful and deadly effect.");
            });
            SetField(inspired_blade, "m_ParentClass", Swashbuckler.swashbuckler_class);
            inspired_blade.OverrideAttributeRecommendations = true;
            inspired_blade.RecommendedAttributes            = new StatType[] { StatType.Dexterity, StatType.Charisma, StatType.Intelligence };
            library.AddAsset(inspired_blade, "9dbb6ac330874b358b2b041287f99d18");

            inspired_blade.ReplaceStartingEquipment = true;
            inspired_blade.StartingItems            = new BlueprintItem[]
            {
                library.Get <BlueprintItem>("afbe88d27a0eb544583e00fa78ffb2c7"), //StuddedStandard
                library.Get <BlueprintItem>("78aef04821150bd479314bc974ea73e2"), //Buckler
                library.Get <BlueprintItem>("bc93a78d71bef084fa155e529660ed0d"), //PotionOfShieldOfFaith
                library.Get <BlueprintItem>("d52566ae8cbe8dc4dae977ef51c27d91"), //PotionOfCureLightWounds
            };

            //Create Features
            createInspiredPanache();
            createInspiredFinesse();
            createRapierTraining();
            createRapierWeaponMastery();
            createInspiredStrike();

            inspired_blade.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, Swashbuckler.panache, Swashbuckler.swashbuckler_finesse),
                                                               Helpers.LevelEntry(5, Swashbuckler.swashbuckler_weapon_training),
                                                               Helpers.LevelEntry(9, Swashbuckler.swashbuckler_weapon_training),
                                                               Helpers.LevelEntry(11, Swashbuckler.bleeding_wound_deed),
                                                               Helpers.LevelEntry(13, Swashbuckler.swashbuckler_weapon_training),
                                                               Helpers.LevelEntry(17, Swashbuckler.swashbuckler_weapon_training),
                                                               Helpers.LevelEntry(20, Swashbuckler.swashbuckler_weapon_mastery), };

            inspired_blade.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, inspired_panache, inspired_finesse),
                                                            Helpers.LevelEntry(5, rapier_training),
                                                            Helpers.LevelEntry(9, rapier_training),
                                                            Helpers.LevelEntry(11, inspired_strike_deed),
                                                            Helpers.LevelEntry(13, rapier_training),
                                                            Helpers.LevelEntry(17, rapier_training),
                                                            Helpers.LevelEntry(20, rapier_weapon_mastery), };

            Swashbuckler.swashbuckler_progression.UIDeterminatorsGroup = Swashbuckler.swashbuckler_progression.UIDeterminatorsGroup.AddToArray(inspired_panache, inspired_finesse);
            Swashbuckler.swashbuckler_progression.UIGroups             = Swashbuckler.swashbuckler_progression.UIGroups.AddToArray(CreateUIGroup(rapier_training, rapier_weapon_mastery));
            Swashbuckler.swashbuckler_class.Archetypes = Swashbuckler.swashbuckler_class.Archetypes.AddToArray(inspired_blade);
        }
Beispiel #7
0
        static BlueprintAiCastSpell createCastSpellAction(string name, BlueprintAbility spell, Consideration[] actor_consideration, Consideration[] target_consideration,
                                                          float base_score = 1f, BlueprintAbility variant = null, int combat_count = 0, int cooldown_rounds = 0, string guid = "")
        {
            var action = CallOfTheWild.Helpers.Create <BlueprintAiCastSpell>();

            action.Ability              = spell;
            action.Variant              = variant;
            action.ActorConsiderations  = actor_consideration;
            action.TargetConsiderations = target_consideration;
            action.name           = name;
            action.BaseScore      = base_score;
            action.CombatCount    = combat_count;
            action.CooldownRounds = cooldown_rounds;
            library.AddAsset(action, guid);

            return(action);
        }
Beispiel #8
0
        static public void create()
        {
            Main.DebugLog("Creating Rostland Bravo archetype");
            rostland_bravo = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "RostlandBravoSwashbucklerArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Rostland Bravo");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "The Free City of Restov is host to numerous dueling schools, from the renowned Aldori Academy to tiny training grounds in blademasters’ homes. Students of these schools are notoriously competitive, and street-corner duels at dawn and dusk are a constant of Restov life. In most cases, while these “lesser schools” do not teach official Aldori techniques, their methods mesh well with that signature style. Unsurprisingly, many students eventually train in the Aldori style, whether because they aspire to join the swordlords’ ranks or simply for the challenge of mastering the legendary weapon. While some favor more technical approaches, others study flashier maneuvers, wielding the curved blade with artful flair. Disdainfully called “bravos” by classically trained rivals, students of this approach have claimed the label with pride. The Rostland bravos’ most advanced techniques bear dragon-themed names as a snub to traditionalist Aldori swordlords, who have never forgotten their crushing defeat by Choral the Conqueror’s dragons at the Valley of Fire.");
            });
            SetField(rostland_bravo, "m_ParentClass", Swashbuckler.swashbuckler_class);
            library.AddAsset(rostland_bravo, "8a2a3b210e5a4fc1b1429365515695fd");

            rostland_bravo.ReplaceStartingEquipment = true;
            rostland_bravo.StartingItems            = new BlueprintItem[]
            {
                library.Get <BlueprintItem>("afbe88d27a0eb544583e00fa78ffb2c7"), //StuddedStandard
                library.Get <BlueprintItem>("4697667a33a6774489e5265a955675a5"), //StandardDuelingSword
                library.Get <BlueprintItem>("bc93a78d71bef084fa155e529660ed0d"), //PotionOfShieldOfFaith
                library.Get <BlueprintItem>("d52566ae8cbe8dc4dae977ef51c27d91"), //PotionOfCureLightWounds
            };

            rostland_bravo.ReplaceClassSkills = true;
            rostland_bravo.ClassSkills        = new StatType[] { StatType.SkillMobility, StatType.SkillKnowledgeWorld, StatType.SkillPerception, StatType.SkillPersuasion };

            //Create Features
            createRostlandBravoProficiencies();
            createAldoriSwashbuckler();
            createInevitableVictory();
            createSweepingWindFeint();
            createDragonsRage();
            createTerrorOfTheGreatWyrm();

            rostland_bravo.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, Swashbuckler.swashbuckler_proficiencies),
                                                               Helpers.LevelEntry(3, Swashbuckler.menacing_swordplay_deed),
                                                               Helpers.LevelEntry(7, Swashbuckler.superior_feint_deed),
                                                               Helpers.LevelEntry(11, Swashbuckler.bleeding_wound_deed),
                                                               Helpers.LevelEntry(15, Swashbuckler.swashbucklers_edge_deed), };

            rostland_bravo.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, rostland_bravo_proficiencies, aldori_swashbuckler),
                                                            Helpers.LevelEntry(3, inevitable_victory_deed),
                                                            Helpers.LevelEntry(7, sweeping_wind_feint),
                                                            Helpers.LevelEntry(11, dragons_rage_deed),
                                                            Helpers.LevelEntry(15, terror_of_the_great_wyrm_deed), };
            Swashbuckler.swashbuckler_progression.UIDeterminatorsGroup = Swashbuckler.swashbuckler_progression.UIDeterminatorsGroup.AddToArray(rostland_bravo_proficiencies, aldori_swashbuckler);
        }
Beispiel #9
0
 public static void AddAsset(this LibraryScriptableObject library, BlueprintScriptableObject blueprint, String guid1, String guid2)
 {
     library.AddAsset(blueprint, Helpers.MergeIds(guid1, guid2));
 }