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


PHP Player::ki方法代码示例

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


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

示例1: testCreatePlayerObjectCanSaveChanges

 /**
  * group char
  **/
 function testCreatePlayerObjectCanSaveChanges()
 {
     $char = new Player($this->char_id);
     $ki = $char->ki();
     $char->add_ki(55);
     $player_factory = new PlayerDAO();
     $this->markTestIncomplete('Player objects not yet self-saving');
     $player_factory->save($char->vo);
     $char_copy = new Player($this->char_id);
     $this->assertEquals($char_copy->ki(), $ki + 55);
 }
开发者ID:reillo,项目名称:ninjawars,代码行数:14,代码来源:player_test.php

示例2: Skill

$alive = false;
if ($error = init($private, $alive)) {
    display_error($error);
} 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');
开发者ID:reillo,项目名称:ninjawars,代码行数:31,代码来源:skills.php

示例3: max

 function harmonize_chakra(Player $char)
 {
     // Heal at most 100 or ki available or hurt by AND at least 0
     $heal_for = (int) max(0, min(100, $char->is_hurt_by(), $char->ki()));
     if ($heal_for > 0) {
         // If there's anything to heal, try.
         // Subtract the ki used for healing.
         $char->heal($heal_for);
         $char->set_ki($char->ki() - $heal_for);
         $char->save();
     }
     return $char;
 }
开发者ID:NinjaWars,项目名称:ninjawars,代码行数:13,代码来源:skills_mod.php

示例4: testCreatePlayerObjectCanSaveChanges

 public function testCreatePlayerObjectCanSaveChanges()
 {
     $char = new Player($this->char_id);
     $ki = $char->ki();
     $char->set_ki($ki + 55);
     $char->set_gold(343);
     $char->save();
     $char_copy = new Player($this->char_id);
     $this->assertEquals($char_copy->ki(), $ki + 55);
     $this->assertEquals($char_copy->gold(), 343);
 }
开发者ID:NinjaWars,项目名称:ninjawars,代码行数:11,代码来源:player_test.php


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