コード例 #1
0
 public Integer getAttuneCost() {
   switch (type) {
     default:
     case Unattuned:
       return 0;
     case PartiallyAttuned:
       return stats.getAttuneCost();
     case ExpensivePartiallyAttuned:
       return 2 * stats.getAttuneCost();
     case FullyAttuned:
       return stats.getAttuneCost();
     case UnharmoniouslyAttuned:
       return 2 * stats.getAttuneCost();
   }
 }
コード例 #2
0
 public ArtifactStatsDecorator(
     IArtifactStats stats, ArtifactAttuneType type, boolean requireAttune) {
   this.stats = stats;
   this.type = type;
   this.requireAttune = requireAttune;
   setName(stats.getName());
 }
コード例 #3
0
  @Override
  public ICardData[] getCards(ICharacter character, ICardReportResourceProvider resourceProvider) {
    IEquipmentAdditionalModel model =
        (IEquipmentAdditionalModel)
            character
                .getStatistics()
                .getCharacterContext()
                .getAdditionalModel(IEquipmentAdditionalModelTemplate.ID);
    List<ICardData> data = new ArrayList<ICardData>();
    for (IEquipmentItem item : model.getEquipmentItems()) {
      String title = item.getTitle();
      Paragraph headerText = new Paragraph();
      if (hasCustomTitle(item)) {
        headerText.add(new Phrase(item.getTemplateId(), resourceProvider.getNormalFont()));
      }
      if (item.getMaterialComposition() == MaterialComposition.Variable) {
        String itemMaterial = "";
        if (hasCustomTitle(item)) itemMaterial += " (";
        itemMaterial += item.getMaterial().getId();
        if (hasCustomTitle(item)) itemMaterial += ")";
        headerText.add(new Phrase(itemMaterial + "\n", resourceProvider.getNormalFont()));
      }
      if (item.getCost() != null) {
        headerText.add(new Phrase(item.getCost().toString(), resourceProvider.getNormalFont()));
      }

      List<Phrase> bodyText = new ArrayList<Phrase>();

      String description = item.getDescription();
      if (description != null && !description.isEmpty()) {
        bodyText.add(new Phrase(description, resourceProvider.getNormalFont()));
        bodyText.add(new Phrase("\n", resourceProvider.getNormalFont()));
      }
      for (IEquipmentStats stats : item.getStats()) {
        Paragraph statsParagraph = new Paragraph();
        if (stats instanceof IArtifactStats) {
          IArtifactStats artifactStats = (IArtifactStats) stats;
          if (artifactStats.getAttuneType() != ArtifactAttuneType.FullyAttuned) {
            continue;
          }
          statsParagraph.add(
              new Phrase(
                  resources.getString("Equipment.Stats.Short.AttuneCost").trim() + ": ",
                  resourceProvider.getBoldFont()));
          statsParagraph.add(
              new Phrase(artifactStats.getAttuneCost() + "m", resourceProvider.getNormalFont()));
        } else {
          String statsString = stringBuilder.createString(item, stats);
          statsParagraph.add(new Phrase(stats.getId() + ": ", resourceProvider.getBoldFont()));
          statsParagraph.add(
              new Phrase(
                  statsString.substring(statsString.indexOf(':') + 2),
                  resourceProvider.getNormalFont()));
        }

        bodyText.add(statsParagraph);
      }

      data.add(
          new EquipmentCardData(
              title, headerText, bodyText.toArray(new Phrase[0]), resourceProvider.getNullIcon()));
    }
    return data.toArray(new ICardData[0]);
  }
コード例 #4
0
 @Override
 public boolean representsItemForUseInCombat() {
   return stats.representsItemForUseInCombat();
 }
コード例 #5
0
 @Override
 public int hashCode() {
   return stats.hashCode();
 }
コード例 #6
0
 public String toString() {
   return stats.toString() + "[" + type + "]";
 }