当前位置: 首页>>代码示例>>C#>>正文


C# Skill类代码示例

本文整理汇总了C#中Skill的典型用法代码示例。如果您正苦于以下问题:C# Skill类的具体用法?C# Skill怎么用?C# Skill使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Skill类属于命名空间,在下文中一共展示了Skill类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SkillProperties

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="skill">skill to edit</param>
        public SkillProperties(MainPage parent, Skill skill)
        {
            InitializeComponent();

            nameBox.TextChanged += Filter.FilterString;
            descriptionBox.TextChanged += Filter.FilterString;
            messageBox.TextChanged += Filter.FilterString;
            permissionBox.TextChanged += Filter.FilterString;
            indicatorBox.TextChanged += Filter.FilterMaterial;
            indicatorBox.TextChanged += UpdateDataBox;
            maxLevelBox.TextChanged += Filter.FilterInt;
            itemReqBox.TextChanged += Filter.FilterMaterials;
            requiredLevelBox.TextChanged += Filter.FilterInt;
            levelBaseBox.TextChanged += Filter.FilterInt;
            levelBonusBox.TextChanged += Filter.FilterInt;
            costBaseBox.TextChanged += Filter.FilterInt;
            costBonusBox.TextChanged += Filter.FilterNInt;
            manaBaseBox.TextChanged += Filter.FilterInt;
            manaBonusBox.TextChanged += Filter.FilterNInt;
            cooldownBaseBox.TextChanged += Filter.FilterDouble;
            cooldownBonusBox.TextChanged += Filter.FilterNDouble;
            rangeBaseBox.TextChanged += Filter.FilterDouble;
            rangeBonusBox.TextChanged += Filter.FilterNDouble;
            radiusBaseBox.TextChanged += Filter.FilterDouble;
            radiusBonusBox.TextChanged += Filter.FilterNDouble;
            periodBaseBox.TextChanged += Filter.FilterDouble;
            periodBonusBox.TextChanged += Filter.FilterNDouble;

            this.parent = parent;
            this.skill = skill;
            Apply();
        }
开发者ID:Eniripsa96,项目名称:SkillAPITool,代码行数:36,代码来源:SkillProperties.xaml.cs

示例2: OnPlayerHealsCreature

		/// <summary>
		/// Handles healing training.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="target"></param>
		/// <param name="skill"></param>
		private void OnPlayerHealsCreature(Creature creature, Creature target, Skill healingSkill)
		{
			var skill = creature.Skills.Get(SkillId.MagicMastery);
			if (skill == null)
				return;

			if (healingSkill.Info.Id == SkillId.Healing)
			{
				var index = 0;

				if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.RD)
					index = 1;
				else if (skill.Info.Rank >= SkillRank.RC && skill.Info.Rank <= SkillRank.R6)
					index = 3;

				if (index != 0)
				{
					skill.Train(index); // Use Healing magic on an injured person.
					if (target.Life < 0)
						skill.Train(index + 1); // Use Healing magic on a critically injured person.
				}
			}
			else if (healingSkill.Info.Id == SkillId.PartyHealing && !creature.IsGiant)
			{
				if (skill.Info.Rank >= SkillRank.R5 && skill.Info.Rank <= SkillRank.R1)
					skill.Train(7); // Use Party Healing.
			}
		}
开发者ID:Rai,项目名称:aura,代码行数:34,代码来源:MagicMastery.cs

示例3: GetSkillInfo

 /// <summary>
 /// Get skill information for a specific skill from the specified UO client.
 /// </summary>
 public static SkillInfo GetSkillInfo(int client, Skill skill)
 {
     ClientInfo ci;
     if (ClientInfoCollection.GetClient(client, out ci))
         return ci.GetSkillInfo((int)skill);
     return null;
 }
开发者ID:nazariitashak,项目名称:UOMachine,代码行数:10,代码来源:GetSkillInfo.cs

示例4: Prepare

		/// <summary>
		/// Prepares skill, skips right to used.
		/// </summary>
		/// <remarks>
		/// Doesn't check anything, like what you can gather with what,
		/// because at this point there's no chance for abuse.
		/// </remarks>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			var entityId = packet.GetLong();
			var collectId = packet.GetInt();

			// You shall stop
			creature.StopMove();
			var creaturePosition = creature.GetPosition();

			// Get target (either prop or creature)
			var targetEntity = this.GetTargetEntity(creature.Region, entityId);
			if (targetEntity != null)
				creature.Temp.GatheringTargetPosition = targetEntity.GetPosition();

			// Check distance
			if (!creaturePosition.InRange(creature.Temp.GatheringTargetPosition, MaxDistance))
			{
				Send.Notice(creature, Localization.Get("Your arms are too short to reach that from here."));
				return false;
			}

			// ? (sets creatures position on the client side)
			Send.CollectAnimation(creature, entityId, collectId, creaturePosition);

			// Use
			Send.SkillUse(creature, skill.Info.Id, entityId, collectId);
			skill.State = SkillState.Used;

			return true;
		}
