Ejemplo n.º 1
0
 private void AwardSolve(string userNickName, int ComponentValue)
 {
     if (OtherModes.ZenModeOn)
     {
         ComponentValue = (int)Math.Ceiling(ComponentValue * 0.20f);
     }
     if (userNickName == null)
     {
         TwitchPlaySettings.AddRewardBonus(ComponentValue);
     }
     else
     {
         string headerText = UnsupportedModule ? modInfo.moduleDisplayName : BombComponent.GetModuleDisplayName();
         IRCConnection.Instance.SendMessage(TwitchPlaySettings.data.AwardSolve, Code, userNickName, ComponentValue, headerText);
         string RecordMessageTone = $"Module ID: {Code} | Player: {userNickName} | Module Name: {headerText} | Value: {ComponentValue}";
         Leaderboard.Instance?.AddSolve(userNickName);
         if (!UserAccess.HasAccess(userNickName, AccessLevel.NoPoints))
         {
             Leaderboard.Instance?.AddScore(userNickName, ComponentValue);
         }
         else
         {
             TwitchPlaySettings.AddRewardBonus(ComponentValue);
         }
         TwitchPlaySettings.AppendToSolveStrikeLog(RecordMessageTone);
         TwitchPlaySettings.AppendToPlayerLog(userNickName);
     }
     if (OtherModes.TimeModeOn)
     {
         float time = OtherModes.GetAdjustedMultiplier() * ComponentValue;
         if (time < TwitchPlaySettings.data.TimeModeMinimumTimeGained)
         {
             BombCommander.timerComponent.TimeRemaining = BombCommander.CurrentTimer + TwitchPlaySettings.data.TimeModeMinimumTimeGained;
             IRCConnection.Instance.SendMessage("Bomb time increased by the minimum {0} seconds!", TwitchPlaySettings.data.TimeModeMinimumTimeGained);
         }
         else
         {
             BombCommander.timerComponent.TimeRemaining = BombCommander.CurrentTimer + time;
             IRCConnection.Instance.SendMessage("Bomb time increased by {0} seconds!", Math.Round(time, 1));
         }
         OtherModes.SetMultiplier(OtherModes.GetMultiplier() + TwitchPlaySettings.data.TimeModeSolveBonus);
     }
 }
Ejemplo n.º 2
0
    private void AwardSolve(string userNickName, ICommandResponseNotifier responseNotifier, int ComponentValue)
    {
        string headerText = UnsupportedModule ? modInfo.moduleDisplayName : BombComponent.GetModuleDisplayName();

        IRCConnection.SendMessage(TwitchPlaySettings.data.AwardSolve, Code, userNickName, ComponentValue, headerText);
        string RecordMessageTone = $"Module ID: {Code} | Player: {userNickName} | Module Name: {headerText} | Value: {ComponentValue}";

        responseNotifier.ProcessResponse(CommandResponse.EndComplete, ComponentValue);
        TwitchPlaySettings.AppendToSolveStrikeLog(RecordMessageTone);
        TwitchPlaySettings.AppendToPlayerLog(userNickName);
        if (OtherModes.timedModeOn)
        {
            float multiplier = OtherModes.getMultiplier();
            float time       = multiplier * ComponentValue;
            BombCommander.timerComponent.TimeRemaining = BombCommander.CurrentTimer + time;
            IRCConnection.SendMessage("Bomb time increased by {0} seconds!", Math.Round(time, 1));
            if (multiplier < 10)
            {
                multiplier = multiplier + 0.1f;
                OtherModes.setMultiplier(multiplier);
            }
        }
    }