コード例 #1
0
ファイル: changes.blade.php プロジェクト: AcceptableIce/Larp3
 }
 if ($key == "disciplines" && sizeof($value) > 0) {
     echo "<h5>Disciplines</h5>";
     foreach ($value as $k => $v) {
         //Get rank difference
         $r1 = isset($v["ranks"][0]) ? $v["ranks"][0] : 0;
         $r2 = isset($v["ranks"][1]) ? $v["ranks"][1] : 0;
         $diff = $r2 - $r1;
         if (strpos($k, "-") !== FALSE) {
             $parts = explode("-", $k);
             $k = $parts[0];
             $path = $parts[1];
         }
         $discipline = RulebookDiscipline::find($k);
         if (isset($path)) {
             $discipline = RulebookDisciplinePath::find($path);
         }
         if ($diff != 0) {
             $order = $diff > 0 ? [$r1, $r2] : [$r2, $r1];
             for ($i = $order[0]; $i < $order[1]; $i++) {
                 $diff_array = $diff > 0 ? [null, $discipline->ranks()->get()[$i]->name . " (" . $discipline->name . " " . ($i + 1) . ")"] : [$discipline->ranks()->get()[$i]->name . " (" . $discipline->name . " " . ($i + 1) . ")", null];
                 print_change("", $diff_array, ["Purchased .", "[change]", "Removed ."]);
             }
         }
     }
 }
 if ($key == "elderPowers" && sizeof($value) > 0) {
     echo "<h5>Elder Powers</h5>";
     foreach ($value as $k => $v) {
         print_change("", $v["character_id"][0] == null ? [null, RulebookElderPower::find($k)->name] : [RulebookElderPower::find($k)->name, null], ["Purchased .", "[change]", "Removed ."]);
     }
コード例 #2
0
 public function paths()
 {
     return RulebookDisciplinePath::where('discipline_id', $this->id);
 }
コード例 #3
0
		<link href='http://fonts.googleapis.com/css?family=Cabin:300,400,700,400italic' rel='stylesheet' type='text/css'>
		<link href="/css/foundation.css" rel="stylesheet" type="text/css">
		<link href="/css/normalize.css" rel="stylesheet" type="text/css">
		<link href="/css/fontello.css" rel="stylesheet" type="text/css">
		<link href="/css/characterSheet.css" rel="stylesheet" type="text/css" />
	</head>
	<body>			
		<?php 
$elders = $character->elderPowers()->get();
?>
		<div class="row left">
			<div class="small-12">
				<h2>Disciplines</h2>
				@foreach($character->disciplines($version)->with('definition')->get()->sortBy('definition.name') as $discipline)
					<?php 
$path = $discipline->path_id ? RulebookDisciplinePath::find($discipline->path_id) : null;
$ranks = $path ? $path->ranks()->get() : $discipline->definition->ranks()->get();
?>
					<h4>
						{{$discipline->definition->name}}@if($discipline->path_id): 
						<span class="discipline-path-name">{{$path->name}}</span>@endif
					</h4>
					@for($i = 0; $i < $discipline->ranks; $i++)
						<b>{{$ranks[$i]->name}}</b><br>
						{{$ranks[$i]->description}}<br>
					@endfor
					@foreach($elders as $elder)
						@if($elder->definition->discipline_id == $discipline->definition->id)
							<b>{{$elder->definition->name}}</b><br>
							{{$elder->definition->description}}<br>
						@endif
コード例 #4
0
ファイル: Character.php プロジェクト: AcceptableIce/Larp3
 public function getDisciplinePathCost($discipline, $path, $rank, $version)
 {
     $cost = $this->getDisciplineCost($discipline, $rank, $version);
     if ($path != null && $path != 0) {
         $pathData = RulebookDisciplinePath::find($path);
         if ($pathData->hard_path) {
             $cost += $rank;
         }
     }
     return $cost;
 }