Пример #1
0
 public function action_attack()
 {
     $character = $this->character;
     $battle = $character->battle;
     if (!Battle::can_fight($character) or !Battle::can_fight($battle)) {
         $this->request->redirect('battle/end');
     }
     Battle::fight($character, $battle);
     $this->request->redirect('battle');
 }
Пример #2
0
 public function fight()
 {
     // these are the "face down" cards
     $this->takePair();
     return parent::fight();
 }
Пример #3
-62
<?php

$battle = new Battle();
$character1 = array();
$character1['name'] = 'Xaoziq';
$character1['level'] = 1;
$character1['attack'] = 10;
$character1['defense'] = 50;
$character1['hp'] = 100;
$character2 = array();
$character2['name'] = 'Evolutionary';
$character2['level'] = 1;
$character2['attack'] = 10;
$character2['defense'] = 50;
$character2['hp'] = 100;
?>
<div class="col-lg-9">
	<?php 
$battle->fight($character1, $character2);
?>
</div>