Beispiel #1
0
    private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        Debug.LogFormat("loaded {0}", scene.name);

        if (scene.buildIndex == (int)SceneBuildIndex.Game)
        {
            Instantiate(levelManager);
            shifter = Instantiate(shifterPrefab).GetComponent <Shifter>() as Shifter;
            if (shifter != null)
            {
                shifter.OnShift += OnShift;
            }

            targetShifter   = Instantiate(targetShifterPrefab).GetComponent <Shifter>() as Shifter;
            timeToNextShape = timeBetweenShapes;
            totalTime       = 0f;
            score           = 0;
            GetNewTarget();
            UpdateScoreText();
            UpdateTimeText();
        }
        else if (scene.buildIndex == (int)SceneBuildIndex.EndMenu)
        {
            UpdateScoreText();
            UpdateTotalTimeText();
            newGameButton.onClick.AddListener(InitializeGame);
        }
    }
Beispiel #2
0
        async public Task TestShiftSubtitle()
        {
            var inputPath  = @"C:\Users\Fabio\source\repos\graph\SubtitleTimeshift.Tests\The.Matrix.1999.BluRay.720p.Malay.srt";
            var outputPath = @"C:\Users\Fabio\source\repos\graph\SubtitleTimeshift.Tests\The.Matrix.1999.BluRay.720p.Malay - Copy.srt";
            var assertPath = @"C:\Users\Fabio\source\repos\graph\SubtitleTimeshift.Tests\The.Matrix.1999.BluRay.720p.Malay - Assert.srt";

            var timeSpan = TimeSpan.FromMilliseconds(123.0);
            var encoding = System.Text.Encoding.UTF8;

            using (var inputStream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
                using (var outputStream = new FileStream(outputPath, FileMode.Truncate, FileAccess.ReadWrite))
                {
                    await Shifter.Shift(inputStream, outputStream, timeSpan, encoding);
                }

            using (var outputStream = new FileStream(outputPath, FileMode.Open, FileAccess.Read))
                using (var outputReader = new StreamReader(outputPath, encoding, true))
                    using (var assertStream = new FileStream(assertPath, FileMode.Open, FileAccess.Read))
                        using (var assertReader = new StreamReader(assertStream, encoding, true))
                        {
                            var assertLine = default(string);
                            var outputLine = default(string);

                            while (null != (assertLine = await assertReader.ReadLineAsync()))
                            {
                                Assert.IsFalse(outputReader.EndOfStream);
                                outputLine = await outputReader.ReadLineAsync();

                                Assert.AreEqual(assertLine, outputLine);
                            }
                        }
        }
Beispiel #3
0
        public void ShiftWorksOnSamples()
        {
            var shifter = new Shifter();
            var shifted = shifter.Shift("qzmt-zixmtkozy-ivhz", 343);

            Assert.Equal("very encrypted name", shifted);
        }
Beispiel #4
0
        public void TestShiftSubtitle()
        {
            var inputPath  = "The.Matrix.1999.BluRay.720p.Malay.srt";
            var outputPath = "The.Matrix.1999.BluRay.720p.Malay - Copy.srt";
            var assertPath = "The.Matrix.1999.BluRay.720p.Malay - Assert.srt";

            var timeSpan = TimeSpan.FromMilliseconds(123);
            var encoding = System.Text.Encoding.UTF8;

            using (var inputStream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
                using (var outputStream = new FileStream(outputPath, FileMode.Truncate, FileAccess.ReadWrite))
                {
                    Shifter.Shift(inputStream, outputStream, timeSpan, encoding);
                }

            using (var outputStream = new FileStream(outputPath, FileMode.Open, FileAccess.Read))
                using (var outputReader = new StreamReader(outputPath, encoding, true))
                    using (var assertStream = new FileStream(assertPath, FileMode.Open, FileAccess.Read))
                        using (var assertReader = new StreamReader(assertStream, encoding, true))
                        {
                            var assertLine = default(string);
                            var outputLine = default(string);

                            while (null != (assertLine = assertReader.ReadLine()))
                            {
                                Assert.IsFalse(outputReader.EndOfStream);
                                outputLine = outputReader.ReadLine();
                                Assert.AreEqual(assertLine, outputLine);
                            }
                        }
        }
Beispiel #5
0
        public async Task TestShiftSubtitle()
        {
            var root       = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName;
            var inputPath  = Path.Combine(root, "The.Matrix.1999.BluRay.720p.Malay.srt");
            var outputPath = Path.Combine(root, "The.Matrix.1999.BluRay.720p.Malay - Copy.srt");
            var assertPath = Path.Combine(root, "The.Matrix.1999.BluRay.720p.Malay - Assert.srt");
            var timeSpan   = TimeSpan.FromMilliseconds(123);
            var encoding   = System.Text.Encoding.UTF8;

            using (var inputStream = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
                using (var outputStream = new FileStream(outputPath, FileMode.Truncate, FileAccess.ReadWrite))
                {
                    await Shifter.Shift(inputStream, outputStream, timeSpan, encoding);
                }

            using (var outputStream = new FileStream(outputPath, FileMode.Open, FileAccess.Read))
                using (var outputReader = new StreamReader(outputPath, encoding, true))
                    using (var assertStream = new FileStream(assertPath, FileMode.Open, FileAccess.Read))
                        using (var assertReader = new StreamReader(assertStream, encoding, true))
                        {
                            var assertLine = default(string);
                            var outputLine = default(string);

                            while (null != (assertLine = await assertReader.ReadLineAsync()))
                            {
                                Assert.False(outputReader.EndOfStream);
                                outputLine = await outputReader.ReadLineAsync();

                                Assert.Equal(assertLine, outputLine);
                            }
                        }
        }
Beispiel #6
0
        public void CreateShifter()
        {
            int[]   rings      = { 32, 22 };
            RingSet newRingSet = new RingSet(rings);
            Shifter newShifter = new Shifter(newRingSet);

            Assert.That(newShifter.Rings, Is.EqualTo(newRingSet));
            Assert.That(newShifter.GetRingCount(), Is.EqualTo(newRingSet.RingCount));
            Assert.That(newShifter.CurPos, Is.EqualTo(0));
        }
Beispiel #7
0
        private RasterOp()
        {
            _ropShifter = new Shifter();            // Our own private Idaho
            _srcFifo    = new Queue <ROpWord>(16);  // 4 quads (hardware limit)
            _destFifo   = new Queue <ROpWord>(4);   // 1 quad
            _halfPipe   = new ROpWord();            // 1 word, for overlap
            _rdsTable   = new CombinerFlags[512];   // 9 bit index
            _rscTable   = new EdgeStrategy[128];    // 7 bit index

            LoadRasterOpROMs();
        }
Beispiel #8
0
        public string Solve(string[] input)
        {
            var parser    = new EntryParser();
            var list      = input.Select(parser.Parse);
            var cc        = new ChecksumComputer();
            var realRooms = list.Where(r => r.DeclaredChecksum == cc.Compute(r.EncryptedName));
            var shifter   = new Shifter();
            var decrypted = realRooms.Select(r => new { name = shifter.Shift(r.EncryptedName, r.SectorId), r.SectorId });
            var northPole = decrypted.FirstOrDefault(x => x.name.Contains("northpole"));

            return(northPole?.SectorId.ToString() ?? "Not found");
        }
Beispiel #9
0
        public void SetCurPos()
        {
            int[]   rings      = { 32, 22 };
            RingSet newRingSet = new RingSet(rings);
            Shifter newShifter = new Shifter(newRingSet);

            Assert.That(newShifter.Rings, Is.EqualTo(newRingSet));
            Assert.That(newShifter.GetRingCount(), Is.EqualTo(newRingSet.RingCount));
            Assert.That(newShifter.CurPos, Is.EqualTo(0));

            int[] newRings = { 11, 22, 33 };
            newRingSet.SetRings(newRings);
            newShifter.SettingGears(newRingSet);
            Assert.That(newShifter.Rings, Is.EqualTo(newRingSet));
            Assert.That(newShifter.GetRingCount(), Is.EqualTo(newRingSet.RingCount));
            Assert.That(newShifter.CurPos, Is.EqualTo(0));
        }
Beispiel #10
0
        public void Reset()
        {
            _scheduler.Reset();

            _memBus.Reset();
            _mem.Reset();
            ALU.Reset();
            Shifter.Reset();
            _diskController.Reset();
            _displayController.Reset();
            _keyboard.Reset();
            _mouse.Reset();
            _cpu.Reset();
            _ethernetController.Reset();
            _musicInterface.Reset();

            UCodeMemory.Reset();
        }
Beispiel #11
0
        public void Reset()
        {
            _scheduler.Reset();

            _memBus.Reset();
            _mem.Reset();
            ALU.Reset();
            Shifter.Reset();
            _diskController.Reset();
            _displayController.Reset();
            _keyboard.Reset();
            _mouseAndKeyset.Reset();
            _cpu.Reset();
            _ethernetController.Reset();
            _orbitController.Reset();
            _tridentController.Reset();

            UCodeMemory.Reset();
        }
Beispiel #12
0
    //Handles whether or not the player should pass through the gate and other related changes, such as the color of the gate and the held object.
    public void HandleGate(RaycastHit2D[] hits)
    {
        for (int i = 0; i < hits.Length; i++)
        {
            if (hits[i].collider != null && hits[i].collider.CompareTag("Gate") && manager.CheckEqual(hits[i].collider))
            {
                GameObject gate = manager.GetEqual(hits[i].collider);

                //Case where the player simply passes through with held object if applicable
                if ((gate.GetComponent <GateScript>().Index == 7 && (held == null || (held != null && held.GetComponent <PickupScript>().Index != 7))) || (held != null && held.GetComponent <PickupScript>().Index == 7 && gate.GetComponent <GateScript>().Index == 7 && held.GetComponent <PickupScript>().LastIndex != gate.GetComponent <GateScript>().LastIndex))
                {
                    PassThrough(gate);
                }

                //Case where gate and held object turn white
                else if (held != null && gate.GetComponent <GateScript>().Index == held.GetComponent <PickupScript>().Index&& held.GetComponent <PickupScript>().Index != 7 && gate.GetComponent <GateScript>().Index != 7)
                {
                    gate.GetComponent <GateScript>().Activate();
                    held.GetComponent <PickupScript>().ChangeColor(7);
                    gate.GetComponent <GateScript>().ChangeColor(7);
                    PassThrough(gate);
                    if (gate.GetComponent <GateScript>().ActivateShift)
                    {
                        Shifter.ShiftColors();
                    }
                }

                //Case where gate and held object are white and revert back to previous color.
                else if (held != null && held.GetComponent <PickupScript>().Index == 7 && gate.GetComponent <GateScript>().Index == 7 && held.GetComponent <PickupScript>().LastIndex == gate.GetComponent <GateScript>().LastIndex)
                {
                    PassThrough(gate);
                    if (gate.GetComponent <GateScript>().ActivateShift)
                    {
                        Shifter.ShiftColors();
                    }
                    held.GetComponent <PickupScript>().Revert();
                    gate.GetComponent <GateScript>().Revert();
                    gate.GetComponent <GateScript>().Deactivate();
                }
            }
        }
    }
Beispiel #13
0
        public void FoldingShiftRightFoldingShiftLeftTestMethod8()
        {
            // {1, 2, 3, 8}
            //  -1 0, 1, 2
            f.InputSignal = new Signal(new List <float>()
            {
                1, 2, 3, 8
            }, new List <int>()
            {
                -1, 0, 1, 2
            }, false);
            f.Run();
            // {8, 3, 2, 1}
            // -2 -1, 0, 1
            s.InputSignal   = f.OutputFoldedSignal;
            s.ShiftingValue = 2;
            s.Run();
            // {8, 3, 2, 1}
            //  0, 1, 2, 3
            var f2 = new Folder();

            f2.InputSignal = s.OutputShiftedSignal;
            f2.Run();
            // {1, 2, 3, 8}
            // -3, -2, -1, 0
            var s2 = new Shifter();

            s2.InputSignal   = f2.OutputFoldedSignal;
            s2.ShiftingValue = 2;
            s2.Run();
            // {1, 2, 3, 8}
            // -5, -4, -3, -2

            actualOutputSignal   = s2.OutputShiftedSignal;
            expectedOutputSignal = new Signal(new List <float>()
            {
                1, 2, 3, 8
            }, new List <int>()
            {
                -5, -4, -3, -2
            }, false);
        }
Beispiel #14
0
        public void Reset()
        {
            _scheduler.Reset();

            _memBus.Reset();
            _mem.Reset();
            ALU.Reset();
            Shifter.Reset();
            _diskController.Reset();
            _displayController.Reset();
            _keyboard.Reset();
            _mouseAndKeyset.Reset();
            _cpu.Reset();
            _ethernetController.Reset();
            _orbitController.Reset();
            _tridentController.Reset();

            UCodeMemory.Reset();

            if (ScriptManager.IsRecording)
            {
                ScriptManager.Recorder.Command("reset");
            }
        }
        public static Blueprint Generate(SpriteShifterConfiguration configuration)
        {
            var signalCount = configuration.SignalCount ?? ScreenUtil.PixelSignals.Count;

            const int maxFilters       = 20;
            const int shifterCount     = 32;
            const int inputSignalCount = 32;

            var inputSignals = ComputerSignals.OrderedSignals.Take(inputSignalCount).ToList();
            var offsetSignal = VirtualSignalNames.Dot;

            var entities  = new List <Entity>();
            var inputMaps = new Entity[inputSignalCount];
            var shifters  = new Shifter[shifterCount];

            // Input maps
            for (var processorIndex = 0; processorIndex < inputSignalCount; processorIndex++)
            {
                var inputSignal = inputSignals[processorIndex];
                var y           = processorIndex * 4 + 3;

                if (y % 18 == 8)
                {
                    y--;
                }
                else if (y % 18 == 9)
                {
                    y++;
                }

                var inputMap = new Entity
                {
                    Name     = ItemNames.ConstantCombinator,
                    Position = new Position
                    {
                        X = 1,
                        Y = y
                    },
                    Direction        = Direction.Right,
                    Control_behavior = new ControlBehavior
                    {
                        Filters = new List <Filter> {
                            Filter.Create(offsetSignal, processorIndex + 1)
                        }
                    }
                };
                inputMaps[processorIndex] = inputMap;
                entities.Add(inputMap);
            }

            // Shifters
            for (var shifterIndex = 0; shifterIndex < shifterCount; shifterIndex++)
            {
                var shifterX = shifterIndex * 2 + shifterIndex / 8 * 2 + 2;

                var outputLink = new Entity
                {
                    Name     = ItemNames.BigElectricPole,
                    Position = new Position
                    {
                        X = 0.5 + shifterX,
                        Y = -1.5
                    }
                };
                entities.Add(outputLink);

                var inputSquared = new Entity
                {
                    Name     = ItemNames.ArithmeticCombinator,
                    Position = new Position
                    {
                        X = shifterX,
                        Y = 0.5
                    },
                    Direction        = Direction.Down,
                    Control_behavior = new ControlBehavior
                    {
                        Arithmetic_conditions = new ArithmeticConditions
                        {
                            First_signal    = SignalID.Create(VirtualSignalNames.Each),
                            Second_constant = 2,
                            Operation       = ArithmeticOperations.Exponentiation,
                            Output_signal   = SignalID.Create(VirtualSignalNames.Each)
                        }
                    }
                };
                entities.Add(inputSquared);

                var bufferedInput = new Entity
                {
                    Name     = ItemNames.ArithmeticCombinator,
                    Position = new Position
                    {
                        X = 0.5 + shifterX,
                        Y = 2
                    },
                    Direction        = Direction.Right,
                    Control_behavior = new ControlBehavior
                    {
                        Arithmetic_conditions = new ArithmeticConditions
                        {
                            First_signal    = SignalID.Create(VirtualSignalNames.Each),
                            Second_constant = 1,
                            Operation       = ArithmeticOperations.Multiplication,
                            Output_signal   = SignalID.Create(VirtualSignalNames.Each)
                        }
                    }
                };
                entities.Add(bufferedInput);

                var negativeInputSquared = new Entity
                {
                    Name     = ItemNames.ArithmeticCombinator,
                    Position = new Position
                    {
                        X = 1 + shifterX,
                        Y = 0.5
                    },
                    Direction        = Direction.Up,
                    Control_behavior = new ControlBehavior
                    {
                        Arithmetic_conditions = new ArithmeticConditions
                        {
                            First_signal    = SignalID.Create(VirtualSignalNames.Each),
                            Second_constant = -1,
                            Operation       = ArithmeticOperations.Multiplication,
                            Output_signal   = SignalID.Create(VirtualSignalNames.Each)
                        }
                    }
                };
                entities.Add(negativeInputSquared);

                // Input signal processors
                var signalProcessors = new SignalProcessor[inputSignalCount];
                for (var processorIndex = 0; processorIndex < inputSignalCount; processorIndex++)
                {
                    var inputSignal = inputSignals[processorIndex];
                    var y           = processorIndex * 4 + 3;

                    var inputChecker = new Entity
                    {
                        Name     = ItemNames.DeciderCombinator,
                        Position = new Position
                        {
                            X = 0.5 + shifterX,
                            Y = y
                        },
                        Direction        = Direction.Right,
                        Control_behavior = new ControlBehavior
                        {
                            Decider_conditions = new DeciderConditions
                            {
                                First_signal          = SignalID.Create(VirtualSignalNames.Each),
                                Second_signal         = SignalID.Create(offsetSignal),
                                Comparator            = Comparators.IsEqual,
                                Output_signal         = SignalID.Create(VirtualSignalNames.Each),
                                Copy_count_from_input = false
                            }
                        }
                    };
                    entities.Add(inputChecker);

                    var inputBuffer = new Entity
                    {
                        Name     = ItemNames.ArithmeticCombinator,
                        Position = new Position
                        {
                            X = 0.5 + shifterX,
                            Y = 1 + y
                        },
                        Direction        = Direction.Right,
                        Control_behavior = new ControlBehavior
                        {
                            Arithmetic_conditions = new ArithmeticConditions
                            {
                                First_signal    = SignalID.Create(inputSignal),
                                Second_constant = 1,
                                Operation       = ArithmeticOperations.Multiplication,
                                Output_signal   = SignalID.Create(inputSignal)
                            }
                        }
                    };
                    entities.Add(inputBuffer);

                    var outputGenerator = new Entity
                    {
                        Name     = ItemNames.ArithmeticCombinator,
                        Position = new Position
                        {
                            X = 0.5 + shifterX,
                            Y = 2 + y
                        },
                        Direction        = Direction.Right,
                        Control_behavior = new ControlBehavior
                        {
                            Arithmetic_conditions = new ArithmeticConditions
                            {
                                First_signal  = SignalID.Create(VirtualSignalNames.Each),
                                Second_signal = SignalID.Create(inputSignal),
                                Operation     = ArithmeticOperations.Multiplication,
                                Output_signal = SignalID.Create(VirtualSignalNames.Each)
                            }
                        }
                    };
                    entities.Add(outputGenerator);

                    var outputCleaner = new Entity
                    {
                        Name     = ItemNames.ArithmeticCombinator,
                        Position = new Position
                        {
                            X = 0.5 + shifterX,
                            Y = 3 + y
                        },
                        Direction        = Direction.Right,
                        Control_behavior = new ControlBehavior
                        {
                            Arithmetic_conditions = new ArithmeticConditions
                            {
                                First_signal    = SignalID.Create(inputSignal),
                                Second_constant = -1,
                                Operation       = ArithmeticOperations.Multiplication,
                                Output_signal   = SignalID.Create(offsetSignal)
                            }
                        }
                    };
                    entities.Add(outputCleaner);

                    signalProcessors[processorIndex] = new SignalProcessor
                    {
                        InputChecker    = inputChecker,
                        InputBuffer     = inputBuffer,
                        OutputGenerator = outputGenerator,
                        OutputCleaner   = outputCleaner
                    };
                }

                // Output signal maps
                var outputMaps = new Entity[(signalCount + maxFilters - 1) / maxFilters];
                for (var index = 0; index < outputMaps.Length; index++)
                {
                    var outputSignalMap = new Entity
                    {
                        Name     = ItemNames.ConstantCombinator,
                        Position = new Position
                        {
                            X = index % 2 + shifterX,
                            Y = index / 2 + inputSignalCount * 4 + 3
                        },
                        Direction        = Direction.Right,
                        Control_behavior = new ControlBehavior
                        {
                            Filters = ScreenUtil.PixelSignals.Skip(index * maxFilters).Take(Math.Min(maxFilters, signalCount - index * maxFilters)).Select((signal, signalIndex) => new Filter
                            {
                                Signal = SignalID.Create(signal),
                                Count  = index * maxFilters + signalIndex + 1
                            }).ToList()
                        }
                    };
                    outputMaps[index] = outputSignalMap;
                    entities.Add(outputSignalMap);
                }

                var offsetBuffer = new Entity
                {
                    Name     = ItemNames.ArithmeticCombinator,
                    Position = new Position
                    {
                        X = 0.5 + shifterX,
                        Y = outputMaps[^ 1].Position.Y + 1
Beispiel #16
0
        public static void Shift(Shifter shifterRole, PlayerControl other)
        {
            var role = Utils.GetRole(other);

            //System.Console.WriteLine(role);
            //TODO - Shift Animation
            shifterRole.LastShifted = DateTime.UtcNow;
            var shifter = shifterRole.Player;
            List <PlayerTask>        tasks1, tasks2;
            List <GameData.TaskInfo> taskinfos1, taskinfos2;

            var swapTasks    = true;
            var lovers       = false;
            var resetShifter = false;
            var snitch       = false;

            Role newRole;

            switch (role)
            {
            case RoleEnum.Sheriff:
            case RoleEnum.Jester:
            case RoleEnum.Engineer:
            case RoleEnum.Lover:
            case RoleEnum.Mayor:
            case RoleEnum.Swapper:
            case RoleEnum.Investigator:
            case RoleEnum.TimeLord:
            case RoleEnum.Medic:
            case RoleEnum.Seer:
            case RoleEnum.Executioner:
            case RoleEnum.Spy:
            case RoleEnum.Snitch:
            case RoleEnum.Arsonist:
            case RoleEnum.Crewmate:
            case RoleEnum.Altruist:

                if (role == RoleEnum.Investigator)
                {
                    Footprint.DestroyAll(Role.GetRole <Investigator>(other));
                }


                newRole        = Role.GetRole(other);
                newRole.Player = shifter;

                if (role == RoleEnum.Snitch)
                {
                    CompleteTask.Postfix(shifter);
                }

                var modifier  = Modifier.GetModifier(other);
                var modifier2 = Modifier.GetModifier(shifter);
                if (modifier != null && modifier2 != null)
                {
                    modifier.Player  = shifter;
                    modifier2.Player = other;
                    Modifier.ModifierDictionary.Remove(other.PlayerId);
                    Modifier.ModifierDictionary.Remove(shifter.PlayerId);
                    Modifier.ModifierDictionary.Add(shifter.PlayerId, modifier);
                    Modifier.ModifierDictionary.Add(other.PlayerId, modifier2);
                }
                else if (modifier2 != null)
                {
                    modifier2.Player = other;
                    Modifier.ModifierDictionary.Remove(shifter.PlayerId);
                    Modifier.ModifierDictionary.Add(other.PlayerId, modifier2);
                }
                else if (modifier != null)
                {
                    modifier.Player = shifter;
                    Modifier.ModifierDictionary.Remove(other.PlayerId);
                    Modifier.ModifierDictionary.Add(shifter.PlayerId, modifier);
                }


                Role.RoleDictionary.Remove(shifter.PlayerId);
                Role.RoleDictionary.Remove(other.PlayerId);

                Role.RoleDictionary.Add(shifter.PlayerId, newRole);
                lovers = role == RoleEnum.Lover;
                snitch = role == RoleEnum.Snitch;

                foreach (var exeRole in Role.AllRoles.Where(x => x.RoleType == RoleEnum.Executioner))
                {
                    var executioner = (Executioner)exeRole;
                    var target      = executioner.target;
                    if (other == target)
                    {
                        executioner.target.nameText.color = Color.white;
                        ;
                        executioner.target = shifter;

                        executioner.RegenTask();
                    }
                }

                if (CustomGameOptions.WhoShifts == ShiftEnum.NonImpostors ||
                    role == RoleEnum.Crewmate && CustomGameOptions.WhoShifts == ShiftEnum.RegularCrewmates)
                {
                    resetShifter       = true;
                    shifterRole.Player = other;
                    Role.RoleDictionary.Add(other.PlayerId, shifterRole);
                }
                else
                {
                    new Crewmate(other);
                }


                break;

            case RoleEnum.Underdog:
            case RoleEnum.Undertaker:
            case RoleEnum.Assassin:
            case RoleEnum.Swooper:
            case RoleEnum.Miner:
            case RoleEnum.Morphling:
            case RoleEnum.Camouflager:
            case RoleEnum.Janitor:
            case RoleEnum.LoverImpostor:
            case RoleEnum.Impostor:
            case RoleEnum.Glitch:
            case RoleEnum.Shifter:
                shifter.Data.IsImpostor = true;
                shifter.MurderPlayer(shifter);
                shifter.Data.IsImpostor = false;
                swapTasks = false;
                break;
            }

            if (swapTasks)
            {
                tasks1     = other.myTasks;
                taskinfos1 = other.Data.Tasks;
                tasks2     = shifter.myTasks;
                taskinfos2 = shifter.Data.Tasks;

                shifter.myTasks    = tasks1;
                shifter.Data.Tasks = taskinfos1;
                other.myTasks      = tasks2;
                other.Data.Tasks   = taskinfos2;

                if (other.AmOwner)
                {
                    Coroutines.Start(ShowShift());
                }

                if (lovers)
                {
                    var lover      = Role.GetRole <Lover>(shifter);
                    var otherLover = lover.OtherLover;
                    otherLover.RegenTask();
                }

                if (snitch)
                {
                    var snitchRole = Role.GetRole <Snitch>(shifter);
                    snitchRole.ImpArrows.DestroyAll();
                    snitchRole.SnitchArrows.DestroyAll();
                    snitchRole.SnitchTargets.Clear();
                    CompleteTask.Postfix(shifter);
                    if (other.AmOwner)
                    {
                        foreach (var player in PlayerControl.AllPlayerControls)
                        {
                            player.nameText.color = Color.white;
                        }
                    }
                }

                if (resetShifter)
                {
                    shifterRole.RegenTask();
                }
            }

            //System.Console.WriteLine(shifter.Is(RoleEnum.Sheriff));
            //System.Console.WriteLine(other.Is(RoleEnum.Sheriff));
            //System.Console.WriteLine(Roles.Role.GetRole(shifter));
            if (shifter.AmOwner || other.AmOwner)
            {
                if (shifter.Is(RoleEnum.Arsonist) && other.AmOwner)
                {
                    Role.GetRole <Arsonist>(shifter).IgniteButton.Destroy();
                }
                DestroyableSingleton <HudManager> .Instance.KillButton.gameObject.SetActive(false);

                DestroyableSingleton <HudManager> .Instance.KillButton.isActive = false;

                Lights.SetLights();
            }
        }