<commit_before><?php

class ItemCollectionCard extends ItemCard {

	private $has;
	private $nodes;

	public function __construct($data, $has, $lang) {
		$this->data = $data;
		@$this->info = json_decode(json_encode($data->data->inventoryItem), true);
		@$this->defs = json_decode(json_encode($data->definitions), true);
		@$this->nodes = $data->data->talentGrid->nodes;
		$this->has = $has;
		$this->lang = $lang;
	}

	private function display_weapon() { 
		foreach($this->defs['perks'] as $node) {
			$damageIcon = ""; $damageClass = "";
			if (array_key_exists('perkIdentifier', $node)) {
				switch($node['perkIdentifier']) {
					case 'PERK_ARC_DAMAGE': $damageIcon = "<div class='element-image'></div>";
							$damageClass = " class='element-arc'"; 
							break;
					case 'PERK_THERMAL_DAMAGE': $damageIcon = "<div class='element-image'></div>";
							$damageClass = " class='element-fire'"; 
							break;
					case 'PERK_VOID_DAMAGE': $damageIcon = "<div class='element-image'></div>";
							$damageClass = " class='element-void'"; 
							break;
				}
				if ($damageIcon != "") {
					break;
				}
			}
		} ?>
		<h2<?=$damageClass?>><?=$damageIcon.$this->info['stats']['368428387']['value']?>
			<span><?=$this->defs['stats']['368428387']['statName']?></span>
		</h2>
		<i><?=@$this->info['itemDescription']?></i>
		<hr/>
		<?php $count = 0;
		foreach($this->info['stats'] as $hash => $stat) { 
			if ($hash != "368428387" && $hash != "3555269338" && $hash != "3871231066" &&
				$hash != "1931675084" && $hash != "943549884" && $hash != "1345609583" &&
				$hash != "2715839340" && $count < 5) { ?>
		<div class="stat" id="<?=(string)$this->info['itemHash']."-".(string)$hash?>">
			<span><?=$this->defs['stats'][(string)$hash]['statName']?></span>
			<div class="stat-bar">
				<div style="width:<?=$stat['value']?>%"></div>
			</div>
			<small><?=$stat['value']?></small>
		</div>
		<?php $count++;
			} 
		}
		$stat = $this->info['stats']['3871231066']; ?>
		<div class="stat">
			<span><?=$this->defs['stats']['3871231066']['statName']?></span>
			<small class="stat-text"><?=$stat['value']?></small>
		</div>
		<?php
	}

