예제 #1
0
        public int TakeDamage(int Damage, PlayerModel.DamageTypes DamageType)
        {
            //Resitance against Damage = Stnadard Arm
            if(resistance != DamageType)
            {
                int damage = Damage - Armour;
                this.LivePoints -= damage;
                Debug.Log("Livepoints: " + this.LivePoints);
                if (this.LivePoints < 0)
                {
                    this.LivePoints = 0;
                }
            }
            //Weak Element
            else if(DamageType == weakElement)
            {
                int damage = 2*Damage;

                this.LivePoints -= damage;
                Debug.Log("Livepoints: " + this.LivePoints);
                if (this.LivePoints < 0)
                {
                    this.LivePoints = 0;
                }
            }
                //Standard
            else
            {
                int damage = Damage - Armour/2;
                this.LivePoints -= damage;
                Debug.Log("Livepoints: " + this.LivePoints);
                if (this.LivePoints < 0)
                {
                    this.LivePoints = 0;
                }
            }

            return this.LivePoints;
        }
예제 #2
0
파일: Damage.cs 프로젝트: Rameos/GIG_game
 public Damage(int damagePoints, PlayerModel.DamageTypes typeDamage)
 {
     this.damage = damagePoints;
     this.typeDamage = typeDamage;
 }
예제 #3
0
 private void setPoisionDamage(PlayerModel.DamageTypes type)
 {
 }
예제 #4
0
 private PlayerStateController()
 {
     playerModel = PlayerModel.Instance();
 }
예제 #5
0
        public static PlayerModel Instance()
        {
            if (playerModel == null)
            {
                playerModel = new PlayerModel();
            }

            return playerModel;
        }