예제 #1
0
 //set labels to appropriate values and set flags for conversion type to be checked in calculation function
 private void setConverter(string inputLabel, string outputLabel, double conversionRate, convType type)
 {
     grpInput.Text = inputLabel;
     grpOutput.Text = outputLabel;
     this.conversionRate = conversionRate;
     if (type == convType.SIMPLE)
     {
         simpleConversion = true;
         celToFahr = false;
         fahrToCell = false;
     }
     else if (type == convType.CELTOFAHR)
     {
         simpleConversion = false;
         celToFahr = true;
         fahrToCell = false;
     }
     else
     {
         simpleConversion = false;
         celToFahr = false;
         fahrToCell = true;
     }
 }
예제 #2
0
        /// <summary>
        /// Returns a script that either makes the player begin a explore or escort quest
        /// </summary>
        /// <param name="triggerHappens">Whether it is a escort or explore mission</param>
        /// <param name="convHappens">Whether it should be a escort or explore quest</param>
        /// <param name="actor">The actor that gives the conversation</param>
        /// <param name="trigger">The trigger that will mark the end of </param>
        /// <param name="Name">The name of the story node</param>
        /// <returns>The script functor</returns>
        private static NWN2ScriptFunctor EscortExplore(convType triggerHappens, convType convHappens, Actor actor, Actor trigger, String Name)
        {
            String tempStringName = "";
            String tempStringValue = "";
            NWN2ScriptFunctor EscortExploreFunctor = new NWN2ScriptFunctor();
            if (triggerHappens != convType.None)
                {
                if (convHappens == convType.Escort)
                    {
                    tempStringName = "sCreatureToEscort";
                    tempStringValue = actor.Tag;
                    }
                else if (convHappens == convType.Explore)
                    {
                    tempStringName = "sTriggerToFind";
                    tempStringValue = trigger.Tag;
                    }

                if (tempStringName != "")
                    {
                    EscortExploreFunctor.Script = makeScript("ga_global_string");

                    // I add the parameters
                    setParam(ref EscortExploreFunctor, 0, tempStringName);
                    setParam(ref EscortExploreFunctor, 1, tempStringValue);
                    }
                else
                    {
                    throw new Exception("There is something wrong in " + Name + " - go back and check its escort/explore values");
                    }
                }
            return EscortExploreFunctor;
        }