Merge pull request #329 from Buurazu/master
Corrupted Data support, fix Diplopia + Flip
This commit is contained in:
3 files changed
+39
-19
No files matched your search
+11
-11
@@ -971,22 +971,22 @@ EID.descriptions[languageCode].GlitchedItemText = {
|
||||
[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 = "{{ColorCyan}}Then:{{CR}} ",
|
||||
active = "{{ColorCyan}}On use:#",
|
||||
pickup_collected = "{{ColorCyan}}When you collect a pickup:#", --chance to?
|
||||
enemy_kill = "{{ColorCyan}}On kill, chance to:#",
|
||||
damage_taken = "{{ColorCyan}}When you take damage:#", --chance to?
|
||||
entity_spawned = "When a {{ColorCyan}}{T1}{{CR}} is spawned:#",
|
||||
tear_fire = "{{ColorCyan}}When you fire a tear, chance to:#",
|
||||
enemy_hit = "{{ColorCyan}}On hitting an enemy, chance to:#",
|
||||
room_clear = "{{ColorCyan}}On room clear:#", --chance to?
|
||||
chain = "Then:{{CR}} ",
|
||||
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 {T1} 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}{{CR}} in the room to {{ColorGray}}{2}{{CR}}",
|
||||
convert_entities = "Convert all {1} in the room to {2}",
|
||||
use_active_item = "Use {1}",
|
||||
spawn_entity = "Spawn a {{ColorGray}}{1}{{CR}}",
|
||||
spawn_entity = "Spawn a {1}",
|
||||
fart = "Fart with size {1}",
|
||||
|
||||
-- Generic entity names not obtained from entities2.xml
|
||||
|
||||
+19
-4
@@ -20,6 +20,18 @@ local logLocation = os.getenv("SYSTEMDRIVE") .. "/Users/" .. os.getenv("USERNAME
|
||||
local logFound = false
|
||||
local logCursor = 0
|
||||
|
||||
local triggerColors = {
|
||||
chain = "{{ColorSilver}}",
|
||||
active = "{{ColorLime}}",
|
||||
pickup_collected = "{{ColorYellow}}",
|
||||
enemy_kill = "{{ColorRed}}",
|
||||
damage_taken = "{{ColorRed}}",
|
||||
entity_spawned = "",
|
||||
tear_fire = "{{ColorCyan}}",
|
||||
enemy_hit = "{{ColorEIDError}}",
|
||||
room_clear = "{{ColorOrange}}",
|
||||
}
|
||||
|
||||
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
|
||||
@@ -31,7 +43,7 @@ local function entityToName(e, plural)
|
||||
if name == e then Isaac.DebugString("No name found for " .. e .. " (could be modded)")
|
||||
elseif plural then name = name .. localizedNames["pluralize"] end
|
||||
|
||||
return name
|
||||
return "{{ColorGray}}" .. name .. "{{CR}}"
|
||||
end
|
||||
|
||||
local function parseEffectLine(raw)
|
||||
@@ -77,7 +89,7 @@ local function parseEffectLine(raw)
|
||||
|
||||
local localizedNames = EID:getDescriptionEntry("GlitchedItemText")
|
||||
local eidString = ""
|
||||
if effectTrigger ~= lastEffectTrigger then eidString = eidString .. (localizedNames[effectTrigger] or (effectTrigger .. "#")) end
|
||||
if effectTrigger ~= lastEffectTrigger then eidString = eidString .. triggerColors[effectTrigger] .. (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
|
||||
@@ -87,8 +99,11 @@ local function parseEffectLine(raw)
|
||||
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
|
||||
|
||||
-- Check log.txt every 5 frames if there's a collectible we haven't read the data for yet
|
||||
-- (Should work well for Corrupted Data)
|
||||
if game:GetFrameCount() % 5 ~= 0 or not EID.Config["DisplayGlitchedItemInfo"] or not logFound or
|
||||
Isaac.GetItemConfig():GetCollectible(maxNumber - spawnedItems - 1) == nil then return end
|
||||
|
||||
local numEffects = 0
|
||||
local itemScore = 0
|
||||
local eidDesc = ""
|
||||
|
||||
@@ -323,10 +323,15 @@ if REPENTANCE then
|
||||
EID:AddCallback(ModCallbacks.MC_POST_PICKUP_INIT, EID.postPickupInit, PickupVariant.PICKUP_COLLECTIBLE)
|
||||
|
||||
function EID:CheckPedestalIndex(entity)
|
||||
-- Only pedestals with indexes that were present at room load can be flip pedestals; fixes shop restock machines
|
||||
if EID.flipItemPositions[curRoomIndex] and EID.flipItemPositions[curRoomIndex][entity.InitSeed] and entity.Index > EID.flipMaxIndex then
|
||||
EID.flipItemPositions[curRoomIndex][entity.InitSeed] = nil
|
||||
entity:GetData()["EID_FlipItemID"] = nil
|
||||
-- Only pedestals with indexes that were present at room load can be flip pedestals
|
||||
-- Fixes shop restock machines and Diplopia... mostly. At least while you're in the room.
|
||||
if entity:GetData()["EID_FlipItemID"] and entity.Index > EID.flipMaxIndex then
|
||||
local curRoomIndex = game:GetLevel():GetCurrentRoomIndex()
|
||||
local gridPos = game:GetRoom():GetGridIndex(entity.Position)
|
||||
local flipEntry = EID.flipItemPositions[curRoomIndex] and EID.flipItemPositions[curRoomIndex][entity.InitSeed]
|
||||
-- only wipe the data if the grid index matches (so Diplopia pedestals don't)
|
||||
if flipEntry and gridPos == flipEntry[2] then EID.flipItemPositions[curRoomIndex][entity.InitSeed] = nil end
|
||||
entity:GetData()["EID_FlipItemID"] = nil
|
||||
end
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, EID.CheckPedestalIndex, PickupVariant.PICKUP_COLLECTIBLE)
|
||||
|
||||
Reference in new issue
Block a user