Example #1
0
        private void CreatRoute()
        {
            if (createRouteArea.ThroughEnd("PlayerSkill"))
            {
                C_SeasonState season = (C_SeasonState)createRouteArea.GetOtherEntity("PlayerSkill").GetUpdateComponent("C_SeasonState");
                if (season.GetNowSeason() != eSeason.Winter)
                {
                    return;
                }
                C_Collider_Circle playerSkillCollider = (C_Collider_Circle)createRouteArea.GetOtherCollider("PlayerSkill");
                Vector2           colliderCentre      = playerSkillCollider.centerPosition;
                float             radius = playerSkillCollider.radius;

                Vector2 lt        = createRouteArea.points[0];
                Vector2 rb        = createRouteArea.points[1];
                Vector2 rayNormal = Vector2.Normalize(rb - lt);

                Vector2 crossPoint1 = lt;
                Vector2 crossPoint2 = lt;

                Method.Circle_Ray(ref colliderCentre, lt, rayNormal, radius, ref crossPoint1, ref crossPoint2);

                crossPoint1 = crossPoint1.X > rb.X ? rb : crossPoint1;
                crossPoint2 = crossPoint2.X > rb.X ? rb : crossPoint2;

                //射線あたり判定からルート生成の始点と終点をゲット
                if (crossPoint1 == crossPoint2)
                {
                    return;
                }
                CreatRoute(crossPoint1, crossPoint2);
            }
        }
Example #2
0
        private void Purify()
        {
            if (isPurify)
            {
                return;
            }
            if (!collider.ThroughStart("PlayerSkill"))
            {
                return;
            }
            if (myState.GetNowSeason() != eSeason.None)
            {
                return;
            }
            if (otherState == null)
            {
                otherState = (C_SeasonState)collider.GetOtherEntity("PlayerSkill").GetUpdateComponent("C_SeasonState");
            }

            isPurify   = true;
            nextSeason = otherState.GetNowSeason();
            effectTimer.Initialize();
            drawComp.SetShaderOn(effectTimer.GetLimitTime() - 0.01f, "A_Shrub_" + nextSeason, "ShrubMask");
            if (nextSeason == eSeason.Spring)
            {
                drawComp.SetDepth(18);
            }
        }
Example #3
0
        public override void Update()
        {
            Purify();
            SpringAction();

            if (effectTimer.IsTime)
            {
                return;
            }
            effectTimer.Update();
            CreatParticleEffect();
            if (effectTimer.IsTime)
            {
                myState.SetNowSeason(nextSeason);
                drawComp.SetNowAnim(myState.GetNowSeason().ToString());
                StartAutumn();
            }
        }
Example #4
0
        private void CreatSeasonEffect()
        {
            if (entity == null)
            {
                return;
            }
            Vector2 creatPosition  = entity.transform.Position - new Vector2(0, 180);
            int     nowSeasonIndex = (int)seasonState.GetNowSeason();

            gameDevice.GetParticleGroup.AddParticles(
                nameList1[nowSeasonIndex],             //name
                1, 1,                                  //count
                creatPosition - new Vector2(130, 200),
                creatPosition + new Vector2(270, 200), //position
                0.6f, 1.5f,                            //speed
                1.0f, 1.6f,                            //size
                0.5f, 1.0f,                            //alpha
                230, 250,                              //angle
                2.0f, 2.0f,                            //alive
                new MoveLine(),                        //moveType
                new ChangeToLucency(new Timer(2))      //changeType
                );

            float speedMin = 1.5f;
            float speedMax = 2.0f;

            if (nowSeasonIndex == 1)
            {
                speedMin = 5.0f;
                speedMax = 7.0f;
            }
            gameDevice.GetParticleGroup.AddParticles(
                nameList2[nowSeasonIndex],             //name
                1, 1,                                  //count
                creatPosition - new Vector2(130, 200),
                creatPosition + new Vector2(270, 200), //position
                speedMin, speedMax,                    //speed
                0.3f, 0.8f,                            //size
                1, 1,                                  //alpha
                230, 250,                              //angle
                2.0f, 2.0f,                            //alive
                new MoveLine(),                        //moveType
                new ChangeToLucency(new Timer(2))      //changeType
                );
        }