本文整理汇总了C#中Data.Structures.Creature.Creature类的典型用法代码示例。如果您正苦于以下问题:C# Creature类的具体用法?C# Creature怎么用?C# Creature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Creature类属于Data.Structures.Creature命名空间,在下文中一共展示了Creature类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Abnormal
public Abnormal(Creature.Creature creature, Abnormality abnormality, Creature.Creature caster = null)
{
Creature = creature;
Caster = caster ?? creature;
Abnormality = abnormality;
TimeoutUts = Funcs.GetCurrentMilliseconds() + abnormality.Time;
}
示例2: CheckIntersections
public static float CheckIntersections(Creature creature, short heading, Point3D moveVector, float distance)
{
if (distance <= 0f)
return 0f;
WorldPosition targetPosition = moveVector.Clone().Add(creature.Position).ToWorldPosition();
double minDistance = distance;
List<Creature> around = Global.VisibleService.FindTargets(creature, creature.Position, distance + 40, TargetingAreaType.All);
for (int x = 0; x < around.Count; x++)
{
if (around[x] == creature)
continue;
short diff = Geom.GetAngleDiff(heading, Geom.GetHeading(creature.Position, around[x].Position));
if (diff > 90)
continue;
double d = Geom.DistanceToLine(around[x].Position, creature.Position, targetPosition);
if (d > 40)
continue;
d = creature.Position.DistanceTo(around[x].Position) - 40;
if (d <= 0)
return 0f;
if (d < minDistance)
minDistance = d;
}
return (float)(minDistance / distance);
}
示例3: SpNpcStatus
public SpNpcStatus(Npc npc, int unk1, int unk2, Creature target = null)
{
Npc = npc;
Unk1 = unk1;
Unk2 = unk2;
Target = target;
}
示例4: Release
public virtual void Release()
{
Creature = null;
Npc = null;
Player = null;
Random = null;
}
示例5: AddAbility
public void AddAbility(Creature target, int id, int level)
{
if (target == null)
return;
lock (target.EffectsLock)
{
for (int i = 0; i < target.Effects.Count; i++)
{
if (target.Effects[i].AbilityId == id)
target.Effects.Remove(target.Effects[i]);
}
}
Ability abi = Data.Data.Abilities[id];
if (abi == null)
return;
abi.level = level;
AbilityEffectsProvider.ProvideEffects(target, abi);
lock (target.EffectsLock)
{
target.Effects.Add(abi);
}
lock (TargetsLock)
if (!targets.Contains(target))
targets.Add(target);
}
示例6: Release
public void Release()
{
Creature = null;
Npc = null;
Projectile = null;
TargetPosition = null;
}
示例7: IsVisible
public static bool IsVisible(Player player, Creature creature)
{
if (creature is Player && !Communication.Global.PlayerService.IsPlayerOnline((Player)creature))
return false;
if (creature == null)
return false;
if (!(creature is Item) && !(creature is Gather) && !(creature is Campfire)
&& creature.LifeStats.IsDead())
return false;
if (creature is Gather && ((Gather)creature).CurrentGatherCounter <= 0)
return false;
double distance = player.Position.DistanceTo(creature.Position);
if (distance > VisibleDistance)
return false;
if (creature is Npc && distance < 75)
creature.Position.Z = player.Position.Z + 25;
PlayerLogic.DistanceToCreatureRecalculated(player, creature, distance);
return true;
}
示例8: CreatureLifeStats
public CreatureLifeStats(Creature creature)
{
_hp = creature.GameStats.HpBase + creature.GameStats.HpStamina;
_mp = creature.GameStats.MpBase + creature.GameStats.MpStamina;
Creature = creature;
}
示例9: OnAttacked
public override void OnAttacked(Creature attacker, int damage)
{
Npc.Target = attacker;
BattleController.AddDamage(attacker, damage);
BattleController.AddAggro(attacker, damage);
}
示例10: Init
public override void Init(Creature creature)
{
base.Init(creature);
MoveController = new NpcMoveController(Npc);
BattleController = new NpcBattleController(Npc);
}
示例11: run
protected int MoveStyle; // 1 normal : 2 run (when see player if agressive)
#endregion Fields
#region Constructors
public SpNpcMove(Creature creature, float x, float y, float z, int style)
{
Creature = creature;
Creature.Position.X = x;
Creature.Position.Y = y;
Creature.Position.Z = z;
MoveStyle = style;
}
示例12: OnAttack
public static void OnAttack(Creature creature, Creature target)
{
creature.Ai.OnAttack(target);
Player player = creature as Player;
if (player != null)
ObserverService.AddObserved(player, target);
}
示例13: NpcMoveController
public NpcMoveController(Creature creature)
{
Creature = creature;
Npc = creature as Npc;
TargetPosition = new Point3D();
MoveVector = new Point3D();
}
示例14: Init
public virtual void Init(Creature creature)
{
Creature = creature;
Npc = creature as Npc;
Player = creature as Player;
Random = new Random((int) (DateTime.Now.Ticks + Funcs.Random().Next(int.MinValue, (int) Math.Abs(creature.Position.X))));
}
示例15: InTheVision
public static void InTheVision(Player player, Creature creature)
{
FeedbackService.SendCreatureInfo(player.Connection, creature);
Npc npc = creature as Npc;
if (npc != null)
QuestEngine.ShowIcon(player, npc);
}