-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.html
492 lines (427 loc) · 20.7 KB
/
index2.html
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PoE 2 Infernalist Calculator v4.0</title>
<style>
:root {
--poe-gold: #FFAA00;
--poe-dark: #1a1a1a;
--poe-border: #443300;
--warning-red: #FF4444;
--success-green: #44FF44;
}
body {
background: rgba(0, 0, 0, 0.9) url('pathofexile2-bg.webp') center/cover fixed;
font-family: 'Arial', sans-serif;
color: #fff;
min-height: 100vh;
margin: 0;
padding: 2rem;
}
.calculator {
background: rgba(0, 0, 0, 0.85);
border: 2px solid var(--poe-border);
max-width: 800px;
margin: 0 auto;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 0 30px rgba(255, 170, 0, 0.1);
}
h1 {
color: var(--poe-gold);
text-align: center;
margin-bottom: 2rem;
font-size: 2.2rem;
}
.input-group {
margin-bottom: 1.5rem;
}
label {
display: block;
margin-bottom: 0.5rem;
color: #cccccc;
font-size: 0.9rem;
}
input, select {
width: 100%;
padding: 0.8rem;
background: rgba(255, 255, 255, 0.1);
border: 1px solid #332200;
color: #fff;
border-radius: 4px;
margin-bottom: 0.5rem;
}
button {
background: var(--poe-gold);
color: #000;
border: none;
padding: 0.8rem 1.5rem;
cursor: pointer;
font-weight: bold;
transition: opacity 0.3s;
border-radius: 4px;
margin: 0.5rem;
}
button:hover {
opacity: 0.8;
}
.error {
color: var(--warning-red);
margin: 1rem 0;
display: none;
}
.result {
background: rgba(255, 170, 0, 0.05);
padding: 1.5rem;
margin-top: 2rem;
border-radius: 4px;
border: 1px solid var(--poe-border);
}
.result-section {
margin: 1.5rem 0;
padding: 1rem;
background: rgba(255, 170, 0, 0.03);
border-radius: 4px;
}
.result-section h4 {
color: var(--poe-gold);
margin-bottom: 0.8rem;
border-bottom: 1px solid var(--poe-border);
padding-bottom: 0.5rem;
}
.warning { color: var(--warning-red); }
.success { color: var(--success-green); }
.save-system {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
}
.character-management {
margin-top: 2rem;
border-top: 1px solid var(--poe-border);
padding-top: 1.5rem;
}
.demonflame-controls {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
margin: 1rem 0;
}
.stack-warning {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { background-color: rgba(255, 68, 68, 0.1); }
50% { background-color: rgba(255, 68, 68, 0.3); }
100% { background-color: rgba(255, 68, 68, 0.1); }
}
@media (max-width: 600px) {
body { padding: 1rem; }
.calculator { padding: 1rem; }
.save-system { flex-direction: column; }
.demonflame-controls { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="calculator">
<h1>Infernalist Loop Calculator</h1>
<!-- Character Management -->
<div class="save-system">
<input type="text" id="charName" placeholder="Character Name" style="flex:2">
<button onclick="saveBuild()">Save Build</button>
<button onclick="loadBuild()">Load Build</button>
<button onclick="deleteBuild()" style="background: var(--warning-red)">Delete Build</button>
</div>
<!-- Build Inputs -->
<div class="input-group">
<label>Character Life</label>
<input type="number" id="life" min="1" required>
</div>
<div class="input-group">
<label>Energy Shield (ES)</label>
<input type="number" id="es" min="0" required>
</div>
<div class="input-group">
<label>Fire Resistance (%)</label>
<input type="number" id="fireRes" min="0" max="90" required>
</div>
<div class="input-group">
<label>Mana/Infernal Flame Pool</label>
<input type="number" id="infernalFlame" min="1" required>
</div>
<div class="input-group">
<label>Barrier Invocation Energy Gain (%)</label>
<input type="number" id="energyGain" min="100" step="1" required value="140">
</div>
<div class="input-group">
<label>In-game Ping (ms)</label>
<input type="number" id="ping" min="0" max="1000" value="50">
</div>
<div class="input-group">
<label>Mana Cost per Cast</label>
<input type="number" id="manaCost" required>
</div>
<div class="input-group">
<label>Critical Strike Chance (%)</label>
<input type="number" id="critChance" min="0" max="100" step="0.1">
</div>
<div class="input-group">
<label>Damage Range</label>
<div style="display: flex; gap: 1rem;">
<input type="number" id="dmgMin" placeholder="Min" required>
<input type="number" id="dmgMax" placeholder="Max" required>
</div>
</div>
<!-- New Recoup and Demonflame Inputs -->
<div class="input-group">
<label>Recoup Percentage (%)</label>
<input type="number" id="recoup" min="0" max="100" step="1" value="24">
</div>
<div class="input-group">
<label>Flask ES Recovery/sec</label>
<input type="number" id="esRecovery" min="0" value="10370">
</div>
<div class="input-group">
<label>Demonflame Customization</label>
<div class="demonflame-controls">
<div>
<label>Current Stacks</label>
<input type="number" id="currentStacks" min="0" value="0">
</div>
<div>
<label>Target Stacks</label>
<input type="number" id="targetStacks" min="0" value="0">
</div>
</div>
</div>
<button onclick="calculateLoop()" style="width: 100%">Calculate Loop Stability</button>
<!-- Results Display -->
<div class="result" id="result"></div>
<div class="error" id="error"></div>
<!-- Saved Characters -->
<div class="character-management">
<h3>Saved Builds</h3>
<div id="savedChars"></div>
</div>
</div>
<script>
// Constants
const SERVER_TICK = 33;
const BI_COOLDOWN = 0;
const ENERGY_PER_TRIGGER = 220;
const DEMONFLAME_DAMAGE_MULTIPLIER = 0.18;
const DEMONFLAME_DEGEN_BASE = 1;
const DEMONFLAME_DEGEN_PERCENT = 0.0005;
// Cookie Management
function getSavedBuilds() {
const builds = document.cookie.split('; ')
.find(row => row.startsWith('infernalistBuilds='));
return builds ? JSON.parse(decodeURIComponent(builds.split('=')[1])) : {};
}
function updateCookie(builds) {
const expires = new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toUTCString();
document.cookie = `infernalistBuilds=${encodeURIComponent(JSON.stringify(builds))}; expires=${expires}; path=/`;
}
// Build Management
function saveBuild() {
const charName = document.getElementById('charName').value.trim();
if (!charName) return showError('Enter character name!');
const builds = getSavedBuilds();
builds[charName] = {
life: document.getElementById('life').value,
es: document.getElementById('es').value,
fireRes: document.getElementById('fireRes').value,
infernalFlame: document.getElementById('infernalFlame').value,
energyGain: document.getElementById('energyGain').value,
ping: document.getElementById('ping').value,
manaCost: document.getElementById('manaCost').value,
critChance: document.getElementById('critChance').value,
dmgMin: document.getElementById('dmgMin').value,
dmgMax: document.getElementById('dmgMax').value,
recoup: document.getElementById('recoup').value,
esRecovery: document.getElementById('esRecovery').value,
currentStacks: document.getElementById('currentStacks').value,
targetStacks: document.getElementById('targetStacks').value
};
updateCookie(builds);
showError(`Saved "${charName}"!`, 'success');
listSavedBuilds();
}
function loadBuild() {
const charName = document.getElementById('charName').value.trim();
const builds = getSavedBuilds();
const build = builds[charName];
if (!build) return showError('Build not found!');
document.getElementById('life').value = build.life;
document.getElementById('es').value = build.es;
document.getElementById('fireRes').value = build.fireRes;
document.getElementById('infernalFlame').value = build.infernalFlame;
document.getElementById('energyGain').value = build.energyGain;
document.getElementById('ping').value = build.ping;
document.getElementById('manaCost').value = build.manaCost;
document.getElementById('critChance').value = build.critChance;
document.getElementById('dmgMin').value = build.dmgMin;
document.getElementById('dmgMax').value = build.dmgMax;
document.getElementById('recoup').value = build.recoup;
document.getElementById('esRecovery').value = build.esRecovery;
document.getElementById('currentStacks').value = build.currentStacks;
document.getElementById('targetStacks').value = build.targetStacks;
showError(`Loaded "${charName}"!`, 'success');
}
function deleteBuild() {
const charName = document.getElementById('charName').value.trim();
const builds = getSavedBuilds();
if (!builds[charName]) return showError('Build not found!');
delete builds[charName];
updateCookie(builds);
showError(`Deleted "${charName}"!`, 'success');
listSavedBuilds();
}
function listSavedBuilds() {
const builds = getSavedBuilds();
const container = document.getElementById('savedChars');
container.innerHTML = Object.keys(builds).map(name => `
<div style="margin: 0.5rem 0; padding: 0.5rem; background: rgba(255,170,0,0.1);">
${name}
<button onclick="document.getElementById('charName').value='${name}'; loadBuild()">Load</button>
</div>
`).join('');
}
// Core Calculations
function calculateLoop() {
try {
// Get input values
const life = parseFloat(document.getElementById('life').value);
const es = parseFloat(document.getElementById('es').value);
const fireRes = parseFloat(document.getElementById('fireRes').value) / 100;
const infernalFlame = parseFloat(document.getElementById('infernalFlame').value);
const energyGain = (parseFloat(document.getElementById('energyGain').value) / 100) + 1;
const ping = parseFloat(document.getElementById('ping').value);
const manaCost = parseFloat(document.getElementById('manaCost').value);
const critChance = parseFloat(document.getElementById('critChance').value) / 100;
const dmgMin = parseFloat(document.getElementById('dmgMin').value);
const dmgMax = parseFloat(document.getElementById('dmgMax').value);
const recoup = parseFloat(document.getElementById('recoup').value) / 100;
const esRecovery = parseFloat(document.getElementById('esRecovery').value);
const currentStacks = parseInt(document.getElementById('currentStacks').value) || 0;
const targetStacks = parseInt(document.getElementById('targetStacks').value) || 0;
// Core calculations
const totalHP = life + es;
const selfDamage = totalHP * (1 - fireRes);
const baseEnergy = (selfDamage / 5) * energyGain;
const initialTriggers = Math.floor(baseEnergy / ENERGY_PER_TRIGGER);
const leftoverEnergy = baseEnergy % ENERGY_PER_TRIGGER;
// Network calculations
const pingSeconds = ping / 1000;
const serverTickSeconds = SERVER_TICK / 1000;
const effectiveCastTime = BI_COOLDOWN + pingSeconds + serverTickSeconds;
const castsPerSecond = 1 / effectiveCastTime;
// Offensive calculations
const avgDamage = (dmgMin + dmgMax) / 2;
const critMultiplier = 1 + (critChance * 1.5);
const baseDPS = (avgDamage * critMultiplier) * castsPerSecond;
// Recoup and Demonflame calculations
const maxRecoupPerSecond = selfDamage * recoup * castsPerSecond;
const degenPerStack = DEMONFLAME_DEGEN_BASE + (life * DEMONFLAME_DEGEN_PERCENT);
const maxSustainableStacks = Math.floor(maxRecoupPerSecond / degenPerStack);
const stacksOverflow = targetStacks > maxSustainableStacks;
// Damage calculations with Demonflame
const currentMultiplier = 1 + (currentStacks * DEMONFLAME_DAMAGE_MULTIPLIER);
const targetMultiplier = 1 + (targetStacks * DEMONFLAME_DAMAGE_MULTIPLIER);
const currentDPS = (baseDPS * currentMultiplier).toFixed(2);
const targetDPS = (baseDPS * targetMultiplier).toFixed(2);
const maxSafeDPS = (baseDPS * (1 + (maxSustainableStacks * DEMONFLAME_DAMAGE_MULTIPLIER))).toFixed(2);
// Sustainability checks
const selfDPS = selfDamage * castsPerSecond;
const sustainable = selfDPS <= esRecovery;
const manaSustainable = infernalFlame >= (manaCost * castsPerSecond);
// Double Cast prediction
let doubleCastData = "N/A";
if(leftoverEnergy > 0) {
const cyclesForDouble = Math.ceil(ENERGY_PER_TRIGGER / leftoverEnergy);
const doubleCastTime = (cyclesForDouble * effectiveCastTime).toFixed(2);
doubleCastData = `${cyclesForDouble} cycles (${doubleCastTime}s)`;
}
// Build results HTML
const resultsHTML = `
<div class="result-section">
<h4>Defensive Metrics</h4>
<p>Self Damage/Cycle: <strong>${selfDamage.toFixed(2)}</strong></p>
<p>Self DPS: <strong class="${sustainable ? 'success' : 'warning'}">${selfDPS.toFixed(2)}</strong></p>
<p>ES Recovery: <strong>${esRecovery.toFixed(2)}/sec</strong></p>
</div>
<div class="result-section">
<h4>Offensive Metrics</h4>
<p>Effective Cast Rate: <strong>${castsPerSecond.toFixed(2)}/sec</strong></p>
<p>Base DPS: <strong>${baseDPS.toFixed(2)}</strong></p>
<p>Damage Range: <strong>${dmgMin} - ${dmgMax}</strong></p>
<p>Critical Chance: <strong>${(critChance * 100).toFixed(1)}%</strong></p>
</div>
<div class="result-section ${stacksOverflow ? 'stack-warning' : ''}">
<h4>Demonflame Optimization</h4>
<div class="demonflame-controls">
<div>
<p>Current Stacks: <strong>${currentStacks}</strong></p>
<p>Current DPS: <strong>${currentDPS}</strong></p>
</div>
<div>
<p>Target Stacks: <strong class="${stacksOverflow ? 'warning' : 'success'}">${targetStacks}</strong></p>
<p>Target DPS: <strong class="${stacksOverflow ? 'warning' : 'success'}">${targetDPS}</strong></p>
</div>
<div>
<p>Max Safe Stacks: <strong>${maxSustainableStacks}</strong></p>
<p>Safe DPS: <strong class="success">${maxSafeDPS}</strong></p>
</div>
</div>
${stacksOverflow ? `
<p class="warning">⚠️ Stack Overflow! Losing ${(degenPerStack * targetStacks - maxRecoupPerSecond).toFixed(1)} life/sec</p>
<p>Degen at ${targetStacks} stacks: <strong class="warning">${(degenPerStack * targetStacks).toFixed(1)}/sec</strong></p>
<p>Recoup Recovery: <strong class="success">${maxRecoupPerSecond.toFixed(1)}/sec</strong>
(${castsPerSecond.toFixed(1)} casts/sec × ${(selfDamage * recoup).toFixed(1)} recoup/cast)</p>
` : ''}
<p class="info">Each stack provides ${DEMONFLAME_DAMAGE_MULTIPLIER*100}% more spell damage</p>
<p class="info">Degen per stack: ${degenPerStack.toFixed(2)}/sec (Base ${DEMONFLAME_DEGEN_BASE} + ${(DEMONFLAME_DEGEN_PERCENT*100).toFixed(2)}% of Life)</p>
<p class="info">Recoup Mechanics: ${(recoup*100).toFixed(0)}% of damage recouped at ${(selfDamage * recoup).toFixed(1)}/sec per cast,
stacking additively across ${castsPerSecond.toFixed(1)} casts/sec (${maxRecoupPerSecond.toFixed(1)}/sec total)</p>
</div>
<div class="result-section">
<h4>Resource Management</h4>
<p>Mana Sustainability:
<strong class="${manaSustainable ? 'success' : 'warning'}">
${manaSustainable ? '✅ Stable' : '⚠️ Insufficient'}
</strong>
</p>
<p>Energy/Cycle: <strong>${baseEnergy.toFixed(2)}</strong></p>
<p>Leftover Energy: <strong>${leftoverEnergy.toFixed(2)}</strong></p>
</div>
<div class="result-section">
<h4>Network Analysis</h4>
<p>Effective Cast Time: <strong>${(effectiveCastTime * 1000).toFixed(1)}ms</strong></p>
<p>Server Tick: <strong>+${SERVER_TICK}ms</strong></p>
<p>Double Cast Prediction: <strong>${doubleCastData}</strong></p>
${leftoverEnergy > 0 ?
`<p class="warning">⚠️ Energy Drift! Extra cast every ${doubleCastData}</p>` :
`<p class="success">✅ Perfect Energy Alignment</p>`}
</div>
`;
document.getElementById('result').innerHTML = resultsHTML;
} catch (error) {
showError(`Calculation error: ${error.message}`);
}
}
// UI Helpers
function showError(message, type = 'error') {
const errorDiv = document.getElementById('error');
errorDiv.textContent = message;
errorDiv.className = type;
errorDiv.style.display = 'block';
setTimeout(() => errorDiv.style.display = 'none', 5000);
}
// Initial Load
document.addEventListener('DOMContentLoaded', listSavedBuilds);
</script>
</body>
</html>