forked from halo-battle/game
Version 1.8
This commit is contained in:
parent
aea537909a
commit
5f81f76b17
184 changed files with 78335 additions and 736 deletions
|
|
@ -54,7 +54,7 @@ class Combat {
|
|||
if ($j == 0) $groupe[] = array($nbvaispgroupe + $nbrest, $nomvais_bc[$i-1] * (1 + $tableTechno[0]/10), $nomvais_pv[$i-1]);
|
||||
else $groupe[] = array($nbvaispgroupe, $nomvais_bc[$i-1] * (1 + $tableTechno[0]/10), $nomvais_pv[$i-1]);
|
||||
}
|
||||
$this->ATvais[] = array($i, $flotteAT['vaisseau_'.$i], $nbgroupes, $groupe);
|
||||
$this->ATvais[] = array($i, $flotteAT['vaisseau_'.$i], $nbgroupes, $groupe, $nomvais_initiative[$i-1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ class Combat {
|
|||
if ($j == 0) $groupe[] = array($nbvaispgroupe + $nbrest, $nomvais_bc[$i-1] * (1 + $tableTechno[1]/10), $nomvais_pv[$i-1]);
|
||||
else $groupe[] = array($nbvaispgroupe, $nomvais_bc[$i-1] * (1 + $tableTechno[1]/10), $nomvais_pv[$i-1]);
|
||||
}
|
||||
$this->ENvais[] = array($i, $flotteEN['vaisseau_'.$i], $nbgroupes, $groupe);
|
||||
$this->ENvais[] = array($i, $flotteEN['vaisseau_'.$i], $nbgroupes, $groupe, $nomvais_initiative[$i-1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ class Combat {
|
|||
if ($j == 0) $groupe[] = array($nbvaispgroupe + $nbrest, $defense_bc[$i-1] * (1 + $tableTechno[1]/10), $defense_pv[$i-1]);
|
||||
else $groupe[] = array($nbvaispgroupe, $defense_bc[$i-1] * (1 + $tableTechno[1]/10), $defense_pv[$i-1]);
|
||||
}
|
||||
$this->ENdef[] = array($i, $defEN['def_'.$i], $nbgroupes, $groupe);
|
||||
$this->ENdef[] = array($i, $defEN['def_'.$i], $nbgroupes, $groupe, $defense_initiative[$i-1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -270,6 +270,7 @@ class Combat {
|
|||
$vaisEff = array();
|
||||
$nbvais = 0;
|
||||
$countj = count($this->ENvais);
|
||||
$countd = count($this->ENdef);
|
||||
for ($i=0 ; $i<$countj ; $i++) {
|
||||
$nbvais += $this->ENvais[$i][1];
|
||||
}
|
||||
|
|
@ -280,10 +281,15 @@ class Combat {
|
|||
$puissance = 0;
|
||||
$count = count($this->ATvais);
|
||||
for ($i=0 ; $i<$count ; $i++) {
|
||||
if ($this->ATvais[$i][4] > $this->Ntour) continue;
|
||||
|
||||
$bonus = 0;
|
||||
for ($j=0 ; $j<$countj ; $j++) {
|
||||
$bonus += $nomvais_rf[$this->ATvais[$i][0]-1][$this->ENvais[$i][0]-1] * $vaisEff[$this->ENvais[$i][0]];
|
||||
}
|
||||
for ($j=0 ; $j<$countd ; $j++) {
|
||||
$bonus += 1/$countd;
|
||||
}
|
||||
$maxat = $nomvais_at[$this->ATvais[$i][0]-1] * (1 + $armement/10);
|
||||
$puissance += $maxat * $pourcentage/100 * $this->ATvais[$i][1] * $bonus;
|
||||
}
|
||||
|
|
@ -304,6 +310,8 @@ class Combat {
|
|||
$puissance = 0;
|
||||
$count = count($this->ENvais);
|
||||
for ($i=0 ; $i<$count ; $i++) {
|
||||
if ($this->ENvais[$i][4] > $this->Ntour) continue;
|
||||
|
||||
$bonus = 0;
|
||||
for ($j=0 ; $j<$countj ; $j++) {
|
||||
$bonus += $nomvais_rf[$this->ENvais[$i][0]-1][$this->ATvais[$i][0]-1] * $vaisEff[$this->ATvais[$i][0]];
|
||||
|
|
@ -315,6 +323,8 @@ class Combat {
|
|||
//Défenses
|
||||
$count = count($this->ENdef);
|
||||
for ($i=0 ; $i<$count ; $i++) {
|
||||
if ($this->ENdef[$i][4] > $this->Ntour) continue;
|
||||
|
||||
$maxat = $defense_at[$this->ENdef[$i][0]-1] * (1 + $armement/10);
|
||||
$puissance += $maxat * $pourcentage/100 * $this->ENdef[$i][1];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ class Rapport{
|
|||
$db->escape($rapportB);
|
||||
$db->escape($utilA);
|
||||
$db->escape($utilB);
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilA', '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilB', '', '$titreB', '$rapportB', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilA, '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilB, '', '$titreB', '$rapportB', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
|
|
@ -139,8 +139,8 @@ class Rapport{
|
|||
$db->escape($utilA);
|
||||
$db->escape($utilB);
|
||||
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilA', '', '$titre', '$rapportA', '$temps')");
|
||||
if ($utilA != $utilB) $db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilB', '', '$titre', '$rapportB', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilA, '', '$titre', '$rapportA', '$temps')");
|
||||
if ($utilA != $utilB) $db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilB, '', '$titre', '$rapportB', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ class Rapport{
|
|||
$db->escape($titre);
|
||||
$db->escape($rapport);
|
||||
$db->escape($utilA);
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilA', '', '$titre', '$rapport', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilA, '', '$titre', '$rapport', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ class Rapport{
|
|||
$db->escape($titre);
|
||||
$db->escape($rapport);
|
||||
$db->escape($utilA);
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilA', '', '$titre', '$rapport', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilA, '', '$titre', '$rapport', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
|
|
@ -283,8 +283,8 @@ class Rapport{
|
|||
$db->escape($rapportB);
|
||||
$db->escape($utilA);
|
||||
$db->escape($utilB);
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilA', '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilB', '', '$titreB', '$rapportB', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilA, '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilB, '', '$titreB', '$rapportB', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ class Rapport{
|
|||
$db->escape($rapportA);
|
||||
$utilA = trouvNom($this->utilA);
|
||||
$db->escape($utilA);
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilA', '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilA, '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ class Rapport{
|
|||
$db->escape($rapportA);
|
||||
$utilA = trouvNom($this->utilA);
|
||||
$db->escape($utilA);
|
||||
$db->query("INSERT INTO ".$this->table." VALUES('', '1', '$utilA', '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, expediteur, sujet, contenu, temps) VALUES($utilA, '', '$titreA', '$rapportA', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue