Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit bced7af

Browse files
author
Mister-Kay
committed
manifest update
1 parent 0e7780a commit bced7af

File tree

2 files changed

+3
-208
lines changed

2 files changed

+3
-208
lines changed

lib/core.js

-205
Original file line numberDiff line numberDiff line change
@@ -62,217 +62,12 @@ module.exports = function PingCompensationCore(dispatch) {
6262
enabled = false
6363
return
6464
}
65-
<<<<<<< HEAD
6665
// debug
6766
if (option.toLowerCase() == 'debug') {
6867
config.debug = !config.debug
6968
command.message(`Ping Compensation debug ${config.debug ? 'enabled.' : 'disabled.'}`)
7069
return
7170
}
72-
=======
73-
}
74-
75-
if (info.type == 'charging') {
76-
opts.stage += 1;
77-
stageEnd = sendActionStage.bind(null, opts);
78-
stageEndTime = Date.now() + length;
79-
stageEndTimeout = setTimeout(stageEnd, length);
80-
return
81-
}
82-
83-
stageEnd = sendActionEnd.bind(null, info.type == 'dash' ? 39 : 0, opts.distance * opts.distanceMult);
84-
stageEndTime = Date.now() + length;
85-
stageEndTimeout = setTimeout(stageEnd, length)
86-
}
87-
88-
function getServerTimeout() {
89-
return (ping.min * 2) + (ping.max > 300 ? 125 : ping.max / 2) + (config.skillRetryCount * config.skillRetryMs) + config.serverTimeout
90-
}
91-
92-
function clearStage() {
93-
clearTimeout(serverTimeout);
94-
clearTimeout(stageEndTimeout)
95-
}
96-
97-
function refreshStageEnd() {
98-
clearTimeout(stageEndTimeout);
99-
stageEndTimeout = setTimeout(stageEnd, stageEndTime - Date.now())
100-
}
101-
102-
function grantCharge(skill, info, stage) {
103-
let levels = info.chargeLevels;
104-
dispatch.toClient('S_GRANT_SKILL', 1, {
105-
skill: modifyChain(skill, levels ? levels[stage] : 10 + stage)
106-
})
107-
}
108-
109-
function sendInstantDash(location) {
110-
dispatch.toClient('S_INSTANT_DASH', 1, {
111-
source: myChar(),
112-
unk1: 0,
113-
unk2: 0,
114-
unk3: 0,
115-
x: location.x,
116-
y: location.y,
117-
z: location.z,
118-
w: currentLocation.w
119-
})
120-
}
121-
122-
function sendInstantMove(location) {
123-
if (location) currentLocation = location;
124-
125-
dispatch.toClient('S_INSTANT_MOVE', 1, {
126-
id: myChar(),
127-
x: currentLocation.x,
128-
y: currentLocation.y,
129-
z: currentLocation.z,
130-
w: currentLocation.w
131-
})
132-
}
133-
134-
function sendActionEnd(type, distance) {
135-
clearStage();
136-
137-
if (!currentAction) return;
138-
139-
if (config.debug) debug(['<* S_ACTION_END', skillId(currentAction.skill), type || 0, currentLocation.w + '\xb0', (distance || 0) + 'u'].join(' '));
140-
141-
if (oopsLocation && (config.forceClipStrict || !currentLocation.inAction)) sendInstantMove(oopsLocation);
142-
else movePlayer(distance);
143-
144-
if (canChainVB) { // In case VB didn't get used on line 670
145-
switchVB = false;
146-
canChainVB = false;
147-
if (config.debug) debug('[Skill Prediction] Chained VB disabled');
148-
}
149-
150-
dispatch.toClient('S_ACTION_END', 2, {
151-
gameId: myChar(),
152-
x: currentLocation.x,
153-
y: currentLocation.y,
154-
z: currentLocation.z,
155-
w: currentLocation.w,
156-
templateId,
157-
skill: currentAction.skill,
158-
type: type || 0,
159-
id: currentAction.id
160-
});
161-
162-
if (currentAction.id == actionNumber) {
163-
let info = skillInfo(currentAction.skill);
164-
if (info) {
165-
if (info.consumeAbnormalEnd)
166-
if (Array.isArray(info.consumeAbnormalEnd))
167-
for (let id of info.consumeAbnormalEnd)
168-
abnormality.remove(id)
169-
else
170-
abnormality.remove(info.consumeAbnormalEnd);
171-
172-
if (info.triggerAbnormalEnd)
173-
for (let id in info.triggerAbnormalEnd) {
174-
let abnormal = info.triggerAbnormalEnd[id];
175-
176-
if (Array.isArray(abnormal))
177-
abnormality.add(id, abnormal[0], abnormal[1]);
178-
else
179-
abnormality.add(id, abnormal, 1)
180-
}
181-
182-
if (info.type == 'dash') lastEndLocation = currentLocation
183-
}
184-
} else lastEndedId = currentAction.id;
185-
186-
actionNumber++;
187-
if (actionNumber > 0xffffffff) actionNumber = 0x80000000;
188-
189-
oopsLocation = currentAction = null;
190-
191-
lastEndedTime = Date.now()
192-
}
193-
194-
function sendCannotStartSkill(skill) {
195-
dispatch.toClient('S_CANNOT_START_SKILL', 1, {
196-
skill
197-
})
198-
}
199-
200-
function sendSystemMessage(type, vars) {
201-
let message = '@' + sysmsg.maps.get(dispatch.base.protocolVersion).name.get(type);
202-
203-
for (let key in vars) message += '\v' + key + '\v' + vars[key]
204-
205-
dispatch.toClient('S_SYSTEM_MESSAGE', 1, {
206-
message
207-
})
208-
}
209-
210-
function updateLocation(event, inAction, special) {
211-
event = event || currentAction;
212-
213-
currentLocation = special ? {
214-
x: event.x,
215-
y: event.y,
216-
z: event.z,
217-
w: event.w || currentLocation.w, // Should be a skill flag maybe?
218-
inAction
219-
} : {
220-
x: event.x,
221-
y: event.y,
222-
z: event.z,
223-
w: event.w,
224-
inAction
225-
}
226-
}
227-
228-
function retry(cb, count = 1) {
229-
if (count > config.skillRetryCount) return;
230-
231-
setTimeout(() => {
232-
if (cb()) retry(cb, count + 1)
233-
}, config.skillRetryMs)
234-
}
235-
236-
function movePlayer(distance) {
237-
if (distance && !currentLocation.inAction) applyDistance(currentLocation, distance)
238-
}
239-
240-
function calcDistance(loc1, loc2) {
241-
return Math.sqrt(Math.pow(loc2.x - loc1.x, 2) + Math.pow(loc2.y - loc1.y, 2))
242-
}
243-
244-
function applyDistance(loc, distance) {
245-
let r = (loc.w / 0x8000) * Math.PI;
246-
247-
loc.x += Math.cos(r) * distance;
248-
loc.y += Math.sin(r) * distance;
249-
return loc
250-
}
251-
252-
// Modifies the chain part (last 2 digits) of a skill ID, preserving flags
253-
function modifyChain(id, chain) {
254-
return id - ((id & 0x3ffffff) % 100) + chain
255-
}
256-
257-
function skillId(id, flagAs) {
258-
id |= flagAs;
259-
260-
let skillFlags = ['P', 'C', '[?3]', '[?4]', '[?5]', '[?6]'],
261-
flags = '';
262-
263-
for (let i = 0, x = id >>> 26; x; i++ , x >>>= 1)
264-
if (x & 1) flags += skillFlags[i];
265-
266-
id = (id & 0x3ffffff).toString();
267-
268-
switch (flags) {
269-
case 'P':
270-
id = [id.slice(0, -4), id.slice(-4, -2), id.slice(-2)].join('-');
271-
break;
272-
case 'C':
273-
id = [id.slice(0, -2), id.slice(-2)].join('-');
274-
break
275-
>>>>>>> salty/master
27671
}
27772
command.message('Ping Compensation command input missing. Input options are "ping", "on", "off", or "debug".')
27873
})

manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"overwrite": false,
1414
"hash": "2154eea4db57f2fb633f8238e897824acfe5f2e48ed55ef57b677d27e0ee6bc6"
1515
},
16-
"config/data/awakening.js": "97a4e55915e3f9dca9a69efc01393151b8a272118a27fedaa37d8cc9a9ccb5f1",
17-
"config/data/basicCC.json": "6d9b4aed42035973afcfc0f25121184bf95ca090e84d48ecc3381be86d1b702f",
16+
"config/data/awakening.js": "6ee61e258a01e50ef514ea22d3487605b923b0c30344494a16c290e2c9a33c48",
17+
"config/data/basicCC.json": "b94ff2356594b6c1f8502013cfa3fe35bb5961fea3e3e662a0171ed52bc062a2",
1818
"config/data/evasiveCC.json": "e3b8afd622054569da25e12463c1fc79f33dacd2d570c0646bcceaca219a9a03",
1919
"config/data/extendedCC.json": "f873db2dc2df74fcdad1b3322253f6669f3c5441d9ed302860b3cbecafbe9de3",
20-
"config/data/skills.js": "f005e1470a388b41aa987d140d60dac57627ee62608f2df70d9eaeb1e39de292",
20+
"config/data/skills.js": "909701416feedd6aaedfa664f57652764f0c6b8bff815529c093acb31e4d4d62",
2121
"docs/commands.md": "b67a1215d2f53de5943041cec3ccf349cbd7d32ace1f0779f1b1a3c54ea75eb3",
2222
"docs/config.md": "4df9d7469e5daec20618e8c64bb4b0bf2df76fb4427d54f75704181053ea3a72",
2323
"docs/ping.md": "13e32834603a523adee6ff50083079693ef8d92c83644091f21f6b184e1547a9",

0 commit comments

Comments
 (0)