示例#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;
        }