Beispiel #1
0
             }
         }
         $is_rewarded = (bool) $reward_gold || (bool) count($received_display_items);
         if ($status_effect) {
             // Only add the status effect
             $player->addStatus($status_effect);
             // Get the statuses and status classes for display.
             $display_statuses = implode(', ', get_status_list());
             $display_status_classes = implode(' ', get_status_list());
             // TODO: Take healthy out of the list since it's redundant.
             //$display_statuses = $display_statuses_classes = string_status($status_effect); // Get the string of a status.
         }
     }
     // Settings to display results.
     $npc_template = 'npc.abstract.tpl';
     $combat_data = array('victim' => $victim, 'display_name' => $display_name, 'attack_damage' => $npco->damage(), 'percent_damage' => $percent_damage, 'status_effect' => $status_effect, 'display_statuses' => $display_statuses, 'display_statuses_classes' => $display_statuses_classes, 'received_gold' => $received_gold, 'received_display_items' => $received_display_items, 'is_rewarded' => $is_rewarded, 'victory' => $victory, 'survive_fight' => $survive_fight, 'kill_npc' => $kill_npc, 'image_path' => $image_path, 'npc_stats' => $npc_stats, 'is_quick' => $is_quick, 'added_bounty' => $added_bounty, 'is_villager' => $is_villager, 'race' => $npco->race(), 'is_weaker' => $is_weaker, 'is_stronger' => $is_stronger);
     // ******************** START of logic for specific npcs ************************
 } else {
     if ($victim == 'peasant') {
         // *** PEASANT, was VILLAGER ***
         $villager_attack = rand(0, 10);
         // *** Villager Damage ***
         $just_villager = rand(0, 20);
         $added_bounty = 0;
         if ($player->vo->health = $victory = subtractHealth($char_id, $villager_attack)) {
             // *** Player defeated villager ***
             $villager_gold = rand(0, 20);
             // *** Vilager Gold ***
             add_gold($char_id, $villager_gold);
             $attacker_level = $player->vo->level;
             // *** Bounty or no bounty ***
Beispiel #2
0
 function testDefaultRaceForBasanIsCreature()
 {
     if (!DEBUG) {
         $this->markTestSkipped();
     }
     $npc = new Npc('basan');
     $this->assertEquals('creature', $npc->race());
 }