//////////////// protected override void Update() { if (Main.netMode == NetmodeID.Server) { var myplayer = this.Player.GetModPlayer <GreenHellPlayer>(); if (this.InfectionStageSnapshot != myplayer.InfectionStage) { PlayerStatePayload.SendToClients(this.PlayerWho, -1); } } }
internal static void GiveTo(GreenHellPlayer myplayer, bool syncIfServer) { var config = GreenHellConfig.Instance; int duration = config.Get <int>(nameof(config.InfectionTickDuration)); myplayer.player.AddBuff(ModContent.BuffType <InfectionDeBuff>(), duration, !syncIfServer); if (myplayer.InfectionStage < InfectionDeBuff.Stages) { myplayer.InfectionStage++; } if (syncIfServer && Main.netMode == NetmodeID.Server) { PlayerStatePayload.SendToClients(myplayer.player.whoAmI); } InfectionDeBuff.UpdateIcon(myplayer); }