19
20
21
22
23
24
25
26
27
28
29
30
31
32
..
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
|
sprint = {
id = 'sprint';
name = 'Sprint';
desc = 'Put on a short burst of speed at the cost of some stamina';
img = 'starlit-ui-icon-ability-sprint.png';
powerKind = 'maneuver';
run = function(user, ctx)
end;
};
}
local species = {
human = {
name = 'Human';
................................................................................
end;
stats = {
psiRegen = 1.3;
psiPower = 1.2;
psi = 1.2;
nutrition = .8; -- women have smaller stomachs
hydration = .8;
staminaRegen = 1.0;
morale = 0.8; -- you are not She-Bear Grylls
};
traits = {
health = 400;
lungCapacity = .6;
irradiation = 0.8; -- you are smaller, so it takes less rads to kill ya
sturdiness = 0; -- women are more fragile and thus susceptible to blunt force trauma
metabolism = .150; -- kCal/s
painTolerance = 0.4;
dehydration = 10e-4; -- L/s
speed = 1.1;
};
};
male = {
name = 'Human Male';
eyeHeight = 1.6;
stats = {
psiRegen = 1.0;
psiPower = 1.0;
psi = 1.0;
nutrition = 1.0;
hydration = 1.0;
staminaRegen = .7; -- men are strong but have inferior endurance
};
traits = {
health = 500;
painTolerance = 1.0;
lungCapacity = 1.0;
sturdiness = 0.3;
metabolism = .150; -- kCal/s
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
<
>
|
|
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
..
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
|
sprint = {
id = 'sprint';
name = 'Sprint';
desc = 'Put on a short burst of speed at the cost of some stamina';
img = 'starlit-ui-icon-ability-sprint.png';
powerKind = 'maneuver';
run = function(user, ctx)
local cost = 10
-- unfortunately stat writes are very expensive, so can't draw from stamina
-- every single frame
local function halt()
if user.action.prog.sprint then
user:statDelta('stamina', -user.action.prog.sprint.cb)
user:deleteOverlay(user.action.prog.sprint.id)
user.action.prog.sprint = nil
end
end
if ctx.how.state == 'init' then
halt()
if user:effectiveStat 'stamina' > 0 then
user.action.prog.sprint = {
cb = 0;
id = user:overlay(function(phys) phys.speed = phys.speed * 2 end)
}
end
elseif ctx.how.state == 'prog' then
local d = ctx.how.delta
local p = user.action.prog.sprint
-- is the player currently holding any of WASD
local isMoving = bit.band(0x0f, user.entity:get_player_control_bits()) ~= 0
if p and isMoving then
p.cb = p.cb + cost*d
if p.cb >= 10 then
user:statDelta('stamina', -10)
if user:effectiveStat 'stamina' < 10 then halt() end
end
end
elseif ctx.how.state == 'halt' then
halt()
end
end;
};
}
local species = {
human = {
name = 'Human';
................................................................................
end;
stats = {
psiRegen = 1.3;
psiPower = 1.2;
psi = 1.2;
nutrition = .8; -- women have smaller stomachs
hydration = .8;
morale = 0.8; -- you are not She-Bear Grylls
};
traits = {
health = 400;
lungCapacity = .6;
irradiation = 0.8; -- you are smaller, so it takes less rads to kill ya
sturdiness = 0; -- women are more fragile and thus susceptible to blunt force trauma
metabolism = .150; -- kCal/s
painTolerance = 0.4;
dehydration = 10e-4; -- L/s
speed = 1.1;
staminaRegen = 30.0;
};
};
male = {
name = 'Human Male';
eyeHeight = 1.6;
stats = {
psiRegen = 1.0;
psiPower = 1.0;
psi = 1.0;
nutrition = 1.0;
hydration = 1.0;
staminaRegen = 20; -- men are strong but have inferior endurance
};
traits = {
health = 500;
painTolerance = 1.0;
lungCapacity = 1.0;
sturdiness = 0.3;
metabolism = .150; -- kCal/s
|