It is currently 01 Nov 2025, 22:46
   
Text Size

hasSecondStrike()

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

hasSecondStrike()

Postby DennisBergkamp » 16 Nov 2009, 05:06

Zerker,

I was having some trouble with your new hasSecondStrike() method. For some reason, normal combat damage does not happen when using this method. If I replace them with the old (not so elegant) :

Code: Select all
if(!att.get(i).hasFirstStrike() || (att.get(i).hasFirstStrike() && att.get(i).hasDoubleStrike()) )
and
Code: Select all
if(!attacking.get(i).hasFirstStrike() || (attacking.get(i).hasFirstStrike() && attacking.get(i).hasDoubleStrike() )){
Stuff works again. I'm confused though, why wouldn't it work with hasSecondStrike()?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: hasSecondStrike()

Postby zerker2000 » 16 Nov 2009, 05:55

Huh? That IS the secondStrike code...
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: hasSecondStrike()

Postby DennisBergkamp » 16 Nov 2009, 06:01

Yes, exactly!

Which is why I'm so confused #-o
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: hasSecondStrike()

Postby Marek14 » 16 Nov 2009, 07:50

I wonder - does the code work correctly if a creature gains or loses first strike after first strike damage?
Marek14
Tester
 
Posts: 2774
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 36 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 36 users online :: 0 registered, 0 hidden and 36 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 36 guests

Login Form