...
 
Commits (1)
......@@ -69,15 +69,28 @@ def parse_autocancel_condition(data):
def transform_autocancel(data):
res = transform_time_element(data)
res["Script"] = "Self" if data["MoveIndex"] < 0 else data["MoveIndex"]
if (data["Unknown2"] & 2) == 0:
res["ScriptTime"] = data["Unknown1"]
unk = dict()
if data["Unknown3"]:
unk["Unknown3"] = data["Unknown3"]
if data["Unknown4"]:
unk["Unknown4"] = data["Unknown4"]
if type(data["Condition"]) == int and data["Condition"] & 0x8000:
res["Condition"] = data["Condition"] & 0x7FFF
res["ActivateStates"] = read_flags(data["Unknown2"], ["A", "B", "C", "D", "E", "F"])
else:
res["Script"] = "Self" if data["MoveIndex"] < 0 else data["MoveIndex"]
if data["Unknown2"] == 2:
res["ScriptTime"] = data["Unknown1"]
else:
if data["Unknown1"]:
res["ScriptTime"] = data["Unknown1"]
if data["Unknown2"]:
unk["Unknown2"] = data["Unknown2"]
condition, params = parse_autocancel_condition(data)
res["Condition"] = condition
if type(data["Condition"]) == int and data["Condition"] < 0:
res["Condition"] = "Unknown %x + %s" % ((data["Condition"] & 0xFFFF) >> 8, res["Condition"])
if params:
res["Parameters"] = params
if unk:
res["Unknown"] = unk
return res
......@@ -34,5 +34,7 @@ def transform_hitbox(data):
unk["Flag4"] = read_flags(data["Flag4"])
if data["Unknown11"]:
unk["Unknown11"] = read_flags(data["Unknown11"])
if data.get("Unknown12"):
unk["Unknown12"] = read_flags(data["Unknown12"])
res["Unknown"] = unk
return res
......@@ -24,6 +24,8 @@ def transform_hurtbox(data):
unk["Unknown11_HI"] = data["Unknown11"] >> 16
if data["Unknown12"] != 1:
unk["Unknown12"] = data["Unknown12"]
if data.get("Unknown13"):
unk["Unknown13"] = data["Unknown13"]
if len(unk) > 0:
res["Unknown"] = unk
return res
......@@ -86,7 +86,7 @@ def transform_move(data, max_uk8):
"Name": data["Name"],
"Script": data["ScriptIndex"],
"InputMatch": input_match,
"HeightRestriction": data["RestrictionDistance"] if data["PositionRestriction"] == 2 else None,
"HeightRestriction": data["RestrictionDistance"] if data["PositionRestriction"] > 0 else None,
"BloodyGarden": data["Unknown4"] > 0 if data["Unknown4"] > 0 else None,
"ProjectileLimit": projectile_limit[0] if projectile_limit[0] > 0 else None,
"ProjectileGroup": projectile_limit[1] if projectile_limit[1] > 0 else None,
......
......@@ -14,7 +14,9 @@ char_alias = {
"Z26": "SKR",
"Z27": "BLK",
"Z28": "FLK",
"Z29": "CDY"
"Z29": "CDY",
"Z30": "G",
"Z31": "SGT",
}
......
def transform_time_element(data):
return {
res = {
"TickStart": data["TickStart"],
"TickEnd": data["TickEnd"]
}
flag1 = data.get("BACVERint1", 0)
if flag1:
res["ActiveOnStates"] = read_flags(flag1, ["A", "B", "C", "D", "E", "F"])
flag2 = data.get("BACVERint2", 0)
if flag2:
res["InactiveOnStates"] = read_flags(flag2, ["A", "B", "C", "D", "E", "F"])
flag3 = data.get("BACVERint3", 0)
if flag3:
res["TickFlag3"] = flag3
flag4 = data.get("BACVERint4", 0)
if flag4:
res["TickFlag4"] = flag4
return res
class Flag(frozenset):
......
result/assets/chars/blk.png

305 KB | W: | H:

result/assets/chars/blk.png

166 KB | W: | H:

result/assets/chars/blk.png
result/assets/chars/blk.png
result/assets/chars/blk.png
result/assets/chars/blk.png
  • 2-up
  • Swipe
  • Onion skin
result/assets/chars/cdy.png

109 KB | W: | H:

result/assets/chars/cdy.png

99.7 KB | W: | H:

result/assets/chars/cdy.png
result/assets/chars/cdy.png
result/assets/chars/cdy.png
result/assets/chars/cdy.png
  • 2-up
  • Swipe
  • Onion skin
result/assets/chars/flk.png

521 KB | W: | H:

result/assets/chars/flk.png

102 KB | W: | H:

result/assets/chars/flk.png
result/assets/chars/flk.png
result/assets/chars/flk.png
result/assets/chars/flk.png
  • 2-up
  • Swipe
  • Onion skin
result/assets/chars/skr.png

213 KB | W: | H:

result/assets/chars/skr.png

54.8 KB | W: | H:

result/assets/chars/skr.png
result/assets/chars/skr.png
result/assets/chars/skr.png
result/assets/chars/skr.png
  • 2-up
  • Swipe
  • Onion skin
result/assets/chars/zgf.png

229 KB | W: | H:

result/assets/chars/zgf.png

62.1 KB | W: | H:

result/assets/chars/zgf.png
result/assets/chars/zgf.png
result/assets/chars/zgf.png
result/assets/chars/zgf.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -232,6 +232,12 @@
padding: 1em;
font-size: smaller;
}
#statebox {
position: absolute;
top: 220px;
padding: 1em;
font-size: smaller;
}
.positions {
position: absolute;
right: 0;
......@@ -493,6 +499,9 @@ dd ul {
#rangebox {
top: 0px;
}
#statebox {
top: 180px;
}
.version-selection .char-img {
position: unset;
}
......
......@@ -57,6 +57,13 @@ function onTickClick(tick, gridElement) {
$el.clone().attr("id", "#" + box+"-old").appendTo("#old-hitbox-shift").addClass("temporary").addClass("old").show();
}
}
for (var i = 0 ; i < states.length ; i++) {
if ($("#activate-state-"+states[i]).prop('checked')) {
$(".if-not-state-"+states[i]).hide();
} else {
$(".if-state-"+states[i]).hide();
}
}
var left = $(".zero").offset().left;
var shiftX = ($(".cross-y").offset().left - left)/100.0;
var rangeBox = "<h4>Ranges</h4>Position: "+ (+shiftX.toFixed(5))+"<br>";
......@@ -217,6 +224,20 @@ $('.sparklines').bind("mousedown", function() {
}).bind('sparklineRegionChange', function(ev) {
if (sparklineDrag) selectFromSparkline(ev);
});
if (states.length) {
var stateBox = "<h4>States</h4> ";
for (var i = 0; i < states.length; i++) {
stateBox += "<label>" + states[i] + " <input type='checkbox' class='activate-state' id='activate-state-" + states[i] + "'></label> ";
}
var state = $("<div id='statebox'>").html(stateBox);
state.prependTo($(".box-container"));
$(".activate-state").each(function(i, e) {
$(e).click(function() {
onTickClick(currentTick, $(grid[currentTick]));
});
});
}
var tick = 1;
if (location.hash) {
var hash = parseInt(location.hash.substring(1));
......
......@@ -2,15 +2,22 @@ import json
def get_box_style(path, h):
res = ""
if "ActiveOnStates" in h:
for st in h["ActiveOnStates"]:
res += "if-state-" + st + " "
if "InactiveOnStates" in h:
for st in h["InactiveOnStates"]:
res += "if-not-state-" + st + " "
if path == "Hurtboxes":
if h.get("Type") == "Armor":
return "hurt armor"
return "hurt "+" ".join([e.lower() for e in h["Sensitivity"]])
return res + "hurt armor"
return res + "hurt "+" ".join([e.lower() for e in h["Sensitivity"]])
if path == "Pushboxes":
return "push"
return res + "push"
if h["HitType"] == "Proximity Guard":
return "proximity"
return "hit"
return res + "proximity"
return res + "hit"
def render_boxes(script, diff):
......
......@@ -28,7 +28,8 @@ def render_script(script, diff, old_version, menu_data, **kwargs):
paths = ["Status", "Hitboxes", "Hurtboxes", "Pushboxes", "Cancels", "AutoCancels", "Commands", "Forces",
"Unknown"]
data = kwargs["data"]
left_panel = render_all_timeline(script, paths, diff, **kwargs)
states = set()
left_panel = render_all_timeline(script, paths, diff, states, **kwargs)
right_panel, box_js = render_boxes(script, diff)
positions = simulate_positions(script)
old_positions = compute_old_positions(old_version, positions, script)
......@@ -40,12 +41,14 @@ def render_script(script, diff, old_version, menu_data, **kwargs):
property_diff["Unknown"] = True
append_property_diff(diff, property_diff, "Positions")
js = """
var states = %s;
var totalTicks = %d;
var interruptFrame = %d;
var positions = %s;
var oldPositions = %s;
%s
""" % (
str(sorted(states)),
script["TotalTicks"],
script.get("InterruptFrame", 10000),
json.dumps(positions, default=float),
......
......@@ -100,7 +100,10 @@ def label_render(key, path, value, tooltip=False, data=None, **kwargs):
def render_box_properties(hurtbox, path, property_diff, additional_class, uk, projectile=False, **kwargs):
all_properties = sorted(
(k, v) for k, v in hurtbox.items() if k not in {"Height", "X", "Y", "Width", "TickStart", "TickEnd", "Unknown", "Parameters"})
(k, v) for k, v in hurtbox.items() if k not in {
"Height", "X", "Y", "Width", "TickStart", "TickEnd", "Unknown", "Parameters",
"ActiveOnStates", "InactiveOnStates", "ActivateStates"
})
if "Command" in hurtbox and hurtbox["Command"] == "Spawn Projectile":
projectile = True
rendered_properties = [render_box_property(k, v, path, property_diff, additional_class, projectile=projectile, **kwargs) for k, v in all_properties]
......@@ -119,10 +122,13 @@ def render_box_properties(hurtbox, path, property_diff, additional_class, uk, pr
render_box_property(k, v["change"], path, property_diff, "removed", uk, projectile=projectile, **kwargs)
for k, v in property_diff.get("#DIFF", {}).items() if "removed" in v["type"]
]
for p in ["ActiveOnStates", "InactiveOnStates", "ActivateStates"]:
if p in hurtbox:
rendered_properties.append(render_box_property(p, hurtbox[p], path, property_diff, additional_class, uk, projectile=projectile, **kwargs))
return "".join(rendered_properties)
def render_all_timeline(script, paths, diff, **kwargs):
def render_all_timeline(script, paths, diff, states, **kwargs):
render = ""
x_scale = 30
y_space = 30
......@@ -133,9 +139,9 @@ def render_all_timeline(script, paths, diff, **kwargs):
render += "<div class='timeline-header-spacer'></div>"
for path in paths:
to_draw = script.get(path)
if not to_draw:
continue
path_diff = diff.get(path, {})
if not to_draw and not path_diff:
continue
uk = False
if path == "Unknown":
uk = True
......@@ -154,7 +160,7 @@ def render_all_timeline(script, paths, diff, **kwargs):
# for old items put their actual key
items = [(-n - 1, n, h) for n, h in removed_items]
latest_delta = None
for n, h in enumerate(to_draw):
for n, h in enumerate(to_draw or []):
if n in added_items:
# for new item, put their potential index
items.append((n - (latest_delta or 0), n, h))
......@@ -169,6 +175,10 @@ def render_all_timeline(script, paths, diff, **kwargs):
render += title_block
i += 1
for sorting_key, n, h in sorted(items):
if "ActiveOnStates" in h:
states.update(h["ActiveOnStates"])
if "InactiveOnStates" in h:
states.update(h["InactiveOnStates"])
render += generate_timeline_item(h, i, n, path, path_diff, "removed" if n < 0 else ("added" if n in added_items else None), uk, x_scale, y_space, **kwargs)
i += 1
......
......@@ -18,6 +18,7 @@ char_label = {
"EDO": "Ed",
"FAN": "F.A.N.G.",
"FLK": "Falke",
"G": "G",
"GOK": "Akuma",
"GUL": "Guile",
"IBK": "Ibuki",
......@@ -32,6 +33,7 @@ char_label = {
"RMK": "R. Mika",
"RSD": "Rashid",
"RYU": "Ryu",
"SGT": "Sagat",
"SKR": "Sakura",
"URN": "Urien",
"VEG": "M. Bison [Dictator]",
......
......@@ -40,7 +40,6 @@
<h4>Unknowns</h4>
<dl class="dl-horizontal">
{%- for k, v in script["Unknown"].items() if k != "Others" %}
{%- call(value) dd_dt_diff('SlideAY', 'SlideAY') %}{{ value|round(6) }}{%- endcall %}
{%- set diff = property_diff['Unknown.'+k]|default({}) %}
<dt class="{{ diff[0] }}">{{ k }}</dt>
<dd{% if diff[0] == "changed" %} data-toggle='tooltip' data-placement='top' title='was {{ diff[1]["old_value"] }}'{% endif %}>{{ v }}</dd>
......