Example #1
0
        static void InteractionTrap1Interaction(Furnishing furnishing, Actor actor)
        {
            var trapLevel = int.Parse(furnishing.GetOtherAttributeValue("TrapLevel"));

            if (actor.HasTrait(Trait.Player))
            {
                MainGraphicDisplay.TextConsole.AddOutputText(string.Format("Trap hits you for {0} damage", trapLevel));
            }
        }
Example #2
0
 static void TestInteractionFunction1(Furnishing furnishing, Actor actor)
 {
     if (furnishing.HasTrait(Trait.BlockMove))
     {
         furnishing.RemoveTrait(Trait.BlockMove);
     }
     else
     {
         furnishing.AddTrait(Trait.BlockMove);
     }
 }
 static void SetupExtraParameters(Furnishing furnishing, Dictionary <string, string> otherParameters)
 {
     if (otherParameters.ContainsKey("LevelTransition"))
     {
         SetupLevelTransitionObject(furnishing, otherParameters);
     }
     if (otherParameters.ContainsKey("InteractionTrap"))
     {
         SetupInteractionTrap(furnishing, otherParameters);
     }
 }
Example #4
0
        static void LevelTransitionInteraction(Furnishing furnishing, Actor actor)
        {
            if (actor.HasTrait(Trait.Player))
            {
                var destinationLevel = (Levels.LevelId)Enum.Parse(typeof(Levels.LevelId),
                                                                  furnishing.GetOtherAttributeValue("DestinationLevel"));
                var destinationXLoc = int.Parse(furnishing.GetOtherAttributeValue("DestinationXLoc"));
                var destinationYLoc = int.Parse(furnishing.GetOtherAttributeValue("DestinationYLoc"));

                MainProgram.LevelTransition(destinationLevel, destinationXLoc, destinationYLoc);
            }
        }
 static void SetupInteractionTrap(Furnishing furnishing, Dictionary <string, string> otherParameters)
 {
     if (otherParameters.ContainsKey("TrapType") && otherParameters.ContainsKey("TrapLevel"))
     {
         furnishing.SetOtherAttribute("TrapType", otherParameters["TrapType"]);
         furnishing.SetOtherAttribute("TrapLevel", otherParameters["TrapLevel"]);
         furnishing.InteractionTrapName = otherParameters["TrapType"] + "Interaction";
     }
     else
     {
         ErrorLogger.AddDebugText(string.Format("Incorrect Interaction Trap Specification at: {0}, {1}",
                                                furnishing.XLoc, furnishing.YLoc));
     }
 }
 // General setup functions or "Add-ons"
 static void SetupLevelTransitionObject(Furnishing furnishing, Dictionary <string, string> otherParameters)
 {
     if (otherParameters.ContainsKey("DestinationLevel") && otherParameters.ContainsKey("DestinationXLoc") &&
         otherParameters.ContainsKey("DestinationYLoc"))
     {
         furnishing.SetOtherAttribute("DestinationLevel", otherParameters["DestinationLevel"]);
         furnishing.SetOtherAttribute("DestinationXLoc", otherParameters["DestinationXLoc"]);
         furnishing.SetOtherAttribute("DestinationYLoc", otherParameters["DestinationYLoc"]);
         furnishing.InteractionFunctionName = "LevelTransitionInteraction";
     }
     else
     {
         ErrorLogger.AddDebugText(string.Format("Incorrect Level Transition Object Specification at: {0}, {1}",
                                                furnishing.XLoc, furnishing.YLoc));
     }
 }
 // Specific Furnishing Setup Functions
 static void TestFurnishingSetup1(Furnishing furnishing, Dictionary <string, string> otherParameters)
 {
     furnishing._interactionFunction = "TestInteractionFunction1";
 }