Beispiel #1
0
        private void RegisterExtraStates()
        {
            //Artificer extra states
            if (Configuration.GetConfigValue(Configuration.EnableMageSkills))
            {
                //Artificer Zappot Fire State
                ContentAddition.AddEntityState <ZapportFireEntity>(out _);
                EggsUtils.EggsUtils.LogToConsole("Zapport fire state loaded!");
            }

            //Engi extra states
            if (Configuration.GetConfigValue(Configuration.EnableEngiSkills))
            {
                //Tesla mine arming states
                ContentAddition.AddEntityState <TeslaArmingUnarmedState>(out _);
                ContentAddition.AddEntityState <TeslaArmingWeakState>(out _);
                ContentAddition.AddEntityState <TeslaArmingFullState>(out _);
                //Main states
                ContentAddition.AddEntityState <TeslaArmState>(out _);
                ContentAddition.AddEntityState <TeslaWaitForStick>(out _);
                ContentAddition.AddEntityState <TeslaWaitForTargetState>(out _);
                ContentAddition.AddEntityState <TeslaPreDetState>(out _);
                ContentAddition.AddEntityState <TeslaDetonateState>(out _);
                EggsUtils.EggsUtils.LogToConsole("Tesla mine states loaded!");
            }
        }
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            rewindStateType = ContentAddition.AddEntityState <RewindState>(out _);
            R2API.Networking.NetworkingAPI.RegisterMessageType <MsgRewind>();

            blacklistedSkills = new[] {
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropHealing"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropHacking"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropShocking"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropEquipmentRestock"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CaptainSkillUsedUp"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CaptainCancelDummy")
            };

            rewindBuff            = ScriptableObject.CreateInstance <BuffDef>();
            rewindBuff.buffColor  = Color.white;
            rewindBuff.canStack   = true;
            rewindBuff.isDebuff   = false;
            rewindBuff.isCooldown = true;
            rewindBuff.name       = "TKSATRewind";
            rewindBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/MiscIcons/rewindBuffIcon.png");
            ContentAddition.AddBuffDef(rewindBuff);

            if (Compat_ClassicItems.enabled)
            {
                LanguageAPI.Add("TKSAT_REWIND_CI_EMBRYO_APPEND", "\n<style=cStack>Beating Embryo: 50% chance to not consume stock.</style>");
                Compat_ClassicItems.RegisterEmbryoHook(equipmentDef, "TKSAT_REWIND_CI_EMBRYO_APPEND", () => "TKSAT.CausalCamera");
            }
        }
Beispiel #3
0
        private void RegisterRexSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator rexSkillLocator       = rexRef.GetComponent <SkillLocator>();
            SkillFamily  rexSkillFamilySpecial = rexSkillLocator.special.skillFamily;

            //Directive Root
            GroundedSkillDef skillDefRoot = ScriptableObject.CreateInstance <GroundedSkillDef>();

            skillDefRoot.activationState            = new SerializableEntityStateType(typeof(DirectiveRoot));
            skillDefRoot.activationStateMachineName = "Weapon";
            skillDefRoot.baseMaxStock                 = 1;
            skillDefRoot.baseRechargeInterval         = 12f;
            skillDefRoot.beginSkillCooldownOnSkillEnd = true;
            skillDefRoot.fullRestockOnAssign          = false;
            skillDefRoot.interruptPriority            = InterruptPriority.Skill;
            skillDefRoot.isCombatSkill                = true;
            skillDefRoot.mustKeyPress                 = true;
            skillDefRoot.canceledFromSprinting        = true;
            skillDefRoot.cancelSprintingOnActivation  = true;
            skillDefRoot.forceSprintDuringState       = false;
            skillDefRoot.rechargeStock                = 1;
            skillDefRoot.requiredStock                = 1;
            skillDefRoot.stockToConsume               = 1;
            skillDefRoot.icon = Resources.Sprites.rexrootIconS;
            skillDefRoot.skillDescriptionToken = "REX_SPECIAL_ROOT_DESC";
            skillDefRoot.skillName             = "Root";
            skillDefRoot.skillNameToken        = "REX_SPECIAL_ROOT_NAME";
            skillDefRoot.keywordTokens         = new string[]
            {
                "KEYWORD_STUNNING",
                "KEYWORD_ADAPTIVE"
            };

            defList.Add(skillDefRoot);
            Array.Resize(ref rexSkillFamilySpecial.variants, rexSkillFamilySpecial.variants.Length + 1);
            rexSkillFamilySpecial.variants[rexSkillFamilySpecial.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefRoot,
                unlockableDef = UnlocksRegistering.rexRootUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefRoot.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <DirectiveRoot>(out _);
        }
