Exemplo n.º 1
0
    @Override
    protected boolean match(GameState state, Event event) {
      if (event.type != EventType.MOVE_BATCH) return false;

      for (ZoneChange change :
          event
              .parametersNow
              .get(EventType.Parameter.TARGET)
              .evaluate(state, null)
              .getAll(ZoneChange.class)) {
        if (state.battlefield().ID != change.destinationZoneID) continue;

        GameObject object = state.get(change.newObjectID);
        if (!object.getColors().contains(Color.GREEN) || !object.getTypes().contains(Type.CREATURE))
          continue;

        return true;
      }
      return false;
    }
Exemplo n.º 2
0
 public static MagicSet get(GameState state) {
   MagicSet ret = new MagicSet();
   for (GameObject o : state.battlefield()) if (-1 != o.getAttackingID()) ret.add(o);
   return ret;
 }