本文整理汇总了C#中Aura.Channel.World.Entities.Creature.GetRndBareHandDamage方法的典型用法代码示例。如果您正苦于以下问题:C# Creature.GetRndBareHandDamage方法的具体用法?C# Creature.GetRndBareHandDamage怎么用?C# Creature.GetRndBareHandDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Channel.World.Entities.Creature
的用法示例。
在下文中一共展示了Creature.GetRndBareHandDamage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
//.........这里部分代码省略.........
else if (attacker.InterceptingSkillId == SkillId.CombatMastery)
{
aAction = new AttackerAction(CombatActionType.SimultaneousHit, attacker, SkillId.CombatMastery, target.EntityId);
aAction.Options |= AttackerOptions.Result;
tAction = new TargetAction(CombatActionType.CounteredHit, target, attacker, target.Skills.IsReady(SkillId.FinalHit) ? SkillId.FinalHit : SkillId.CombatMastery);
tAction.Options |= TargetOptions.Result;
}
else
{
aAction = new AttackerAction(CombatActionType.Hit, attacker, skill.Info.Id, targetEntityId);
tAction = new TargetAction(CombatActionType.TakeHit, target, attacker, target.Skills.IsReady(SkillId.FinalHit) ? SkillId.FinalHit : SkillId.CombatMastery);
aAction.Options |= AttackerOptions.Result;
tAction.Options |= TargetOptions.Result;
}
attacker.InterceptingSkillId = SkillId.None;
var cap = new CombatActionPack(attacker, skill.Info.Id, tAction, aAction);
cap.Hit = i;
cap.MaxHits = maxHits;
cap.PrevId = prevId;
prevId = cap.Id;
// Default attacker options
aAction.Set(AttackerOptions.Result);
if (dualWield)
aAction.Set(AttackerOptions.DualWield);
// Base damage
var damage = (i == 1 ? attacker.GetRndRightHandDamage() : attacker.GetRndLeftHandDamage());
if (lowStamina)
{
damage = attacker.GetRndBareHandDamage();
}
// Critical Hit
var critShieldReduction = (target.LeftHand != null ? target.LeftHand.Data.DefenseBonusCrit : 0);
var critChance = (i == 1 ? attacker.GetRightCritChance(target.Protection + critShieldReduction) : attacker.GetLeftCritChance(target.Protection + critShieldReduction));
CriticalHit.Handle(attacker, critChance, ref damage, tAction);
var maxDamage = damage; //Damage without Defense and Protection
// Subtract target def/prot
SkillHelper.HandleDefenseProtection(target, ref damage);
// Defense
var tActionOldType = tAction.Type;
Defense.Handle(aAction, tAction, ref damage);
if (i == 1 && tAction.Type == CombatActionType.Defended)
{
defenseStun = tAction.Stun;
}
// Mana Shield
ManaShield.Handle(target, ref damage, tAction, maxDamage);
// Deal with it!
if (damage > 0)
target.TakeDamage(tAction.Damage = damage, attacker);
if (tAction.Type == CombatActionType.Defended && target.Life <= 0)
{
tAction.Type = tActionOldType;
}
示例2: Use
/// <summary>
/// Uses WM, attacking targets.
/// </summary>
/// <param name="attacker"></param>
/// <param name="skill"></param>
/// <param name="targetAreaId"></param>
/// <param name="unkInt1"></param>
/// <param name="unkInt2"></param>
public void Use(Creature attacker, Skill skill, long targetAreaId = 0, int unkInt1 = 0, int unkInt2 = 0)
{
bool wasKnockedDown = (attacker.IsKnockedDown || attacker.WasKnockedBack);
if ((attacker.Stun > 500 && wasKnockedDown || attacker.IsStunned && !wasKnockedDown || DateTime.Now.AddMilliseconds(2000) < attacker.AttackDelayTime && (wasKnockedDown)) && attacker.InterceptingSkillId == SkillId.None)
{
Send.SkillUseSilentCancel(attacker);
return;
}
var range = this.GetRange(attacker, skill);
ICollection<Creature> targets = attacker.GetTargetableCreaturesInRange(range, true).Where(t => !(DateTime.Now.AddMilliseconds(2000) < t.NotReadyToBeHitTime)).ToList(); //Able to be attacked at 1/3 of knock down time.
// Check targets
if (targets.Count == 0)
{
Send.Notice(attacker, Localization.Get("There isn't a target nearby to use that on."));
Send.SkillUseSilentCancel(attacker);
return;
}
// Create actions
var cap = new CombatActionPack(attacker, skill.Info.Id);
var aAction = new AttackerAction(CombatActionType.SpecialHit, attacker, skill.Info.Id, targetAreaId);
aAction.Set(AttackerOptions.Result);
cap.Add(aAction);
var survived = new List<Creature>();
var skipped = new List<Creature>();
var i = 0;
foreach (var target in targets)
{
i++;
target.StopMove();
Skill smash = target.Skills.Get(SkillId.Smash);
if (smash != null && target.Skills.IsReady(SkillId.Smash) && !attacker.IsPlayer)
attacker.InterceptingSkillId = SkillId.Smash;
TargetAction tAction;
if (attacker.InterceptingSkillId == SkillId.Smash && target.GetPosition().InRange(attacker.GetPosition(), target.AttackRangeFor(attacker)))
{
aAction.Options |= AttackerOptions.Result;
tAction = new TargetAction(CombatActionType.CounteredHit, target, attacker, SkillId.Smash);
tAction.Options |= TargetOptions.Result;
}
else
{
tAction = new TargetAction(CombatActionType.TakeHit, target, attacker, skill.Info.Id);
}
attacker.InterceptingSkillId = SkillId.None;
tAction.Delay = 300; // Usually 300, sometimes 350?
// Calculate damage
float damage = 0f;
if (attacker.RightHand != null && (
attacker.RightHand.Data.HasTag("/weapon/bow01/") ||
attacker.RightHand.Data.HasTag("/weapon/bow/") ||
attacker.RightHand.Data.HasTag("/weapon/crossbow/") ||
attacker.RightHand.Data.HasTag("/weapon/shuriken/") ||
attacker.RightHand.Data.HasTag("/weapon/atlatl/") ||
attacker.RightHand.Data.HasTag("/weapon/gun/dualgun/")))
{
damage = attacker.GetRndBareHandDamage();
}
else
{
damage = attacker.GetRndTotalDamage();
}
damage *= skill.RankData.Var1 / 100f;
// Handle skills and reductions
var allCrit = false;
var critSkill = target.Skills.Get(SkillId.CriticalHit);
if (allCrit)
{
// Add crit bonus
var bonus = critSkill.RankData.Var1 / 100f;
damage = damage + (damage * bonus);
// Set target option
tAction.Set(TargetOptions.Critical);
}
else if (i == 1)
{
CriticalHit.Handle(attacker, attacker.GetTotalCritChance(0), ref damage, tAction);
if (tAction.Has(TargetOptions.Critical))
//.........这里部分代码省略.........
示例3: Use
/// <summary>
/// Handles usage of the skill.
/// </summary>
/// <param name="attacker"></param>
/// <param name="target"></param>
public void Use(Creature attacker, Creature target)
{
// Updating unlock because of the updating lock for pre-renovation
// Has to be done here because we can't have an updating unlock
// after the combat action, it resets the stun.
if (!AuraData.FeaturesDb.IsEnabled("TalentRenovationCloseCombat"))
{
attacker.Unlock(Locks.Run, true);
attacker.Unlock(Locks.Move, true);
}
var skill = attacker.Skills.Get(SkillId.Counterattack);
var aAction = new AttackerAction(CombatActionType.RangeHit, attacker, SkillId.Counterattack, target.EntityId);
aAction.Options |= AttackerOptions.Result | AttackerOptions.KnockBackHit2;
var tAction = new TargetAction(CombatActionType.CounteredHit2, target, attacker, target.Skills.IsReady(SkillId.Smash) ? SkillId.Smash : SkillId.CombatMastery);
tAction.Options |= TargetOptions.Result | TargetOptions.Smash;
var cap = new CombatActionPack(attacker, skill.Info.Id);
cap.Add(aAction, tAction);
float damage;
if (attacker.RightHand != null && attacker.RightHand.Data.HasTag("/weapon/gun/")) //TODO: Only do this when out of ammo.
{
damage = (attacker.GetRndBareHandDamage() * (skill.RankData.Var2 / 100f)) +
(target.GetRndTotalDamage() * (skill.RankData.Var1 / 100f));
}
else
{
damage = (attacker.GetRndTotalDamage() * (skill.RankData.Var2 / 100f)) +
(target.GetRndTotalDamage() * (skill.RankData.Var1 / 100f));
}
var critShieldReduction = (target.LeftHand != null ? target.LeftHand.Data.DefenseBonusCrit : 0);
var critChance = attacker.GetTotalCritChance(target.Protection + critShieldReduction) + skill.RankData.Var3;
CriticalHit.Handle(attacker, critChance, ref damage, tAction, true);
var maxDamage = damage; //Damage without Defense and Protection
SkillHelper.HandleDefenseProtection(target, ref damage, true, true);
ManaShield.Handle(target, ref damage, tAction, maxDamage);
target.TakeDamage(tAction.Damage = damage, attacker);
target.Aggro(attacker);
if (target.IsDead)
tAction.Options |= TargetOptions.FinishingKnockDown;
if (attacker.IsCharacter && AuraData.FeaturesDb.IsEnabled("CombatSystemRenewal"))
{
aAction.Stun = 2000;
}
else
{
aAction.Stun = AttackStunTime;
}
tAction.Stun = StunTime;
target.Stability = Creature.MinStability;
attacker.Shove(target, KnockbackDistance);
// Update both weapons
SkillHelper.UpdateWeapon(attacker, target, attacker.RightHand, attacker.LeftHand);
Send.SkillUseStun(attacker, skill.Info.Id, aAction.Stun, 1);
this.Training(aAction, tAction);
cap.Handle();
}