Exemplo n.º 1
0
 function testStatRoll()
 {
     $result = statRoll();
     $this->assertEquals(6, count($result));
 }
Exemplo n.º 2
0
Arquivo: app.php Projeto: Camolot/dnd
//carry race id and class id to background page
$app->post('/background', function () use($app) {
    $_SESSION['class'] = $_POST['class_id'];
    return $app['twig']->render('background.html.twig', array('backgrounds' => Background::getAll()));
});
//background page
//carry race id, class id, background id to stats page
$app->post('/stats', function () use($app) {
    $_SESSION['background'] = $_POST['background_id'];
    $race_id = $_SESSION['race'];
    $race_find = Race::find($race_id);
    $race = getName($race_find);
    $class_id = $_SESSION['class'];
    $class_find = CharClass::find($class_id);
    $classname = getName($class_find);
    $stats = statRoll();
    $assigned_stats = assignRolls($six_rolls, $classname, $race);
    return $app['twig']->render('stats.html.twig', array('stat' => Stat::getAll()));
});
//stats page
//carry race id, class id, background id, stats id to skills page
$app->post('/bio', function () use($app) {
    $_SESSION['str'] = $_POST['str_id'];
    $_SESSION['dex'] = $_POST['dex_id'];
    $_SESSION['con'] = $_POST['con_id'];
    $_SESSION['int'] = $_POST['int_id'];
    $_SESSION['wis'] = $_POST['wis_id'];
    $_SESSION['cha'] = $_POST['cha_id'];
    return $app['twig']->render('bio.html.twig');
});
//bio page