예제 #1
0
            public override bool Apply()
            {
                if (!base.Apply())
                {
                    return(false);
                }

                // dash speed seems to always be actor speed * 10
                float speed = Target.Attributes[GameAttribute.Running_Rate_Total] * 10f;

                Target.TranslateFacing(_destination, true);
                _mover = new ActorMover(Target);
                _mover.Move(_destination, speed, new NotifyActorMovementMessage
                {
                    TurnImmediately = true,
                    Field5          = 0x9206, // alt: 0x920e, not sure what this param is for.
                    AnimationTag    = 69808,  // dashing strike attack animation
                    Field7          = 6,      // ticks to wait before playing attack animation
                });

                // make sure buff timeout is big enough otherwise the client will sometimes ignore the visual effects.
                TickTimer minDashWait = WaitSeconds(0.15f);

                Timeout = minDashWait.TimeoutTick > _mover.ArrivalTime.TimeoutTick ? minDashWait : _mover.ArrivalTime;

                Target.Attributes[GameAttribute.Hidden] = true;
                Target.Attributes.BroadcastChangedIfRevealed();
                return(true);
            }
예제 #2
0
    public void moveToPortalLocation()
    {
        ActorMover.moveActor(gameObject, portalLocation, true);
        moveOnNextSceneLoad = false;

        // set the player's respawn point
        GetComponent <DyingPlayer>().respawnPoint = transform.position;
        // stop the player moving
        if (GetComponent <MovementFromAbility>())
        {
            GetComponent <MovementFromAbility>().onReachingDestination();
        }
        // stop the player's ability use
        if (GetComponent <UsingAbility>())
        {
            GetComponent <UsingAbility>().stopUsingAbility();
        }
        // reset the player's position recorder
        if (GetComponent <PositionRecorder>())
        {
            GetComponent <PositionRecorder>().reset();
        }
        // disable spawns that are too near to where the player has entered the area
        foreach (SpawnController spawn in SpawnController.all)
        {
            if (Vector3.Distance(spawn.transform.position, transform.position) < disableSpawnerRange)
            {
                spawn.deactivate();
            }
        }
    }
예제 #3
0
        public override IEnumerable<TickTimer> Main()
        {
            //StartCooldown(WaitSeconds(10f));

            ActorMover mover = new ActorMover(User);
            mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                Field7 = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
                yield return WaitTicks(1);

            // extra wait for leap to finish
            yield return WaitTicks(1);

            // ground smash effect
            User.PlayEffectGroup(162811);

            bool hitAnything = false;
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(TargetPosition, 8f);
            attack.AddWeaponDamage(0.70f, DamageType.Physical);
            attack.OnHit = hitPayload => { hitAnything = true; };
            attack.Apply();

            if (hitAnything)
                GeneratePrimaryResource(15f);

            yield break;
        }
예제 #4
0
 public PowerAction(Actor owner, int powerSNO)
     : base(owner)
 {
     _power            = PowerLoader.CreateImplementationForPowerSNO(powerSNO);
     _power.User       = owner;
     _powerRan         = false;
     _baseAttackRadius = this.Owner.ActorData.Cylinder.Ax2 + _power.EvalTag(PowerKeys.AttackRadius) + 1.5f;
     _ownerMover       = new ActorMover(owner);
 }
예제 #5
0
파일: KnockbackBuff.cs 프로젝트: n4v/mooege
        public override bool Apply()
        {
            if (!base.Apply())
                return false;

            Vector3D destination = PowerMath.TranslateDirection2D(User.Position, Target.Position,
                                                                   _magnitude < 0f ? User.Position : Target.Position, 
                                                                   (float)Math.Sqrt(Math.Abs(_magnitude)));

            _mover = new ActorMover(Target);
            _mover.MoveArc(destination, _height, _gravity, new ACDTranslateArcMessage
            {
                Field3 = 0x2006, // wtf?
                FlyingAnimationTagID = AnimationSetKeys.KnockBack.ID,
                LandingAnimationTagID = AnimationSetKeys.KnockBackLand.ID,
                PowerSNO = PowerSNO
            });

            return true;
        }
예제 #6
0
        public override IEnumerable <TickTimer> Main()
        {
            //StartCooldown(WaitSeconds(10f));

            ActorMover mover = new ActorMover(User);

            mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID  = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                Field7 = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
            {
                yield return(WaitTicks(1));
            }

            // extra wait for leap to finish
            yield return(WaitTicks(1));

            // ground smash effect
            User.PlayEffectGroup(162811);

            bool          hitAnything = false;
            AttackPayload attack      = new AttackPayload(this);

            attack.Targets = GetEnemiesInRadius(TargetPosition, 8f);
            attack.AddWeaponDamage(0.70f, DamageType.Physical);
            attack.OnHit = hitPayload => { hitAnything = true; };
            attack.Apply();

            if (hitAnything)
            {
                GeneratePrimaryResource(15f);
            }

            yield break;
        }
    public void moveCreator()
    {
        GameObject caster = GetComponent <CreationReferences>().creator;

        if (!caster)
        {
            return;
        }

        if (dontMoveCreatorIfDeath)
        {
            StateController controller = caster.GetComponent <StateController>();
            if (controller.currentState == controller.dying)
            {
                return;
            }
        }

        caster.transform.LookAt(transform.position);
        ActorMover.moveActor(caster, transform.position);
    }
예제 #8
0
        public override bool Apply()
        {
            if (!base.Apply())
            {
                return(false);
            }

            Vector3D destination = PowerMath.TranslateDirection2D(User.Position, Target.Position,
                                                                  _magnitude < 0f ? User.Position : Target.Position,
                                                                  (float)Math.Sqrt(Math.Abs(_magnitude)));

            _mover = new ActorMover(Target);
            _mover.MoveArc(destination, _height, _gravity, new ACDTranslateArcMessage
            {
                Field3 = 0x2006, // wtf?
                FlyingAnimationTagID  = AnimationSetKeys.KnockBack.ID,
                LandingAnimationTagID = AnimationSetKeys.KnockBackLand.ID,
                Field7 = PowerSNO
            });

            return(true);
        }
예제 #9
0
            public override bool Apply()
            {
                if (!base.Apply())
                    return false;

                float speed = User.Attributes[GameAttribute.Running_Rate_Total] * EvalTag(PowerKeys.WalkingSpeedMultiplier);

                User.TranslateFacing(_destination, true);
                _mover = new ActorMover(User);
                _mover.Move(_destination, speed, new ACDTranslateNormalMessage
                {
                    TurnImmediately = true,
                    AnimationTag = 69808,
                });

                // make sure buff timeout is big enough otherwise the client will sometimes ignore the visual effects.
                TickTimer minDashWait = WaitSeconds(0.15f);
                Timeout = minDashWait.TimeoutTick > _mover.ArrivalTime.TimeoutTick ? minDashWait : _mover.ArrivalTime;

                User.Attributes.BroadcastChangedIfRevealed();
                return true;
            }
예제 #10
0
        //there is a changed walking speed multiplier from 8101 patch.
        public override IEnumerable<TickTimer> Main()
        {
            //if (User.CurrentScene.NavMesh.WalkGrid[(int)((TargetPosition.X - 
            //this.World.QuadTree.Query<Mooege.Core.GS.Map.Scene>(TargetPosition).FirstOrDefault().Bounds.Left) / 2.5f), 
            //(int)((TargetPosition.Y - this.World.QuadTree.Query<Mooege.Core.GS.Map.Scene>(TargetPosition).FirstOrDefault().Bounds.Top) / 2.5f)] == 0)	
               //yield break;
            bool hitAnything = false;
            StartCooldown(EvalTag(PowerKeys.CooldownTime));

            if (Rune_C > 0)
            {
                AttackPayload launch = new AttackPayload(this);
                launch.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(31));
                launch.AddWeaponDamage(ScriptFormula(30), DamageType.Physical);
                launch.OnHit = hitPayload =>
                {
                    hitAnything = true;
                };
                launch.Apply();
                User.PlayEffectGroup(165924); //Not sure if this is the only effect to be displayed in this case
            }

            ActorMover mover = new ActorMover(User);
            mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                Field7 = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
                yield return WaitTicks(1);

            // extra wait for leap to finish
            yield return WaitTicks(1);

            if (Rune_D > 0)
            {
                AddBuff(User, new LeapAttackArmorBuff());
            }

            // ground smash effect
            User.PlayEffectGroup(162811);

            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(0));
            //ScriptFormula(1) states "% of willpower Damage", perhaps the damage should be calculated that way instead.
            attack.AddWeaponDamage(0.70f, DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                hitAnything = true;
                if (Rune_E > 0)
                {
                    if (Rand.NextDouble() < ScriptFormula(37))
                    {
                        AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(38))));
                    }
                }
            };
            attack.Apply();

            if (hitAnything)
                GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit));

            //TODO: Eventually att visuals, and check if the current uber-drag is really intended :P
            if (Rune_A > 0)
            {
                TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3));
                Actor curTarget;
                int affectedTargets = 0;
                while (affectedTargets < ScriptFormula(12)) //SF(11) states  "Min number to Knockback", and is 5, what can that mean?
                {
                    curTarget = targets.GetClosestTo(User.Position);
                    if (curTarget != null)
                    {
                        targets.Actors.Remove(curTarget);

                        if (curTarget.World != null)
                        {
                            Knockback(curTarget, ScriptFormula(8), ScriptFormula(9), ScriptFormula(10));
                        }
                        affectedTargets++;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (Rune_B > 0)
            {
                TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3));
                foreach (Actor curTarget in targets.Actors)
                {
                    Knockback(curTarget, ScriptFormula(17), ScriptFormula(18), ScriptFormula(19));
                    var secondKnockBack = GetEnemiesInRadius(curTarget.Position, 1f); // this will hackfully check for collision
                    if (secondKnockBack.Actors.Count > 1)
                    {
                        foreach (Actor secondaryTarget in GetEnemiesInRadius(curTarget.Position, ScriptFormula(23)).Actors)
                        {
                            Knockback(secondaryTarget, ScriptFormula(24), ScriptFormula(25), ScriptFormula(26));
                            var thirdKnockBack = GetEnemiesInRadius(secondaryTarget.Position, 1f); 
                            if (thirdKnockBack.Actors.Count > 1)
                            {
                                foreach (Actor thirdTarget in GetEnemiesInRadius(secondaryTarget.Position, ScriptFormula(23)).Actors)
                                {
                                    Knockback(thirdTarget, ScriptFormula(24), ScriptFormula(25), ScriptFormula(26));
                                }
                            }
                        }
                    }
                }
            }
            yield break;
        }
