<commit_before><template>
  <article id="hero-attributes" class="media">
    <figure class="media-left">
      <p class="image is-128x128">
        <img :src="attributes.image">
      </p>
    </figure>
    <div class="media-content">
      <div class="content">
        <!--p>
          <strong class="title is-5">Base Stats</strong>
          <br>Note that critical power (1000) and block power (500) have hidden base values for all heroes, those base values are not shown in the table.
        </p-->
        <div class="columns">
          <div class="column is-one-quarter">
            <label class="label">{{ $t('ui.mpatk') }}</label>
            <div class="field ">
              <div class="control is-expanded">
                <input class="input" type="number" v-model.number="mpatkValue">
              </div>
            </div>
            <label class="label">{{ $t('ui.aspd') }}</label>
            <div class="field ">
              <div class="control is-expanded">
                <input class="input" type="number" v-model.number="aspdValue">
              </div>
            </div>
          </div>
          <div class="column is-three-quarters">
              <table class="table is-hoverable is-fullwidth">
              <thead>
                <th>Type</th>
                <th>Value</th>
              </thead>
              <tbody>
                <tr>
                  <td>Autoattack Cycle</td>
                  <td>{{ rounding(effCycle) }}s</td>
                </tr>
                <tr>
                  <td>Autoattack Hits</td>
                  <td>{{ effHits }}</td>
                </tr>
                <tr>
                  <td>Effective MP/Atk per "hit"</td>
                  <td>{{ Math.floor(effMpatkhit) }}</td>
                </tr>
                <tr>
                  <td>Effective MP/Atk per second</td>
                  <td>{{ Math.round(effMpatksec) }}</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <br>
        <table class="table is-hoverable is-fullwidth">
          <thead>
            <th>Type</th>
            <th>Value</th>
          </thead>
          <tfoot>
            <th>Type</th>
            <th>Value</th>
          </tfoot>
          <tbody>
            <tr v-for="key in Object.keys(attributes.stats)" :key="key">
              <td>{{ $t('ui.' + key) }}</td>
              <td>{{ attributes.stats[key] }}</td>
            </tr>
          </tbody>
        </table>

      </div>
    </div>
  </article>
</template>

<script>
import { softcap } from "@/mixins/softcap";

export default {
  name: "Attributes",
  mixins: [softcap],
  props: {
    attributes: {
      type: Object,
      required: true
    },
    auto: {
      type: Object,
      required: true
    }
  },
  data: function() {
    return {
      mpatkValue: 0,
      aspdValue: 1000
    };
  },
  computed: {
    effCycle: function() {
      return this.effDuration(this.auto.duration);
    },
    effHits: function() {
      var s = "";
      for (var i = 0; i < this.auto.hits.length; i++) {
        s +=
          "(" +
          String(this.effHitsHelper(this.auto.hits[i])).replace(",", "s, ") +
          "s), ";
      }
      return s.slice(0, -2);
    },
    effMpatkhit: function() {
      return this.attributes.stats.mpatk * this.mpatkCapped;
    },
    effMpatksec: function() {
      var avgHitsPerSec = this.auto.hits.length / this.effCycle;
      return this.effMpatkhit * avgHitsPerSec;
    },
    mpatkCapped: function() {
      return 1 + this.actualStat(this.mpatk, this.mpatkValue) / 100.0;
    },
    aspdCapped: function() {
      return this.actualStat(this.aspd, this.aspdValue) / 100.0;
    }
  },
  methods: {
    effHitsHelper: function(arr) {
      var a = [];
      for (var i = 0; i < arr.length; i++) {
        a.push(this.rounding(arr[i] / this.aspdCapped));<commit_msg>Fix for spaces between each comma.<commit_after><template>
  <article id="hero-attributes" class="media">
    <figure class="media-left">
      <p class="image is-128x128">
        <img :src="attributes.image">
      </p>
    </figure>
    <div class="media-content">
      <div class="content">
        <!--p>
          <strong class="title is-5">Base Stats</strong>
          <br>Note that critical power (1000) and block power (500) have hidden base values for all heroes, those base values are not shown in the table.
        </p-->
        <div class="columns">
          <div class="column is-one-quarter">
            <label class="label">{{ $t('ui.mpatk') }}</label>
            <div class="field ">
              <div class="control is-expanded">
                <input class="input" type="number" v-model.number="mpatkValue">
              </div>
            </div>
            <label class="label">{{ $t('ui.aspd') }}</label>
            <div class="field ">
              <div class="control is-expanded">
                <input class="input" type="number" v-model.number="aspdValue">
              </div>
            </div>
          </div>
          <div class="column is-three-quarters">
              <table class="table is-hoverable is-fullwidth">
              <thead>
                <th>Type</th>
                <th>Value</th>
              </thead>
              <tbody>
                <tr>
                  <td>Autoattack Cycle</td>
                  <td>{{ rounding(effCycle) }}s</td>
                </tr>
                <tr>
                  <td>Autoattack Hits</td>
                  <td>{{ effHits }}</td>
                </tr>
                <tr>
                  <td>Effective MP/Atk per "hit"</td>
                  <td>{{ Math.floor(effMpatkhit) }}</td>
                </tr>
                <tr>
                  <td>Effective MP/Atk per second</td>
                  <td>{{ Math.round(effMpatksec) }}</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <br>
        <table class="table is-hoverable is-fullwidth">
          <thead>
            <th>Type</th>
            <th>Value</th>
          </thead>
          <tfoot>
            <th>Type</th>
            <th>Value</th>
          </tfoot>
          <tbody>
            <tr v-for="key in Object.keys(attributes.stats)" :key="key">
              <td>{{ $t('ui.' + key) }}</td>
              <td>{{ attributes.stats[key] }}</td>
            </tr>
          </tbody>
        </table>

      </div>
    </div>
  </article>
</template>

<script>
import { softcap } from "@/mixins/softcap";

export default {
  name: "Attributes",
  mixins: [softcap],
  props: {
    attributes: {
      type: Object,
      required: true
    },
    auto: {
      type: Object,
      required: true
    }
  },
  data: function() {
    return {
      mpatkValue: 0,
      aspdValue: 1000
    };
  },
  computed: {
    effCycle: function() {
      return this.effDuration(this.auto.duration);
    },
    effHits: function() {
      var s = "";
      for (var i = 0; i < this.auto.hits.length; i++) {
        s +=
          "(" +
          String(this.effHitsHelper(this.auto.hits[i])).replace(/,/g, "s, ") +
          "s), ";
      }
      return s.slice(0, -2);
    },
    effMpatkhit: function() {
      return this.attributes.stats.mpatk * this.mpatkCapped;
    },
    effMpatksec: function() {
      var avgHitsPerSec = this.auto.hits.length / this.effCycle;
      return this.effMpatkhit * avgHitsPerSec;
    },
    mpatkCapped: function() {
      return 1 + this.actualStat(this.mpatk, this.mpatkValue) / 100.0;
    },
    aspdCapped: function() {
      return this.actualStat(this.aspd, this.aspdValue) / 100.0;
    }
  },
  methods: {
    effHitsHelper: function(arr) {
      var a = [];
      for (var i = 0; i < arr.length; i++) {
        a.push(this.rounding(arr[i] / this.aspdCapped));
{'fraction_non_alphanumeric': 0.16257982120051084, 'fraction_numerical': 0.008173690932311623, 'mean_word_length': 1.5043172369683402, 'pattern_counts': {'":': 0, '<': 199, '<?xml version=': 0, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6520963', 'n_tokens_mistral': 2592, 'n_tokens_neox': 2467, 'n_words': 520}