• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Creature.Creature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Creature类属于Data.Structures.Creature命名空间,在下文中一共展示了Creature类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:Abnormal.cs


示例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);
        }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:35,代码来源:SeUtils.cs


示例3: SpNpcStatus

 public SpNpcStatus(Npc npc, int unk1, int unk2, Creature target = null)
 {
     Npc = npc;
     Unk1 = unk1;
     Unk2 = unk2;
     Target = target;
 }
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:7,代码来源:SpNpcStatus.cs


示例4: Release

 public virtual void Release()
 {
     Creature = null;
     Npc = null;
     Player = null;
     Random = null;
 }
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:7,代码来源:DefaultAi.cs


示例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);
        }
开发者ID:mMellowz,项目名称:revcore,代码行数:32,代码来源:AbilityProcessor.cs


示例6: Release

 public void Release()
 {
     Creature = null;
     Npc = null;
     Projectile = null;
     TargetPosition = null;
 }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:NpcMoveController.cs


示例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;
        }
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:26,代码来源:Visible.cs


示例8: CreatureLifeStats

        public CreatureLifeStats(Creature creature)
        {
            _hp = creature.GameStats.HpBase + creature.GameStats.HpStamina;
            _mp = creature.GameStats.MpBase + creature.GameStats.MpStamina;

            Creature = creature;
        }
开发者ID:bobobear,项目名称:TeraEmulator-1,代码行数:7,代码来源:CreatureLifeStats.cs


示例9: OnAttacked

        public override void OnAttacked(Creature attacker, int damage)
        {
            Npc.Target = attacker;

            BattleController.AddDamage(attacker, damage);
            BattleController.AddAggro(attacker, damage);
        }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:NpcAi.cs


示例10: Init

        public override void Init(Creature creature)
        {
            base.Init(creature);

            MoveController = new NpcMoveController(Npc);
            BattleController = new NpcBattleController(Npc);
        }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:NpcAi.cs


示例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;
        }
开发者ID:mMellowz,项目名称:revcore,代码行数:14,代码来源:SpNpcMove.cs


示例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);
        }
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:8,代码来源:AiLogic.cs


示例13: NpcMoveController

        public NpcMoveController(Creature creature)
        {
            Creature = creature;
            Npc = creature as Npc;

            TargetPosition = new Point3D();
            MoveVector = new Point3D();
        }
开发者ID:mMellowz,项目名称:revcore,代码行数:8,代码来源:NpcMoveController.cs


示例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))));
        }
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:8,代码来源:DefaultAi.cs


示例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);
        }
开发者ID:Koushi009,项目名称:TeraEmulator_2117a,代码行数:8,代码来源:PlayerLogic.cs


示例16: Init

        public override void Init(Creature creature)
        {
            base.Init(creature);

            NextRegenUts = Funcs.GetCurrentMilliseconds() + 1000;
            NextDistressUts = Funcs.GetCurrentMilliseconds() + 60000;
            LastBattleUts = 0;
        }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:8,代码来源:PlayerAi.cs


示例17: UpdateCreatureStats

        public static void UpdateCreatureStats(Creature creature)
        {
            StatsService.UpdateStats(creature);

            Player player = creature as Player;
            if (player != null)
                FeedbackService.StatsUpdated(player);
        }
开发者ID:bobobear,项目名称:TeraEmulator,代码行数:8,代码来源:CreatureLogic.cs


示例18: SpNpcMove

 public SpNpcMove(Creature creature, short speed, float x2, float y2, float z2)
 {
     Creature = creature;
     Speed = speed;
     X2 = x2;
     Y2 = y2;
     Z2 = z2;
 }
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:8,代码来源:SpNpcMove.cs


示例19: FindNpcs

        public List<Npc> FindNpcs(Creature creature, float x, float y, float z, double distance, bool findVillagers = false)
        {
            double verticalDistance = distance * 2;

            return creature.VisibleNpcs.Select(npc =>
                                               npc.Position.DistanceTo(x, y) <= distance
                                               && Math.Abs(z - npc.Position.Z) < verticalDistance
                                               /*&& (!npc.NpcTemplate.IsVillager || findVillagers)*/);
        }
开发者ID:mMellowz,项目名称:revcore,代码行数:9,代码来源:VisibleService.cs


示例20: OnAttack

        public override void OnAttack(Creature target)
        {
            if (Player.Controller is DeathController)
                return;

            if (!(Player.Controller is BattleController))
                Global.ControllerService.SetController(Player, new BattleController());
            
            ((BattleController) Player.Controller).AddTarget(target);
        }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:10,代码来源:PlayerAi.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Player.Player类代码示例发布时间:2022-05-24
下一篇:
C# Linq.TestDbManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap