-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.js
64 lines (55 loc) · 1.52 KB
/
types.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var random = require("./random");
// Attibutes
const STR = "Fighting Prowess";
const INT = "Knowledge of healing";
const AGI = "Agility/Stealth";
const LUCK = "Good fortune";
// Equipment
const SWORD = "Weapon";
const STAFF = "Healing item";
const ARMOR = "Armor";
const CHARM = "Charm";
// Action
const ATTACK = "Attack";
const HEAL = "Heal";
const EVADE = "Evade";
const PASS = "Pass";
const ATTRIBUTES = [STR, INT, AGI, LUCK];
const EQUIPMENT = [SWORD, STAFF, ARMOR, CHARM];
const ACTIONS = [ATTACK, HEAL, EVADE, PASS];
const NAMES = ["Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel"
, "India", "Juliett", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra",
"Tango", "Uniform", "Victor", "Whiskey", "Xray", "Yankee", "Zulu"];
const randomAttribute = () => {
const rand = random.randomInt(ATTRIBUTES.length);
return ATTRIBUTES[rand];
};
const randomEquipment = () => {
const rand = random.randomInt(EQUIPMENT.length);
return EQUIPMENT[rand];
};
const randomAction = () => {
// Random action shouldn't be PASS.
const rand = random.randomInt(ACTIONS.length - 1);
return ACTIONS[rand];
};
module.exports = {
STR: STR,
INT: INT,
AGI: AGI,
LUCK: LUCK,
SWORD: SWORD,
STAFF: STAFF,
ARMOR: ARMOR,
CHARM: CHARM,
ATTACK: ATTACK,
HEAL: HEAL,
EVADE: EVADE,
ATTRIBUTES: ATTRIBUTES,
EQUIPMENT: EQUIPMENT,
ACTIONS: ACTIONS,
NAMES: NAMES,
randomAttribute: randomAttribute,
randomEquipment: randomEquipment,
randomAction: randomAction,
};