コード例 #1
0
ファイル: BaseEnemy.cs プロジェクト: Rameos/GIG_game
        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
ファイル: PlayerModel.cs プロジェクト: Rameos/GIG_game
        public static PlayerModel Instance()
        {
            if (playerModel == null)
            {
                playerModel = new PlayerModel();
            }

            return playerModel;
        }