本文整理汇总了PHP中Weapon::getUserDefenseWeapons方法的典型用法代码示例。如果您正苦于以下问题:PHP Weapon::getUserDefenseWeapons方法的具体用法?PHP Weapon::getUserDefenseWeapons怎么用?PHP Weapon::getUserDefenseWeapons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weapon
的用法示例。
在下文中一共展示了Weapon::getUserDefenseWeapons方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$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: spiedValue
$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);