示例#1
0
        public static short maxFeelLv = ConfigEnvSet.GetInt("Gift.MaxFeelLv").ToShort(); //好感度最大等级
        /// <summary>
        /// 礼物类型名称
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static string GetGiftTypeName(GiftType type)
        {
            string result = string.Empty;

            switch (type)
            {
            case GiftType.Food:
                result = LanguageManager.GetLang().GiftType_Food;
                break;

            case GiftType.Kitchenware:
                result = LanguageManager.GetLang().GiftType_Kitchenware;
                break;

            case GiftType.Mechanical:
                result = LanguageManager.GetLang().GiftType_Mechanical;
                break;

            case GiftType.Books:
                result = LanguageManager.GetLang().GiftType_Books;
                break;

            case GiftType.MusicalInstruments:
                result = LanguageManager.GetLang().GiftType_MusicalInstruments;
                break;

            default:
                break;
            }
            return(result);
        }
示例#2
0
 public Gift(GiftType giftType, int amount, string giftName, string giftStoreId)
 {
     this.giftType    = giftType;
     this.amount      = amount;
     this.giftName    = giftName;
     this.giftStoreId = giftStoreId;
 }
 public void SetGiftCallBackData(int giftIndex, int surPlusTime, int surPlusTotalTime, GiftType giftType)
 {
     this.giftIndex        = giftIndex;
     this.surPlusTime      = surPlusTime;
     this.surPlusTotalTime = surPlusTotalTime;
     this.giftType         = giftType;
 }
示例#4
0
 public void AddGift(GiftType gift)
 {
     interfaces.Add(new GiftInterface(gift, graphics, 0, 0, INT_WIDTH, INT_HEIGHT, font));
     interfaces[interfaces.Count - 1].AddOpenHandler(OpenGift);
     UpdatePagesToInterfaces();
     Reposition(0, 0, false, null);
 }
示例#5
0
 public void SetUIGiftIndex(int index, string name, GiftType giftType, string url)
 {
     this.index    = index;
     this.name     = name;
     this.giftType = giftType;
     img_url       = url;
 }
示例#6
0
 public static short maxFeelLv = ConfigEnvSet.GetInt("Gift.MaxFeelLv").ToShort(); //好感度最大等级
 /// <summary>
 /// 礼物类型名称
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetGiftTypeName(GiftType type)
 {
     string result = string.Empty;
     switch (type)
     {
         case GiftType.Food:
             result = LanguageManager.GetLang().GiftType_Food;
             break;
         case GiftType.Kitchenware:
             result = LanguageManager.GetLang().GiftType_Kitchenware;
             break;
         case GiftType.Mechanical:
             result = LanguageManager.GetLang().GiftType_Mechanical;
             break;
         case GiftType.Books:
             result = LanguageManager.GetLang().GiftType_Books;
             break;
         case GiftType.MusicalInstruments:
             result = LanguageManager.GetLang().GiftType_MusicalInstruments;
             break;
         default:
             break;
     }
     return result;
 }
示例#7
0
        public ShopGiftInterface(GiftType gift, GraphicsDevice graphics, SpriteFont font, int x, int y,
                                 int width, int height, int cost, Action <GiftType, int> buy)
        {
            this.font     = font;
            this.GiftType = gift;
            this.cost     = cost;

            bgImg  = new Texture2D(graphics, width, height);
            bgImg  = DrawHelper.AddBorder(bgImg, 3, Color.Gray, Color.LightGray);
            bgRect = new Rectangle(x, y, width, height);

            name    = Language.Translate(gift.ToString().AddSpaces()) + " " + Language.Translate("Gift");
            namePos = new Vector2(bgRect.X + bgRect.Width / 2 - font.MeasureString(name).X / 2, bgRect.Y + SPACING);

            giftImg  = Utilities.GiftImg;
            giftRect = new Rectangle(bgRect.X + bgRect.Width / 2 - GIFT_SIZE / 2, (int)namePos.Y + SPACING * 3 + (int)font.MeasureString(name).Y,
                                     GIFT_SIZE, GIFT_SIZE);
            giftColor = Gift.GetColor(gift);

            buyButton = new MenuButton(new System.Action(() => buy?.Invoke(this.GiftType, this.cost)),
                                       Language.Translate("Buy") + " (" + cost.ToString() + "c)",
                                       0, 0, true, font, graphics);
            buyButton.X = bgRect.X + bgRect.Width / 2 - buyButton.Width / 2;
            buyButton.Y = bgRect.Bottom - buyButton.Height - SPACING;
        }
示例#8
0
文件: Gift.cs 项目: TudorDan/PongGame
        public Gift(Canvas canvas)
        {
            speedY = rnd.NextDouble() * 5 + 1;
            double X = rnd.Next(1, (int)(canvas.ActualWidth - Size));
            double Y = rnd.Next(1, (int)(canvas.ActualHeight - Size) / 2);

            Position = new Point(X, Y);
            Type     = (GiftType)rnd.Next(0, 4);
        }
        private IAbstractGiftFactory GetFactory(bool isGoodChild, GiftType giftType)
        {
            if (!isGoodChild)
            {
                return(giftType == GiftType.Edible ? LemonGiftFactory : BirchGiftFactory);
            }

            return(giftType == GiftType.Edible ? CakeGiftFactory : DollGiftFactory);
        }
示例#10
0
 public int DonationPercentage(GiftType type)
 {
     return(type switch
     {
         GiftType.LEMON => 0,
         GiftType.ICE_CREAM => IceCream,
         GiftType.DIAMOND => Diamond,
         GiftType.NINJAGHINI => Ninjaghini,
         GiftType.NINJET => Ninjet,
         _ => throw new ArgumentException($"Invalid argument: {type}!"),
     });
示例#11
0
 /// <summary>
 /// 增加
 /// </summary>
 /// <param name="GiftType">GiftType实体对象</param>
 /// <returns>int值,返回自增ID</returns>
 public int AddReturnId(GiftType model)
 {
     SqlParameter[] param = new SqlParameter[]
     {
         new SqlParameter("@GiftTypeName", model.GiftTypeName),
         new SqlParameter("@Decription", model.Decription),
         new SqlParameter("@ParentId", model.ParentId),
         new SqlParameter("@OrderIndex", model.OrderIndex),
         new SqlParameter("@IsDelete", model.IsDelete)
     };
     return(Convert.ToInt32(DBHelper.ExecuteScalar("GiftType_AddReturnId", param)));
 }
示例#12
0
 /// <summary>
 /// 增加
 /// </summary>
 /// <param name="GiftType">GiftType实体对象</param>
 /// <returns>bool值,判断是否操作成功</returns>
 public bool Add(GiftType model)
 {
     SqlParameter[] param = new SqlParameter[]
     {
         new SqlParameter("@GiftTypeName", model.GiftTypeName),
         new SqlParameter("@Decription", model.Decription),
         new SqlParameter("@ParentId", model.ParentId),
         new SqlParameter("@OrderIndex", model.OrderIndex),
         new SqlParameter("@IsDelete", model.IsDelete)
     };
     return(DBHelper.ExecuteNonQuery("GiftType_Add", param));
 }
示例#13
0
        /// <summary>
        /// 数据访问通过条件查询并分页排序
        /// </summary>
        /// <param name="WhereString">查询条件</param>
        /// <param name="PageIndex">当前页码</param>
        /// <param name="PageSize">页大小(每页显示多少条数据)</param>
        /// <param name="OrderString">排序条件(排序条件为必须参数)</param>
        /// <returns>GiftType实体类对象</returns>
        public List <GiftType> SelectByWhereAndPage(string WhereString, int PageIndex, int PageSize, string OrderString, out int TotalCount)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@where", WhereString),
                new SqlParameter("@pageIndex", PageIndex),
                new SqlParameter("@pageSize", PageSize),
                new SqlParameter("@orderString", OrderString),
                new SqlParameter("@TotalCount", ParameterDirection.Output)
            };
            List <GiftType> list  = new List <GiftType>();
            GiftType        model = null;

            using (SqlDataReader dr = DBHelper.RunProcedure("GiftType_SelectByWhereAndPage", param))
            {
                while (dr.Read())
                {
                    model            = new GiftType();
                    model.GiftTypeId = Convert.ToInt32(dr["GiftTypeId"]);
                    if (DBNull.Value != dr["GiftTypeName"])
                    {
                        model.GiftTypeName = dr["GiftTypeName"].ToString();
                    }
                    if (DBNull.Value != dr["Decription"])
                    {
                        model.Decription = dr["Decription"].ToString();
                    }
                    if (DBNull.Value != dr["ParentId"])
                    {
                        model.ParentId = Convert.ToInt32(dr["ParentId"]);
                    }
                    if (DBNull.Value != dr["OrderIndex"])
                    {
                        model.OrderIndex = Convert.ToInt32(dr["OrderIndex"]);
                    }
                    if (DBNull.Value != dr["IsDelete"])
                    {
                        model.IsDelete = Convert.ToBoolean(dr["IsDelete"]);
                    }
                    list.Add(model);
                }
                if (dr.NextResult() && dr.Read())
                {
                    TotalCount = Convert.ToInt32(dr["TotalCount"]);
                }
                else
                {
                    TotalCount = 0;
                }
            }
            return(list);
        }
示例#14
0
        public bool SendGift(GiftType giftType)
        {
            string query = string.Empty;

            switch (giftType)
            {
            case GiftType.Snow:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"snow\"}";
                break;

            case GiftType.Kiss:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"kiss\"}";
                break;

            case GiftType.Topaz:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"gemstone\"}";
                break;

            case GiftType.Flower:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"flower\"}";
                break;

            case GiftType.Tomato:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"tomato\"}";
                break;

            case GiftType.Berry:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"berry\"}";
                break;

            case GiftType.Egg:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"egg\"}";
                break;

            case GiftType.Pepper:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"pepper\"}";
                break;

            case GiftType.Heart:
                query = "{\"type\":\"send_gift\",\"receiver_id\":\"\",\"gift\":\"heart\"}";
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(giftType), giftType, null);
            }

            var whattosend = Utils.Converter.ConvertToKOKData(query);

            Send(whattosend);
            return(false);
        }
示例#15
0
        public static List <ProjectileType> ProjectilesForType(GiftType type)
        {
            List <ProjectileType> returnVal = new List <ProjectileType>();

            // Helps us randomly iterate through all the projectiles, not just the ones that are first
            // This prevents gifts from being biased towards the first projectiles in the enum
            List <ProjectileType> projectiles = Enum.GetValues(typeof(ProjectileType)).Cast <ProjectileType>().ToList();

            projectiles.Shuffle();

            int groups        = ProjGroupsFor(type);
            int valuePerGroup = GiftWorthFor(type) / groups;

            for (int i = 0; i < groups && i < projectiles.Count; i++)
            {
                int projWorth = Utilities.WorthOf(projectiles[i]);
                if (projWorth * 2 < valuePerGroup && projWorth > 0)
                {
                    int projs = valuePerGroup / projWorth;
                    returnVal.AddRange(Enumerable.Repeat(projectiles[i], projs));
                }
            }

            return(returnVal);

            // Old code for gifts (pre-1.1)
            //for (int i = 0; i < projectiles.Count && returnVal.Count < (int)type + 15; i++)
            //{
            //    int worth = Utilities.WorthOf(projectiles[i]);
            //    if (worth > 0) // Prevent unimplemented projectiles from being added (or ProjectileType.None)
            //    {
            //        int percentChance = initPercentChance - worth * 2;
            //        while (percentChance >= 100)
            //        {
            //            returnVal.Add(projectiles[i]);
            //            percentChance -= Utilities.Rand.Next(10, 15);
            //        }
            //        if (Utilities.Rand.Next(100) + 1 <= percentChance &&
            //            percentChance < 100)
            //        {
            //            returnVal.Add(projectiles[i]);
            //        }
            //    }
            //}
        }
示例#16
0
        public static List <Material> MaterialsForType(GiftType type)
        {
            List <Material> returnVal = new List <Material>();

            // Helps us randomly iterate through all the materials, not just the ones that are first
            // This prevents gifts from being biased towards the first materials in the enum
            List <Material> materials = Enum.GetValues(typeof(Material)).Cast <Material>().ToList();

            materials.Shuffle();

            int groups        = MaterialGroupsFor(type);
            int valuePerGroup = GiftWorthFor(type) / groups;

            for (int i = 0; i < groups && i < materials.Count; i++)
            {
                int materialWorth = GameInfo.CostOf(materials[i]);
                if (materialWorth * 2 < valuePerGroup)
                {
                    int counts = valuePerGroup / materialWorth;
                    returnVal.AddRange(Enumerable.Repeat(materials[i], counts));
                }
            }

            return(returnVal);

            // Old gift code (from pre-1.1)
            //int giftWorth = GiftWorthFor(type);

            //for (int i = 0; i < materials.Count && returnVal.Count < (int)type + 15; i++)
            //{
            //    int worth = GameInfo.CostOf(materials[i]);
            //    int percentChance = giftWorth - worth;
            //    while (percentChance >= 100)
            //    {
            //        returnVal.Add(materials[i]);
            //        percentChance -= Utilities.Rand.Next(10, 15);
            //    }
            //    if (Utilities.Rand.Next(100) + 1 <= percentChance &&
            //        percentChance < 100)
            //    {
            //        returnVal.Add(materials[i]);
            //    }
            //}
        }
示例#17
0
        public GiftInterface(GiftType giftType, GraphicsDevice graphics, int x, int y, int width, int height,
                             SpriteFont font)
        {
            this.font = font;

            bgImg  = new Texture2D(graphics, width, height);
            bgImg  = DrawHelper.AddBorder(bgImg, 3, Color.Gray, Color.LightGray);
            bgRect = new Rectangle(x, y, width, height);

            openButton   = new MenuButton(new System.Action(() => open?.Invoke(Gift)), Language.Translate("Open"), 0, 0, true, font, graphics);
            openButton.X = bgRect.X + bgRect.Width / 2 - openButton.Width / 2;
            openButton.Y = bgRect.Bottom - openButton.Height - SPACING;

            Gift      = giftType;
            giftImg   = Utilities.GiftImg;
            giftRect  = new Rectangle(bgRect.X + bgRect.Width / 2 - GIFT_SIZE / 2, bgRect.Y + SPACING, GIFT_SIZE, GIFT_SIZE);
            giftColor = OneCannonOneArmy.Gift.GetColor(giftType);

            name    = Language.Translate(giftType.ToString()) + " " + Language.Translate("Gift");
            namePos = new Vector2(bgRect.X + bgRect.Width / 2 - font.MeasureString(name).X / 2, giftRect.Y + SPACING);
        }
示例#18
0
        /// <summary>
        /// 通过条件查询
        /// </summary>
        /// <param name="WhereString">查询条件</param>
        /// <returns>GiftType实体类对象</returns>
        public List <GiftType> SelectByWhere(string WhereString)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@where", WhereString)
            };
            List <GiftType> list  = new List <GiftType>();
            GiftType        model = null;

            using (SqlDataReader dr = DBHelper.RunProcedure("GiftType_SelectByWhere", param))
            {
                while (dr.Read())
                {
                    model            = new GiftType();
                    model.GiftTypeId = Convert.ToInt32(dr["GiftTypeId"]);
                    if (DBNull.Value != dr["GiftTypeName"])
                    {
                        model.GiftTypeName = dr["GiftTypeName"].ToString();
                    }
                    if (DBNull.Value != dr["Decription"])
                    {
                        model.Decription = dr["Decription"].ToString();
                    }
                    if (DBNull.Value != dr["ParentId"])
                    {
                        model.ParentId = Convert.ToInt32(dr["ParentId"]);
                    }
                    if (DBNull.Value != dr["OrderIndex"])
                    {
                        model.OrderIndex = Convert.ToInt32(dr["OrderIndex"]);
                    }
                    if (DBNull.Value != dr["IsDelete"])
                    {
                        model.IsDelete = Convert.ToBoolean(dr["IsDelete"]);
                    }
                    list.Add(model);
                }
            }
            return(list);
        }
示例#19
0
        /// <summary>
        /// Obtiene los regalos de cargos a habitacion
        /// </summary>
        /// <param name="ReceiptID"></param>
        /// <param name="aGifts"></param>
        /// <param name="Request"></param>
        /// <param name="ChargeTo"></param>
        /// <returns></returns>
        /// <history>
        /// [vipacheco] 01/Junio/2016 Created
        /// </history>
        public static List <CargoHabitacionRequest> GetGiftsRoomCharges(int ReceiptID, ref List <GiftType> aGifts, ref CargoHabitacionTRNRequest Request, string ChargeTo)
        {
            List <CargoHabitacionRequest> aRoomCharges = new List <CargoHabitacionRequest>();

            // obtenemos los cargos a habitacion de Opera que no se han dado
            List <GiftsReceiptDetailRoomChargesOpera> lstResult = BRGiftsReceiptDetail.GetGiftsReceiptDetailRoomChargesOpera(ReceiptID);

            if (lstResult.Count > 0)
            {
                GiftsReceiptDetailRoomChargesOpera First = lstResult[0];

                // Configuramos el Request
                Request.Hotel    = First.gulsOriginal;
                Request.Folio    = Convert.ToInt32(First.guHReservID);
                Request.PostDate = BRHelpers.GetServerDate();
                Request.Batch    = First.rhConsecutive != null ? $"{First.rhConsecutive}" : "";

                foreach (GiftsReceiptDetailRoomChargesOpera Current in lstResult)
                {
                    // agregamos el cargo a habitacion
                    AddRoomCharge(ref aRoomCharges, Current.gulsOriginal, Convert.ToInt32(Current.guHReservID), ChargeTo, ReceiptID, Current.giN, Current.gePriceA, Current.giOperaTransactionType);

                    // preparamos los regalos con cargos a habitacion que se guardaran en Origos
                    GiftType _Gift = new GiftType();
                    _Gift.ID                   = Current.gegi;
                    _Gift.Descripcion          = Current.giN;
                    _Gift.Quantity             = 0;
                    _Gift.Receipt              = ReceiptID;
                    _Gift.Promotion            = "";
                    _Gift.TransactionTypeOpera = Current.giOperaTransactionType;

                    // Agregamos a la lista
                    aGifts.Add(_Gift);
                }

                Request.CargosHabitacion = aRoomCharges.ToArray();
            }

            return(aRoomCharges);
        }
示例#20
0
        public ChatGiftMessage(string channel, string messageId, PublicUserData user, RoomRole roomRole, bool subscribing, GiftType type, int amount, string message) : base(ChatEventType.GIFT, channel, messageId, user, roomRole, subscribing)
        {
            GiftType    = type;
            GiftMessage = message;
            AmountGifts = amount;

            switch (type)
            {
            case GiftType.LEMON:
                GiftValue = 1m;
                break;

            case GiftType.ICE_CREAM:
                GiftValue = 10m;
                break;

            case GiftType.DIAMOND:
                GiftValue = 100m;
                break;

            case GiftType.NINJAGHINI:
                GiftValue = 1000m;
                break;

            case GiftType.NINJET:
                GiftValue = 10000m;
                break;

            case GiftType.BTT:
            case GiftType.TRX:
                GiftValue = (decimal)amount / 1000000;
                break;

            default:
                break;
            }
            GiftLinoValue = GiftLemonValue = (int)GiftValue;
        }
示例#21
0
        /// <summary>
        /// 通过Id查询
        /// </summary>
        /// <param name="Id">主键Id</param>
        /// <returns>GiftType实体类对象</returns>
        public GiftType SelectById(int Id)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@GiftTypeId", Id)
            };
            GiftType model = new GiftType();

            using (SqlDataReader dr = DBHelper.RunProcedure("GiftType_SelectById", param))
            {
                if (dr.Read())
                {
                    model.GiftTypeId = Convert.ToInt32(dr["GiftTypeId"]);
                    if (DBNull.Value != dr["GiftTypeName"])
                    {
                        model.GiftTypeName = dr["GiftTypeName"].ToString();
                    }
                    if (DBNull.Value != dr["Decription"])
                    {
                        model.Decription = dr["Decription"].ToString();
                    }
                    if (DBNull.Value != dr["ParentId"])
                    {
                        model.ParentId = Convert.ToInt32(dr["ParentId"]);
                    }
                    if (DBNull.Value != dr["OrderIndex"])
                    {
                        model.OrderIndex = Convert.ToInt32(dr["OrderIndex"]);
                    }
                    if (DBNull.Value != dr["IsDelete"])
                    {
                        model.IsDelete = Convert.ToBoolean(dr["IsDelete"]);
                    }
                }
            }
            return(model);
        }
示例#22
0
        public static Color GetColor(GiftType type)
        {
            switch (type)
            {
            case GiftType.Red:
                return(new Color(170, 0, 0));

            case GiftType.Orange:
                return(Color.Orange);

            case GiftType.Yellow:
                return(Color.Yellow);

            case GiftType.Green:
                return(Color.Green);

            case GiftType.Blue:
                return(Color.Blue);

            case GiftType.Purple:
                return(Color.Purple);
            }
            return(new Color());
        }
示例#23
0
 public static int CoinsForType(GiftType type)
 {
     return(Utilities.Rand.Next(GameInfo.COIN_GIFT_MULTIPLIER_MIN * ((int)type + 1),
                                GameInfo.COIN_GIFT_MULTIPLIER_MAX * ((int)type + 1)));
 }
示例#24
0
 public void SetGiftCallBackData(int giftIndex, string message, int surPlusTime, int surPlusTotalTime, int giftCount, GiftType giftType)
 {
     this.giftIndex        = giftIndex;
     this.surPlusTime      = surPlusTime;
     this.surPlusTotalTime = surPlusTotalTime;
     //this.message = message;
     //this.giftCount = giftCount;
     //this.giftType = giftType;
 }
示例#25
0
        public static bool FavorUtility_GetGiftGainInfo_Patch_Prefix(NpcData npcData, FavorManagerConfInfo favorConf, ItemBaseConfData itemBaseConf, ref int gainValue, ref FeeLevelEnum feeLevel, ref string replyText, ref GiftType gType)
        {
            if (!Main.enabled)
            {
                return(true);
            }

            if (itemBaseConf.NameID == 271422) //heart knot
            {
                gainValue = 0;
                replyText = string.Empty;
                gType     = GiftType.Normal;
                feeLevel  = FeeLevelEnum.Refuse;
                int failIndex = -1;
                int id        = npcData.id;

                Dbgl("Giving heart knot to :" + npcData.Name + " " + npcData.id + " " + npcData.factionId);

                if (Module <Player> .Self.CanExpress(id, out failIndex) && FavorRelationshipUtil.CheckExpress(id, ref failIndex))
                {
                    gainValue = FavorUtility.GetGiftGainValue(favorConf.FavorValues_Confession, itemBaseConf);
                    feeLevel  = FeeLevelEnum.Confession;
                    gType     = GiftType.Relation;
                }
                else
                {
                    gainValue = 0;
                    feeLevel  = FeeLevelEnum.Refuse;
                    gType     = GiftType.Relation;
                }

                replyText = FavorUtility.GetGiveGiftDialog(npcData, favorConf, itemBaseConf, feeLevel, failIndex);
                return(false);
            }
            else if (itemBaseConf.NameID == 270956) // wedding ring
            {
                gainValue = 0;
                replyText = string.Empty;
                gType     = GiftType.Normal;
                feeLevel  = FeeLevelEnum.Refuse;
                int failIndex = -1;
                int id        = npcData.id;

                if (Module <MGMgr> .Self.CanMarriage(id, out failIndex) && FavorRelationshipUtil.CheckPropose(id, ref failIndex))
                {
                    gainValue = FavorUtility.GetGiftGainValue(favorConf.FavorValues_Propose, itemBaseConf);
                    feeLevel  = FeeLevelEnum.Propose;
                    gType     = GiftType.Relation;
                }
                else
                {
                    gainValue = 0;
                    feeLevel  = FeeLevelEnum.Refuse;
                    gType     = GiftType.Relation;
                }

                replyText = FavorUtility.GetGiveGiftDialog(npcData, favorConf, itemBaseConf, feeLevel, failIndex);
                return(false);
            }

            return(true);
        }
示例#26
0
 protected override object this[string index]
 {
     get
     {
         #region
         switch (index)
         {
             case "GeneralID": return GeneralID;
             case "HeadID": return HeadID;
             case "PicturesID": return PicturesID;
             case "GeneralName": return GeneralName;
             case "GeneralLv": return GeneralLv;
             case "LifeNum": return LifeNum;
             case "CareerID": return CareerID;
             case "PowerNum": return PowerNum;
             case "SoulNum": return SoulNum;
             case "IntellectNum": return IntellectNum;
             case "HitProbability": return HitProbability;
             case "AbilityID": return AbilityID;
             case "IsRecruit": return IsRecruit;
             case "ShowFilter": return ShowFilter;
             case "RecruitFilter": return RecruitFilter;
             case "GiftType": return GiftType;
             case "Description": return Description;
             case "ReplaceSkills": return ReplaceSkills;
             case "GeneralType": return GeneralType;
             case "SoulID": return SoulID;
             case "DemandNum": return DemandNum;
             case "Mature": return Mature;
             case "GeneralQuality": return GeneralQuality;
             case "ItemID": return ItemID;
             case "BattleHeadID": return BattleHeadID;
             case "IsConscribe": return IsConscribe;
             default: throw new ArgumentException(string.Format("GeneralInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
     set
     {
         #region
         switch (index)
         {
             case "GeneralID":
                 _GeneralID = value.ToInt();
                 break;
             case "HeadID":
                 _HeadID = value.ToNotNullString();
                 break;
             case "PicturesID":
                 _PicturesID = value.ToNotNullString();
                 break;
             case "GeneralName":
                 _GeneralName = value.ToNotNullString();
                 break;
             case "GeneralLv":
                 _GeneralLv = value.ToShort();
                 break;
             case "LifeNum":
                 _LifeNum = value.ToInt();
                 break;
             case "CareerID":
                 _CareerID = value.ToShort();
                 break;
             case "PowerNum":
                 _PowerNum = value.ToShort();
                 break;
             case "SoulNum":
                 _SoulNum = value.ToShort();
                 break;
             case "IntellectNum":
                 _IntellectNum = value.ToShort();
                 break;
             case "HitProbability":
                 _HitProbability = value.ToDecimal();
                 break;
             case "AbilityID":
                 _AbilityID = value.ToInt();
                 break;
             case "IsRecruit":
                 _IsRecruit = value.ToBool();
                 break;
             case "ShowFilter":
                 _ShowFilter = ConvertCustomField<CacheList<ShowFilterInfo>>(value, index);
                 break;
             case "RecruitFilter":
                 _RecruitFilter = ConvertCustomField<CacheList<RecruitFilter>>(value, index);
                 break;
             case "Description":
                 _Description = value.ToNotNullString();
                 break;
             case "GiftType":
                 _GiftType = value.ToEnum<GiftType>();
                 break;
             case "ReplaceSkills":
                 _ReplaceSkills = ConvertCustomField<SkillInfo>(value, index);
                 break;
             case "GeneralType":
                 _GeneralType = value.ToEnum<GeneralType>();
                 break;
             case "SoulID":
                 _SoulID = value.ToInt();
                 break;
             case "DemandNum":
                 _DemandNum = value.ToInt();
                 break;
             case "Mature":
                 _Mature = ConvertCustomField<CacheList<GeneralProperty>>(value, index);
                 break;
             case "GeneralQuality":
                 _GeneralQuality = value.ToEnum<GeneralQuality>();
                 break;
             case "ItemID":
                 _ItemID = value.ToInt();
                 break;
             case "BattleHeadID":
                 _BattleHeadID = value.ToNotNullString();
                 break;
             case "IsConscribe":
                 _IsConscribe = value.ToBool();
                 break;
             default: throw new ArgumentException(string.Format("GeneralInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
 }
示例#27
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="GiftType">GiftType实体对象</param>
 /// <returns>bool值,判断是否操作成功</returns>
 public bool Change(GiftType model)
 {
     return(dal.Change(model));
 }
示例#28
0
 /// <summary>
 /// 增加
 /// </summary>
 /// <param name="GiftType">GiftType实体对象</param>
 /// <returns>int值,返回自增ID</returns>
 public int AddReturnId(GiftType model)
 {
     return(dal.AddReturnId(model));
 }
示例#29
0
 /// <summary>
 /// 增加
 /// </summary>
 /// <param name="GiftType">GiftType实体对象</param>
 /// <returns>bool值,判断是否操作成功</returns>
 public bool Add(GiftType model)
 {
     return(dal.Add(model));
 }
示例#30
0
 public Gift(GiftType type)
 {
     Box  = new PictureBox();
     Type = type;
 }
示例#31
0
 protected override object this[string index]
 {
     get
     {
         #region
         switch (index)
         {
             case "ItemID": return ItemID;
             case "ItemName": return ItemName;
             case "HeadID": return HeadID;
             case "ItemType": return ItemType;
             case "EquParts": return EquParts;
             case "QualityType": return QualityType;
             case "CareerRange": return CareerRange;
             case "DemandLv": return DemandLv;
             case "MedicineType": return MedicineType;
             case "MedicineLv": return MedicineLv;
             case "MedicineNum": return MedicineNum;
             case "PropType": return PropType;
             case "EffectNum": return EffectNum;
             case "SalePrice": return SalePrice;
             case "PackMaxNum": return PackMaxNum;
             case "ItemDesc": return ItemDesc;
             case "EnableSale": return EnableSale;
             case "IsMystery": return IsMystery;
             case "DemandEnergy": return DemandEnergy;
             case "Version": return Version;
             case "ItemPack": return ItemPack;
             case "PictrueID": return PictrueID;
             case "MysteryNum": return MysteryNum;
             case "MysteryPrice": return MysteryPrice;
             case "IsGold": return IsGold;
             case "GiftType": return GiftType;
             case "SatiationNum": return SatiationNum;
             case "AbilityType": return AbilityType;
             case "IsUse": return IsUse;
             case "MaxHeadID": return MaxHeadID;
             case "IsCostly": return IsCostly;
             case "Athletics": return Athletics;
             default: throw new ArgumentException(string.Format("ItemBaseInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
     set
     {
         #region
         switch (index)
         {
             case "ItemID":
                 _ItemID = value.ToInt();
                 break;
             case "ItemName":
                 _ItemName = value.ToNotNullString();
                 break;
             case "HeadID":
                 _HeadID = value.ToNotNullString();
                 break;
             case "ItemType":
                 _ItemType = value.ToEnum<ItemType>();
                 break;
             case "EquParts":
                 _EquParts = value.ToEnum<EquParts>();
                 break;
             case "QualityType":
                 _QualityType = value.ToEnum<QualityType>();
                 break;
             case "CareerRange":
                 _CareerRange = value.ToNotNullString();
                 break;
             case "DemandLv":
                 _DemandLv = value.ToShort();
                 break;
             case "MedicineType":
                 _MedicineType = value.ToShort();
                 break;
             case "MedicineLv":
                 _MedicineLv = value.ToShort();
                 break;
             case "MedicineNum":
                 _MedicineNum = value.ToShort();
                 break;
             case "PropType":
                 _PropType = value.ToShort();
                 break;
             case "EffectNum":
                 _EffectNum = value.ToInt();
                 break;
             case "SalePrice":
                 _SalePrice = value.ToInt();
                 break;
             case "PackMaxNum":
                 _PackMaxNum = value.ToInt();
                 break;
             case "ItemDesc":
                 _ItemDesc = value.ToNotNullString();
                 break;
             case "EnableSale":
                 _EnableSale = value.ToShort();
                 break;
             case "IsMystery":
                 _IsMystery = value.ToInt();
                 break;
             case "DemandEnergy":
                 _DemandEnergy = value.ToInt();
                 break;
             case "Version":
                 _Version = value.ToInt();
                 break;
             case "ItemPack":
                 _ItemPack =ConvertCustomField<CacheList<PrizeInfo>>(value, index);
                 break;
             case "PictrueID":
                 _PictrueID = value.ToNotNullString();
                 break;
             case "MysteryNum":
                 _MysteryNum = value.ToInt();
                 break;
             case "MysteryPrice":
                 _MysteryPrice = value.ToInt();
                 break;
             case "IsGold":
                 _IsGold = value.ToBool();
                 break;
             case "GiftType":
                 _GiftType = value.ToEnum<GiftType>();
                 break;
             case "SatiationNum":
                 _SatiationNum = value.ToShort();
                 break;
             case "AbilityType":
                 _AbilityType = value.ToEnum<AbilityType>();
                 break;
             case "IsUse":
                 _IsUse = value.ToBool();
                 break;
             case "MaxHeadID":
                 _MaxHeadID = value.ToNotNullString();
                 break;
             case "IsCostly":
                 _IsCostly = value.ToBool();
                 break;
             case "Athletics":
                 _Athletics = value.ToInt();
                 break;
             default: throw new ArgumentException(string.Format("ItemBaseInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
 }
 public override void BuildGift(bool isGoodChild, GiftType giftType)
 {
     Parcel.Gift = GetFactory(isGoodChild, giftType).GetGift();
 }
示例#33
0
        /// <summary>
        /// Obtiene los regalos de promociones de Sistur
        /// </summary>
        /// <param name="ReceiptID"></param>
        /// <param name="ChangeBy"></param>
        /// <param name="UserID"></param>
        /// <param name="aGifts"></param>
        /// <param name="enumPromotionsSystem"></param>
        /// <returns></returns>
        /// <history>
        /// [vipacheco] 27/Mayo/2016 Created
        /// [vipacheco] 25/Julio/2016 Modified --> Se agreggo asyncronia
        /// </history>
        public async static Task <List <GuardaPromocionForzadaRequest> > GetGiftsPromotionsSistur(int ReceiptID, string ChangeBy, string UserID, List <GiftType> aGifts)
        {
            List <GuardaPromocionForzadaRequest> aPromotions = new List <GuardaPromocionForzadaRequest>();
            string Hotel = string.Empty;
            string Folio = string.Empty;
            //int Company = 0;
            string Application    = string.Empty;
            string MembershipType = string.Empty;

            // obtenemos las promociones de Sistur que no se han dado
            List <GiftsReceiptDetailPromotionsSistur> Result = await BRGiftsReceiptDetail.GetGiftsReceiptDetailPromotionsPVP(ReceiptID);

            // por default se van a guardar al sistema de Promociones de Sistur
            EnumPromotionsSystem enumPromotionsSystem = EnumPromotionsSystem.Sistur;

            if (Result.Count > 0)
            {
                GiftsReceiptDetailPromotionsSistur Detail = Result[0];

                // Si es inhouse
                if (Detail.lspg.Equals("IH"))
                {
                    // Si es una invitacion inhouse
                    if (Detail.guHReservID != null)
                    {
                        Hotel = Detail.gulsOriginal;
                        Folio = Detail.guHReservID;
                    }
                    // si es una invitacion externa
                    else
                    {
                        Hotel = Detail.lsPropertyOpera;
                        Folio = $"{ReceiptID}";
                    }

                    // Si el Lead Source usa sistur
                    if (Detail.lsUseSistur)
                    {
                        enumPromotionsSystem = EnumPromotionsSystem.Sistur;
                    }
                }
                // Si es outhouse
                else
                {
                    Hotel = Detail.srPropertyOpera;
                    Folio = $"{ReceiptID}";

                    // Si la sala de ventas usa sistur
                    if (Detail.srUseSistur)
                    {
                        enumPromotionsSystem = EnumPromotionsSystem.Sistur;
                    }
                }
                // si es una invitacion externa u outhouse
                if ((Detail.lspg.Equals("IH") && Detail.guHReservID == null) || Detail.lspg.Equals("OUT"))
                {
                    // guardamos la reservacion ficticia
                    WirePRHelper.Origos_reservas_ficticias_Guardar(Hotel, Convert.ToInt32(Folio), Detail.guFirstName1, Detail.guLastName1);
                }
            }

            for (int i = 0; i < Result.Count; i++)
            {
                GiftsReceiptDetailPromotionsSistur _Detail = Result[i];

                // preparamos los regalos con promociones que se guardaran en Sistur
                AddPromotion(ref aPromotions, Hotel, Folio, _Detail.giPVPPromotion, _Detail.gegi, ReceiptID, (!string.IsNullOrEmpty(ChangeBy) ? ChangeBy : UserID), enumPromotionsSystem);

                // preparamos los regalos con promociones que se guardaran en Origos
                GiftType typGift = new GiftType();
                typGift.ID                   = _Detail.gegi;
                typGift.Descripcion          = _Detail.giN;
                typGift.Quantity             = 0;
                typGift.Receipt              = ReceiptID;
                typGift.Promotion            = _Detail.giPVPPromotion;
                typGift.TransactionTypeOpera = "";

                // Agregamos a la lista
                aGifts.Add(typGift);
            }

            return(aPromotions);
        }