Esempio n. 1
0
        public override bool UseItem(Player player)
        {
            DBTPlayer dbtPlayer = player.GetModPlayer <DBTPlayer>();

            if (dbtPlayer.FirstTransformation == null)
            {
                dbtPlayer.AcquireAndTransform(TransformationDefinitionManager.Instance.SSJ1);
                return(true);
            }

            TransformationDefinition currentTransformation = dbtPlayer.FirstTransformation.Definition;

            dbtPlayer.ClearTransformations();
            int nextIndex = TransformationDefinitionManager.Instance.GetIndex(currentTransformation) + 1;

            if (nextIndex >= TransformationDefinitionManager.Instance.Count)
            {
                nextIndex = 0;
            }

            dbtPlayer.AcquireAndTransform(TransformationDefinitionManager.Instance[nextIndex]);

            return(true);
        }
Esempio n. 2
0
        public override bool Receive(BinaryReader reader, int fromWho)
        {
            byte   whichPlayer        = reader.ReadByte();
            string transformationName = reader.ReadString();

            if (Main.netMode == NetmodeID.Server)
            {
                SendPacketToAllClients(fromWho, whichPlayer, transformationName);
            }

            DBTPlayer dbtPlayer = Main.player[whichPlayer].GetModPlayer <DBTPlayer>();

            dbtPlayer.AcquireAndTransform(TransformationDefinitionManager.Instance[transformationName]);

            return(true);
        }