当前位置: 首页>>代码示例>>PHP>>正文


PHP Skill::getIgnoreStealth方法代码示例

本文整理汇总了PHP中Skill::getIgnoreStealth方法的典型用法代码示例。如果您正苦于以下问题:PHP Skill::getIgnoreStealth方法的具体用法?PHP Skill::getIgnoreStealth怎么用?PHP Skill::getIgnoreStealth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Skill的用法示例。


在下文中一共展示了Skill::getIgnoreStealth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: in

    die;
}
// Template vars.
$display_sight_table = $generic_skill_result_message = $generic_state_change = $killed_target = $loot = $added_bounty = $bounty = $suicided = $destealthed = null;
//Get filtered info from input.
$target = in('target');
$command = in('command');
$stealth = in('stealth');
$skillListObj = new Skill();
$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);
开发者ID:NinjaWars,项目名称:ninjawars,代码行数:31,代码来源:skills_mod.php

示例2: elseif

$simultaneousKill = NULL;
// *** Not simultaneous by default. ***
$stealthAttackDamage = $attacker_str;
$turns_to_take = null;
// *** Even on failure take at least one turn. ***
$attack_type = 'attack';
// *** Default attack category type is single attack. ***
if ($blaze) {
    $attack_type = 'blaze';
} elseif ($deflect) {
    $attack_type = 'deflect';
} elseif ($duel) {
    $attack_type = 'duel';
}
$skillListObj = new Skill();
$ignores_stealth = $skillListObj->getIgnoreStealth($attack_type);
$required_turns = $skillListObj->getTurnCost($attack_type);
// *** Attack Legal section ***
$attacker = $username;
$params = array('required_turns' => $required_turns, 'ignores_stealth' => $ignores_stealth);
assert($attacker != $target);
$AttackLegal = new AttackLegal($attacker, $target, $params);
// *** There's a same-domain problem with this attack-legal now that it's been modified for skills ***
// ***  MAIN BATTLE ALGORITHM  ***
if (!$AttackLegal->check()) {
    // *** Display the reason the attack failed.
    echo "<div class='ninja-error centered'>" . $AttackLegal->getError() . "</div>";
} else {
    // *** ATTACKING + STEALTHED SECTION  ***
    if (!$duel && $attacker_status['Stealth']) {
        //Not dueling, and attacking from stealth
开发者ID:ninjajerry,项目名称:ninjawars,代码行数:31,代码来源:attack_mod.php

示例3: Player

}
if ($evade) {
    $attack_type['evade'] = 'evade';
}
if ($duel) {
    $attack_type['duel'] = 'duel';
} else {
    $attack_type['attack'] = 'attack';
}
$target_player = new Player($target);
$attacking_player = new Player(self_char_id());
$attacker = $attacking_player->name();
$skillListObj = new Skill();
$ignores_stealth = false;
foreach ($attack_type as $type) {
    $ignores_stealth = $ignores_stealth || $skillListObj->getIgnoreStealth($type);
    $required_turns += $skillListObj->getTurnCost($type);
}
// *** Attack Legal section ***
$params = array('required_turns' => $required_turns, 'ignores_stealth' => $ignores_stealth);
$attack_legal = new AttackLegal($attacking_player, $target_player, $params);
$attack_is_legal = $attack_legal->check();
$attack_error = $attack_legal->getError();
// ***  MAIN BATTLE ALGORITHM  ***
if ($attack_is_legal) {
    // *** Target's stats. ***
    $target_health = $target_player->health;
    $target_level = $target_player->level;
    $target_str = $target_player->getStrength();
    // *** Attacker's stats. ***
    $attacker_health = $attacking_player->health;
开发者ID:NinjaWars,项目名称:ninjawars,代码行数:31,代码来源:attack_mod.php


注:本文中的Skill::getIgnoreStealth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。