add link to calculating palico
This commit is contained in:
1 parent
7cc708af91
commit
8f2b1b7c2d
5 files changed
+118
-1
No files matched your search
@@ -0,0 +1,13 @@
|
||||
[{"id": 1, "name": "Iron Sword", "class": 1}, {"id": 2, "name": "Iron Sword+", "class": 1}, {"id": 3, "name": "Buster Sword", "class": 1}, {"id": 4, "name": "Buster Sword+", "class": 1}, {"id": 5, "name": "Ravager Blade", "class": 1}, {"id": 6, "name": "Ravager Blade+", "class": 1}, {"id": 7, "name": "Lacerator Blade", "class": 1}, {"id": 8, "name": "Devastator Blade", "class": 1}, {"id": 9, "name": "Exemplar Blade", "class": 1}, {"id": 10, "name": "Grandglory Blade", "class": 1}, {"id": 11, "name": "Chrome Razor", "class": 1}, {"id": 12, "name": "Chrome Quietus", "class": 1}, {"id": 13, "name": "Chrome Hell", "class": 1}, {"id": 14, "name": "Chrome Heaven", "class": 1}, {"id": 15, "name": "Khezu Shock Sword", "class": 1}, {"id": 16, "name": "Khezu Shock Blade", "class": 1}, {"id": 17, "name": "Khezu Shock Full", "class": 1}, {"id": 18, "name": "Blood Sword", "class": 1}, {"id": 19, "name": "Blood Shock", "class": 1}, {"id": 20, "name": "Santoku Reaver", "class": 1}, {"id": 21, "name": "Funayuki Reaver", "class": 1}, {"id": 22, "name": "Toad Bereaver", "class": 1}, {"id": 23, "name": "Millstone Bereaver", "class": 1}, {"id": 24, "name": "Rampage Blade", "class": 1}, {"id": 25, "name": "Rampage Temperline", "class": 1}, {"id": 26, "name": "Brazenwall", "class": 1}, {"id": 27, "name": "Crimsonwall", "class": 1}, {"id": 28, "name": "Cragscliff", "class": 1}, {"id": 29, "name": "Cragscliff+", "class": 1}, {"id": 30, "name": "Cliffsword Titanius", "class": 1}, {"id": 31, "name": "Rugged Great Sword", "class": 1}, {"id": 32, "name": "Chieftain's Grt Swd", "class": 1}, {"id": 33, "name": "Schattenstolz", "class": 1}, {"id": 34, "name": "D\u00fcsterstolz", "class": 1}, {"id": 35, "name": "Verh\u00e4ngnisstolz", "class": 1}, {"id": 36, "name": "L'Apoth\u00e9ose", "class": 1}, {"id": 37, "name": "L'\u00c9clat", "class": 1}, {"id": 38, "name": "L'Origine", "class": 1}, {"id": 39, "name": "Usurper's Storm", "class": 1}, {"id": 40, "name": "Despot's Blackstorm", "class": 1}, {"id": 41, "name": "Brimstren Drakepride", "class": 1}, {"id": 42, "name": "Brimstren Drakepride+", "class": 1}, {"id": 43, "name": "Stygian Acedia", "class": 1}, {"id": 44, "name": "Demon Rod", "class": 1}, {"id": 45, "name": "Great Demon Rod", "class": 1}, {"id": 46, "name": "Great Demon Hot Rod", "class": 1}, {"id": 47, "name": "Demonlord Rod", "class": 1}, {"id": 48, "name": "Oppressor's Forger", "class": 1}, {"id": 49, "name": "Orcus Tonitrus", "class": 1}, {"id": 50, "name": "Ludroth Bone Sword", "class": 1}, {"id": 51, "name": "Ludroth Bone Sword+", "class": 1}, {"id": 52, "name": "Cataclysm Sword", "class": 1}, {"id": 53, "name": "Cataclysm Blade", "class": 1}, {"id": 54, "name": "Cataclysm Blade+", "class": 1}, {"id": 55, "name": "Bone Blade", "class": 1}, {"id": 56, "name": "Bone Blade+", "class": 1}, {"id": 57, "name": "Jawblade", "class": 1}, {"id": 58, "name": "Giant Jawblade", "class": 1}, {"id": 59, "name": "Golem Blade", "class": 1}, {"id": 60, "name": "Tiger Jawblade", "class": 1}, {"id": 61, "name": "Tigrex Great Sword", "class": 1}, {"id": 62, "name": "Accursed Blade", "class": 1}, {"id": 63, "name": "Veined Graveblade", "class": 1}, {"id": 64, "name": "Veined Graveblade+", "class": 1}, {"id": 65, "name": "Deified Grisblade", "class": 1}, {"id": 66, "name": "Dios Blade", "class": 1}, {"id": 67, "name": "Dios Blade+", "class": 1}, {"id": 68, "name": "Demolition Sword", "class": 1}, {"id": 69, "name": "Myxo Demolisher", "class": 1}, {"id": 70, "name": "Lightbreak Blade", "class": 1}, {"id": 71, "name": "Executioner", "class": 1}, {"id": 72, "name": "Executioner+", "class": 1}, {"id": 73, "name": "Enforcer's Axe", "class": 1}, {"id": 74, "name": "Cera Cigil", "class": 1}, {"id": 75, "name": "Cera Cymmetry", "class": 1}, {"id": 76, "name": "Valkyrie Blade", "class": 1}, {"id": 77, "name": "Sieglinde", "class": 1}, {"id": 78, "name": "Titania", "class": 1}, {"id": 79, "name": "Blushing Dame", "class": 1}, {"id": 80, "name": "Blushing Dame+", "class": 1}, {"id": 81, "name": "Br\u00fcnnhilde", "class": 1}, {"id": 82, "name": "Auberon", "class": 1}, {"id": 83, "name": "Auberon+", "class": 1}, {"id": 84, "name": "Pale Kaiser", "class": 1}, {"id": 85, "name": "Red Wing", "class": 1}, {"id": 86, "name": "Rathalos Firesword", "class": 1}, {"id": 87, "name": "Rathalos Flamesword", "class": 1}, {"id": 88, "name": "Rathalos Gleamsword", "class": 1}, {"id": 89, "name": "Rathalos Gleamsword+", "class": 1}, {"id": 90, "name": "Rathlord Gleamsword", "class": 1}, {"id": 91, "name": "Rathalos Glinsword", "class": 1}, {"id": 92, "name": "Rathalos Glinsword+", "class": 1}, {"id": 93, "name": "Rathflame Glinsword", "class": 1}, {"id": 94, "name": "Thrash Sword", "class": 1}, {"id": 95, "name": "Thrash Sword+", "class": 1}, {"id": 96, "name": "Thrash Blade", "class": 1}, {"id": 97, "name": "Thrashgash Blade", "class": 1}, {"id": 98, "name": "Jala Blade", "class": 1}, {"id": 99, "name": "Jajala Blade", "class": 1}, {"id": 100, "name": "Pavaka Blade", "claLine truncated
|
||||
{"id": -1, "name": "-- Relic Great Sword --", "class": 1},
|
||||
{"id": -2, "name": "-- Relic Long Sword --", "class": 2},
|
||||
{"id": -3, "name": "-- Relic Sword and Shield --", "class": 3},
|
||||
{"id": -4, "name": "-- Relic Dual Blades --", "class": 4},
|
||||
{"id": -5, "name": "-- Relic Hammer --", "class": 5},
|
||||
{"id": -6, "name": "-- Relic Hunting Horn --", "class": 6},
|
||||
{"id": -7, "name": "-- Relic Lance -", "class": 7},
|
||||
{"id": -8, "name": "-- Relic Gunlance --", "class": 8},
|
||||
{"id": -9, "name": "-- Relic Switch Axe --", "class": 9},
|
||||
{"id": -10, "name": "-- Relic Charge Blade --", "class": 10},
|
||||
{"id": -11, "name": "-- Relic Insect Glaive --", "class": 11}
|
||||
]
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Parse the weapon list data from calculating palico, and use it to
|
||||
generate another JSON file mapping the weapon name to the the weapon
|
||||
class qualified id (CLASS.WEAPON_ID) that is used when passing weapon
|
||||
setups in the query parameter.
|
||||
|
||||
See https://github.com/mrmin123/the-calculating-palico
|
||||
"""
|
||||
|
||||
import os.path
|
||||
import json
|
||||
|
||||
import _pathfix
|
||||
from _pathfix import db_path, project_path
|
||||
|
||||
if __name__ == '__main__':
|
||||
inpath = os.path.join(db_path, "calculating_palico_weapon_list.json")
|
||||
outpath = os.path.join(project_path, "web", "data",
|
||||
"calculating_palico_weapon_map.json")
|
||||
|
||||
with open(inpath) as f:
|
||||
weapon_list = json.load(f)
|
||||
weapon_map = dict()
|
||||
for weapon in weapon_list:
|
||||
weapon_map[weapon["name"]] = "%s.%s" % (weapon["class"], weapon["id"])
|
||||
with open(outpath, "w") as f:
|
||||
json.dump(weapon_map, f)
|
||||
@@ -0,0 +1 @@
|
||||
{"Ukanlos Skysinger": "6.1096", "Garuga Engetsu": "1.121", "Canine Katana": "2.264", "Dark Parasol": "12.2007", "Defender's Gunlance": "8.1303", "Marine Fisher": "8.1415", "Kut-Ku Pick": "5.880", "Accursed Bellow+": "13.2076", "Grand Wailing Ghost": "2.209", "Elendskraft": "10.1673", "Usurper's Roar+": "8.1382", "Rathlord Gleamsword": "1.90", "Luna's Howl": "8.1465", "Gold Chordmaker": "6.994", "Starlight Axe": "10.1730", "Silver Rook": "8.1319", "Jingana": "7.1191", "Fatalis Zaggespanon": "2.350", "Royal Claw": "3.501", "Accursed Slicers": "4.600", "Twistcrawl+": "7.1186", "Flicker Axe": "9.1572", "Ignis Noire": "4.732", "Zvolta Demolisher": "8.1326", "Tigrine Esurience": "2.272", "Usurper Boltslicer+": "2.274", "Sharkutter": "3.464", "Stahlurteil": "2.214", "Tarnished Sword": "3.561", "Bleeding Bopper": "5.798", "Tetrozonata": "8.1351", "Rathalos Glinsword+": "1.92", "Flame Fatalis Blade": "1.173", "Chameleos Blades": "4.647", "Dios Stinger+": "7.1174", "Curviscera": "2.290", "Guild Knight Sabers": "4.618", "Lagombergeddon": "8.1397", "Gravios Spear": "7.1147", "Rampage Temperline": "1.25", "Stealth Glaive": "11.1742", "Weathered Blades": "4.759", "Queen's Scionfire": "13.2039", "Utsurowazaru": "13.2093", "Eldaora's Hornet": "12.2015", "dummy113": "5.969", "Kurogane": "5.781", "Teostra's Orph\u00e9e": "6.1114", "Eldaora's Fang": "7.1277", "Valkyrie Chordmaker": "6.991", "Brute Flute": "6.1038", "Crimson Lance+": "7.1254", "Ceanataur Head Axe": "5.833", "Master Sabers": "4.619", "Iron Devil": "5.782", "Demolition Hammer": "5.877", "Galefrost+": "9.1492", "Glutton's Tools": "4.705", "Doomfang \"Envoys\"": "4.721", "Portsmark": "5.971", "Amber Slash": "9.1490", "Dear Rosetta": "10.1653", "Dios Katana+": "2.258", "Bone Lance": "7.1162", "Fatalis Ascencia": "2.361", "Daora's Brigia": "8.1470", "Ukanlos Staff": "11.1826", "Assault Glaive": "11.1775", "Nadeshiko": "5.919", "Freezer Speartuna": "1.133", "Fatalis Enforcer": "11.1864", "Shell Claw Lance": "7.1244", "Neo Undertaker": "7.1285", "Kirin Bolt": "3.515", "Queen's Farflier": "13.2038", "Kut-Ku Anger": "12.1929", "Akantor Dark Melody": "6.1094", "Verrat/Foi": "13.2155", "Shining Ishtar": "8.1378", "Yellow Buster": "13.2121", "Gorger's Tools": "4.706", "White Gunlance": "8.1340", "Agnablaster": "13.2102", "Glasya-Labolas": "5.852", "Neo Twin Acrus": "4.678", "Usurper's Boltslicer": "2.273", "Caster's Rod+": "11.1852", "Rebellious Knife": "3.392", "Akantor Cannon": "13.2151", "Demonlance Rajang": "7.1210", "Princess Panoply": "8.1374", "Qurupexspander+": "9.1544", "Self-possession": "11.1814", "Loyal Thunder": "13.2067", "Fimbulvetr": "11.1792", "Cross Bowgun+": "12.1870", "Blood Thunder": "8.1333", "Le D\u00e9tecteur": "3.398", "Despot's Boltbreaker": "2.275", "Pressurized Plaser+": "13.2062", "Bamboo Birdsbane": "8.1475", "Demonlord Gunlance": "8.1367", "Hurricane": "4.594", "Cryoseism": "9.1576", "Ukanlos Calamity": "7.1268", "Fulgent Demolisher": "10.1685", "Rampart+": "7.1130", "Undertaker": "7.1283", "Ravager Blade+": "1.6", "Susano-o": "2.319", "Monument of Lament": "1.171", "Eisenherz": "9.1561", "Blood Flute": "6.1036", "Heroic Deceadeus": "10.1704", "Ukanlos Gunlance": "8.1446", "Ukanlos Skylighter": "12.2005", "Daora's Colossus": "5.961", "Seditious Lance": "7.1261", "Ritual Eidolons": "4.740", "Penetrating Gaze": "12.1997", "Paraflick Axe": "9.1573", "Grim Genuflector": "2.358", "Yuki Ichimonji": "2.231", "Hadad Sedition": "7.1262", "Vavoom Verdict": "9.1507", "Nightfall Blaster": "13.2054", "Plesiperse Spike": "3.513", "Matched Slicers+": "4.589", "Thunderlance": "7.1240", "Grimmblick": "5.828", "Ruiner Lance": "7.1272", "Pox Tessen": "4.688", "La Foi": "13.2116", "Despot's Crookbolt": "3.423", "Bone Claw Lance": "7.1242", "Emperor Thundersword": "1.137", "Arachnoscale+": "10.1688", "Centenarian Dagger": "2.354", "Blackest Animus": "3.531", "Golden Radius": "3.453", "Bel Fiore": "5.900", "Vulcamagnon": "1.143", "Fatalis Menace": "6.1097", "Hydra Bite": "3.414", "Viper Bite": "3.433", "Vadya Muse": "6.1082", "Alated Insect": "4.613", "Tigrex Skull": "13.2073", "Matraca Hammer": "5.928", "Pink Maracas": "4.654", "Deepbuster": "8.1347", "Melting Blazer": "4.723", "Thanatos Rod+": "11.1846", "Huracan Blueblaze": "5.873", "Grimmig Katze": "9.1579", "Rathflame Glinsword": "1.93", "Buzzawgun": "12.1918", "Fatalis Buster": "5.939", "Ukanlos Horned Flute": "6.1095", "Needle Vine": "11.1787", "Notched Doom+": "9.1523", "Epitaph Blade+": "1.186", "Full Generator": "8.1329", "Pressure Cooker+": "5.857", "Rathalos Glinsword": "1.91", "Thunderclap+": "2.352", "Demon Lance": "7.1208", "Poli'ahu Pipe": "6.1015", "Tropeco Gun": "13.2110", "Stygian Industria": "5.813", "Basarios Venom Spear": "7.1146", "Stygian Invidia": "12.1898", "Cyclone": "4.595", "Eigoh": "13.2094", "Gold Cat Crusher": "5.915", "World's Demise": "8.1321", "Brimstren Draketail+": "7.1213", "La Loi": "2.216", "dummy78": "6.1117", "dummy79": "6.1118", "Ruiner Sword": "3.553", "Bone Kris+": "3.Line truncated
|
||||
@@ -5,6 +5,9 @@ WEAPON_NAME_IDX = {};
|
||||
// ["name", "wtype", "final", "element", "element_2", "awaken"]
|
||||
WEAPON_ID_IDX = {};
|
||||
|
||||
// maps weapon name name -> calculating palico id string
|
||||
PALICO_ID = {};
|
||||
|
||||
_ITEM_NAME_SPECIAL = {
|
||||
"welldonesteak": "Well-done Steak",
|
||||
"lrgelderdragonbone": "Lrg ElderDragon Bone",
|
||||
@@ -154,6 +157,17 @@ function load_weapon_data(ready_fn) {
|
||||
}
|
||||
|
||||
|
||||
function load_calculating_palico_data(ready_fn) {
|
||||
var DATA_PATH = get_base_path() + "/data/";
|
||||
$.getJSON(DATA_PATH + "calculating_palico_weapon_map.json",
|
||||
function(data) {
|
||||
PALICO_ID = data;
|
||||
ready_fn();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setup_weapon_autocomplete(weapon_selector, predicate_fn, ready_fn,
|
||||
change_fn) {
|
||||
load_weapon_data(function() {
|
||||
@@ -235,3 +249,32 @@ function set_horn_melodies_title(weapon_data) {
|
||||
});
|
||||
weapon_data["horn_melodies_title"] = lines.join(" ");
|
||||
}
|
||||
|
||||
|
||||
function get_calculating_palico_setup(weapon_data) {
|
||||
// NB: load_calculating_palico_data must be called first
|
||||
var name = weapon_data["name"];
|
||||
if (! name in PALICO_ID) {
|
||||
return "";
|
||||
}
|
||||
|
||||
var setup = [];
|
||||
setup.push(PALICO_ID[name]);
|
||||
var sharpness_plus = weapon_data["sharpness_plus"];
|
||||
var max_sharpness = -1;
|
||||
for (var i=0; i < sharpness_plus.length; i++) {
|
||||
if (sharpness_plus[i] == 0) {
|
||||
break;
|
||||
}
|
||||
max_sharpness = i;
|
||||
}
|
||||
setup.push(max_sharpness);
|
||||
setup.push("3.1.awk,shp");
|
||||
return setup.join(".");
|
||||
}
|
||||
|
||||
function get_calculating_palico_uri(setups) {
|
||||
// m=31 is Great Jaggi
|
||||
var base = "http://minyoung.ch/calculatingpalico/?m=31&s=";
|
||||
return base + encodeURIComponent(JSON.stringify(setups));
|
||||
}
|
||||
+33
-1
@@ -90,6 +90,10 @@
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#cp_div {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -98,7 +102,9 @@
|
||||
var template_row = new EJS({ url: "templates/weaponrow.ejs" });
|
||||
|
||||
$(document).ready(function(){
|
||||
load_weapon_data(init_page);
|
||||
load_weapon_data(function() {
|
||||
load_calculating_palico_data(init_page);
|
||||
});
|
||||
|
||||
$("#sharpness_popup").on("click", function(evt) {
|
||||
$(this).html("").offset({top:0, left:0}).hide();
|
||||
@@ -211,6 +217,7 @@
|
||||
|
||||
function update_weapon_list(state) {
|
||||
var match_count = 0;
|
||||
var cp_setups = [];
|
||||
var comps = state["weapon_component_text"].split("|");
|
||||
console.log("updating weapon list: " + JSON.stringify(state));
|
||||
$("#weapon_table").empty();
|
||||
@@ -238,10 +245,30 @@
|
||||
data["ELEMENT_ABBR"] = ELEMENT_ABBR;
|
||||
var html = template_row.render(data);
|
||||
$("#weapon_table").append(html);
|
||||
var setup = get_calculating_palico_setup(data);
|
||||
console.log("setup for " + weapon_id + ": "
|
||||
+ setup);
|
||||
if (setup.length) {
|
||||
cp_setups.push(setup);
|
||||
}
|
||||
update_cp_link(cp_setups);
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("match count: " + match_count);
|
||||
|
||||
}
|
||||
|
||||
function update_cp_link(setups) {
|
||||
if (setups.length == 0) {
|
||||
console.log("no matches or no cp setups, hiding cp link");
|
||||
$("#cp_div").hide();
|
||||
} else {
|
||||
var href = get_calculating_palico_uri(setups);
|
||||
console.log("cp link: " + href);
|
||||
$("#cp_link").prop("href", href);
|
||||
$("#cp_div").show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
@@ -304,6 +331,11 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="cp_div">
|
||||
<a id="cp_link"
|
||||
href="http://minyoung.ch/calculatingpalico/"
|
||||
>Compare weapons (Calculating Palico)</a>
|
||||
</div>
|
||||
<table id="weapon_table">
|
||||
</table>
|
||||
<div id="sharpness_popup"></div>
|
||||
|
||||
Reference in new issue
Block a user