	private function display_armor() { 
		if (count($this->info['stats']) > 0) { 
			if (array_key_exists('2391494160', $this->info['stats']) && $this->info['stats']['2391494160']['value'] > 0) { ?>
		<h3 class="prestige pull-right"><?=$this->info['stats']['2391494160']['value']?></h3>
		<?php } ?>
		<h2><?=$this->info['stats']['3897883278']['value']?>
			<span><?=$this->defs['stats']['3897883278']['statName']?></span>
		</h2>
		<?php } ?>
		<i><?=@$this->info['itemDescription']?></i>
		<?php if (count($this->info['stats']) > 0) { 
			$stats = array();
			foreach($this->info['stats'] as $index => $stat) {
				$hash = $stat['statHash'];
				if (($hash == "1735777505" || $hash == "144602215" || $hash == "4244567218") && $stat['value'] > 0) {
					array_push($stats, $hash);
				}
			} 
			if (!empty($stats)) { ?>
			<hr/><commit_msg>- Made the cards display fixed generic values for collection items - Removed Intelligence, Discipline and Strength stats from collection armors (imprecise)<commit_after><?php

class ItemCollectionCard extends ItemCard {

	private $normalizedValue = array(
		"attack" => 331,
		"defense" => array(
			"helmet" => 447,
			"gauntlets" => 366,
			"chest" => 488,
			"legs" => 325,
		),
		"light" => 36,
);

	private $has;
	private $nodes;

	public function __construct($data, $has, $lang) {
		$this->data = $data;
		@$this->info = json_decode(json_encode($data->data->inventoryItem), true);
		@$this->defs = json_decode(json_encode($data->definitions), true);
		@$this->nodes = $data->data->talentGrid->nodes;
		$this->has = $has;
		$this->lang = $lang;
	}

	private function display_weapon() { 
		foreach($this->defs['perks'] as $node) {
			$damageIcon = ""; $damageClass = "";
			if (array_key_exists('perkIdentifier', $node)) {
				switch($node['perkIdentifier']) {
					case 'PERK_ARC_DAMAGE': $damageIcon = "<div class='element-image'></div>";
							$damageClass = " class='element-arc'"; 
							break;
					case 'PERK_THERMAL_DAMAGE': $damageIcon = "<div class='element-image'></div>";
							$damageClass = " class='element-fire'"; 
							break;
					case 'PERK_VOID_DAMAGE': $damageIcon = "<div class='element-image'></div>";
							$damageClass = " class='element-void'"; 
							break;
				}
				if ($damageIcon != "") {
					break;
				}
			}
		} ?>
		<h2<?=$damageClass?>><?=$damageIcon.$this->normalizedValue['attack']?>
			<span><?=$this->defs['stats']['368428387']['statName']?></span>
		</h2>
		<i><?=@$this->info['itemDescription']?></i>
		<hr/>
		<?php $count = 0;
		foreach($this->info['stats'] as $hash => $stat) { 
			if ($hash != "368428387" && $hash != "3555269338" && $hash != "3871231066" &&
				$hash != "1931675084" && $hash != "943549884" && $hash != "1345609583" &&
				$hash != "2715839340" && $count < 5) { ?>
		<div class="stat" id="<?=(string)$this->info['itemHash']."-".(string)$hash?>">
			<span><?=$this->defs['stats'][(string)$hash]['statName']?></span>
			<div class="stat-bar">
				<div style="width:<?=$stat['value']?>%"></div>
			</div>
			<small><?=$stat['value']?></small>
		</div>
		<?php $count++;
			} 
		}
		$stat = $this->info['stats']['3871231066']; ?>
		<div class="stat">
			<span><?=$this->defs['stats']['3871231066']['statName']?></span>
			<small class="stat-text"><?=$stat['value']?></small>
		</div>
		<?php
	}

	private function display_armor() { 
		if (count($this->info['stats']) > 0) { 
			/*if (array_key_exists('2391494160', $this->info['stats']) && $this->info['stats']['2391494160']['value'] > 0) {*/ ?>
		<h3 class="prestige pull-right"><?=$this->normalizedValue['light']?></h3>
		<?php /*}*/ switch ($this->info['bucketTypeHash']) {
			case "3448274439": $defense = $this->normalizedValue['defense']['helmet']; break;
			case "3551918588": $defense = $this->normalizedValue['defense']['gauntlets']; break;
			case "14239492": $defense = $this->normalizedValue['defense']['chest']; break;
			case "20886954": $defense = $this->normalizedValue['defense']['legs']; break;
		}

		?>
		<h2><?=$this->info['stats']['3897883278']['value']?>
			<span><?=$this->defs['stats']['3897883278']['statName']?></span>
		</h2>
		<?php } ?>
		<i><?=@$this->info['itemDescription']?></i>
		<?php if (count($this->info['stats']) > 0) { 
			$stats = array();
			foreach($this->info['stats'] as $index => $stat) {
				$hash = $stat['statHash'];
				if (($hash == "1735777505" || $hash == "144602215" || $hash == "4244567218") && $stat['value'] > 0) {
					array_push($stats, $hash);
				}
			} 
			if (false && !empty($stats)) { ?>
			<hr/>
{'fraction_non_alphanumeric': 0.26024313372354796, 'fraction_numerical': 0.06423532943118715, 'mean_word_length': 4.33546837469976, 'pattern_counts': {'":': 4, '<': 123, '<?xml version=': 0, '>': 205, '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': '5804024', 'n_tokens_mistral': 3059, 'n_tokens_neox': 2478, 'n_words': 387}