Compare commits

...
13 Commits
7 changed files with 115 additions and 50 deletions

No files matched your search

+3 -3
View File
@@ -323,7 +323,7 @@ local repCollectibles={
[656] = {"656", "Damocles", "<Item not obtainable>"}, -- Damocles
[657] = {"657", "Vasculitis", "Enemies explode into tears upon death, which inherit the effects of Isaac's tears"}, -- Vasculitis
[658] = {"658", "Giant Cell", "Spawn micro-Isaacs when taking damage#They chase and shoot at nearby enemies"}, -- Giant Cell
[659] = {"659", "Tropicamide", "↑ {{Range}} +1.5 Range up#↑{{Tearsize}} Tear Size up"}, -- Tropicamide
[659] = {"659", "Tropicamide", "↑ {{Range}} +1.5 Range up#↑ {{Tearsize}} Tear Size up"}, -- Tropicamide
[660] = {"660", "Card Reading", "Spawns two portals at the start of each floor#Portals disappear when leaving the room#{{ColorRed}}Red: {{CR}}{{BossRoom}} Boss Room#{{ColorYellow}}Yellow: {{CR}}{{TreasureRoom}} Item Room#{{ColorBlue}}Blue: {{CR}}{{SecretRoom}} Secret Room"}, -- Card Reading
[661] = {"661", "Quints", "Spawns a stationary shooting familiar at the location where an enemy died#Up to 5 familiars"}, -- Quints
[662] = {"662", "Pacifist (Cut item)", "<Item does not exist>"}, -- Pacifist (Cut item)
@@ -358,7 +358,7 @@ local repCollectibles={
[691] = {"691", "Sacred Orb", "Prevents Quality {{Quality0}}/{{Quality1}} items from spawning#33% chance to reroll items with Quality {{Quality2}} to Quality {{Quality3}} or {{Quality4}}"}, -- Sacred Orb
[692] = {"692", "Sanguine Bond", "Spawns a set of spikes in the {{DevilRoom}}Devil Room#Taking damage from the spikes can grant a reward:#35%: Nothing#33%: ↑ {{Damage}} +0.5 Damage up#15%: {{Coin}} 6 pennies#10%: {{BlackHeart}} 2 Black Hearts#5%: {{DevilRoom}} Random Devil item#2%: Leviathan transformation"}, -- Sanguine Bond //PERCENTAGES NOT CONFIRMED, updated in patch, taken from Wiki
[693] = {"693", "The Swarm", "Grants 8 orbital flies which turn into Blue Flies after they block a shot#Spawns a new fly every room cleared"}, -- The Swarm
[694] = {"694", "Heartbreak", "{{BrokenHeart}}Grants 3 broken hearts#↑ {{Damage}} +0.25 Damage for every broken heart#Every fatal hit will add 2 more broken hearts#You die at 12 broken hearts"}, -- Heartbreak
[694] = {"694", "Heartbreak", "{{BrokenHeart}} Grants 3 broken hearts#↑ {{Damage}} +0.25 Damage for every broken heart#Every fatal hit will add 2 more broken hearts#You die at 12 broken hearts"}, -- Heartbreak
[695] = {"695", "Bloody Gust", "When taking damage, gain speed and tears up for the current floor#Up to +1.02 Speed and +3 Fire Rate possible"}, -- Bloody Gust
[696] = {"696", "Salvation", "Grants halo that spawns beams of light on enemies inside it#The halo grows larger the more damage you've taken this floor"}, -- Salvation
[697] = {"697", "Vanishing Twin", "Familiar that becomes a clone of the boss when entering the boss room#Defeating it drops an extra item#Clone is slower and has 75% of the original boss health"}, -- Vanishing Twin
@@ -394,7 +394,7 @@ local repCollectibles={
[727] = {"727", "Ghost Bombs", "{{Bomb}} +5 bombs#Bombs spawn ghosts that deal contact damage and explode after 10 seconds"}, -- Ghost Bombs
[728] = {"728", "Gello", "Spawns a demon familiar that's attached to Isaac#Mimics Isaac's tears, stats and effects"}, -- Gello
[729] = {"729", "Decap Attack", "Throws Isaac's head, dealing contact damage and shooting tears from where it lands#Reactivating the item or stepping on the head reattaches it"}, -- Decap Attack
[730] = {"730", "Glass Eye", "↑{{Damage}} +0.75 Damage up#↑ {{Luck}} +1 Luck up"}, -- Glass Eye
[730] = {"730", "Glass Eye", "↑ {{Damage}} +0.75 Damage up#↑ {{Luck}} +1 Luck up"}, -- Glass Eye
[731] = {"731", "Stye", "!!! Applies only for the right eye#↑ {{Damage}} +28% Damage up#↑ {{Range}} +7 Range up#↓ {{Shotspeed}} -0.3 Shot Speed down"}, -- Stye
[732] = {"732", "Mom's Ring", "↑ {{Damage}} +1 Damage up#{{Rune}} Spawns a random rune or soul stone on pickup"}, -- Mom's Ring
+81 -4
View File
@@ -43,6 +43,36 @@ function EID:addTrinket(id, description, itemName, language)
EID.descriptions[language].custom["5.350." .. id] = {id, itemName, description, EID._currentMod}
end
-- Adds information about appending text and multiplying numbers in a modded trinket's Golden/Mom's Box description. All three variables are optional, set to ""/0 or nil to not include them
-- appendText can be 1 string, or a table of 2 strings; one for doubling and one for tripling
-- numbersToMultiply can be 1 number, or a table of numbers
-- maxMultiplier is what tripling (Golden+Mom's Box) should multiply the numbers by (normally 3)
-- (If it's less than 2, it also applies to doubling)
-- Example: My modded trinket gives +0.5 range, and when tripled, adds homing instead of tripling the range boost
-- EID:addGoldenTrinketMetadata(Isaac.GetTrinketIdByName("Cool Trinket"), {"", "Homing tears"}, 0.5, 2)
function EID:addGoldenTrinketMetadata(id, appendText, numbersToMultiply, maxMultiplier, language)
maxMultiplier = maxMultiplier or 3
language = language or "en_us"
if appendText == "" then appendText = nil
elseif type(appendText) == "string" then appendText = {appendText} end
if numbersToMultiply == 0 then numbersToMultiply = nil
elseif type(numbersToMultiply) == "number" then numbersToMultiply = {numbersToMultiply} end
EID.GoldenTrinketData[id] = {t = numbersToMultiply, mult = maxMultiplier, append = appendText and true}
if appendText then
EID.descriptions[language].goldenTrinketEffects[id] = { appendText[1], appendText[1], appendText[2] or appendText[1] }
end
end
-- Add a fully custom data table to the table of Golden Trinket effects
-- Check the comments above EID.GoldenTrinketData in eid_data.lua for some info about what is possible
-- You may also want to add text entries into EID.descriptions[languageCode].goldenTrinketEffects
function EID:addGoldenTrinketTable(id, dataTable)
EID.GoldenTrinketData[id] = dataTable
end
-- Adds a description for a card/rune. Optional parameters: itemName, language
function EID:addCard(id, description, itemName, language)
itemName = itemName or nil
@@ -320,6 +350,8 @@ function EID:getDescriptionObj(Type, Variant, SubType, entity, checkModifiers)
description.Transformation = EID:getTransformation(Type, Variant, SubType)
description.ModName = tableEntry and tableEntry[4]
description.Quality = EID:getObjectQuality(description)
description.Icon = EID:getObjectIcon(description)
if checkModifiers ~= false then
for _,modifier in ipairs(EID.DescModifiers) do
@@ -591,12 +623,12 @@ function EID:createItemIconObject(str)
local cardID,numReplace3 = string.gsub(str, "Card", "")
if numReplace3 > 0 and cardID ~= "" and tonumber(cardID) ~= nil then
if tonumber(cardID) > maxCardID then return EID.InlineIcons[str] or EID.InlineIcons["Blank"] end
return {"Cards",tonumber(cardID)-1,8,8,0,1,EID.CardPillSprite}
return {"Cards", tonumber(cardID)-1, 8, 8, 0, 1, EID.CardPillSprite}
end
local pillID,numReplace4 = string.gsub(str, "Pill", "")
if numReplace4 > 0 and pillID ~= "" and tonumber(pillID) ~= nil then
if tonumber(pillID) > maxPillID then return EID.InlineIcons[str] or EID.InlineIcons["Blank"] end
return {"Pills",tonumber(pillID)-1,9,8,0,1,EID.CardPillSprite}
return {"Pills", tonumber(pillID)-1, 9, 8, 0, 1, EID.CardPillSprite}
end
if item == nil then
return nil
@@ -608,7 +640,7 @@ function EID:createItemIconObject(str)
spriteDummy:Load("gfx/eid_inline_icons.anm2", true)
spriteDummy:ReplaceSpritesheet(1, item.GfxFileName)
spriteDummy:LoadGraphics()
local newDynamicSprite = {"ItemIcon",0,11,8,-2,-2,spriteDummy}
local newDynamicSprite = {"ItemIcon", 0, 11, 8, -2, -2, spriteDummy}
dynamicSpriteCache[str] = newDynamicSprite
return newDynamicSprite
end
@@ -690,7 +722,7 @@ end
-- Returns the icon used for the bulletpoint. It will look at the first word in the given string.
-- Also returns the first word if it was rejected (so it can be removed from the line)
function EID:handleBulletpointIcon(text)
local firstWord = string.match(text, "([^%s]+)")
local firstWord = EID:removeColorMarkup(string.match(text, "([^%s]+)"))
if EID:getIcon(firstWord) ~= EID.InlineIcons["ERROR"] and string.find(firstWord, "{{.-}}")~=nil then
if not EID.Config["StatAndPickupBulletpoints"] and EID.StatPickupBulletpointBlacklist[firstWord] then
return "\007", firstWord
@@ -750,6 +782,14 @@ function EID:filterColorMarkup(text, baseKColor)
return textPartsTable
end
-- A simple function to remove color markup, to preserve bulletpoint icons after start-of-line color markup
function EID:removeColorMarkup(text)
for word in string.gmatch(text, "{{Color.-}}") do
text = string.gsub(text, word, "", 1)
end
return text
end
-- A simple function to replace all markup {{ }} with placeholder strings, to use in fitTextToWidth
function EID:replaceAllMarkupWithSpaces(text, checkBulletpoint)
if checkBulletpoint then
@@ -1528,3 +1568,40 @@ function EID:evaluateQueuedItems()
end
end
end
-- Returns the quality of the described entity
function EID:getObjectQuality(descObj)
if REPENTANCE and descObj.ObjType == 5 and descObj.ObjVariant == 100 then
return tonumber(EID.itemConfig:GetCollectible(tonumber(descObj.ObjSubType)).Quality)
end
end
-- Returns the Inline Icon definition object for a given object.
EID.ObjectIcon = {}
function EID:getObjectIcon(descObj)
-- custom object icon
if EID.ObjectIcon[descObj.ObjType.."."..descObj.ObjVariant.."."..descObj.ObjSubType] then
return EID.ObjectIcon[descObj.ObjType.."."..descObj.ObjVariant.."."..descObj.ObjSubType]
end
if descObj.ObjType == 5 then
if descObj.ObjVariant == 100 then
return EID:createItemIconObject("Collectible" .. descObj.ObjSubType)
elseif descObj.ObjVariant == 350 then
return EID:createItemIconObject("Trinket" .. descObj.ObjSubType)
elseif descObj.ObjVariant == 300 then
return EID:createItemIconObject("Card" .. descObj.ObjSubType)
elseif descObj.ObjVariant == 70 then
if descObj.ObjSubType >= 2049 then
return EID:createItemIconObject("Pill" .. (descObj.ObjSubType - 2048))
end
return EID:createItemIconObject("Pill" .. descObj.ObjSubType)
end
end
end
-- Adds an EID Icon to an Object
function EID:AddIconToObject(eType, eVariant, eSubType, iconName)
EID.ObjectIcon[eType.."."..eVariant.."."..eSubType] = EID.InlineIcons[iconName]
end
+7 -3
View File
@@ -789,6 +789,7 @@ local newResults = {}
local skipRandom = false
local isRefresh = false
local queryString = ""
local displayingRecipeList = false
local function RecipeCrunchCoroutine()
coTimer = Isaac.GetTime()
@@ -894,7 +895,7 @@ function EID:handleBagOfCraftingUpdating()
end
-- Check for Hold Tab key inputs
if Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.bagPlayer.ControllerIndex) then
if displayingRecipeList and Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.bagPlayer.ControllerIndex) then
EID.bagPlayer.ControlsCooldown = 2
if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, EID.bagPlayer.ControllerIndex) then
bagOfCraftingOffset = math.min(numResults-(numResults%EID.Config["BagOfCraftingResults"]), bagOfCraftingOffset + EID.Config["BagOfCraftingResults"])
@@ -940,9 +941,11 @@ end
-- Called when needed based on EID.Config["RefreshRate"]
function EID:handleBagOfCraftingRendering(ignoreRefreshRate)
-- Determine if we should display anything at all
if ((EID.isHidden or craftingIsHidden) and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting") or game.Challenge == Challenge.CHALLENGE_CANTRIPPED then
if not EID:RefreshThisFrame() and not ignoreRefreshRate then
return false
elseif not EID:RefreshThisFrame() and not ignoreRefreshRate then
end
displayingRecipeList = false
if ((EID.isHidden or craftingIsHidden) and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting") or game.Challenge == Challenge.CHALLENGE_CANTRIPPED then
return false
elseif EID.Config["BagOfCraftingHideInBattle"] then
if Isaac.CountBosses() > 0 or Isaac.CountEnemies() > 0 then
@@ -1070,6 +1073,7 @@ function EID:handleBagOfCraftingRendering(ignoreRefreshRate)
end
-- Recipe List display
displayingRecipeList = true
if sortNeeded then
sortAllItems()
sortNeeded = false
+1
View File
@@ -125,6 +125,7 @@ local dummySprite2 = Sprite()
dummySprite2:Load("gfx/eid_inline_icons.anm2", true)
-- add animated icon using api function (Make sure to create new Sprite Obj when using animated icons. Reuse objects when only using static icons)
EID:addIcon("TestIcon", "hearts", -1, 9, 9, -1, 0, dummySprite2)
EID:AddIconToObject(5, 100, 1, "TestIcon")
-- add icon directly
+10 -5
View File
@@ -373,23 +373,28 @@ if REPENTANCE then
end
end)
end
end
--replacing a phrase, such as "half a heart"
elseif data.findReplace then
if data.findReplace then
local textTable = EID:getDescriptionEntry("goldenTrinketEffects", trinketID)
if textTable then
descObj.Description, count = string.gsub(descObj.Description, textTable[1], "{{ColorGold}}" .. textTable[multiplier] .. "{{ColorText}}", 1)
end
end
--append some new text to the description
elseif data.append then
if data.append then
local textTable = EID:getDescriptionEntry("goldenTrinketEffects", trinketID)
if textTable then
textChoice = math.min(textChoice, #textTable) -- some items have only 1 append description
descObj.Description = descObj.Description .. "#{{ColorGold}}" .. textTable[textChoice]
count = 1
if textTable[textChoice] ~= "" then
descObj.Description = descObj.Description .. "#{{ColorGold}}" .. textTable[textChoice]
count = 1
end
end
end
--the nuclear option: replacing the entire description; 1 = Gold, 2 = Mom's Box, 3 = Both
--only replace if the chosen language has defined it
elseif data.fullReplace then
if data.fullReplace then
local textTable = EID:getDescriptionEntry("goldenTrinketEffects", trinketID, true)
if (textTable) then
textChoice = math.min(textChoice, #textTable)
+12 -34
View File
@@ -9,7 +9,7 @@ local game = Game()
require("eid_config")
EID.Config = EID.UserConfig
EID.Config.Version = "3.2" -- note: changing this will reset everyone's settings to default!
EID.ModVersion = "4.26"
EID.ModVersion = "4.27"
EID.DefaultConfig.Version = EID.Config.Version
EID.isHidden = false
EID.player = nil -- The primary Player Entity of Player 1
@@ -477,7 +477,8 @@ function EID:printDescriptions(useCached)
-- Do the description entities match, and the description texts match?
for i,newDesc in ipairs(EID.descriptionsToPrint) do
local oldDesc = EID.previousDescs[i]
if newDesc.Description ~= oldDesc.Description or (newDesc.Entity and oldDesc.Entity and GetPtrHash(newDesc.Entity) ~= GetPtrHash(oldDesc.Entity)) then
if newDesc.Description ~= oldDesc.Description or newDesc.Name ~= oldDesc.Name or
(newDesc.Entity and oldDesc.Entity and GetPtrHash(newDesc.Entity) ~= GetPtrHash(oldDesc.Entity)) then
EID:printNewDescriptions()
return
end
@@ -522,7 +523,6 @@ function EID:printDescription(desc, cachedID)
end
local renderPos = EID:getTextPosition()
--print(cachedID)
if cachedID then
local localModeDiff = renderPos - EID.CachedRenderPoses[cachedID]
-- Drawing our currently saved description
@@ -556,33 +556,11 @@ function EID:printDescription(desc, cachedID)
local textScale = Vector(EID.Scale, EID.Scale)
local offsetX = 0
EID.lineHeight = EID.Config["LineHeight"]
if EID.Config["ShowItemIcon"] then
local iconType = nil
local subType = desc.ObjSubType
if desc.ObjType == 5 then
if desc.ObjVariant == 100 then
iconType = "Collectible"
elseif desc.ObjVariant == 350 then
iconType = "Trinket"
elseif desc.ObjVariant == 300 then
iconType = "Card"
elseif desc.ObjVariant == 70 then
iconType = "Pill"
if subType >= 2049 then
subType = subType - 2048
end
end
end
if iconType ~= nil then
offsetX = offsetX + 14
EID:renderString(
"{{" .. iconType .. subType .. "}}",
renderPos + (Vector(-3, -4) * EID.Scale),
textScale,
EID:getNameColor()
)
end
if EID.Config["ShowItemIcon"] and desc.Icon then
offsetX = offsetX + 14
EID:renderInlineIcons({{desc.Icon,0}}, renderPos.X - 3 * EID.Scale, renderPos.Y - 4 * EID.Scale)
end
--Display ItemType / Charge
local itemType = -1
if desc.ObjSubType ~= nil and desc.ObjType == 5 and desc.ObjVariant == 100 then
@@ -632,9 +610,8 @@ function EID:printDescription(desc, cachedID)
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.."}}"
if EID.Config["ShowQuality"] and desc.Quality then
curName = curName.." - {{Quality"..desc.Quality.."}}"
end
-- Display the mod this item is from
if desc.ModName then
@@ -1062,8 +1039,9 @@ local function attemptPathfind(entity)
if pathsChecked[entity.InitSeed] == false and EID.GameUpdateCount - lastPathfindFrame < 10 then return false end
-- Spawn a Shopkeeper entity to attempt a pathfind to the target pickup, then remove it afterwards
pathCheckerEntity = game:Spawn(17, 0, EID.player.Position, nullVector, EID.player, 0, 4354)
pathCheckerEntity = game:Spawn(17, 0, EID.player.Position, nullVector, EID.player, 6969, 4354)
pathCheckerEntity:GetData()["EID_Pathfinder"] = true
pathCheckerEntity.Visible = false
local success = pathCheckerEntity:ToNPC().Pathfinder:HasPathToPos(entity.Position, false)
pathsChecked[entity.InitSeed] = success
pathCheckerEntity:Remove()
+1 -1
View File
@@ -113,7 +113,7 @@ https://moddingofisaac.com/mod/1079/external-item-descriptions
- prefab for the incredible [b]Japanese[/b] language pack
- domcizzz for the cool [b]Czech[/b] language pack
- [url=https://steamcommunity.com/id/whytefang/]adc[/url] for creating an awesome new Languagepack and providing ideas for new functionalities</description>
<version>4.26</version>
<version>4.27</version>
<visibility>Public</visibility>
<tag id="Lua"/>
<tag id="Items"/>