Exemplo n.º 1
0
 public function testCantAttackIfExcessiveAmountOfTurnsIsRequired()
 {
     $confirm = true;
     $char_id = TestAccountCreateAndDestroy::create_testing_account($confirm);
     $this->oldify_character_last_attack($char_id);
     $char_2_id = TestAccountCreateAndDestroy::create_alternate_testing_account($confirm);
     $this->oldify_character_last_attack($char_2_id);
     $char = new Player($char_2_id);
     $legal = new AttackLegal($char_id, $char->name(), ['required_turns' => 4000000000.0, 'ignores_stealth' => true]);
     $this->assertFalse($legal->check($update_timer = false));
 }
Exemplo n.º 2
0
 public function testDoshinOfferSomeBountyOnATestPlayer()
 {
     $target_id = TestAccountCreateAndDestroy::create_alternate_testing_account(true);
     $this->char->set_gold(434343);
     $this->char->save();
     $target = new Player($target_id);
     $request = new Request(['target' => $target->name(), 'amount' => 600]);
     RequestWrapper::inject($request);
     $doshin = new DoshinController();
     $doshin->offerBounty();
     $new_bounty = (new Player($target->id()))->bounty();
     TestAccountCreateAndDestroy::destroy();
     $this->assertEquals(600, $new_bounty);
 }
 public static function char_id_2($confirm = false)
 {
     return TestAccountCreateAndDestroy::create_alternate_testing_account($confirm);
 }