forked from Sklore/HL_DD_5e_Colab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOM_5ePack - Procedures.user
156 lines (131 loc) · 5.42 KB
/
COM_5ePack - Procedures.user
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
<?xml version="1.0" encoding="UTF-8"?>
<document signature="Hero Lab Data">
<loadonce key="COM_5ePack - Procedures"/>
<fileinfo>
<info_author>
Tim Shadow
Email: ShadowChemosh@yahoo.com</info_author>
<info_history>
January 14, 2016
-Created new to hold procedures for the new 5e Pack.</info_history>
</fileinfo>
<procedure id="5CAddProf" context="pick"><![CDATA[
~ This procedure allows for giving a central Tab to add
~ proficiencies for skills, tools, or Skill/Tool combo.
~ This is useful for allowing the Tools to display correctly
~ on the "Skills" tab.
~ Timing: Post-Level/10000
~ Parms In:
~ NumOfProf - Use this for adding additional Skills & Tools
~ NumOfTool - Use this for adding ONLY Tool choices.
~ NumOfSkill - Use this for adding ONLY Skill choices.
~ Example Use for allowing both a Skill/Tool choice
~ var NumOfProf as number
~ NumOfProf = 1
~ call 5CAddProf
~ Example Use for allowing only Skill choices
~ var NumOfProf as number
~ NumOfSkill = 1
~ call 5CAddProf
~ Example Use for allowing only Tool choices
~ var NumOfProf as number
~ NumOfTool = 1
~ call 5CAddProf
var NumOfProf as number
var NumOfSkill as number
var NumOfTool as number
~ If a combination of Tools/Skills is allowed add here
if (NumOfProf <> 0) then
hero.childfound[cfg5CProf].field[cToolMax].value += NumOfProf
hero.childfound[cfg5CProf].field[cSkillMax].value += NumOfProf
endif
~ If only skills are allowed add here
if (NumOfSkill <> 0) then
hero.childfound[cfg5CProf].field[cSkillMax2].value += NumOfSkill
endif
~ If only tools are allowed add here
if (NumOfTool <> 0) then
hero.childfound[cfg5CProf].field[cToolMax2].value += NumOfTool
endif]]></procedure>
<procedure id="5Cfoctocls" context="pick"><![CDATA[
doneif (isroot = 0)
if (root.tagis[component.Class] <> 0) then
perform root.setfocus
elseif (root.tagis[component.Configure] <> 0) then
perform root.setfocus
else
if (root.islinkage[table] <> 0) then
perform root.linkage[table].setfocus
elseif (root.islinkage[varies] <> 0) then
perform root.linkage[varies].setfocus
endif
endif
doneif (state.isfocus = 0)
~ We could also be in a table on a configureable, so stop if that is where
~ we are.
doneif (focus.tagis[component.Configure] <> 0)]]></procedure>
<procedure id="S2SeleText" context="pick"><![CDATA[
~ For adjustment use only. Select where the text is coming from.
~ Either the Duration field or the Source field.
~ 1 = Source
~ 2 = Duration
var S2Type as number
~ If the default "(duration)" text is changed then attempt to use it.
If (compare(field[pDuration].text,"(duration)") <> 0) Then
~ Make sure that we are not blank either.
If (compare(field[pDuration].text,"") <> 0) Then
S2Type = 2
Endif
Endif
~ If the default "(source)" text is changed then attempt to use it.
If (compare(field[pSource].text,"(source)") <> 0) Then
~ Make sure that we are not blank either.
If (compare(field[pSource].text,"") <> 0) Then
S2Type = 1
Endif
Endif]]></procedure>
<procedure id="S2SetName" context="pick"><![CDATA[
~Set the Custom Name and Custom Text adjustments logic into this single
~procedure. We need to allow for using the Duration field or the Source
~field for setting the name so that we are backwards compatable.
~Timing: Render/99999999
~ 1 = Source
~ 2 = Duration
var S2Type as number
~ Figure out if we are to use Duration or Source text
Call S2SeleText
~ The tag AdjShadow.Name means we are totally overwriting the live name value
If (tagis[AdjShadow.Name] <> 0) Then
~ Source field has text to use so use it
If (S2Type = 1) Then
field[pChosen].chosen.field[livename].text = field[pSource].text
field[pChosen].chosen.field[sbName].text = field[pSource].text
~ Duration field has text and Source does not so use it
ElseIf (S2Type = 2) Then
field[pChosen].chosen.field[livename].text = field[pDuration].text
field[pChosen].chosen.field[sbName].text = field[pDuration].text
Endif
~ The tag AdjShadow.Text means we are appending to the live name value
ElseIf (tagis[AdjShadow.Text] <> 0) Then
~ Source field has text to use so use it
If (S2Type = 1) Then
field[pChosen].chosen.field[livename].text &= field[pSource].text
field[pChosen].chosen.field[sbName].text &= field[pSource].text
~ Duration field has text and Source does not so use it
ElseIf (S2Type = 2) Then
field[pChosen].chosen.field[livename].text &= field[pDuration].text
field[pChosen].chosen.field[sbName].text &= field[pDuration].text
Endif
Endif]]></procedure>
<procedure id="5CSplSchSF" context="pick"><![CDATA[
~ This procedure is for "Spell School - Spell Focus" logic.
~ We are called from every spell school pick to give a 1/2
~ proficiency bonus to that school of magic.
~ If we do not have spell focus then get out now!
doneif (tagis[Broadcast.SpellFocus] = 0)
~ We need to apply "half" our proficiency bonus to this
~ school of magic.
field[schDC].value += round(hero.child[ProfBonus].field[tProfBonus].value/2,0,-1)
]]>
</procedure>
</document>