-
Notifications
You must be signed in to change notification settings - Fork 0
/
martial_traditions.js
51 lines (47 loc) · 1.53 KB
/
martial_traditions.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
const changeCase = require("change-case")
var weapon = {}
weapon.name = "sword"
weapon.type = "melee"
weapon.genericName = changeCase.capitalCase(weapon.name) + ' ' + "Tradition"
var damage_multiplier
if (weapon.type.toLowerCase() === "ranged"){
damage_multiplier = 1.05
} else {
damage_multiplier = 1.1
}
var repeattime_multiplier = .95
var cost_multiplier = 0.90
var range_multiplier = 1.1
var spread_multiplier = 0.9
var template = `---
genericName: ${weapon.genericName}
autoResearch: true
description: ${weapon.genericName}
icon: ${weapon.name}.png
tooltip: ${weapon.genericName}
affects: ${weapon.name}
modifications:
- value: Attack/${changeCase.capitalCase(weapon.type)}/Damage/Hack
multiply: ${damage_multiplier}
- value: Attack/${changeCase.capitalCase(weapon.type)}/Damage/Pierce
multiply: ${damage_multiplier}
- value: Attack/${changeCase.capitalCase(weapon.type)}/Damage/Crush
multiply: ${damage_multiplier}
- value: Attack/${changeCase.capitalCase(weapon.type)}/RepeatTime
multiply: ${repeattime_multiplier}
- value: Cost/Resources/food
multiply: ${cost_multiplier}
- value: Cost/Resources/wood
multiply: ${cost_multiplier}
- value: Cost/Resources/stone
multiply: ${cost_multiplier}
- value: Cost/Resources/metal
multiply: ${cost_multiplier}`
if ( changeCase.noCase(weapon.type) === "ranged") {
template +=`
- value: Attack/${changeCase.capitalCase(weapon.type)}/Spread
multiply: ${spread_multiplier}
- value: Attack/${changeCase.capitalCase(weapon.type)}/MaxRange
multiply: ${range_multiplier}`
}
console.log(template)