コード例 #1
0
ファイル: armoury.php プロジェクト: Naddiseo/WW2Game
			$weapon->weaponId = $wId;
			$weapon->isAttack = 0;
			$weapon->weaponCount = $amount;
			$weapon->weaponStrength = $conf['weapon' . $wId . 'strength'];
			if ($amount and $weapon->create()) {
				$t->daWeapons[] = $weapon;
			}
		}
		$user->cacheStats();
	}
	else {
		$t->err = 'Not enough Gold';
	}
	
	
}

$t->user = $user;

if (!$t->saWeapons and !$t->daWeapons) {
	$t->saWeapons = Weapon::getUserAttackWeapons($user->id);
	$t->daWeapons = Weapon::getUserDefenseWeapons($user->id);
}

$t->saRatio = Weapon::getStrengthRatio($user->id, 1);
$t->daRatio = Weapon::getStrengthRatio($user->id, 0);

$t->pageTitle = 'Armoury';
$t->display();
?>
コード例 #2
0
ファイル: spy.php プロジェクト: Naddiseo/WW2Game
		$spylog->DA              = spiedValue($target->DA, $user, $target);
		$spylog->calevel         = spiedValue($target->calevel, $user, $target);
		$spylog->targetSpies     = spiedValue($target->spies, $user, $target);
		$spylog->salevel         = spiedValue($target->salevel, $user, $target, $conf['names']['upgrades'][1][$target->salevel]);
		$spylog->dalevel         = spiedValue($target->dalevel, $user, $target, $conf['names']['upgrades'][0][$target->dalevel]);
		$spylog->attackTurns     = spiedValue($target->attackturns, $user, $target);
		$spylog->unitProduction  = spiedValue($target->up, $user, $target);
		$spylog->sf              = spiedValue($target->specialforces, $user, $target);
		$spylog->ralevel         = spiedValue($target->ralevel, $user, $target);
		$spylog->hhlevel         = spiedValue($target->hhlevel, $user, $target);
		$spylog->gold            = spiedValue($target->gold, $user, $target);

		require_once('scripts/Weapon.php');
		
		$attackWeapons        = Weapon::getUserAttackWeapons($target->id);
		$defenseWeapons       = Weapon::getUserDefenseWeapons($target->id);
		
		$spylog->weapons      = array();
		$spylog->types        = array();
		$spylog->types2       = array();
		$spylog->quantities   = array();
		$spylog->strengths    = array();
		$spylog->allStrengths = array();
		
		foreach ($attackWeapons as $w) {
			$spylog->weapons[]      = $w->weaponId;
			$spylog->types[]        = 1;
			$spylog->types2[]       = 1;
			$spylog->quantities[]   = spiedValue($w->weaponCount, $user, $target);
			$spylog->strengths[]    = spiedValue($w->weaponStrength, $user, $target);
			$spylog->allStrengths[] = spiedValue($w->getFullStrength(), $user, $target);