mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-18 16:17:20 +00:00
Artifacts fixes part 4
Completely fixed the artifact of the fool and fixed all kind of artifact: +Deleted some useless .tpl files and merged into one (Stable) +The artifact of the fool effect won't be displayed if not active +Fixed a bug that permitted to have a great and a unique artefacts active at the same moment +Big reductions of code in a lot of files +Created some new methods to support artifacts +Fixed a bug that prevented the effect of the "Rivals confusion" to work correctly +Fixed a bug that prevented "The eagles eyes" artifact to work correctly for the attacker +Fixed the artifact of the fool of every kind, now it's calculated with a new method +Fixed the cranny capacity when a "Rivals confusion" artifact is active +Some minor bug fixing , improovements and optimization
This commit is contained in:
+9
-65
@@ -1,83 +1,27 @@
|
||||
<?php
|
||||
include("next.tpl");
|
||||
$artefact_2 = count($database->getOwnUniqueArtefactInfo2($session->uid,7,3,0));
|
||||
$artefact1_2 = count($database->getOwnUniqueArtefactInfo2($village->wid,7,1,1));
|
||||
$artefact2_2 = count($database->getOwnUniqueArtefactInfo2($session->uid,7,2,0));
|
||||
if($artefact_2 > 0){
|
||||
$artefact_bouns = 6;
|
||||
}else if($artefact1_2 > 0){
|
||||
$artefact_bouns = 3;
|
||||
}else if($artefact2_2 > 0){
|
||||
$artefact_bouns = 2;
|
||||
}else{
|
||||
$artefact_bouns = 1;
|
||||
}
|
||||
$good_effect = $bad_effect = 1;
|
||||
$foolartefact = $database->getFoolArtefactInfo(7,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$bad_effect = $arte['effect2'];
|
||||
}else{
|
||||
$good_effect = $arte['effect2'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$multiplier = (($session->tribe == 3) ? 2 : 1) * CRANNY_CAPACITY;
|
||||
$actualLevel = $village->resarray['f'.$id];
|
||||
$level = min($actualLevel + 1 + $loopsame + $doublebuild + $master, 10);
|
||||
?>
|
||||
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
|
||||
<img class="building g23" src="img/x.gif" alt="Cranny" title="<?php echo CRANNY; ?>" />
|
||||
</a>
|
||||
<h1><?php echo CRANNY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo CRANNY_DESC; ?></p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CURRENT_HIDDEN_UNITS; ?></th>
|
||||
<?php
|
||||
if($session->tribe == 3) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*2*CRANNY_CAPACITY; ?></b> <?php echo UNITS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*CRANNY_CAPACITY; ?></b> <?php echo UNITS; ?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><b><?php echo $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$village->resarray['f'.$id]]['attri'] * $multiplier); ?></b> <?php echo UNITS; ?></td>
|
||||
</tr>
|
||||
<?php if($actualLevel < 10){?>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
if($next<=10){
|
||||
?>
|
||||
<th><?php echo HIDDEN_UNITS_LEVEL; ?> <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:</th>
|
||||
<?php
|
||||
if($session->tribe == 3) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> <?php echo UNITS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> <?php echo UNITS; ?></td>
|
||||
<?php
|
||||
}}else{
|
||||
?>
|
||||
<th><?php echo HIDDEN_UNITS_LEVEL; ?> 20:</th>
|
||||
<?php
|
||||
if($session->tribe == 3) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[10]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> <?php echo UNITS; ?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><b><?php echo $bid23[10]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> <?php echo UNITS; ?></td>
|
||||
<?php
|
||||
}}}
|
||||
?>
|
||||
<th><?php echo HIDDEN_UNITS_LEVEL; ?> <?php echo $level; ?>:</th>
|
||||
<td><b><?php echo $database->getArtifactsValueInfluence($session->uid, $village->wid, 7, $bid23[$level]['attri'] * $multiplier); ?></b> <?php echo UNITS; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user