コード例 #1
0
ファイル: SkillIcon.cs プロジェクト: WildGenie/RazorEx
 private SkillIcon(SkillName skill)
 {
     this.skill = skill;
     table.Controls.Add(new LabelEx(skill.ToString(), ConfigEx.GetElement(8, "SkillIconSize")));
     Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Skills", skill.ToString()),
                          ConfigEx.GetAttribute(Location.Y, "locY", "Skills", skill.ToString()));
 }
コード例 #2
0
        public ArmorOfCrafting(int bonus, int itemID, int skill) : base(itemID)
        {
            i_SkillBonus = bonus;
            i_Skill      = skill;

            Weight        = 1;
            PhysicalBonus = 2 + Utility.Random((int)(1.6 * bonus));
            FireBonus     = 4 + Utility.Random((int)(1.6 * bonus));
            ColdBonus     = 3 + Utility.Random((int)(1.6 * bonus));
            PoisonBonus   = 3 + Utility.Random((int)(1.6 * bonus));
            EnergyBonus   = 3 + Utility.Random((int)(1.6 * bonus));

            switch (i_Skill)
            {
            default:
            case 0: sn_SkillName = SkillName.Blacksmith; break;

            case 1: sn_SkillName = SkillName.Mining; break;

            case 2: sn_SkillName = SkillName.Tailoring; break;

            case 3: sn_SkillName = SkillName.Carpentry; break;

            case 4: sn_SkillName = SkillName.Lumberjacking; break;
            }

            string s_Type = "";

            switch (itemID)
            {
            case 5062:
            default: ItemID = 5062; s_Type = "gloves"; break;

            case 7609: ItemID = 7609; s_Type = "cap"; break;

            case 5068: ItemID = 5068; s_Type = "tunic"; break;

            case 5063: ItemID = 5063; s_Type = "gorget"; break;

            case 5069: ItemID = 5069; s_Type = "arms"; break;

            case 5067: ItemID = 5067; s_Type = "leggings"; break;
            }

            if (i_SkillBonus < 1)
            {
                Name = "Apprentices " + s_Type + " of " + sn_SkillName.ToString();
            }
            else if (i_SkillBonus <= 3)
            {
                Name = "Novices " + s_Type + " of " + sn_SkillName.ToString();
            }
            else
            {
                Name = "Masters " + s_Type + " of " + sn_SkillName.ToString();
            }

            this.Hue = CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Platinum));
        }
コード例 #3
0
        public ArmorOfTailoring(int bonus, int itemID, int skill) : base(itemID)
        {
            i_SkillBonus = bonus;
            i_Skill      = skill;

            Weight        = 1;
            PhysicalBonus = 2 + Utility.Random((int)(1.6 * bonus));
            FireBonus     = 4 + Utility.Random((int)(1.6 * bonus));
            ColdBonus     = 3 + Utility.Random((int)(1.6 * bonus));
            PoisonBonus   = 3 + Utility.Random((int)(1.6 * bonus));
            EnergyBonus   = 3 + Utility.Random((int)(1.6 * bonus));
            {
                sn_SkillName = SkillName.Tailoring;
            }

            string s_Type = "";

            switch (itemID)
            {
            case 5062:
            default: ItemID = 5062; s_Type = "gloves"; break;

            case 7609: ItemID = 7609; s_Type = "cap"; break;

            case 5068: ItemID = 5068; s_Type = "tunic"; break;

            case 5063: ItemID = 5063; s_Type = "gorget"; break;

            case 5069: ItemID = 5069; s_Type = "arms"; break;

            case 5067: ItemID = 5067; s_Type = "leggings"; break;
            }

            if (i_SkillBonus < 1)
            {
                Name = "Apprentices " + s_Type + " of " + sn_SkillName.ToString();
            }
            else if (i_SkillBonus <= 3)
            {
                Name = "Novices " + s_Type + " of " + sn_SkillName.ToString();
            }
            else
            {
                Name = "Masters " + s_Type + " of " + sn_SkillName.ToString();
            }

            this.Hue = CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.SpinedLeather, (int)CraftResource.EtherealLeather));
        }
