Ejemplo n.º 1
0
        /// <summary>
        /// Call this in <see cref="ModProjectile.SetStaticDefaults"/> to register this projectile into the "clicker weapon" category.
        /// <br>This is only for projectiles spawned by clickers directly (Item.shoot). Clicker Class only uses one such projectile for all it's clickers. Only use this if you know what you are doing!</br>
        /// <br>Various effects will only proc "on click" by checking this category instead of "all clicker class projectiles"</br>
        /// </summary>
        /// <param name="modProj">The <see cref="ModProjectile"/> that is to be registered</param>
        /// <exception cref="InvalidOperationException"/>
        public static void RegisterClickerWeaponProjectile(ModProjectile modProj)
        {
            if (ClickerClass.finalizedRegisterCompat)
            {
                throw new InvalidOperationException("Tried to register a clicker weapon projectile at the wrong time, do so in ModProjectile.SetStaticDefaults");
            }
            int type = modProj.Projectile.type;

            if (!ClickerWeaponProjectiles.Contains(type))
            {
                ClickerWeaponProjectiles.Add(type);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Call this to check if a projectile type belongs to the "clicker weapon" category.
 /// <br>Various effects will only proc "on click" by checking this category instead of "all clicker class projectiles"</br>
 /// </summary>
 /// <param name="type">The projectile type to be checked</param>
 /// <returns><see langword="true"/> if that category</returns>
 public static bool IsClickerWeaponProj(int type)
 {
     return(ClickerWeaponProjectiles.Contains(type));
 }