RFC: Cost X and AI

I was trying to get working Black Sun's Zenith and Green Sun's Zenith (current implementation here)
The cards work ok when are played by a human player (me). The AI, on the other hand, can pay 46 with only two basic lands. At first i thought it was a problem with my implementation (may be it is, i dont know for sure yet).
As far as i know, i should use GetObjectX() to get the value of X payed by the user, which i am doing, also Red Sun's Zenith (core card) do this in the same way but does not show this weird behavoir.
Any ideas?
The cards work ok when are played by a human player (me). The AI, on the other hand, can pay 46 with only two basic lands. At first i thought it was a problem with my implementation (may be it is, i dont know for sure yet).
As far as i know, i should use GetObjectX() to get the value of X payed by the user, which i am doing, also Red Sun's Zenith (core card) do this in the same way but does not show this weird behavoir.
Any ideas?