Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Ulamog, the Ceaseless Hunger
Moderator: CCGHQ Admins
Ulamog, the Ceaseless Hunger
by Chakan » 31 Aug 2015, 01:42
Been trying to come up with a working code for this thing all day, but everything I've tried so far ended in failure. Could someone let me know if this code is at least half way right? There's really no other cards, that I could think of anyway, that have an ability such as this. I've already done 11 of the cards that have been spoiled for Battle for Zendikar, hope to have the rest of the spoiled cards done by Friday.
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<TRIGGER value="ATTACKING" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
if TriggerPlayer() ~= nil then
local secondaryPlayer = SecondaryPlayer()
local effectController = EffectController()
for i = 0,(20-1) do
local card = secondaryPlayer:Library_GetNth( i )
if card ~= nil then
card:Exile()
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Re: Ulamog, the Ceaseless Hunger
by Xander9009 » 31 Aug 2015, 01:48
Try this:
Riiak, are you aware your site is messed up? Or is it just me? I moved to Windows 10, so it's possible that's why (but I seriously doubt it).
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<TRIGGER value="ATTACKING" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local oDefending = RSN_GetDefendingPlayer(EffectSourceLKI())
if oDefending ~= nil then
for i=0,19 do
local card = oDefending:Library_GetTop()
if card ~= nil then
card:Exile()
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Riiak, are you aware your site is messed up? Or is it just me? I moved to Windows 10, so it's possible that's why (but I seriously doubt it).
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Ulamog, the Ceaseless Hunger
by Chakan » 31 Aug 2015, 02:10
Where'd you get those functions, Xander? I didn't even know such a code existed. Also, if you're talking about the Wiki, yeah, it's messed up I think, the pages exist, but they're blank, right? (Also, that code didn't work.)
Re: Ulamog, the Ceaseless Hunger
by Xander9009 » 31 Aug 2015, 04:18
You can see the function used in Dimir Cutpurse's code. As for how I know it exists, it's just because I've been here awhile lol. If I recall correctly, the game doesn't have a proper ability to determine the defending player when you're in a 2HG game, and this function is supposed to fix that.Chakan wrote:Where'd you get those functions, Xander? I didn't even know such a code existed. Also, if you're talking about the Wiki, yeah, it's messed up I think, the pages exist, but they're blank, right? (Also, that code didn't work.)
Either way, since it didn't work, try this.
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.]]></LOCALISED_TEXT>
<TRIGGER value="ATTACKING" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
MTG():MessageAllPlayers("RTA is firing.")
local oDefending = TriggerPlayer()
if oDefending ~= nil then
MTG():MessageAllPlayers("Defending Player is valid. His or her life total is currently "..oDefending:GetLifeTotal())
for i=0,2 do
MTG():MessageAllPlayers("i: "..i)
local card = oDefending:Library_GetTop()
if card ~= nil then
MTG():MessageAllPlayers("i: "..i.." is valid.")
card:Exile()
end
end
end
MTG():MessageAllPlayers("RTA is finished.")
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Ulamog, the Ceaseless Hunger
by thefiremind » 31 Aug 2015, 07:49
Is TriggerPlayer() set to the attacked player in an ATTACKING trigger? Maybe it does and I didn't know, but it's the first time I see it. I would have used EffectSourceLKI():GetPlayerAttacked(), or maybe even better, save that information inside the TRIGGER condition and use the saved one inside the action so you're sure that nothing strange happens:
- Code: Select all
<TRIGGER value="ATTACKING" simple_qualifier="self">
EffectDC():Set_PlayerPtr( 1, EffectSource():GetPlayerAttacked() )
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
...
local oDefending = EffectDC():Get_PlayerPtr(1)
...
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Ulamog, the Ceaseless Hunger
by RiiakShiNal » 31 Aug 2015, 11:01
Actually, I was not aware that the Wiki was messed up. I have, however, confirmed that it is screwed up, though I don't yet know how long it will take to fix it or why it got screwed up in the first place.Xander9009 wrote:Riiak, are you aware your site is messed up? Or is it just me? I moved to Windows 10, so it's possible that's why (but I seriously doubt it).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Ulamog, the Ceaseless Hunger
by Chakan » 31 Aug 2015, 15:29
Ah ha, thanks for the code Xander. It works perfectly now. I'll make sure to study this code if another such ability comes up. A big thanks to everyone who posted, I really appreciate it.
Re: Ulamog, the Ceaseless Hunger
by Xander9009 » 31 Aug 2015, 16:42
I wasn't sure. I was just going by the code that I found in another card. I don't recall what it was, but apparently whoever made it knew it would work (or got lucky haha).thefiremind wrote:Is TriggerPlayer() set to the attacked player in an ATTACKING trigger? Maybe it does and I didn't know, but it's the first time I see it. I would have used EffectSourceLKI():GetPlayerAttacked(), or maybe even better, save that information inside the TRIGGER condition and use the saved one inside the action so you're sure that nothing strange happens:
- Code: Select all
<TRIGGER value="ATTACKING" simple_qualifier="self">
EffectDC():Set_PlayerPtr( 1, EffectSource():GetPlayerAttacked() )
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
...
local oDefending = EffectDC():Get_PlayerPtr(1)
...
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 43 guests