public static NPCDialogDico endgameGood() { NPCDialogDico dico = new NPCDialogDico(); // CREATE CELLS QBlock q0 = new QBlock("I shall be yours as you prove your valor."); DialogCell cell0 = new DialogCell(q0); dico.addDialogCell(cell0); QBlock q1 = new QBlock("You're a valourous knight!"); DialogCell cell1 = new DialogCell(q1); dico.addDialogCell(cell1); // UPDATE LINKS cell0.defaultSuccessorID = cell1.getID(); // SET STARTING CELL dico.setStartingCellFromID(cell0.getID()); dico.finishDicoCreation(); return(dico); }
public DialogCell getNextDialogCellFromCurrentDCell(DialogCell iDialogCell) { DialogCell nextCell = null; if (iDialogCell != null) { ABlock selectedAnswer = iDialogCell.selectedAnswer; string defaultSuccessorID = iDialogCell.defaultSuccessorID; string answerSuccessorID = (selectedAnswer != null) ? selectedAnswer.successor_dcell_ID : ""; string successorID = (answerSuccessorID.Length > 0) ? answerSuccessorID : defaultSuccessorID; Debug.Log(" SUCCESSOR ID " + successorID); if (successorID.Length <= 0) { return(null); } foreach (DialogCell dcell in loadedCells) { if (dcell.getID() == successorID) { nextCell = dcell; break; } }//! foreach activeAnswer } return(nextCell); }
public static NPCDialogDico endgameBad() { NPCDialogDico dico = new NPCDialogDico(); // CREATE CELLS QBlock q0 = new QBlock("Look at yourself! You're not a hero!"); DialogCell cell0 = new DialogCell(q0); dico.addDialogCell(cell0); QBlock q1 = new QBlock("You made it.. but at what cost?"); DialogCell cell1 = new DialogCell(q1); dico.addDialogCell(cell1); // UPDATE LINKS cell0.defaultSuccessorID = cell1.getID(); // SET STARTING CELL dico.setStartingCellFromID(cell0.getID()); dico.finishDicoCreation(); return(dico); }
public static NPCDialogDico princess() { NPCDialogDico dico = new NPCDialogDico(); // CREATE CELLS QBlock q0 = new QBlock("Help meeeeeeee!"); DialogCell cell0 = new DialogCell(q0); dico.addDialogCell(cell0); QBlock q1 = new QBlock("Someone please help me !!"); DialogCell cell1 = new DialogCell(q1); dico.addDialogCell(cell1); QBlock q2 = new QBlock("", DBlock.DBLOCK_EFFECTS.NEXT_CINEMATIC_STEP); DialogCell cell2 = new DialogCell(q2); dico.addDialogCell(cell2); // UPDATE LINKS cell0.defaultSuccessorID = cell1.getID(); cell1.defaultSuccessorID = cell2.getID(); // SET STARTING CELL dico.setStartingCellFromID(cell0.getID()); dico.finishDicoCreation(); return(dico); }
public void addDialogCell(DialogCell iDCell) { if (loadedCells == null) { loadedCells = new List <DialogCell>(); } loadedCells.Add(iDCell); }
public void init(int iDialogID) { NPCDialogDico loadDico = null; DialogBank.loadDicoFromID(iDialogID, out loadDico); npcDialogDico = loadDico; if (null == npcDialogDico) { Debug.Log("wtf ? " + iDialogID); } else { activeDCell = npcDialogDico.startingCell; } }
public static NPCDialogDico wizard1() { NPCDialogDico dico = new NPCDialogDico(); // CREATE CELLS QBlock q0 = new QBlock("Wizard : Good morning sir."); DialogCell cell0 = new DialogCell(q0); dico.addDialogCell(cell0); QBlock q1 = new QBlock("Beautiful Princess, heh?"); DialogCell cell1 = new DialogCell(q1); dico.addDialogCell(cell1); QBlock q2 = new QBlock("I can help you pass this weird door but it will cost you an arm."); ABlock a21 = new ABlock("OK, Let's do this !"); ABlock a22 = new ABlock("No way I'm doing it."); DialogCell cell2 = new DialogCell(q2); cell2.addAnswer(a21); cell2.addAnswer(a22); dico.addDialogCell(cell2); QBlock q3 = new QBlock("You made the right decision my friend!", DBlock.DBLOCK_EFFECTS.LOSE_ARM); DialogCell cell3 = new DialogCell(q3); dico.addDialogCell(cell3); QBlock q4 = new QBlock("As you wish..."); DialogCell cell4 = new DialogCell(q4); dico.addDialogCell(cell4); // UPDATE LINKS cell0.defaultSuccessorID = cell1.getID(); cell1.defaultSuccessorID = cell2.getID(); a21.successor_dcell_ID = cell3.getID(); a22.successor_dcell_ID = cell4.getID(); // SET STARTING CELL dico.setStartingCellFromID(cell0.getID()); dico.finishDicoCreation(); return(dico); }
public bool tryPursueDialog() { bool rc = true; if (activeDCell == null) { rc = false; } else if (activeDCell.isFinalBlock()) { rc = false; } else { DialogCell cellCopy = activeDCell; activeDCell = npcDialogDico.getNextDialogCellFromCurrentDCell(cellCopy); rc = (activeDCell != null); } return(rc); }
public void resetDialog() { activeDCell = npcDialogDico.startingCell; }