예제 #11
0
        public override IEnumerable<TickTimer> Main()
        {
            bool hitAnything = false;
            //StartCooldown(WaitSeconds(10f));
            if (Rune_C > 0)
            {
                AttackPayload launch = new AttackPayload(this);
                launch.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(31));
                launch.AddWeaponDamage(ScriptFormula(30), DamageType.Physical);
                launch.OnHit = hitPayload =>
                {
                    hitAnything = true;
                };
                launch.Apply();
                User.PlayEffectGroup(165924); //Not sure if this is the only effect to be displayed in this case
            }

            ActorMover mover = new ActorMover(User);
            mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                Field7 = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
                yield return WaitTicks(1);

            // extra wait for leap to finish
            yield return WaitTicks(1);

            if (Rune_D > 0)
            {
                AddBuff(User, new LeapAttackArmorBuff());
            }

            // ground smash effect
            User.PlayEffectGroup(162811);

            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(0));
            //ScriptFormula(1) states "% of willpower Damage", perhaps the damage should be calculated that way instead.
            attack.AddWeaponDamage(0.70f, DamageType.Physical);
            attack.OnHit = hitPayload => 
                { 
                    hitAnything = true;
                    if (Rune_E > 0)
                    {
                        if (Rand.NextDouble() < ScriptFormula(37))
                        {
                            AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(38))));
                        }
                    }
                };
            attack.Apply();

            if (hitAnything)
                GeneratePrimaryResource(15f);

            //TODO: Eventually att visuals, and check if the current uber-drag is really intended :P
            if (Rune_A > 0)
            {
                TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3));
                Actor curTarget;
                int affectedTargets = 0;
                while (affectedTargets < ScriptFormula(12)) //SF(11) states  "Min number to Knockback", and is 5, what can that mean?
                {
                    curTarget = targets.GetClosestTo(User.Position);
                    if (curTarget != null)
                    {
                        targets.Actors.Remove(curTarget);

                        if (curTarget.World != null)
                        {
                            Knockback(curTarget, ScriptFormula(8), ScriptFormula(9), ScriptFormula(10));
                        }
                        affectedTargets++;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            yield break;
        }
예제 #12
0
파일: Monk.cs 프로젝트: jujuman/mooege
            public override bool Apply()
            {
                if (!base.Apply())
                    return false;

                // dash speed seems to always be actor speed * 10
                float speed = Target.Attributes[GameAttribute.Running_Rate_Total] * ScriptFormula(5);

                Target.TranslateFacing(_destination, true);
                _mover = new ActorMover(Target);
                _mover.Move(_destination, speed, new ACDTranslateNormalMessage
                {
                    TurnImmediately = true,
                    Field5 = 0x9206, // alt: 0x920e, not sure what this param is for.
                    AnimationTag = 69808, // dashing strike attack animation
                    Field7 = 6, // ticks to wait before playing attack animation
                });

                // make sure buff timeout is big enough otherwise the client will sometimes ignore the visual effects.
                TickTimer minDashWait = WaitSeconds(0.15f);
                Timeout = minDashWait.TimeoutTick > _mover.ArrivalTime.TimeoutTick ? minDashWait : _mover.ArrivalTime;

                Target.Attributes[GameAttribute.Hidden] = true;
                Target.Attributes.BroadcastChangedIfRevealed();
                return true;
            }
예제 #13
0
        public override IEnumerable<TickTimer> Main()
        {
            //StartCooldown(WaitSeconds(10f));

            ActorMover mover = new ActorMover(User);
            mover.MoveArc(TargetPosition, 3, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                PowerSNO = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
                yield return WaitTicks(1);

            yield break;
        }
예제 #14
0
            public override bool Apply()
            {
                if (!base.Apply())
                    return false;

                // dash speed seems to always be actor speed * 10
                float speed = User.Attributes[GameAttribute.Running_Rate_Total] * 5f;

                User.TranslateFacing(_destination, true);
                _mover = new ActorMover(User);
                _mover.Move(_destination, speed, new NotifyActorMovementMessage
                {
                    TurnImmediately = true,
                    AnimationTag = 69808, // dashing strike attack animation
                });

                // make sure buff timeout is big enough otherwise the client will sometimes ignore the visual effects.
                TickTimer minDashWait = WaitSeconds(0.15f);
                Timeout = minDashWait.TimeoutTick > _mover.ArrivalTime.TimeoutTick ? minDashWait : _mover.ArrivalTime;

                User.Attributes.BroadcastChangedIfRevealed();
                return true;
            }