コード例 #4
0
    public BaseSkill GetSkill(SkillName name)
    {
        BaseSkill sk;

        sk = typeof(SkillGenerator).GetMethod(name.ToString(), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(this, null) as BaseSkill;
        return(sk);
    }
コード例 #5
0
ファイル: ExchangeSkill.cs プロジェクト: zerodowned/Ulmeta
        private static void OnTarget(Mobile from, object targeted, object state)
        {
            object[]  args    = state as object[];
            SkillName toLower = (SkillName)args[0];
            SkillName toRaise = (SkillName)args[1];

            if (targeted is Mobile)
            {
                Mobile targ      = (Mobile)targeted;
                Skill  targLower = targ.Skills[toLower];
                Skill  targRaise = targ.Skills[toRaise];

                if (targLower == null || targRaise == null)
                {
                    return;
                }

                double swapBase = targRaise.Base, swapCap = targRaise.Cap;

                targRaise.Base = targLower.Base;
                targRaise.Cap  = targLower.Cap;
                targLower.Base = swapBase;
                targLower.Cap  = swapCap;

                CommandLogging.LogChangeProperty(from, targ, String.Format("{0} was exchanged for", toLower), toRaise.ToString());

                from.SendMessage("{0}\'s {1} skill has been exchanged for {2} {3} skill.",
                                 targ.RawName, toLower.ToString(), (targ.Female ? "her" : "his"), toRaise.ToString());
            }
            else
            {
                from.SendMessage("This only works for mobiles.");
            }
        }
コード例 #6
0
ファイル: SkillScroll.cs プロジェクト: zerodowned/UO-Forever
        public virtual string GetLabelName()
        {
            if (Amount > 1)
            {
                return("+{0} " + SkillName.ToString() + " Skill Scrolls : " + Amount);
            }

            return("a +{0} " + SkillName.ToString() + " Skill Scroll");
        }
コード例 #7
0
ファイル: Gamef.cs プロジェクト: FANTOME-PAN/IEC-Project
 /// <summary>
 /// 读取技能数据
 /// </summary>
 /// <param name="name">技能名称</param>
 /// <returns>技能数据</returns>
 public static SkillData LoadSkillData(SkillName name)
 {
     Debug.Log("Load " + name);
     if (name.ToString().StartsWith("TestSkill"))
     {
         return(Resources.Load <SkillData>("Skill/TestSkill"));
     }
     return(Resources.Load <SkillData>(GameDB.Instance.skillDataPath.paths[(int)name]));
     //return skillCache.LoadData(name);
 }
コード例 #8
0
 public void Casting(SkillName name, float totalTime, bool reverseProgress = false)
 {
     this.reverseProgress  = reverseProgress;
     prograssBar.value     = reverseProgress?0:1;
     timeLeftText.text     = totalTime.ToString("0.0");
     skillName.text        = name.ToString();
     castTimer             = Time.time;
     castingTime           = totalTime;
     skillIcon.mainTexture = ResourceLoader.Skill.GetIcon(name);
 }
コード例 #9
0
        // Does search... returns ArrayList reference for mobiles that matched

        public static ArrayList FindSkillMobs(SkillName skill, int elapsed)
        {
            if (elapsed == 0)
            {
                elapsed = 2;                            // Default
            }
            //ArrayList MobStates = NetState.Instances;
            List <NetState> MobStates  = NetState.Instances;
            ArrayList       MobMatches = new ArrayList(NetState.Instances.Count);

            LogHelper Logger = new LogHelper("findskill.log", false, true);

            // Loop through active connections' mobiles and check conditions

            for (int i = 0; i < MobStates.Count; ++i)
            {
                Mobile m = MobStates[i].Mobile;

                // If m defined & PlayerMobile, get involved (not explicit)

                if (m != null)
                {
                    if (m is PlayerMobile)
                    {
                        PlayerMobile pm = (PlayerMobile)m;

                        SkillName LastSkill = pm.LastSkillUsed;
                        DateTime  LastTime  = pm.LastSkillTime;

                        // Check time & skill, display if match

                        if (LastSkill == skill && DateTime.Now <= (LastTime + TimeSpan.FromSeconds(elapsed * 60)))
                        {
                            MobMatches.Add(pm);
                        }
                    }
                }
            }

            if (MobMatches.Count > 0)
            {
                // Loop through matches and log before returning

                foreach (PlayerMobile pm in MobMatches)
                {
                    Logger.Log(LogType.Mobile, pm, skill.ToString());
                }

                Logger.Finish();
            }

            return(MobMatches);
        }
コード例 #10
0
        public ConditionFunction FindCondition(SkillName skillName)
        {
            var condition = typeof(Condition).GetMethod(skillName.ToString());

            if (condition == null)
            {
                logService.AddEntry(this, $"{skillName} has no condition defined, defaulting to return cast inside grift / rift.", LogLevel.Debug);

                condition = typeof(Condition).GetMethod(nameof(Condition.DefaultAlways));
            }

            return((ConditionFunction)Delegate.CreateDelegate(typeof(ConditionFunction), condition));
        }
コード例 #11
0
ファイル: ExchangeSkill.cs プロジェクト: zerodowned/Ulmeta
        public static bool TryParse(Mobile m, string toParse, ref SkillName skill)
        {
            try
            {
                skill = (SkillName)Enum.Parse(typeof(SkillName), toParse, true);
            }
            catch
            {
                m.SendMessage("{0} is an invalid skill name.", skill.ToString());
                return(false);
            }

            return(true);
        }
コード例 #12
0
ファイル: ExchangeSkill.cs プロジェクト: greeduomacro/hubroot
		public static bool TryParse( Mobile m, string toParse, ref SkillName skill )
		{
			try
			{
				skill = (SkillName)Enum.Parse( typeof( SkillName ), toParse, true );
			}
			catch
			{
				m.SendMessage( "{0} is an invalid skill name.", skill.ToString() );
				return false;
			}

			return true;
		}
コード例 #13
0
    /// <summary>
    /// 通过技能名创建对应的技能类的实例
    /// </summary>
    /// <param name="name">技能名</param>
    /// <returns>对应的技能类的实例</returns>
    public static ISkill CreateSkill(SkillName name)
    {
        if (!isInit)
        {
            Init();
        }

        if (skillDict.ContainsKey(name))
        {
            Type type = skillDict[name];
            return((ISkill)Activator.CreateInstance(type));
        }
        UnityEngine.Debug.Log("No class for skill named :" + name.ToString());
        return(null);
    }
コード例 #14
0
    /// <summary>
    /// 通过技能名创建对应的技能类的实例
    /// </summary>
    /// <param name="name">技能名</param>
    /// <returns>对应的技能类的实例</returns>
    public static ISkill CreateSkill(SkillName name)
    {
        if (!isInit)
        {
            Init();
        }
        int index = (int)name;

        if (classIndex.SkillClasses[index] != null)
        {
            Type type = classIndex.SkillClasses[index];
            return((ISkill)Activator.CreateInstance(type));
        }
        UnityEngine.Debug.Log("No class for skill named :" + name.ToString());
        return(null);
    }
コード例 #15
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            string desc = String.Format("Charges: {0:#,#}", _Charges) + "\n" + String.Format("<BASEFONT COLOR=#00FF00>Use: Increases the {0} bonus of an item by {1:f1}<BASEFONT COLOR=#FFFFFF>", _Skill.ToString(), _Value);

            list.Add(1070722, desc); // ~1_NOTHING~
        }
