Re: Community Wad
I've created a function for use in dealing with situations where the Reveal functions are not working.
I've never made a function before, so I don't know how to go about testing or whether I've even go it right. The code works in a card I created for testing it, but I don't know what to do next. Any advice would be much appreciated.
I've never made a function before, so I don't know how to go about testing or whether I've even go it right. The code works in a card I created for testing it, but I don't know what to do next. Any advice would be much appreciated.
- Code: Select all
-----------------------------
--File Info------------------
-----------------------------
--A simple set of functions for revealing cards to other players.
-------------------------
--Card Chest Registers---
-------------------------
--Make sure registers are entered into CW_Constants.lol
-------------------------
--Function List----------
-------------------------
--Parameters in braces {} are optional.
--CW_Reveal_DC(oPlayer, iRevealDC)
-- Reveals the cards in the iDC to all other players
-- Input: {Player, Int}
-- Output: None
-------------------------
--Functions Definitions--
-------------------------
--Reveals cards in a DC to each player, but omits the player provided
--Input: Player, Chest
--Output: Bool
CW_Reveal_DC = function(oPlayer, iRevealDC)
if oPlayer ~= nil and iRevealDC ~= nil then
local iReviewDC = EffectDC():Make_Chest(900)
local iCount = iRevealDC:Count()
for i=0, iCount-1 do
iRevealDC:QueryUnselect_CardPtr(i)
end
for i=0,MTG():GetNumberOfPlayers()-1 do
local player = MTG():GetNthPlayer(i)
if player ~= nil and player ~= oPlayer then
player:ChooseItemFromDC( "SPL_CARD_QUERY_CHOOSE_A_CARD_TO_EXIT_THIS_VIEW", iRevealDC, iReviewDC, QUERY_FLAG_MAY )
end
end
return true
else
return true
end
end