From 174004e51dce66ca3b227bf3f390ec4cdde44f7e Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Sun, 19 Apr 2015 11:26:05 -0500 Subject: [PATCH] Adjust Segs from 30 to 15 minutes Decided to reduce the amount of time 1 Seg equals down to 15 minutes from 30 minutes. Felt odd that a CR+1 fight would take 30 minutes, as would a trip to the store. 15 minutes seems much more appropriate. --- src/scripts/components/Adventure/GmModal.js | 12 +++--- src/scripts/components/Save/Inputs.js | 2 +- src/scripts/helpers/Pathfinder.js | 41 ++++++++++----------- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/scripts/components/Adventure/GmModal.js b/src/scripts/components/Adventure/GmModal.js index f54ad62..95d76b9 100644 --- a/src/scripts/components/Adventure/GmModal.js +++ b/src/scripts/components/Adventure/GmModal.js @@ -56,22 +56,22 @@ var AdventureGmModal = React.createClass({

Adjust Time

- -1 Day + -1 Day
- -1 Hour + -1 Hour
- -30 Mins + -15 Mins
- +30 Mins + +15 Mins
- +1 Hour + +1 Hour
- +1 Day + +1 Day
diff --git a/src/scripts/components/Save/Inputs.js b/src/scripts/components/Save/Inputs.js index 0313ab8..fcf1987 100644 --- a/src/scripts/components/Save/Inputs.js +++ b/src/scripts/components/Save/Inputs.js @@ -81,7 +81,7 @@ var SaveInputs = React.createClass({ type="text" name="segs" ref="segs" - placeholder="Segs (48 = 1 Day)" + placeholder="Segs (96 = 1 Day)" defaultValue={attrs.segs || 0} onChange={this.handleDayTime} addonBefore="Current Segs" diff --git a/src/scripts/helpers/Pathfinder.js b/src/scripts/helpers/Pathfinder.js index 304f1d0..19f83f8 100644 --- a/src/scripts/helpers/Pathfinder.js +++ b/src/scripts/helpers/Pathfinder.js @@ -455,21 +455,21 @@ var Pathfinder = { segs = 0; } - var days, hours, half, dayLabel, hourLabel, halfLabel, ampmLabel; + var days, hours, partial, dayLabel, hourLabel, partialLabel, ampmLabel; /* Days */ - days = parseInt(segs/48); - segs = segs - (days * 48); + days = parseInt(segs/96); + segs = segs - (days * 96); dayLabel = 'Day ' + (days + 1); /* Hours */ - hours = parseInt(segs/2); + hours = parseInt(segs/4); - segs = segs - (hours * 2); + segs = segs - (hours * 4); if (hours === 0) { hourLabel = '12'; ampmLabel = 'AM'; @@ -487,11 +487,10 @@ var Pathfinder = { ampmLabel = 'PM'; } - half = parseInt(segs); - halfLabel = (half === 1) ? ':30' : ':00'; + partial = parseInt(segs); + partialLabel = (partial > 0) ? ':' + (partial * 15) : ':00'; - return ({dayLabel}  {hourLabel + halfLabel} {ampmLabel}); - //return (dayLabel + ', ' + hourLabel + halfLabel + ' ' + ampmLabel); + return ({dayLabel}  {hourLabel + partialLabel} {ampmLabel}); }, getPartyLevel: function(xp, size) { @@ -534,22 +533,22 @@ var Pathfinder = { segs = 0; } - var days, hours, half; - var dayLabel, hourLabel, halfLabel = (); + var days, hours, partial; + var dayLabel, hourLabel, partialLabel = (); /* Days */ - days = parseInt(segs / 48); - segs = segs - (days * 48); + days = parseInt(segs / 96); + segs = segs - (days * 96); /* Hours */ - hours = parseInt(segs / 2); - segs = segs - (hours * 2); + hours = parseInt(segs / 4); + segs = segs - (hours * 4); - half = parseInt(segs); + partial = parseInt(segs); if (days > 0) { dayLabel = ({days} Day{days > 1 ? 's' : ''}); @@ -559,11 +558,11 @@ var Pathfinder = { hourLabel = ({days > 0 ? ' ' + hours : hours} Hour{hours > 1 ? 's': ''}); } - if (half > 0) { - halfLabel = ({hours > 0 ? ' 30' : '30'} Mins); + if (partial > 0) { + partialLabel = ({hours > 0 ? ' ' + (partial * 15) : (partial * 15)} Mins); } - return ({dayLabel}{hourLabel}{halfLabel}); + return ({dayLabel}{hourLabel}{partialLabel}); }, getTravelDistance: function(source, dest) { @@ -576,14 +575,14 @@ var Pathfinder = { var days = parseInt(distance/maxMilesPerDay); var hours = parseInt((distance%maxMilesPerDay)/speed); - return (days * 48) + (hours * 2); + return (days * 96) + (hours * 4); }, getCarriageCost: function(distance) { //Rate @ 1gp per 1 hour var segs = this.getTravelTime(distance, 3); - return parseInt(segs/2); + return parseInt(segs/4); } };