• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

Please Help...

PhYCoZ x20

Terrarian
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace PhYCoZsMod.NPCs.Bosses
{
public class MechanicalBrain : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mechanical Brain");
}
public override void SetDefaults()
{
npc.CloneDefaults(NPCID.BrainofCthulhu); //Clones the AI of the Brain of Cthulu
npc.aiStyle = -1;
npc.lifeMax = 99000;
npc.damage = 120;
npc.lavaImmune = true;
npc.boss = true;
music = MusicID.Boss3;
npc.buffImmune[BuffID.Poisoned] = true;
npc.buffImmune[BuffID.Confused] = true;
npc.buffImmune[BuffID.OnFire] = true;
npc.buffImmune[BuffID.Inferno] = true;
npc.buffImmune[BuffID.Cursed] = true;
npc.buffImmune[BuffID.StardustMinionBleed] = true;
npc.buffImmune[BuffID.ShadowFlame] = true;
npc.buffImmune[BuffID.Venom] = true;
npc.buffImmune[BuffID.BrokenArmor] = true;
npc.buffImmune[BuffID.Daybreak] = true;
}
private int attackCounter;
private int summonCounter;
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(attackCounter);
writer.Write(summonCounter);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
attackCounter = reader.ReadInt32();
summonCounter = reader.ReadInt32();
}
public override void CustomBehavior()
{
if (Main.netMode != 1)
{
if (attackCounter > 0)
{
attackCounter--;
}
Player target = Main.player[npc.target];
if (attackCounter <= 0 && Vector2.Distance(npc.Center, target.Center) < 200 && Collision.CanHit(npc.Center, 1, 1, target.Center, 1, 1))
{
Vector2 direction = (target.Center - npc.Center).SafeNormalize(Vector2.UnitX);
direction = direction.RotatedByRandom(MathHelper.ToRadians(1));
int projectile = Projectile.NewProjectile(npc.Center, direction * 8, ProjectileID.EyeLaser, 56, 12, Main.myPlayer);
Main.projectile[projectile].timeLeft = 31300;
attackCounter = 107;
npc.netUpdate = true;
}
if (summonCounter > 0)
{
summonCounter--;
}
Player target = Main.player[npc.target];
if (summonCounter <= 0)
{
NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("MechaSticker"));
summonCounter = 200;
npc.netUpdate = true;
}
}
}
}
}



and it says :

c:\Users\bbutl\Documents\My Games\Terraria\ModLoader\Mod Sources\PhYCoZsMod\NPCs\Bosses\MechanicalBrain.cs(55,30) : error CS0115: 'PhYCoZsMod.NPCs.Bosses.MechanicalBrain.CustomBehavior()': no suitable method found to override
 

Red 4

Terrarian
try public override void CustomBehavior();
[doublepost=1561390237,1561390206][/doublepost]just add ;
 
Last edited:
Top Bottom