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; }
public Damage(int damagePoints, PlayerModel.DamageTypes typeDamage) { this.damage = damagePoints; this.typeDamage = typeDamage; }
private void setPoisionDamage(PlayerModel.DamageTypes type) { }
private PlayerStateController() { playerModel = PlayerModel.Instance(); }
public static PlayerModel Instance() { if (playerModel == null) { playerModel = new PlayerModel(); } return playerModel; }