From 2b3c48d1ea9fc3846d10e0ce602273c6e616f335 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sun, 14 Jul 2024 23:39:12 +0200 Subject: [PATCH] Added shortcut function for adding general conditions --- features/eid_api.lua | 2 ++ features/eid_conditionals_funcs.lua | 34 +++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/features/eid_api.lua b/features/eid_api.lua index ec6d2966..c413d7bf 100644 --- a/features/eid_api.lua +++ b/features/eid_api.lua @@ -2160,6 +2160,8 @@ end function EID:GetEntityXMLName(Type, Variant, SubType) return EID.XMLEntityNames[Type.."."..Variant] or EID.XMLEntityNames[Type.."."..Variant.."."..SubType] end + +---@diagnostic disable-next-line: duplicate-set-field function EID:GetEntityXMLNameByString(tvsString) local Type, Var, Sub = EID:SplitTVS(tvsString) return EID:GetEntityXMLName(Type, Var, Sub) diff --git a/features/eid_conditionals_funcs.lua b/features/eid_conditionals_funcs.lua index 2c4e4332..8bc54a72 100644 --- a/features/eid_conditionals_funcs.lua +++ b/features/eid_conditionals_funcs.lua @@ -62,18 +62,48 @@ function EID:addToGeneralCondition(ID, locTable, text, numberToDouble, newNumber language = language or "en_us" if numberToDouble then newNumber = newNumber or numberToDouble * 2 - text = {numberToDouble, newNumber, text} + text = { numberToDouble, newNumber, text } end EID.descriptions[language][locTable][ID] = text end +-- Shortcut function for adding Repentance Tarot Cloth conditions +function EID:addTarotClothBuffsCondition(ID, text, numberToDouble, newNumber, language) + EID:addToGeneralCondition(ID, "tarotClothBuffs", text, numberToDouble, newNumber, language) +end + +-- Shortcut function for adding Ab+ Tarot Cloth conditions +function EID:addTarotClothBuffsABCondition(ID, text, numberToDouble, newNumber, language) + EID:addToGeneralCondition(ID, "tarotClothBuffsAB", text, numberToDouble, newNumber, language) +end + +-- Shortcut function for adding car battery conditions +function EID:addCarBatteryCondition(ID, text, numberToDouble, newNumber, language) + EID:addToGeneralCondition(ID, "carBattery", text, numberToDouble, newNumber, language) +end + +-- Shortcut function for adding abyss synergies conditions +function EID:addAbyssSynergiesCondition(ID, text, numberToDouble, newNumber, language) + EID:addToGeneralCondition(ID, "abyssSynergies", text, numberToDouble, newNumber, language) +end + +-- Shortcut function for adding book of belial conditions +function EID:addBookOfBelialBuffsCondition(ID, text, numberToDouble, newNumber, language) + EID:addToGeneralCondition(ID, "bookOfBelialBuffs", text, numberToDouble, newNumber, language) +end + +-- Shortcut function for adding binge eater conditions +function EID:addBingeEaterBuffsCondition(ID, text, numberToDouble, newNumber, language) + EID:addToGeneralCondition(ID, "bingeEaterBuffs", text, numberToDouble, newNumber, language) +end + -- Shortcut function for adding BFFS conditions; this is slightly more complex since it supports trinkets -- Example usage: EID:addBFFSCondition(myBasicFamiliarID, nil, 3.5) function EID:addBFFSCondition(ID, text, numberToDouble, newNumber, language) language = language or "en_us" if numberToDouble then newNumber = newNumber or numberToDouble * 2 - text = {numberToDouble, newNumber, text} + text = { numberToDouble, newNumber, text } end if type(ID) ~= "string" then ID = "5.100." .. ID else