Example #1
0
        private void AimThrowableBase_FireProjectile(On.EntityStates.AimThrowableBase.orig_FireProjectile orig, EntityStates.AimThrowableBase self)
        {
            var doIgnore = self is EntityStates.Treebot.Weapon.AimMortar2 || self is EntityStates.Captain.Weapon.CallAirstrikeBase;

            if (doIgnore)
            {
                ignoreMugs = true;
            }
            orig(self);
            if (doIgnore)
            {
                ignoreMugs = false;
            }
        }
        private void AimThrowableBase_FireProjectile(On.EntityStates.AimThrowableBase.orig_FireProjectile orig, EntityStates.AimThrowableBase self)
        {
            bool isScep     = Scepter.instance.GetCount(self.outer.commonComponents.characterBody) > 0;
            var  origPrefab = self.projectilePrefab;

            if (isScep && self is CallAirstrikeAlt caa)
            {
                self.projectilePrefab = projReplacer;
                caa.airstrikeRadius  *= 8f;
                caa.detonationRadius *= 8f;
            }
            orig(self);
            if (isScep && self is CallAirstrikeAlt caa2)
            {
                self.projectilePrefab  = origPrefab;
                caa2.airstrikeRadius  /= 8f;
                caa2.detonationRadius /= 8f;
            }
        }