Package csa.jportal.ai.enhancedAI.enhancedSim

Examples of csa.jportal.ai.enhancedAI.enhancedSim.VirtualMatch$TimedEffect


    public static String lastBestUID = "";

    EAIPlan(Environment e)
    {
        E = e;
        baseMatch = new VirtualMatch(E.match);
        vMatchAppliedToPhase = E.match.getPhase()-1;
        phasePlan = createSchedules(E.match.getPhase(), this, E);

//        System.out.println("Cache true/false = "+EAIPlanTree.cachetrueHit+"/"+EAIPlanTree.cacheFalseHit);
    }
View Full Code Here


    }

    EAIPlan(Environment e, Communication c)
    {
        E = e;
        baseMatch = new VirtualMatch(E.match);
        vMatchAppliedToPhase = E.match.getPhase()-1;
        phasePlan = createSchedules(E.match.getPhase(), this, E, c);
    }
View Full Code Here

    {
        myTurn = m;
    }
    final void setMatch(Match m, boolean stack)
    {
        vMatch = new VirtualMatch(m, stack);
    }
View Full Code Here

    {
        vMatch = new VirtualMatch(m, stack);
    }
    final void setMatch(VirtualMatch m)
    {
        vMatch = new VirtualMatch(m);
    }
View Full Code Here

        for (int i = 0; i < leafs.size(); i++)
        {
            EAIPlanTree leaf = leafs.elementAt(i);

            leaf.playerScore = 0; // reset scoring
            VirtualMatch vm = leaf.vMatch;

            EAISchedule s = leaf.executedActions[currentPhaseExtended];
            if ((s == null) || (s.size() == 0))
            {
                vm.resolveStack();
                continue;
            }
            Vector<EAIAction> plan = s.getStepPlan();

            for (int a =plan.size()-1; a >=0; a--)
            {
                EAIAction action = plan.elementAt(a);
                leaf.addToResultStack(action);
                  // build stack in vMatch
                vm.addStackAction(new EAIAction(action)); // add a copy, otherwise mana payment of original action is deleted!
            }
            vm.resolveStack();
            {
                if (vm.simFinished()) continue;
                leaf.createSchedule(); // for this phase
                leaf.flatten();
            }
        }
        // 1 depth flatten!
View Full Code Here

        Match.loadMatchUnstated(matchName, null, match, options);

        if (!match.didMatchStart()) return;

        vMatch = new VirtualMatch(match);
        //jButton3.setEnabled(vMatch != null);
        jButtonTest.setEnabled(vMatch != null);
    }//GEN-LAST:event_jButton2ActionPerformed
View Full Code Here

c) library size
  */

  public int buildScore(Match match, int playerNo, boolean remember)
  {
      return buildScore(new VirtualMatch(match), playerNo, remember);
  }
View Full Code Here

  // action = 1, from hand to battle
  // action = 2, battle to Grave
  public static int getBattleFieldDifScore(VirtualMatch match, int playerNo, CardSimList cards, int action)
  {
      VirtualMatch cl = new VirtualMatch(match, true);
      Weighting weightingUsed = Weighting.DEFAULT;
      int scoreOrg = weightingUsed.buildScore(match, playerNo, false) - weightingUsed.buildScore(match, (playerNo+1)%2, false);

      if (action == 1)
      {
          cl.moveCardFromHandToBattle(cards);
      }
      else if (action == 2)
      {
          cl.moveCardFromBattleToGrave(cards);
      }

      int scoreNew = weightingUsed.buildScore(cl, playerNo, false) - weightingUsed.buildScore(cl, (playerNo+1)%2, false);
      return scoreNew-scoreOrg;
  }
View Full Code Here

  public static int getHealthScore(VirtualMatch match, int playerNo, int h)
  {
     Integer score = healthScoreMap.get(h);
     if (score == null)
     {
          VirtualMatch cl = new VirtualMatch(match);
          Weighting weightingUsed = Weighting.DEFAULT;
          cl.life[playerNo] = h;
          score = weightingUsed.buildScore(match, playerNo, false);
          healthScoreMap.put(h, score);
     }
View Full Code Here

                        if (aHints.hasHint(key, HintOccurrence.O_WHEN_BLOCKED))
                        {
                            if (aHints.hasHint(key, HintTargetTypes.TY_DAMAGE_AS_NON_BLOCKED))
                            {
                               
                                VirtualMatch vMatch = new VirtualMatch(c.E.mInitiatorMatch);
                                int damageToDo = initiator.getNowPower();
                               
                                CombatSimConfig configTMP = new CombatSimConfig();
                                configTMP.attackers = new CardSimList(initiator);
                                configTMP.blockerLands = vMatch.getLand((initiator.getOwner()+1)%2);
                                configTMP.attackerLands = vMatch.getLand(initiator.getOwner());
                               
                                csa.jportal.ai.enhancedAI.enhancedSim.SingleFight sFight = csa.jportal.ai.enhancedAI.enhancedSim.SingleFight.getFight(initiator, vMatch.getBlocker(initiator), configTMP, false);
                               
                                vMatch.getAttacker().remove(initiator);
                                int oldOpponentHealth = vMatch.getLife((initiator.getOwner()+1)%2);
                                vMatch.doCombat(initiator.getOwner());
                                int newOpponentHealth = vMatch.getLife((initiator.getOwner()+1)%2);
                               
                                int otherDamage = oldOpponentHealth-newOpponentHealth;
                               
                                boolean damagePlayer =  EAIPlanTree.doRatherPlayerDamage(new VirtualMatch(c.E.mInitiatorMatch), sFight, initiator.getOwner(), otherDamage);
                               
                                c.setBooleanResult(damagePlayer);
                                c.setSuccessfull(true);
                                return;
                            }
View Full Code Here

TOP

Related Classes of csa.jportal.ai.enhancedAI.enhancedSim.VirtualMatch$TimedEffect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.