コード例 #1
0
        private void ToolbotDash_OnEnter(On.EntityStates.Toolbot.ToolbotDash.orig_OnEnter orig, EntityStates.Toolbot.ToolbotDash self)
        {
            orig(self);
            var count = GetCount(self.characterBody);

            if (count > 0)
            {
                var cpt = self.GetComponent <ToolbotDashBoostTracker>();
                if (!cpt)
                {
                    cpt = self.gameObject.AddComponent <ToolbotDashBoostTracker>();
                }
                cpt.maxBoosts  = count * toolbotReacBoostCount;
                cpt.boostsUsed = 0;
            }
        }
コード例 #2
0
        private void On_ToolbotDashEnter(On.EntityStates.Toolbot.ToolbotDash.orig_OnEnter orig, EntityStates.Toolbot.ToolbotDash self)
        {
            orig(self);
            if (!self.outer.commonComponents.characterBody)
            {
                return;
            }
            if (Scepter.instance.GetCount(self.outer.commonComponents.characterBody) < 1)
            {
                return;
            }
            var cpt = self.outer.commonComponents.characterBody.GetComponent <ScepterToolbotDashTracker>();

            if (!cpt)
            {
                cpt = self.outer.commonComponents.characterBody.gameObject.AddComponent <ScepterToolbotDashTracker>();
            }
            cpt.enabled            = true;
            cpt.trackedDamageTaken = 0f;
            self.baseDuration     *= 2f;
        }