diff --git a/src/client/UI/Missions/init.lua b/src/client/UI/Missions/init.lua index e429e7c..5100465 100644 --- a/src/client/UI/Missions/init.lua +++ b/src/client/UI/Missions/init.lua @@ -21,6 +21,7 @@ local interfaces = require(StarterPlayer.StarterPlayerScripts.Client.UI.Collidab local statusUIListeners = {} local missionRequirements = ReplicatedStorage.Missions local missionSkipProductID = ReplicatedStorage.Config.DevProductData.IDs.MissionSkip.Value +local doubleGemsGamepassID = tostring(ReplicatedStorage.Config.GamepassData.IDs["2xGems"].Value) local rolloutSpeed = ReplicatedStorage.Config.Text.MissionTextRolloutSpeed.Value local MissionsUI = CentralUI.new(player.PlayerGui:WaitForChild "MissionsUI") local MissionFearRewardUI = require(script.MissionFearRewardUI) @@ -87,6 +88,10 @@ function MissionsUI:_initialize(): () end function MissionsUI:RolloutDialogue(dialogueSegment, gemRewardValue) + if selectors.hasGamepass(store:getState(), player.Name, doubleGemsGamepassID) then + gemRewardValue *= 2 + end + local splitText = {} local text = if typeof(dialogueSegment) == "string" then dialogueSegment else dialogueSegment.Value local gemRewardText = formatter.formatNumberWithSuffix(gemRewardValue) .. " Gems" diff --git a/src/server/Combat/Missions.lua b/src/server/Combat/Missions.lua index 94ffb25..e848736 100644 --- a/src/server/Combat/Missions.lua +++ b/src/server/Combat/Missions.lua @@ -25,7 +25,8 @@ Remotes.Server:Get("CompleteMission"):SetCallback(function(player: Player) return false end - store:dispatch(actions.completeMission(player.Name, areaName, currentMissionRequirements.Gems.Value)) + store:dispatch(actions.completeMission(player.Name, areaName)) + store:dispatch(actions.incrementPlayerStat(player.Name, "Gems", currentMissionRequirements.Gems.Value)) return true end) diff --git a/src/server/PlayerManager/ProfileTemplate.lua b/src/server/PlayerManager/ProfileTemplate.lua index 45ac1e3..b005118 100644 --- a/src/server/PlayerManager/ProfileTemplate.lua +++ b/src/server/PlayerManager/ProfileTemplate.lua @@ -27,6 +27,7 @@ return { MultiplierData = { FearMultiplier = 1, StrengthMultiplier = 1, + GemsMultiplier = 1, }, PurchaseData = { diff --git a/src/server/PurchaseManager/DeveloperProducts/Gamepasses/Rewarders.lua b/src/server/PurchaseManager/DeveloperProducts/Gamepasses/Rewarders.lua index ae55e2f..9d8d2eb 100644 --- a/src/server/PurchaseManager/DeveloperProducts/Gamepasses/Rewarders.lua +++ b/src/server/PurchaseManager/DeveloperProducts/Gamepasses/Rewarders.lua @@ -36,9 +36,13 @@ return { [tostring(IDs["2xStrength"].Value)] = function(player: Player) store:dispatch(actions.incrementPlayerMultiplier(player.Name, "StrengthMultiplier", 2)) end, + [tostring(IDs["2xFear"].Value)] = function(player: Player) + store:dispatch(actions.incrementPlayerMultiplier(player.Name, "FearMultiplier", 2)) + end, + [tostring(IDs["2xGems"].Value)] = function(player: Player) + store:dispatch(actions.incrementPlayerMultiplier(player.Name, "GemsMultiplier", 2)) + end, - [tostring(IDs["2xFear"].Value)] = true, - [tostring(IDs["2xGems"].Value)] = true, [tostring(IDs["2xSpeed"].Value)] = true, [tostring(IDs["2xAttackSpeed"].Value)] = true, [tostring(IDs["3xWorkoutSpeed"].Value)] = true, diff --git a/src/server/PurchaseManager/DeveloperProducts/Products/Rewarders.lua b/src/server/PurchaseManager/DeveloperProducts/Products/Rewarders.lua index bab6458..ac67198 100644 --- a/src/server/PurchaseManager/DeveloperProducts/Products/Rewarders.lua +++ b/src/server/PurchaseManager/DeveloperProducts/Products/Rewarders.lua @@ -15,5 +15,6 @@ return { local gemReward = ReplicatedStorage.Missions[areaName][tostring(currentMissionData.CurrentMissionNumber)].Gems.Value store:dispatch(actions.completeMission(player.Name, areaName, gemReward, true)) + store:dispatch(actions.incrementPlayerStat(player.Name, "Gems", gemReward)) end, } diff --git a/src/server/State/Actions/MissionActions.lua b/src/server/State/Actions/MissionActions.lua index 9ec3ae7..17c2203 100644 --- a/src/server/State/Actions/MissionActions.lua +++ b/src/server/State/Actions/MissionActions.lua @@ -12,11 +12,10 @@ return { end), completeMission = makeActionCreator( "completeMission", - function(playerName: string, areaName: string, gemReward: number, skipped: boolean) + function(playerName: string, areaName: string, skipped: boolean) return { areaName = areaName, playerName = playerName, - gemReward = gemReward, skipped = skipped, shouldSave = true, } diff --git a/src/shared/State/DefaultStates.lua b/src/shared/State/DefaultStates.lua index 59a6ecb..2e38a37 100644 --- a/src/shared/State/DefaultStates.lua +++ b/src/shared/State/DefaultStates.lua @@ -27,6 +27,7 @@ return { MultiplierData = { FearMultiplier = 1, StrengthMultiplier = 1, + GemsMultiplier = 1, }, PetData = { diff --git a/src/shared/State/Reducer/Stats.lua b/src/shared/State/Reducer/Stats.lua index 529f5fc..dfb64b6 100644 --- a/src/shared/State/Reducer/Stats.lua +++ b/src/shared/State/Reducer/Stats.lua @@ -97,9 +97,4 @@ return Rodux.createReducer({}, { draft[action.playerName].CurrentPetEquipCount += removedPetEquipCount end) end, - completeMission = function(state, action) - return produce(state, function(draft) - draft[action.playerName].Gems += action.gemReward - end) - end, })