-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_pseudo.coffee
131 lines (99 loc) · 2.38 KB
/
game_pseudo.coffee
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Player = ->
@BaseStats:
# base life stat
life: 100
# recharge per second
life_recharge: 5
# lowered by attacking or running
stamina: 100
# recharge per second, only when not moving
stamina_recharge: 10
# factored into attack speed (for melee weapons),
# range (for ranged weapons),
# and damage for each unless there is a fixed damage/range e.g. a crossbow
strength: 20
# extra options for dialog, and avoid being seen.
stealth: 0
# accuracy / block chance
melee_dexterity: 0
# accuracy
ranged_dexterity: 0
# dodge chance and reduction to stamina loss
agility: 0
# adds hints to dialog
charisma: 0
vision: 20
@equip_slots:
chest_armor: null,
head_armor: null,
boots: null,
leg_armor: null,
belt: null,
hand1_item: null
hand2_item: null
backpack: null
@items:
@skills:
hand_to_hand_combat:
stats:
block_chance: 0
damage: 0
attack_speed: 0
agility: 0
stealth: 0
abilities:
power_strike: null
flurry: null
grapple: null
takedown: null
twist: null
disarm: null
pin: null
lunge: null
dive: null
melee_weapon_combat:
stats:
block_chance: 0
attack_speed: 0
damage: 0
agility: 0
stealth: 0
abilities:
power_strike: null
flurry: null
throw: null
disarm: null
counter: null
lunge: null
ranged_weapon_combat:
stats:
accuracy: null
deadliness: null
abilities:
long_vision: null
windup: null
target: null
kite: null
stealth:
stats:
invisibility: null
silence: null
agility: null
abilities:
pounce: null
decimate: null
flee: null
@storage_slots: ->
backpack = @equip_slots.backpack.num_slots || 0
belt = @equip_slots.belt.num_slots || 0
{
total: backpack + belt
max_continuous: Math.max(backpack, belt)
}
@ranged_attack_range = (item) =>
Math.max((@stats.strength - item.weight), 0)
@ranged_attack_accuracy = (item) =>
100 - Math.max((item.dexterity - @stats.ranged_dexterity), 0)
@melee_attack_accuracy = (item) =>
100 - Math.max((item.dexterity - @stats.melee_dexterity), 0)
this