Beispiel #1
0
        private void Update()
        {
            Character character = ActorContainer.Instance.LocalCharacter;

            if (character == null)
            {
                return;
            }
            if (base.MoveController.IsGrounded == false || base.IsInvincible == true)
            {
                return;
            }
            if (character.transform.position.DistanceWith(this.transform.position) > SpecificSdb <Sdb.GeneralInfo> .Get().ZombieDetactionRange)
            {
                return;
            }

            Vector2 diffPosition = character.transform.position - this.transform.position;

            diffPosition.y = 0;
            Vector2 direction = diffPosition.normalized;

            Vector2 velocity = RigidBody.velocity;

            velocity.x = direction.x * ActorInfo.MoveSpeed;

            RigidBody.velocity = velocity;
        }
Beispiel #2
0
        public void CheckOut(Visitor visitor, int visitorScore)
        {
            var visitorInfo = SdbInstance <Sdb.VisitorInfo> .Get(visitor.Info.RaceType.ToString());

            var gradeInfo = SpecificSdb <Sdb.HotelGradeInfo> .Get();

            int originalGrade = gradeInfo.GetGrade(Score);
            int originalScore = Score;

            Score += visitorScore * visitorInfo.VipGrade;
            int newGrade = gradeInfo.GetGrade(Score);

            if (originalGrade != newGrade)
            {
                if (originalGrade > newGrade)
                {
                    Score = gradeInfo.Grades[originalGrade - 1].X;
                }
                else
                {
                    OnGradeChanged?.Invoke(newGrade, originalGrade);
                }
            }
            if (newGrade > originalGrade)
            {
                Debug.Log("UpGrade!!, new: " + newGrade + ", ori: " + originalGrade + " new score : " + Score + " ori score : " + originalScore);
                Main_Scene.GradeChangeListener.Instance.OnHotelGradeIncreased();
            }

            OnExpRateChanged?.Invoke(gradeInfo.GetExpRate(Score));
        }
Beispiel #3
0
        public override void Use(Character owner)
        {
            base.Use(owner);
            owner.Heal(SpecificSdb <Sdb.GeneralInfo> .Get().HpItemHealValue);
            // 이펙트 출력

            Destroy(this.gameObject);
        }
Beispiel #4
0
        private IEnumerator InvincibleProcess()
        {
            IsInvincible = true;
            OnInvincibleStart?.Invoke();
            yield return(new WaitForSeconds(SpecificSdb <Sdb.GeneralInfo> .Get().HitInvincibleTime));

            IsInvincible = false;
            OnInvincibleEnd?.Invoke();
        }
Beispiel #5
0
        public float GetExpRate()
        {
            var gradeInfo = SpecificSdb <Sdb.HotelGradeInfo> .Get();

            return(gradeInfo.GetExpRate(Score));
        }
Beispiel #6
0
        private int GetGrade()
        {
            var gradeInfo = SpecificSdb <Sdb.HotelGradeInfo> .Get();

            return(gradeInfo.GetGrade(Score));
        }