fix some hero problems

This commit is contained in:
unknown
2012-05-20 16:50:12 +03:00
parent 5d82ddb51a
commit 04eee11d75
8 changed files with 47 additions and 10 deletions
+7 -3
View File
@@ -978,8 +978,12 @@ class Automation {
$notlife1 = $dead[$start]+$dead[$start+1]+$dead[$start+2]+$dead[$start+3]+$dead[$start+4]+$dead[$start+5]+$dead[$start+6]+$dead[$start+7]+$dead[$start+8]+$dead[$start+9];
$life= ''.$enforce['u'.$start.''].','.$enforce['u'.($start+1).''].','.$enforce['u'.($start+2).''].','.$enforce['u'.($start+3).''].','.$enforce['u'.($start+4).''].','.$enforce['u'.($start+5).''].','.$enforce['u'.($start+6).''].','.$enforce['u'.($start+7).''].','.$enforce['u'.($start+8).''].','.$enforce['u'.($start+9).''].'';
$life1 = $enforce['u'.$start.'']+$enforce['u'.($start+1).'']+$enforce['u'.($start+2).'']+$enforce['u'.($start+3).'']+$enforce['u'.($start+4).'']+$enforce['u'.($start+5).'']+$enforce['u'.($start+6).'']+$enforce['u'.($start+7).'']+$enforce['u'.($start+8).'']+$enforce['u'.($start+9).''];
$lifehero = $enforce['hero'];
$notlifehero = $dead['hero'];
$totallife = $enforce['hero']+$life1;
$totalnotlife = $dead['hero']+$notlife1;
//NEED TO SEND A RAPPORTAGE!!!
$data2 = ''.$database->getVillageField($enforce['from'],"owner").','.$to['wref'].','.addslashes($to['name']).','.$tribe.','.$life.','.$notlife.'';
$data2 = ''.$database->getVillageField($enforce['from'],"owner").','.$to['wref'].','.addslashes($to['name']).','.$tribe.','.$life.','.$notlife.','.$lifehero.','.$notlifehero.'';
if($scout){
for($i=1;$i<=10;$i++)
{
@@ -992,9 +996,9 @@ class Automation {
}
}
}else{
if($notlife == 0){
if($totalnotlife == 0){
$database->addNotice($database->getVillageField($enforce['from'],"owner"),$from['wref'],$ownally,15,'Reinforcement in '.addslashes($to['name']).' was attacked',$data2,$AttackArrivalTime);
}else if($life1 > $notlife1){
}else if($totallife > $totalnotlife){
$database->addNotice($database->getVillageField($enforce['from'],"owner"),$from['wref'],$ownally,16,'Reinforcement in '.addslashes($to['name']).' was attacked',$data2,$AttackArrivalTime);
}else{
$database->addNotice($database->getVillageField($enforce['from'],"owner"),$from['wref'],$ownally,17,'Reinforcement in '.addslashes($to['name']).' was attacked',$data2,$AttackArrivalTime);
+12 -1
View File
@@ -1,6 +1,7 @@
<?php
//reinforcement is underattack
$dataarray = explode(",",$message->readingNotice['data']);
if(isset($dataarray[24]) and $dataarray[24]!=0){$colspan="11";}else{$colspan="10";}
?>
<table cellpadding="1" cellspacing="1" id="report_surround">
<thead>
@@ -22,7 +23,7 @@ $dataarray = explode(",",$message->readingNotice['data']);
<table cellpadding="1" cellspacing="1" class="defender"><thead>
<tr>
<td class="role">Defender</td>
<td colspan="10"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[0],"id",0); ?>"><?php echo $database->getUserField($dataarray[0],"username",0); ?></a> in the village <a href="karte.php?d=<?php echo $dataarray[1]."&amp;c=".$generator->getMapCheck($dataarray[1]); ?>"><?php echo $database->getVillageField($dataarray[1],"name"); ?></a></td>
<td colspan="<?php echo $colspan ?>"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[0],"id",0); ?>"><?php echo $database->getUserField($dataarray[0],"username",0); ?></a> in the village <a href="karte.php?d=<?php echo $dataarray[1]."&amp;c=".$generator->getMapCheck($dataarray[1]); ?>"><?php echo $database->getVillageField($dataarray[1],"name"); ?></a></td>
</tr>
</thead>
<tbody class="units">
@@ -34,6 +35,9 @@ $start = ($tribe-1)*10+1;
for($i=$start;$i<=($start+9);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=4;$i<=13;$i++) {
if($dataarray[$i] == 0) {
@@ -43,6 +47,9 @@ for($i=4;$i<=13;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
echo "<td>$dataarray[24]</td>";
}
echo "<tr><th>Casualties</th>";
for($i=14;$i<=23;$i++) {
if($dataarray[$i] == 0) {
@@ -52,6 +59,10 @@ for($i=14;$i<=23;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
if ($dataarray[25]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[25]</td>";
}
?>
</tr></tbody>
</table>
+12 -1
View File
@@ -1,6 +1,7 @@
<?php
//reinforcement is underattack
$dataarray = explode(",",$message->readingNotice['data']);
if(isset($dataarray[24]) and $dataarray[24]!=0){$colspan="11";}else{$colspan="10";}
?>
<table cellpadding="1" cellspacing="1" id="report_surround">
<thead>
@@ -22,7 +23,7 @@ $dataarray = explode(",",$message->readingNotice['data']);
<table cellpadding="1" cellspacing="1" class="defender"><thead>
<tr>
<td class="role">Defender</td>
<td colspan="10"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[0],"id",0); ?>"><?php echo $database->getUserField($dataarray[0],"username",0); ?></a> in the village <a href="karte.php?d=<?php echo $dataarray[1]."&amp;c=".$generator->getMapCheck($dataarray[1]); ?>"><?php echo $database->getVillageField($dataarray[1],"name"); ?></a></td>
<td colspan="<?php echo $colspan ?>"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[0],"id",0); ?>"><?php echo $database->getUserField($dataarray[0],"username",0); ?></a> in the village <a href="karte.php?d=<?php echo $dataarray[1]."&amp;c=".$generator->getMapCheck($dataarray[1]); ?>"><?php echo $database->getVillageField($dataarray[1],"name"); ?></a></td>
</tr>
</thead>
<tbody class="units">
@@ -34,6 +35,9 @@ $start = ($tribe-1)*10+1;
for($i=$start;$i<=($start+9);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=4;$i<=13;$i++) {
if($dataarray[$i] == 0) {
@@ -43,6 +47,9 @@ for($i=4;$i<=13;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
echo "<td>$dataarray[24]</td>";
}
echo "<tr><th>Casualties</th>";
for($i=14;$i<=23;$i++) {
if($dataarray[$i] == 0) {
@@ -52,6 +59,10 @@ for($i=14;$i<=23;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
if ($dataarray[25]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[25]</td>";
}
?>
</tr></tbody>
</table>
+12 -1
View File
@@ -1,6 +1,7 @@
<?php
//reinforcement is underattack
$dataarray = explode(",",$message->readingNotice['data']);
if(isset($dataarray[24]) and $dataarray[24]!=0){$colspan="11";}else{$colspan="10";}
?>
<table cellpadding="1" cellspacing="1" id="report_surround">
<thead>
@@ -22,7 +23,7 @@ $dataarray = explode(",",$message->readingNotice['data']);
<table cellpadding="1" cellspacing="1" class="defender"><thead>
<tr>
<td class="role">Defender</td>
<td colspan="10"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[0],"id",0); ?>"><?php echo $database->getUserField($dataarray[0],"username",0); ?></a> in the village <a href="karte.php?d=<?php echo $dataarray[1]."&amp;c=".$generator->getMapCheck($dataarray[1]); ?>"><?php echo $database->getVillageField($dataarray[1],"name"); ?></a></td>
<td colspan="<?php echo $colspan ?>"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[0],"id",0); ?>"><?php echo $database->getUserField($dataarray[0],"username",0); ?></a> in the village <a href="karte.php?d=<?php echo $dataarray[1]."&amp;c=".$generator->getMapCheck($dataarray[1]); ?>"><?php echo $database->getVillageField($dataarray[1],"name"); ?></a></td>
</tr>
</thead>
<tbody class="units">
@@ -34,6 +35,9 @@ $start = ($tribe-1)*10+1;
for($i=$start;$i<=($start+9);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=4;$i<=13;$i++) {
if($dataarray[$i] == 0) {
@@ -43,6 +47,9 @@ for($i=4;$i<=13;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
echo "<td>$dataarray[24]</td>";
}
echo "<tr><th>Casualties</th>";
for($i=14;$i<=23;$i++) {
if($dataarray[$i] == 0) {
@@ -52,6 +59,10 @@ for($i=14;$i<=23;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[24]) and $dataarray[24]!=0){
if ($dataarray[25]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[25]</td>";
}
?>
</tr></tbody>
</table>
+1 -1
View File
@@ -106,7 +106,7 @@ $tocoor = $database->getCoor($enforce['vref']);
echo"<span class=\"none\">(".$enforce['u6'].")</span></td>";
if($enforce['hero']>0){
?>
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="hero" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="t11" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['hero'].")</span></td>";
}
+1 -1
View File
@@ -106,7 +106,7 @@ $tocoor = $database->getCoor($enforce['vref']);
echo"<span class=\"none\">(".$enforce['u26'].")</span></td>";
if($enforce['hero']>0){
?>
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="hero" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="t11" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['hero'].")</span></td>";
}
+1 -1
View File
@@ -107,7 +107,7 @@ $tocoor = $database->getCoor($enforce['vref']);
echo"<span class=\"none\">(".$enforce['u36'].")</span></td>";
if($enforce['hero']>0){
?>
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="hero" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="t11" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['hero'].")</span></td>";
}
+1 -1
View File
@@ -105,7 +105,7 @@ $tocoor = $database->getCoor($enforce['vref']);
echo"<span class=\"none\">(".$enforce['u6'].")</span></td>";
if($enforce['hero']>0){
?>
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="hero" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<td class="line-last large"><img class="unit uhero" src="img/x.gif" title="Hero" alt="Hero"> <input class="text" name="t11" value="<?php echo $enforce['hero']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['hero'].")</span></td>";
}