本文整理汇总了PHP中Armor类的典型用法代码示例。如果您正苦于以下问题:PHP Armor类的具体用法?PHP Armor怎么用?PHP Armor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Armor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadArmor
function loadArmor($ID)
{
//check ID is not blank and exists and such
$db = DB::GetConn();
$id_con = $db->quoteInto("ID = ?", $ID);
$getQuery = "SELECT * FROM `Armor` WHERE {$id_con} limit 1;";
$res = $db->query($getQuery);
$obj = $res->fetchObject();
return Armor::loadArmorFromObject($obj);
}
示例2: __construct
public function __construct(\Weapon $weapon, \Armor $armor, array $rings = [], $hp = 100)
{
$this->hp = $hp;
$this->damage = $weapon->getDamage();
$this->cost += $weapon->getCost();
$this->armor = $armor->getArmor();
$this->cost += $armor->getCost();
foreach ($rings as $ring) {
$this->damage += $ring->getDamage();
$this->armor += $ring->getArmor();
$this->cost += $ring->getCost();
}
}
示例3: getProtection
public function getProtection()
{
return parent::getProtection() + 6;
}
示例4: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::GOLD_BOOTS, $meta, $count, "Gold Boots");
}
示例5: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::CHAIN_HELMET, $meta, $count, "Chainmail Helmet");
}
示例6: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::LEATHER_PANTS, $meta, $count, "Leather Pants");
}
示例7: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::GOLD_CHESTPLATE, $meta, $count, "Gold Chestplate");
}
示例8: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::CHAIN_LEGGINGS, $meta, $count, "Chain Leggings");
}
示例9: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::IRON_BOOTS, $meta, $count, "Iron Boots");
}
示例10: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::LEATHER_CAP, $meta, $count, "Leather Cap");
}
示例11: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::LEATHER_TUNIC, $meta, $count, "Leather Tunic");
}
示例12: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::DIAMOND_HELMET, $meta, $count, "Diamond Helmet");
}
示例13: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::GOLD_LEGGINGS, $meta, $count, "Gold Leggings");
}
示例14: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::CHAIN_BOOTS, $meta, $count, "Chainmail Boots");
}
示例15: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::DIAMOND_CHESTPLATE, $meta, $count, "Diamond Chestplate");
}