Skip to content

Commit

Permalink
Cleanup unnecessary includes, edit comments. Adjust logic for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSolstice8 authored and zach2good committed Mar 2, 2022
1 parent 74bc7d4 commit 8e4be64
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 20 deletions.
3 changes: 1 addition & 2 deletions scripts/globals/abilities/flabra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Flabra
-- Increases resistance against earth and deals wind damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
3 changes: 1 addition & 2 deletions scripts/globals/abilities/gelus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Gelus
-- Increases resistance against wind and deals ice damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
3 changes: 1 addition & 2 deletions scripts/globals/abilities/ignis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Ignis
-- Increases resistance against ice and deals fire damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
3 changes: 1 addition & 2 deletions scripts/globals/abilities/lux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Lux
-- Increases resistance against dark and deals light damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/abilities/rune_enchantment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Ability: Rune Enchantment
-- Allows you to harbor runes
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/globals/status")
Expand Down
3 changes: 1 addition & 2 deletions scripts/globals/abilities/sulpor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Sulpor
-- Increases resistance against earth and deals thunder damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
3 changes: 1 addition & 2 deletions scripts/globals/abilities/tellus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Tellus
-- Increases resistance against thunder and deals earth damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
3 changes: 1 addition & 2 deletions scripts/globals/abilities/tenebrae.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Tenebrae
-- Increases resistance against light and deals dark damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
3 changes: 1 addition & 2 deletions scripts/globals/abilities/unda.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- Ability: Undra
-- Increases resistance against fire and deals water damage.
-- Obtained: Rune Fencer Level 5
-- Recast Time: 0:10
-- Recast Time: 0:05
-- Duration: 5:00
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/status")
require("scripts/globals/job_utils/rune_fencer")
-----------------------------------
Expand Down
9 changes: 6 additions & 3 deletions scripts/globals/job_utils/rune_fencer.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-----------------------------------
-- Rune Fencer Job Utilities
-----------------------------------
require("scripts/settings/main")
require("scripts/globals/ability")
require("scripts/globals/status")
require("scripts/globals/msg")
Expand All @@ -14,12 +13,16 @@ xi.job_utils.rune_fencer = xi.job_utils.rune_fencer or {}
-----------------------------------

local function getRUNLevel(player)
return player:getMainJob() == xi.job.RUN and player:getMainLvl() or player:getSubLvl()
if player:getMainJob() == xi.job.RUN then
return player:getMainLvl()
else
return player:getSubLvl()
end
end

local function applyRuneEnhancement(effectType, player)
local RUNLevel = getRUNLevel(player)
local meritBonus = (player:getMerit(xi.merit.MERIT_RUNE_ENHANCE) * 2) -- 2 more elemental resistance per merit for a maximum total of (2*5) = 10
local meritBonus = player:getMerit(xi.merit.MERIT_RUNE_ENHANCE) -- 2 more elemental resistance per merit for a maximum total of (2*5) = 10 (power of merit is 2 per level)
local jobPointBonus = player:getJobPointLevel(xi.jp.RUNE_ENCHANTMENT_EFFECT) -- 1 more elemental resistance per level for a maximum total of 20

-- see https://www.bg-wiki.com/ffxi/Category:Rune
Expand Down

0 comments on commit 8e4be64

Please sign in to comment.