예제 #1
0
        public Api_Result <Mem_ship> Marriage(int ship_rid)
        {
            Api_Result <Mem_ship> api_Result = new Api_Result <Mem_ship>();

            if (!this.ValidMarriage(ship_rid))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            Mem_useitem mem_useitem = null;

            if (!Comm_UserDatas.Instance.User_useItem.TryGetValue(55, ref mem_useitem))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (mem_useitem.Value == 0)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            Mem_ship     mem_ship     = Comm_UserDatas.Instance.User_ship.get_Item(ship_rid);
            Mst_ship     mst_ship     = Mst_DataManager.Instance.Mst_ship.get_Item(mem_ship.Ship_id);
            Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ship);
            int          num          = mem_ship.Maxhp - mem_shipBase.C_taik_powerup;
            int          num2         = num + this.getMariageTaik(num);

            if (num2 > mst_ship.Taik_max)
            {
                num2 = mst_ship.Taik_max;
            }
            mem_shipBase.C_taik         = num2 - mst_ship.Taik;
            mem_shipBase.C_taik_powerup = ((num2 + mem_shipBase.C_taik_powerup <= mst_ship.Taik_max) ? mem_shipBase.C_taik_powerup : (mst_ship.Taik_max - num2));
            num2 += mem_shipBase.C_taik_powerup;
            mem_shipBase.Nowhp = num2;
            int luck = mem_ship.Luck;
            int num3 = (int)Utils.GetRandDouble(3.0, 6.0, 1.0, 1);
            int num4 = luck + num3;

            if (num4 > mst_ship.Luck_max)
            {
                num4 = mst_ship.Luck_max;
            }
            mem_shipBase.C_luck = num4 - mst_ship.Luck;
            mem_shipBase.Level  = 100;
            mem_ship.Set_ShipParam(mem_shipBase, mst_ship, false);
            Dictionary <int, int> mst_level = Mst_DataManager.Instance.Get_MstLevel(true);

            mem_ship.SetRequireExp(mem_ship.Level, mst_level);
            mem_ship.SumLovToMarriage();
            Comm_UserDatas.Instance.Ship_book.get_Item(mem_ship.Ship_id).UpdateShipBook(false, true);
            Comm_UserDatas.Instance.User_useItem.get_Item(55).Sub_UseItem(1);
            api_Result.data = mem_ship;
            return(api_Result);
        }