Ejemplo n.º 1
0
        private bool EquipmentSlot_PerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
        {
            var retv = orig(self, equipmentDef);

            if (self && self.characterBody)
            {
                var count = GetCount(self.characterBody);
                if (count <= 0)
                {
                    return(retv);
                }
                var pts = self.characterBody.gameObject.GetComponent <PixieTubeStopwatch>();
                if (!pts)
                {
                    pts = self.characterBody.gameObject.AddComponent <PixieTubeStopwatch>();
                }
                if (pts.CheckProcEquipment())
                {
                    for (var i = 0; i < count; i++)
                    {
                        SpawnWisp(self.characterBody.corePosition, self.characterBody.teamComponent ? self.characterBody.teamComponent.teamIndex : TeamIndex.None);
                    }
                }
            }
            return(retv);
        }
Ejemplo n.º 2
0
        private bool On_ESPerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot slot, EquipmentIndex ind)
        {
            var retv = orig(slot, ind);

            if (subEnableExt.Contains(ind))
            {
                return(retv);
            }
            foreach (Equipment bpl in ClassicItemsPlugin.masterItemList.OfType <Equipment>())
            {
                if (bpl.enabled && ind == bpl.regIndex)
                {
                    return(retv);                                   //Embryo is handled in individual item code for CI items
                }
            }
            if (slot.characterBody && Util.CheckRoll(GetCount(slot.characterBody) * procChance))
            {
                if ((simpleDoubleEqps.Contains(ind) && subEnable[ind]) ||
                    (ind >= EquipmentIndex.Count && subEnableModded))
                {
                    retv = retv || orig(slot, ind);
                }
            }
            return(retv);
        }
Ejemplo n.º 3
0
 private bool TryPerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
 {
     if (equipmentDef == EquipmentDef)
     {
         return(PerformEquipmentAction(self));
     }
     else
     {
         return(orig(self, equipmentDef));
     }
 }
 private bool PerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, RoR2.EquipmentSlot self, EquipmentIndex equipmentIndex)
 {
     if (equipmentIndex == Index)
     {
         return(ActivateEquipment(self));
     }
     else
     {
         return(orig(self, equipmentIndex));
     }
 }
 public static bool FireEquipment(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef def)
 {
     if (equipmentDefs.Contains(def))
     {
         return(fireEquipmentCases[equipmentDefs.IndexOf(def)](self));
     }
     else
     {
         return(orig(self, def));
     }
 }
Ejemplo n.º 6
0
 public static bool EquipmentSlot_PerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentIndex equipmentIndex)
 {
     if (self.characterBody && self.characterBody.masterObject && self.characterBody.masterObject.GetComponent <AffixEquipBehaviour>() is AffixEquipBehaviour behaviour)
     {
         if (equipmentIndex == BaseAffixEquip.index)
         {
             return(behaviour.PerformBaseAction());
         }
         else if (equipmentIndex == LunarAffixEquip.index)
         {
             return(behaviour.PerformLunarAction());
         }
     }
     return(orig(self, equipmentIndex));
 }
Ejemplo n.º 7
0
        private bool EquipmentSlotOnPerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentIndex index)
        {
            if (index == BulletTimer.EquipIndex)
            {
                _bulletTimer.PerformAction(self.characterBody);
                return(true);
            }

            if (index == JestersDice.EquipIndex)
            {
                _jestersDice.PerformAction(this, self.characterBody);
                return(true);
            }

            return(orig(self, index));
        }
Ejemplo n.º 8
0
 private bool EquipmentSlotOnPerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentIndex index)
 {
     if (index == BrokenPrinter.EquipIndex)
     {
         summonbox.SummonMjnion(self.characterBody);
         return(true);
     }
     if (index == UnstableQuantumReactor.EquipIndex)
     {
         reactor.BecomeUnstable(self.characterBody);
         return(true);
     }
     if (index == Lumpkin.EquipIndex)
     {
         lum.Scream(self.characterBody);
         return(true);
     }
     return(orig(self, index)); //must
 }
Ejemplo n.º 9
0
            private bool EquipmentSlot_PerformEquipmentAction(On.RoR2.EquipmentSlot.orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
            {
                var retv = orig(self, equipmentDef);

                if (equipmentDef != this.targetEquipment)
                {
                    return(retv);
                }
                var proc = CheckLastEmbryoProc(self);

                if (proc > 0)
                {
                    for (var i = 0; i < proc; i++)
                    {
                        retv |= orig(self, equipmentDef); //return true if any activation was successful
                    }
                }
                return(retv);
            }