开发者ID:tkiapril,项目名称:aura,代码行数:41,代码来源:Gathering.cs

示例5: GetProgress

		protected virtual int GetProgress(ConquestState state, Skill skill)
		{
            if (skill == null)
			{
				return 0;
			}

            if (state.User == null)
                return 0;

            if ((Skill != (SkillName)skill.SkillID))
            {
                if (ChangeSkillReset)
                {
                    return -state.Progress;
                }

                return 0;
            }

		    if (SkillAmount != 0 && SkillAmount > state.User.Skills[Skill].Value)
		    {
                return 0;
		    }

			return 1;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:27,代码来源:SkillConquest.cs

示例6: Prepare

		/// <summary>
		/// Prepares skill, goes straight to use to skip readying and using it.
		/// </summary>
		/// <remarks>
		/// The client will take a moment to send the Complete packet,
		/// as if it would cast the skill first.
		/// </remarks>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillUse(creature, skill.Info.Id, 0);
			skill.State = SkillState.Used;

			return true;
		}
开发者ID:aura-project,项目名称:aura,代码行数:17,代码来源:WebSpinning.cs

示例7: ChangeSkill

    //assign a new skill to the manager (put into the list) return whether the change is successful
    public static bool ChangeSkill(Skill skill, int index)
    {
        if((skill.attack_type != status_manager.weapon_type && skill.attack_type != Skill.AttackType.anytype) || skill.level_req > status_manager.level)
        {
            return false;
        }

        //if skill is already there
        for(int i = 0; i < 6; ++i)
        {
            if(skills[i] != null && skills[i].id == skill.id)
            {
                skills[i].Remove();
                skills[i] = null;
                StatusGUIManager.EmptySkillIcon(i);
                SkillSlotManager.EmptySkill(i);
            }
        }

        if(skills[index] != null)
        {
            skills[index].Remove();
        }

        StatusGUIManager.ChangeSkillIcon(index, skill.icon);
        SkillSlotManager.AssignSkill(index, skill);
        skill.ownership = Skill.Ownership.player;
        skill.SetUp(status_manager);
        skills[index] = skill;
        return true;
    }
开发者ID:jackykschou,项目名称:2012_Untitled_RPG,代码行数:32,代码来源:SkillManager.cs

示例8: Start

		/// <summary>
		/// Starts Mana Deflector.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="dict"></param>
		/// <returns></returns>
		public override StartStopResult Start(Creature creature, Skill skill, MabiDictionary dict)
		{
			// Give an indication of activation, official behavior unknown.
			Send.Notice(creature, Localization.Get("Mana Deflector activated."));

			return StartStopResult.Okay;
		}
开发者ID:tkiapril,项目名称:aura,代码行数:14,代码来源:ManaDeflector.cs

示例9: UseRegular

		/// <summary>
		/// Handles usage of the skill if it's a regular dye.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <param name="part"></param>
		private void UseRegular(Creature creature, Skill skill, Packet packet, int part)
		{
			var x = packet.GetShort();
			var y = packet.GetShort();

			Send.SkillUseDye(creature, skill.Info.Id, part, x, y);
		}
开发者ID:xKamuna,项目名称:aura,代码行数:14,代码来源:Dye.cs

示例10: Init

 /// <summary>
 /// 初始化
 /// </summary>
 public override void Init(Skill Skill, XmlNode data)
 {
     base.Init(Skill, data);
     Dealy = Skill_Manager.GetXmlAttrFloat(data, "delay");
     LifeTime = Skill_Manager.GetXmlAttrFloat(data, "lifetime");
     CD = Skill_Manager.GetXmlAttrFloat(data, "cd");
 }
开发者ID:webconfig,项目名称:Design,代码行数:10,代码来源:Skill_Time.cs

示例11: getAcidBlade

 public static Skill getAcidBlade()
 {
     if (acidBlade == null)
     {
         acidBlade = new Skill();
         acidBlade.name = "Acid\nBlade";
         acidBlade.icon = Resources.Load<Sprite>("SpellVisuals/ASSASSIN/ACID BLADE/acid blade");
         acidBlade.description = "Weaker than Shiv but corrodes your enemy's armor!";
         acidBlade.basePower = 3;
         acidBlade.aoe = 0;
         acidBlade.range = 1;
         acidBlade.manaCost = user => 0;
         acidBlade.cooldown = 3;
         acidBlade.damageType = Skill.DamageType.DAMAGE;
         acidBlade.targetType = Skill.TargetType.ENEMY;
         acidBlade.OnTarget = (user, target, args) =>
         {
             float amt = user.DamageMultiplier * acidBlade.basePower;
             target.TakeDamage(amt, user);
             target.AddEffect(EffectFactory.GetWeakenDefenseEffect(), 3);
         };
         acidBlade.GenerateTasks = (user, tile, args) =>
         {
             List<Unit> list = acidBlade.gatherTargets(user, tile);
                 GameManager.instance.tasks.Add(new Task_Face_Eachother(user, tile.unit));
                 GameManager.instance.tasks.Add(new Task_Trigger_Animation(user, "Punch"));
                 GameManager.instance.tasks.Add(new Task_Wait(0.3f));
                 GameManager.instance.tasks.Add(new Task_PlaySound(Resources.Load<AudioClip>("SE/Sward4")));
                 GameManager.instance.tasks.Add(new Task_ShowParticleAnimation((GameObject)Resources.Load("SpellVisuals/ASSASSIN/shiv/shiv prefab"), tile.transform.position, 1));
                 GameManager.instance.tasks.Add(new Task_Trigger_Animation(tile.unit, "Hit"));
             acidBlade.EnqueueExecuteTask(user, tile, args);
         };
     }
     return acidBlade;
 }
开发者ID:jegriffi,项目名称:SeanJamesMattAndrew,代码行数:35,代码来源:SkillFactory.cs

示例12: OnSkillClick

	void OnSkillClick(Skill skill)
	{
		PlayerInfo info = PlayerInfo._instance;
		
		this.skill = skill;
		this.skillNameLabel.text = this.skill.Name + " Lv." + this.skill.Level;
		this.skillDesLabel.text = "当前技能的攻击力为: " + (this.skill.Damage*this.skill.Level) + "\n下一级技能的攻击力为: " + (this.skill.Damage*(this.skill.Level+1)) 
			+ "\n升级所需要的金币数: " + (500*(skill.Level+1));
		if((500*(this.skill.Level+1)) <= info.Coin)
		{
			if(this.skill.Level < info.Level)
			{
				SetUpgradeButtonState(true, "升级");
			}
			else
			{
				SetUpgradeButtonState(false, "最大等级");
			}
		}
		else
		{
			SetUpgradeButtonState(false, "金币不足");
		}

	}
开发者ID:xiaopan1991,项目名称:TaidouARPGProject,代码行数:25,代码来源:SkillUI.cs

示例13: PutOnCooldown

 public void PutOnCooldown(Skill sk)
 {
     if (!onCooldown.Contains(sk))
     {
         onCooldown.Add(sk);
     }
 }
开发者ID:JerethChampagne,项目名称:ArenaLegends,代码行数:7,代码来源:Spellbook.cs

示例14: Start

		public void Start(Creature creature, Skill skill, Packet packet)
		{
			// Get parameters
			var stringParam = packet.NextIs(PacketElementType.String);
			var dict = new MabiDictionary();
			byte unkByte = 0;

			if (stringParam)
				dict.Parse(packet.GetString());
			else
				unkByte = packet.GetByte();

			// Run skill
			var result = this.Start(creature, skill, dict);

			if (result == StartStopResult.Fail)
			{
				Send.SkillStartSilentCancel(creature, skill.Info.Id);
				return;
			}

			skill.Activate(SkillFlags.InUse);

			Send.StatUpdate(creature, StatUpdateType.Private, Stat.Mana, Stat.Stamina);

			if (stringParam)
				Send.SkillStart(creature, skill, dict.ToString());
			else
				Send.SkillStart(creature, skill, unkByte);
		}
开发者ID:aura-project,项目名称:aura,代码行数:30,代码来源:StartStopSkillHandler.cs

示例15: ReceiveMouseInput

 public void ReceiveMouseInput(GameObject clicked)
 {
     Enemy enemy = clicked.GetComponent<Enemy>();
     if (enemy)
     {
         bool success;
         if (m_currentSkill && enemy.m_skillWeakTo == m_currentSkill.m_color)
         {
             success = enemy.TakeDamage(m_currentSkill.Strength());
         }
         else
         {
             success = enemy.TakeDamage(0);
         }
         if (success && m_currentSkill)
         {
             m_currentSkill.Grow();
         }
     }
     Skill skill = clicked.GetComponent<Skill>();
     if (skill)
     {
         m_currentSkill = skill;
         GameManager.instance.SetCursorFromCurrentSkill(m_currentSkill.m_color);
     }
 }
开发者ID:jmdigiov,项目名称:Growth,代码行数:26,代码来源:PlayerController.cs


注:本文中的Skill类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。