Hey,
ik wil graag me website Demonworld laten checken,
De link is:
http://speelveelspellen.nl/lol/
het is een heel oud project geweest van mij
en vraag me af wat het waard is.
Demo account:
Naam: test
ww: test
een deel van coding is:
PHP
/////////////////////////
//FUNCTIE MONSTER ATTACK
function monsterAttack($monster)
{
global $player;
//Amout of attack the monster has
$mRepeat = ceil($monster['speed'] / $player['speed']);
if($mRepeat <= 0)
{
$mRepeat = 1;
}
//Set attackpower,defence and experience
$mAttack = $monster['attack'] - $player['defense'];
$mDefense = $player['attack'] - $monster['defense'];
if($mRepeat >= 1)
{
while($mRepeat != 0)
{
//attack
if($mAttack <= 0 )
{
$mRepeat--;
$dmg = $player['level'] * 5;
$gok = rand(1, 100);
if($gok <= 10)
{
echo "<br />".$monster['name']." hits you for <strong class='negative'>".$dmg."</strong> Hit Points\n";
$player['hp'] = $player['hp'] - $dmg;
if($player['hp'] > 0)
{
//Show Monster HP
echo "<br />You have <strong class='positive'>".$player['hp']."</strong> Hit Points left\n";
updatePlayer($player);
}
else
{
//Set hp to 0
$player['hp'] = 0;
//revived = 1
$revived = 1;
//Player is KO
echo "<p><strong class='negative'>You have been KO\'d</strong></p>\n";
echo "<p>An angel has appeared and has revived you for<strong class='positive'> 1</strong> HP.<br />\n";
echo "You lucky bastard!</p>\n";
//If player has more then 10 gold pieces the angel take 10% of your money
if($player['gold'] >= 10)
{
$cost = floor($player['gold']*0.1);
$player['gold'] -= $cost;
echo "But she nicked <strong class='negative'>".$cost."</strong> gold pieces!!!\n";
}
$_SESSION['kill'] = true;
$player['hp'] = 1;
updatePlayer($player);
break;
}
}
else
{
echo "<br />".$monster['name']." hits you but <strong>miss</strong>\n";
}
}
else
{
echo "<br />".$monster['name']." hits you for <strong class='negative'>".$mAttack."</strong> Hit Points\n";
//Calculate player hp
$player['hp'] = $player['hp'] - $mAttack;
//monster repeat - 1
$mRepeat--;
if($player['hp'] > 0)
{
//Show Monster HP
echo "<br />You have <strong class='positive'>".$player['hp']."</strong> Hit Points left\n";
}
//If player has died
if($player['hp'] <= 0)
{
//Set hp to 0
$player['hp'] = 0;
//revived = 1
$revived = 1;
//Player is KO
echo "<p><strong class='negative'>You have been KO\'d</strong></p>\n";
echo "<p>An angel has appeared and has revived you for<strong class='positive'> 1</strong> HP.<br />\n";
echo "You lucky bastard!</p>\n";
//If player has more then 10 gold pieces the angel take 10% of your money
if($player['gold'] >= 10)
{
$cost = floor($player['gold']*0.1);
$player['gold'] -= $cost;
echo "But she nicked <strong class='negative'>".$cost."</strong> gold pieces!!!\n";
}
$_SESSION['kill'] = true;
$player['hp'] = 1;
updatePlayer($player);
break;
}
updatePlayer($player);
}//End attack
}//End While
}//End player repeat
}//End functie monster attack
Toon Meer