BlueWaterMelon
Golem
how come your sword shoots chaos balls?
[doublepost=1458910257,1458910140][/doublepost]witch is a projectile form the game
[doublepost=1458910257,1458910140][/doublepost]witch is a projectile form the game
It is NPChow come your sword shoots chaos balls?
[doublepost=1458910257,1458910140][/doublepost]witch is a projectile form the game
You can manually spawn your Projectile using Projectile.NewProjectile, save the value you get back from that function to call back the new projectile from Main.projectile and set friendly to true.oh ya
[doublepost=1458910390,1458910369][/doublepost]there must be a way do
It's real to shoot NPC, but it will hurt you and will fly down always. so easier to make new projectileoh ya
[doublepost=1458910390,1458910369][/doublepost]there must be a way do
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ModName.Projectiles
{
public class ChaosBall : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "Chaos Ball";
projectile.width = 16;
projectile.height = 16;
projectile.friendly = true;
projectile.penetrate = 3;
projectile.tileCollide = false;
}
public override void AI()
{
float minDistance = 300;
float dX = 0;
float dY = 0;
float distance = 0;
int target = -1;
int num272 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f);
Main.dust[num272].noGravity = true;
Main.dust[num272].velocity *= 0.3f;
Dust dust26 = Main.dust[num272];
dust26.velocity.X = dust26.velocity.X - projectile.velocity.X * 0.2f;
Dust dust27 = Main.dust[num272];
dust27.velocity.Y = dust27.velocity.Y - projectile.velocity.Y * 0.2f;
for (int i = 0; i < 200; i++)
{
NPC n = Main.npc[i];
if (n.active && n.life > 1)
{
Vector2 center = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
dX = n.position.X + (float)(n.width / 2) - center.X;
dY = n.position.Y + (float)(n.height / 2) - center.Y;
distance = (float)Math.Sqrt((double)(dX * 1.25 + dY * 1.25));
if (distance < minDistance)
{
minDistance = distance;
target = i;
}
}
}
}
}
}
Is there any way that I can use the time on the players computer? (basically, account for timezones, NOT GMT or UNIX)
I wonder why this thing doesn't work![]()
ExampleMod has plenty of examples of changing Vanilla stuff. It is usually in a class with Global in the name. Search the source code for examples.How to modify vanilla items, NPCs etc? For example adding drops for enemies or adding attributes to armor.
Huh, which item in examplemod can show this?ExampleMod has plenty of examples of changing Vanilla stuff. It is usually in a class with Global in the name. Search the source code for examples.
NPC.downedPlantBossHow can I check that plantera has been downed?
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float spread = 2f * 0.1750f;
float baseSpeed = (float)Math.Sqrt(speedX * speedX + speedY * speedY);
double baseAngle = Math.Atan2(speedX, speedY);
double randomAngle = baseAngle + (Main.rand.NextFloat() - 0.75f) * spread;
float randomSpeed = Main.rand.NextFloat() * 0.2f + 1f;
speedX = baseSpeed * randomSpeed * (float)Math.Sin(randomAngle);
speedY = baseSpeed * randomSpeed * (float)Math.Cos(randomAngle);
if (player.direction > 0)
{
player.position.X -= 10;
return true;
}
if (player.direction < 0)
{
player.position.X += 10;
return true;
}
return true;
}