Merge pull request #310 from Buurazu/master
Glitched Item Descriptions + etc. fixes
This commit is contained in:
13 files changed
+398
-53
No files matched your search
@@ -951,6 +951,62 @@ EID.descriptions[languageCode].horsepills={
|
||||
[9999] = {"", "Golden Pill", "Random horse pill effect#Destroys itself after a few uses"}, -- Golden Pill
|
||||
}
|
||||
|
||||
---------- Glitched Item Descriptions ----------
|
||||
|
||||
EID.descriptions[languageCode].GlitchedItemText = {
|
||||
-- This will be appended to words to pluralize them, make it "" to not pluralize
|
||||
pluralize = "s",
|
||||
|
||||
-- Item Config info
|
||||
AddBlackHearts = "{1} Black Heart",
|
||||
AddBombs = "{1} Bomb",
|
||||
AddCoins = "{1} Coin",
|
||||
AddHearts = "Heals {1} Red Heart",
|
||||
AddKeys = "{1} Key",
|
||||
AddMaxHearts = "{1} Heart Container",
|
||||
AddSoulHearts = "{1} Soul Heart",
|
||||
|
||||
-- Cache Flag names
|
||||
cacheFlagStart = "May affect ",
|
||||
[0] = "Damage", "Fire Rate", "Shot Speed", "Range", "Speed", "Tear Effects", "Tear Color", "Flight", "Attack Type", "Familiars", "Luck", "Size", "Color", "Chest Contents", [16] = "All Stats",
|
||||
|
||||
-- Attribute triggers
|
||||
chain = "Then: ",
|
||||
active = "On use:#",
|
||||
pickup_collected = "When you collect a pickup:#", --chance to?
|
||||
enemy_kill = "On kill, chance to:#",
|
||||
damage_taken = "When you take damage:#", --chance to?
|
||||
entity_spawned = "When a {{ColorGray}}{T1}{{ColorText}} is spawned:#",
|
||||
tear_fire = "When you fire a tear, chance to:#",
|
||||
enemy_hit = "On hitting an enemy, chance to:#",
|
||||
room_clear = "On room clear:#", --chance to?
|
||||
|
||||
-- Attribute effects
|
||||
area_damage = "Deal {1} damage in an area around you",
|
||||
add_temporary_effect = "Gain {1} for the room",
|
||||
convert_entities = "Convert all {{ColorGray}}{1}{{ColorText}} in the room to {{ColorGray}}{2}{{ColorText}}",
|
||||
use_active_item = "Use {1}",
|
||||
spawn_entity = "Spawn a {{ColorGray}}{1}{{ColorText}}",
|
||||
fart = "Fart with size {1}",
|
||||
|
||||
-- Generic entity names not obtained from entities2.xml
|
||||
-- This could also be a place to localize entity names; this table is read from before EID.XMLEntityNames
|
||||
["4.-1"] = "lit Bomb",
|
||||
["5.0"] = "pickup",
|
||||
["5.10"] = "Heart",
|
||||
["5.20"] = "Coin",
|
||||
["5.30"] = "Key",
|
||||
["5.40"] = "Bomb pickup",
|
||||
["5.69"] = "Grab Bag",
|
||||
["5.70"] = "Pill",
|
||||
["5.90"] = "Battery",
|
||||
["5.300"] = "Card",
|
||||
["9.-1"] = "enemy projectile",
|
||||
["999.-1"] = "grid object",
|
||||
["1000.0"] = "effect",
|
||||
|
||||
}
|
||||
|
||||
---------- Misc. Text ----------
|
||||
|
||||
EID.descriptions[languageCode].spindownError = "Item disappears"
|
||||
@@ -966,7 +1022,7 @@ EID.descriptions[languageCode].CraftingHideKey = "Hide:"
|
||||
EID.descriptions[languageCode].CraftingPreviewKey = "Preview:"
|
||||
EID.descriptions[languageCode].CraftingPreviewBackup = "!!! If this item's locked, it will turn into"
|
||||
|
||||
EID.descriptions[languageCode].CraftingResults = "(Scroll: hold {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}},#Lock: {{ButtonX}}, Refresh: {{ButtonB}})"
|
||||
EID.descriptions[languageCode].CraftingResults = "(Scroll: Hold {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}}, Lock: {{ButtonX}}, Refresh: {{ButtonB}}, Reset Bag: Hold {{ButtonRB}})"
|
||||
|
||||
EID.descriptions[languageCode].BlankCardCharge = "Blank Card charge:"
|
||||
EID.descriptions[languageCode].BlankCardQCard = "Teleport to I Am Error Room#Blank Card and ?-Card will be destroyed"
|
||||
|
||||
@@ -93,4 +93,4 @@ local repTransformations = {
|
||||
-- Trinkets
|
||||
["5.350.169"] = "1",
|
||||
}
|
||||
EID:updateDescriptionsViaTable(repTransformations, EID.EntityTransformations, false)
|
||||
EID:updateDescriptionsViaTable(repTransformations, EID.EntityTransformations)
|
||||
+45
-6
@@ -311,14 +311,14 @@ function EID:getDescriptionObj(Type, Variant, SubType, entity)
|
||||
description.ObjType = Type
|
||||
description.ObjVariant = Variant
|
||||
description.ObjSubType = SubType
|
||||
description.fullItemString = Type.."."..Variant.."."..description.ObjSubType
|
||||
description.Name = EID:getObjectName(Type, Variant, description.ObjSubType)
|
||||
description.fullItemString = Type.."."..Variant.."."..SubType
|
||||
description.Name = EID:getObjectName(Type, Variant, SubType)
|
||||
description.Entity = entity or nil
|
||||
|
||||
local tableEntry = EID:getDescriptionData(Type, Variant, description.ObjSubType)
|
||||
description.Description = tableEntry and tableEntry[3] or EID:getXMLDescription(Type, Variant, description.ObjSubType)
|
||||
local tableEntry = EID:getDescriptionData(Type, Variant, SubType)
|
||||
description.Description = tableEntry and tableEntry[3] or EID:getXMLDescription(Type, Variant, SubType)
|
||||
|
||||
description.Transformation = EID:getTransformation(Type, Variant, description.ObjSubType)
|
||||
description.Transformation = EID:getTransformation(Type, Variant, SubType)
|
||||
|
||||
for k,modifier in pairs(EID.DescModifiers) do
|
||||
if modifier.condition(description) then
|
||||
@@ -506,7 +506,7 @@ function EID:hasDescription(entity)
|
||||
return isAllowed and entity.SubType > 0
|
||||
end
|
||||
if entity.Type == 6 and entity.Variant == 16 and EID.Config["DisplayCraneInfo"] and REPENTANCE then
|
||||
isAllowed = not entity:GetSprite():IsPlaying("Broken") and not entity:GetSprite():IsPlaying("Prize")
|
||||
isAllowed = not entity:GetSprite():IsPlaying("Broken") and not entity:GetSprite():IsPlaying("Prize") and EID.CraneItemType[tostring(entity.InitSeed)]
|
||||
end
|
||||
isAllowed = isAllowed or (entity.Type == 1000 and entity.Variant == EffectVariant.DICE_FLOOR and EID.Config["DisplayDiceInfo"])
|
||||
return isAllowed
|
||||
@@ -784,6 +784,45 @@ function EID:PlayersHaveCollectible(collectibleID)
|
||||
return false
|
||||
end
|
||||
|
||||
-- Obtains information about glitched items from the ItemConfig (hearts added on pickup, cacheflags affected), returns string of info
|
||||
local itemConfigItemAttributes = { "AddMaxHearts", "AddHearts", "AddSoulHearts", "AddBlackHearts", "AddBombs", "AddCoins", "AddKeys", "CacheFlags" }
|
||||
function EID:CheckGlitchedItemConfig(id)
|
||||
local localizedNames = EID:getDescriptionEntry("GlitchedItemText")
|
||||
local config = Isaac.GetItemConfig()
|
||||
local item = config:GetCollectible(id)
|
||||
if not item then return "" end
|
||||
local attributes = ""
|
||||
for k,v in ipairs(itemConfigItemAttributes) do
|
||||
local val = item[v]
|
||||
if val ~= 0 then
|
||||
if (v == "CacheFlags") then
|
||||
local flagString = localizedNames["cacheFlagStart"]
|
||||
if val == CacheFlag.CACHE_ALL then
|
||||
flagString = flagString .. localizedNames[16]
|
||||
else
|
||||
for i=0, 13 do
|
||||
if 2^i & val ~= 0 then
|
||||
flagString = flagString .. localizedNames[i] .. ", "
|
||||
end
|
||||
end
|
||||
flagString = string.sub(flagString, 0, -3) -- remove final comma
|
||||
end
|
||||
attributes = attributes .. flagString .. "#"
|
||||
else
|
||||
-- the Add Heart attributes count half a heart as 1, so divide the value in half
|
||||
if string.find(v, "Hearts") then val = val / 2 end
|
||||
-- the g flag removes .0 in numbers like 1.0 (caused by the hearts division)
|
||||
local s = string.format("%.4g",val)
|
||||
if val > 0 then s = "+" .. s end
|
||||
attributes = attributes .. string.gsub(localizedNames[v], "{1}", s)
|
||||
if val ~= 1 and val ~= -1 then attributes = attributes .. localizedNames["pluralize"] end
|
||||
attributes = attributes .. "#"
|
||||
end
|
||||
end
|
||||
end
|
||||
return attributes
|
||||
end
|
||||
|
||||
-- Converts a given CollectibleID into the respective Spindown dice result
|
||||
function EID:getSpindownResult(collectibleID)
|
||||
if collectibleID <= 0 or collectibleID > 4294960000 then return 0 end
|
||||
|
||||
+40
-11
@@ -664,6 +664,7 @@ local refreshPosition = 0
|
||||
local bagOfCraftingRefreshes = 0
|
||||
local downHeld = 0
|
||||
local upHeld = 0
|
||||
local resetBagCounter = 0
|
||||
|
||||
local craftingIsHidden = false
|
||||
local showCraftingResult = false
|
||||
@@ -714,23 +715,41 @@ for key,num in pairs(Keyboard) do
|
||||
keyString = string.gsub(keyString, "_", " ")
|
||||
HotkeyToString[num] = keyString
|
||||
end
|
||||
--convert controller enum to buttons
|
||||
local ControllerToString = { [0] = "{{ButtonDLeft}}", "{{ButtonDRight}}", "{{ButtonDUp}}", "{{ButtonDDown}}",
|
||||
"{{ButtonA}}", "{{ButtonB}}", "{{ButtonX}}", "{{ButtonY}}", "{{ButtonLB}}", "{{ButtonLT}}", "{{ButtonLStick}}",
|
||||
"{{ButtonRB}}", "{{ButtonRT}}", "{{ButtonRStick}}", "{{ButtonSelect}}", "{{ButtonMenu}}" }
|
||||
|
||||
local function getHotkeyString()
|
||||
local hotkeyString = ""
|
||||
local hideDesc = EID:getDescriptionEntry("CraftingHideKey")
|
||||
local previewDesc = EID:getDescriptionEntry("CraftingPreviewKey")
|
||||
--we have a binding for a keyboard hide key
|
||||
if HotkeyToString[EID.Config["CraftingHideKey"]] then
|
||||
hotkeyString = hideDesc .. " " .. HotkeyToString[EID.Config["CraftingHideKey"]]
|
||||
|
||||
local controllerEnabled = EID.player.ControllerIndex > 0
|
||||
local hideKey = HotkeyToString[EID.Config["CraftingHideKey"]]
|
||||
local hideButton = controllerEnabled and ControllerToString[EID.Config["CraftingHideButton"]]
|
||||
local previewKey = HotkeyToString[EID.Config["CraftingResultKey"]]
|
||||
local previewButton = controllerEnabled and ControllerToString[EID.Config["CraftingResultButton"]]
|
||||
|
||||
if hideKey or hideButton then hotkeyString = hideDesc .. " " end
|
||||
if hideKey and hideButton then
|
||||
hotkeyString = hotkeyString .. hideKey .. "/" .. hideButton
|
||||
else
|
||||
hotkeyString = hotkeyString .. (hideKey or hideButton)
|
||||
end
|
||||
--we have a binding for a keyboard preview toggle key, and a full bag, and aren't on Preview Only mode
|
||||
if #EID.BagItems >= 8 and EID.Config["BagOfCraftingDisplayMode"] ~= "Preview Only" and HotkeyToString[EID.Config["CraftingResultKey"]] then
|
||||
if hotkeyString ~= "" then hotkeyString = hotkeyString .. ", " end
|
||||
hotkeyString = hotkeyString .. previewDesc .. " " .. HotkeyToString[EID.Config["CraftingResultKey"]]
|
||||
|
||||
if #EID.BagItems >= 8 and EID.Config["BagOfCraftingDisplayMode"] ~= "Preview Only" then
|
||||
if previewKey or previewButton then hotkeyString = hotkeyString .. ", " .. previewDesc .. " " end
|
||||
if previewKey and previewButton then
|
||||
hotkeyString = hotkeyString .. previewKey .. "/" .. previewButton
|
||||
else
|
||||
hotkeyString = hotkeyString .. (previewKey or previewButton)
|
||||
end
|
||||
end
|
||||
if hotkeyString ~= "" then
|
||||
hotkeyString = "!!! " .. hotkeyString .. "#"
|
||||
end
|
||||
|
||||
return hotkeyString
|
||||
end
|
||||
|
||||
@@ -784,9 +803,6 @@ function EID:handleBagOfCraftingRendering()
|
||||
local tableToCraftingIconsFunc = EID.tableToCraftingIconsMerged
|
||||
if EID.Config["BagOfCraftingDisplayIcons"] then tableToCraftingIconsFunc = EID.tableToCraftingIconsFull end
|
||||
|
||||
local customDescObj = EID:getDescriptionObj(5, 100, 710)
|
||||
customDescObj.Description = ""
|
||||
|
||||
--prevent our hotkeys from triggering as they're set
|
||||
if not ModConfigMenu or not ModConfigMenu.IsVisible then
|
||||
if Input.IsButtonTriggered(EID.Config["CraftingHideKey"], 0) or Input.IsButtonTriggered(EID.Config["CraftingHideButton"], EID.player.ControllerIndex) then
|
||||
@@ -885,6 +901,9 @@ function EID:handleBagOfCraftingRendering()
|
||||
--sort by ingredient quality
|
||||
table.sort(itemQuery, qualitySort)
|
||||
|
||||
local customDescObj = EID:getDescriptionObj(5, 100, 710)
|
||||
customDescObj.Description = ""
|
||||
|
||||
--No Recipes Mode display
|
||||
if EID.Config["BagOfCraftingDisplayMode"] == "Pickups Only" then
|
||||
EID:appendToDescription(customDescObj, getHotkeyString())
|
||||
@@ -1020,7 +1039,7 @@ function EID:handleBagOfCraftingRendering()
|
||||
local resultDesc = EID:getDescriptionEntry("CraftingResults")
|
||||
EID:appendToDescription(customDescObj, resultDesc)
|
||||
if Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.player.ControllerIndex) then
|
||||
EID.player:SetShootingCooldown(2)
|
||||
EID.player.ControlsCooldown = 2
|
||||
if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, EID.player.ControllerIndex) then
|
||||
bagOfCraftingOffset = math.min(numResults-(numResults%EID.Config["BagOfCraftingResults"]), bagOfCraftingOffset + EID.Config["BagOfCraftingResults"])
|
||||
downHeld = Isaac.GetTime()
|
||||
@@ -1045,6 +1064,16 @@ function EID:handleBagOfCraftingRendering()
|
||||
bagOfCraftingOffset = math.max(0, bagOfCraftingOffset - EID.Config["BagOfCraftingResults"])
|
||||
upHeld = Isaac.GetTime() - 700
|
||||
end
|
||||
--reset bag contents when holding Use Pill/Card
|
||||
if Input.IsActionPressed(ButtonAction.ACTION_PILLCARD, EID.player.ControllerIndex) then
|
||||
resetBagCounter = resetBagCounter + 1
|
||||
if resetBagCounter > 120 then
|
||||
EID.BagItems = {}
|
||||
resetBagCounter = 0
|
||||
end
|
||||
else
|
||||
resetBagCounter = 0
|
||||
end
|
||||
end
|
||||
--fix bug with being allowed to go to an empty page if recipe count = multiple of page size (or if we refresh on last page)
|
||||
if (bagOfCraftingOffset >= numResults) then bagOfCraftingOffset = bagOfCraftingOffset - EID.Config["BagOfCraftingResults"] end
|
||||
|
||||
@@ -188,6 +188,14 @@ EID.UserConfig = {
|
||||
-- Default = false
|
||||
["ShowUnidentifiedPillDescriptions"] = false,
|
||||
|
||||
------------Glitched Items--------------
|
||||
-- Toggle Display of Glitched Item (TMTRAINER) descriptions
|
||||
-- Note: The --luadebug launch option is required for more detailed glitched item descriptions
|
||||
-- This option allows mods to have access to your files and should be turned on at your own risk!
|
||||
-- Without --luadebug, you still can see the effect the item will have on your Hearts, and what stats it might modify
|
||||
-- Default = true
|
||||
["DisplayGlitchedItemInfo"] = true,
|
||||
|
||||
--------Sacrifice Room---------
|
||||
|
||||
-- Toggle display of the next Sacrifice Room payout description
|
||||
@@ -366,6 +374,7 @@ EID.DefaultConfig = {
|
||||
["DisplayPillInfoOptions?"] = true,
|
||||
["DisplayObstructedPillInfo"] = false,
|
||||
["ShowUnidentifiedPillDescriptions"] = false,
|
||||
["DisplayGlitchedItemInfo"] = true,
|
||||
["DisplaySacrificeInfo"] = true,
|
||||
["DisplayDiceInfo"] = true,
|
||||
["DisplayBagOfCrafting"] = "always",
|
||||
|
||||
+1
-1
@@ -227,7 +227,7 @@ EID.InlineIcons = {
|
||||
["Quality2"] = {"Quality", 2, 10, 10, 0, 0},
|
||||
["Quality3"] = {"Quality", 3, 10, 10, 0, 0},
|
||||
["Quality4"] = {"Quality", 4, 10, 10, 0, 0},
|
||||
-- Controller Button Icons (XBox based)
|
||||
-- Controller Button Icons dynamically return either Controller or Keyboard key sprites
|
||||
["ButtonY"] = {"XboxOne", 0, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonA"] = {"XboxOne", 1, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonB"] = {"XboxOne", 2, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
|
||||
@@ -262,20 +262,6 @@ local game = Game()
|
||||
EID:addDescriptionModifier("Golden Trinket", GoldenTrinketCondition, GoldenTrinketCallback)
|
||||
|
||||
|
||||
|
||||
-- Handle ItemID
|
||||
local function ItemIDCondition(descObj)
|
||||
return EID.Config["ShowObjectID"] and descObj.ObjType > 0
|
||||
end
|
||||
|
||||
local function ItemIDCallback(descObj)
|
||||
descObj.Name = descObj.Name.."{{ColorGray}} "..descObj.ObjType.."."..descObj.ObjVariant.."."..descObj.ObjSubType
|
||||
return descObj
|
||||
end
|
||||
EID:addDescriptionModifier("ItemID", ItemIDCondition, ItemIDCallback)
|
||||
|
||||
|
||||
|
||||
-- Handle Blank Card description addition
|
||||
local blankCardHidden = {[32]=true,[33]=true,[34]=true,[35]=true,[36]=true,[37]=true,[38]=true,[39]=true,[40]=true,[41]=true,[49]=true,[50]=true,[55]=true,[78]=true}
|
||||
local function BlankCardCondition(descObj)
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
--[[
|
||||
|
||||
This file is only loaded when the game is launched with the "--luadebug" launch option.
|
||||
This allows mods to have access to your computer's files, which is necessary to read glitched item info that's printed to the game's log file.
|
||||
|
||||
Having --luadebug on would allow malicious mods to delete your files, execute command prompt commands, and probably much more.
|
||||
USE AT YOUR OWN RISK.
|
||||
|
||||
]]
|
||||
|
||||
local game = Game()
|
||||
|
||||
-- glitched items start at 4294967295
|
||||
local maxNumber = 4294967296
|
||||
local spawnedItems = 0
|
||||
local lastEffectTrigger = "chain"
|
||||
local descOne = ""
|
||||
|
||||
local logLocation = os.getenv("SYSTEMDRIVE") .. "/Users/" .. os.getenv("USERNAME") .. "/Documents/My Games/Binding of Isaac Repentance/log.txt"
|
||||
local logFound = false
|
||||
local logCursor = 0
|
||||
|
||||
local function entityToName(e, plural)
|
||||
local localizedNames = EID:getDescriptionEntry("GlitchedItemText")
|
||||
-- -1 is often used as an "any of this type", even if there's only one of that type, so converting it to 0 can help find names
|
||||
local eWithZero = string.gsub(e, "-1", "0")
|
||||
plural = plural or false
|
||||
local name = localizedNames[e] or EID.XMLEntityNames[e] or localizedNames[eWithZero] or EID.XMLEntityNames[eWithZero] or e
|
||||
|
||||
--print out entities with no name yet
|
||||
if name == e then print("No name found for " .. e .. " (could be modded)")
|
||||
elseif plural then name = name .. localizedNames["pluralize"] end
|
||||
|
||||
return name
|
||||
end
|
||||
|
||||
local function parseEffectLine(raw)
|
||||
local words = {}
|
||||
for w in string.gmatch(raw,"%S+") do table.insert(words, w) end
|
||||
|
||||
local triggerReplacements = {}
|
||||
local replacements = {}
|
||||
local printEffect = true
|
||||
|
||||
-- words[1] = "[INFO]", words[2] = "-"
|
||||
local effectTrigger = words[3]
|
||||
if (string.find(effectTrigger, "entity_spawned")) then
|
||||
effectTrigger = "entity_spawned"
|
||||
triggerReplacements[1] = entityToName(string.sub(words[3], 16, -2))
|
||||
end
|
||||
-- words[4] = "->"
|
||||
local effectType = words[5]
|
||||
local fullEffect = ""
|
||||
for i=5,#words do fullEffect = fullEffect .. words[i] .. " " end
|
||||
|
||||
if effectType == "add_temporary_effect" or effectType == "use_active_item" then
|
||||
-- remainder of line = collectible name that's granted for the room
|
||||
local name = ""
|
||||
for i=6,#words do
|
||||
name = name .. words[i]
|
||||
if (i ~= #words) then name = name .. " " end
|
||||
end
|
||||
|
||||
replacements[1] = "{{Collectible" .. Isaac.GetItemIdByName(name) .. "}}" .. name
|
||||
elseif effectType == "convert_entities" then
|
||||
replacements[1] = entityToName(words[6], true)
|
||||
replacements[2] = entityToName(words[8])
|
||||
elseif effectType == "spawn_entity" then
|
||||
replacements[1] = entityToName(words[6])
|
||||
elseif effectType == "fart" then
|
||||
replacements[1] = words[6]
|
||||
elseif effectType == "area_damage" then
|
||||
replacements[1] = words[6]
|
||||
-- display area_damage 0's because they still need to be done to chain to the next thing
|
||||
--if words[6] == "0" then printEffect = false end
|
||||
end
|
||||
|
||||
local localizedNames = EID:getDescriptionEntry("GlitchedItemText")
|
||||
local eidString = ""
|
||||
if effectTrigger ~= lastEffectTrigger then eidString = eidString .. (localizedNames[effectTrigger] or (effectTrigger .. "#")) end
|
||||
if printEffect then eidString = eidString .. (localizedNames[effectType] or fullEffect) .. "#" end
|
||||
for k,v in ipairs(triggerReplacements) do eidString = string.gsub(eidString, "{T" .. k .. "}", v) end
|
||||
for k,v in ipairs(replacements) do eidString = string.gsub(eidString, "{" .. k .. "}", v) end
|
||||
|
||||
if effectTrigger ~= "chain" then lastEffectTrigger = effectTrigger end
|
||||
return eidString
|
||||
end
|
||||
|
||||
local function CheckLogForItems(_)
|
||||
if not EID.Config["DisplayGlitchedItemInfo"] or not logFound or game:GetFrameCount() % 5 ~= 0 or not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) then return end
|
||||
|
||||
local numEffects = 0
|
||||
local itemScore = 0
|
||||
local eidDesc = ""
|
||||
|
||||
local theLog = io.open(logLocation, "r")
|
||||
theLog:seek("set", logCursor)
|
||||
|
||||
local line = theLog:read()
|
||||
while line ~= nil do
|
||||
if string.find(line, "initialized with") then
|
||||
local count = 0
|
||||
spawnedItems = spawnedItems + 1
|
||||
lastEffectTrigger = "chain"
|
||||
eidDesc = ""
|
||||
-- find the number of effects to watch for
|
||||
for s in string.gmatch(line, "%d*%.?%d+") do
|
||||
numEffects = tonumber(s)
|
||||
break
|
||||
end
|
||||
elseif numEffects > 0 then
|
||||
numEffects = numEffects - 1
|
||||
eidDesc = eidDesc .. parseEffectLine(line)
|
||||
if numEffects == 0 then
|
||||
-- Glowing Hour Glass type effects seem to cause the game to reload all items, check if our desc is equal to the first one
|
||||
if (descOne == eidDesc) then spawnedItems = 1 end
|
||||
|
||||
eidDesc = EID:CheckGlitchedItemConfig(maxNumber - spawnedItems) .. eidDesc
|
||||
EID:addCollectible(maxNumber - spawnedItems, eidDesc)
|
||||
if spawnedItems == 1 then descOne = eidDesc end
|
||||
end
|
||||
elseif string.find(line, "Game ended;") then
|
||||
spawnedItems = 0
|
||||
lastEffectTrigger = "chain"
|
||||
eidDesc = ""
|
||||
end
|
||||
|
||||
line = theLog:read()
|
||||
end
|
||||
|
||||
logCursor = theLog:seek()
|
||||
theLog:close()
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_POST_UPDATE, CheckLogForItems)
|
||||
|
||||
local function GameStartTMTRAINER(_,isSave)
|
||||
local theLog = io.open(logLocation, "r")
|
||||
if (theLog == nil) then
|
||||
print("[EID] Could not find the log file at " .. logLocation .. "; glitched item descriptions won't work!")
|
||||
Isaac.DebugString("[EID] Could not find the log file at " .. logLocation .. "; glitched item descriptions won't work!")
|
||||
logFound = false
|
||||
return
|
||||
else
|
||||
logFound = true
|
||||
end
|
||||
|
||||
-- luckily, when the game reloads, it also reloads all glitched items, so resuming works perfectly as long as we start at the beginning
|
||||
spawnedItems = 0
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, GameStartTMTRAINER)
|
||||
|
||||
local function GameEndTMTRAINER()
|
||||
-- Our cursor spot in the log gets wiped if mods are reloaded; can't think of a better way than this
|
||||
Isaac.DebugString("[EID] Game ended; ignore previous glitched items in the log!")
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, GameEndTMTRAINER)
|
||||
@@ -49,3 +49,7 @@ EID.XMLItemIsInPools = {[1] = {0, 16, 23}, [2] = {0, 16}, [3] = {0, 16, 23}, [4]
|
||||
EID.cardMetadata = {[0] = {mimiccharge=0}, [1] = {mimiccharge=2}, [10] = {mimiccharge=2}, [11] = {mimiccharge=6}, [12] = {mimiccharge=3}, [13] = {mimiccharge=4}, [14] = {mimiccharge=3}, [15] = {mimiccharge=6}, [16] = {mimiccharge=3}, [17] = {mimiccharge=3}, [18] = {mimiccharge=2}, [19] = {mimiccharge=2}, [2] = {mimiccharge=2}, [20] = {mimiccharge=12}, [21] = {mimiccharge=6}, [22] = {mimiccharge=3}, [23] = {mimiccharge=12}, [24] = {mimiccharge=12}, [25] = {mimiccharge=12}, [26] = {mimiccharge=12}, [27] = {mimiccharge=6}, [28] = {mimiccharge=6}, [29] = {mimiccharge=6}, [3] = {mimiccharge=2}, [30] = {mimiccharge=6}, [31] = {mimiccharge=2}, [32] = {mimiccharge=2}, [33] = {mimiccharge=12}, [34] = {mimiccharge=4}, [35] = {mimiccharge=6}, [36] = {mimiccharge=2}, [37] = {mimiccharge=4}, [38] = {mimiccharge=2}, [39] = {mimiccharge=4}, [4] = {mimiccharge=3}, [40] = {mimiccharge=3}, [41] = {mimiccharge=4}, [42] = {mimiccharge=6}, [43] = {mimiccharge=6}, [44] = {mimiccharge=1}, [45] = {mimiccharge=6}, [46] = {mimiccharge=1}, [47] = {mimiccharge=2}, [48] = {mimiccharge=1}, [49] = {mimiccharge=4}, [5] = {mimiccharge=4}, [50] = {mimiccharge=3}, [51] = {mimiccharge=4}, [52] = {mimiccharge=3}, [53] = {mimiccharge=12}, [54] = {mimiccharge=3}, [55] = {mimiccharge=1}, [56] = {mimiccharge=12}, [57] = {mimiccharge=4}, [58] = {mimiccharge=4}, [59] = {mimiccharge=4}, [6] = {mimiccharge=12}, [60] = {mimiccharge=2}, [61] = {mimiccharge=12}, [62] = {mimiccharge=4}, [63] = {mimiccharge=2}, [64] = {mimiccharge=12}, [65] = {mimiccharge=1}, [66] = {mimiccharge=4}, [67] = {mimiccharge=3}, [68] = {mimiccharge=6}, [69] = {mimiccharge=4}, [7] = {mimiccharge=6}, [70] = {mimiccharge=6}, [71] = {mimiccharge=4}, [72] = {mimiccharge=3}, [73] = {mimiccharge=12}, [74] = {mimiccharge=2}, [75] = {mimiccharge=6}, [76] = {mimiccharge=12}, [77] = {mimiccharge=2}, [78] = {mimiccharge=4}, [79] = {mimiccharge=12}, [8] = {mimiccharge=3}, [80] = {mimiccharge=6}, [81] = {mimiccharge=4}, [82] = {mimiccharge=3}, [83] = {mimiccharge=6}, [84] = {mimiccharge=3}, [85] = {mimiccharge=3}, [86] = {mimiccharge=4}, [87] = {mimiccharge=6}, [88] = {mimiccharge=6}, [89] = {mimiccharge=1}, [9] = {mimiccharge=6}, [90] = {mimiccharge=4}, [91] = {mimiccharge=3}, [92] = {mimiccharge=12}, [93] = {mimiccharge=12}, [94] = {mimiccharge=6}, [95] = {mimiccharge=4}, [96] = {mimiccharge=6}, [97] = {mimiccharge=4}, }
|
||||
|
||||
EID.pillMetadata = {[0] = {mimiccharge=1, class="1+"}, [1] = {mimiccharge=2, class="2-"}, [10] = {mimiccharge=6, class="2+"}, [11] = {mimiccharge=4, class="3-"}, [12] = {mimiccharge=6, class="3+"}, [13] = {mimiccharge=4, class="3-"}, [14] = {mimiccharge=6, class="3+"}, [15] = {mimiccharge=4, class="3-"}, [16] = {mimiccharge=6, class="3+"}, [17] = {mimiccharge=4, class="3-"}, [18] = {mimiccharge=6, class="3+"}, [19] = {mimiccharge=1, class="1"}, [2] = {mimiccharge=12, class="2+"}, [20] = {mimiccharge=12, class="2+"}, [21] = {mimiccharge=6, class="2"}, [22] = {mimiccharge=6, class="1-"}, [23] = {mimiccharge=4, class="2+"}, [24] = {mimiccharge=2, class="1+"}, [25] = {mimiccharge=6, class="2-"}, [26] = {mimiccharge=3, class="1+"}, [27] = {mimiccharge=6, class="1-"}, [28] = {mimiccharge=2, class="1+"}, [29] = {mimiccharge=6, class="1-"}, [3] = {mimiccharge=1, class="2"}, [30] = {mimiccharge=2, class="0"}, [31] = {mimiccharge=6, class="1-"}, [32] = {mimiccharge=6, class="1"}, [33] = {mimiccharge=6, class="1"}, [34] = {mimiccharge=2, class="1+"}, [35] = {mimiccharge=2, class="1+"}, [36] = {mimiccharge=3, class="1+"}, [37] = {mimiccharge=6, class="1-"}, [38] = {mimiccharge=1, class="1+"}, [39] = {mimiccharge=1, class="0-"}, [4] = {mimiccharge=3, class="1"}, [40] = {mimiccharge=1, class="0+"}, [41] = {mimiccharge=3, class="1"}, [42] = {mimiccharge=6, class="1"}, [43] = {mimiccharge=4, class="2+"}, [44] = {mimiccharge=1, class="0"}, [45] = {mimiccharge=1, class="1+"}, [46] = {mimiccharge=6, class="2+"}, [47] = {mimiccharge=4, class="3-"}, [48] = {mimiccharge=6, class="3+"}, [49] = {mimiccharge=3, class="3"}, [5] = {mimiccharge=12, class="2+"}, [6] = {mimiccharge=4, class="3-"}, [7] = {mimiccharge=6, class="3+"}, [8] = {mimiccharge=1, class="0"}, [9] = {mimiccharge=1, class="0"}, }
|
||||
|
||||
--The name of each entity, for use in glitched item descriptions
|
||||
EID.XMLEntityNames = {["1.0"] = "Player", ["1.1"] = "Coplayer", ["2.0"] = "Tear", ["2.1"] = "Blood Tear", ["2.2"] = "Tooth Tear", ["2.3"] = "Metallic Tear", ["2.4"] = "Bobs Head Tear", ["2.5"] = "Fire Tear", ["2.6"] = "Dark Matter Tear", ["2.7"] = "Mysterious Tear", ["2.8"] = "Scythe Tear", ["2.9"] = "Chaos Card Tear", ["2.10"] = "Chaos Card Tear", ["2.11"] = "Tear", ["2.12"] = "Blood Tear", ["2.13"] = "Nail Tear", ["2.14"] = "Pupula Tear", ["2.15"] = "Pupula Blood Tear", ["2.16"] = "God's Flesh Tear", ["2.17"] = "God's Flesh Blood Tear", ["2.18"] = "Diamond Tear", ["2.19"] = "Explosivo Tear", ["2.20"] = "Coin Tear", ["2.21"] = "Multidimensional Tear", ["2.22"] = "Stone Tear", ["2.23"] = "Nail Blood Tear", ["2.24"] = "Glaucoma Tear", ["2.25"] = "Glaucoma Blood Tear", ["2.26"] = "Booger Tear", ["2.27"] = "Egg Tear", ["2.28"] = "Razor Tear", ["2.29"] = "Bone Tear", ["2.30"] = "Black Tooth Tear", ["2.31"] = "Needle Tear", ["2.32"] = "Belial Tear", ["2.33"] = "Pop Tear", ["2.34"] = "Pop Blood Tear", ["2.35"] = "Balloon Tear", ["2.36"] = "Hungry Tear", ["2.37"] = "Brimstone Balloon Tear", ["2.38"] = "Bomb Balloon Tear", ["3.1"] = "Brother Bobby", ["3.2"] = "Demon Baby", ["3.3"] = "Little Chubby", ["3.4"] = "Little Gish", ["3.5"] = "Little Steve", ["3.6"] = "Robo-Baby", ["3.7"] = "Sister Maggy", ["3.8"] = "Abel", ["3.9"] = "Ghost Baby", ["3.10"] = "Harlequin Baby", ["3.11"] = "Rainbow Baby", ["3.12"] = "Isaacs Head", ["3.13"] = "Blue Baby Soul", ["3.14"] = "Dead Bird", ["3.15"] = "Eves Bird Foot", ["3.16"] = "Daddys Foot", ["3.17"] = "Peepers Eye", ["3.20"] = "Bomb Bag", ["3.21"] = "Sack of Pennies", ["3.22"] = "Little C.H.A.D.", ["3.23"] = "The Relic", ["3.24"] = "Bum Fiend", ["3.25"] = "Holy Water", ["3.26"] = "Key Piece 1", ["3.27"] = "Key Piece 2", ["3.28"] = "Full Key", ["3.30"] = "Forever Alone", ["3.31"] = "Distant Admiration", ["3.32"] = "Guardian Angel", ["3.33"] = "Fly Orbital", ["3.35"] = "Sacrificial Dagger", ["3.40"] = "Dead Cat", ["3.41"] = "1UP", ["3.42"] = "Guppys Hair Ball", ["3.43"] = "Attack Fly", ["3.44"] = "Cube of Meat L1", ["3.45"] = "Cube of Meat L2", ["3.46"] = "Cube of Meat L3", ["3.47"] = "Cube of Meat L4", ["3.48"] = "Isaacs Body", ["3.50"] = "Smart Fly", ["3.51"] = "Dry Baby", ["3.52"] = "Juicy Sack", ["3.53"] = "Robo-Baby 2.0", ["3.54"] = "Rotten Baby", ["3.55"] = "Headless Baby", ["3.56"] = "Leech", ["3.57"] = "Mystery Sack", ["3.58"] = "BBF", ["3.59"] = "Bob's Brain", ["3.60"] = "Best Bud", ["3.61"] = "Lil' Brimstone", ["3.62"] = "Isaac's Heart", ["3.63"] = "Lil' Haunt", ["3.64"] = "Dark Bum", ["3.65"] = "Big Fan", ["3.66"] = "Sissy Longlegs", ["3.67"] = "Punching Bag", ["3.68"] = "Guillotine", ["3.69"] = "Ball of Bandages L1", ["3.70"] = "Ball of Bandages L2", ["3.71"] = "Ball of Bandages L3", ["3.72"] = "Ball of Bandages L4", ["3.73"] = "Blue Spider", ["3.74"] = "Mongo Baby", ["3.75"] = "Samson's Chains", ["3.78"] = "Scissors", ["3.79"] = "Gemini Familiar", ["3.76"] = "Cain's Eye", ["3.77"] = "???'s Only Friend", ["3.80"] = "Incubus", ["3.81"] = "Fate's Reward", ["3.82"] = "Lil Chest", ["3.83"] = "Sworn Protector", ["3.84"] = "Friend Zone", ["3.85"] = "Lost Fly", ["3.86"] = "Charged Baby", ["3.87"] = "Lil Gurdy", ["3.88"] = "Bumbo", ["3.89"] = "Censer", ["3.90"] = "Key Bum", ["3.91"] = "Rune Bag", ["3.92"] = "Seraphim", ["3.93"] = "GB Bug", ["3.94"] = "Spider Mod", ["3.95"] = "Farting Baby", ["3.96"] = "Succubus", ["3.97"] = "Lil Loki", ["3.98"] = "Obsessed Fan", ["3.99"] = "Papa Fly", ["3.100"] = "Milk!", ["3.101"] = "Multidimensional Baby", ["3.102"] = "Super Bum", ["3.103"] = "Tonsil", ["3.104"] = "Big Chubby", ["3.105"] = "Depression", ["3.106"] = "Shade", ["3.107"] = "Hushy", ["3.108"] = "Lil Monstro", ["3.109"] = "King Baby", ["3.110"] = "Finger!", ["3.111"] = "YO LISTEN!", ["3.112"] = "Acid Baby", ["3.113"] = "Spider Baby", ["3.114"] = "Sack of Sacks", ["3.115"] = "Brown Nugget", ["3.116"] = "Bloodshot Eye", ["3.117"] = "Mom's Razor", ["3.118"] = "Angry Fly", ["3.119"] = "Box Buddy", ["3.120"] = "Sprinkler", ["3.121"] = "Leprocy", ["3.122"] = "Lil Harbingers", ["3.123"] = "Angelic Prism", ["3.124"] = "Mystery Egg", ["3.125"] = "Lil Spewer", ["3.126"] = "Slipped Rib", ["3.127"] = "Pointy Rib", ["3.128"] = "Bone Orbital", ["3.129"] = "Hallowed Ground", ["3.130"] = "Jaw Bone", ["3.900"] = "Forgotten Body", ["4.0"] = "Bomb", ["4.1"] = "Big Bomb", ["4.2"] = "Decoy", ["4.3"] = "Troll Bomb", ["4.4"] = "Megatroll Bomb", ["4.5"] = "Poison Bomb", ["4.6"] = "Big Poison Bomb", ["4.7"] = "Sad Bomb", ["4.8"] = "Hot Bomb", ["4.9"] = "Butt Bomb", ["4.10"] = "Mr. Mega Bomb", ["4.11"] = "Bobby Bomb", ["4.12"] = "Glitter Bomb", ["5.10.1"] = "Heart", ["5.10.2"] = "Heart (half)", ["5.10.3"] = "Heart (soul)", ["5.10.4"] = "Heart (eternal)", ["5.10.5"] = "Heart (double)", ["5.10.6"] = "Black Heart", ["5.10.7"] = "Gold Heart", ["5.10.8"] = "Heart (half soul)", ["5.10.9"] = "Scared Heart", ["5.10.10"] = "Blended Heart", ["5.10.11"] = "Bone Heart", ["5.20.1"] = "Penny", ["5.20.2"] = "Nickel", ["5.Line truncated
|
||||
|
||||
@@ -94,20 +94,21 @@ local nullVector = Vector(0,0)
|
||||
local modfolder ='external item descriptions_836319872' --release mod folder name
|
||||
|
||||
local function GetCurrentModPath()
|
||||
if debug then
|
||||
return string.sub(debug.getinfo(GetCurrentModPath).source,2) .. "/../"
|
||||
end
|
||||
--use some very hacky trickery to get the path to this mod
|
||||
local _, err = pcall(require, "")
|
||||
local _, basePathStart = string.find(err, "no file '", 1)
|
||||
local _, modPathStart = string.find(err, "no file '", basePathStart)
|
||||
local modPathEnd, _ = string.find(err, ".lua'", modPathStart)
|
||||
local modPath = string.sub(err, modPathStart+1, modPathEnd-1)
|
||||
modPath = string.gsub(modPath, "\\", "/")
|
||||
if debug then
|
||||
if REPENTANCE then require("eid_tmtrainer") end
|
||||
return string.sub(debug.getinfo(GetCurrentModPath).source,2) .. "/../"
|
||||
end
|
||||
--use some very hacky trickery to get the path to this mod
|
||||
local _, err = pcall(require, "")
|
||||
local _, basePathStart = string.find(err, "no file '", 1)
|
||||
local _, modPathStart = string.find(err, "no file '", basePathStart)
|
||||
local modPathEnd, _ = string.find(err, ".lua'", modPathStart)
|
||||
local modPath = string.sub(err, modPathStart+1, modPathEnd-1)
|
||||
modPath = string.gsub(modPath, "\\", "/")
|
||||
modPath = string.gsub(modPath, "//", "/")
|
||||
modPath = string.gsub(modPath, ":/", ":\\")
|
||||
|
||||
return modPath
|
||||
|
||||
return modPath
|
||||
end
|
||||
EID.modPath = GetCurrentModPath()
|
||||
|
||||
@@ -353,10 +354,15 @@ function EID:printDescription(desc)
|
||||
EID.Config["Language"] = curLanguage
|
||||
if EID.Config["TranslateItemName"] == 1 then
|
||||
curName = englishName
|
||||
elseif EID.Config["TranslateItemName"] == 3 and curName ~= englishName then
|
||||
elseif EID.Config["TranslateItemName"] == 3 and curName ~= englishName and not EID.isDisplayingPermanent then
|
||||
curName = curName.." ("..englishName..")"
|
||||
end
|
||||
end
|
||||
-- Display Entity ID
|
||||
if EID.Config["ShowObjectID"] and desc.ObjType > 0 then
|
||||
curName = curName.." {{ColorGray}}"..desc.ObjType.."."..desc.ObjVariant.."."..desc.ObjSubType
|
||||
end
|
||||
-- Display Quality
|
||||
if REPENTANCE and EID.Config["ShowQuality"] and desc.ObjVariant == PickupVariant.PICKUP_COLLECTIBLE then
|
||||
local quality = tonumber(EID.itemConfig:GetCollectible(tonumber(desc.ObjSubType)).Quality)
|
||||
curName = curName.." - {{Quality"..quality.."}}"
|
||||
@@ -862,6 +868,23 @@ local function onRender(t)
|
||||
return
|
||||
end
|
||||
|
||||
--Handle Glitched Items
|
||||
if closest.Type == 5 and closest.Variant == 100 and closest.SubType > 4294960000 then
|
||||
local glitchedObj = EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType)
|
||||
local glitchedDesc = EID:getXMLDescription(closest.Type, closest.Variant, closest.SubType)
|
||||
|
||||
-- force the default glitchy description if option is off
|
||||
if not EID.Config["DisplayGlitchedItemInfo"] then
|
||||
glitchedObj.Description = glitchedDesc
|
||||
-- grab the Item Config info if eid_tmtrainer.lua hasn't taken care of it
|
||||
elseif not debug then
|
||||
glitchedObj.Description = EID:CheckGlitchedItemConfig(closest.SubType) .. glitchedDesc
|
||||
end
|
||||
|
||||
EID:printDescription(glitchedObj)
|
||||
return
|
||||
end
|
||||
|
||||
if closest.Type == 1000 and closest.Variant == 76 then
|
||||
EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType+1, closest))
|
||||
return
|
||||
|
||||
@@ -604,6 +604,28 @@ if MCMLoaded then
|
||||
end
|
||||
}
|
||||
)
|
||||
------------Glitched Items--------------
|
||||
MCM.AddSetting(
|
||||
"EID",
|
||||
"Display",
|
||||
{
|
||||
Type = ModConfigMenu.OptionType.BOOLEAN,
|
||||
CurrentSetting = function()
|
||||
return EID.Config["DisplayGlitchedItemInfo"]
|
||||
end,
|
||||
Display = function()
|
||||
local onOff = "False"
|
||||
if EID.Config["DisplayGlitchedItemInfo"] then
|
||||
onOff = "True"
|
||||
end
|
||||
return "Glitched Item Infos: " .. onOff
|
||||
end,
|
||||
OnChange = function(currentBool)
|
||||
EID.Config["DisplayGlitchedItemInfo"] = currentBool
|
||||
end,
|
||||
Info = {"Note: The --luadebug launch option is required for more detailed glitched item descriptions"}
|
||||
}
|
||||
)
|
||||
--------Sacrifice Room---------
|
||||
MCM.AddSetting(
|
||||
"EID",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
@@ -4,17 +4,19 @@
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
filePath = "D:\\Programme\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\resources-dlc3\\"
|
||||
# filePath = "D:\\Program Files\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\resources-dlc3\\"
|
||||
|
||||
# take second element for sort
|
||||
def sortByID(elem):
|
||||
return elem["id"]
|
||||
recipies = []
|
||||
recipes = []
|
||||
itemQuality = []
|
||||
itempools = {}
|
||||
itemIDToPool = {}
|
||||
maxItemID = 0
|
||||
cardMetadatas = []
|
||||
pillMetadatas = []
|
||||
entityNames = []
|
||||
|
||||
recipeIngredients = {}
|
||||
#Poop, Penny
|
||||
@@ -53,7 +55,7 @@ for recipe in recipesXML.findall('recipe'):
|
||||
|
||||
convertedInput.sort()
|
||||
convertedInput = str(convertedInput).replace(" ","").replace("[","").replace("]","")
|
||||
recipies.append({"input": convertedInput, "output": recipe.get('output')})
|
||||
recipes.append({"input": convertedInput, "output": recipe.get('output')})
|
||||
|
||||
# Read items_metadata.xml
|
||||
items_metadataXML = ET.parse(filePath+'items_metadata.xml').getroot()
|
||||
@@ -90,6 +92,19 @@ for pilleffect in pocketitemsXML.findall('pilleffect'):
|
||||
pillMetadatas.append({ "id": pilleffect.get('id'), "mimiccharge": pilleffect.get('mimiccharge', 0), "class":pilleffect.get('class')})
|
||||
pillMetadatas.sort(key=sortByID)
|
||||
|
||||
# Read entities2.xml
|
||||
entitiesXML = ET.parse(filePath+'entities2.xml').getroot()
|
||||
|
||||
for entity in entitiesXML.findall('entity'):
|
||||
theID = entity.get('id')
|
||||
theName = entity.get('name')
|
||||
if entity.get('variant'):
|
||||
theID += "." + entity.get('variant')
|
||||
if entity.get('subtype') and entity.get('subtype') != "0":
|
||||
theID += "." + entity.get('subtype')
|
||||
if theName[0] == '#':
|
||||
theName = theName[1:].replace('_',' ').title()
|
||||
entityNames.append({ "id": theID, "name": theName })
|
||||
|
||||
#Write xml file
|
||||
|
||||
@@ -104,7 +119,7 @@ newfile.write("EID.XMLMaxItemID = "+str(maxItemID) + "\n")
|
||||
|
||||
newfile.write("--The fixed recipes, for use in Bag of Crafting\n")
|
||||
newfile.write("EID.XMLRecipes = {")
|
||||
for recipe in recipies:
|
||||
for recipe in recipes:
|
||||
newfile.write("[\""+recipe["input"]+"\"] = "+str(recipe["output"])+", ")
|
||||
newfile.write("}\n\n")
|
||||
|
||||
@@ -137,9 +152,15 @@ for card in cardMetadatas:
|
||||
newfile.write("}\n\n")
|
||||
|
||||
newfile.write("EID.pillMetadata = {")
|
||||
|
||||
|
||||
for pill in pillMetadatas:
|
||||
newfile.write("["+pill['id']+"] = {mimiccharge="+str(pill['mimiccharge'])+", class=\""+str(pill['class'])+"\"}, ")
|
||||
|
||||
newfile.write("}\n")
|
||||
newfile.write("}\n\n")
|
||||
|
||||
|
||||
newfile.write("--The name of each entity, for use in glitched item descriptions\n")
|
||||
newfile.write("EID.XMLEntityNames = {")
|
||||
for entity in entityNames:
|
||||
newfile.write("[\""+entity['id']+"\"] = \""+entity['name']+"\", ")
|
||||
newfile.write("}\n\n")
|
||||
|
||||
Reference in new issue
Block a user