예제 #1
0
        /// <summary>
        /// Automatically sets certain static defaults. Override this if you do not want the properties to be set for you.
        /// </summary>
        public virtual void AutoStaticDefaults()
        {
            TextureAssets.Npc[NPC.type] = ModContent.GetTexture(Texture);

            if (Banner != 0 && BannerItem != 0)
            {
                NPCLoader.bannerToItem[Banner] = BannerItem;
            }
            else if (Banner != 0 || BannerItem != 0)
            {
                Logging.tML.Warn(Language.GetTextValue("tModLoader.LoadWarningBannerOrBannerItemNotSet", Mod.DisplayName, Name));
            }

            if (NPC.lifeMax > 32767 || NPC.boss)
            {
                Main.npcLifeBytes[NPC.type] = 4;
            }
            else if (NPC.lifeMax > 127)
            {
                Main.npcLifeBytes[NPC.type] = 2;
            }
            else
            {
                Main.npcLifeBytes[NPC.type] = 1;
            }

            if (DisplayName.IsDefault())
            {
                DisplayName.SetDefault(Regex.Replace(Name, "([A-Z])", " $1").Trim());
            }
        }
예제 #2
0
 public override void AutoStaticDefaults()
 {
     Main.projectileTexture[projectile.type] = Main.magicPixel;
     Main.projFrames[projectile.type]        = 1;
     if (DisplayName.IsDefault())
     {
         DisplayName.SetDefault(Regex.Replace(Name, "([A-Z])", " $1").Trim());
     }
 }
예제 #3
0
        public override void SetupContent()
        {
            SetStaticDefaults();

            if (DisplayName.IsDefault())
            {
                DisplayName.SetDefault(Regex.Replace(Name, "([A-Z])", " $1").Trim());
            }

            SetDefaults();
        }
예제 #4
0
        /// <summary>
        /// Automatically sets certain static defaults. Override this if you do not want the properties to be set for you.
        /// </summary>
        public virtual void AutoStaticDefaults()
        {
            Main.itemTexture[item.type] = ModLoader.GetTexture(Texture);

            var flameTexture = Texture + "_Flame";

            if (ModLoader.TextureExists(flameTexture))
            {
                Main.itemFlameTexture[item.type] = ModLoader.GetTexture(flameTexture);
                Main.itemFlameLoaded[item.type]  = true;
            }

            if (DisplayName.IsDefault())
            {
                DisplayName.SetDefault(Regex.Replace(Name, "([A-Z])", " $1").Trim());
            }
        }
예제 #5
0
 /// <summary>
 /// Automatically sets certain static defaults. Override this if you do not want the properties to be set for you.
 /// </summary>
 public virtual void AutoStaticDefaults()
 {
     TextureAssets.Projectile[Projectile.type] = ModContent.GetTexture(Texture);
     Main.projFrames[Projectile.type]          = 1;
     if (Projectile.hostile)
     {
         Main.projHostile[Projectile.type] = true;
     }
     if (Projectile.aiStyle == 7)
     {
         Main.projHook[Projectile.type] = true;
     }
     if (DisplayName.IsDefault())
     {
         DisplayName.SetDefault(Regex.Replace(Name, "([A-Z])", " $1").Trim());
     }
 }
예제 #6
0
        public override void AutoStaticDefaults()
        {
            try {
                /*switch(Type) {
                 *  case ActionType.Literal:
                 *  Main.itemTexture[item.type] = ModContent.GetTexture("Literal");
                 *  break;
                 *  default:*/
                Main.itemTexture[item.type] = ModContent.GetTexture("Jailbreak/" + Type.ToString() + "s/" + Name.Replace(Type.ToString(), ""));

                /*break;
                 * }*/
            } catch (Exception) {
                Main.itemTexture[item.type] = ModContent.GetTexture("Jailbreak/Empty");
            }

            if (DisplayName.IsDefault())
            {
                DisplayName.SetDefault(Regex.Replace(Name, "(?<!^)([A-Z])", " $1").Trim());
            }
        }