Esempio n. 1
0
        List <Production> GetPlayerProductionsByCategory(ProductionCategory category)
        {
            Player            localPlayer       = GameController.instance.playersController.playersIngame[Player.localPlayerId];
            List <Production> playerProductions = localPlayer.GetProductionBuildingsByCategory(category);

            return(playerProductions);
        }
Esempio n. 2
0
        void Redraw(ProductionCategory newCategory)
        {
            List <Production> playerProductions = GetPlayerProductionsByCategory(newCategory);

            for (int i = 0; i < buildNumberIcons.Count; i++)
            {
                var buildingNumberButton = buildNumberIcons[i];

                buildingNumberButton.SetupBuildingId(i);
                buildingNumberButton.SetupWithController(this);

                if (i < playerProductions.Count)
                {
                    buildingNumberButton.SetEnabled();
                }
                else
                {
                    buildingNumberButton.SetDisabled();
                }

                if (i == selectedBuildingNumber)
                {
                    buildingNumberButton.SetActive();
                }
                else
                {
                    buildingNumberButton.SetUnactive();
                }
            }
        }
Esempio n. 3
0
        public void SetupWithProductionCategory(ProductionCategory category)
        {
            productionCategory = category;

            selfImage.sprite = category.icon;

            Redraw();
        }
        public void OnSelectButtonClick(ProductionCategory productionType)
        {
            selectedProductionCategory = productionType;

            if (productionCategoryChanged != null)
            {
                productionCategoryChanged(selectedProductionCategory);
            }

            Redraw();
        }
Esempio n. 5
0
 public ProductionData[] Find(ProductionCategory category, int productId)
 {
     return(this.Entries.Where(a => a.Category == category && a.Id == productId).ToArray());
 }
Esempio n. 6
0
File: Creature.cs Progetto: Rai/aura
		/// <summary>
		/// Calculates and returns general production skill success chance.
		/// </summary>
		/// <remarks>
		/// Unofficial, but seems to work fine in most cases.
		/// Dex bonus: http://mabination.com/threads/57123-Chaos-Life-Skill-Guide-Refining
		/// </remarks>
		/// <returns></returns>
		public float GetProductionSuccessChance(Skill skill, ProductionCategory category, int baseChance, int rainBonus)
		{
			// Base
			float result = baseChance;
			if (skill.Info.Id != SkillId.PotionMaking && skill.Info.Id != SkillId.Milling)
				result += (this.Dex - 60) * (baseChance / 300f);

			// Production Mastery bonus
			var pm = this.Skills.Get(SkillId.ProductionMastery);
			if (pm != null)
				result += (byte)pm.Info.Rank;

			// Weather bonus
			if (ChannelServer.Instance.Weather.GetWeatherType(this.RegionId) == WeatherType.Rain)
			{
				if (category == ProductionCategory.Weaving)
					result += rainBonus * 2;
				else
					result *= 1 + (rainBonus / 100f);
			}

			// Party bonus
			result += this.GetProductionPartyBonus(skill);

			return Math2.Clamp(0, 99, result);
		}
Esempio n. 7
0
		/// <summary>
		/// Checks if category can be handled by this skill, returns false if not.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="category"></param>
		/// <returns></returns>
		protected abstract bool CheckCategory(Creature creature, ProductionCategory category);
Esempio n. 8
0
 protected override bool CheckCategory(Creature creature, ProductionCategory category)
 {
     return(category == ProductionCategory.Handicraft);
 }
Esempio n. 9
0
 protected override bool CheckCategory(Creature creature, ProductionCategory category)
 {
     return(category == ProductionCategory.Spinning || category == ProductionCategory.Weaving);
 }
Esempio n. 10
0
		/// <summary>
		/// Calculates and returns general production skill success chance.
		/// </summary>
		/// <remarks>
		/// Unofficial, but seems to work fine in most cases.
		/// Dex bonus: http://mabination.com/threads/57123-Chaos-Life-Skill-Guide-Refining
		/// </remarks>
		/// <returns></returns>
		public float GetProductionSuccessChance(Skill skill, ProductionCategory category, int baseChance, int rainBonus)
		{
			// Base
			float result = baseChance;
			if (skill.Info.Id != SkillId.PotionMaking && skill.Info.Id != SkillId.Milling)
				result += (this.Dex - 60) * (baseChance / 300f);

			// Production Mastery bonus
			var pm = this.Skills.Get(SkillId.ProductionMastery);
			if (pm != null)
				result += (byte)pm.Info.Rank;

			// Weather bonus
			if (ChannelServer.Instance.Weather.GetWeatherType(this.RegionId) == WeatherType.Rain)
			{
				if (category == ProductionCategory.Weaving)
					result += rainBonus * 2;
				else
					result *= 1 + (rainBonus / 100f);
			}

			// Party bonus
			result += this.GetProductionPartyBonus(skill);

			// Monday: Increase in success rate for production skills.
			// +10%, bonus is unofficial.
			if (ErinnTime.Now.Month == ErinnMonth.AlbanEiler)
				result += 5;

			return Math2.Clamp(0, 99, result);
		}
Esempio n. 11
0
 void OnProductionCategoryChanged(ProductionCategory newCategory)
 {
     SelectBuildingWithNumber(0);
 }
Esempio n. 12
0
 /// <summary>
 /// Checks if category can be handled by this skill, returns false if not.
 /// </summary>
 /// <param name="creature"></param>
 /// <param name="category"></param>
 /// <returns></returns>
 protected abstract bool CheckCategory(Creature creature, ProductionCategory category);
Esempio n. 13
0
		protected override bool CheckCategory(Creature creature, ProductionCategory category)
		{
			return (category == ProductionCategory.Handicraft);
		}
Esempio n. 14
0
        Production GetPlayerProductionByTypeAndNumber(ProductionCategory category, int number)
        {
            List <Production> playerProductions = GetPlayerProductionsByCategory(category);

            return(playerProductions.Count > 0 ? playerProductions[number] : null);
        }
Esempio n. 15
0
File: Weaving.cs Progetto: Rai/aura
		protected override bool CheckCategory(Creature creature, ProductionCategory category)
		{
			return (category == ProductionCategory.Spinning || category == ProductionCategory.Weaving);
		}
Esempio n. 16
0
 protected override bool CheckCategory(Creature creature, ProductionCategory category)
 {
     return(category == ProductionCategory.Milling);
 }
Esempio n. 17
0
		protected override bool CheckCategory(Creature creature, ProductionCategory category)
		{
			return (category == ProductionCategory.Milling);
		}