本文整理汇总了PHP中Skill::hasSkill方法的典型用法代码示例。如果您正苦于以下问题:PHP Skill::hasSkill方法的具体用法?PHP Skill::hasSkill怎么用?PHP Skill::hasSkill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::hasSkill方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
$poisonMaximum = 100;
// *** Before level-based addition.
$poisonMinimum = 1;
$poisonTurnCost = $skillListObj->getTurnCost('poison touch');
// wut
$turn_cost = $skillListObj->getTurnCost(strtolower($command));
$ignores_stealth = $skillListObj->getIgnoreStealth($command);
$self_use = $skillListObj->getSelfUse($command);
$use_on_target = $skillListObj->getUsableOnTarget($command);
$ki_cost = 0;
// Ki taken during use.
$reuse = true;
// Able to reuse the skill.
$today = date("F j, Y, g:i a");
// Check whether the user actually has the needed skill.
$has_skill = $skillListObj->hasSkill($command);
$starting_turn_cost = $turn_cost;
assert($turn_cost >= 0);
$turns_to_take = null;
// *** Even on failure take at least one turn.
$char_id = self_char_id();
$player = new Player($char_id);
if ($target != '' && $target != $player->player_id) {
$target = new Player($target);
$target_id = $target->id();
$return_to_target = true;
} else {
// Use the skill on himself.
$return_to_target = false;
$target = $player;
$target_id = null;
示例2: Skill
} else {
require_once LIB_ROOT . "control/lib_status.php";
// statuses for quickstats
require_once LIB_ROOT . "control/lib_player.php";
// Player info display pieces.
require_once LIB_ROOT . "control/Skill.php";
$skillsListObj = new Skill();
$player = new Player(self_char_id());
$level = $player->level();
$class = $player->class_display_name();
// Just to be displayed in the template.
$starting_turns = $player->turns();
$starting_ki = $player->ki();
$status_list = get_status_list();
$no_skills = true;
$stealth = $skillsListObj->hasSkill('Stealth');
if ($stealth) {
$no_skills = false;
}
$stealth_turn_cost = $skillsListObj->getTurnCost('Stealth');
$unstealth_turn_cost = $skillsListObj->getTurnCost('Unstealth');
$chi = $skillsListObj->hasSkill('Chi');
$speed = $skillsListObj->hasSkill('speed');
$hidden_resurrect = $skillsListObj->hasSkill('hidden resurrect');
$midnight_heal = $skillsListObj->hasSkill('midnight heal');
$kampo_turn_cost = $skillsListObj->getTurnCost('Kampo');
$kampo = $skillsListObj->hasSkill('kampo');
$heal = $skillsListObj->hasSkill('heal');
$heal_turn_cost = $skillsListObj->getTurnCost('heal');
$clone_kill = $skillsListObj->hasSkill('clone kill');
$clone_kill_turn_cost = $skillsListObj->getTurnCost('clone kill');
示例3: floor
$victor = $attacker;
$loser = $target;
}
$killed_target = true;
$killpoints = 1;
// Changes killpoints from zero to one.
if ($duel) {
// Changes killpoints amount by dueling equation.
$killpoints = Combat::killpointsFromDueling($attacking_player, $target_player);
$duel_log_msg = "{$attacker} has dueled {$target} and won {$killpoints} killpoints.";
// Only log duels if they're better than 1 or if they're a failure.
if ($killpoints > 1 || $killpoints < 0) {
// Make a WIN record in the dueling log.
GameLog::sendLogOfDuel($attacker, $target, 1, $killpoints);
}
if ($skillListObj->hasSkill('wrath')) {
// They'll retain 10 health for the kill, at the end.
$wrath_regain = 10;
}
}
$attacking_player->addKills($killpoints);
// Attacker gains their killpoints.
$target_player->death();
if (!$simultaneousKill) {
// This stuff only happens if you don't die also.
$loot = floor($gold_mod * $target_player->gold());
// Add the wrath health regain to the attacker.
if (isset($wrath_regain)) {
$attacking_player->changeHealth($wrath_regain);
}
}
示例4: in
$restore = in('restore');
$max_heal = in('max_heal');
$heal_and_resurrect = in('heal_and_resurrect');
$userLevel = getLevel($username);
$startingHealth = getHealth($username);
$startingGold = getGold($username);
$startingKills = getKills($username);
$startingTurns = getTurns($username);
$level = getLevel($username);
$heal_points = in('heal_points') ? intval(in('heal_points')) : null;
// The pointwise healing method.
$freeResLevelLimit = 6;
$freeResKillLimit = 25;
$lostTurns = 10;
// *** Default turns lost when the player has no kills.
$has_chi = $skillsListObj->hasSkill('Chi');
// Extra healing benefits from chi, by level.
// *** A True or False as to whether resurrection will be free.
$freeResurrection = $userLevel < $freeResLevelLimit && $startingKills < $freeResKillLimit;
if ($heal_and_resurrect) {
// Set resurrect if needed.
if ($startingHealth < 1) {
$restore = 1;
}
// Set heal always.
$max_heal = 1;
}
if ($restore == 1) {
// *** RESURRECTION SECTION ***
if ($startingHealth > 0) {
echo "You are not dead.<br><br>\n";
示例5: Skill
<p>
<?php
// TODO: Consider more skills along the lines of: disguise, escape, concealment, archery, medicine, explosives, and poisons.
// TODO: Also consider "packageable" classes.
include OBJ_ROOT . "Skill.php";
$skillsListObj = new Skill();
$level = getLevel($username);
$class = getClass($username);
$status_array = getStatus($username);
$row = $sql->data;
echo "<p>You are a level {$level}, {$class} Ninja.</p>\n";
$status_output_list = render_status_section();
echo "<p>Your status is: " . $status_output_list . "</p>";
echo "<div id='skills-list'>";
$no_skills = true;
if ($skillsListObj->hasSkill('Stealth')) {
echo "<div id='stealth-skills'>";
echo "<p>By selecting Stealth you will go into a mode where enemies can not directly attack you for a short time.";
echo "<a href=\"about.php#skills\">(help)</a></p><p>";
echo "<form action=\"skills_mod.php\" method=\"post\">\n";
echo "<div>\n";
echo "<input type=\"submit\" name=\"command\" value=\"Stealth\" class=\"formButton\">\n";
echo "</select> Turn Cost: " . $skillsListObj->getTurnCost('Stealth') . " to Stealth.\n";
echo "</div>\n";
echo "</form></p><p>";
echo "<form action=\"skills_mod.php\" method=\"post\">\n";
echo "<div>\n";
echo "<input type=\"submit\" name=\"command\" value=\"Unstealth\" class=\"formButton\">\n";
echo "Turn Cost: " . $skillsListObj->getTurnCost('Unstealth') . " to Unstealth.\n ";
echo "</div>\n";
echo "</form></p>";