Skip to content

Commit

Permalink
Better values
Browse files Browse the repository at this point in the history
  • Loading branch information
TonybynMp4 committed Feb 16, 2024
1 parent d1bfa51 commit a971f68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config/client.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
return {
--- time in minutes before the alcohol level is updated
alcoholDecayTime = 5,
alcoholDecayTime = 1,
--- amount of alcohol to decay per alcoholDecayTime
alcoholDecayAmount = 0.25,
alcoholDecayAmount = 0.05,
--- delay in ms before the effect is first applied
delayEffect = 15000,
effect = {
Expand Down
12 changes: 6 additions & 6 deletions config/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ return {
champagne = {
min = 20,
max = 40,
alcoholLevel = 0.5,
alcoholLevel = 0.25,
prop = {
bone = 18905,
pos = vec3(0.10000000149011, -0.02999999932944, 0.02999999932944),
Expand All @@ -52,7 +52,7 @@ return {
whiskey = {
min = 20,
max = 30,
alcoholLevel = 0.75,
alcoholLevel = 0.5,
prop = {
bone = 60309,
pos = vec3(0.0, 0.0, 0.0),
Expand All @@ -68,7 +68,7 @@ return {
vodka = {
min = 20,
max = 40,
alcoholLevel = 1,
alcoholLevel = 0.5,
prop = {
bone = 18905,
pos = vec3(0.0, -0.25999999046325, 0.10000000149011),
Expand All @@ -84,7 +84,7 @@ return {
beer = {
min = 30,
max = 40,
alcoholLevel = 0.25,
alcoholLevel = 0.15,
prop = {
bone = 18905,
pos = vec3(0.03999999910593, -0.14000000059604, 0.10000000149011),
Expand All @@ -99,7 +99,7 @@ return {
},
wine = {
min = 20,
alcoholLevel = 0.3,
alcoholLevel = 0.125,
max = 40,
prop = {
bone = 18905,
Expand All @@ -116,7 +116,7 @@ return {
grapejuice = {
max = 25,
min = 10,
alcoholLevel = 0.05,
alcoholLevel = 0.075,
prop = {
bone = 18905,
pos = vec3(0.0, -0.25999999046325, 0.10000000149011),
Expand Down
7 changes: 3 additions & 4 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ for alcohol, params in pairs(config.alcoholItems) do
local newAlcohol = playerState.alcohol + ((params.alcoholLevel / 2) * (1 - alcoholTolerance)) + (params.alcoholLevel / 2)

playerState:set('alcohol', newAlcohol, true)
player.Functions.SetMetaData('alcohol', playerState.alcohol)
player.Functions.SetMetaData('alcohol', newAlcohol)


if math.random() <= config.alcoholToleranceIncreaseChance then
if alcoholTolerance < 1.0 and math.random() <= config.alcoholToleranceIncreaseChance then
player.Functions.SetMetaData('alcoholTolerance', alcoholTolerance + config.alcoholToleranceIncrease)
exports.qbx_core:Notify(source, 'You feel like you can handle your liquor better now', 'success')
end


playerState:set('stress', playerState.stress - math.random(params.stressRelief.min, params.stressRelief.max), true)

TriggerClientEvent('hud:client:UpdateNeeds', source, player.PlayerData.metadata.thirst, sustenance)
Expand Down

0 comments on commit a971f68

Please sign in to comment.