Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int TurnKill(Deck remainingdeck, OpeningHand openinghand) {
- int OneCostPower=2;
- int TwoCostPower=3;
- int ThreeCostPower=4;
- int BoltDamage=2;
- int OneDropCMC = 1;
- int TwoDropCMC = 2;
- int ThreeDropCMC = 3;
- int BoltCMC = 2;
- int Turn=0;
- int OppLife=20;
- int ManaLeft;
- int TypeOfCardDrawn;
- int OneDropsInPlay=0;
- int TwoDropsInPlay=0;
- int ThreeDropsInPlay=0;
- int LandsInPlay=0;
- int OneDropsInHand=openinghand.NumberOf1Cost;
- int TwoDropsInHand=openinghand.NumberOf2Cost;
- int ThreeDropsInHand=openinghand.NumberOf3Cost;
- int BoltsInHand=openinghand.NumberOfBolts;
- int LandsInHand=openinghand.NumberOfLands;
- do {
- Turn++;
- //
- // Attempt at flexible Turn management!
- //
- // Initialize vars
- int CastableBolts=0;
- // Untap, Upkeep, Draw card if Turn>1
- if (Turn > 1) {
- TypeOfCardDrawn=remainingdeck.DrawCard();
- if (TypeOfCardDrawn==1) {OneDropsInHand++;}
- if (TypeOfCardDrawn==2) {TwoDropsInHand++;}
- if (TypeOfCardDrawn==3) {ThreeDropsInHand++;}
- if (TypeOfCardDrawn==4) {BoltsInHand++;}
- if (TypeOfCardDrawn==5) {LandsInHand++;}
- }
- // Main Phase, No matter what, play land
- if (LandsInHand>=1) {LandsInPlay++; LandsInHand--;}
- ManaLeft=LandsInPlay;
- // Combat Phase, adjust if doing Goblin Guide sims
- if (Turn > 1) {
- OppLife=OppLife-OneCostPower*OneDropsInPlay;
- OppLife=OppLife-TwoCostPower*TwoDropsInPlay;
- OppLife=OppLife-ThreeCostPower*ThreeDropsInPlay;
- }
- // Second Main Phase, first go for the Bolt win
- CastableBolts=Math.min(BoltsInHand, ManaLeft/BoltCMC);
- if (OppLife<=CastableBolts*BoltDamage) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
- // Solve for max damage
- int PossibleDamageNextTurn=0;
- int ManaNeededForThisPlay=0;
- int NewPowerOnField=0;
- int NewOneDropsOnField=0;
- int NewTwoDropsOnField=0;
- int NewThreeDropsOnField=0;
- for (int OneDropCount=0; OneDropCount<=OneDropsInHand; OneDropCount++){
- for (int TwoDropCount=0; TwoDropCount<=TwoDropsInHand; TwoDropCount++){
- for (int ThreeDropCount=0; ThreeDropCount<=ThreeDropsInHand; ThreeDropCount++){
- PossibleDamageNextTurn = OneDropCount*OneCostPower + TwoDropCount*TwoCostPower + ThreeDropCount*ThreeCostPower;
- ManaNeededForThisPlay = OneDropCMC*OneDropCount + TwoDropCMC*TwoDropCount + ThreeDropCMC*ThreeDropCount;
- if (ManaNeededForThisPlay <= ManaLeft && PossibleDamageNextTurn > NewPowerOnField) {
- NewPowerOnField = PossibleDamageNextTurn;
- NewOneDropsOnField = OneDropCount;
- NewTwoDropsOnField = TwoDropCount;
- NewThreeDropsOnField = ThreeDropCount;
- }
- }
- }
- }
- OneDropsInPlay = OneDropsInPlay + NewOneDropsOnField;
- OneDropsInHand = OneDropsInHand - NewOneDropsOnField;
- ManaLeft = ManaLeft - OneDropCMC*NewOneDropsOnField;
- TwoDropsInPlay = TwoDropsInPlay + NewTwoDropsOnField;
- TwoDropsInHand = TwoDropsInHand - NewTwoDropsOnField;
- ManaLeft = ManaLeft - TwoDropCMC*NewTwoDropsOnField;
- ThreeDropsInPlay = ThreeDropsInPlay + NewThreeDropsOnField;
- ThreeDropsInHand = ThreeDropsInHand - NewThreeDropsOnField;
- ManaLeft = ManaLeft - ThreeDropCMC*NewThreeDropsOnField;
- // Bolts to end the turn
- CastableBolts=Math.min(BoltsInHand, ManaLeft/BoltCMC);
- if (CastableBolts>=1) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
- } while (OppLife>0 && Turn<=50);
- return Turn;
- }//end of TurnKill
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement