You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.8 KiB
74 lines
2.8 KiB
14 years ago
|
<?php
|
||
|
/*
|
||
|
*
|
||
|
* @copyright (c) 2009 animegame.eu
|
||
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/char.inc.php');
|
||
|
|
||
|
//if($chara_1['id']) {
|
||
|
// $arena = mysql_fetch_array(mysql_query("SELECT id, name, ring, platz, lux, preis, level, skill, exp FROM arena WHERE besitzer='$chara_2[besitzer]' LIMIT 1"));
|
||
|
//} else {
|
||
|
// $arena = mysql_fetch_array(mysql_query("SELECT id, name, ring, platz, lux, preis, level, skill, exp FROM arena WHERE besitzer='$user_ida[id]' LIMIT 1"));
|
||
|
//}
|
||
|
//$arena_geld = ($arena['platz'] / 2) + ($arena['ring'] * 3) + ($arena['lux'] * 50);
|
||
|
//$arena_geld /= 4;
|
||
|
//
|
||
|
//$exp1 = explode(",",$arena[exp]);
|
||
|
//$exp1[0] = round($exp1[0]);
|
||
|
//$arena_besucher = ($arena[ring] * 3) + ($arena[lux] * 200);
|
||
|
//if($arena[preis] != 0){
|
||
|
// $arena_besucher = round($arena_besucher / ($arena[preis] / 10));
|
||
|
//} else{
|
||
|
// $arena_besucher = 1;
|
||
|
//}
|
||
|
//if($arena_besucher<0) {
|
||
|
//$arena_besucher = 0;
|
||
|
//}
|
||
|
//
|
||
|
//if($arena_besucher>$arena[platz]) {
|
||
|
//$arena_besucher = $arena[platz];
|
||
|
//}
|
||
|
//
|
||
|
//$arena_einkommen = $arena_besucher * $arena[preis];
|
||
|
|
||
|
function calculateArenaData($owner_id, $char_1, $char_2, $factor){
|
||
|
// echo 'Berechne die Arena-Daten mit Faktor '.$factor;
|
||
|
$lf = 0.7; // Luxus Exponent
|
||
|
$kf_1 = 1/3; // Kampf Exponent a)
|
||
|
$kf_2 = $kf_1 * $kf_1; // Kampf Exponent b)
|
||
|
|
||
|
$arena = mysql_fetch_assoc(mysql_query('SELECT * FROM arena WHERE besitzer = '.$owner_id));
|
||
|
$wert_char1 = max(0.75,min(1.25,$char_1['siege']/($char_1['niederlagen'] + 0.01))) * getPowerLevelWithBuffs($char_1['id']);
|
||
|
$wert_char2 = max(0.75,min(1.25,$char_2['siege']/($char_2['niederlagen'] + 0.01))) * getPowerLevelWithBuffs($char_2['id']);
|
||
|
// Neue Kalkulation :)
|
||
|
$kampf_wert = (pow($wert_char1,$kf_1)+pow($wert_char1,$kf_2))*(pow($wert_char2,$kf_1)+pow($wert_char2,$kf_2));
|
||
|
// Neue Kalkulation :)
|
||
|
$arena_wert = pow($arena['luxus'], $lf)+log($arena['level'],4)+0.5;
|
||
|
|
||
|
$zuschauer = $kampf_wert*$arena_wert*$factor;
|
||
|
$z_loge = floor(0.01*$zuschauer);
|
||
|
$z_sitz = round(0.36*$zuschauer);
|
||
|
$z_steh = round($zuschauer - $z_loge - $z_sitz); // Damit auch ja keiner zu kurz kommt :D
|
||
|
$result['steh'] = $z_steh>$arena['steh']?$arena['steh']:$z_steh;
|
||
|
$result['sitz'] = $z_sitz>$arena['sitz']?$arena['sitz']:$z_sitz;
|
||
|
$result['loge'] = $z_loge>$arena['loge']?$arena['loge']:$z_loge;
|
||
|
$result['steh'] = round($result['steh']*$arena['zustand']);
|
||
|
$result['sitz'] = round($result['sitz']*$arena['zustand']);
|
||
|
$result['loge'] = round($result['loge']*$arena['zustand']);
|
||
|
$result['geld'] = $result['steh'] * 10 + $result['sitz'] * 60 + $result['loge'] * 3000;
|
||
|
$result['id'] = $arena['id'];
|
||
|
return $result;
|
||
|
}
|
||
|
|
||
|
function calculateUnterhaltsKosten($arena){
|
||
|
return $arena['steuerlasten'];
|
||
|
}
|
||
|
|
||
|
function calculateRenovierungsKosten($arena){
|
||
|
return (1-$arena['zustand'])*($arena['steh']*10+$arena['sitz']*150+$arena['loge']*18000);
|
||
|
}
|
||
|
|
||
|
?>
|