-
Notifications
You must be signed in to change notification settings - Fork 0
/
procon.dnh
117 lines (91 loc) · 2.58 KB
/
procon.dnh
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
#include "./sound.dnh"
#include "./itsb.dnh"
#include "./ww.dnh"
#include "./language.dnh"
#include "./textf.dnh"
function getCharacter {
return GetAreaCommonData("Replay", "Character", 0);
}
task setCharacter(c) {
SetAreaCommonData("Replay", "Character", c);
}
function getDifficulty {
return GetAreaCommonData("Replay", "Difficulty", 1);
}
task setDifficulty(d) {
SetAreaCommonData("Replay", "Difficulty", d);
}
let MODE_ALL = 0;
let MODE_SPELL_OFF = 100;
function getMode {
return GetAreaCommonData("Replay", "Mode", MODE_ALL);
}
task setMode(m) {
SetAreaCommonData("Replay", "Mode", m);
}
function exists(o) {return !Obj_IsDeleted(o);}
function nexists(o) {return Obj_IsDeleted(o);}
function delete(o) {return Obj_Delete(o);}
function flush(vk) {
while (GetVirtualKeyState(vk) != KEY_FREE) {yield;}
}
function flushZ {flush(VK_OK);}
function flushX {flush(VK_CANCEL);}
function wait(t) {
loop (t) {yield;}
}
function getEffectCut {
return GetAreaCommonData("Cy06", "EffCut", 1);
}
function randIntH(l, h) {
return trunc(rand(l, h));
}
function runScript(path, args) {
let sc = LoadScript(path);
let l = length(args);
ascent (i in 0 .. l) {
SetScriptArgument(sc, i, args[i]);
}
StartScript(sc);
while (!IsCloseScript(sc)) {yield;}
return GetScriptResult(sc);
}
let MODE_STAGE = 0;
let MODE_SPELL = 100;
function getHistory(spellID) {
return GetAreaCommonData("Cy06", "H-" ~ IntToString(getCharacter) ~ "/" ~ IntToString(spellID) ~ "/" ~ IntToString(getDifficulty), [0, 0]);
}
task setHistory(spellID, history) {
SetAreaCommonData("Cy06", "H-" ~ IntToString(getCharacter) ~ "/" ~ IntToString(spellID) ~ "/" ~ IntToString(getDifficulty), history);
}
task saveHistoryPre(spellID) {
let old = getHistory(spellID);
setHistory(spellID, [old[0], old[1] + 1]);
}
task saveHistoryPost(spellID, success) {
let old = getHistory(spellID);
setHistory(spellID, [old[0] + success, old[1]]);
}
function getLastStage(chara, diff) {
return GetAreaCommonData("Cy06", "gls" ~ IntToString(chara) ~ IntToString(diff), 1);
}
task setLastStage(chara, diff, stage) {
SetAreaCommonData("Cy06", "gls" ~ IntToString(chara) ~ IntToString(diff), stage);
}
function inDialogue {
return GetCommonData("InDialogue", false);
}
function toggleDialogue {
SetCommonData("InDialogue", !inDialogue);
}
function isCharacterUnlocked(id) {
return GetAreaCommonData("Cy06", "Unlocked" ~ IntToString(id), false);
}
task unlockCharacter(id) {
SetAreaCommonData("Cy06", "Unlocked" ~ IntToString(id), true);
}
function randomSign {
return 1 - 2 * round(rand(0, 1));
}
let EV_SUBMIT = EV_USER + 6;
let EV_DEDZ = EV_USER + 5;