Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ctc:SwitchCostumeRequirementold(hasTrinket, trinketId, costumeId) -- outdated, but left in just in case with problems with the playerData version
- for i = 0, (game:GetNumPlayers() - 1) do
- local player = Isaac.GetPlayer(i)
- if hasTrinket == true then
- if player:GetTrinket(0) ~= nil then -- the player holds at least something
- if player:GetTrinket(0) == trinketId
- or player:GetTrinket(1) == trinketId then
- player:TryRemoveNullCostume(costumeId) -- remove costume
- -- allow the moddedCos. boolean to be switched in the callback
- hasTrinket = false -- switches the moddedCos. variable of the currrent trinket to 'false'..
- -- in the MC_EXECUTE_CMD callback of the Mod which calls the function
- end
- end
- end
- end
- end
- -- functions used in the MC_POST_UPDATE callback of mods which want the compatibility
- function ctc:AddTrinketCostume(player, trinketId, costumeId)
- if onPickup == false then -- costume would get applied by smelting the trinket
- if player:GetTrinket(0) ~= trinketId
- and player:GetTrinket(1) ~= trinketId
- and applyCostume == true then -- still follows the same rules as base game trinkets
- -- costume would get applied by smelting the trinket
- player:AddNullCostume(costumeId)
- -- allow the moddedCos. boolean to be switched in the callback
- hasTrinketCostume = true -- switches the moddedCos. variable of the curreent trinket to 'true'..
- -- in the MC_POST_UPDATE callback of the Mod whihc calls the function
- end
- else
- if player:HasTrinket(trinketId) then
- -- costume would get applied by picking up the trinket
- player:AddNullCostume(costumeId)
- -- allow the moddedCos. boolean to be switched in the callback
- hasTrinketCostume = true -- switches the moddedCos. variable of the curreent trinket to 'true'..
- -- in the MC_POST_UPDATE callback of the Mod whihc calls the function
- end
- end
- end
- -- ex. ctc:RemoveTrinketCostume(player, costumeId)
- function ctc:RemoveTrinketCostume (player, trinketId, costumeId)
- if not player:HasTrinket(trinketId) then
- -- costume would get applied by picking up the trinket
- player:TryRemoveNullCostume(costumeId)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment