当前位置: 首页>>代码示例>>PHP>>正文


PHP Stat::assignRolls方法代码示例

本文整理汇总了PHP中Stat::assignRolls方法的典型用法代码示例。如果您正苦于以下问题:PHP Stat::assignRolls方法的具体用法?PHP Stat::assignRolls怎么用?PHP Stat::assignRolls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stat的用法示例。


在下文中一共展示了Stat::assignRolls方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Stat

 function test_updateAcrobatics()
 {
     $str = 2;
     $dex = 2;
     $con = 2;
     $intel = 2;
     $wis = 2;
     $cha = 2;
     $init = 2;
     $max_hp = 2;
     $speed = 2;
     $ac = 2;
     $acrobatics = 2;
     $arcana = 2;
     $animal_handling = 2;
     $athletics = 2;
     $deception = 2;
     $history = 2;
     $insight = 2;
     $intimidation = 2;
     $investigation = 2;
     $medicine = 2;
     $nature = 2;
     $perception = 2;
     $performance = 2;
     $persuasion = 2;
     $proficiency = 2;
     $religion = 2;
     $sleight_of_hand = 2;
     $stealth = 2;
     $survival = 2;
     $test_stat = new Stat($ac, $acrobatics, $animal_handling, $arcana, $athletics, $cha, $con, $deception, $dex, $history, $init, $insight, $intel, $intimidation, $investigation, $max_hp, $medicine, $nature, $perception, $performance, $persuasion, $proficiency, $religion, $speed, $sleight_of_hand, $stealth, $str, $survival, $wis);
     $test_stat->save();
     $six_rolls = [18, 16, 14, 12, 10, 8];
     $classname = "cleric";
     $race = "mountain dwarf";
     $test_stat->assignRolls($six_rolls, $classname, $race);
     $dex = $test_stat->getDex();
     $result = 1;
     $proficiencies = ["insight", "medicine", "acrobatics"];
     $test_stat->updateAcrobatics($proficiencies);
     $acrobatics = $test_stat->getAcrobatics();
     $this->assertEquals($acrobatics, $result);
 }
开发者ID:civilianemail,项目名称:dnd,代码行数:44,代码来源:StatTest.php

示例2: function

//background page
//render background page
$app->get('/background', function () use($app) {
    return $app['twig']->render('background.html.twig', array('backgrounds' => Background::getAll()));
});
//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 = $race_find->getName();
    $class_id = $_SESSION['class'];
    $class_find = CharClass::find($class_id);
    $class = $class_find->getName();
    $stats = statRoll();
    Stat::assignRolls($stats, $class, $race);
    return $app['twig']->render('stats.html.twig', array('race' => $_SESSION['race'], 'class' => $_SESSION['class'], 'str' => $_SESSION['str'], 'dex' => $_SESSION['dex'], 'con' => $_SESSION['con'], 'wis' => $_SESSION['wis'], 'int' => $_SESSION['int'], 'cha' => $_SESSION['cha']));
});
//stats page
//render stats page
$app->get('/stats', function () use($app) {
    return $app['twig']->render('stats.html.twig', array('str' => $_SESSION['str'], 'dex' => $_SESSION['dex'], 'con' => $_SESSION['con'], 'wis' => $_SESSION['wis'], 'int' => $_SESSION['int'], 'cha' => $_SESSION['cha']));
});
//loadout page
//render loadout page
$app->post('/skills', function () use($app) {
    $loadouts = loadOuts($_SESSION['class'], $_SESSION['background']);
    $max0 = $loadouts[0][0];
    $max1 = $loadouts[0][1];
    $max2 = $loadouts[0][2];
    $max3 = $loadouts[0][3];
开发者ID:civilianemail,项目名称:dnd,代码行数:31,代码来源:app.php


注:本文中的Stat::assignRolls方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。