Beispiel #4
0
        private void RegisterArtificerSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator artificerSkillLocator       = artificerRef.GetComponent <SkillLocator>();
            SkillFamily  artificerSkillFamilyUtility = artificerSkillLocator.utility.skillFamily;

            //Zapport
            SkillDef skillDefZapport = ScriptableObject.CreateInstance <SkillDef>();

            skillDefZapport.activationState            = new SerializableEntityStateType(typeof(ZapportChargeEntity));
            skillDefZapport.activationStateMachineName = "Weapon";
            skillDefZapport.baseMaxStock                 = 2;
            skillDefZapport.baseRechargeInterval         = 10f;
            skillDefZapport.beginSkillCooldownOnSkillEnd = true;
            skillDefZapport.fullRestockOnAssign          = false;
            skillDefZapport.interruptPriority            = InterruptPriority.PrioritySkill;
            skillDefZapport.isCombatSkill                = true;
            skillDefZapport.mustKeyPress                 = false;
            skillDefZapport.canceledFromSprinting        = false;
            skillDefZapport.cancelSprintingOnActivation  = true;
            skillDefZapport.forceSprintDuringState       = false;
            skillDefZapport.rechargeStock                = 1;
            skillDefZapport.requiredStock                = 1;
            skillDefZapport.stockToConsume               = 1;
            skillDefZapport.icon = Resources.Sprites.zapportIconS;
            skillDefZapport.skillDescriptionToken = "ARTIFICER_UTILITY_ZAPPORT_DESC";
            skillDefZapport.skillName             = "Zapport";
            skillDefZapport.skillNameToken        = "ARTIFICER_UTILITY_ZAPPORT_NAME";
            skillDefZapport.keywordTokens         = new string[]
            {
                "KEYWORD_STUNNING",
                "KEYWORD_ENHANCING"
            };

            defList.Add(skillDefZapport);
            Array.Resize(ref artificerSkillFamilyUtility.variants, artificerSkillFamilyUtility.variants.Length + 1);
            artificerSkillFamilyUtility.variants[artificerSkillFamilyUtility.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefZapport,
                unlockableDef = UnlocksRegistering.artificerZapportUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefZapport.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <ZapportChargeEntity>(out _);
        }
Beispiel #5
0
        private void RegisterMultSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator multSkillLocator         = multRef.GetComponent <SkillLocator>();
            SkillFamily  multSkillFamilySecondary = multSkillLocator.secondary.skillFamily;

            //NanobotSwarm
            NanoSkilldef skillDefNanoSwarm = ScriptableObject.CreateInstance <NanoSkilldef>();

            skillDefNanoSwarm.activationState            = new SerializableEntityStateType(typeof(NanobotEntity));
            skillDefNanoSwarm.activationStateMachineName = "Weapon";
            skillDefNanoSwarm.baseMaxStock                 = 1;
            skillDefNanoSwarm.baseRechargeInterval         = 12f;
            skillDefNanoSwarm.beginSkillCooldownOnSkillEnd = true;
            skillDefNanoSwarm.fullRestockOnAssign          = false;
            skillDefNanoSwarm.interruptPriority            = InterruptPriority.Skill;
            skillDefNanoSwarm.isCombatSkill                = true;
            skillDefNanoSwarm.mustKeyPress                 = true;
            skillDefNanoSwarm.canceledFromSprinting        = false;
            skillDefNanoSwarm.cancelSprintingOnActivation  = true;
            skillDefNanoSwarm.forceSprintDuringState       = false;
            skillDefNanoSwarm.rechargeStock                = 1;
            skillDefNanoSwarm.requiredStock                = 1;
            skillDefNanoSwarm.stockToConsume               = 1;
            skillDefNanoSwarm.icon = Resources.Sprites.nanoBotsIconS;
            skillDefNanoSwarm.skillDescriptionToken = "MULT_SECONDARY_NANOBOT_DESC";
            skillDefNanoSwarm.skillName             = "NanobotSwarm";
            skillDefNanoSwarm.skillNameToken        = "MULT_SECONDARY_NANOBOT_NAME";
            skillDefNanoSwarm.keywordTokens         = new string[]
            {
                "KEYWORD_MARKING"
            };

            defList.Add(skillDefNanoSwarm);
            Array.Resize(ref multSkillFamilySecondary.variants, multSkillFamilySecondary.variants.Length + 1);
            multSkillFamilySecondary.variants[multSkillFamilySecondary.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefNanoSwarm,
                unlockableDef = UnlocksRegistering.multNanobeaconUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefNanoSwarm.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <NanobotEntity>(out _);
        }
