Exemple #1
0
        // Returning `true` means it ran a custom menu update. `false` means the menu needs to be updated manually.
        public override bool RunCustomMenuUpdate()
        {
            List <byte> rulesToShow = new List <byte>();

            // Add Rules that are present for this menu:
            this.AddRulesToShow(new string[] { "hp", "armor", "suit", "hat", "shoes", "mob", "att" }, ref rulesToShow);

            short attType = WandData.GetParamVal(WandData.actParamSet, "att");

            if (attType == 2)
            {
                this.AddRulesToShow(new string[] { "weapon" }, ref rulesToShow);
            }
            else if (attType == 3)
            {
                this.AddRulesToShow(new string[] { "spell" }, ref rulesToShow);
            }
            else if (attType == 4)
            {
                this.AddRulesToShow(new string[] { "thrown" }, ref rulesToShow);
            }
            else if (attType == 5)
            {
                this.AddRulesToShow(new string[] { "bolt" }, ref rulesToShow);
            }

            byte[] ruleIdsToShow = rulesToShow.ToArray();
            WandData.actParamMenu.UpdateMenuOptions((byte)ruleIdsToShow.Length, ruleIdsToShow);
            return(true);
        }
Exemple #2
0
        // This override will check the "fly" group param, and show the appropriate rule accordingly.
        public override bool RunCustomMenuUpdate()
        {
            short flightVal = WandData.GetParamVal(WandData.moveParamSet, "fly");

            List <byte> rulesToShow = new List <byte>();

            // Add Rules that are present for this menu:
            this.AddRulesToShow(new string[] { "fly" }, ref rulesToShow);

            if (flightVal != 0)
            {
                this.AddRulesToShow(new string[] { "duration" }, ref rulesToShow);
            }

            switch (flightVal)
            {
            // X, Y, Reverse, Cluster Link, Cluster ID
            case (byte)FlightMovement.Axis:
                this.AddRulesToShow(new string[] { "durOffset", "x", "y", "reverse", "toCluster" }, ref rulesToShow);
                break;

            // X, Y, MidX, MidY, Reverse, Cluster Link, Cluster ID
            case (byte)FlightMovement.Quadratic:
                this.AddRulesToShow(new string[] { "durOffset", "x", "y", "midX", "midY", "reverse", "toCluster" }, ref rulesToShow);
                break;

            // Diameter, Reverse, Cluster Link, Cluster ID
            case (byte)FlightMovement.Circle:
                this.AddRulesToShow(new string[] { "durOffset", "diameter", "reverse", "toCluster", "rel" }, ref rulesToShow);
                break;

            // X, Y, Countdown, Cluster ID
            case (byte)FlightMovement.To:
                this.AddRulesToShow(new string[] { "x", "y", "countdown" }, ref rulesToShow);
                break;

            // Track, Cluster ID
            case (byte)FlightMovement.Track:
                this.AddRulesToShow(new string[] { "durOffset", "toTrack" }, ref rulesToShow);
                break;
            }

            byte[] ruleIdsToShow = rulesToShow.ToArray();
            WandData.moveParamMenu.UpdateMenuOptions((byte)ruleIdsToShow.Length, ruleIdsToShow);
            return(true);
        }