-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocedures.dat
1007 lines (834 loc) · 33.1 KB
/
procedures.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
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the definitions of assorted procedures that are used
throughout the data files. Since procedures are typically called from multiple
places, it usually makes sense to put them all in one central location where
you can always find them instead of having them littered throughout the data
files and hard to locate when you need to refer to them.
-->
<document signature="Hero Lab Data">
<!-- ##################
The following procedures are generic and used in various places
##################
-->
<!-- Procedure Money
Format monetary values for appropriate display. The value to be formatted
is passed in via the "moneyvalue" variable. The formatted string is returned
in the "money" variable. If the money is an integral value, no decimals
are appended. Otherwise, the value is rounded to two decimals and output
with two decimals, so "$1.5" actually looks like "$1.50".
Outbound parameter: money
Inbound parameter: rngReduce, rngIncrease, rngTag
-->
<procedure id="AdjustRange" scripttype="none"><![CDATA[
~declare variables that are used to communicate with our caller
var rngChange as number
var rngTag as string
doneif (rngChange = 0)
if (rngChange < 0) then
if (compare(rngTag,"Range.Extreme") = 0) then
rngTag = "Range.Long"
elseif (compare(rngTag,"Range.Long") = 0) then
rngTag = "Range.Medium"
else
rngTag = "Range.Close"
endif
rngChange += 1
elseif (rngChange > 0) then
if (compare(rngTag,"Range.Close") = 0) then
rngTag = "Range.Medium"
elseif (compare(rngTag,"Range.Medium") = 0) then
rngTag = "Range.Long"
else
rngTag = "Range.Extreme"
endif
rngChange -= 1
endif
]]></procedure>
<procedure id="CalcLevel" scripttype="none"><![CDATA[
~declare variables that are used to communicate with our caller
var curMax as number
var curLevel as number
var curXP as number
var lvlDiff as number
curXP = #resmax[resXP]
if (curXP < 100) then
curMax = 1
elseif (curXP < 300) then
curMax = 2
elseif (curXP < 600) then
curMax = 3
elseif (curXP < 1000) then
curMax = 4
elseif (curXP < 1500) then
curMax = 5
elseif (curXP < 2100) then
curMax = 6
elseif (curXP < 2800) then
curMax = 7
elseif (curXP < 3600) then
curMax = 8
elseif (curXP < 4500) then
curMax = 9
elseif (curXP < 5500) then
curMax = 10
elseif (curXP < 6600) then
curMax = 11
elseif (curXP < 7800) then
curMax = 12
elseif (curXP < 9100) then
curMax = 13
elseif (curXP < 10500) then
curMax = 14
elseif (curXP < 12000) then
curMax = 15
elseif (curXP < 13600) then
curMax = 16
elseif (curXP < 15300) then
curMax = 17
elseif (curXP < 17100) then
curMax = 18
elseif (curXP < 19000) then
curMax = 19
elseif (curXP < 21000) then
curMax = 20
elseif (curXP < 23100) then
curMax = 21
elseif (curXP < 25300) then
curMax = 22
endif
lvlDiff = curMax - curLevel
#resmax[resPerks] += lvlDiff
#resmax[resSkill] += lvlDiff
#traitbonus[trHealth] += lvlDiff
]]></procedure>
<!-- Procedure Money
Format monetary values for appropriate display. The value to be formatted
is passed in via the "moneyvalue" variable. The formatted string is returned
in the "money" variable. If the money is an integral value, no decimals
are appended. Otherwise, the value is rounded to two decimals and output
with two decimals, so "$1.5" actually looks like "$1.50".
Outbound parameter: money
Inbound parameter: moneyvalue
-->
<procedure id="Money" scripttype="none"><![CDATA[
~declare variables that are used to communicate with our caller
var moneyvalue as number
var money as string
~invoke the MoneyBare procedure to format the value
call MoneyBare
~prepend a "$" on the value
money = "$" & money
]]></procedure>
<!-- Procedure MoneyBare
Handles the formatting of the money value without prepending the currency
symbol, which is useful in situations where you just want the raw value.
Outbound parameter: money
Inbound parameter: moneyvalue
-->
<procedure id="MoneyBare" scripttype="none"><![CDATA[
~declare variables that are used to communicate with our caller
var moneyvalue as number
var money as string
~format the value properly for display as currency
if (moneyvalue = int(moneyvalue)) then
money = moneyvalue
else
money = decimals(moneyvalue,2)
endif
]]></procedure>
<!-- ##################
The following procedures are used in conjuction with description and mouse-info scripts
##################
-->
<!-- Procedure Prereqs
Generate a list of all failed pre-requisites for the pick/thing that is the
current script context, with one failed prereq to a line. We do this for use
within all "info" scripts, so we cannot use any special symbols. Instead, we
put the results into the "prereqs" text variable that the caller must also
declare, allowing the caller to extract the results synthesized below. The
caller can also specify that we always check our prereqs against the hero
instead of the pick/thing's container, which is done by setting the
"use_hero" variable to a non-zero value.
Outbound parameter: prereqs
Inbound parameter: use_hero
-->
<procedure id="Prereqs" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var prereqs as string
var use_hero as number
~declare variables that are used internally
var v_req_text as string
var v_reqnum as number
var v_req as string
var v_i as number
var v_is_first as number
var v_result as number
~get the number of prereqs for the pick/thing and reset the text to empty
v_reqnum = prereqnum - 1
prereqs = ""
~if we're building all the description text for use on the server, we
~should never include any pre-reqs
doneif (state.isfixedtxt <> 0)
~iterate through all of our prereqs and append any that aren't satisfied
for v_i = 0 to v_reqnum
~get the message for the next prereq
if (use_hero <> 0) then
v_req = prereqmsg[v_i,hero]
else
v_req = prereqmsg[v_i]
endif
~if the message is non-empty, it's been failed, so append it
prereqs = splice(prereqs,v_req,"{br}")
next
~if we have any failed prerequisites, wrap them in red to highlight them
if (v_is_first = 0) then
prereqs = "{text clrwarning}" & prereqs & "{text clrreset}{br}{br}"
endif
]]></procedure>
<!-- Procedure MouseInfo
Generate full details for the pick/thing that is the current script context.
The details include the name and are intended for use within a mouseinfo
script. As with the "Prereqs" script above, we want this procedure to work
from any "info" script, so we cannot use special symbols. The results are
synthesized into a variable named "mouseinfo" that the caller must also
declare, allowing the caller to access the results upon return. The caller
can request the inclusion of failed prereqs in the details by setting the
"isprereq" variable to non-zero. Failed prereqs are typically only included
for things but can be included for picks.
Outbound parameter: mouseinfo
Inbound parameter: isprereq
-->
<procedure id="MouseInfo" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var mouseinfo as string
~declare variables that are used internally
var v_name as string
~get the item name; if this is a pick, amend the name with our gear quantity
v_name = field[name].text
if (ispick <> 0) then
~if this is gear with a quantity of more than one, append it to the name
if (isgear <> 0) then
if (stackable <> 0) then
if (field[stackQty].value > 1) then
v_name &= " (x" & field[stackQty].text & ")"
endif
endif
endif
endif
~start our info text with the centered name and switch to left-justified text
mouseinfo = "{b}" & v_name & "{/b}{br}{br}{align left}"
~get the rest of the details for the item using the normal description procedure;
~we call another procedure, so we must declare the variables it uses to pass in
~our state and return the synthesized text, then pull the results out of the
~variable for our use
var descript as string
call Descript
mouseinfo &= descript
]]></procedure>
<!-- Procedure Descript
Generate full details for the pick/thing that is the current script context.
The details exclude the name and are intended for use within a description
script. As with the "Prereqs" script above, we want this procedure to work
from any "info" script, so we cannot use special symbols. The results are
synthesized into a variable named "descript" that the caller must also
declare, allowing the caller to access the results upon return. The caller
can request the inclusion of failed prereqs in the details by setting the
"isprereq" variable to non-zero. Failed prereqs are typically only included
for things but can be included for picks.
Outbound parameter: descript
Inbound parameter: isprereq
-->
<procedure id="Descript" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var descript as string
var isprereq as number
~declare variables that are used by called procedures
var iteminfo as string
~if this is a show-only thing, just output any description text and we're done
if (tagis[thing.showonly] <> 0) then
descript = splicedesc
done
endif
~we start our details text with nothing
descript = ""
~if requested or renderend for a thing, append any failed prereq details
if (isprereq + !ispick <> 0) then
var prereqs as string
call Prereqs
descript &= prereqs
endif
~based on the nature of the item, synthesize the appropriate details that are
~specific to the particular item type
iteminfo = ""
if (tagis[component.Perk] <> 0) then
call InfoPerk
elseif (tagis[component.WeapRange] <> 0) then
call InfoRange
elseif (tagis[component.WeapMelee] <> 0) then
call InfoMelee
elseif (tagis[component.Defense] <> 0) then
call InfoDef
elseif (tagis[component.Advance] <> 0) then
call InfoAdv
elseif (tagis[component.GearMod] <> 0) then
call InfoGearMods
endif
~if this is a piece of gear, append proper info to the item-specific details
if (tagis[component.Gear] <> 0) then
~if this is a thing, append the cost
if (ispick = 0) then
iteminfo &= "Cost: " & splicetext[both, grcost, field[grCost].text] & "{br}"
else
iteminfo &= "Value: " & splicetext[both, grcost, field[grCost].text] & "{br}"
endif
~append the item's weight
iteminfo &= "Weight: "
if (field[gearWeight].value > 0) then
iteminfo &= field[gearWeight].text
~ & " each"
else
iteminfo &= chr(150)
endif
iteminfo &= "{br}"
~append the item's rarity
iteminfo &= "Rarity: " & field[grRarity].text & "{br}"
if (isgizmo <> 0) then
if (ispick <> 0) then
call InfoMods
endif
endif
endif
~append our item-specific info to the synthesized details text
descript &= iteminfo
~append the description of the item
if (empty(iteminfo) = 0) then
descript &= "{br}"
endif
if (field[descript].isempty <> 0) then
descript &= chr(150) & " no description " & chr(150)
else
descript &= splicedesc
endif
~if this is gear, output any container/containee details
if (isgear <> 0) then
~if we're held somewhere, append our path
if (isgearheld <> 0) then
descript &= "{br}{br}{b}Container{/b}: " & gearpath["->"]
endif
~if we're a gear holder, append our contents
if (isgearlist <> 0) then
iteminfo = gearlist[", ", TRUE]
if (empty(iteminfo) <> 0) then
iteminfo = "None"
endif
descript &= "{br}{br}{b}Carries{/b}: " & iteminfo
endif
endif
]]></procedure>
<!-- Procedure InfoWeapon
Generate details specific to all weapons. The text is placed into the
"iteminfo" variable for subsequent use by our caller.
Outbound parameter: iteminfo
-->
<procedure id="InfoWeapon" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~report the weapon bonus (omitting if there is none)
iteminfo = ""
if (tagis[AmmoType.?] <> 0) then
iteminfo &= "{b}Ammunition: {/b}" & tagnames[AmmoType.?,", "]
iteminfo &= "{br}{br}"
endif
~report the Weapon Type of the weapon
iteminfo &= "Weapon Type: " & tagnames[WeaponType.?,","] & "{br}"
if (field[wpBonus].value <> 0) then
iteminfo &= "Weapon Bonus/Penalty: "
iteminfo &= splicetext[details, wpbonus, signed(field[wpBonus].text)] & "{br}"
endif
~report the net attack rating of the weapon
iteminfo &= "Net Attack: " & field[wpNetAtk].text & "{br}"
~report the damage rating of the weapon
iteminfo &= "Damage Rating: " & field[wpDamage].text & "{br}"
~report the net attack rating of the weapon
iteminfo &= "Damage Effects: "
if (field[wpEffects].isempty = 0) then
iteminfo &= field[wpEffects].text
else
iteminfo &= chr(150)
endif
iteminfo &= "{br}"
~report the net attack rating of the weapon
iteminfo &= "Damage Type: " & tagnames[DamageType.?,","] & "{br}"
~report the net attack rating of the weapon
iteminfo &= "Fire Rate: " & field[wpFireRate].text & "{br}"
~ the minimum strength requirement (omitting if there is none)
if (field[wpStrReq].value > 0) then
iteminfo &= "Minimum Strength: " & field[wpStrReq].text & "{br}"
endif
]]></procedure>
<!-- Procedure InfoWeapSp
Generate special abilities specific to all weapons. This is separate from
the "InfoWeapon" procedure so that it can always be performed last. The
text is placed into the "iteminfo" variable for subsequent use by our caller.
Outbound parameter: iteminfo
-->
<procedure id="InfoWeapSp" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~report the net attack rating of the weapon
iteminfo &= "Qualities: "
if (field[wpQualities].isempty = 0) then
iteminfo &= field[wpQualities].text
else
iteminfo &= chr(150)
endif
iteminfo &= "{br}"
~report any special details about the weapon (omitting if there are none)
var special as string
special = tagnames[Weapon.?,", "]
special = splice(special,field[wpSpecial].text,", ")
if (empty(special) = 0) then
iteminfo &= "Special: " & special & "{br}"
endif
]]></procedure>
<!-- Procedure InfoMelee
Generate details specific to a melee weapon. The text is placed into the
"iteminfo" variable for subsequent use by our caller.
Outbound parameter: iteminfo
-->
<procedure id="InfoMelee" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~start with generic details for all weapons
call InfoWeapon
~finish with generic special abilities for all weapons
call InfoWeapSp
]]></procedure>
<!-- Procedure InfoRange
Generate details specific to a ranged weapon. The text is placed into the
"iteminfo" variable for subsequent use by our caller.
Outbound parameter: iteminfo
-->
<procedure id="InfoRange" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~start with generic details for all weapons
call InfoWeapon
~add the range details for the weapon
iteminfo &= "Range: " & field[wpRange].text & "{br}"
~finish with generic special abilities for all weapons
call InfoWeapSp
]]></procedure>
<!-- Procedure InfoDef
Generate details specific to defensive gear, including armor and shields.
The text is placed into the "iteminfo" variable for subsequent use by our
caller.
Outbound parameter: iteminfo
-->
<procedure id="InfoDef" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~add the defense rating
iteminfo &= "Defense: " & field[defPhysical].text & "{br}"
~report the minimum strength requirement (omitting if there is none)
if (field[defStrReq].value > 0) then
iteminfo &= "Minimum Strength: " & field[defStrReq].text & "{br}"
endif
]]></procedure>
<!-- Procedure InfoAdv
Generate details specific to advances. The text is placed into the
"iteminfo" variable for subsequent use by our caller.
Outbound parameter: iteminfo
-->
<procedure id="InfoAdv" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~if we don't have a valid pick to operate upon, just get out, else we get errors
doneif (ispick = 0)
~add any user notes
if (gizmo.child[advDetails].field[advNotes].isempty = 0) then
iteminfo &= "User Notes: " & gizmo.child[advDetails].field[advNotes].text & "{br}"
endif
]]></procedure>
<!-- Procedure InfoHeld
Retrieve a summary of what container this gear is currently held within.
Used for mouse-info scripts with equipment, with the generated text being
assigned to the @text special symbol for the script.
-->
<procedure id="InfoHeld" scripttype="mouseinfo"><![CDATA[
@text = "Held by: " & gearholder.field[name].text
]]></procedure>
<!-- Procedure InfoHolder
Retrieve a summary of what equipment is held within this gear container.
Used for mouse-info scripts with equipment, with the generated text being
assigned to the @text special symbol for the script.
-->
<procedure id="InfoHolder" scripttype="mouseinfo"><![CDATA[
var gear as string
gear = gearlist["; ", TRUE]
if (empty(gear) <> 0) then
gear = "Empty"
endif
@text = "{align left}This item is a container.{br}{br}Contents: " & gear
]]></procedure>
<procedure id="InfoPerk" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~report any special details about the weapon (omitting if there are none)
iteminfo &= "Ranks: " & field[prkMaxRank].value & "{br}"
]]></procedure>
<procedure id="InfoGearMods" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var iteminfo as string
~report any special details about the weapon (omitting if there are none)
iteminfo &= "Weight: " & signed(field[modWeight].value) & "{br}"
iteminfo &= "Cost: " & signed(field[modCost].value) & "{br}"
]]></procedure>
<procedure id="InfoMods" context="info"><![CDATA[
~ we are only called if there is a gizmo on the item.
~ declare variables that are used to communicate with our caller
var iteminfo as string
var modinfo as string
var ismore as number
ismore = 0
foreach pick in gizmo from GearMod
if (ismore <> 0) then
modinfo &= "; "
endif
modinfo &= eachpick.field[name].text
ismore = 1
nexteach
if (empty(modinfo) = 0) then
iteminfo &= "{br}" & "Mods: " & modinfo & "{br}"
endif
]]></procedure>
<!-- ##################
The folowing procedures are used with transactions for buying and selling items
##################
-->
<!-- Procedure XactSetup
Perform setup of the transaction fields when the user is purchasing an item.
-->
<procedure id="XactSetup" scripttype="xactsetup"><![CDATA[
~start by assuming our unit cost is the cost of one item
~Note: If this is the purchase of a thing and we have a non-zero lot cost, we
~ need to calculate the unit cost appropriately.
var cost as number
if (@isbuy = 0) then
cost = field[grCost].value
elseif (field[grLotCost].value <> 0) then
cost = field[grLotCost].value / field[lotsize].value
else
cost = field[grCost].value
endif
~setup the unit cost for the item
hero.transact.field[xactEach].value = cost
~zero out the cash amount to be paid (implying use of the standard cost)
hero.transact.field[xactCash].value = 0
~if the item is gear, setup whether the item holds other gear
if (isgear <> 0) then
hero.transact.field[xactHolder].value = gearcount
endif
]]></procedure>
<!-- Procedure XactBuy
Purchase an item for cash from the character's resources.
-->
<procedure id="XactBuy" scripttype="xactbuy"><![CDATA[
~if we're buying for free, no cash should be touched, so get out
doneif (hero.transact.field[xactIsFree].value <> 0)
~get the cash amount specified by the user
var cash as number
cash = hero.transact.field[xactCash].value
~if no cash amount was given, get the standard total cost for the purchase
if (cash = 0) then
cash = hero.transact.field[xactQty].value * hero.transact.field[xactEach].value
endif
~if we don't have enough cash to make the purchase, reject the transaction
if (cash > herofield[acCashNet].value) then
@reject = "You lack sufficient cash to purchase the item."
done
endif
~subtract the amount from the current pool of cash
perform hero.usagepool[TotalCash].adjust[-cash]
]]></procedure>
<!-- Procedure XactSell
Sell an item for cash that gets added to the character's resources.
-->
<procedure id="XactSell" scripttype="xactsell"><![CDATA[
~get the cash amount specified by the user
var cash as number
cash = hero.transact.field[xactCash].value
~add the amount to the current pool of cash
perform hero.usagepool[TotalCash].adjust[cash]
]]></procedure>
<!-- ##################
The following procedures are used by the Dashboard and Tactical Console panels
##################
-->
<!-- Procedure DshName
Synthesize the actor name for display in the Dashboard/TacCon. As this is
specified as a "label" script, the script can access special symbols for the
script type and we can avoid using a variable to return the results. Instead,
we can write the name directly into the "@text" special symbol for the
script. The caller can disable the automatic color highlighting of the name
by setting the "isnocolor" variable. By default, the actor name is colored
based on whether it is the active actor.
Inbound parameter: isnocolor
-->
<procedure id="DshName" scripttype="label"><![CDATA[
var isnocolor as number
~unless disabled, if this hero is active or a minion, change the color
if (isnocolor = 0) then
if (hero.isactive <> 0) then
@text &= "{text clractive}"
elseif (hero.isminion <> 0) then
@text &= "{text clrauto}"
endif
endif
~start with the hero name
if (empty(hero.actorname) <> 0) then
if (hero.isminion <> 0) then
@text &= "Unnamed"
else
@text &= "Unnamed Character"
endif
else
@text &= hero.actorname
endif
~if this is a minion, append the master's name
if (hero.isminion <> 0) then
var mastername as string
if (empty(hero.master.actorname) <> 0) then
if (hero.master.isminion <> 0) then
mastername = "Unnamed"
else
mastername = "Unnamed Character"
endif
else
mastername = hero.master.actorname
endif
@text &= " (" & mastername & ")"
endif
~if we have minion text, show it after the name unless it's the same as the hero name
if (hero.isminion <> 0) then
var result as number
result = compare(hero.actorname,hero.miniontext)
if (result <> 0) then
@text &= " {text clrdisable}(" & hero.miniontext & "){text clrreset}"
endif
endif
]]></procedure>
<!-- Procedure DshGear
Synthesize the actor's full gear info for display in the Dashboard/TacCon.
The generated text is placed directly into the "@text" special symbol for
the "mouseinfo" script, so all the caller needs to do is invoke the script
and be done.
-->
<procedure id="DshGear" scripttype="mouseinfo"><![CDATA[
@text = "{align left}Click to transfer gear from this character to the active character.{br}{br}"
var gear as string
gear = hero.geartree[!Helper.NoMove]
if (empty(gear) <> 0) then
@text &= "Gear: No transferable gear possessed"
else
@text &= "Gear List:{br}" & gear
endif
]]></procedure>
<!-- Procedure DshSpecial
Synthesize a report of the actor's various special abilities for display in
the Dashboard/TacCon. The generated text is placed directly into the "@text"
special symbol for the "mouseinfo" script, so all the caller needs to do is
invoke the script and be done.
-->
<procedure id="DshSpecial" scripttype="mouseinfo"><![CDATA[
var final as string
var name as string
var source as string
~output all items designated for inclusion
foreach pick in hero where "DashTacCon.Special" sortas SpecInfo
if (eachpick.field[spcName].isempty = 0) then
name = eachpick.field[spcName].text
else
name = eachpick.field[name].text
endif
source = eachpick.tagnames[SpecialTab.?,","]
if (length(source) = 0) then
source = "????"
endif
final &= source & ": {b}" & name & "{/b}{br}"
nexteach
~if we have no special abilities, output something appropriate
if (empty(final) <> 0) then
final = "- No Special Abilities -"
endif
@text = "{align left}" & final
]]></procedure>
<!-- Procedure DshRolls
Synthesize a report of the pertinent rolls for display in the Dashboard/TacCon.
The generated text is placed directly into the "@text" special symbol for the
"mouseinfo" script, so all the caller needs to do is invoke the script and be
done.
-->
<procedure id="DshRolls" scripttype="mouseinfo"><![CDATA[
var final as string
var roll as string
foreach pick in hero where "DashTacCon.Rolls"
if (eachpick.tagis[component.Skill] <> 0) then
roll = eachpick.field[sklRoll].text & "{text clrsecond} (" & eachpick.field[trtFinal].text & " + " & eachpick.linkage[attribute].field[name].text & " " & eachpick.linkage[attribute].field[trtFinal].text & "){text clrreset}"
else
roll = "????"
endif
final &= eachpick.field[name].text & " {b}" & roll & "{/b}{br}"
nexteach
@text = "{align left}" & final
]]></procedure>
<!-- Procedure DshCombat
Synthesize a report of the various combat details (e.g. weapons and armor)
for display in the Dashboard/TacCon. The generated text is placed directly
into the "@text" special symbol for the "mouseinfo" script, so all the
caller needs to do is invoke the script and be done.
-->
<procedure id="DshCombat" scripttype="mouseinfo"><![CDATA[
var ismore as number
var final as string
var info as string
~output basic combat information
foreach pick in hero where "DashTacCon.Combat" sortas explicit
info = eachpick.field[name].text & " {b}" & eachpick.field[trtFinal].text & "{/b}"
final = splice(final,info,", ")
nexteach
final &= "{br}{br}"
~output equipped armor and shield
info = ""
foreach pick in hero from Armor
if (eachpick.field[grIsEquip].value <> 0) then
info &= eachpick.field[name].text & " {b}" & eachpick.field[defPhysical].text & "{/b}{br}"
endif
nexteach
if (empty(info) <> 0) then
info = "-No Armor Equipped-{br}"
endif
final &= info
info = ""
foreach pick in hero from Shield
if (eachpick.field[grIsEquip].value <> 0) then
info &= eachpick.field[name].text & " {b}" & eachpick.field[defPhysical].text & "{/b}{br}"
endif
nexteach
if (empty(info) <> 0) then
info = "-No Shield Equipped-{br}"
endif
final &= info & "{br}"
~output all weapons, with equipped ones first
info = ""
foreach pick in hero from WeaponBase sortas Armory
info &= eachpick.field[name].text & " {b}" & eachpick.field[wpNetAtk].text & " {/b}{text clrsecond}@{text clrreset}" & eachpick.field[wpDamage].text & "{br}"
nexteach
if (empty(info) <> 0) then
info = "-No Weapons-{br}"
endif
final &= info
@text = "{align left}" & final
]]></procedure>
<!-- Procedure DshBasics
Synthesize a report of the various character basic details for display in
the Dashboard/TacCon. The generated text is placed directly into the "@text"
special symbol for the "mouseinfo" script, so all the caller needs to do is
invoke the script and be done.
-->
<procedure id="DshBasics" scripttype="mouseinfo"><![CDATA[
var final as string
var info as string
~output our race
info = hero.findchild[Species].field[name].text
if (empty(info) <> 0) then
info = "-none-"
endif
final = "Species: {b}" & info & "{/b}{br}{br}"
~output our power point pool
perform hero.child[trPowerPts].setfocus
final &= "Power Points: {b}" & focus.field[trtFinal].text & " / " & focus.field[trtMaximum].text & "{/b}{br}{br}"
~output our resistance traits
foreach pick in hero where "User.Resistance"
final &= eachpick.field[name].text & ": {b}" & eachpick.field[trtFinal].text & "{/b}{br}"
nexteach
final &= "{br}"
~output attributes
foreach pick in hero from Attribute
final &= eachpick.field[name].text & ": {b}" & eachpick.field[trtFinal].text & "{/b}{br}"
nexteach
~output any permanent adjustments
info = ""
foreach pick in hero where "InPlay.Permanent"
info &= eachpick.field[adjName].text & "{br}"
nexteach
if (empty(info) = 0) then
info = "{br}{b}Permanent Adjustments:{/b}{br}" & info
endif
final &= info
~return the final text
@text = "{align left}" & final
]]></procedure>
<!-- Procedure DshActive
Synthesize a report of the character's activated abilities for display in
the Dashboard/TacCon. The generated text is placed directly into the "@text"
special symbol for the "mouseinfo" script, so all the caller needs to do is
invoke the script and be done.
-->
<procedure id="DshActive" scripttype="mouseinfo"><![CDATA[
~if there are no activated abilities for the character, report that fact
if (hero.tagis[Activated.?] = 0) then
if (herofield[tactNotes].isempty <> 0) then
@text = "No abilities are active."
done
endif
endif
~output all activated abilities and conditions for the character (if any)
var final as string
if (hero.tagis[Activated.?] <> 0) then
final = "{b}Activated Abilities:{/b}"
foreach pick in hero where "(Adjustment.? | Helper.Activated) & !InPlay.Permanent"
final &= "{br}"
if (eachpick.tagis[Adjustment.?] <> 0) then
final &= eachpick.field[adjName].text
else
final &= eachpick.field[name].text
endif
nexteach
endif
~append any tactical console notes at the end
if (herofield[tactNotes].isempty = 0) then
if (empty(final) = 0) then
final &= "{br}{br}"
endif
final &= "{b}Tactical Notes:{/b}{br}" & herofield[tactNotes].text
endif
@text = "{align left}" & final
]]></procedure>
<!-- ##################
The following procedures are used in conjunction with printed output
##################
-->
<!-- Procedure JrnInfo
Synthesize a journal entry for detailed output. The generated text is
placed in the "infotext" variable. If special spacing needs to be inserted
between sections of the output, the caller can dictate that via the
"spacing" variable.
Inbound parameter: spacing
Outbound parameter: infotext
-->
<procedure id="JrnInfo" context="info"><![CDATA[
~declare variables that are used to communicate with our caller
var spacing as string
var infotext as string
~start with left-aligned text and append the date and award details
infotext = "{align left}"
if (field[jrnGame].value <> 0) then
infotext = infotext & "{b}Date (game world){/b}: " & field[jrnGame].datetime[gamedate,"/"] & "{br}"
endif
infotext = infotext & "{b}Date (real world){/b}: " & field[jrnReal].datetime[realdate,"/"] & "{br}" & spacing