Ejemplo n.º 1
0
        private void PunishMental(ref int index)
        {
            var mentalLoss = (uint)(GameResourceBook.OutMentalSceneQuest(config.PunishMental) * (10 + hardness) / 10);

            if (mentalLoss > 0)
            {
                UserProfile.Profile.InfoBasic.SubMental(mentalLoss);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Mental, (int)-mentalLoss);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 2
0
        private void PunishGold(ref int index)
        {
            var goldLoss = (uint)(GameResourceBook.OutGoldSceneQuest(level, config.PunishGold) * (10 + hardness) / 10);

            if (goldLoss > 0)
            {
                UserProfile.Profile.InfoBag.SubResource(GameResourceType.Gold, goldLoss);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25),
                                                                   60, ImageRegionCellType.Gold, (int)-goldLoss);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 3
0
        private void RewardStr(ref int index)
        {
            var strGet = config.RewardStr;

            if (strGet > 0 && UserProfile.InfoDungeon.Str >= 0)
            {
                UserProfile.InfoDungeon.ChangeAttr(strGet, 0, 0, 0, 0);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25),
                                                                   60, ImageRegionCellType.Str, strGet);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 4
0
        private void RewardEndu(ref int index)
        {
            var enduGet = config.RewardEndu;

            if (enduGet > 0 && UserProfile.InfoDungeon.Endu >= 0)
            {
                UserProfile.InfoDungeon.ChangeAttr(0, 0, 0, 0, enduGet);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25),
                                                                   60, ImageRegionCellType.Endu, enduGet);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 5
0
        private void RewardGold(ref int index)
        {
            var goldGet = (uint)(GameResourceBook.InGoldSceneQuest(level, config.RewardGold) * (10 + hardness) / 10); //难度越高资源越多

            if (goldGet > 0)
            {
                UserProfile.Profile.InfoBag.AddResource(GameResourceType.Gold, goldGet);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25),
                                                                   60, ImageRegionCellType.Gold, (int)goldGet);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 6
0
        private void RewardFood(ref int index)
        {
            var foodGet = (uint)(GameResourceBook.InFoodSceneQuest(config.RewardFood) * (10 - hardness) / 10);

            if (foodGet > 0)
            {
                UserProfile.Profile.InfoBasic.AddFood(foodGet);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25),
                                                                   60, ImageRegionCellType.Food, (int)foodGet);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 7
0
        private void RewardExp(ref int index)
        {
            var expGet = (uint)(GameResourceBook.InExpSceneQuest(level, config.RewardExp) * (10 + hardness) / 10); //难度越高经验越多

            if (expGet > 0)
            {
                UserProfile.Profile.InfoBasic.AddExp((int)expGet);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25),
                                                                   60, ImageRegionCellType.Exp, (int)expGet);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 8
0
        private void RewardRes(ref int index)
        {
            var resId  = config.RewardResId;
            var resGet = (uint)(GameResourceBook.InResSceneQuest(resId, level, config.RewardResAmount) * (10 + hardness) / 10); //难度越高资源越多

            if (resGet > 0)
            {
                UserProfile.Profile.InfoBag.AddResource((GameResourceType)resId, resGet);
                var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25),
                                                                   60, ImageRegionCellType.Lumber + resId - 1, (int)resGet);
                vRegion.AddRegion(pictureRegion);
                index++;
            }
        }
Ejemplo n.º 9
0
        private void DoTrade()
        {
            int    multi = int.Parse(evt.ParamList[0]);
            string type  = "all";

            if (evt.ParamList.Count >= 2)
            {
                type = evt.ParamList[1];
            }
            double multiNeed = multi * MathTool.Clamp(1, 0.2f, 5);
            double multiGet  = multi * MathTool.Clamp(1, 0.2f, 5);
            int    index     = 1;

            if (config.TradeGold > 0 && (type == "all" || type == "gold"))
            {
                var goldGet = GameResourceBook.InGoldSceneQuest(level, (int)(config.TradeGold * multiGet), true);
                if (goldGet > 0)
                {
                    UserProfile.Profile.InfoBag.AddResource(GameResourceType.Gold, goldGet);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Gold, (int)goldGet);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            else if (config.TradeGold < 0)
            {
                var goldLoss = GameResourceBook.OutGoldSceneQuest(level, (int)(-config.TradeGold * multiNeed), true);
                if (goldLoss > 0)
                {
                    UserProfile.Profile.InfoBag.SubResource(GameResourceType.Gold, goldLoss);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Gold, (int)-goldLoss);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            if (config.TradeFood > 0 && (type == "all" || type == "food"))
            {
                var foodGet = Math.Min(100, GameResourceBook.InFoodSceneQuest((int)(config.TradeFood * multiGet), true));
                if (foodGet > 0)
                {
                    UserProfile.Profile.InfoBasic.AddFood(foodGet);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Food, (int)foodGet);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            else if (config.TradeFood < 0)
            {
                var foodLoss = Math.Min(100, GameResourceBook.OutFoodSceneQuest((int)(-config.TradeFood * multiNeed), true));
                if (foodLoss > 0)
                {
                    UserProfile.Profile.InfoBasic.SubFood(foodLoss);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Food, (int)-foodLoss);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            if (config.TradeHealth > 0 && (type == "all" || type == "health"))
            {
                var healthGet = Math.Min(100, GameResourceBook.InHealthSceneQuest((int)(config.TradeHealth * multiGet), true));
                if (healthGet > 0)
                {
                    UserProfile.Profile.InfoBasic.AddHealth(healthGet);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Health, (int)healthGet);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            else if (config.TradeHealth < 0)
            {
                var healthLoss = Math.Min(100, GameResourceBook.OutHealthSceneQuest((int)(-config.TradeHealth * multiNeed), true));
                if (healthLoss > 0)
                {
                    UserProfile.Profile.InfoBasic.SubHealth(healthLoss);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Health, (int)-healthLoss);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            if (config.TradeMental > 0 && (type == "all" || type == "mental"))
            {
                var mentalGet = Math.Min(100, GameResourceBook.InMentalSceneQuest((int)(config.TradeMental * multiGet), true));
                if (mentalGet > 0)
                {
                    UserProfile.Profile.InfoBasic.AddMental(mentalGet);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Mental, (int)mentalGet);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            else if (config.TradeMental < 0)
            {
                var mentalLoss = Math.Min(100, GameResourceBook.OutMentalSceneQuest((int)(-config.TradeMental * multiNeed), true));
                if (mentalLoss > 0)
                {
                    UserProfile.Profile.InfoBasic.SubMental(mentalLoss);
                    var pictureRegion = ComplexRegion.GetResShowRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25), 60, ImageRegionCellType.Mental, (int)-mentalLoss);
                    vRegion.AddRegion(pictureRegion);
                    index++;
                }
            }
            if (!string.IsNullOrEmpty(config.TradeDropItem))
            {
                var itemList = DropBook.GetDropItemList(config.TradeDropItem);
                foreach (var itemId in itemList)
                {
                    UserProfile.InfoBag.AddItem(itemId, 1);
                    vRegion.AddRegion(new PictureRegion(index, pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25, 60, 60, PictureRegionCellType.Item, itemId));


                    index++;
                }
            }
        }