public override void ResetEffects()
{
BrainBand = false
}
I could be wrong but I think I see the problem. Where you have this,I did both ways and they never worked. With the mod content it says I cant convert from float to Microsoft.Xna.Framework.Vector2
using Beskil.Items.Accesories;
using Beskil.Projectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace Beskil
{
public class BeskilPlayer : ModPlayer
{
public bool BrainBand;
public override void UpdateBadLifeRegen()
{
if (BrainBand){
Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType<CreeperBand>());
}
}
public override void ResetEffects()
{
BrainBand = false;
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Beskil.Projectiles;
using Beskil;
namespace Beskil.Items.Accesories
{
public class BrainBand : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brain Band");
Tooltip.SetDefault("Shoots little Creepers");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.value = 0;
item.rare = -12;
item.accessory = true;
item.defense = 4;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetBeskilPlayer().BrainBand = true;
}
}
}
Seems theres still no support for packed files?
Or is there a way to build with a text/json file and have access to it even in the sideloaded state? (since Path becomes relative to steam)
Theres an ungodly amount of clutter appearing, or will appear in the future and since its all clutter caused by constructed objects I would prefer to be able to have the data stored, load it up, loop through, construct, done.
The only solution I have seen is to have a file saved in the Main.SavePath which isn't great if you want the file to already have something...
I could do a simple json database with REST but that might be overkill, and I'd also need to accommodate for lack of internet connection; other than writing to Main.SavePath.
Are you talking about files within a packaged .tmod file, such as a json or txt file you as a modder can use? Or something that gets externally saved to Main.SavePath for the purpose of persistency? Both things are possible, the former is as easy as using the Mod.GetFileBytes method
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using NecromancedBosses.NPCs;
namespace NecromancedBosses.NPCs.NecromancedEOC {
[AutoloadBossHead]
public class NecromancedEOC : ModNPC {
public override void SetStaticDefaults() {
DisplayName.SetDefault("Necromanced Eye of Cthulhu");
Main.npcFrameCount[npc.type] = 6;
}
public override void SetDefaults() {
npc.width = 100;
npc.height = 110;
npc.aiStyle = 4;
npc.damage = 45;
npc.defense = 36;
npc.lifeMax = 14000;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
npc.knockBackResist = 0f;
npc.noGravity = true;
npc.noTileCollide = true;
npc.boss = true;
npc.value = 30000f;
aiType = 4;
}
public override void ScaleExpertStats(int numPlayers, float bosslifeScale) {
npc.lifeMax = (int)(npc.lifeMax * 0.625f * bosslifeScale);
npc.damage = (int)(npc.damage * 0.6f);
}
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) {
scale = 1.5f;
return null;
}
public override void NPCLoot() {
if (NecromancedNPCs.DownedNEOCBoss) {
if (Main.expertMode) {
npc.DropBossBags();
} else {
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Items.NecromancedSoul>(), 9);
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GoldCoin, 5);
}
}
}
}
}
I am asking here:
So, i'm currently making a mod which adds "Necromanced" versions of the vanilla bosses.
But the only technique I know to give them the vanilla AIs is to set the aiType to the vanilla bosses ai types.
But doing so, I can't set a proper loot table for them to use.
Can anyone help me with that?
Thank you in advance.