Пример #1
0
        public void OnPlayerUseWorldItemSecondary(object secondaryResult)
        {
            WIListResult dialogResult = secondaryResult as WIListResult;

            switch (dialogResult.SecondaryResult)
            {
            case "Fuse":
                Fuse existingFuse = null;
                if (Player.Local.Tool.worlditem.Is <Fuse>(out existingFuse))
                {
                    //copy the properties from the fuse the player is holding
                    //then attach the fuse to the bomb
                    Fuse newFuse = worlditem.GetOrAdd <Fuse>();
                    newFuse.CopyFrom(existingFuse);
                    newFuse.AttachToBomb(this);
                    existingFuse.worlditem.RemoveFromGame();
                }
                break;

            default:
                break;
            }
        }