コード例 #1
0
        static void InteractionTrap2Interaction(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));
            }
            furnishing.InteractionTrapName = null;
            furnishing.SetOtherAttribute("TrapType", null);
            furnishing.SetOtherAttribute("TrapLevel", null);
        }
コード例 #2
0
 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));
     }
 }
コード例 #3
0
 // 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));
     }
 }