if ($target->feld[$i]->bauzeit == 0) { echo '<td><img src="images/buildings/', $bild, '" border="0" onmouseover="Tip(', $target->feld[$i]->aktiv > 0 ? $mouse . 'online' : $mouse . 'offline', ')" onmouseout="UnTip()" /></td>'; } if ($target->feld[$i]->bauzeit > 0) { echo '<td><img src="images/buildings/', $bild, '" border="0" onmouseover="Tip(\'', $mouse, ' | Fertig in ', $target->feld[$i]->bauzeit, ' Ticks \')" onmouseout="UnTip()" /></td>'; } } if ($i % 10 == 0 && $oflaeche == 50) { echo '</tr>'; } if ($i % 6 == 0 && $oflaeche == 24) { echo '</tr>'; } } echo '</table><hr />'; echo '<br /><table class="bordered2">'; $inhalt = array("rohstoffa", "rohstoffb", "rohstoffc", "rohstoffd", "isochips", "tritanium", "dili", "antimaterie", "deuterium", "npcborg", "npcrom", "npcfer", "npcfod", "npckling", "npccard"); $inhaltcap = array("Baustoff", "Duranium", "Erz", "Sorium", "Isochips", "Tritanium", "Dilithium", "Antimaterie", "Deuterium", "Vinkulum", "Ale", "Latinum", "Château Picard", "Blutwein", "Taspar Eier"); $inhaltimg = array("baustoff.png", "duranium.png", "erz.png", "sorium.png", "isochips.png", "tritanium.png", "dili.png", "antimaterie.png", "deuterium.png", "vinkulum.png", "ale.png", "latinum.png", "chateau.png", "blutwein.png", "eier.png"); for ($i = 0; $i < sizeof($inhalt); $i++) { if ($target->{$inhalt}[$i] > 0) { echo '<tr><td>', $inhaltcap[$i], '</td><td><img src="images/misc/', $inhaltimg[$i], '" border="0" /></td><td>', $target->{$inhalt}[$i], '</td></tr>'; } } echo '</table>'; echo '<br /><br />'; $but = new Button("schiffe.php?sid=" . $sid, "zurück zum Schiff"); $but->printme(); } } include "foot.php";
} if ($schiff->alarmstufe == 'red' && $alarmcheck === false) { echo '<img src="images/misc/alarmrg.png" border="0" />'; } else { echo '<a href="flotte.php?fid=', $fid, '&do=6r"><img src="images/misc/alarmrk.png" border="0" /></a>'; } echo '<br />'; echo '<br />'; $bu = new Button("flotte.php?do=3&fid=" . $fid, "Schilde aktivieren"); $bu->printme(); echo '<br />'; $bu = new Button("flotte.php?do=4&fid=" . $fid, "Schilde deaktivieren"); $bu->printme(); echo '<br /><br />'; $bu = new Button("flotte.php?do=5&fid=" . $fid, "Energie verteilen"); $bu->printme(); echo '</td><td style="vertical-align:top;"><table class="bordered">'; $nebel = false; $gegnerab = mysql_query("SELECT * FROM schiffe WHERE x='" . $schiff->position->x . "' AND y='" . $schiff->position->y . "' AND orbit='" . $schiff->position->orbit . "' AND typ='b'"); while ($gegner = mysql_fetch_array($gegnerab)) { $nebel = true; } //deutbool for ($po = 0; $po < sizeof($schiffe); $po++) { $pruf = new Schiffe($schiffe[$po]); if ($pruf->skill->deuterium == 1) { $deutbool = true; } if ($pruf->skill->erz == 1) { $erzbool = true; }
public function navigieren($richtung, $flotte, $test) { if ($this->position->orbit == 1 && $richtung != 'v') { return 1; } if ($this->flotte > 0 && $flotte === false) { return 3; } if ($this->gondeln >= $this->maxgondeln) { return 4; } if ($this->dock > 0) { return 21; } //ENERGIEBEHANDLUNG $grundbetrag = $this->position->system->id == 0 ? 1 : 0.2; $grundbetrag = $grundbetrag * $this->flugkosten; //erzeuge alle 4 Felder oben unten links rechts $feldoben = new Weltraum($this->position->x, $this->position->y - 1, $this->position->system->id, $this->position->system->id > 0); $feldunten = new Weltraum($this->position->x, $this->position->y + 1, $this->position->system->id, $this->position->system->id > 0); $feldlinks = new Weltraum($this->position->x - 1, $this->position->y, $this->position->system->id, $this->position->system->id > 0); $feldrechts = new Weltraum($this->position->x + 1, $this->position->y, $this->position->system->id, $this->position->system->id > 0); //abhandlungen //auswahl switchvar if ($richtung == 'o') { $switchvar = $feldoben; } if ($richtung == 'u') { $switchvar = $feldunten; } if ($richtung == 'l') { $switchvar = $feldlinks; } if ($richtung == 'r') { $switchvar = $feldrechts; } $need = 0; if ($richtung == 'o' || $richtung == 'l' || $richtung == 'u' || $richtung == 'r') { $need = $grundbetrag * $switchvar->feld->einflugkosten; } if (!isset($need)) { $need = $grundbetrag; } if (!$switchvar->feld->passierbar && isset($switchvar)) { echo '<span class="error">Nicht passierbar!</span><br />'; return "-1"; } //ENERGIEBEHANDLUNG if ($this->energie < $need) { echo '<span class="error">Es werden ', $need, ' Energie benötigt um in das Feld einzufliegen!</span><br />'; return "-1"; } if ($test == 0) { if ($richtung == 'o' && $this->position->y > 1) { $this->position->y--; $this->energie -= $need; $this->gondeln++; } if ($richtung == 'l' && $this->position->x > 1) { $this->position->x--; $this->energie -= $need; $this->gondeln++; } if ($richtung == 'u' && ($this->position->y < 20 && $this->position->system > 0 || $this->position->system->id == 0)) { $this->position->y++; $this->energie -= $need; $this->gondeln++; } if ($richtung == 'r' && ($this->position->x < 20 && $this->position->system > 0 || $this->position->system->id == 0)) { $this->position->x++; $this->energie -= $need; $this->gondeln++; } if ($richtung == 'v') { $this->position->orbit = $this->position->orbit == 1 ? 0 : 1; $this->energie -= $need; $this->gondeln++; } if ($richtung == 's') { if ($this->position->orbit == 1) { return 1; } $erledigt = false; if ($this->position->system->id == 0 && !$erledigt) { $abfrage = mysql_query("SELECT * FROM systeme WHERE x='" . $this->position->x . "' AND y='" . $this->position->y . "' LIMIT 1"); while ($row = mysql_fetch_array($abfrage)) { $this->energie -= $need; $this->position->system = new System($row["id"]); $this->gondeln++; //Flottenpruefung if ($flotte === true) { $fx = 0; $fy = 0; $testvar1 = mysql_query("SELECT * FROM schiffe WHERE flotte='" . $this->flotte . "' AND id!='" . $this->id . "' AND system='" . $row["id"] . "' LIMIT 1"); while ($testrow1 = mysql_fetch_array($testvar1)) { $fx = $testrow1["x"]; $fy = $testrow1["y"]; } } if ($fx == 0 && $fy == 0) { $flyin = $this->einflugkoordinaten(); $this->position->x = $flyin[0]; $this->position->y = $flyin[1]; } else { $this->position->x = $fx; $this->position->y = $fy; } $erledigt = true; } } if ($this->position->system->id > 0 && !$erledigt) { $this->gondeln++; $this->energie -= $need; $this->position->x = $this->position->system->x; $this->position->y = $this->position->system->y; $this->position->system = new System('0'); $this->position->system->id = 0; $erledigt = true; } } mysql_query("UPDATE schiffe SET gondeln='" . $this->gondeln . "',energie='" . $this->energie . "',system='" . $this->position->system->id . "',x=" . $this->position->x . ",y=" . $this->position->y . ",orbit=" . $this->position->orbit . " WHERE id='{$this->id}'") or die(mysql_error()); mysql_query("UPDATE counter SET count=count+1 WHERE id=1") or die(mysql_error()); /* $abfrage2=mysql_query("SELECT * FROM schiffe WHERE id!='$this->id' AND system='".$this->position->system->id."' AND x=".$this->position->x." AND y=".$this->position->y." AND orbit=".$this->position->orbit); while($row2=mysql_fetch_array($abfrage2)) { $eintrag=new Logbuch("typ","neu"); $eintrag->x=$this->position->x; $eintrag->y=$this->position->y; $eintrag->zeit=date("Y-m-d H:i:s"); $eintrag->system=$this->position->system->id; $eintrag->typ="Bewegung"; $eintrag->klasse="Eingang"; $eintrag->text="Einflug des Schiffes ".$this->name." (".$this->id.")"; $eintrag->initiator=$this->besitzer->id; $eintrag->betroffener=$row2["besitzer"]; $eintrag->save(); } //Horchposten /* $lovevar=$_SESSION["Id"]; $horcharray=array(); $horchquery=mysql_query("SELECT * FROM schiffe WHERE besitzer!='$lovevar' AND klasse='Horchposten' AND x>=".($this->position->x-5)." AND x<= ".($this->position->x+5) ." AND y>= ".($this->position->y-5) ." AND y<=".($this->position->y+5)); while($treffer=mysql_fetch_array($horchquery)) array_push($horcharray,$treffer["id"]); $datum=date("Y-m-d H:i:s"); for($a=0;$a<sizeof($horcharray);$a++) { $ich=$horcharray[$a]; mysql_query("INSERT INTO horchlog (datum,img,besitzer,klasse,ich,x,y) VALUES ('$datum','$schiff->img','$schiff->besitzer','$schiff->klasse','$ich','$schiff->x','$schiff->y')") or die(mysql_error()); } $abfrage=mysql_query("SELECT * FROM weltraum WHERE (typ='b' OR typ='rs' OR typ='bs') AND x=".$this->position->x." AND y=".$this->position->y." AND system=".$this->position->system->id); while($tmp=mysql_fetch_array($abfrage)) $nebel=true; $sonnenquery=mysql_query("SELECT * FROM weltraum WHERE (typ='p' OR typ='x' OR typ='r1' OR typ='r2' OR typ='r3' OR typ='r4') AND system=".$this->position->system->id." AND x=".$this->position->x." AND y=".$this->position->y); while($sonne=mysql_fetch_array($sonnenquery)) { echo 'Dein Schiff wurde zerstört!'; $this->zerstoerung(); } mysql_query("UPDATE schiffe SET schildstatus='$this->schildstatus',energie='$this->energie',phaser='$this->phaser',gondeln='$this->gondeln',schilde='$this->schilde' WHERE id='$this->id'"); */ if (!$flotte) { $this->kampftick("0", null); } if (isset($switchvar) && $switchvar->feld->hide && $this->schildstatus == 1) { $this->schildstatus = 0; mysql_query("update schiffe set schildstatus=0 where id=" . $this->id); echo "<span class=\"error\">Du bist in " . $switchvar->name . " eingeflogen: Schilde ausgefallen.</span>"; } if (isset($switchvar) && $switchvar->feld->deadly) { if ($this->besitzer->level == 5) { echo "Du bist in " . $switchvar->name . " eingeflogen. Dein Schiff wurde zerstört, zerquetscht und zermalmt.<br /><br />"; $this->zerstoerung(); $bu = new Button("schiffchoice.php", "zur Schiffsübersicht"); $bu->printme(); die; } else { echo "<span class=\"error\">Normalerweise wäre dein Schiff jetzt zerstört, da du aber noch nicht Level 5 erreicht hast, werden dem Schiff nur 20% der aktuellen Energie abgezogen</span>"; $this->energie = floor($this->energie * 0.2 * 100) / 100; mysql_query("update schiffe set energie=" . $this->energie . " where id=" . $this->id); } } } return 0; }