Skip to content

Instantly share code, notes, and snippets.

@SteffenBlake
Created July 18, 2025 23:04
Show Gist options
  • Select an option

  • Save SteffenBlake/b9b9fc3e3a4eb02d3cc342704f47836b to your computer and use it in GitHub Desktop.

Select an option

Save SteffenBlake/b9b9fc3e3a4eb02d3cc342704f47836b to your computer and use it in GitHub Desktop.
local weaponskill_elements = {
-- Dagger
['GustSlash'] = 'Wind',
['Cyclone'] = 'Wind',
['EnergySteal'] = 'Dark',
['EnergyDrain'] = 'Dark',
['AeolianEdge'] = 'Wind',
-- Sword
['BurningBlade'] = 'Fire',
['RedLotusBlade'] = 'Fire',
['ShiningBlade'] = 'Light',
['SeraphBlade'] = 'Light',
['SanguineBlade'] = 'Dark',
-- Great Sword
['Frostbite'] = 'Ice',
['Freezebite'] = 'Ice',
['HerculeanSlash'] = 'Ice',
-- Axe
['Cloudsplitter'] = 'Thunder',
['PrimalRend'] = 'Light',
-- Scythe
['DarkHarvest'] = 'Dark',
['ShadowofDeath'] = 'Dark',
['InfernalScythe'] = 'Dark',
-- Polearm
['ThunderThrust'] = 'Thunder',
['RaidenThrust'] = 'Thunder',
-- Katana
['BladeTeki'] = 'Water',
['BladeTo'] = 'Ice',
['BladeChi'] = 'Earth',
['BladeEi'] = 'Dark',
['BladeYu'] = 'Water',
-- Great Katana
['TachiGoten'] = 'Thunder',
['TachiKagero'] = 'Fire',
['TachiJinpu'] = 'Wind',
['TachiKoki'] = 'Light',
-- Club
['ShiningStrike'] = 'Light',
['SeraphStrike'] = 'Light',
['FlashNova'] = 'Light',
-- Staff
['RockCrusher'] = 'Earth',
['EarthCrusher'] = 'Earth',
['Starburst'] = 'Dark',
['Sunburst'] = 'Dark',
['Cataclysm'] = 'Dark',
['Vidohunir'] = 'Dark',
['GarlandofBliss'] = 'Light',
['Omniscience'] = 'Dark',
-- Archery
['FlamingArrow'] = 'Fire',
-- Marksmanship
['HotShot'] = 'Fire',
['Wildfire'] = 'Fire',
['Trueflight'] = 'Light',
['LeadenSalute'] = 'Dark',
};
local element_opposites = {
Fire = 'Water',
Ice = 'Fire',
Wind = 'Earth',
Earth = 'Wind',
Thunder = 'Water',
Water = 'Thunder',
Light = 'Dark',
Dark = 'Light',
}
local M = {}
---@param element 'Fire'|'Ice'|'Wind'|'Earth'|'Thunder'|'Water'|'Light'|'Dark'
---@return number -- range: -0.4 to 0.4
function M.current_ele_bonus(element)
local environment = gData.GetEnvironment();
local opposing_element = element_opposites[element];
local bonus = 0.0;
-- Day bonus
if environment.DayElement == element then
bonus = bonus + 0.1;
elseif environment.DayElement == opposing_element then
bonus = bonus - 0.1;
end
-- Weather bonus
local element_double = element .. ' x2';
local opposing_double = opposing_element .. ' x2';
if environment.Weather == element_double then
bonus = bonus + 0.25;
elseif environment.Weather == element then
bonus = bonus + 0.1;
elseif environment.Weather == opposing_double then
bonus = bonus - 0.25;
elseif environment.Weather == opposing_element then
bonus = bonus - 0.1;
end
return bonus;
end
---@param ws_name_normalized string
---@return number -- range: -0.4 to 0.4
function M.weaponskill_ele_bonus(ws_name_normalized)
local element = weaponskill_elements[ws_name_normalized];
return M.current_ele_bonus(element);
end
return M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment