Exemplo n.º 1
0
        public string AddStoreInfosToUsableItem(Data_Item item, UI_StoreItemDisplayV2 itemUi, bool isHidden)
        {
            if (!data.moreInfosInUseableShops || isHidden)
            {
                return(string.Empty);
            }

            Data_InventoryItem invItem = item as Data_InventoryItem;

            if (invItem == null || invItem.ItemType != InventoryItemTypes.Useable)
            {
                return(string.Empty);
            }

            int playerId = UI_StoreScreenV2.Instance.CurrentShopper;
            PlayerCharacters playerChar   = PlayerManager.Instance.Players[playerId].PlayerCharacter;
            bool             haveConsumed = PlayerGlobalInventory.instance.HaveYouConsumedThis(item, playerChar);

            itemUi.ToggleAlreadyPurchased(haveConsumed, true);

            if (invItem.ItemName == "ITEM_NAME_NOIZE_FIGURE")
            {
                return(" +1 ALL");
            }

            return(string.Format("{0}{1}{2}{3}{4}{5}",
                                 invItem.Stat_ST > 0 ? string.Format(" +{0} ST", invItem.Stat_ST) : string.Empty,
                                 invItem.Stat_SP > 0 ? string.Format(" +{0} SP", invItem.Stat_SP) : string.Empty,
                                 invItem.Stat_AG > 0 ? string.Format(" +{0} AG", invItem.Stat_AG) : string.Empty,
                                 invItem.Stat_WP > 0 ? string.Format(" +{0} WP", invItem.Stat_WP) : string.Empty,
                                 invItem.Stat_AT > 0 ? string.Format(" +{0} AT", invItem.Stat_AT) : string.Empty,
                                 invItem.Stat_LK > 0 ? string.Format(" +{0} LK", invItem.Stat_LK) : string.Empty
                                 ));
        }
Exemplo n.º 2
0
        private static int optimize_actor_item_value(InventoryOptimizePasses pass,
                                                     Game_Actor actor, Data_Item item)
        {
            int value = 0;

            switch (pass)
            {
            case InventoryOptimizePasses.HealingItem:
                value = item.healing_item_value();
                break;

            case InventoryOptimizePasses.Accessory:
                value = item.accessory_value();
                break;

            case InventoryOptimizePasses.DanceRing:
                value = item.dance_value();
                break;
            }

            // Bonus for Prfs
            if (item.is_prf)
            {
                value += 5;
            }
            return(value);
        }
Exemplo n.º 3
0
        public DateWiseGraph Get_Order_Count_By_Month(string cartType, int month, int year)
        {
            var obj = new DateWiseGraph();

            using (var con = DbHelper.GetSqlConnection())
            {
                var dates = con.Query <DateTime>(string.Format("SELECT [Dates] from Get_All_Days_Of_Month({0}, {1})", month, year), commandType: CommandType.Text).ToList();
                foreach (var x in dates)
                {
                    obj.labels.Add(x.ToString("dd MMM yyyy"));
                }
                var productTypes = con.Query <string>("SELECT DISTINCT Product_Type FROM [Shopping_Cart_Items_Tbl]", commandType: CommandType.Text);
                if (productTypes != null)
                {
                    var dataSet = new List <Data_Item>();
                    foreach (var x in productTypes)
                    {
                        var dataItem = new Data_Item {
                            label = x
                        };
                        dataItem.data = con.Query <int>(string.Format("SELECT ISNULL(t2.[Count], 0) as 'data' from Get_All_Days_Of_Month({0}, {1}) t1 LEFT JOIN Get_DateWise_Order_Count('{2}', '{3}') t2 on t1.[Dates]=t2.[Date]", month, year, cartType, x), commandType: CommandType.Text).ToList();
                        dataSet.Add(dataItem);
                    }
                    obj.datasets = dataSet;
                }
            }
            return(obj);
        }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     selected = MenuLog.Objective;
     hover    = MenuLog.Objective;
     oldstate = MenuLog.Objective;
     items    = GetComponent <Menu_Flow> ().gamedata.GetComponent <Data_Item> ();
     Change_Text("No Objective");
     menu = GetComponent <Menu_Flow> ();
 }
Exemplo n.º 5
0
 public Equipment_Service()
 {
     DebugWeapon = new Data_Weapon()
     {
         Name = "[DEBUG WEAPON]", Main_Type = 0, Uses = -1
     };
     DebugItem = new Data_Item()
     {
         Name = "[DEBUG ITEM]", Uses = -1
     };
 }
Exemplo n.º 6
0
        private void CreateStatsWindow(bool createPopup = false, Data_Item item = null)
        {
            // Create a unit for the stats window
            Global.game_map.add_actor_unit(Constants.Team.PLAYER_TEAM, Config.OFF_MAP, ActorId, "");

            Stats_Window     = new Prep_Stats_Window(Global.game_map.last_added_unit);
            Stats_Window.loc = new Vector2(Config.WINDOW_WIDTH - 160, Config.WINDOW_HEIGHT - 136);

            if (createPopup)
            {
                Stats_Popup = new Stat_Boost_Popup(
                    item.Id, !item.is_weapon, Global.game_map.last_added_unit, -1, true);
                Stats_Popup.loc = new Vector2(
                    (Config.WINDOW_WIDTH - 80) - Stats_Popup.width / 2,
                    Config.WINDOW_HEIGHT - 56);
                Stats_Popup.stereoscopic = Config.PREPITEM_WINDOW_DEPTH;
            }

            Global.game_map.completely_remove_unit(Global.game_map.last_added_unit.id);
        }
Exemplo n.º 7
0
 public void CreateStatsPopup(Data_Item item, Dictionary <Boosts, int> boosts)
 {
     CreateStatsWindow(true, item);
     Stats_Window.gain_stats(boosts);
 }
Exemplo n.º 8
0
        private void UseItem(
            ConfirmationMenu useConfirmMenu,
            ItemUseMenu useMenu,
            ItemRepairMenu repairMenu)
        {
            Game_Actor actor = useMenu.Actor;
            Data_Item  item  = useMenu.SelectedItemData.to_item;

            // Use -1 if nothing
            int inventoryTarget = -1;

            if (repairMenu != null)
            {
                inventoryTarget = repairMenu.SelectedItem;
            }

            // If promoting
            if (actor.PromotedBy(item))
            {
                // If there are multiple promotion choices
                if (actor.PromotedBy(item) &&
                    actor.NeedsPromotionMenu)
                {
                    Global.game_map.add_actor_unit(Constants.Team.PLAYER_TEAM, Config.OFF_MAP, actor.id, "");
                    var unit = Global.game_map.last_added_unit;

                    var promotionChoiceMenu = new PromotionChoiceMenu(unit);
                    promotionChoiceMenu.Selected  += PromotionChoiceMenu_Selected;
                    promotionChoiceMenu.Canceled  += PromotionChoiceMenu_Canceled;
                    promotionChoiceMenu.Closed    += menu_Closed;
                    promotionChoiceMenu.Confirmed += PromotionChoiceMenu_Confirmed;
                    AddMenu(promotionChoiceMenu);

                    var promotionMenuFadeIn = promotionChoiceMenu.FadeInMenu(false);
                    promotionMenuFadeIn.Finished += menu_Closed;
                    AddMenu(promotionMenuFadeIn);
                }
                else
                {
                    Promote(useMenu);
                }
            }
            else
            {
                RemoveTopMenu(useConfirmMenu);
                if (repairMenu != null)
                {
                    RemoveTopMenu(repairMenu);
                }

                Global.game_system.play_se(System_Sounds.Gain);
                Dictionary <Boosts, int> boosts = actor.item_boosts(item);
                // Apply item effect
                actor.item_effect(item, inventoryTarget);
                actor.recover_hp();

                useMenu.UseItem();
                useMenu.ShowWindow();
                if (item.is_stat_booster() || item.is_growth_booster())
                {
                    useMenu.CreateStatsPopup(item, boosts);
                }
                else if (item.can_repair)
                {
                    useMenu.CreateRepairPopup(inventoryTarget);
                }
            }
        }