-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsheet_single.dat
620 lines (523 loc) · 17.4 KB
/
sheet_single.dat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the definition of the first page of the standard character
sheet for output. The character sheet has been carved into a simple two-column
presentation that is used by many game systems, with some information on the
left and other material on the right. You can use whatever overall layout you
prefer, using this sample as a guideline.
A variety of display techniques have been used on this one character sheet to
provide examples of how to present information in different ways. You will
likely choose one or two of these methods and use them exclusively within your
own data files, but this gives you various styles to choose from.
The second page of the character sheet will be found in "sheet_standard2.dat".
-->
<document signature="Hero Lab Data">
<!-- Hero and Player Info
NOTE! These could be easily wrapped inside a template or used directly within
a layout, as we do here. Both methods are perfectly reasonable.
-->
<!-- oHeroNameSingle portal - name of the actor
style="outHeroNam"> -->
<portal
id="oHeroNameSingle"
style="outHeroNam">
<output_label>
<labeltext><![CDATA[
var txt as string
var role as string
var rolesumm as string
var assign as string
var division as string
var ismore as number
txt = ""
role = ""
rolesumm = ""
assign = ""
division = ""
txt = hero.findchild[Service].field[serRank].text
assign = hero.findchild[Service].field[serAssign].text
if (empty(txt) = 0) then
call GetDivisionColor
@text &= division
@text &= txt & " "
endif
if (empty(hero.actorname) <> 0) then
@text &= "- Unnamed Hero -"
else
@text &= hero.actorname
endif
ismore = 0
foreach pick in hero from CharRole
if (ismore <> 0) then
role &= " / "
rolesumm &= ". "
endif
role &= eachpick.field[name].text
rolesumm &= eachpick.field[summary].text
ismore = 1
nexteach
if (empty(role) <> 0) then
txt = ""
else
txt = role
endif
if (empty(assign) <> 0) then
txt = txt
else
if (empty(txt) <> 0) then
txt = assign
else
txt &= ", " & assign
endif
endif
if (empty(txt) = 0) then
@text &= "{br}{size 44}" & txt & "{revert}"
endif
]]></labeltext>
</output_label>
</portal>
<!-- oPersonalSingle portal
This is a table in which we output the personal details (background) of the
character. We use a table so we can put the info on the first page if there
is room and easily spill it onto the second page if not.
-->
<portal
id="oPersonalSingle"
style="outNormal">
<output_table
component="Personal"
showtemplate="oPersonal"
varyheight="yes">
<list><![CDATA[
!Helper.NoPersText & hero#source.ShowDetail
]]></list>
</output_table>
</portal>
<!-- oTraitsSingle portal - traits of the actor -->
<portal
id="oTraitsSingle"
style="outPlainLt">
<output_label>
<labeltext><![CDATA[
var temp as string
var division as string
var ismore as number
temp = ""
ismore = 0
foreach pick in hero from Trait
if (ismore <> 0) then
temp &= ", "
endif
temp &= eachpick.field[name].text
ismore = 1
nexteach
call GetDivisionColor
@text &= division
@text &= "{b}Traits: {/b}{text 000000}" & temp
]]></labeltext>
</output_label>
</portal>
<!-- oValuesSingle portal - values of the actor -->
<portal
id="oValuesSingle"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var temp as string
var division as string
var ismore as number
temp = ""
ismore = 0
foreach pick in hero from Value
temp &= "{br}" & chr(149) & " " & eachpick.field[name].text
nexteach
call GetDivisionColor
@text &= division
@text &= "{b}Values: {/b}{text 000000}" & temp
]]></labeltext>
</output_label>
</portal>
<!-- oFocusSingle portal - focuses of the actor -->
<portal
id="oFocusSingle"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var temp as string
var division as string
var ismore as number
temp = ""
division = ""
ismore = 0
foreach pick in hero from Focus
if (ismore <> 0) then
temp &= ", "
endif
temp &= eachpick.field[name].text
ismore = 1
nexteach
call GetDivisionColor
@text = division
@text &= "{b}Focuses: {/b}{text 000000}" & temp
]]></labeltext>
</output_label>
</portal>
<!-- oDetermination portal - Determination value of the actor -->
<portal
id="oDetermination"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var temp as string
var division as string
var ismore as number
temp = ""
ismore = 0
foreach pick in hero from Focus
if (ismore <> 0) then
temp &= ", "
endif
temp &= eachpick.field[name].text
ismore = 1
nexteach
call GetDivisionColor
@text &= division
@text &= "{b}Determination: {/b}{text 000000} {font Wingdings}{size 46}" & chr(168) & "{horz 3}" & chr(168) & "{horz 3}" & chr(168) & "{revert}"
]]></labeltext>
</output_label>
</portal>
<!-- oStress portal - Stress value of the actor -->
<portal
id="oStress"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var temp as string
var division as string
var stress as number
var i as number
temp = "{font Wingdings}{size 46}"
stress = #stressmax[]
for i = 1 to stress
temp &= "{horz 3}" & chr(168)
next
temp &= "{revert}"
call GetDivisionColor
@text &= division
@text &= "{b}Stress: {/b}{text 000000}" & temp
]]></labeltext>
</output_label>
</portal>
<!-- oGearSingle portal
This is a table of all Gear carried by the actor. The gear list needs to
exclude weapons and armor, since those are already listed in the separate
sections for those item types.
-->
<portal
id="oGearSingle"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var temp as string
var division as string
var ismore as number
temp = ""
ismore = 0
foreach pick in hero from Gear where "!(Print.NoPrint|Equipment.Natural)"
if (ismore <> 0) then
temp &= ", "
endif
temp &= eachpick.field[name].text
ismore = 1
nexteach
call GetDivisionColor
@text &= division
@text &= "{b}Equipment: {/b}{text 000000}{br}" & temp
]]></labeltext>
</output_label>
</portal>
<!-- oWeaponSingle portal
This is a table of all Weapons carried by the actor. Weapons use the same
template for both the contents and the header across the top. See the
template for more details on this.
-->
<portal
id="oArmorySingle"
style="outNormal">
<output_table
component="WeaponBase"
showtemplate="oWeapPickSingle"
showsortset="Armory"
varyheight="yes">
<list><![CDATA[
]]></list>
</output_table>
</portal>
<portal
id="oWeaponHeader"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var division as string
call GetDivisionColor
@text &= division
@text &= "{b}Attacks:{/b}{text 000000}"
]]></labeltext>
</output_label>
</portal>
<!-- oTalent portal
This is a table of all Talents for the actor.
-->
<portal
id="oTalentSingle"
style="outNormal">
<output_table
component="TalentBase"
showtemplate="oTalPickSingle"
showsortset="TalentSort"
varyheight="yes">
<list><![CDATA[
]]></list>
</output_table>
</portal>
<portal
id="oTalentHeader"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var division as string
call GetDivisionColor
@text &= division
@text &= "{b}Talents:{/b}{text 000000}"
]]></labeltext>
</output_label>
</portal>
<!-- oResistance portal - Resistance value of the actor -->
<portal
id="oResistance"
style="outLeft">
<output_label>
<labeltext><![CDATA[
var division as string
call GetDivisionColor
@text &= division
@text &= "{b}Resistance: {/b}{text 000000}" & #resistance[]
]]></labeltext>
</output_label>
</portal>
<!-- oTalPickSingle template
This template presents the Special Abilities, consisting of the prominent
name and the summary text in small letters next to it. We use a small margin
for vertical spacing between abilities.
-->
<template
id="oTalPickSingle"
name="Output Talents Table"
compset="TalentBase"
marginvert="2">
<portal
id="details"
style="outLeft">
<output_label
ismultiline="yes">
<labeltext><![CDATA[
var division as string
call GetDivisionColor
@text &= division
@text &= "{b}" & field[name].text
if (tagis[TalentCat.Role] <> 0) then
@text &= " [Role]"
endif
@text &= ":{/b}{text 000000} " & field[talSummary].text
]]></labeltext>
</output_label>
</portal>
<position><![CDATA[
~our details width spans the entire template width
portal[details].width = width
~limit our portal height to a single line of output
~ portal[details].lineheight = 1
perform portal[details].autoheight
~our height is the height of our portal
height = portal[details].bottom
]]></position>
</template>
<!-- oGearPick template
This template presents the basic gear possessed. Gear that is in quantities
other than one has the proper quantity listed next to it. We use a small
horizontal margin to indent everything slightly.
-->
<template
id="oWeapPickSingle"
name="Single Page Output Weapon Table"
compset="Weapon"
marginhorz="25">
<portal
id="bullet"
style="outPlain">
<output_label>
<labeltext><![CDATA[
@text = chr(149)
]]></labeltext>
</output_label>
</portal>
<portal
id="summary"
style="outPlainLt">
<output_label
ismultiline="yes">
<labeltext><![CDATA[
@text = field[wpDamageSummaryOS].text
]]></labeltext>
</output_label>
</portal>
<position><![CDATA[
~our height is the height of the tallest portal
height = portal[summary].height
doneif (issizing <> 0)
~assign a fixed width to the bullet and position the summary to the right
portal[bullet].width = 10
perform portal[summary].alignrel[ltor,bullet,20]
~size the name to fit the available space
portal[summary].width = width - portal[summary].left
portal[summary].top = portal[bullet].top
~perform portal[summary].sizetofit[36]
perform portal[summary].autoheight
~our height is the height of our portal
height = portal[summary].bottom
~center all portals vertically
~perform portal[bullet].centervert
~perform portal[summary].centervert
]]></position>
</template>
<!-- oLeftSideSingle layout
This layout is rendered down the left side of the sheet and contains the
name and description details for the character, as well as the table of
table of attributes, table of health/powers, and table of derived traits.
<portalref portal="oHeroInfo"/>
<portalref portal="oDerived"/>
-->
<layout
id="oLeftSideSingle">
<portalref portal="oHeroNameSingle"/>
<portalref portal="oPersonalSingle"/>
<portalref portal="oTraitsSingle"/>
<portalref portal="oValuesSingle"/>
<portalref portal="oAttribute"/>
<portalref portal="oDiscip"/>
<portalref portal="oFocusSingle"/>
<portalref portal="oTalentHeader"/>
<portalref portal="oTalentSingle"/>
<position><![CDATA[
~position the hero name at the top with the hero details beneath the name
perform portal[oHeroNameSingle].autoplace[0]
perform portal[oPersonalSingle].autoplace[10]
perform portal[oTraitsSingle].autoplace[10]
perform portal[oValuesSingle].autoplace[10]
~position the tables next
perform portal[oAttribute].autoplace[10]
perform portal[oDiscip].autoplace[10]
perform portal[oFocusSingle].autoplace[10]
perform portal[oTalentHeader].autoplace[20]
perform portal[oTalentSingle].autoplace[5]
~our layout height is the extent of the elements within
height = autoextent
]]></position>
</layout>
<!-- oRightSideSingle layout
This layout is rendered down the right side of the sheet and contains the
character portrait, table of special abilities, table of skills, and table
of gear. As much gear as will fit is output, with any excess being truncated
on this sheet and being included on the spillover sheet.
-->
<layout
id="oRightSideSingle">
<portalref portal="oDetermination"/>
<portalref portal="oStress"/>
<portalref portal="oResistance"/>
<portalref portal="oWeaponHeader"/>
<portalref portal="oArmorySingle"/>
<portalref portal="oGearSingle"/>
<portalref portal="oPersonal"/>
<templateref template="oPortrait" thing="actor"/>
<position><![CDATA[
~position the character portrait at the top and the various tables beneath
perform template[oPortrait].autoplace
perform portal[oDetermination].autoplace
perform portal[oStress].autoplace
perform portal[oResistance].autoplace
perform portal[oWeaponHeader].autoplace
perform portal[oArmorySingle].autoplace
perform portal[oGearSingle].autoplace
perform portal[oPersonal].autoplace
~our layout height is the extent of the elements within
height = autoextent
]]></position>
</layout>
<!-- singlepage sheet
This is the first page of the stanard character sheet, which coordinates the
output of a whole bunch of layouts containing different pieces of information
for the character. Layouts are estimated to perform whatever calculations are
necessary within that layout, such as its overall dimensions. Once estimated,
the dimensions of the layout can be used to properly position and size any
subsequent layouts that depend on it. So the overall process is to process
layouts in an order that progressively fills the sheet with aligned material.
-->
<sheet
id="singlepage"
name="1-Page character sheet">
<layoutref layout="oLogos"/>
<layoutref layout="oLeftSideSingle"/>
<layoutref layout="oRightSideSingle"/>
<layoutref layout="oAdjust"/>
<layoutref layout="oValidate"/>
<position><![CDATA[
~set this global variable to 1 if you want the logos to be stacked; a value
~of zero places them side-by-side
scenevalue[stacklogos] = 1
~setup the gap to be used between the various sections of the character sheet
autogap = 20
scenevalue[sectiongap] = autogap
~calculate the width of the two columns of the character sheet, leaving a
~suitable center gap between them
var colwidth as number
colwidth = (width - 50) / 2
~if the user wants to omit the validation report, the hide it and allow the
~rest of the sheet to fill that space; otherwise, output the layout and the
~top of the validation report establishes the bottom for all other output
var extent as number
if (hero.tagis[source.Validation] = 0) then
layout[oValidate].visible = 0
extent = height
else
layout[oValidate].width = width
perform layout[oValidate].render
layout[oValidate].top = height - layout[oValidate].height
extent = layout[oValidate].top - autogap
endif
~position the leftside layout in the upper left corner
layout[oLeftSideSingle].width = colwidth
layout[oLeftSideSingle].height = extent - layout[oLeftSideSingle].top
perform layout[oLeftSideSingle].render
~position the activated adjustments at the bottom on the left; this will
~establish the remaining space available on the left for armor and weapons
layout[oAdjust].width = colwidth
perform layout[oAdjust].render
layout[oAdjust].top = extent - layout[oAdjust].height
~position the armory layout within the remaining space on the left
~layout[oArmory].width = colwidth
~layout[oArmory].top = layout[oLeftSideSingle].bottom + autogap
~layout[oArmory].height = layout[oAdjust].top - autogap - layout[oArmory].top
~perform layout[oArmory].render
~position the logos layout in the upper right corner
layout[oLogos].width = colwidth
perform layout[oLogos].render
layout[oLogos].left = width - colwidth
~position the rightside layout in the remaining space on the right
layout[oRightSideSingle].width = colwidth
layout[oRightSideSingle].top = layout[oLogos].bottom + autogap
layout[oRightSideSingle].left = layout[oLogos].left
layout[oRightSideSingle].height = extent - layout[oRightSideSingle].top
perform layout[oRightSideSingle].render
]]></position>
</sheet>
</document>