function expand_enemy_info($enemy_id) { $enemy = char_info($enemy_id); $enemy = format_health_percent($enemy); $enemy['enemy_id'] = $enemy_id; return $enemy; }
public function testAttackLegalCantAttackSelfEvenIfUsingSelfIdVsSelfUsername() { $char_id = TestAccountCreateAndDestroy::create_testing_account(); $this->oldify_character_last_attack($char_id); $info = char_info($char_id); $this->assertTrue((bool) $info['uname'], 'Character uname not found to check attacklegal with'); $legal = new AttackLegal($char_id, $info['uname'], ['required_turns' => 1, 'ignores_stealth' => true]); $this->assertFalse($legal->check($update_timer = false)); }
/** * Check whether the player has the skill. **/ public function hasSkill($skill, $username = null) { $skill = strtolower($skill); if (!$username) { $char_id = self_char_id(); } else { $char_id = get_char_id($username); } $player_info = char_info($char_id); $player_level = $player_info['level']; $skills = $this->skills($char_id); $level_req = isset($skills[$skill]['level']) ? $skills[$skill]['level'] : 1; return isset($skills[$skill]['available']) && $player_level >= $level_req; }
public static function split_char_infos($ids) { if (is_numeric($ids)) { // Single id, so return a single data set return array(char_info($ids, $admin_info = true)); } else { // Get the info for multiple ninjas $res = array(); $ids = explode(',', $ids); foreach ($ids as $id) { $res[$id] = char_info($id, $admin_info = true); } return $res; } }
function clan_id($char_id = null) { $info = char_info($char_id); return $info['clan_id']; }
function public_char_info($p_id = null, $admin_info = false) { $char_info = char_info($p_id); if ($admin_info !== true) { unset($char_info['ip'], $char_info['member'], $char_info['pname'], $char_info['pname_backup'], $char_info['verification_number'], $char_info['confirmed']); } return $char_info; }
function pull_sight_data($target_id) { $data = char_info($target_id); // Strip all fields but those allowed. $allowed = array('Name' => 'uname', 'Class' => 'class', 'Level' => 'level', 'Turns' => 'turns', 'Strength' => 'strength', 'Speed' => 'speed', 'Stamina' => 'stamina', 'Ki' => 'ki', 'Gold' => 'gold', 'Kills' => 'kills'); $res = array(); foreach ($allowed as $header => $field) { $res[$header] = $data[$field]; } return $res; }
function self_char_info() { return char_info(self_char_id()); }
<h2 class='char-name'><?php echo $dado->name; ?> </h2> <div class="posicao"> <span>Matou: <?php echo $dado->kills; ?> </span> <span>Morreu: <?php echo $dado->deaths; ?> </span> </div> <span class="char clearfix"><?php $info = char_info($con, $dado->char_id); ?> </span> </div> </li> <?php } ?> </ul> </div> <div class="carousel-navigation"> <a class="prev" href=''> < </a> <a class="next" href=''> > </a> </div> <div class="carousel-pagination">