imagettftext($image, 14, 0, 725, intval(696), $noir, $font, $temp); if ($aventurier->PR_MAX == 0) { imagettftext($image, 12, 0, 705, 723, $noir, $font, "pas de limite"); } else { imagettftext($image, 12, 0, 710, 723, $noir, $font, "max : " . $aventurier->PR_MAX); } //MAGIEPHYS if ($aventurier->MAGIEPHYS != 0) { imagettftext($image, $fontSize, 0, 388, 281, $noir, $font, $aventurier->MAGIEPHYS); } //MAGIEPSY if ($aventurier->MAGIEPSY != 0) { imagettftext($image, $fontSize, 0, 548, 281, $noir, $font, $aventurier->MAGIEPSY); } $nbr = 0; $competencesLiees = fusionneCompetencesSansDoublons($aventurier->ORIGINE->COMPETENCESLIEES, $aventurier->METIER->COMPETENCESLIEES); foreach ($aventurier->competences as $competence) { $string = $competence->NOM; if (!in_array($competence, $competencesLiees)) { $string = "*" . $string; } $font_size_temp = $fontSize; $dimensions = imagettfbbox($font_size_temp, 0, $font, $string); $lineWidth = $dimensions[2] - $dimensions[0]; while (($lineWidth = $dimensions[2] - $dimensions[0]) > 160) { $font_size_temp = $font_size_temp - 0.2; $dimensions = imagettfbbox($font_size_temp, 0, $font, $string); $lineWidth = $dimensions[2] - $dimensions[0]; } imagettftext($image, $font_size_temp, 0, 10, 748 + $nbr * 21.3, $noir, $font, $string); $nbr++;
public function determineCompetences() { if ($this->METIER != "" && $this->ORIGINE != "") { if ($this->METIER->ID == 99) { $this->COMPETENCESLIEES = $this->METIER->COMPETENCESLIEES; } else { $this->COMPETENCESLIEES = fusionneCompetencesSansDoublons($this->METIER->COMPETENCESLIEES, $this->ORIGINE->COMPETENCESLIEES); } } if (empty($this->ID)) { return; } $db = DatabaseManager::getDb(); $requete = "SELECT * FROM lien_aventurier_competence WHERE ID_AVENTURIER = " . $this->ID; $stmt = $db->prepare($requete); $stmt->execute(); $this->COMPETENCESCHOISIES = array(); while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) { $comp = new Competence(); $this->COMPETENCESCHOISIES[] = $comp; } $this->competences = fusionneCompetencesSansDoublons($this->COMPETENCESCHOISIES, $this->COMPETENCESLIEES); }
$aventurier = unserialize($_SESSION["birdibeuk_aventurier"]); $aventurier->NOM = $_GET["nom"]; $aventurier->SEXE = $_GET["sexe"]; $aventurier->NIVEAU = 1; $aventurier->XP = 0; $aventurier->ID_ORIGINE = $_GET["origine"]; $aventurier->ID_METIER = $_GET["metier"]; //Calcul des EV, EA, etc... $aventurier->determineCaracs(); $aventurier->determineCompetences(); $_SESSION["birdibeuk_aventurier"] = serialize($aventurier); $competencesLiees = fusionneCompetencesSansDoublons($aventurier->METIER->COMPETENCESLIEES, $aventurier->ORIGINE->COMPETENCESLIEES); if ($aventurier->ORIGINE->NOM == "Humain" && $aventurier->METIER->NOM == "Aucun") { $competencesAChoisir = getCompetencesAChoisirPourHumainSansProfession(); } else { $competencesAChoisir = fusionneCompetencesSansDoublons($aventurier->METIER->COMPETENCESACHOISIR, $aventurier->ORIGINE->COMPETENCESACHOISIR); } $competencesAChoisir = TableauExclusionCompetence($competencesAChoisir, $competencesLiees); include "view/nouvelAventurierCompetences.php"; break; case 2: $aventurier = unserialize($_SESSION["birdibeuk_aventurier"]); if (isset($_GET["COU"]) && isset($_GET["INT"]) && isset($_GET["CHA"]) && isset($_GET["AD"]) && isset($_GET["FO"])) { $aventurier->COU = $_GET["COU"]; $aventurier->INT = $_GET["INT"]; $aventurier->FO = $_GET["FO"]; $aventurier->CHA = $_GET["CHA"]; $aventurier->AD = $_GET["AD"]; $_SESSION["birdibeuk_aventurier"] = serialize($aventurier); $listeOrigines = Origine::getOriginesPossibles($aventurier->COU, $aventurier->CHA, $aventurier->INT, $aventurier->AD, $aventurier->FO); $listeMetiers = Metier::getMetiersPossibles($aventurier->COU, $aventurier->CHA, $aventurier->INT, $aventurier->AD, $aventurier->FO);