unrealcodez
Terrarian
I want to add in a custom difficulty just like the Calamity mod did, but I cant figure out how to access my Custom Properties script with my Custom Boss Script to change the health and damage of it. Any help?
Code:
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.IO;
using Terraria.ModLoader;
using Terraria.Localization;
namespace AldersMod.NPCs
{
public class AlderBossPH : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Alder");
}
public override void SetDefaults()
{
npc.aiStyle = 94;
npc.lifeMax = 3250000;
npc.damage = 360;
npc.defense = 60;
npc.knockBackResist = 0f;
npc.width = 174;
npc.height = 364;
npc.boss = true;
npc.dontTakeDamage = false;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
npc.noGravity = true;
npc.npcSlots = 0;
npc.noTileCollide = true;
NPCID.Sets.MustAlwaysDraw[npc.type] = true;
music = MusicID.Boss2;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 1.65f * bossLifeScale);
npc.damage = (int)(npc.damage * 1.55f);
npc.defense = (int)(npc.defense + (numPlayers * 1.5));
}
public void NightmareModeStats() //THIS WONT WORK
{
if (mProperties.NMM == true) { // This line doesnt work :*(
npc.lifeMax = (int)(npc.lifeMax * 2.5f);
npc.damage = (int)(npc.damage * 2.25f);
}
}
public override void BossLoot(ref string name, ref int potiontype)
{
if (Main.expertMode)
{
potiontype = ItemID.HealingPotion;
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AldersBag"));
}
else
{
potiontype = ItemID.GreaterHealingPotion;
if (Main.rand.Next(5) == 0)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AldersSword"));
}
}
}
}
}