Example #1
0
        public override bool UseItem(Player player)
        {
            if (player.whoAmI == Main.myPlayer)
            {
                if (Main.raining)
                {
                    PboneWorld.StopRain();
                }
                else
                {
                    PboneWorld.StartRain();
                }

                // Vanilla does some wacky syncing. I'm just calling SendData and hoping for the best

                /*if (Main.maxRaining != Main.oldMaxRaining)
                 * {
                 *  if (Main.netMode == NetmodeID.MultiplayerClient)
                 *  {
                 *      NetMessage.SendData(MessageID.WorldData);
                 *  }
                 *  Main.oldMaxRaining = Main.maxRaining;
                 * }*/
                if (Main.netMode == NetmodeID.MultiplayerClient)
                {
                    NetMessage.SendData(MessageID.WorldData);
                }

                return(true);
            }

            return(base.UseItem(player));
        }
Example #2
0
        public override bool UseItem(Player player)
        {
            if (player.whoAmI == Main.myPlayer)
            {
                if (player.altFunctionUse == 0)
                {
                    Main.dayTime = !Main.dayTime;
                    Main.time    = 0;
                    if (++Main.moonPhase >= 8)
                    {
                        Main.moonPhase = 0;
                    }

                    if (Main.netMode == NetmodeID.MultiplayerClient)
                    {
                        NetMessage.SendData(MessageID.WorldData);
                    }

                    return(true);
                }
                else if (player.altFunctionUse == 2)
                {
                    if (PboneWorld.ForceFastForwardTime)
                    {
                        PboneWorld.ForceStopTimeFastForward();
                        player.GetModPlayer <VisualPlayer>().AmIFluxCapacitoring = false;
                    }
                    else
                    {
                        PboneWorld.ForceFastForwardTime = true;
                        player.GetModPlayer <VisualPlayer>().AmIFluxCapacitoring = true;
                    }

                    return(true);
                }
            }

            return(base.UseItem(player));
        }
Example #3
0
        public override bool UseItem(Player player)
        {
            if (player.whoAmI == Main.myPlayer)
            {
                if (Sandstorm.Happening)
                {
                    PboneWorld.StopStandstorm();
                }
                else
                {
                    PboneWorld.StartSandstorm();
                }

                // Same case as amulet of rain syncing, just hope it works
                if (Main.netMode == NetmodeID.MultiplayerClient)
                {
                    NetMessage.SendData(MessageID.WorldData);
                }

                return(true);
            }

            return(base.UseItem(player));
        }