Beispiel #6
0
        private void RegisterHuntressSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator huntressSkillLocator         = huntressRef.GetComponent <SkillLocator>();
            SkillFamily  huntressSkillFamilySecondary = huntressSkillLocator.secondary.skillFamily;

            //Cluster bomb arrow
            HuntressTrackingSkillDef skillDefClusterArrow = ScriptableObject.CreateInstance <HuntressTrackingSkillDef>();

            skillDefClusterArrow.activationState            = new SerializableEntityStateType(typeof(ClusterBombArrow));
            skillDefClusterArrow.activationStateMachineName = "Weapon";
            skillDefClusterArrow.baseMaxStock                 = 1;
            skillDefClusterArrow.baseRechargeInterval         = 8f;
            skillDefClusterArrow.beginSkillCooldownOnSkillEnd = false;
            skillDefClusterArrow.fullRestockOnAssign          = false;
            skillDefClusterArrow.interruptPriority            = InterruptPriority.Skill;
            skillDefClusterArrow.isCombatSkill                = true;
            skillDefClusterArrow.mustKeyPress                 = false;
            skillDefClusterArrow.canceledFromSprinting        = false;
            skillDefClusterArrow.cancelSprintingOnActivation  = false;
            skillDefClusterArrow.forceSprintDuringState       = false;
            skillDefClusterArrow.rechargeStock                = 1;
            skillDefClusterArrow.requiredStock                = 1;
            skillDefClusterArrow.stockToConsume               = 1;
            skillDefClusterArrow.icon = Resources.Sprites.clusterArrowIconS;
            skillDefClusterArrow.skillDescriptionToken = "HUNTRESS_SECONDARY_CLUSTERARROW_DESC";
            skillDefClusterArrow.skillName             = "ClusterArrow";
            skillDefClusterArrow.skillNameToken        = "HUNTRESS_SECONDARY_CLUSTERARROW_NAME";
            skillDefClusterArrow.keywordTokens         = new string[]
            {
                "KEYWORD_AGILE"
            };

            defList.Add(skillDefClusterArrow);
            Array.Resize(ref huntressSkillFamilySecondary.variants, huntressSkillFamilySecondary.variants.Length + 1);
            huntressSkillFamilySecondary.variants[huntressSkillFamilySecondary.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefClusterArrow,
                unlockableDef = UnlocksRegistering.huntressClusterarrowUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefClusterArrow.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <ClusterBombArrow>(out _);
        }
Beispiel #7
0
        private void RegisterCaptainSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator captainSkillLocator         = captainRef.GetComponent <SkillLocator>();
            SkillFamily  captainSkillFamilySecondary = captainSkillLocator.secondary.skillFamily;

            //DebuffGrenade
            SkillDef skillDefDebuffnade = ScriptableObject.CreateInstance <SkillDef>();

            skillDefDebuffnade.activationState            = new SerializableEntityStateType(typeof(DebuffGrenadeEntity));
            skillDefDebuffnade.activationStateMachineName = "Weapon";
            skillDefDebuffnade.baseMaxStock                 = 1;
            skillDefDebuffnade.baseRechargeInterval         = 10f;
            skillDefDebuffnade.beginSkillCooldownOnSkillEnd = true;
            skillDefDebuffnade.fullRestockOnAssign          = false;
            skillDefDebuffnade.interruptPriority            = InterruptPriority.Skill;
            skillDefDebuffnade.isCombatSkill                = true;
            skillDefDebuffnade.mustKeyPress                 = false;
            skillDefDebuffnade.canceledFromSprinting        = false;
            skillDefDebuffnade.cancelSprintingOnActivation  = true;
            skillDefDebuffnade.forceSprintDuringState       = false;
            skillDefDebuffnade.rechargeStock                = 1;
            skillDefDebuffnade.requiredStock                = 1;
            skillDefDebuffnade.stockToConsume               = 1;
            skillDefDebuffnade.icon = Resources.Sprites.debuffNadeIconS;
            skillDefDebuffnade.skillDescriptionToken = "CAPTAIN_SECONDARY_DEBUFFNADE_DESC";
            skillDefDebuffnade.skillName             = "Debuffnade";
            skillDefDebuffnade.skillNameToken        = "CAPTAIN_SECONDARY_DEBUFFNADE_NAME";
            skillDefDebuffnade.keywordTokens         = new string[]
            {
                "KEYWORD_MARKING",
            };

            defList.Add(skillDefDebuffnade);
            Array.Resize(ref captainSkillFamilySecondary.variants, captainSkillFamilySecondary.variants.Length + 1);
            captainSkillFamilySecondary.variants[captainSkillFamilySecondary.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefDebuffnade,
                unlockableDef = UnlocksRegistering.captainDebuffnadeUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefDebuffnade.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <DebuffGrenadeEntity>(out _);
        }
