Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Artefact rapira = new Artefact("Рапира", 500, 0, 200, 4000);
- Console.WriteLine(rapira.getDamage(500));
- class Artefact
- {
- string name;
- int damage;
- int hpInfluence;
- int armorInfluence;
- int price;
- //Инициализатор
- public Artefact(string name, int damage, int hpInfluence, int armorInfluence, int price)
- {
- this.name = name;
- this.damage = damage;
- this.hpInfluence = hpInfluence;
- this.armorInfluence = armorInfluence;
- this.price = price;
- }
- public int discountPrice(int discount)
- {
- discount = discount / 100;
- return (price - (price / discount));
- }
- public int getDamage(int damage)
- {
- return (this.damage + damage);
- }
- public int getHp(int hp)
- {
- return (hp + this.hpInfluence);
- }
- public int getArmor(int armor)
- {
- return (armor + armorInfluence);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement