The first code right below this is what I have to repeat.....the next code is the actual code (battle), and the last is the forms it uses to display the results.
Code: Select all
$outputList .= 'Your critical attack hits and ' . $arena_char_name . ' suffers ' . $player_critical . ' health'; ?>
<script>
setTimeout('document.status.msgbx.value = "<?php echo $outputList; ?>";', 2000);
</script>
Code: Select all
<script>
setTimeout('document.weapons.life.value = "<?php echo $playerHp; ?>";', 0);
</script>
<?php
$player_accuracy = mt_rand($user_accuracy, 100);
$player_atkdam = mt_rand(0,$user_strength);
$player_critical = mt_rand(0,$user_strength)*2;
if($player_accuracy > 80 && $player_critical>=$user_strength){
$outputList .= 'Your critical attack hits and ' . $arena_char_name . ' suffers ' . $player_critical . ' health'; ?>
<script>
setTimeout('document.status.msgbx.value = "<?php echo $outputList; ?>";', 2000);
</script>
<?php
}elseif($player_accuracy < 80 || $player_accuracy > 80) {
$outputList .= 'Your attack hits and ' . $arena_char_name . ' suffers ' . $player_atkdam . ' health'; ?>
<script>
setTimeout('document.status.msgbx.value = "<?php echo $outputList; ?>";', 2000);
</script>
<?php
}else{
$outputList .= 'Your attacked missed! You really suck !'; ?>
<script>
setTimeout('document.status.msgbx.value = "<?php echo $outputList; ?>";', 2000);
</script>
<?php
}
Code: Select all
<form name="status">
<input type="text" readonly="true" name="msgbx" size="80" maxlength="80" onFocus="FocusOut()" onKeyDown="javascript: alert('Don\'t do that!');" style="background-color:#575957; border:none">
</form>
<form name="status1">
<input type="text" readonly="true" name="msgbx1" size="80" maxlength="80" onFocus="FocusOut()" onKeyDown="javascript: alert('Don\'t do that!');" style="background-color:#575957; border:none">
</form>