コード例 #16
0
		public ArmorOfCrafting( int bonus, int itemID, int skill ) : base( itemID )
		{
			i_SkillBonus = bonus;
			i_Skill = skill;
			
			Weight = 1;
			PhysicalBonus = 2 + Utility.Random((int)(1.6*bonus));
			FireBonus = 4 + Utility.Random((int)(1.6*bonus));
			ColdBonus = 3 + Utility.Random((int)(1.6*bonus));
			PoisonBonus = 3 + Utility.Random((int)(1.6*bonus));
			EnergyBonus = 3 + Utility.Random((int)(1.6*bonus));
			
			switch (i_Skill)
			{
				default: case 0: sn_SkillName = SkillName.Blacksmith; break;
				case 1: sn_SkillName = SkillName.Mining; break;
				case 2: sn_SkillName = SkillName.Tailoring; break;
				case 3: sn_SkillName = SkillName.Carpentry; break;
				case 4: sn_SkillName = SkillName.Lumberjacking; break;
			}

			string s_Type = "";
			switch (itemID)
			{
				case 5062: default: ItemID = 5062; s_Type = "gloves"; break;
				case 7609: ItemID = 7609; s_Type = "cap"; break;
				case 5068: ItemID = 5068; s_Type = "tunic"; break;
				case 5063: ItemID = 5063; s_Type = "gorget"; break;
				case 5069: ItemID = 5069; s_Type = "arms"; break;
				case 5067: ItemID = 5067; s_Type = "leggings"; break;
			}

			if (i_SkillBonus < 1)
				Name = "Apprentices " + s_Type + " of " + sn_SkillName.ToString();
			else if (i_SkillBonus <= 3)
				Name = "Novices " + s_Type + " of " + sn_SkillName.ToString();
			else
				Name = "Masters " + s_Type + " of " + sn_SkillName.ToString();
			
			this.Hue = CraftResources.GetHue( (CraftResource)Utility.RandomMinMax( (int)CraftResource.DullCopper, (int)CraftResource.Sunstone ) );
		}
