Check for challenges

This commit is contained in:
theo@manjaro 2023-06-28 20:30:31 +02:00
parent 6f91218f68
commit f78740be7d
2 changed files with 23 additions and 16 deletions

View File

@ -16,6 +16,9 @@ function mod:isCurseBlind()
end end
function mod.isIdNotTakenAlready(id) function mod.isIdNotTakenAlready(id)
-- Always returns seen if on a challenge
if Isaac.GetChallenge()~=0 then return false end
if id>=1 and id<=save.settings.maxid then if id>=1 and id<=save.settings.maxid then
return not save.seen[id] return not save.seen[id]
end end
@ -31,21 +34,24 @@ function mod.isIdNotTakenAlready(id)
end end
function mod.registerTouched(id) function mod.registerTouched(id)
if id>=1 and id<=save.settings.maxid then -- Only register when not on a challenge
save:touchid(id) if Isaac.GetChallenge()==0 then
end if id>=1 and id<=save.settings.maxid then
if id >=save.settings.maxid then save:touchid(id)
-- Modded item, save them by name end
-- (as IDs are choosen manually by the game, and may vary when changing mods) if id >=save.settings.maxid then
local itemconfig = Isaac.GetItemConfig():GetCollectible(id) -- Modded item, save them by name
if itemconfig then -- (as IDs are choosen manually by the game, and may vary when changing mods)
local name = itemconfig.Name local itemconfig = Isaac.GetItemConfig():GetCollectible(id)
save:touchname(name) if itemconfig then
local name = itemconfig.Name
save:touchname(name)
end
end end
end
-- Save -- Save
mod:save() mod:save()
end
end end
-- Used to check if EID's description should be modified -- Used to check if EID's description should be modified

View File

@ -3,7 +3,7 @@
<name>DeadGod Helper</name> <name>DeadGod Helper</name>
<directory>deadgod helper</directory> <directory>deadgod helper</directory>
<id>2985754961</id> <id>2985754961</id>
<description>A small mod for The Binding Of Isaac: Repentance! <description>Spot missing items!
Easily spot items that were not previously picked up on this savefile. Very useful when you're trying to get a second or third Dead God. Easily spot items that were not previously picked up on this savefile. Very useful when you're trying to get a second or third Dead God.
@ -16,7 +16,7 @@ It is also compatible with Mod Config Menu, if you want to toggle things (such a
Since mods can't directly access the savefile, this mod takes it upon itself to track wich items are picked up. This means that the first time you install this mod, everything will be marked as unseen. Since mods can't directly access the savefile, this mod takes it upon itself to track wich items are picked up. This means that the first time you install this mod, everything will be marked as unseen.
Turns out EID already has a some support for this, using a save extractor. If you want to go down that route, here's the link to the extractor : https://github.com/wofsauge/External-Item-Descriptions/tree/master/scripts Turns out EID already has some support for this, using a save extractor. If you want to go down that route, here's the link to the extractor : https://github.com/wofsauge/External-Item-Descriptions/tree/master/scripts
However, EID's save extractor doesn't really work on Linux, so I made a port of it in python, in order to be more easily ran. This port is available here : https://forge.chapril.org/ayte/DeadGodHelper/src/branch/main/SaveExtractor However, EID's save extractor doesn't really work on Linux, so I made a port of it in python, in order to be more easily ran. This port is available here : https://forge.chapril.org/ayte/DeadGodHelper/src/branch/main/SaveExtractor
This port can also extract save file's info to be used for Dead God Helper. This port can also extract save file's info to be used for Dead God Helper.
@ -26,8 +26,9 @@ This mod is still relevant in itself if you do not want to use external tools, o
Anyway, I hope that this mod will be useful to someone :) Anyway, I hope that this mod will be useful to someone :)
Source code is available at https://forge.chapril.org/ayte/DeadGodHelper</description> Source code is available at https://forge.chapril.org/ayte/DeadGodHelper</description>
<version>1.11</version> <version>1.12</version>
<visibility>Public</visibility> <visibility>Public</visibility>
<tag id="Items"/> <tag id="Items"/>
<tag id="Tweaks"/>
<tag id="Graphics"/> <tag id="Graphics"/>
</metadata> </metadata>