-
Notifications
You must be signed in to change notification settings - Fork 0
/
Weapon.ts
35 lines (34 loc) · 1012 Bytes
/
Weapon.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Attributes } from '../../attributes/Attributes';
import { uncommon } from '../../rarity/rarities';
import type { Rarity } from '../../rarity/Rarity';
import { Item } from './Item';
/**
* Creates weapon with the given parameters.
* @category Equipment
*/
export class Weapon extends Item {
/**
* Determines the rarity of the weapon.
*/
public rarity: Rarity;
/**
* Determines the name of the weapon.
*/
public name: string;
/**
* Determines the description of the weapon.
*/
public description: string;
/**
* Determines the attributes of the weapon.
* @see {@link Attributes | Attributes class} for more details.
*/
public attributes: Attributes;
public constructor(rarity: Rarity = uncommon, name = 'Weapon', description = 'A weapon', attributes: Attributes = new Attributes()) {
super(rarity, name, description, attributes);
this.rarity = rarity;
this.name = name;
this.description = description;
this.attributes = attributes;
}
}