Upgrading Multiple Blockers Rules
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
10 posts
• Page 1 of 1
Upgrading Multiple Blockers Rules
by friarsol » 03 Sep 2012, 17:53
One of the remaining "old rules" that has just been around for ever is assigning combat damage ad-lib during damage resolution. I think I'm going to look into upgrading this to the current rules.
This is multiple steps, and will probably take at least a few weeks to complete, but since I haven't looked into the Combat code much if anyone familiar with the area would like to give some pointers that would be much appreciated. (Especially with where the AI is doing most of the decision making, since the Human stuff is all in the Phase area that I am familiar with.)
So the rules I'm looking to upgrade are:
1. After blockers are finished being declared, order multiple blockers for damage assignment. (Human can use new DualListBox, AI would just order in a similar manner they do now in Combat Damage). Refresh the combat panel, so the top most blocker will be dealt damage first.
2. During combat damage, assign damage in order based upon what was shown. AI will assign damage very similarly to what it does now.
3. Create/Upgrade Multiblockers UI Element to allow for: Only assigning damage one Blocker at a time. Assigning 1 damage, Lethal Damage, Remaining Damage to a Blocker/Defender.
Any requests in this whole thing? I will try to keep Banding in mind while I'm writing it, but definitely won't be writing it in during these upgrades.
Has anyone else checked out the DualListBox, any requests for that?
This is multiple steps, and will probably take at least a few weeks to complete, but since I haven't looked into the Combat code much if anyone familiar with the area would like to give some pointers that would be much appreciated. (Especially with where the AI is doing most of the decision making, since the Human stuff is all in the Phase area that I am familiar with.)
So the rules I'm looking to upgrade are:
1. After blockers are finished being declared, order multiple blockers for damage assignment. (Human can use new DualListBox, AI would just order in a similar manner they do now in Combat Damage). Refresh the combat panel, so the top most blocker will be dealt damage first.
2. During combat damage, assign damage in order based upon what was shown. AI will assign damage very similarly to what it does now.
3. Create/Upgrade Multiblockers UI Element to allow for: Only assigning damage one Blocker at a time. Assigning 1 damage, Lethal Damage, Remaining Damage to a Blocker/Defender.
Any requests in this whole thing? I will try to keep Banding in mind while I'm writing it, but definitely won't be writing it in during these upgrades.
Has anyone else checked out the DualListBox, any requests for that?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Upgrading Multiple Blockers Rules
by Sloth » 03 Sep 2012, 18:14
The AI function that takes care of this is distributeAIDamage in the combat class. I've meddled with this function last week for the first time. It's still very basic.friarsol wrote:This is multiple steps, and will probably take at least a few weeks to complete, but since I haven't looked into the Combat code much if anyone familiar with the area would like to give some pointers that would be much appreciated. (Especially with where the AI is doing most of the decision making, since the Human stuff is all in the Phase area that I am familiar with.)
Blocking multiple attackers (like Avatar of Hope) should be considered.friarsol wrote:Any requests in this whole thing? I will try to keep Banding in mind while I'm writing it, but definitely won't be writing it in during these upgrades.
It's already a great improvement. If i could make a wish, it would be showing the cards related cards in some way (picture or details).friarsol wrote:Has anyone else checked out the DualListBox, any requests for that?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Upgrading Multiple Blockers Rules
by friarsol » 03 Sep 2012, 18:29
Ah yes, single creature blocking multiple creatures. I have to look up how damage assignment works if these type of creatures block in multiple groups, I believe it gets complex fast.Sloth wrote:Blocking multiple attackers (like Avatar of Hope) should be considered.friarsol wrote:Any requests in this whole thing? I will try to keep Banding in mind while I'm writing it, but definitely won't be writing it in during these upgrades.It's already a great improvement. If i could make a wish, it would be showing the cards related cards in some way (picture or details).friarsol wrote:Has anyone else checked out the DualListBox, any requests for that?
As far as the DLB, which related cards? The one that is spawning the box? I think the ones that are in the select box should now show up in the card panel.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Upgrading Multiple Blockers Rules
by Sloth » 03 Sep 2012, 19:07
Ah, didn't notice that. Very cool, very cool.friarsol wrote:As far as the DLB, which related cards? The one that is spawning the box? I think the ones that are in the select box should now show up in the card panel.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Upgrading Multiple Blockers Rules
by friarsol » 07 Sep 2012, 23:47
I may already be done with the first step of this, but probably won't have a chance to commit till later this weekend due to real life. Either way, I want to wait till after the fixed Release is out. The main thing that isn't working right now (which already wasn't working) is I have no idea why the CardPanels aren't displaying the relevant cards.
I haven't looked too much into Wall of Glare and related cards, but I simplified some Combat functions to more easily be used in these cases. Once this first step is all checked in, I'll convert any reference of a single Attacker being blocked, to a CardList of Attackers.
How do we want this Keyword to be implemented? I think two different Keywords would probably be best. One for Wall of Glare effects. And one for BlockAdditional effects.
I think in general, stacking BlockAdditional keywords works except for maybe.. Kemba's Legion. Not sure how the best way to handle that is.
I haven't looked too much into Wall of Glare and related cards, but I simplified some Combat functions to more easily be used in these cases. Once this first step is all checked in, I'll convert any reference of a single Attacker being blocked, to a CardList of Attackers.
How do we want this Keyword to be implemented? I think two different Keywords would probably be best. One for Wall of Glare effects. And one for BlockAdditional effects.
I think in general, stacking BlockAdditional keywords works except for maybe.. Kemba's Legion. Not sure how the best way to handle that is.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Upgrading Multiple Blockers Rules
by Sloth » 08 Sep 2012, 13:53
Kemba's Legion could just have "Can block X additional creatures". Yare would give "Can block 2 additional creatures" and the others "Can block 1 additional creatures".friarsol wrote:I think in general, stacking BlockAdditional keywords works except for maybe.. Kemba's Legion. Not sure how the best way to handle that is.
A modified version of getKeywordMagnitude can calculate the final number.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Upgrading Multiple Blockers Rules
by friarsol » 10 Sep 2012, 00:46
Ok, the first step of Blocking Multiple Creatures is in 16775. The AI won't try to do it yet, but the functions should already be in place for when it does (specifically ordering damage assignment). I only added Wall of Glare and Foriysian Brigade for now, since it definitely needs more eyes before we start adding all of the others that have the same keyword. And however we want to iron out the keyword management.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Upgrading Multiple Blockers Rules
by Sloth » 10 Sep 2012, 07:24
Thanks a lot Sol. I will take a look at the AI part.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Upgrading Multiple Blockers Rules
by Jaedayr » 18 Sep 2012, 03:03
Is there a way that an attacking 2/4 creature with deathtouch which is blocked by a 1/3 and a 3/4 creature can deal 1 damage to each of them to kill them both? Or is all damage allocated to one creature at a time?
Re: Upgrading Multiple Blockers Rules
by friarsol » 18 Sep 2012, 03:59
I thought I handled this already, but maybe the logic is slightly faulty. I'll take a look when I have some time.Jaedayr wrote:Is there a way that an attacking 2/4 creature with deathtouch which is blocked by a 1/3 and a 3/4 creature can deal 1 damage to each of them to kill them both? Or is all damage allocated to one creature at a time?
Edit: Oh, just forgot to compare to the current damage. Should be good now.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 22 guests