Implemented seperate Birthright descriptions and fixed some bugs in the API

This commit is contained in:
Wofsauge committed 2021-04-15 19:59:06 +02:00
1 parent 2d391cdb1b
commit d89696eae3
6 files changed
+68 -67

No files matched your search

+41 -43
View File
@@ -282,47 +282,49 @@ local repCollectibles={
}
EID:updateDescriptionsViaTable(repCollectibles, EID.descriptions["en_us"].collectibles, true)
--[[ Needs to be implemented and needs an API feature to add stuff to!
EID.descriptions["en_us"].birthright ={
{"Isaac", "", "All items cycle through two options"}, -- Isaac
{"Magdalene", "", ""}, -- Magdalene
{"Cain", "", ""}, -- Cain
{"Judas", "", ""}, -- Judas
{"Black Judas", "", ""}, -- Black Judas
{"???", "", "Soul hearts gained from health upgrades are doubled"}, -- ???
{"Eve", "", " Whore of Babylon is active regardless of health and Dead Bird is active without taking damage"}, -- Eve
{"Samson", "", " Bloody Lust can gain 4 more damage boosts at the same +0.2 intervals, for a new maximum total of +14.0"}, -- Samson
{"Azazel", "", "Azazel's Brimstone beam becomes much wider, like Mega Blast. No effect on damage"}, -- Azazel
{"Lazarus", "", "No direct effect, the item is triggered if Lazarus dies and becomes Lazarus Risen"}, -- Lazarus
{"Lazarus Risen", "", "Grants a slowly fading +21.6 damage bonus"}, -- Lazarus Risen
{"Eden", "", "Spawns 3 random items from random item pools. Only one can be taken"}, -- Eden
{"The Lost", "", "Prevents items with the internal tag "nolostbr" from spawning. In practice, this automatically rerolls most items that aren't beneficial to The Lost, namely ones that only give health, flight, and/or spectral tears or activate upon taking damage"}, -- The Lost
{"Lilith", "", ""}, -- Lilith
{"Keeper", "", ""}, -- Keeper
{"Apollyon", "", ""}, -- Apollyon
{"The Forgotten", "", "The Soul is unchained and free to move"}, -- The Forgotten
{"Bethany", "", "Activating an item using soul charges is sometimes free"}, -- Bethany
{"Jacob and Esau", "", "The character who picks up the item gains copies of three of the other character's passive items"}, -- Jacob and Esau
{"Tainted Isaac", "", "Adds 4 more slots for passive items"}, -- Tainted Isaac
{"Tainted Magdalene", "", "Adds 1 more red heart that doesn't drain"}, -- Tainted Magdalene
{"Tainted Cain", "", "The amount of pickups spawned from collecting an item is doubled"}, -- Tainted Cain
{"Tainted Judas", "", ""}, -- Tainted Judas
{"Tainted ???", "", "Increases the maximum number of carried poops to 29"}, -- Tainted ???
{"Tainted Eve", "", ""}, -- Tainted Eve
{"Tainted Samson", "", "The berserk timer gains 3 seconds instead of 1 when Tainted Samson kills an enemy"}, -- Tainted Samson
{"Tainted Azazel", "", "Doubles the size of Tainted Azazel's Hemoptysis sneeze attack"}, -- Tainted Azazel
{"Tainted Lazarus", "", ""}, -- Tainted Lazarus
{"Dead Tainted Lazarus", "", ""}, -- Dead Tainted Lazarus
{"Tainted Eden", "", "Passive items gained before birthright will not be rerolled upon taking damage"}, -- Tainted Eden
{"Tainted Lost", "", "Grants an extra life that revives Tainted Lost in the same room and deals 200 damage to nearby enemies. It can hit the same enemy multiple times"}, -- Tainted Lost
{"Tainted Lilith", "", ""}, -- Tainted Lilith
{"Tainted Keeper", "", "Strongly attracts the coins dropped by defeating enemies from a short distance. No effect on other coins"}, -- Tainted Keeper
{"Tainted Apollyon", "", ""}, -- Tainted Apollyon
{"Tainted Forgotten", "", "Tainted Soul gains the Recall ability, to retrieve the Tainted Forgotten automatically from a distance"}, -- Tainted Forgotten
{"Tainted Bethany", "", ""}, -- Tainted Bethany
{"Tainted Jacob", "", ""}, -- Tainted Jacob
{"Isaac", "", "All items cycle through two options"},
{"Magdalene", "", "<No effect yet>"},
{"Cain", "", "<No effect yet>"},
{"Judas", "", "<No effect yet>"},
{"???", "", "Soul hearts gained from health upgrades are doubled"},
{"Eve", "", "Whore of Babylon is active regardless of health#Dead Bird is active without taking damage"},
{"Samson", "", "Bloody Lust can gain 4 more damage boosts at the same +0.2 intervals, for a new maximum total of +14.0"},
{"Azazel", "", "Azazel's Brimstone beam becomes much wider, like Mega Blast#No effect on damage"},
{"Lazarus", "", "When dead, revive as Lazarus Risen#Lazarus Risen gains a slowly fading +21.6 damage bonus"},
{"Eden", "", "Spawns 3 random items from random item pools#Only one can be taken"},
{"The Lost", "", "Prevents items not beneficial to The Lost from spawning#Examples: ones that only give health, flight, and/or spectral tears or activate upon taking damage"},
{"Lazarus Risen", "", "Grants a slowly fading +21.6 damage bonus"},
{"Black Judas", "", "<No effect yet>"},
{"Lilith", "", "<No effect yet>"},
{"Keeper", "", "<No effect yet>"},
{"Apollyon", "", "<No effect yet>"},
{"The Forgotten", "", "The Soul is unchained and free to move"},
{"The Forgotten Soul", "", "The Soul is unchained and free to move"},
{"Bethany", "", "Activating an item using soul charges is sometimes free"},
{"Jacob", "", "The character who picks up the item gains copies of three of the other character's passive items"},
{"Esau", "", "The character who picks up the item gains copies of three of the other character's passive items"},
{"Tainted Isaac", "", "Adds 4 more slots for passive items"},
{"Tainted Magdalene", "", "Adds 1 more red heart that doesn't drain"},
{"Tainted Cain", "", "The amount of pickups spawned from collecting an item is doubled"},
{"Tainted Judas", "", "<No effect yet>"},
{"Tainted ???", "", "Increases the maximum number of carried poops to 29"},
{"Tainted Eve", "", "<No effect yet>"},
{"Tainted Samson", "", "The berserk timer gains 3 seconds instead of 1 when Tainted Samson kills an enemy"},
{"Tainted Azazel", "", "Doubles the size of Tainted Azazel's Hemoptysis {{Collectible726}} sneeze attack"},
{"Tainted Lazarus", "", "<No effect yet>"},
{"Tainted Eden", "", "Passive items gained before Birthright will not be rerolled upon taking damage"},
{"Tainted Lost", "", "+1 extra life that revives Tainted Lost in the same room and deals 200 damage to nearby enemies#Can hit the same enemy multiple times"},
{"Tainted Lilith", "", ""},
{"Tainted Keeper", "", "Strongly attracts the coins dropped by defeating enemies from a short distance#No effect on other coins"},
{"Tainted Apollyon", "", "<No effect yet>"},
{"Tainted Forgotten", "", "Tainted Soul gains the Recall ability {{Collectible714}}, to automatically retrieve the Tainted Forgotten from a distance"},
{"Tainted Bethany", "", "<No effect yet>"},
{"Tainted Jacob", "", "<No effect yet>"},
{"Dead Tainted Lazarus", "", "<No effect yet>"},
{"Tainted Jacob 2", "", "<No effect yet>"},
{"Tainted Forgotten Soul", "", "Tainted Soul gains the Recall ability {{Collectible714}}, to automatically retrieve the Tainted Forgotten from a distance"},
}
]]--
---------- Trinkets ----------
local repTrinkets={
@@ -525,8 +527,4 @@ EID.descriptions["en_us"].horsepills={
{"49", "", "↑ Increases 1 random stat two times#↓ Decreases 1 random other stat two times#Will not decrease with PHD"},
}
---------- Transformations ----------
local repTransformations={}
EID:updateDescriptionsViaTable(repTransformations, EID.descriptions["en_us"].transformations,false)
+1 -6
View File
@@ -1100,9 +1100,4 @@ local repPills={
{"49", "", "Increases one attribute and decreases another randomly, with the same power as standard attribute increase/decrease pills. #If taken with PHD, it will not reduce an attribute."},
}
EID:updateDescriptionsViaTable(repPills, EID.descriptions["en_us_detailed"].pills, true)
---------- Transformations ----------
local repTransformations={}
EID:updateDescriptionsViaTable(repTransformations, EID.descriptions["en_us"].transformations,false)
EID:updateDescriptionsViaTable(repPills, EID.descriptions["en_us_detailed"].pills, true)
+2 -8
View File
@@ -413,7 +413,7 @@ local repCards={
[96] = {"96", "", "Gera 6 Book of Virtues {{Collectible584}} orbital com propriedades aleatórias"},
[97] = {"97", "", "Gera Esau como um personagem secundário temporário para a sala atual"},
}
-- EID:updateDescriptionsViaTable(repCards, EID.descriptions["pt_br"].cards, true)
EID:updateDescriptionsViaTable(repCards, EID.descriptions["pt_br"].cards, true)
---------- Pills ----------
@@ -480,10 +480,4 @@ EID.descriptions["pt_br"].horsepills={
{"47", "", "↓ -0.3 Velocidade de disparo"},
{"48", "", "↑ +0.3 Velocidade de disparo"},
{"49", "", "↑ Aumenta 1 status aleatório duas vezes#↓ Diminue 1 status aleatório duas vezes#Não vai diminuir com PHD"},
}
---------- Transformations ----------
local repTransformations={}
EID:updateDescriptionsViaTable(repTransformations, EID.descriptions["pt_br"].transformations,false)
}
+1 -1
View File
@@ -79,4 +79,4 @@ local repTransformations = {
-- Trinkets
["5.350.169"] = "1",
}
EID:updateDescriptionsViaTable(repTransformations, EID.EntityTransformations, true)
EID:updateDescriptionsViaTable(repTransformations, EID.EntityTransformations, false)
+17 -8
View File
@@ -197,10 +197,10 @@ end
-- function to turn entity type names into actual ingame ID.Variant pairs
function EID:getIDVariantString(typeName)
if typeName == "collectible" or typeName == "collectibles" then return "5.100"
if typeName == "collectible" or typeName == "collectibles" or typeName == "birthright" then return "5.100"
elseif typeName == "trinket" or typeName == "trinkets" then return "5.350"
elseif typeName == "card" or typeName == "cards" then return "5.300"
elseif typeName == "pill" or typeName == "pills" then return "5.70"
elseif typeName == "pill" or typeName == "pills" or typeName == "horsepills" or typeName == "horsepill" then return "5.70"
elseif typeName == "sacrifice" then return "-999.-1"
elseif typeName == "dice" then return "1000.76"
end
@@ -210,7 +210,12 @@ end
-- function to turn entity typ and variants into their EID table-name
function EID:getTableName(Type, Variant, SubType)
local idString = Type.."."..Variant
if idString == "5.100" then return "collectibles"
if idString == "5.100" then
if SubType == 619 then
return "birthright"
else
return "collectibles"
end
elseif idString == "5.350" then return "trinkets"
elseif idString == "5.300" then return "cards"
elseif idString == "5.70" then
@@ -286,9 +291,10 @@ function EID:getDescriptionObj(Type, Variant, SubType)
description.ItemVariant = Variant
description.RealID = SubType
description.ID = SubType
if EID:getTableName(Type, Variant, SubType) == "pills" or EID:getTableName(Type, Variant, SubType) == "horsepills" then
local tableName = EID:getTableName(Type, Variant, SubType)
if tableName == "pills" or tableName == "horsepills" then
local pool = Game():GetItemPool()
description.ID = pool:GetPillEffect(SubType)+1
description.ID = pool:GetPillEffect(SubType) + 1
end
description.fullItemString = Type.."."..Variant.."."..description.ID
description.Name = EID:getObjectName(Type, Variant, description.ID)
@@ -332,6 +338,9 @@ function EID:getDescriptionData(Type, Variant, SubType)
local moddedDesc = EID.descriptions[EID.Config["Language"]].custom[fullString.."."..SubType] or
EID.descriptions["en_us"].custom[fullString.."."..SubType] or nil
local tableName = EID:getTableName(Type, Variant, SubType)
if tableName == "birthright" then
SubType = Isaac.GetPlayer(0).SubType + 1
end
local legacyModdedDescription = EID:getLegacyModDescription(Type, Variant, SubType)
local defaultDesc = EID.descriptions[EID.Config["Language"]][tableName][SubType] or EID.descriptions["en_us"][tableName][SubType] or nil
@@ -393,13 +402,13 @@ function EID:getObjectName(Type, Variant, SubType)
name = tableEntry[2]
end
end
if tableName == "collectibles" then
if tableName == "collectibles" or tableName == "birthright" then
return name or EID.itemConfig:GetCollectible(SubType).Name
elseif tableName == "trinkets" then
return name or EID.itemConfig:GetTrinket(SubType).Name
elseif tableName == "cards" then
return name or EID.itemConfig:GetCard(SubType).Name
elseif tableName == "pills" then
elseif tableName == "pills" or tableName == "horsepills" then
name = name or EID.itemConfig:GetPillEffect(SubType-1).Name
return string.gsub(name,"I'm Excited!!!","I'm Excited!!") -- prevent markup trigger
elseif tableName == "sacrifice" then
@@ -416,7 +425,7 @@ end
function EID:getXMLDescription(Type, Variant, SubType)
local tableName = EID:getTableName(Type, Variant, SubType)
local desc= nil
if tableName == "collectibles" then
if tableName == "collectibles" or tableName == "birthright" then
desc = EID.itemConfig:GetCollectible(SubType).Description
elseif tableName == "trinkets" then
desc = EID.itemConfig:GetTrinket(SubType).Description
+6 -1
View File
@@ -382,7 +382,12 @@ local function onRender(t)
EID:renderQuestionMark()
return
end
EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType))
local descriptionObj = EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType)
-- Handle Birthright Character name display
if closest.SubType == 619 then
descriptionObj.Description = "{{CustomTransformation}} {{ColorGray}}"..player:GetName().."{{CR}}#"..descriptionObj.Description
end
EID:printDescription(descriptionObj)
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
--Handle Cards & Runes
if closest:ToPickup():IsShopItem() and not EID.Config["DisplayCardInfoShop"] then