-
Notifications
You must be signed in to change notification settings - Fork 2
/
prime-vault.php
166 lines (159 loc) · 5.75 KB
/
prime-vault.php
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
<!doctype html>
<html lang="en" data-bs-theme="dark">
<head>
<title>Prime Vault | omni.wf</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="icon" href="https://browse.wf/Lotus/Interface/Icons/Categories/GrimoireModIcon.png">
<style id="scale-style">.icon{height:1em}</style>
</head>
<body data-bs-theme="dark">
<?php require "components/navbar.php"; ?>
<div class="container pt-3">
<h3>In Rotation</h3>
<ul id="inrotation"></ul>
<h3>Prime Resurgence</h3>
<ul id="resurgence"></ul>
<h3>Vaulted</h3>
<ul id="vaulted"></ul>
</div>
<script src="common.js"></script>
<script>
const STATE_VAULTED = 0;
const STATE_RESURGENCE = 1;
const STATE_INROTATION = 2;
Promise.all([
getDictPromise(),
fetch("https://browse.wf/warframe-public-export-plus/ExportRelics.json").then(res => res.json()),
fetch("https://browse.wf/warframe-public-export-plus/ExportRewards.json").then(res => res.json()),
fetch("https://browse.wf/warframe-public-export-plus/ExportRecipes.json").then(res => res.json()),
fetch("https://browse.wf/warframe-public-export-plus/ExportWeapons.json").then(res => res.json()),
fetch("https://browse.wf/warframe-public-export-plus/ExportWarframes.json").then(res => res.json()),
fetch("https://browse.wf/warframe-public-export-plus/ExportSentinels.json").then(res => res.json()),
fetch("https://raw.githubusercontent.com/calamity-inc/warframe-worldstate-history/senpai/worldState.json").then(res => res.json()),
]).then(function([ dict, ExportRelics, ExportRewards, ExportRecipes, ExportWeapons, ExportWarframes, ExportSentinels, worldState ])
{
window.dict = dict;
window.ExportRelics = ExportRelics;
window.ExportRewards = ExportRewards;
window.ExportWeapons = ExportWeapons;
window.ExportWarframes = ExportWarframes;
window.ExportSentinels = ExportSentinels;
console.time("build component_to_item");
window.component_to_item = {};
for (const [type, recipe] of Object.entries(ExportRecipes))
{
component_to_item[type] = recipe.resultType;
for (const ingredient of recipe.ingredients)
{
component_to_item[ingredient.ItemType] = recipe.resultType;
}
}
console.timeEnd("build component_to_item");
console.time("build VarziaItems");
window.VarziaItems = {};
for (const offering of worldState.PrimeVaultTraders[0].Manifest)
{
VarziaItems[offering.ItemType.split("/Lotus/StoreItems/").join("/Lotus/")] = true;
}
console.timeEnd("build VarziaItems");
console.time("build MissionRewards");
window.MissionRewards = {};
for (const deck of Object.values(ExportRewards))
{
for (const tier of deck)
{
for (const reward of tier)
{
MissionRewards[reward.type.split("/Lotus/StoreItems/").join("/Lotus/")] = true;
}
}
}
console.timeEnd("build MissionRewards");
console.time("build items");
window.items = {};
for (const [type, relic] of Object.entries(ExportRelics))
{
if (relic.quality == "VPQ_BRONZE" && relic.era != "Requiem")
{
const state = type in MissionRewards
? STATE_INROTATION
: type in VarziaItems
? STATE_RESURGENCE
: STATE_VAULTED
;
for (const reward of ExportRewards[relic.rewardManifest][0])
{
if (reward.type != "/Lotus/StoreItems/Types/Recipes/Components/FormaBlueprint")
{
const item = component_to_item[reward.type.split("/Lotus/StoreItems/").join("/Lotus/")];
if (!items[item] || state > items[item])
{
items[item] = state;
}
}
}
}
}
console.timeEnd("build items");
updateList();
onLanguageUpdate = updateList;
});
function updateList()
{
const state_to_elm = {};
state_to_elm[STATE_VAULTED] = document.getElementById("vaulted");
state_to_elm[STATE_RESURGENCE] = document.getElementById("resurgence");
state_to_elm[STATE_INROTATION] = document.getElementById("inrotation");
for (const div of Object.values(state_to_elm))
{
div.innerHTML = "";
}
let named_items = [];
for (const [item, state] of Object.entries(items))
{
const name = dict[ExportWarframes[item]?.name] ?? dict[ExportWeapons[item]?.name] ?? dict[ExportSentinels[item]?.name];
if (name)
{
named_items.push({
key: item,
name: name.split("<ARCHWING>").join("").trim(),
state
});
}
else
{
console.info("discarding", item);
}
}
named_items = named_items.sort((a, b) => a.name.localeCompare(b.name));
for (const item of named_items)
{
const li = document.createElement("li");
li.textContent = item.name + " ";
{
const a = document.createElement("a");
a.textContent = "(Wiki)";
a.href = "https://warframe.fandom.com/wiki/" + encodeURIComponent(item.name);
a.target = "_blank";
li.appendChild(a);
}
{
const span = document.createElement("span");
span.textContent = " ";
li.appendChild(span);
}
{
const a = document.createElement("a");
a.textContent = "(omni.wf)";
a.href = "/#q=" + encodeURIComponent(item.key);
a.target = "_blank";
li.appendChild(a);
}
state_to_elm[item.state].appendChild(li);
}
}
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>