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
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Nigel Sheldon 2021-01-01 14:27:52 +01:00 committed by Gitea
parent aed31bcfc8
commit dcb0eaf50d
1 changed files with 6 additions and 0 deletions

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);