コード例 #1
0
        public override void Attack()
        {
            int a = Projectile.NewProjectile(npc.Center, ArchaeaNPC.AngleToSpeed(ArchaeaNPC.AngleTo(npc, npcTarget) + compensate, 4f), ProjectileID.Fireball, 10, 1f);

            Main.projectile[a].timeLeft    = 300;
            Main.projectile[a].hostile     = true;
            Main.projectile[a].friendly    = false;
            Main.projectile[a].tileCollide = false;
        }
コード例 #2
0
ファイル: ArchaeaNPC.cs プロジェクト: in-Signia/Archaea-Mod
 public static Dust[] DustSpread(Vector2 v, int width = 1, int height = 1, int dustType = 6, int total = 10, float scale = 1f)
 {
     Dust[] dusts = new Dust[total];
     for (int k = 0; k < total; k++)
     {
         Vector2 speed = ArchaeaNPC.AngleToSpeed(ArchaeaNPC.RandAngle(), 8f);
         dusts[k] = Dust.NewDustDirect(v + speed, width, height, dustType, speed.X, speed.Y, 0, default(Color), 2f);
     }
     return(dusts);
 }
コード例 #3
0
ファイル: Sky_ground.cs プロジェクト: in-Signia/Archaea-Mod
        public bool canSee()
        {
            Vector2 line;

            for (float k = 0; k < npc.Distance(target().position); k += 0.5f)
            {
                line = npc.Center + ArchaeaNPC.AngleToSpeed(ArchaeaNPC.AngleTo(npc, target()), k);
                int  i    = (int)line.X / 16;
                int  j    = (int)line.Y / 16;
                Tile tile = Main.tile[i, j];
                if (tile.active() && Main.tileSolid[tile.type])
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #4
0
 public override void Attack()
 {
     projIndex = 0;
     for (int k = -3; k <= 3; k += 2)
     {
         bombs[projIndex]          = Projectile.NewProjectileDirect(npc.Center, ArchaeaNPC.AngleToSpeed(ArchaeaNPC.RandAngle(), 4f), ProjectileID.BouncyGrenade, 15, 5f);
         bombs[projIndex].timeLeft = 180;
         bombs[projIndex].hostile  = true;
         bombs[projIndex].friendly = false;
         projIndex++;
     }
 }