Le calcul des points c'était n'importe quoi. J'ai simplifié c'est désormais: le nombre de ressources consommées x 0.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Nigel Sheldon 2021-01-01 14:27:52 +01:00
parent 4cda71a337
commit afa97638fa

View File

@ -113,6 +113,7 @@ class User
public function addPoints($metal, $cristal, $hydrogene, $credits = 0, $demolition = false)
{
/* Ancien code, fait des calculs boursier dans le système de points, wtf ?
global $table_bourse_ressources;
//On charge les 3 valeurs boursières
$bdd = new BDD();
@ -129,6 +130,11 @@ class User
$points = bourse_calcPrixBase($bourse[0]["dispo"], $metal);
$points += bourse_calcPrixBase($bourse[1]["dispo"], $cristal);
$points += bourse_calcPrixBase($bourse[2]["dispo"], $hydrogene);
*/
$rate = 0.7;
$points = $metal *$rate;
$points += $cristal *$rate;
$points += $hydrogene *$rate;
if ($demolition) {
$this->points -= intval($points);