Skip to content

Commit b51da87

Browse files
committed
Implements concentrating; changes up available/reacted
1 parent 3f8151e commit b51da87

12 files changed

+3078
-2655
lines changed

assets/combat-icons.ai

+3,034-2,601
Large diffs are not rendered by default.

images/combat-icons_available.png

2.51 KB
Loading

images/combat-icons_concentrating.png

6.61 KB
Loading

images/combat-icons_reacted.png

3.86 KB
Loading

images/reacted.png

3.86 KB
Loading

images/used-reaction.png

-21.6 KB
Loading

index.html

+22-10
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@
6666
</div>
6767
<div class="actor-name">
6868
<div class="show">
69-
<% if (_.include(features, "readied")) { %>
70-
<div class='readied feature-icon'/>
69+
<% if (_.include(features, "available")) { %>
70+
<div class='available feature-icon'/>
71+
<% } %>
72+
<% if (_.include(features, "reacted")) { %>
73+
<div class='reacted feature-icon'/>
7174
<% } %>
7275
<label><%- title %></label>
7376
<% if (_.include(features, "advantage")) { %>
@@ -82,12 +85,15 @@
8285
<% if (_.include(features, "granting")) { %>
8386
<div class='granting feature-icon'/>
8487
<% } %>
85-
<% if (_.include(features, "bloodied")) { %>
86-
<div class='bloodied feature-icon'/>
87-
<% } %>
8888
<% if (_.include(features, "used-reaction")) { %>
8989
<div class='used-reaction feature-icon'/>
9090
<% } %>
91+
<% if (_.include(features, "concentrating")) { %>
92+
<div class='concentrating feature-icon'/>
93+
<% } %>
94+
<% if (_.include(features, "bloodied")) { %>
95+
<div class='bloodied feature-icon'/>
96+
<% } %>
9197
<% if (_.include(features, "incapacitated")) { %>
9298
<div class='incapacitated feature-icon'/>
9399
<% } %>
@@ -123,8 +129,11 @@
123129
</div>
124130
<div class="marquee-name">
125131
<div class="show">
126-
<% if (_.include(features, "readied")) { %>
127-
<div class='readied feature-icon'/>
132+
<% if (_.include(features, "available")) { %>
133+
<div class='available feature-icon'/>
134+
<% } %>
135+
<% if (_.include(features, "reacted")) { %>
136+
<div class='reacted feature-icon'/>
128137
<% } %>
129138
<label><%- title %></label>
130139
<% if (_.include(features, "advantage")) { %>
@@ -139,12 +148,15 @@
139148
<% if (_.include(features, "granting")) { %>
140149
<div class='granting feature-icon'/>
141150
<% } %>
142-
<% if (_.include(features, "bloodied")) { %>
143-
<div class='bloodied feature-icon'/>
144-
<% } %>
145151
<% if (_.include(features, "used-reaction")) { %>
146152
<div class='used-reaction feature-icon'/>
147153
<% } %>
154+
<% if (_.include(features, "concentrating")) { %>
155+
<div class='concentrating feature-icon'/>
156+
<% } %>
157+
<% if (_.include(features, "bloodied")) { %>
158+
<div class='bloodied feature-icon'/>
159+
<% } %>
148160
<% if (_.include(features, "incapacitated")) { %>
149161
<div class='incapacitated feature-icon'/>
150162
<% } %>

js/app.js

+11-23
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ $(function(){
5050
var value = this.$('.actor-initiative .edit-form input').val();
5151
value = isNaN(parseInt(value)) ? "" : parseInt(value);
5252

53-
console.log('Updating initiative with', value);
5453
this.collection.selectedActor().save({order: value});
5554
this.hideInitiative();
5655
}
@@ -72,11 +71,9 @@ $(function(){
7271
var target_id = $(e.target).parent().attr('id');
7372
var condition = this.newCondition.val().replace(/^\s+|\s+$/g,'');
7473

75-
if(condition.length > 0){
74+
if (condition.length > 0){
7675
this.collection.selectedActor().addCondition({title:condition, persistent: false});
77-
} else {
78-
console.log('skipping empty condition');
79-
}
76+
}
8077

8178
this.newCondition.blur();
8279
this.newConditionCell.hide();
@@ -111,7 +108,6 @@ $(function(){
111108
},
112109

113110
render: function() {
114-
console.log('marqueeview render event');
115111
var selectedActor = this.collection.selectedActor();
116112
if (selectedActor) {
117113
this.$el.html(this.template(selectedActor.toJSON()));
@@ -294,7 +290,6 @@ $(function(){
294290
var value = this.sessionInput.val();
295291
this.sessionForm.hide();
296292
this.sessionLabel.show();
297-
console.log('Updating session name: ', value);
298293

299294
this.sessionInput.val('');
300295
Sessions.setTitle(value);
@@ -306,11 +301,9 @@ $(function(){
306301
this.sessionLabel.hide();
307302
this.sessionForm.show();
308303
this.sessionInput.focus();
309-
console.log('double click on session title change it');
310304
},
311305

312306
onSessionUpdate: function() {
313-
console.log('app: Game Session Changed');
314307
this.sessionLabel.html(Sessions.getTitle());
315308
},
316309

@@ -376,66 +369,61 @@ $(function(){
376369
this.selectNextAndEditInitiative(e); break;
377370
case 60: // '<'
378371
this.actorUp(); break;
379-
case 55: // '7'
380-
this.toggleFeature(Actors.selectedActor(), 'used-reaction'); break;
381372
case 57: // '9'
382373
this.rotateFeature(Actors.selectedActor(), ['bloodied', 'dying', 'incapacitated', 'health-neutral']); break;
374+
case 56: // '8'
375+
this.toggleFeature(Actors.selectedActor(), 'concentrating'); break;
376+
case 55: // '7'
377+
this.toggleFeature(Actors.selectedActor(), 'used-reaction'); break;
383378
case 51: // '3'
384379
this.rotateFeature(Actors.selectedActor(), ['defending', 'granting', 'defense-neutral']); break;
385380
case 50: // '2'
386381
this.rotateFeature(Actors.selectedActor(), ['advantage', 'disadvantage', 'advantage-neutral']); break;
387382
case 49: // '1'
388-
this.toggleReadied(Actors.selectedActor()); break;
383+
this.rotateFeature(Actors.selectedActor(), ['available', 'reacted']); break;
389384
case 48: // '0'
390385
this.toggleFeature(Actors.selectedActor(), 'persistent'); break;
391386
case 45: // '-'
392387
this.incrementLastConditionFromActor(Actors.selectedActor(), -1); break;
393388
case 43: // '+'
394389
this.incrementLastConditionFromActor(Actors.selectedActor(), +1); break;
390+
case 33: // '!'
391+
this.toggleReadied(Actors.selectedActor()); break;
395392
case 710: // 'Shift-Option-I'
396393
this.resetAllInitiatives(e); break;
397394
case 91: // ] session dwn
398-
console.log('switch session up');
399395
Sessions.saveSession(Environment.toJSON(), Actors.toJSON());
400396
Sessions.upSelect();
401397
Actors.reset(Sessions.getActors());
402398
Environment.set(Sessions.getEnv());
403399
break;
404400

405401
case 93: // [ session up
406-
console.log('switch session down');
407402
Sessions.saveSession(Environment.toJSON(), Actors.toJSON());
408403
Sessions.downSelect();
409404
Actors.reset(Sessions.getActors());
410405
Environment.set(Sessions.getEnv());
411406
break;
412407

413408
case 115: // s Save session
414-
console.log('Saving Session');
415409
Sessions.saveSession(Environment.toJSON(), Actors.toJSON());
416410
break;
417411

418412
case 125: // } new session
419-
console.log('new session');
420413
Sessions.saveSession(Environment.toJSON(), Actors.toJSON());
421414
Sessions.newSession();
422415
Actors.reset(Sessions.getActors());
423416
Environment.set(Sessions.getEnv());
424417
break;
425418

426419
case 123: // } delete session
427-
console.log('delete session');
428420
Sessions.saveSession(Environment.toJSON(), Actors.toJSON());
429421
var reset = window.confirm("Delete Game Session? This will remove the entire session!");
430422
if (reset) {
431-
console.log('gone');
432423
Sessions.removeSession();
433424
Actors.reset(Sessions.getActors());
434425
Environment.set(Sessions.getEnv());
435-
} else {
436-
console.log('sikeeeeee');
437-
return;
438-
}
426+
}
439427
break;
440428
default:
441429
console.log('Command key: ' + charCode + ' ' + e.key);
@@ -569,7 +557,7 @@ $(function(){
569557

570558
toggleReadied: function( model ) {
571559
model.toggleFeature('readied' );
572-
var readyString = model.get('title') + " ready";
560+
var readyString = model.get('title') + " readied";
573561
if (model.hasFeature('readied')) {
574562
Environment.addAspect(readyString);
575563
} else {

js/models/actor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var Actor = Backbone.Model.extend({
1414
active: false,
1515
selected: false,
1616
conditions: [],
17-
features: []
17+
features: ['available']
1818
};
1919
},
2020

js/models/session.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,11 @@ var Session = Backbone.Model.extend({
55
var d = Date().toLocaleString('en-US');
66

77
return {
8-
title: "Ready Session 0",
8+
title: "New Session",
99
index: null,
1010
selected: true ,
1111
lastplayed: d,
12-
actors: [
13-
{
14-
title: "Ready Player 1",
15-
order: 0,
16-
active: true,
17-
selected: true,
18-
conditions: [],
19-
features: ['persistent']
20-
},
21-
],
12+
actors: [],
2213
env: {aspects:[]}
2314
};
2415
}

stylesheets/labels.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ textarea {
304304
border-left: 1px solid #c0e;
305305
}
306306

307-
.active .conditions.labels li.ready a,
307+
.active .conditions.labels li.readied a,
308308
.conditions.labels li.ready a,
309309
.active .conditions.labels li.delay a,
310310
.conditions.labels li.delay a

stylesheets/marquee.css

+7-8
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,9 @@ li.actor-item.active {
188188
.feature-icon.bloodied {
189189
background-image: url(../images/blood-drop.png);
190190
}
191-
192-
.feature-icon.used-reaction {
193-
background-image: url(../images/used-reaction.png);
191+
.feature-icon.concentrating {
192+
background-image: url(../images/combat-icons_concentrating.png);
194193
}
195-
196194
.feature-icon.defending {
197195
background-image: url(../images/combat-icons_defending.png);
198196
}
@@ -205,16 +203,17 @@ li.actor-item.active {
205203
.feature-icon.disadvantage {
206204
background-image: url(../images/combat-icons_disadvantage.png);
207205
}
208-
209206
.feature-icon.dying {
210207
background-image: url(../images/purple-skull.png);
211208
}
212209
.feature-icon.incapacitated {
213210
background-image: url(../images/orange-skull.png);
214211
}
215-
216-
.feature-icon.readied {
217-
background-image: url(../images/combat-icons_readied.png);
212+
.feature-icon.available {
213+
background-image: url(../images/combat-icons_available.png);
214+
}
215+
.feature-icon.reacted {
216+
background-image: url(../images/combat-icons_reacted.png);
218217
}
219218

220219
li:hover .destroy, li:hover .activate {

0 commit comments

Comments
 (0)