Advertisement
ticktockgames

CGFDirectorNodeLibrary.as Example

Jun 18th, 2013
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.blogger.ticktockgames.cgf.data
  2. {
  3.     import com.blogger.ticktockgames.cgf.CGFGameModelInterface;
  4.     import com.blogger.ticktockgames.epok.data.DirectorNodeLibrary;
  5.     import com.blogger.ticktockgames.epok.data.DialogChoice;
  6.     import com.blogger.ticktockgames.epok.data.DialogContent;
  7.     import com.blogger.ticktockgames.epok.data.DirectorNode;
  8.     import com.blogger.ticktockgames.epok.utils.DLog;
  9.    
  10.     import flash.utils.getDefinitionByName;
  11.     import flash.utils.getQualifiedClassName;
  12.    
  13.     import flash.utils.getDefinitionByName;
  14.     import flash.utils.getQualifiedClassName;
  15.  
  16.     /*
  17.     *   This is an autogenerated class.
  18.     *   Do not edit this file directly.
  19.     *   Change the corresponding XML file labeled CGFDirectorNodeLibrary.xml
  20.     */
  21.  
  22.     public class CGFDirectorNodeLibrary extends DirectorNodeLibrary
  23.     {
  24.         public function CGFDirectorNodeLibrary():void
  25.         {
  26.             // Do nothing
  27.         }
  28.         /*
  29.         public static function getNodeById( idStr:String ):DirectorNode
  30.         {
  31.             //var className:Class = getLibraryClass();
  32.             //var targetFunction:Function = className[idStr]
  33.             //var targetFunction:Function = className[idStr] as Function;
  34.            
  35.             var resultNode:DirectorNode = CGFDirectorNodeLibrary[idStr]();
  36.  
  37.             // Check if function is valid
  38.             if( resultNode === null)
  39.             {
  40.                 DLog.e( "DirectorNodeLibrary.getNodeById(" + idStr.toString() + ")", "Function returned invalid.");
  41.                 return null;   
  42.             }
  43.            
  44.             return resultNode = CGFDirectorNodeLibrary[idStr]();
  45.             //return resultNode = className.targetFunction() as DirectorNode;
  46.         }
  47.         */
  48.         protected override function getLibraryClass():Class
  49.         {
  50.             return CGFDirectorNodeLibrary;
  51.         }
  52.            
  53.         public static function KarensHouse_1():DirectorNode
  54.         {
  55.                     var resultNode:DirectorNode = new DirectorNode();
  56.  
  57.                 var textId:String = "KarensHouse_1";
  58.                 var choiceListArray:Array = new Array();
  59.                 var nextNodeListArray:Array = new Array();
  60.                 var onEnterFunc:Function;
  61.                 var onExitFunc:Function;
  62.                 var conditionFunc:Function;
  63.                 onEnterFunc = function(){
  64.                     // Insert Enter code here
  65.                     return;
  66.                 };
  67.            
  68.                 onExitFunc = function(){
  69.                     // Insert Exit code here
  70.                     return;
  71.                 };
  72.            
  73.                 conditionFunc = function(){
  74.                     return true;
  75.                 };
  76.            
  77.                 var dialogText:DialogContent = new DialogContent( "I can't believe Katie didn't show up to my 30th. She was so excited about it. It's just not like her to flake on me.", "Karen", null);
  78.  
  79.                 // choice list goes here
  80.                 nextNodeListArray.push( "KarensHouse_2" );
  81.  
  82.                 resultNode.init( textId,
  83.                     dialogText,
  84.                     nextNodeListArray,
  85.                     choiceListArray,
  86.                     onEnterFunc,
  87.                     onExitFunc,
  88.                     conditionFunc );
  89.  
  90.                 return resultNode;
  91.  
  92.         } // function KarensHouse_1
  93.            
  94.         public static function KarensHouse_2():DirectorNode
  95.         {
  96.                     var resultNode:DirectorNode = new DirectorNode();
  97.  
  98.                 var textId:String = "KarensHouse_2";
  99.                 var choiceListArray:Array = new Array();
  100.                 var nextNodeListArray:Array = new Array();
  101.                 var onEnterFunc:Function;
  102.                 var onExitFunc:Function;
  103.                 var conditionFunc:Function;
  104.                 onEnterFunc = function(){
  105.                     // Insert Enter code here
  106.                     return;
  107.                 };
  108.            
  109.                 onExitFunc = function(){
  110.                     // Insert Exit code here
  111.                     return;
  112.                 };
  113.            
  114.                 conditionFunc = function(){
  115.                     return true;
  116.                 };
  117.            
  118.                 var dialogText:DialogContent = new DialogContent( "", "", null);
  119.  
  120.                 // choice list goes here
  121.                 choiceListArray.push( new DialogChoice( "KarensHouse_3", "Check Voicemail" ) );
  122.                 choiceListArray.push( new DialogChoice( "KarensHouse_4", "Call Katie" ) );
  123.                 choiceListArray.push( new DialogChoice( "KarensHouse_6", "Call Police" ) );
  124.                 choiceListArray.push( new DialogChoice( "KarensHouse_5", "Leave" ) );
  125.  
  126.                 // Next Node list goes here
  127.  
  128.                 resultNode.init( textId,
  129.                     dialogText,
  130.                     nextNodeListArray,
  131.                     choiceListArray,
  132.                     onEnterFunc,
  133.                     onExitFunc,
  134.                     conditionFunc );
  135.  
  136.                 return resultNode;
  137.  
  138.         } // function KarensHouse_2
  139.            
  140.         public static function KarensHouse_3():DirectorNode
  141.         {
  142.                     var resultNode:DirectorNode = new DirectorNode();
  143.  
  144.                 var textId:String = "KarensHouse_3";
  145.                 var choiceListArray:Array = new Array();
  146.                 var nextNodeListArray:Array = new Array();
  147.                 var onEnterFunc:Function;
  148.                 var onExitFunc:Function;
  149.                 var conditionFunc:Function;
  150.                 onEnterFunc = function(){
  151.                     var flags = CGFGameModelInterface.getDirectorFlags();
  152.                     flags.setFlagByName("KarensHouse_3", 1);
  153.                     return;
  154.                 };
  155.            
  156.                 onExitFunc = function(){
  157.                     // Insert Exit code here
  158.                     return;
  159.                 };
  160.            
  161.                 conditionFunc = function(){
  162.                     var flags = CGFGameModelInterface.getDirectorFlags();
  163.                     return flags.getFlagValueByName("KarensHouse_3") != 1;
  164.                 };
  165.            
  166.                 var dialogText:DialogContent = new DialogContent( "Karen Checks her voicemail.", "", null);
  167.  
  168.                 // choice list goes here
  169.                 nextNodeListArray.push( "KarensHouse_10" );
  170.  
  171.                 resultNode.init( textId,
  172.                     dialogText,
  173.                     nextNodeListArray,
  174.                     choiceListArray,
  175.                     onEnterFunc,
  176.                     onExitFunc,
  177.                     conditionFunc );
  178.  
  179.                 return resultNode;
  180.  
  181.         } // function KarensHouse_3
  182.            
  183.         public static function KarensHouse_4():DirectorNode
  184.         {
  185.                     var resultNode:DirectorNode = new DirectorNode();
  186.  
  187.                 var textId:String = "KarensHouse_4";
  188.                 var choiceListArray:Array = new Array();
  189.                 var nextNodeListArray:Array = new Array();
  190.                 var onEnterFunc:Function;
  191.                 var onExitFunc:Function;
  192.                 var conditionFunc:Function;
  193.                 onEnterFunc = function(){
  194.                     var flags = CGFGameModelInterface.getDirectorFlags();
  195.                     flags.setFlagByName("KarensHouse_4", 1);
  196.                     return;
  197.                 };
  198.            
  199.                 onExitFunc = function(){
  200.                     // Insert Exit code here
  201.                     return;
  202.                 };
  203.            
  204.                 conditionFunc = function(){
  205.                     var flags = CGFGameModelInterface.getDirectorFlags();
  206.                     return flags.getFlagValueByName("KarensHouse_4") != 1;
  207.                 };
  208.            
  209.                 var dialogText:DialogContent = new DialogContent( "Karen calls Katie", "", null);
  210.  
  211.                 // choice list goes here
  212.                 nextNodeListArray.push( "KarensHouse_11" );
  213.  
  214.                 resultNode.init( textId,
  215.                     dialogText,
  216.                     nextNodeListArray,
  217.                     choiceListArray,
  218.                     onEnterFunc,
  219.                     onExitFunc,
  220.                     conditionFunc );
  221.  
  222.                 return resultNode;
  223.  
  224.         } // function KarensHouse_4
  225.            
  226.         public static function KarensHouse_5():DirectorNode
  227.         {
  228.                     var resultNode:DirectorNode = new DirectorNode();
  229.  
  230.                 var textId:String = "KarensHouse_5";
  231.                 var choiceListArray:Array = new Array();
  232.                 var nextNodeListArray:Array = new Array();
  233.                 var onEnterFunc:Function;
  234.                 var onExitFunc:Function;
  235.                 var conditionFunc:Function;
  236.                 onEnterFunc = function(){
  237.                     // Insert Enter code here
  238.                     return;
  239.                 };
  240.            
  241.                 onExitFunc = function(){
  242.                     // Insert Exit code here
  243.                     return;
  244.                 };
  245.            
  246.                 conditionFunc = function(){
  247.                     return true;
  248.                 };
  249.            
  250.                 var dialogText:DialogContent = new DialogContent( "", "", null);
  251.  
  252.                 // choice list goes here
  253.                 nextNodeListArray.push( "KarensHouse_7" );
  254.                 nextNodeListArray.push( "KarensHouse_8" );
  255.  
  256.                 resultNode.init( textId,
  257.                     dialogText,
  258.                     nextNodeListArray,
  259.                     choiceListArray,
  260.                     onEnterFunc,
  261.                     onExitFunc,
  262.                     conditionFunc );
  263.  
  264.                 return resultNode;
  265.  
  266.         } // function KarensHouse_5
  267.            
  268.         public static function KarensHouse_6():DirectorNode
  269.         {
  270.                     var resultNode:DirectorNode = new DirectorNode();
  271.  
  272.                 var textId:String = "KarensHouse_6";
  273.                 var choiceListArray:Array = new Array();
  274.                 var nextNodeListArray:Array = new Array();
  275.                 var onEnterFunc:Function;
  276.                 var onExitFunc:Function;
  277.                 var conditionFunc:Function;
  278.                 onEnterFunc = function(){
  279.                     var flags = CGFGameModelInterface.getDirectorFlags();
  280.                     flags.setFlagByName("KarensHouse_6", 1);
  281.                     return;
  282.                 };
  283.            
  284.                 onExitFunc = function(){
  285.                     // Insert Exit code here
  286.                     return;
  287.                 };
  288.            
  289.                 conditionFunc = function(){
  290.                     var flags = CGFGameModelInterface.getDirectorFlags();
  291.                     return (flags.getFlagValueByName("KarensHouse_6") == 0 && flags.getFlagValueByName("KarensHouse_9") == 1);
  292.                 };
  293.            
  294.                 var dialogText:DialogContent = new DialogContent( "Maybe I should just do what he says. I don't want to risk it.", "Karen", null);
  295.  
  296.                 // choice list goes here
  297.                 nextNodeListArray.push( "KarensHouse_2" );
  298.  
  299.                 resultNode.init( textId,
  300.                     dialogText,
  301.                     nextNodeListArray,
  302.                     choiceListArray,
  303.                     onEnterFunc,
  304.                     onExitFunc,
  305.                     conditionFunc );
  306.  
  307.                 return resultNode;
  308.  
  309.         } // function KarensHouse_6
  310.            
  311.         public static function KarensHouse_7():DirectorNode
  312.         {
  313.                     var resultNode:DirectorNode = new DirectorNode();
  314.  
  315.                 var textId:String = "KarensHouse_7";
  316.                 var choiceListArray:Array = new Array();
  317.                 var nextNodeListArray:Array = new Array();
  318.                 var onEnterFunc:Function;
  319.                 var onExitFunc:Function;
  320.                 var conditionFunc:Function;
  321.                 onEnterFunc = function(){
  322.                     return;
  323.                 };
  324.            
  325.                 onExitFunc = function(){
  326.                     // Insert Exit code here
  327.                     return;
  328.                 };
  329.            
  330.                 conditionFunc = function(){
  331.                     var flags = CGFGameModelInterface.getDirectorFlags();
  332.                     return (flags.getFlagValueByName("KarensHouse_9") == 0);
  333.                 };
  334.            
  335.                 var dialogText:DialogContent = new DialogContent( "I don't even know where she would be.", "Karen", null);
  336.  
  337.                 // choice list goes here
  338.                 nextNodeListArray.push( "KarensHouse_2" );
  339.  
  340.                 resultNode.init( textId,
  341.                     dialogText,
  342.                     nextNodeListArray,
  343.                     choiceListArray,
  344.                     onEnterFunc,
  345.                     onExitFunc,
  346.                     conditionFunc );
  347.  
  348.                 return resultNode;
  349.  
  350.         } // function KarensHouse_7
  351.            
  352.         public static function KarensHouse_8():DirectorNode
  353.         {
  354.                     var resultNode:DirectorNode = new DirectorNode();
  355.  
  356.                 var textId:String = "KarensHouse_8";
  357.                 var choiceListArray:Array = new Array();
  358.                 var nextNodeListArray:Array = new Array();
  359.                 var onEnterFunc:Function;
  360.                 var onExitFunc:Function;
  361.                 var conditionFunc:Function;
  362.                 onEnterFunc = function(){
  363.                     return;
  364.                 };
  365.            
  366.                 onExitFunc = function(){
  367.                     // Insert Exit code here
  368.                     return;
  369.                 };
  370.            
  371.                 conditionFunc = function(){
  372.                     return true;
  373.                 };
  374.            
  375.                 var dialogText:DialogContent = new DialogContent( "Karen leaves her home.", "Tommy", null);
  376.  
  377.                 // choice list goes here
  378.  
  379.                 resultNode.init( textId,
  380.                     dialogText,
  381.                     nextNodeListArray,
  382.                     choiceListArray,
  383.                     onEnterFunc,
  384.                     onExitFunc,
  385.                     conditionFunc );
  386.  
  387.                 return resultNode;
  388.  
  389.         } // function KarensHouse_8
  390.            
  391.         public static function KarensHouse_9():DirectorNode
  392.         {
  393.                     var resultNode:DirectorNode = new DirectorNode();
  394.  
  395.                 var textId:String = "KarensHouse_9";
  396.                 var choiceListArray:Array = new Array();
  397.                 var nextNodeListArray:Array = new Array();
  398.                 var onEnterFunc:Function;
  399.                 var onExitFunc:Function;
  400.                 var conditionFunc:Function;
  401.                 onEnterFunc = function(){
  402.                     var flags = CGFGameModelInterface.getDirectorFlags();
  403.                     flags.setFlagByName("KarensHouse_9", 1);
  404.                     return;
  405.                 };
  406.            
  407.                 onExitFunc = function(){
  408.                     // Insert Exit code here
  409.                     return;
  410.                 };
  411.            
  412.                 conditionFunc = function(){
  413.                 return true;
  414.                 };
  415.            
  416.                 var dialogText:DialogContent = new DialogContent( "Hey Karen, it's Tommy, your former brother-in-law. Katie here wishes you a happy birthday too... I'd pass the phone to her but she's a little... tied up at the moment. If you ever want to see her again you'll do exactly as I say. Meet me tonight at 888 Brannen Street. And don't try anything unless you want to become an only child. See ya soon, kiddo. *Click*", "Tommy", null);
  417.  
  418.                 // choice list goes here
  419.                 nextNodeListArray.push( "KarensHouse_2" );
  420.  
  421.                 resultNode.init( textId,
  422.                     dialogText,
  423.                     nextNodeListArray,
  424.                     choiceListArray,
  425.                     onEnterFunc,
  426.                     onExitFunc,
  427.                     conditionFunc );
  428.  
  429.                 return resultNode;
  430.  
  431.         } // function KarensHouse_9
  432.            
  433.         public static function KarensHouse_10():DirectorNode
  434.         {
  435.                     var resultNode:DirectorNode = new DirectorNode();
  436.  
  437.                 var textId:String = "KarensHouse_10";
  438.                 var choiceListArray:Array = new Array();
  439.                 var nextNodeListArray:Array = new Array();
  440.                 var onEnterFunc:Function;
  441.                 var onExitFunc:Function;
  442.                 var conditionFunc:Function;
  443.                 onEnterFunc = function(){
  444.                     return;
  445.                 };
  446.            
  447.                 onExitFunc = function(){
  448.                     // Insert Exit code here
  449.                     return;
  450.                 };
  451.            
  452.                 conditionFunc = function(){
  453.                     return true;
  454.                 };
  455.            
  456.                 var dialogText:DialogContent = new DialogContent( "Happy birthday to you...", "????", null);
  457.  
  458.                 // choice list goes here
  459.                 nextNodeListArray.push( "KarensHouse_9" );
  460.  
  461.                 resultNode.init( textId,
  462.                     dialogText,
  463.                     nextNodeListArray,
  464.                     choiceListArray,
  465.                     onEnterFunc,
  466.                     onExitFunc,
  467.                     conditionFunc );
  468.  
  469.                 return resultNode;
  470.  
  471.         } // function KarensHouse_10
  472.            
  473.         public static function KarensHouse_11():DirectorNode
  474.         {
  475.                     var resultNode:DirectorNode = new DirectorNode();
  476.  
  477.                 var textId:String = "KarensHouse_11";
  478.                 var choiceListArray:Array = new Array();
  479.                 var nextNodeListArray:Array = new Array();
  480.                 var onEnterFunc:Function;
  481.                 var onExitFunc:Function;
  482.                 var conditionFunc:Function;
  483.                 onEnterFunc = function(){
  484.                     return;
  485.                 };
  486.            
  487.                 onExitFunc = function(){
  488.                     // Insert Exit code here
  489.                     return;
  490.                 };
  491.            
  492.                 conditionFunc = function(){
  493.                     return true;
  494.                 };
  495.            
  496.                 var dialogText:DialogContent = new DialogContent( "Hi this is Katie. I'm not here right now, but if you leave you name number, and message I'll get back to you as soon as I can! *Beep*", "Katie", null);
  497.  
  498.                 // choice list goes here
  499.                 nextNodeListArray.push( "KarensHouse_2" );
  500.  
  501.                 resultNode.init( textId,
  502.                     dialogText,
  503.                     nextNodeListArray,
  504.                     choiceListArray,
  505.                     onEnterFunc,
  506.                     onExitFunc,
  507.                     conditionFunc );
  508.  
  509.                 return resultNode;
  510.  
  511.         } // function KarensHouse_11
  512.            
  513.     } // class
  514. } // package
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement