本文整理汇总了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();
}
示例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.
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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");
}
示例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;
}
示例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, "金币不足");
}
}
示例13: PutOnCooldown
public void PutOnCooldown(Skill sk)
{
if (!onCooldown.Contains(sk))
{
onCooldown.Add(sk);
}
}
示例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);
}
示例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);
}
}