本文整理汇总了C#中Combat.GetTargets方法的典型用法代码示例。如果您正苦于以下问题:C# Combat.GetTargets方法的具体用法?C# Combat.GetTargets怎么用?C# Combat.GetTargets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Combat
的用法示例。
在下文中一共展示了Combat.GetTargets方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public override void Run(Combat.Character character)
{
Int32 time = EvaluationHelper.AsInt32(character, Time, 1);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
Vector2 offset = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0));
foreach (Combat.Character target in character.GetTargets(target_id))
{
switch (BindPosition)
{
case BindToTargetPostion.Mid:
offset += target.BasePlayer.Constants.Midposition;
break;
case BindToTargetPostion.Head:
offset += target.BasePlayer.Constants.Headposition;
break;
case BindToTargetPostion.None:
case BindToTargetPostion.Foot:
default:
break;
}
character.Bind.Set(target, offset, time, 0, false);
break;
}
}
示例2: Run
public override void Run(Combat.Character character)
{
Int32 time = EvaluationHelper.AsInt32(character, Time, 1);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
Vector2 position = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0));
foreach (Combat.Character target in character.GetTargets(target_id))
{
target.Bind.Set(character, position, time, 0, true);
}
}
示例3: Run
public override void Run(Combat.Character character)
{
Int32? amount = EvaluationHelper.AsInt32(character, Amount, null);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
if (amount == null) return;
foreach (Combat.Character target in character.GetTargets(target_id))
{
target.BasePlayer.Power += amount.Value;
}
}
示例4: Run
public override void Run(Combat.Character character)
{
Int32? statenumber = EvaluationHelper.AsInt32(character, StateNumber, null);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
if (statenumber == null) return;
foreach (Combat.Character target in character.GetTargets(target_id))
{
target.StateManager.ForeignManager = character.StateManager;
target.StateManager.ChangeState(statenumber.Value);
}
}
示例5: Run
public override void Run(Combat.Character character)
{
Single? x = EvaluationHelper.AsSingle(character, X, null);
Single? y = EvaluationHelper.AsSingle(character, Y, null);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
foreach (Combat.Character target in character.GetTargets(target_id))
{
Vector2 velocity = new Vector2(0, 0);
if (x != null) velocity.X = x.Value;
if (y != null) velocity.Y = y.Value;
target.CurrentVelocity += velocity;
}
}
示例6: Run
public override void Run(Combat.Character character)
{
Int32 facing = EvaluationHelper.AsInt32(character, Facing, 0);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
foreach (Combat.Character target in character.GetTargets(target_id))
{
if (facing > 0)
{
target.CurrentFacing = character.CurrentFacing;
}
else if (facing < 0)
{
target.CurrentFacing = Misc.FlipFacing(character.CurrentFacing);
}
}
}
示例7: Run
public override void Run(Combat.Character character)
{
Int32? amount = EvaluationHelper.AsInt32(character, Amount, null);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
Boolean cankill = EvaluationHelper.AsBoolean(character, CanKill, true);
Boolean absolute = EvaluationHelper.AsBoolean(character, Absolute, false);
if (amount == null) return;
foreach (Combat.Character target in character.GetTargets(target_id))
{
Int32 newamount = amount.Value;
if (absolute == false && newamount < 0)
{
newamount = (Int32)(newamount * character.OffensiveInfo.AttackMultiplier);
newamount = (Int32)(newamount / target.DefensiveInfo.DefenseMultiplier);
}
target.Life += newamount;
if (target.Life == 0 && cankill == false) target.Life = 1;
}
}
示例8: Run
public override void Run(Combat.Character character)
{
Int32 exclude_id = EvaluationHelper.AsInt32(character, Id, -1);
Boolean keepone = EvaluationHelper.AsBoolean(character, KeepOne, true);
List<Combat.Character> removelist = new List<Combat.Character>();
foreach (Combat.Character target in character.GetTargets(Int32.MinValue))
{
if (exclude_id != -1 && target.DefensiveInfo.HitDef.TargetId == exclude_id) continue;
removelist.Add(target);
}
if (removelist.Count > 0 && keepone == true) removelist.RemoveAt(0);
foreach (Combat.Character target in removelist) character.OffensiveInfo.TargetList.Remove(target);
/*
Boolean keptone = false;
foreach (Combat.Entity entity in character.Engine.Entities)
{
Combat.Character target = character.FilterEntityAsTarget(entity, Int32.MinValue);
if (target == null) continue;
if (exclude_id != -1 && target.DefensiveInfo.HitDef.TargetId == exclude_id) continue;
if (keptone == false)
{
keptone = true;
continue;
}
character.OffensiveInfo.TargetList.Remove(target);
}
*/
}