Visually updates all chests' frames.
Chests that are being used (M:Terraria.Chest.GetCurrentlyOpenChests) or eating an item (F:Terraria.Chest.eatingAnimationTime) will not be opened.
3901 {
3902
3905 for (int i = 0; i < 255; i++)
3906 {
3907 if (Main.player[i].active && Main.player[i].chest >= 0 && Main.player[i].chest <
num)
3908 {
3910 }
3911 }
3913 for (
int j = 0;
j <
num;
j++)
3914 {
3915 chest = Main.chest[
j];
3916 if (chest != null)
3917 {
3919 {
3920 chest.frameCounter++;
3921 }
3922 else
3923 {
3924 chest.frameCounter--;
3925 }
3926 if (chest.eatingAnimationTime == 9 && chest.frame == 1)
3927 {
3929 }
3930 if (chest.eatingAnimationTime > 0)
3931 {
3932 chest.eatingAnimationTime--;
3933 }
3934 if (chest.frameCounter < chest.eatingAnimationTime)
3935 {
3936 chest.frameCounter = chest.eatingAnimationTime;
3937 }
3938 if (chest.frameCounter < 0)
3939 {
3940 chest.frameCounter = 0;
3941 }
3942 if (chest.frameCounter > 10)
3943 {
3944 chest.frameCounter = 10;
3945 }
3946 if (chest.frameCounter == 0)
3947 {
3948 chest.frame = 0;
3949 }
3950 else if (chest.frameCounter == 10)
3951 {
3952 chest.frame = 2;
3953 }
3954 else
3955 {
3956 chest.frame = 1;
3957 }
3958 }
3959 }
3960 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Chest(bool bank=false)
Create a new T:Terraria.Chest with no name.
static HashSet< int > _chestInUse