I'm not going to answer every single one of these questions (sorry!) since I'll be answering them from the top of my head:
1. When the Eye of Cthulu (for example) changes its form, it's not chaning its texture. Every NPC has a so called 'frame' (npc.frame') which is a rectangle (X coordinate, Y coordinate, width, height). This frame takes care of the change in visuals.
Imagine you have a piece of paper with 4 different images below one another. Now you have another piece of paper with a square/rectangle cut out in the middle, the exact same size as one of those images. You can move the piece with the hole to show different parts of the other piece with the images on it. Same with npc.frame. If you have multiple images below one another, you can change
npc.frame.Y to scroll down on the 'spritesheet'.
2. I'm not sure if you know how a projectile is shot already, so I'm going to start from the basics. There's a method called
Projectile.NewProjectile which basically spawns in a new projectile, simple as that. Now the parameters for this method are as follows: (XPosition, YPosition, speedX, speedY, projectileType, damage, knockback, owner, ai0, ai1). Now you want to focus on spawning the projectile at a given position that is at the edge of the texture.
First of all, you want to turn the rotation of the NPC in question into a direction vector. That way you also immediately know which way to shoot the projectile in. You can also use that direction vector and multiply it to make the projectile spawn at the edge of the texture. In code it would look something like this:
Code:
Vector2 direction = npc.rotation.ToRotationVector2();
Vector2 spawnProjectileAtPosition = npc.Center + (direction * 18); // You'll want to change the '18' to whatever value you see fit. The '18' influences the distance at which the projectile spawns according to the center of the NPC.
direction *= 8; // Here we modify the speed at which we're going to shoot the projectile. Change the '8' if you want the projectile to go faster or slower.
Projectile.NewProjectile(spawnProjectileAtPosition.X, spawnProjectileAtPosition.Y, direction.X, direction.Y, projectileType, damage, knockback, Main.myPlayer);
As you can see, I left the (projectileType, damage, knockback) as just names. You'll want to modify those, though.
3. Very simple, really. Example:
Code:
npc.velocity *= 0; // Makes the NPC stop moving.
npc.rotation += 0.2F; // Rotate the NPC. You can change the value to make it rotate faster or slower and change '+=' to '-=' to make it rotate the other way.
4. Also not too difficult.
Code:
npc.dontTakeDamage = true; // Make sure the NPC cannot be damaged.
npc.lifeRegenCount += 5; // Change '5' to make the NPC generate slower or faster.
Also, do NOT forget to set
npc.dontTakeDamage back to false when the NPC ends its spin.
5, 6, 7, 8, 9 - Not right now. Bit too much from the top of my head
10. You'll want to check the NPCs current life against its max life and go from there. Also use defDamage and defDefense to modify its damage and defense values:
Code:
if(npc.life <= npc.lifeMax * 0.5F) // Check if the current life of the NPC is lower or equal to half of its max life.
{
npc.damage = npc.defDamage * 2; // Damage is multiplied.
npc.defense= npc.defDefense * 2; // As well as defense.
}
11... Not from the top of my head xD
12. To make an NPC look at the player, you can kind of reverse-apply the rotating+shooting projectile from earlier on:
Code:
npc.TargetClosest(true); // Get the closest player to target.
npc.rotation = (Main.player[npc.target].Center - npc.Center).ToRotation();
For the charging.. Someone else might be able to help you there...