@@ -384,13 +384,6 @@ var ItsATrap = (() => {
384
384
385
385
// Circle the trap's trigger area.
386
386
let circle = PathMath . createCircleData ( radius ) ;
387
- createObj ( 'path' , _ . extend ( circle , {
388
- layer : 'objects' ,
389
- left : x ,
390
- _pageid : pageId ,
391
- stroke_width : 10 ,
392
- top : y
393
- } ) ) ;
394
387
createObj ( 'path' , _ . extend ( circle , {
395
388
layer : 'objects' ,
396
389
left : x ,
@@ -463,14 +456,17 @@ var ItsATrap = (() => {
463
456
* bleeding-eye status.
464
457
*/
465
458
function revealTrap ( trap , force ) {
466
- if ( _getUserOption ( 'revealTrapsToMap' ) ) {
467
- trap . set ( 'layer' , 'map' ) ;
468
- toFront ( trap ) ;
469
- }
470
- else {
459
+ let effect = new TrapEffect ( trap ) ;
460
+
461
+ if ( effect . revealLayer === 'objects' ) {
471
462
trap . set ( 'layer' , 'objects' ) ;
472
463
toBack ( trap ) ;
473
464
}
465
+ else {
466
+ trap . set ( 'layer' , 'map' ) ;
467
+ toFront ( trap ) ;
468
+ }
469
+ sendPing ( trap . get ( 'left' ) , trap . get ( 'top' ) , trap . get ( '_pageid' ) ) ;
474
470
}
475
471
476
472
// Create macro for the remote activation command.
@@ -637,6 +633,22 @@ var TrapEffect = (() => {
637
633
return this . _effect . notes ;
638
634
}
639
635
636
+ /**
637
+ * The layer that the trap gets revealed to.
638
+ * @type {string }
639
+ */
640
+ get revealLayer ( ) {
641
+ return this . _effect . revealLayer ;
642
+ }
643
+
644
+ /**
645
+ * Whether the trap is revealed when it is spotted.
646
+ * @type {boolean }
647
+ */
648
+ get revealWhenSpotted ( ) {
649
+ return this . _effect . revealWhenSpotted ;
650
+ }
651
+
640
652
/**
641
653
* The name of a sound played when the trap is activated.
642
654
* @type {string }
@@ -1003,7 +1015,9 @@ var ItsATrapCreationWizard = (() => {
1003
1015
function _displayWizardProperties ( modificationCommand , properties ) {
1004
1016
let table = new HtmlBuilder ( 'table' ) ;
1005
1017
_ . each ( properties , prop => {
1006
- let row = table . append ( 'tr' ) ;
1018
+ let row = table . append ( 'tr' , undefined , {
1019
+ title : prop . desc
1020
+ } ) ;
1007
1021
1008
1022
// Construct the list of parameter prompts.
1009
1023
let params = [ ] ;
@@ -1164,6 +1178,13 @@ var ItsATrapCreationWizard = (() => {
1164
1178
value : trapEffect . revealWhenSpotted ? 'yes' : 'no' ,
1165
1179
options : [ 'yes' , 'no' ]
1166
1180
} ,
1181
+ {
1182
+ id : 'revealLayer' ,
1183
+ name : 'Reveal Layer' ,
1184
+ desc : 'When this trap is revealed, which layer is it revealed on?' ,
1185
+ value : trapEffect . revealLayer || 'map' ,
1186
+ options : [ 'map' , 'objects' ]
1187
+ } ,
1167
1188
{
1168
1189
id : 'searchDist' ,
1169
1190
name : 'Passive Search Distance' ,
@@ -1248,6 +1269,8 @@ var ItsATrapCreationWizard = (() => {
1248
1269
trapEffect . message = params [ 0 ] ;
1249
1270
if ( prop === 'notes' )
1250
1271
trapEffect . notes = params [ 0 ] ;
1272
+ if ( prop === 'revealLayer' )
1273
+ trapEffect . revealLayer = params [ 0 ] ;
1251
1274
if ( prop === 'revealToPlayers' )
1252
1275
trapToken . set ( 'status_bleeding-eye' , params [ 0 ] === 'yes' ) ;
1253
1276
if ( prop === 'revealWhenSpotted' )
@@ -1734,6 +1757,10 @@ var D20TrapTheme = (() => {
1734
1757
1735
1758
if ( effectResults . character ) {
1736
1759
1760
+ var row = content . append ( '.paddedRow' ) ;
1761
+ row . append ( 'span.bold' , 'Target:' ) ;
1762
+ row . append ( 'span' , effectResults . character . get ( 'name' ) ) ;
1763
+
1737
1764
// Add the attack roll message.
1738
1765
if ( effectResults . attack ) {
1739
1766
let rollResult = D20TrapTheme . htmlRollResult ( effectResults . roll , '1d20 + ' + effectResults . attack ) ;
@@ -1770,7 +1797,7 @@ var D20TrapTheme = (() => {
1770
1797
if ( effectResults . damage )
1771
1798
row . append ( 'span' , 'Damage: [[' + effectResults . damage + ']]' ) ;
1772
1799
else
1773
- row . append ( 'span' , effectResults . character . get ( 'name' ) + ' falls prey to the ' + effectResults . type + '\'s effects!' ) ;
1800
+ row . append ( 'span' , 'You fall prey to the ' + effectResults . type + '\'s effects!' ) ;
1774
1801
}
1775
1802
else {
1776
1803
let row = content . append ( '.paddedRow' ) ;
0 commit comments