コード例 #17
0
 public static Texture2D GetIcon(SkillName name)
 {
     return(Resources.Load(iconPath + name.ToString()) as Texture2D);
 }
コード例 #18
0
 public static GameObject GetSkillPrefab(SkillName name)
 {
     return(Resources.Load("SkillPrefabs/" + name.ToString()) as GameObject);
 }
コード例 #19
0
 public override void OnSingleClick(Mobile from)
 {
     this.LabelTo(from, Name + " [" + m_Skill1.ToString() + "/" + m_Skill2.ToString() + "]");
 }
コード例 #20
0
ファイル: FindSkill.cs プロジェクト: zerodowned/angelisland
		// Does search... returns ArrayList reference for mobiles that matched

		public static ArrayList FindSkillMobs(SkillName skill, int elapsed)
		{
			if (elapsed == 0) elapsed = 2;	// Default

			//ArrayList MobStates = NetState.Instances;
			List<NetState> MobStates = NetState.Instances;
			ArrayList MobMatches = new ArrayList(NetState.Instances.Count);

			LogHelper Logger = new LogHelper("findskill.log", false, true);

			// Loop through active connections' mobiles and check conditions

			for (int i = 0; i < MobStates.Count; ++i)
			{

				Mobile m = MobStates[i].Mobile;

				// If m defined & PlayerMobile, get involved (not explicit)

				if (m != null)
				{

					if (m is PlayerMobile)
					{

						PlayerMobile pm = (PlayerMobile)m;

						SkillName LastSkill = pm.LastSkillUsed;
						DateTime LastTime = pm.LastSkillTime;

						// Check time & skill, display if match

						if (LastSkill == skill && DateTime.Now <= (LastTime + TimeSpan.FromSeconds(elapsed * 60)))
							MobMatches.Add(pm);
					}

				}

			}

			if (MobMatches.Count > 0)
			{

				// Loop through matches and log before returning

				foreach (PlayerMobile pm in MobMatches)
					Logger.Log(LogType.Mobile, pm, skill.ToString());

				Logger.Finish();
			}

			return MobMatches;
		}
コード例 #21
0
ファイル: Skill.cs プロジェクト: dantastic-66/SWRPG_Sample
        /// <summary>
        /// Saves the skill.
        /// </summary>
        /// <returns>Skill object</returns>
        public Skill SaveSkill()
        {
            SqlDataReader      result;
            DatabaseConnection dbconn     = new DatabaseConnection();
            SqlCommand         command    = new SqlCommand();
            SqlConnection      connection = new SqlConnection(dbconn.SQLSEVERConnString);

            try
            {
                connection.Open();
                command.Connection  = connection;
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "InsertUpdate_Skill";
                command.Parameters.Add(dbconn.GenerateParameterObj("@SkillID", SqlDbType.Int, SkillID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@SkillName", SqlDbType.VarChar, SkillName.ToString(), 100));
                command.Parameters.Add(dbconn.GenerateParameterObj("@SkillDescription", SqlDbType.VarChar, SkillDescription.ToString(), 1000));
                command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityID", SqlDbType.Int, AbilityID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@TrainedSkill", SqlDbType.Bit, TrainedSkill.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@SkillTrainingFeatID", SqlDbType.Int, SkillTrainingFeatID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@AmorProfAffected", SqlDbType.Bit, AmorProfAffected.ToString(), 0));



                result = command.ExecuteReader();

                result.Read();
                SetReaderToObject(ref result);
            }
            catch
            {
                Exception e = new Exception();
                this._insertUpdateOK = false;
                this._insertUpdateMessage.Append(e.Message + "                     Inner Exception= " + e.InnerException);
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this);
        }
コード例 #22
0
ファイル: SkillIcon.cs プロジェクト: WildGenie/RazorEx
 protected override void Save()
 {
     ConfigEx.SetAttribute(Location.X, "locX", "Skills", skill.ToString());
     ConfigEx.SetAttribute(Location.Y, "locY", "Skills", skill.ToString());
 }
コード例 #23
0
 public override string ToString()
 {
     return("ID: " + CharacterSkillID.ToString() + "   UserID: " + SkillName.ToString());
 }
コード例 #24
0
ファイル: SkillBonusInfo.cs プロジェクト: uotools/xrunuo
 public override string ToString()
 {
     return(m_Skill.ToString());
 }
コード例 #25
0
        public virtual bool CheckSkills(Mobile m)
        {
            if (m.Skills[MoveSkill].Value < RequiredSkill)
            {
                string args = string.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), MoveSkill.ToString());
                m.SendLocalizedMessage(1063013, args);                 // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }

            return(true);
        }