Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Add fearless boost
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluviolithic committed Nov 27, 2023
1 parent 41e5972 commit 5f71cae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/client/UI/Combat/FearMeter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ playerStatePromise:andThen(function()
end

local function revealFearMeter()
fearMeter.Fear.Visible = true
if selectors.getActiveBoosts(store:getState(), player.Name)["FearlessBoost"] then
fearMeter.Fear.Visible = false
fearMeter.Fearless.Visible = true
else
fearMeter.Fear.Visible = true
fearMeter.Fearless.Visible = false
end

fearMeter.Icon.Visible = true
fearMeter.Image.Visible = true
fearMeter.Enable.Visible = false
Expand Down
3 changes: 3 additions & 0 deletions src/server/Combat/Enemies/ApplyDamageToPlayers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ return function(enemy, info, janitor)
task.spawn(function()
while damagePlayers do
for _, player in info.EngagedPlayers do
if selectors.getActiveBoosts(store:getState(), player.Name)["FearlessBoost"] then
continue
end
local fearMeterGoal = math.min(
selectors.getStat(store:getState(), player.Name, "CurrentFearMeter")
+ enemy.Configuration.Damage.Value,
Expand Down
6 changes: 6 additions & 0 deletions src/server/Combat/FearEffects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ local function isScared(playerName, state)
if not selectors.isPlayerLoaded(state, playerName) then
return false
end
if selectors.getActiveBoosts(state, playerName)["FearlessBoost"] then
if selectors.getStat(state, playerName, "CurrentFearMeter") ~= 0 then
store:dispatch(actions.setPlayerStat(playerName, "CurrentFearMeter", 0))
end
return false
end
return selectors.getStat(state, playerName, "CurrentFearMeter")
== selectors.getStat(state, playerName, "MaxFearMeter")
and (os.time() - selectors.getStat(state, playerName, "LastScaredTimestamp")) < 121
Expand Down

0 comments on commit 5f71cae

Please sign in to comment.