Implementing Annihilator from Eldrazi...
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Implementing Annihilator from Eldrazi...
by slapshot5 » 21 Apr 2010, 17:58
Has anyone given thought to implementing Annihilator from Rise of the Eldrazi?
The basics are pretty simple.
cards.txt can look something like this:
Anyone given this any thought?
-slapshot5
PS - I think some tweaks will be necessary in order to add Eldrazi Conscription, which gives Annihilator. Or maybe that can all be done in the Enchant/Unenchant code. I haven't thought about that yet.
The basics are pretty simple.
cards.txt can look something like this:
- Code: Select all
Ulamog's Crusher
8
Creature Eldrazi
no text
8/8
This card attacks each turn if able.
Annihilator:2
- Code: Select all
if(hasKeyword(card, "Annihilator") != -1) {
int n = hasKeyword(card, "Annihilator");
if(n != -1) {
String parse = card.getKeyword().get(n).toString();
card.removeIntrinsicKeyword(parse);
String l[] = parse.split(":");
final int annihilator = Integer.parseInt(l[1]);
card.setAnnihilator(annihilator);
}
}//annihilator
- Code: Select all
public boolean hasAnnihilator();
public void setAnnihilator();
public int getAnnihilator();
- Code: Select all
if(!faceDown && card.hasAnnihilator()) {
area.append("Annihilator "+card.getAnnihilator());
}
Anyone given this any thought?
-slapshot5
PS - I think some tweaks will be necessary in order to add Eldrazi Conscription, which gives Annihilator. Or maybe that can all be done in the Enchant/Unenchant code. I haven't thought about that yet.
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Implementing Annihilator from Eldrazi...
by DennisBergkamp » 21 Apr 2010, 19:36
I've been thinking about this too... probably the best way of doing this is to skip the check at the end of CardFactory_Creatures, and to just check and execute the Annihilator ability as the attack triggers happen for each creature that's attacking and has "Annihilator {number}". This would also make cards like Eldrazi Conscription easier, because you could "dynamically" assign the keyword. Currently attack triggers happen in CombatUtil.java in the checkDeclareAttackers() method, this is where the check and parse would happen, and an "Annihilator ability" would be executed for each attacking creature that has annihilator. (EDIT: you won't have to take into account Planeswalker attackers, since all attackers including Pw attackers get checked in checkDeclareAttackers(), right after attackers are declared, right before blockers are declared)
The input stuff might be a bit tricky though, and like you said, I'm not sure 100% either if they will stack correctly. We might have to resort to selecting permanents to sacrifice through one of those "AllZone.Display.getChoiceOptional" lists, but I don't know. I guess the answer is to just try and see if it works.
The input stuff might be a bit tricky though, and like you said, I'm not sure 100% either if they will stack correctly. We might have to resort to selecting permanents to sacrifice through one of those "AllZone.Display.getChoiceOptional" lists, but I don't know. I guess the answer is to just try and see if it works.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 56 guests