Esempio n. 1
0
        protected override void OnDelayedAttachAsMain(Character target)
        {
            this.character = target;
            Character casterCharacter       = caster.GetComponent <SkillComponent>().Character;
            Direction casterFacingDirection = casterCharacter.FacingDirection();

            targetMovementComponent = targetEntity.GetComponent <MovementComponent>();
            targetMovementComponent.WallCollisionHandler += OnWallCollision;
            Direction movementDirection = StaggerModifier.CalculateMovementDirection(
                casterMovementComponent, targetMovementComponent,
                collidedProjectilePosition, info.MovementBehavior
                );
            Direction facingDirection = StaggerModifier.CalculateFacingDirection(
                casterMovementComponent, targetMovementComponent,
                collidedProjectilePosition, info.FacingBehavior, movementDirection
                );

            targetMovementComponent.MovingDirection = movementDirection.ToNormalizedVector2();
            targetMovementComponent.FacingDirection = facingDirection;


            target.InterruptChannelingSkill();
            target.PlayAnimation(animProfile.Upper());
            target.JumpToFrame(4);
            //DLog.LogError("Jump on knockdown");
            blastRequest           = (BlastRequest)DoBlast(target);
            stageFromPreviousCheck = blastRequest.ShowStage();
            state = State.Peaking;
        }
Esempio n. 2
0
        private void TriggerEvents()
        {
            for (int kIndex = 0; kIndex < info.Events.Count; kIndex++)
            {
                JumpAction.Event e = info.Events[kIndex];
                if (e.ShowTriggerType() != JumpAction.Event.TriggerType.OnGroundLanding)
                {
                    continue;
                }
                if (processedEvents.Contains(e))
                {
                    continue;
                }

                processedEvents.Add(e);
                JumpAction.Event.ActionType at = e.ShowActionType();
                switch (at)
                {
                case JumpAction.Event.ActionType.CameraFx:
                    JumpAction.CameraFxEvent cfe = (JumpAction.CameraFxEvent)e;
                    CameraAction.FxType      ft  = cfe.fx.ShowFxType();
                    switch (ft)
                    {
                    case CameraAction.FxType.Shake:
                        CameraAction.ShakeFx sf = (CameraAction.ShakeFx)cfe.fx;
                        ProCamera2DShake     proCamera2DShake;
                        proCamera2DShake = camera.GetComponent <ProCamera2DShake>();
                        if (proCamera2DShake == null)
                        {
                            proCamera2DShake = camera.gameObject.AddComponent <ProCamera2DShake>();
                        }

                        proCamera2DShake.Strength              = sf.strength;
                        proCamera2DShake.Duration              = sf.duration;
                        proCamera2DShake.Vibrato               = sf.vibrato;
                        proCamera2DShake.Smoothness            = sf.smoothness;
                        proCamera2DShake.Randomness            = sf.randomness;
                        proCamera2DShake.UseRandomInitialAngle = sf.useRandomInitialAngel;
                        proCamera2DShake.Rotation              = sf.rotation;
                        proCamera2DShake.Shake();
                        break;
                    }
                    break;

                case JumpAction.Event.ActionType.Vfx:
                    JumpAction.VfxEvent ve = (JumpAction.VfxEvent)e;
                    VfxAction.VfxType   vt = ve.fx.ShowVfxType();
                    switch (vt)
                    {
                    case VfxAction.VfxType.SpawnPrefab:
                        vfxLogic = new Vfxs.Vfx.SpawnPrefab(
                            10, (VfxAction.SpawnPrefabVfx)ve.fx,
                            new DefaultVfxGameObjectFactory(), targetCharacter,
                            SkillCastingSource.FromUserInput(), environment.GetCamera(),
                            environment, null
                            );
                        break;
                    }
                    break;
                }
            }

            stageFromPreviousCheck = blastRequest.ShowStage();
        }