Esempio n. 1
0
 public function addComboDiscipline($comboData)
 {
     $comboRecord = $this->findOneWhere('CharacterComboDiscipline', 'combo_id', $comboData['id']);
     if (!$comboRecord) {
         $comboDefinition = RulebookComboDiscipline::firstOrCreate(["owner_id" => $this->character_id, "name" => $comboData["name"], "option1" => $comboData["option1"], "option2" => $comboData["option2"], "option3" => strlen($comboData["option3"]) == 0 ? null : $comboData["option3"], "description" => $comboData["description"]]);
         $comboRecord = $this->createNewRecord("CharacterComboDiscipline");
         $comboRecord->combo_id = $comboDefinition->id;
         if ($this->editingAsStoryteller()) {
             $comboRecord->free_points = $comboDefinition->cost($this->character_id);
         }
         $comboRecord->save();
     }
     $this->touchedRecords["CharacterComboDiscipline"][] = $comboRecord->id;
 }