Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AI_156_BatOfLight()

void Terraria.Projectile.AI_156_BatOfLight ( )
inlineprivate

Definition at line 41808 of file Projectile.cs.

41809 {
41811 Player player = Main.player[owner];
41812 bool num = type == 755;
41813 bool flag = type == 946;
41814 if (num)
41815 {
41816 if (player.dead)
41817 {
41818 player.batsOfLight = false;
41819 }
41820 if (player.batsOfLight)
41821 {
41822 timeLeft = 2;
41823 }
41824 DelegateMethods.v3_1 = AI_156_GetColor().ToVector3();
41825 Point point = base.Center.ToTileCoordinates();
41826 DelegateMethods.CastLightOpen(point.X, point.Y);
41827 if (++frameCounter >= 6)
41828 {
41829 frameCounter = 0;
41830 if (++frame >= Main.projFrames[type] - 1)
41831 {
41832 frame = 0;
41833 }
41834 }
41835 int num2 = player.direction;
41836 if (velocity.X != 0f)
41837 {
41838 num2 = Math.Sign(velocity.X);
41839 }
41841 }
41842 if (flag)
41843 {
41844 if (player.dead)
41845 {
41846 player.empressBlade = false;
41847 }
41848 if (player.empressBlade)
41849 {
41850 timeLeft = 2;
41851 }
41852 DelegateMethods.v3_1 = AI_156_GetColor().ToVector3();
41853 Point point2 = base.Center.ToTileCoordinates();
41854 DelegateMethods.CastLightOpen(point2.X, point2.Y);
41855 }
41858 }
static int Sign(decimal value)
Definition Math.cs:1202
Vector2 velocity
Definition Entity.cs:16
static List< int > _ai156_blacklistedTargets
void AI_156_Think(List< int > blacklist)

References Terraria.Player.batsOfLight, Terraria.DelegateMethods.CastLightOpen(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), Terraria.Player.dead, Terraria.Entity.direction, Terraria.Player.empressBlade, Terraria.Main.player, Terraria.Main.projFrames, System.Math.Sign(), System.type, Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.