示例#1
0
        //private bool _spawned;  // using my own spawn flag cause Actor.Spawned isn't being used right now

        public Projectile(SkillContext context, int actorSNO, Vector3 UserPosition)
            : base(actorSNO)
        {
            this.World         = context.World;
            IsAlreadyDestroyed = false;

            //ObjectDescription = new BoundingSphere(new Vector3(0, 0, 0), new Real(0.1f));

            TranslateSpeed = 1f;

            /*this.PxActor =*/

            /*Dirac.Engine.PhysXEngine.PhysXConcurrentActions.Enqueue(() =>
             *  );*/

            if (this.Scale == 0f)
            {
                this.Scale = 1.00f;
            }

            this.Context  = context;
            this.Position = new Vector3(UserPosition.x, UserPosition.y, UserPosition.z); // sin este vector3d al cambiar pos se cambia user pos ric0

            this.TimeOut = 3000;                                                         //default

            // 2 second default timeout for projectiles
            //this.Timer = new TickTimer(2000);

            LastPosition = this.Position /*era null*/;

            //PowerManager.ProjectilesToUpdate.Add(this.DynamicID);
        }
示例#2
0
        public EffectActor(SkillContext context, int actorSNO, Vector3 position)
            : base(actorSNO)
        {
            this.Context = context;

            //this.Field2 = 0x8;
            if (this.Scale == 0f)
            {
                this.Scale = 1f;
            }
            this.Position = position;

            // copy in important effect params from user

            /*this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            *  this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            *  this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            *  this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            *  this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];*/
        }
示例#3
0
        public static bool RunPower(Actor owner /*, Actor targetedActor*/, TargetMessage targetMessage)
        {
            if (targetMessage.PowerSlot == null)
            {
                return(false); //thrwo ex
            }
            //targetPosition = targetedActor.Position;

            //user.Attributes[GameAttribute.Mana_Cur, (int)(user as Player).Toon.HeroTable.PrimaryResource] = 100 /*GetMaxResource((int)Toon.HeroTable.SecondaryResource)*/;
            //user.Attributes.BroadcastChangedIfRevealed();


            //return false;


            // find and run a power implementation
            SkillContext implementation = SkillManager.createInstance((owner as Player), (SkillSlot)targetMessage.PowerSlot);

            if (implementation == null)
            {
                return(false); //loghack //throw ex
            }
            if (owner.World.Actors.ContainsKey(targetMessage.TargetID))
            {
                implementation.TargetActor = owner.World.Actors[targetMessage.TargetID];
            }
            implementation.TargetMessageFromClient = targetMessage;
            implementation.Player = (owner as Player);
            implementation.World  = owner.World;
            implementation.DestinationUserClick = targetMessage.Position;
            implementation.VectorDirector       = (implementation.DestinationUserClick - implementation.Player.Position).NormalizedCopy;

            implementation.Run();

            //Logging.LogManager.DefaultLogger.Trace("Skill SNO Used {0}", targetMessage.PowerSlot);

            return(true);
        }
示例#4
0
        public bool LootAndExp; //HACK: As we currently just give out random exp and loot, this is in to prevent giving this out for mobs that shouldn't give it.

        public DeathPayload(SkillContext context, DamageType deathDamageType, Actor target, bool grantsLootAndExp = true)
            : base(context, target)
        {
            this.LootAndExp      = grantsLootAndExp;
            this.DeathDamageType = deathDamageType;
        }
示例#5
0
 public Payload(SkillContext context, Actor target)
 {
     this.Context = context;
     this.Target  = target;
 }
示例#6
0
 public AttackPayload(SkillContext context)
     : base(context, context.Player)
 {
 }