Beispiel #8
0
        private void RegisterMercenarySkills()
        {
            SkillLocator mercSkillLocator       = mercenaryRef.GetComponent <SkillLocator>();
            SkillFamily  mercSkillFamilyUtility = mercSkillLocator.utility.skillFamily;

            //Slashport
            MercSlashportDef skillDefSlashport = ScriptableObject.CreateInstance <MercSlashportDef>();

            skillDefSlashport.activationState            = new SerializableEntityStateType(typeof(SlashportEntity));
            skillDefSlashport.activationStateMachineName = "Weapon";
            skillDefSlashport.baseMaxStock                 = 1;
            skillDefSlashport.baseRechargeInterval         = 9f;
            skillDefSlashport.beginSkillCooldownOnSkillEnd = true;
            skillDefSlashport.fullRestockOnAssign          = false;
            skillDefSlashport.interruptPriority            = InterruptPriority.PrioritySkill;
            skillDefSlashport.isCombatSkill                = true;
            skillDefSlashport.mustKeyPress                 = false;
            skillDefSlashport.canceledFromSprinting        = false;
            skillDefSlashport.cancelSprintingOnActivation  = false;
            skillDefSlashport.forceSprintDuringState       = false;
            skillDefSlashport.rechargeStock                = 1;
            skillDefSlashport.requiredStock                = 1;
            skillDefSlashport.stockToConsume               = 1;
            skillDefSlashport.icon = Resources.Sprites.slashportIconS;
            skillDefSlashport.skillDescriptionToken = "MERCENARY_UTILITY_SLASHPORT_DESC";
            skillDefSlashport.skillName             = "Slashport";
            skillDefSlashport.skillNameToken        = "MERCENARY_UTILITY_SLASHPORT_NAME";
            skillDefSlashport.keywordTokens         = new string[]
            {
                "KEYWORD_EXPOSE",
                "KEYWORD_STUNNING"
            };

            defList.Add(skillDefSlashport);
            Array.Resize(ref mercSkillFamilyUtility.variants, mercSkillFamilyUtility.variants.Length + 1);
            mercSkillFamilyUtility.variants[mercSkillFamilyUtility.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefSlashport,
                unlockableDef = UnlocksRegistering.mercSlashportUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefSlashport.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <SlashportEntity>(out _);
        }
Beispiel #9
0
        private void RegisterEngiSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator engiSkillLocator         = engineerRef.GetComponent <SkillLocator>();
            SkillFamily  engiSkillFamilySecondary = engiSkillLocator.secondary.skillFamily;

            SkillDef skillDefTeslamine = ScriptableObject.CreateInstance <SkillDef>();

            skillDefTeslamine.activationState            = new SerializableEntityStateType(typeof(TeslaMineFireState));
            skillDefTeslamine.activationStateMachineName = "Weapon";
            skillDefTeslamine.baseMaxStock                 = 4;
            skillDefTeslamine.baseRechargeInterval         = 10f;
            skillDefTeslamine.beginSkillCooldownOnSkillEnd = false;
            skillDefTeslamine.fullRestockOnAssign          = false;
            skillDefTeslamine.interruptPriority            = InterruptPriority.Skill;
            skillDefTeslamine.isCombatSkill                = true;
            skillDefTeslamine.mustKeyPress                 = false;
            skillDefTeslamine.canceledFromSprinting        = false;
            skillDefTeslamine.cancelSprintingOnActivation  = true;
            skillDefTeslamine.forceSprintDuringState       = false;
            skillDefTeslamine.rechargeStock                = 1;
            skillDefTeslamine.requiredStock                = 1;
            skillDefTeslamine.stockToConsume               = 1;
            skillDefTeslamine.icon = Resources.Sprites.teslaMineIconS;
            skillDefTeslamine.skillDescriptionToken = "ENGI_SECONDARY_TESLAMINE_DESC";
            skillDefTeslamine.skillName             = "TeslaMine";
            skillDefTeslamine.skillNameToken        = "ENGI_SECONDARY_TESLAMINE_NAME";
            skillDefTeslamine.keywordTokens         = new string[]
            {
                "KEYWORD_STUNNING"
            };

            defList.Add(skillDefTeslamine);
            Array.Resize(ref engiSkillFamilySecondary.variants, engiSkillFamilySecondary.variants.Length + 1);
            engiSkillFamilySecondary.variants[engiSkillFamilySecondary.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefTeslamine,
                unlockableDef = UnlocksRegistering.engiTeslaUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefTeslamine.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <TeslaMineFireState>(out _);
        }
Beispiel #10
0
        private void RegisterAcridSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator acridSkillLocator       = acridRef.GetComponent <SkillLocator>();
            SkillFamily  acridSkillFamilySpecial = acridSkillLocator.special.skillFamily;

            //AcridPurge
            AcridPurgeDef skillDefExpunge = ScriptableObject.CreateInstance <AcridPurgeDef>();

            skillDefExpunge.activationState            = new SerializableEntityStateType(typeof(AcridPurgeEntity));
            skillDefExpunge.activationStateMachineName = "Body";
            skillDefExpunge.baseMaxStock                 = 1;
            skillDefExpunge.baseRechargeInterval         = 12f;
            skillDefExpunge.beginSkillCooldownOnSkillEnd = false;
            skillDefExpunge.fullRestockOnAssign          = false;
            skillDefExpunge.interruptPriority            = InterruptPriority.Skill;
            skillDefExpunge.isCombatSkill                = true;
            skillDefExpunge.mustKeyPress                 = true;
            skillDefExpunge.canceledFromSprinting        = false;
            skillDefExpunge.cancelSprintingOnActivation  = false;
            skillDefExpunge.forceSprintDuringState       = false;
            skillDefExpunge.rechargeStock                = 1;
            skillDefExpunge.requiredStock                = 1;
            skillDefExpunge.stockToConsume               = 1;
            skillDefExpunge.icon = Resources.Sprites.acridpurgeIconS;
            skillDefExpunge.skillDescriptionToken = "ACRID_SPECIAL_PURGE_DESC";
            skillDefExpunge.skillName             = "Purge";
            skillDefExpunge.skillNameToken        = "ACRID_SPECIAL_PURGE_NAME";

            defList.Add(skillDefExpunge);
            Array.Resize(ref acridSkillFamilySpecial.variants, acridSkillFamilySpecial.variants.Length + 1);
            acridSkillFamilySpecial.variants[acridSkillFamilySpecial.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefExpunge,
                unlockableDef = UnlocksRegistering.acridExpungeUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefExpunge.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <AcridPurgeEntity>(out _);
        }
Beispiel #11
0
        private void RegisterLoaderSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator loaderSkillLocator       = loaderRef.GetComponent <SkillLocator>();
            SkillFamily  loaderSkillFamilySpecial = loaderSkillLocator.special.skillFamily;

            //Shieldsplosion
            ShieldsplosionDef skillDefShieldsplode = ScriptableObject.CreateInstance <ShieldsplosionDef>();

            skillDefShieldsplode.activationState            = new SerializableEntityStateType(typeof(ShieldSplosionEntity));
            skillDefShieldsplode.activationStateMachineName = "Body";
            skillDefShieldsplode.baseMaxStock                 = 1;
            skillDefShieldsplode.baseRechargeInterval         = 8f;
            skillDefShieldsplode.beginSkillCooldownOnSkillEnd = false;
            skillDefShieldsplode.fullRestockOnAssign          = false;
            skillDefShieldsplode.interruptPriority            = InterruptPriority.Skill;
            skillDefShieldsplode.isCombatSkill                = true;
            skillDefShieldsplode.mustKeyPress                 = true;
            skillDefShieldsplode.canceledFromSprinting        = false;
            skillDefShieldsplode.cancelSprintingOnActivation  = false;
            skillDefShieldsplode.forceSprintDuringState       = false;
            skillDefShieldsplode.rechargeStock                = 1;
            skillDefShieldsplode.requiredStock                = 1;
            skillDefShieldsplode.stockToConsume               = 1;
            skillDefShieldsplode.icon = Resources.Sprites.shieldsplosionIconS;
            skillDefShieldsplode.skillDescriptionToken = "LOADER_SPECIAL_SHIELDSPLOSION_DESC";
            skillDefShieldsplode.skillName             = "ShieldSplosion";
            skillDefShieldsplode.skillNameToken        = "LOADER_SPECIAL_SHIELDSPLOSION_NAME";

            defList.Add(skillDefShieldsplode);
            Array.Resize(ref loaderSkillFamilySpecial.variants, loaderSkillFamilySpecial.variants.Length + 1);
            loaderSkillFamilySpecial.variants[loaderSkillFamilySpecial.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefShieldsplode,
                unlockableDef = UnlocksRegistering.loaderShieldsplosionUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefShieldsplode.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <ShieldSplosionEntity>(out _);
        }
Beispiel #12
0
        private void RegisterBanditSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator banditSkillLocator       = banditRef.GetComponent <SkillLocator>();
            SkillFamily  banditSkillFamilyUtility = banditSkillLocator.utility.skillFamily;
            SkillFamily  banditSkillFamilyPrimary = banditSkillLocator.primary.skillFamily;

            //Thieves Cunning
            InvisOnSprintSkillDef skillDefInvisSprint = ScriptableObject.CreateInstance <InvisOnSprintSkillDef>();

            //These two are dummies, don't actually exist, just there to stop errors
            skillDefInvisSprint.activationState            = new SerializableEntityStateType(typeof(ThrowSmokebomb));
            skillDefInvisSprint.activationStateMachineName = "Body";
            skillDefInvisSprint.baseMaxStock         = 1;
            skillDefInvisSprint.baseRechargeInterval = 6f;
            skillDefInvisSprint.fullRestockOnAssign  = false;
            skillDefInvisSprint.rechargeStock        = 1;
            skillDefInvisSprint.requiredStock        = 1;
            skillDefInvisSprint.stockToConsume       = 1;
            skillDefInvisSprint.icon = Resources.Sprites.invisSprintIconS;
            skillDefInvisSprint.skillDescriptionToken = "BANDIT_UTILITY_INVISSPRINT_DESC";
            skillDefInvisSprint.skillName             = "ThievesCunning";
            skillDefInvisSprint.skillNameToken        = "BANDIT_UTILITY_INVISSPRINT_NAME";

            defList.Add(skillDefInvisSprint);
            Array.Resize(ref banditSkillFamilyUtility.variants, banditSkillFamilyUtility.variants.Length + 1);
            banditSkillFamilyUtility.variants[banditSkillFamilyUtility.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefInvisSprint,
                unlockableDef = UnlocksRegistering.banditInvisSprintUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefInvisSprint.skillNameToken, false, null)
            };

            //Magic bullet
            ReloadSkillDef skillDefMagicBullet = ScriptableObject.CreateInstance <ReloadSkillDef>();

            skillDefMagicBullet.activationState              = new SerializableEntityStateType(typeof(MagicBulletEntity));
            skillDefMagicBullet.reloadState                  = new SerializableEntityStateType(typeof(EnterReload));
            skillDefMagicBullet.activationStateMachineName   = "Weapon";
            skillDefMagicBullet.baseMaxStock                 = 4;
            skillDefMagicBullet.graceDuration                = 0.8f;
            skillDefMagicBullet.beginSkillCooldownOnSkillEnd = true;
            skillDefMagicBullet.fullRestockOnAssign          = false;
            skillDefMagicBullet.isCombatSkill                = true;
            skillDefMagicBullet.mustKeyPress                 = true;
            skillDefMagicBullet.reloadInterruptPriority      = InterruptPriority.Any;
            skillDefMagicBullet.canceledFromSprinting        = true;
            skillDefMagicBullet.cancelSprintingOnActivation  = true;
            skillDefMagicBullet.forceSprintDuringState       = false;
            skillDefMagicBullet.baseRechargeInterval         = 0f;
            skillDefMagicBullet.rechargeStock                = 0;
            skillDefMagicBullet.requiredStock                = 1;
            skillDefMagicBullet.stockToConsume               = 1;
            skillDefMagicBullet.icon = Resources.Sprites.magicBulletIconS;
            skillDefMagicBullet.skillDescriptionToken = "BANDIT_PRIMARY_MAGICBULLET_DESC";
            skillDefMagicBullet.skillName             = "MagicBullet";
            skillDefMagicBullet.skillNameToken        = "BANDIT_PRIMARY_MAGICBULLET_NAME";

            defList.Add(skillDefMagicBullet);
            Array.Resize(ref banditSkillFamilyPrimary.variants, banditSkillFamilyPrimary.variants.Length + 1);
            banditSkillFamilyPrimary.variants[banditSkillFamilyPrimary.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefMagicBullet,
                unlockableDef = UnlocksRegistering.banditMagicBulletUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefMagicBullet.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <MagicBulletEntity>(out _);
        }
