public void exitDialog() { GameObject go = GameObject.Find("dialogGO"); if (!!go) { uiDialogController = go.GetComponentInChildren <UIDialogController>(); } if (uiDialogController != null && dialogUI != null) { uiDialogController.show(false); } dialogStarted = false; if (!!resetDialog) { dialogController.resetDialog(); } }
// DIALOG NT METHODS // ======================================================= public void dialog() { //RESOLVE EFFECT OF THE NEW MESSAGE if (!!capturedPlayerControlled) { bool tryDialog = false; if (!dialogStarted) { if (dialogController != null) { uiDialogController = dialogUI.GetComponentInChildren <UIDialogController>(true); string newMessage = dialogController.getMessage(); if ((newMessage != null) && (uiDialogController != null)) { uiDialogController.message = newMessage; if (!!uiDialogController) { uiDialogController.show(true); } dialogStarted = true; tryDialog = true; } } } else { if (dialogController != null) { tryDialog = dialogController.tryPursueDialog(); if (!tryDialog) { exitDialog(); } else // PURSUE DIALOG { string newMessage = dialogController.getMessage(); if ((newMessage != null) && (uiDialogController != null)) { uiDialogController.message = newMessage; } } } } if (dialogController != null && uiDialogController != null) { uiDialogController.response = dialogController.getSelectedAnswer(); } // MUTILATE PLAYER PlayerState ps = capturedPlayerControlled.GetComponent <PlayerState>(); if (!!ps && tryDialog) { DBlock.DBLOCK_EFFECTS q_effect = dialogController.getQuestionBlockEffect(); DBlock.DBLOCK_EFFECTS a_effect = dialogController.getResponseBlockEffect(); bool playerMutilated = ps.mutilate(q_effect) || ps.mutilate(a_effect); if (!!playerMutilated) { List <INPCType> doorguards = _attachedNPC.getINTRefs(NPCTypeNames.doorguard); foreach (INPCType doorguard in doorguards) { doorguard.action2(); doorguard.action(); } } // CHECK FOR A NEXT CINEMATIC STEP if ((q_effect == DBlock.DBLOCK_EFFECTS.NEXT_CINEMATIC_STEP) || (a_effect == DBlock.DBLOCK_EFFECTS.NEXT_CINEMATIC_STEP)) { List <INPCType> cinematics = _attachedNPC.getINTRefs(NPCTypeNames.cinematic); foreach (INPCType c in cinematics) { c.action(); } } } //ps && tryPlayer } //! captured player } //! dialog