File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ export interface Monster {
5151 traits ?: Trait [ ] ;
5252 spells ?: Spell [ ] ;
5353 actions ?: Trait [ ] ;
54+ bonus_actions ?: Trait [ ] ;
5455 legendary_actions ?: Trait [ ] ;
5556 reactions ?: Trait [ ] ;
5657 monster ?: string ;
@@ -74,10 +75,11 @@ export interface Monster {
7475export interface StatblockParameters
7576 extends Omit <
7677 Monster ,
77- "traits" | "actions" | "legendary_actions" | "reactions"
78+ "traits" | "actions" | "bonus_actions" | " legendary_actions" | "reactions"
7879 > {
7980 traits ?: { desc : string ; name : string } [ ] | [ string , string ] [ ] ;
8081 actions ?: Trait [ ] | [ string , string ] [ ] ;
82+ bonus_actions ?: Trait [ ] | [ string , string ] [ ] ;
8183 legendary_actions ?: Trait [ ] | [ string , string ] [ ] ;
8284 reactions ?: Trait [ ] | [ string , string ] [ ] ;
8385}
Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ actions:
7171legendary_actions:
7272 - [<legendary_actions-name>, <legendary_actions-description>]
7373 - ...
74+ bonus_actions:
75+ - [<trait-name>, <trait-description>]
76+ - ...
7477reactions:
7578 - [<reaction-name>, <reaction-description>]
7679 - ...
Original file line number Diff line number Diff line change @@ -593,6 +593,15 @@ return "";`
593593
594594 dice : true
595595 } ,
596+ {
597+ type : "traits" ,
598+ id : nanoid ( ) ,
599+ properties : [ "bonus_actions" ] ,
600+ heading : "Bonus Actions" ,
601+ conditioned : true ,
602+
603+ dice : true
604+ } ,
596605 {
597606 type : "traits" ,
598607 id : nanoid ( ) ,
Original file line number Diff line number Diff line change @@ -428,6 +428,10 @@ export default class StatBlockPlugin extends Plugin {
428428 monster . actions ?? [ ] ,
429429 params . actions ?? [ ]
430430 ) ;
431+ let bonus_actions = transformTraits (
432+ monster . bonus_actions ?? [ ] ,
433+ params . bonus_actions ?? [ ]
434+ ) ;
431435 let legendary_actions = transformTraits (
432436 monster . legendary_actions ?? [ ] ,
433437 params . legendary_actions ?? [ ]
@@ -440,6 +444,7 @@ export default class StatBlockPlugin extends Plugin {
440444 Object . assign ( params , {
441445 traits,
442446 actions,
447+ bonus_actions,
443448 reactions,
444449 legendary_actions
445450 } ) ;
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ class Parser {
8989 if ( monster . actions ) {
9090 monster . actions = transformTraits ( [ ] , monster . actions ) ;
9191 }
92+ if ( monster . bonus_actions ) {
93+ monster . bonus_actions = transformTraits ( [ ] , monster . bonus_actions ) ;
94+ }
9295 if ( monster . reactions ) {
9396 monster . reactions = transformTraits ( [ ] , monster . reactions ) ;
9497 }
You can’t perform that action at this time.
0 commit comments