Beispiel #13
0
        private void RegisterCommandoSkills()
        {
            //Nab the skillocator and skillfamilies
            SkillLocator commandoSkillLocator       = commandoRef.GetComponent <SkillLocator>();
            SkillFamily  commandoSkillFamilyPrimary = commandoSkillLocator.primary.skillFamily;
            SkillFamily  commandoSkillFamilyUtility = commandoSkillLocator.utility.skillFamily;

            //Combat Shotgun
            SteppedSkillDef skillDefCombatshotgun = ScriptableObject.CreateInstance <SteppedSkillDef>();

            skillDefCombatshotgun.activationState              = new SerializableEntityStateType(typeof(CombatShotgunEntity));
            skillDefCombatshotgun.activationStateMachineName   = "Weapon";
            skillDefCombatshotgun.beginSkillCooldownOnSkillEnd = true;
            skillDefCombatshotgun.fullRestockOnAssign          = true;
            skillDefCombatshotgun.interruptPriority            = InterruptPriority.Any;
            skillDefCombatshotgun.isCombatSkill               = true;
            skillDefCombatshotgun.mustKeyPress                = false;
            skillDefCombatshotgun.canceledFromSprinting       = false;
            skillDefCombatshotgun.cancelSprintingOnActivation = true;
            skillDefCombatshotgun.forceSprintDuringState      = false;
            skillDefCombatshotgun.stockToConsume              = 0;
            skillDefCombatshotgun.icon = Resources.Sprites.shotgunIconS;
            skillDefCombatshotgun.skillDescriptionToken = "COMMANDO_PRIMARY_COMBATSHOTGUN_DESC";
            skillDefCombatshotgun.skillName             = "CombatShotgun";
            skillDefCombatshotgun.skillNameToken        = "COMMANDO_PRIMARY_COMBATSHOTGUN_NAME";

            defList.Add(skillDefCombatshotgun);
            Array.Resize(ref commandoSkillFamilyPrimary.variants, commandoSkillFamilyPrimary.variants.Length + 1);
            commandoSkillFamilyPrimary.variants[commandoSkillFamilyPrimary.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefCombatshotgun,
                unlockableDef = UnlocksRegistering.commandoShotgunUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefCombatshotgun.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <CombatShotgunEntity>(out _);

            //Dash
            SkillDef skillDefDash = ScriptableObject.CreateInstance <SkillDef>();

            skillDefDash.activationState            = new SerializableEntityStateType(typeof(CommandoDashEntity));
            skillDefDash.activationStateMachineName = "Body";
            skillDefDash.baseMaxStock                 = 2;
            skillDefDash.baseRechargeInterval         = 8f;
            skillDefDash.beginSkillCooldownOnSkillEnd = true;
            skillDefDash.fullRestockOnAssign          = false;
            skillDefDash.interruptPriority            = InterruptPriority.PrioritySkill;
            skillDefDash.isCombatSkill                = false;
            skillDefDash.mustKeyPress                 = true;
            skillDefDash.canceledFromSprinting        = false;
            skillDefDash.cancelSprintingOnActivation  = false;
            skillDefDash.forceSprintDuringState       = false;
            skillDefDash.stockToConsume               = 1;
            skillDefDash.requiredStock                = 1;
            skillDefDash.rechargeStock                = 1;
            skillDefDash.icon = Resources.Sprites.dashIconS;
            skillDefDash.skillDescriptionToken = "COMMANDO_UTILITY_DASH_DESC";
            skillDefDash.skillName             = "Dash";
            skillDefDash.skillNameToken        = "COMMANDO_UTILITY_DASH_NAME";
            skillDefDash.keywordTokens         = new string[]
            {
                "KEYWORD_PREPARE"
            };

            defList.Add(skillDefDash);
            Array.Resize(ref commandoSkillFamilyUtility.variants, commandoSkillFamilyUtility.variants.Length + 1);
            commandoSkillFamilyUtility.variants[commandoSkillFamilyUtility.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = skillDefDash,
                unlockableDef = UnlocksRegistering.commandoDashUnlockDef,
                viewableNode  = new ViewablesCatalog.Node(skillDefDash.skillNameToken, false, null)
            };
            ContentAddition.AddEntityState <CommandoDashEntity>(out _);
        }
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            //load custom assets
            skillDef = TinkersSatchelPlugin.resources.LoadAsset <SkillDef>("Assets/TinkersSatchel/SkillDefs/EngiUtilitySpeedispenser.asset");
            var tmpDeployableBody = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserBody.prefab")
                                    .InstantiateClone("TkSatTempSetupPrefab", false);

            deployableMaster    = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserMaster.prefab");
            deployableBlueprint = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserBlueprints.prefab");

            //load vanilla assets
            targetSkillFamily = Addressables.LoadAssetAsync <SkillFamily>("RoR2/Base/Engi/EngiBodyUtilityFamily.asset")
                                .WaitForCompletion();
            var captainSupply = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Captain/CaptainSupplyDrop, EquipmentRestock.prefab")
                                .WaitForCompletion()
                                .InstantiateClone("TkSatTempSetupPrefab2", false);
            var buffIcon = Addressables.LoadAssetAsync <Sprite>("RoR2/DLC1/AttackSpeedAndMoveSpeed/texCoffeeIcon.png")
                           .WaitForCompletion();
            var mainMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Engi/matEngiTurret.mat")
                          .WaitForCompletion();
            var bpOkMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Engi/matBlueprintsOk.mat")
                          .WaitForCompletion();
            var bpNokMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Engi/matBlueprintsInvalid.mat")
                           .WaitForCompletion();
            var ctp = Addressables.LoadAssetAsync <CharacterCameraParams>("RoR2/Base/Common/ccpStandard.asset")
                      .WaitForCompletion();
            var turretBp = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Engi/EngiTurretBlueprints.prefab")
                           .WaitForCompletion();
            var turretObj = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Engi/EngiTurretBody.prefab")
                            .WaitForCompletion();
            var bpProjMtl = turretBp.transform.Find("BlobLightProjector").GetComponent <Projector>().material;

            //modify
            speedBuff            = ScriptableObject.CreateInstance <BuffDef>();
            speedBuff.buffColor  = Color.white;
            speedBuff.canStack   = false;
            speedBuff.isDebuff   = false;
            speedBuff.name       = "TKSATEngiSpeedispenserBuff";
            speedBuff.iconSprite = buffIcon;

            tmpDeployableBody.GetComponent <CameraTargetParams>().cameraParams = ctp;
            tmpDeployableBody.GetComponent <ModelLocator>().modelTransform.GetComponent <MeshRenderer>().material = mainMtl;
            var eic = captainSupply.transform.Find("ModelBase/captain supply drop/EnergyIndicatorContainer");

            eic.SetParent(tmpDeployableBody.transform);
            eic.localScale *= 0.5f;
            eic.position   -= new Vector3(0f, 1.5f, 0f);
            var cl = tmpDeployableBody.GetComponent <ModelLocator>().modelTransform.GetComponent <ChildLocator>();

            cl.transformPairs[0].transform = eic;
            cl.transformPairs[1].transform = eic.Find("Canvas/EnergyIndicatorBackgroundPanel/EnergyIndicator");

            GameObject.Destroy(captainSupply);
            deployableBody = tmpDeployableBody.InstantiateClone("EngiSpeedispenserBody", true);
            GameObject.Destroy(tmpDeployableBody);
            deployableMaster.GetComponent <CharacterMaster>().bodyPrefab = deployableBody;

            deployableBlueprint.transform.Find("BlobLight").GetComponent <Projector>().material = bpProjMtl;
            deployableBlueprint.transform.Find("Model Base/SpeedispenserModel").GetComponent <MeshRenderer>().material = bpOkMtl;
            var bp = deployableBlueprint.GetComponent <BlueprintController>();

            bp.okMaterial      = bpOkMtl;
            bp.invalidMaterial = bpNokMtl;

            foreach (var akEvent in turretBp.GetComponents <AkEvent>())
            {
                var newEvent = deployableBlueprint.AddComponent <AkEvent>();
                newEvent.triggerList         = akEvent.triggerList.ToArray().ToList();
                newEvent.useOtherObject      = akEvent.useOtherObject;
                newEvent.actionOnEventType   = akEvent.actionOnEventType;
                newEvent.curveInterpolation  = akEvent.curveInterpolation;
                newEvent.enableActionOnEvent = akEvent.enableActionOnEvent;
                newEvent.data               = akEvent.data;
                newEvent.useCallbacks       = akEvent.useCallbacks;
                newEvent.Callbacks          = akEvent.Callbacks.ToArray().ToList();
                newEvent.playingId          = akEvent.playingId;
                newEvent.soundEmitterObject = deployableBlueprint;
                newEvent.transitionDuration = akEvent.transitionDuration;
            }

            foreach (var akEvent in turretObj.GetComponents <AkEvent>())
            {
                var newEvent = deployableBody.AddComponent <AkEvent>();
                newEvent.triggerList         = akEvent.triggerList.ToArray().ToList();
                newEvent.useOtherObject      = akEvent.useOtherObject;
                newEvent.actionOnEventType   = akEvent.actionOnEventType;
                newEvent.curveInterpolation  = akEvent.curveInterpolation;
                newEvent.enableActionOnEvent = akEvent.enableActionOnEvent;
                newEvent.data               = akEvent.data;
                newEvent.useCallbacks       = akEvent.useCallbacks;
                newEvent.Callbacks          = akEvent.Callbacks.ToArray().ToList();
                newEvent.playingId          = akEvent.playingId;
                newEvent.soundEmitterObject = deployableBody;
                newEvent.transitionDuration = akEvent.transitionDuration;
            }

            //R2API catalog reg

            var dmsSerializable = ContentAddition.AddEntityState <DispenserMainState>(out bool entStateDidSucceed);

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on EngiUtilitySpeedispenser (DispenserMainState)! Deployable will be unusable.");
            }
            else
            {
                var esm = deployableBody.GetComponent <EntityStateMachine>();
                esm.initialStateType = dmsSerializable;
                esm.mainStateType    = dmsSerializable;
            }

            R2API.Networking.NetworkingAPI.RegisterMessageType <PlaceDispenser.MsgConstructDispenser>();
            ContentAddition.AddBuffDef(speedBuff);
            ContentAddition.AddBody(deployableBody);
            ContentAddition.AddMaster(deployableMaster);
            deployableSlot = DeployableAPI.RegisterDeployableSlot((master, countMult) => {
                return(1);
            });

            skillDef.activationState = ContentAddition.AddEntityState <PlaceDispenser>(out entStateDidSucceed);

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on EngiUtilitySpeedispenser! Skill will not appear nor function.");
            }
            else if (!ContentAddition.AddSkillDef(skillDef))
            {
                TinkersSatchelPlugin._logger.LogError("SkillDef setup failed on EngiUtilitySpeedispenser! Skill will not appear nor function.");
            }
            else
            {
                setupSucceeded = true;
            }
        }