Ejemplo n.º 1
0
	function CreateSummon($no,$strength=false) {
		include_once(DATA_MONSTER);
		$monster	= CreateMonster($no,1);

		$monster["summon"]	= true;
		// 召喚モンスターの強化。
		if($strength) {
			$monster["maxhp"]	= round($monster["maxhp"]*$strength);
			$monster["hp"]	= round($monster["hp"]*$strength);
			$monster["maxsp"]	= round($monster["maxsp"]*$strength);
			$monster["sp"]	= round($monster["sp"]*$strength);
			$monster["str"]	= round($monster["str"]*$strength);
			$monster["int"]	= round($monster["int"]*$strength);
			$monster["dex"]	= round($monster["dex"]*$strength);
			$monster["spd"]	= round($monster["spd"]*$strength);
			$monster["luk"]	= round($monster["luk"]*$strength);

			$monster["atk"]["0"]	= round($monster["atk"]["0"]*$strength);
			$monster["atk"]["1"]	= round($monster["atk"]["1"]*$strength);
		}

		$monster	= new monster($monster);
		$monster->SetBattleVariable();
		return $monster;
	}
Ejemplo n.º 2
0
<?php

require_once 'monster.php';
require_once 'kryptonian.php';
require_once 'arena.php';
$kraken = new monster();
$kraken->setStats(100 + rand(50, 1000), rand(200, 400), 30, 100);
$kraken->isPresent(true);
$superMincho = new kryptonian();
$superMincho->setStats('100', rand(100, 200), '50', '30');
$superMincho->setHeatray(rand(30, 50));
$superMincho->setSuperhumanstrength('100');
$superMincho->setRegeneration(rand(80, 120));
echo "<pre>";
print_r($kraken);
print_r($superMincho);
$arena = new Arena($kraken, $superMincho);
$rounds = $arena->doBattle();
echo "The battle is over in {$rounds}";
echo "<pre>";
print_r($kraken);
print_r($superMincho);