示例#1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('races')->delete();
     $races = [["id" => 1, "name" => "Human", "description" => "This race combines in itself all the properties of the other races, albeit they are less pronounced.", "male_image" => "races/human-male.png", "female_image" => "races/human-female.png", "strength" => 5, "agility" => 5, "constitution" => 5, "intelligence" => 5, "charisma" => 1, "starting_location_id" => 1], ["id" => 2, "name" => "Elf", "description" => "This race is known for it's great agility, but lacks constitution.", "male_image" => "races/elf-male.png", "female_image" => "races/elf-female.png", "strength" => 5, "agility" => 9, "constitution" => 1, "intelligence" => 5, "charisma" => 1, "starting_location_id" => 1], ["id" => 3, "name" => "Dwarf", "description" => "This race is known for it's constitution and resilience, but lack agility and grace.", "male_image" => "races/dwarf-male.png", "female_image" => "races/dwarf-female.png", "strength" => 5, "agility" => 1, "constitution" => 9, "intelligence" => 5, "charisma" => 1, "starting_location_id" => 1], ["id" => 4, "name" => "Orc", "description" => "This race enjoys great physical strength, but lacks intelligence.", "male_image" => "races/orc-male.png", "female_image" => "races/orc-female.png", "strength" => 9, "agility" => 5, "constitution" => 5, "intelligence" => 1, "charisma" => 1, "starting_location_id" => 1]];
     foreach ($races as $race) {
         Race::create($race);
     }
 }
示例#2
0
 /**
  * 玩家卡片取得处理
  */
 public function cardBox()
 {
     // 玩家ID获取
     $intPlayerId = Input::get('player_id');
     // 玩家所持卡片全取得
     $lstCard = OwnedCard::where('player_id', $intPlayerId)->get();
     return view('admin.player.card-box')->withCards(Card::all())->withAttrs(Attr::all())->withRaces(Race::all())->withJobs(Job::all())->withSkills(Skill::all())->withOwnedCards($lstCard);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param CreateCharacterRequest $request
  * @return Response
  */
 public function store(CreateCharacterRequest $request)
 {
     $authenticatedUser = $request->user();
     /** @var User $authenticatedUser */
     $race = Race::findOrFail($request->input('race_id'));
     /** @var Race $race */
     $character = $authenticatedUser->character()->create(['name' => $request->input('name'), 'gender' => $request->input('gender'), 'xp' => 0, 'level' => 1, 'money' => 0, 'reputation' => 0, 'strength' => $race->strength, 'agility' => $race->agility, 'constitution' => $race->constitution, 'intelligence' => $race->intelligence, 'charisma' => $race->charisma, 'race_id' => $race->id, 'location_id' => $race->starting_location_id]);
     return redirect()->route("home");
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $race = \App\Race::where('prefix', $request->segment(1))->first();
     if ($race->closed == true && is_null($request->session()->get('type'))) {
         return redirect($race->prefix . '/error')->with('race_enabled', 'Lo sentimos, las inscripciones están cerradas. Si aun tiene un código de inscripción sin canjear por favor acérquese a la <a href="' . url($race->url_expo) . '" target="_blank">Expo</a> para regularizar su inscripción.');
     }
     if ($race->maintenance == true) {
         return redirect($race->prefix . '/error')->with('race_enabled', 'Lo sentimos, el sistema de inscripción se encuentra temporalmente en mantenimiento. Por favor intente nuevamente en breve..');
     }
     return $next($request)->with('type', $request->session()->get('type'));
 }
示例#5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $data = array(array('class' => 'D', 'order_key' => 1), array('class' => 'C', 'order_key' => 2), array('class' => 'B', 'order_key' => 3), array('class' => 'A', 'order_key' => 4), array('class' => 'S', 'order_key' => 5), array('class' => 'SS', 'order_key' => 6), array('class' => 'Z', 'order_key' => 7));
     CharClass::insert($data);
     $data = array(array("race" => "Beastfolk"), array("race" => "Celestial"), array("race" => "Cell"), array("race" => "Dragon"), array("race" => "Eidolon"), array("race" => "Human"), array("race" => "Lizardfolk"), array("race" => "Machine"), array("race" => "Metal"), array("race" => "Oxsecian"), array("race" => "Spirit"), array("race" => "Stonefolk"), array("race" => "Wild Beast"));
     Race::insert($data);
     $faker = Faker::create();
     for ($i = 0; $i < 50; $i++) {
         Affection::create(["affection" => $faker->shuffle($faker->name())]);
     }
 }
示例#6
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 1; $i < 200; $i++) {
         $name = $faker->shuffle($faker->word()) . $faker->shuffle($faker->word());
         $recodeID = $faker->boolean(50) ? rand(0, $i) : NULL;
         $race = Race::orderByRaw("RAND()")->first();
         Character::create(['name' => $name, 'savename' => $name, 'class' => $faker->randomElement($array = array('A', 'B', 'C', 'D', 'S', 'SS', 'Z')), 'race' => $race->race, 'pot' => $faker->boolean(50), 'pof' => $faker->boolean(50), 'adventurer' => $faker->boolean(50), 'recode_id' => NULL]);
         for ($t = 1; $t < 4; $t++) {
             Job::create(['name' => $faker->shuffle($faker->name()), 'number' => $t, 'element' => $faker->randomElement($array = array('None', 'Fire', 'Ice', 'Darkness', 'Lightning', 'Heal', 'Remedy')), 'weapon' => $faker->randomElement($array = array('Sword', 'Bow', 'Spear', 'Staff')), 'minHP' => $faker->numberBetween(0, 130), 'maxHP' => $faker->numberBetween(200, 900), 'minATK' => $faker->numberBetween(0, 130), 'maxATK' => $faker->numberBetween(200, 900), 'minDEF' => $faker->numberBetween(0, 130), 'maxDEF' => $faker->numberBetween(200, 900), 'minMATK' => $faker->numberBetween(0, 130), 'maxMATK' => $faker->numberBetween(200, 900), 'minMDEF' => $faker->numberBetween(0, 130), 'maxMDEF' => $faker->numberBetween(200, 900), 'character_id' => $i]);
             for ($s = 1; $s < 5; $s++) {
                 $skill = Skill::orderByRaw("RAND()")->first();
                 $affection = Affection::orderByRaw("RAND()")->first();
                 JobSkill::create(['lvl' => rand(0, 15 * $s), 'skill_name' => $skill->name, 'affection' => $affection->affection, 'frequency' => rand(0, 101), 'job_id' => $t * $i]);
                 $item = Item::orderByRaw("RAND()")->first();
                 JobItem::create(['quantity' => rand(0, 51), 'item_name' => $item->name, 'job_id' => $t * $i]);
             }
         }
         for ($j = 0; $j < rand(1, 8); $j++) {
             Iteration::create(['trigger' => $faker->word(), 'content' => $faker->text(), 'character_id' => $i, 'trigger_id' => NULL]);
         }
     }
 }
示例#7
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     return view('lskill')->withLskills(Lskill::all())->withAttrs(Attr::all())->withRaces(Race::all())->withJobs(Job::all());
 }
示例#8
0
 public function scatter($id)
 {
     $race = Race::findOrFail($id);
     return view('race.scatter', array('race' => $race));
 }
示例#9
0
 public function dashboard($race_id)
 {
     $race = Race::find($race_id);
     return view('admin.dashboard')->with('race', $race);
 }
示例#10
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     return view('admin.equipment.edit')->withEquipment(Equipment::find($id))->withAttrs(Attr::all())->withRaces(Race::all())->withJobs(Job::all())->withEquipmentTypes(EquipmentType::all())->withEquipmentSubTypes(EquipmentSubType::all())->withEquipmentStatuses(EquipmentStatus::all());
 }
示例#11
0
 public function disclaimer($prefix)
 {
     $race = Race::where('prefix', $prefix)->first();
     $month = getMonthNameSpanish($race->date->month);
     $pdf = PDF::loadView('enroll.docs.disclaimer', ['race' => $race, 'month' => $month])->setPaper('a4')->setOrientation('portrait');
     return $pdf->stream('disclaimer.pdf');
 }
示例#12
0
 /**
  * [run description]
  * @return [type] [description]
  */
 public function run()
 {
     DB::table('races')->delete();
     Race::create(array('type' => 'relay', 'status' => 'completed'));
 }
示例#13
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     //
     return view('admin.incident.create')->withAttrs(Attr::all())->withRaces(Race::all())->withJobs(Job::all());
 }
示例#14
0
 /**
  * 卡片更新页面
  * @param $id
  * @return mixed
  */
 public function edit($id)
 {
     return view('admin.card.edit')->withCard(Card::find($id))->withAttrs(Attr::all())->withRaces(Race::all())->withJobs(Job::all())->withSkills(Skill::all());
 }
示例#15
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     return view('admin.skill.skill')->withSkills(Skill::all())->withAttrs(Attr::all())->withRaces(Race::all())->withJobs(Job::all());
 }