From 84fe500a8ac83724fcbab9a09d708476022ec17e Mon Sep 17 00:00:00 2001 From: radiskull Date: Thu, 13 Oct 2011 16:03:09 +0000 Subject: [PATCH] =?UTF-8?q?erster=20Teil=20f=C3=BCr=20Frontend=20Clanfight?= =?UTF-8?q?s=20(nicht=20fertig!!!)=20Seelenzerst=C3=B6rer=20Bug=20behoben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ag/clan/kampf_info.php | 158 +++++++++++++++++++++++++++++++++++ ag/inclu/user-controll.php | 1 + ag/include/clan.inc.php | 13 ++- ag/include/kampf/lose2.php | 58 +++++++------ ag/include/usergroup.inc.php | 3 +- 5 files changed, 204 insertions(+), 29 deletions(-) create mode 100644 ag/clan/kampf_info.php diff --git a/ag/clan/kampf_info.php b/ag/clan/kampf_info.php new file mode 100644 index 0000000..edacfd6 --- /dev/null +++ b/ag/clan/kampf_info.php @@ -0,0 +1,158 @@ +
'; + echo displayHistoryBackLink(); +} + +function displayDenyChallenge($clan_id) { + if(!is_numeric($clan_id)) { + displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink()); + exit; + } + ?> + + + + + + + + +
Herausforderung wirklich ablehnen?
ja';?>nein';?>
+ +
+ + + + + + + + + + + + + + + '; + } + ?> +
Herausforderungen
Clan herausfordern +
+ +
+
+ + + + + + + + + '; + echo ''; + echo ''; + } + ?> +
HerausfordererDatumTypAnzahlOption
'.$clan['clanname'].''.formatTimestamp($challenge['challenged_time']).''.getFightType($challenge['type']).''.$challenge['anzahl_chars'].'annehmen |'; + echo 'ablehnen
+
offene Herausforderungen
'.$cllng.'
+
\ No newline at end of file diff --git a/ag/inclu/user-controll.php b/ag/inclu/user-controll.php index 9f7ceea..9add7ef 100644 --- a/ag/inclu/user-controll.php +++ b/ag/inclu/user-controll.php @@ -80,6 +80,7 @@ if ($name AND $passwort) { $clan_009 = " Mein Clan
+ Clan Kämpfe
Clan Markt
Clan Item Nutzung
Geld Spenden
diff --git a/ag/include/clan.inc.php b/ag/include/clan.inc.php index c750279..66cf04c 100644 --- a/ag/include/clan.inc.php +++ b/ag/include/clan.inc.php @@ -186,7 +186,18 @@ function fireMember($user, $member){ } } - +/** + * + * Return all Clans with their id and name. + * + */ +function getAllClans() { + $qry = mysql_query('SELECT id,clanname FROM clan;'); + while ($result = mysql_fetch_assoc($qry)) { + $clans[] = $result; + } + return $clans; +} function joinClan($user, $clanid){ // last chance to lock the clan if in the old situation it was having to few members ;) isClanLocked($clanid); // we only require the calculation not the result! diff --git a/ag/include/kampf/lose2.php b/ag/include/kampf/lose2.php index f1c3321..fb262f9 100644 --- a/ag/include/kampf/lose2.php +++ b/ag/include/kampf/lose2.php @@ -9,37 +9,43 @@ ####################KAIOKEN-LOSE SPIELER 1 if($technick1['type'] == 'lose2') { -$k_mp[0] = $k_mp[0] - $technick1['mp']; -if($k_mp[0] < 0) { -$schaden_1 = 'Schwächen fehlgeschlagen'; -$k_mp[0] = 0; -} else { -if($technick1['starke'] >= mt_rand(1,100)) { -$schaden_1 = 'Schwächen'; -$k_mp[1] = ($k_mp2[1] / 100) * 20; -} else { -$schaden_1 = 'Schwächen fehlgeschlagen'; -} -} -$aktion_AV1[$x] = 'nein'; + $k_mp[0] = $k_mp[0] - $technick1['mp']; + if($k_mp[0] < 0) { + $schaden_1 = 'Schwächen fehlgeschlagen'; + $k_mp[0] = 0; + } else { + if($technick1['starke'] >= mt_rand(1,100)) { + $schaden_1 = 'Schwächen'; + $k_mp[1] -= $k_mp2[1] * 0.8; + if($k_mp[1] < 0) { + $k_mp[1] = 0; + } + } else { + $schaden_1 = 'Schwächen fehlgeschlagen'; + } + } + $aktion_AV1[$x] = 'nein'; } ####################KAIOKEN-LOSE SPIELER 2 if($technick2['type'] == 'lose2') { -$k_mp[1] = $k_mp[1] - $technick2['mp']; -if($k_mp[1] < 0) { -$schaden_2 = 'Schwächen fehlgeschlagen'; -$k_mp[1] = 0; -} else { + $k_mp[1] = $k_mp[1] - $technick2['mp']; + if($k_mp[1] < 0) { + $schaden_2 = 'Schwächen fehlgeschlagen'; + $k_mp[1] = 0; + } else { -if($technick2['starke'] >= mt_rand(1,100)) { -$schaden_2 = 'Schwächen'; -$k_mp[0] = ($k_mp1[1] / 100) * 20; -} else { -$schaden_2 = 'Schwächen fehlgeschlagen'; + if($technick2['starke'] >= mt_rand(1,100)) { + $schaden_2 = 'Schwächen'; + $k_mp[0] -= $k_mp1[1] * 0.8; + if($k_mp[0] < 0) { + $k_mp[0] = 0; + } + } else { + $schaden_2 = 'Schwächen fehlgeschlagen'; -} -} -$aktion_AV2[$x] = 'nein'; + } + } + $aktion_AV2[$x] = 'nein'; } ?> diff --git a/ag/include/usergroup.inc.php b/ag/include/usergroup.inc.php index c5e3104..2db34e5 100644 --- a/ag/include/usergroup.inc.php +++ b/ag/include/usergroup.inc.php @@ -39,8 +39,7 @@ function getUserGroups($user) { $i = 0; while ($result = mysql_fetch_assoc($qry)) { - $groups[$i] = array("gruppen_id" => $result['gruppen_id'], "gruppen_name" => $result['gruppen_name']); - $i++; + $groups[] = array("gruppen_id" => $result['gruppen_id'], "gruppen_name" => $result['gruppen_name']); } return $groups;