add html/jsonapi armor builder

- make decoration calculator use 1-slot decorations multiple times
This commit is contained in:
Bryce Allen
2015-04-29 02:16:01 -05:00
parent 784299dd53
commit 6329e7028b
11 changed files with 662 additions and 38 deletions

View File

@@ -0,0 +1,18 @@
<table>
<% for(var i=0; i<decorations.length; i++) { %>
<tr>
<td><%= Array(decorations[i]["num_slots"] + 1).join("\u26ab") %></td>
<td><%= decorations[i]["display_name"] %>
<button id="<%= type %>_remove_decoration_<%= i %>"
class="remove_decoration">-</button></td>
</tr>
<% } %>
<% if (free_slots > 0) { %>
<tr>
<td><%= Array(free_slots + 1).join("\u26aa") %><%= Array(3- free_slots + 1).join("&nbsp;") %></td>
<td><input id="<%= type %>_decoration" type="text" size="12">
<button id="<%= type %>_add_decoration"
class="add_decoration">+</button></td>
</tr>
<% } %>
</table>

View File

@@ -0,0 +1,21 @@
<table id="resist_table" cellpadding="2" border="0">
<tr>
<th>&nbsp;</th>
<th>Total</th>
<th>Head</th>
<th>Body</th>
<th>Arms</th>
<th>Waist</th>
<th>Legs</th>
</tr>
<% for(var i=0; i<ELEMENTS.length; i++) { %>
<tr>
<th><%= ELEMENTS[i] %></th>
<td class="num"><%= element_resist[ELEMENTS[i]] %></td>
<% for(var j=0; j<TYPES.length; j++) { %>
<td class="num">
<%= armors[TYPES[j]]
? armors[TYPES[j]][ELEMENTS[i] + "_res"] : "&nbsp;" %></td>
<% } %>
<% } %>
</table>

25
web/templates/skills.ejs Normal file
View File

@@ -0,0 +1,25 @@
<table id="skills_table" cellpadding="2" border="0">
<tr>
<th>&nbsp;</th>
<th>Total</th>
<% for(var i=0; i<TYPES.length; i++) { %>
<td><%= TYPES[i] %></td>
<% } %>
</tr>
<% for(var i=0; i<active_skills.length; i++) { %>
<tr>
<td><%= active_skills[i] %></td>
<td class="num"><%= skills[active_skills[i]] %></td>
<% for(var j=0; j<TYPES.length; j++) { %>
<td class="num">
<%= (armors[TYPES[j]] && tskills_by_type[TYPES[j]][active_skills[i]])
? tskills_by_type[TYPES[j]][active_skills[i]]
: "&nbsp;" %>
<%= 0 && (armors[TYPES[j]] && dskills_by_type[TYPES[j]][active_skills[i]])
? " (" + dskills_by_type[TYPES[j]][active_skills[i]] + ")"
: "&nbsp;" %>
</td>
<% } %>
</tr>
<% } %>
</table>

View File

@@ -0,0 +1,24 @@
<table id="skills_table" cellpadding="2">
<tr>
<th>Skill</th>
<th>Total</th>
<% for(var i=0; i<TYPES.length; i++) { %>
<th><%= TYPES[i] %></th>
<% } %>
</tr>
<% for(var i=0; i<active_skills.length; i++) { %>
<tr>
<td><%= active_skills[i] %></td>
<td><%= skills[active_skills[i]] %></td>
<% for(var j=0; j<TYPES.length; j++) { %>
<td>
<%= (armors[TYPES[j]] && armors[TYPES[j]]["skills"][active_skills[i]])
? armors[TYPES[j]]["skills"][active_skills[i]] : "&nbsp;" %>
<%= (armors[TYPES[j]] && dskills_by_type[TYPES[j]][active_skills[i]])
? " (" + dskills_by_type[TYPES[j]][active_skills[i]] + ")"
: "&nbsp;" %>
</td>
<% } %>
</tr>
<% } %>
</table>