MemeMayhem / ModExamples

10 stars 3 forks source link

Relic "Pig Book" reference #103

Open AirHater opened 2 weeks ago

AirHater commented 2 weeks ago

image image I tried using Api.GameMechanicTags.RELIC_ICON.pig_book to get the icon of this combo relic, but i got an exception. Its listed as "big_book" in both https://github.com/MemeMayhem/ModExamples/blob/aaaa8e1cebfdd675b3521cd400b44b7415c1148f/References/RelicData.lua.txt and via Api:PrintRelics(), but it doesnt have an actual icon reference? Also, is there a way to remove relics during the event, similar to combat_unit:RemoveRelic(name) in the outside?

GoodCrispyShark commented 2 weeks ago

not all relics have RELIC_ICON only the ones that can be combined have this

GoodCrispyShark commented 1 week ago

i dont quite get what removing relic in outside mean? do you mean you want to block it in relic pool?

AirHater commented 1 week ago

i wanted to ask if its possible to remove relic in the event/choice, similar to how its possible to do in the combat via combat_unit:RemoveRelic(name)

GoodCrispyShark commented 1 week ago

You should be able to do so by calling the same function Did they persist in the next wave?

AirHater commented 1 week ago

i dont really understand where am i supposed to add that function. am i supposed to call it something like Api:RegisterChoice(event, function(combat_unit) local relic = "blue_fish" combat_unit:RemoveRelic(name) end) but than it would remove it relic regardless of what you chose in the event (if that code even works). how am i supposed to add a function to a specific choice event?

fx013 commented 1 week ago

@AirHater The Api:RegisterChoice API doesn't support callback functions. Is there any existing choice event in the game that removes relics? If not, this functionality likely is not there. Instead of removing relics, maybe add a relic that negates the effect of the relic you want to remove?

GoodCrispyShark commented 1 week ago

Combo relic would remove the required relics. Hope this is useful for now

AirHater commented 1 week ago

unfortunately that wasnt much useful. i guess i will try adding hidden attribute, and than have onBeforeCombatStart check to remove the relic, for now