Skip to content

Commit fd217ef

Browse files
author
Wil Thieme
committed
first steps in building pfrpg2 implementation
1 parent 87989dd commit fd217ef

File tree

3 files changed

+193
-2
lines changed

3 files changed

+193
-2
lines changed
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
<?xml version="1.0" encoding="iso-8859-1"?>
2+
3+
<!-- Please see the LICENSE.md file included with this distribution for attribution and copyright information. -->
4+
5+
<root>
6+
<windowclass name="char_weapon" merge="join">
7+
<script file="campaign/scripts/ammo_weapon.lua" />
8+
<sheetdata>
9+
<number_charweaponfullattack name="attacks">
10+
<script file="campaign/scripts/ammo_attacks.lua" />
11+
</number_charweaponfullattack>
12+
<number_charweaponattacktotal name="attack1">
13+
<script file="campaign/scripts/ammo_attack.lua" />
14+
</number_charweaponattacktotal>
15+
<number_charweaponattacktotal name="attack2">
16+
<script file="campaign/scripts/ammo_attack.lua" />
17+
</number_charweaponattacktotal>
18+
<number_charweaponattacktotal name="attack3">
19+
<script file="campaign/scripts/ammo_attack.lua" />
20+
</number_charweaponattacktotal>
21+
<number_charweaponattacktotal name="attack4">
22+
<script file="campaign/scripts/ammo_attack.lua" />
23+
</number_charweaponattacktotal>
24+
25+
<!-- Ranged specific fields -->
26+
<buttonfield name="isloaded" source="ammunitionmanager.isloaded">
27+
<anchored width="27" height="10">
28+
<top parent="name" anchor="bottom" offset="11" />
29+
<left offset="2" />
30+
</anchored>
31+
<state icon="button_load" tooltipres="tooltip_actions_unloaded" />
32+
<state icon="button_unload" tooltipres="tooltip_actions_loaded" />
33+
<default>0</default>
34+
<script file="campaign/scripts/ammo_isloaded.lua" />
35+
</buttonfield>
36+
<label name="label_range">
37+
<anchored width="56">
38+
<left offset="33" />
39+
</anchored>
40+
</label>
41+
<label name="label_ammo">
42+
<anchored>
43+
<left offset="125" />
44+
</anchored>
45+
</label>
46+
<basicnumber name="maxammo">
47+
<script file="common/scripts/number_crosslink_unlink.lua" />
48+
</basicnumber>
49+
</sheetdata>
50+
</windowclass>
51+
52+
<windowclass name="char_weapon_editor" merge="join">
53+
<placement>
54+
<size width="400" height="470" />
55+
</placement>
56+
<sizelimits>
57+
<minimum width="400" height="470" />
58+
<dynamic />
59+
</sizelimits>
60+
</windowclass>
61+
62+
<windowclass name="char_weapon_editor_main" merge="join">
63+
<script file="campaign/scripts/char_weapon_editor_main.lua" />
64+
<sheetdata>
65+
<header_column name="header_ammo">
66+
<static textres="weapon_header_ammo" />
67+
<center />
68+
</header_column>
69+
70+
<combobox_ammo name="ammopicker" source="ammunitionmanager.ammopicker">
71+
<anchored>
72+
<right offset="-5" />
73+
</anchored>
74+
<itemsheetname><string /><field>subtype</field></itemsheetname>
75+
<itemsheetname><string /><field>type</field></itemsheetname>
76+
</combobox_ammo>
77+
<label_fieldtop name="label_ammopicker">
78+
<anchored to="ammopicker" />
79+
<static textres="weapon_label_ammopicker" />
80+
<readonly />
81+
<center />
82+
</label_fieldtop>
83+
84+
<combobox_ammo name="missammopicker" source="ammunitionmanager.missammopicker">
85+
<itemsheetname><string /><field>subtype</field></itemsheetname>
86+
<itemsheetname><string /><field>type</field></itemsheetname>
87+
<default textres="ammo_original" />
88+
<defaultvalue>ammo_original</defaultvalue>
89+
</combobox_ammo>
90+
<label_fieldtop name="label_missammopicker">
91+
<anchored to="missammopicker" />
92+
<static textres="weapon_label_altammopicker" />
93+
<readonly />
94+
<center />
95+
</label_fieldtop>
96+
<basicnumber name="missrecoverypercentage" source="ammunitionmanager.missrecoverypercentage">
97+
<anchored width="40" height="20">
98+
<top parent="missammopicker" anchor="top" offset="0" />
99+
<right offset="-113" />
100+
</anchored>
101+
<default>50</default>
102+
<tabtarget prev="ammopicker" next="missedshots" />
103+
</basicnumber>
104+
<label_fieldtop name="label_missrecoverypercentage">
105+
<anchored to="missrecoverypercentage" />
106+
<readonly />
107+
<center />
108+
</label_fieldtop>
109+
<label name="label_missammopercentof">
110+
<anchored to="missrecoverypercentage" position="righthigh" offset="5,0" width="35" />
111+
<static>% of</static>
112+
<center />
113+
</label>
114+
<basicnumber name="missedshots" source="ammunitionmanager.missedshots">
115+
<anchored to="label_missammopercentof" position="righthigh" offset="5,0" width="40" height="20" />
116+
<default>0</default>
117+
<hideonvalue>0</hideonvalue>
118+
<script file="common/scripts/number_crosslink_unlink.lua" />
119+
</basicnumber>
120+
<label_fieldtop name="label_missedshots">
121+
<anchored to="missedshots" />
122+
<static textres="weapon_label_missedshots" />
123+
<readonly />
124+
<center />
125+
</label_fieldtop>
126+
<recovershots name="recovermisses">
127+
<anchored to="missedshots" position="right" offset="7" width="20" />
128+
<counter>missedshots</counter>
129+
<ammopicker>missammopicker</ammopicker>
130+
<percent>missrecoverypercentage</percent>
131+
</recovershots>
132+
133+
<combobox_ammo name="hitammopicker" source="ammunitionmanager.hitammopicker">
134+
<anchored>
135+
<top parent="missammopicker" />
136+
</anchored>
137+
<itemsheetname><string /><field>subtype</field></itemsheetname>
138+
<itemsheetname><string /><field>type</field></itemsheetname>
139+
<default textres="ammo_original" />
140+
<defaultvalue>ammo_original</defaultvalue>
141+
</combobox_ammo>
142+
<label_fieldtop name="label_hitammopicker">
143+
<anchored to="hitammopicker" />
144+
<static textres="weapon_label_altammopicker" />
145+
<readonly />
146+
<center />
147+
</label_fieldtop>
148+
<basicnumber name="hitrecoverypercentage" source="ammunitionmanager.hitrecoverypercentage">
149+
<anchored width="40" height="20">
150+
<top parent="hitammopicker" anchor="top" offset="0" />
151+
<right offset="-113" />
152+
</anchored>
153+
<default>50</default>
154+
<tabtarget prev="ammopicker" next="missedshots" />
155+
</basicnumber>
156+
<label_fieldtop name="label_hitrecoverypercentage">
157+
<anchored to="hitrecoverypercentage" />
158+
<readonly />
159+
<center />
160+
</label_fieldtop>
161+
<label name="label_hitammopercentof">
162+
<anchored to="hitrecoverypercentage" position="righthigh" offset="5,0" width="35" />
163+
<static>% of </static>
164+
<center />
165+
</label>
166+
<basicnumber name="hitshots" source="ammunitionmanager.hitshots">
167+
<anchored to="label_hitammopercentof" position="righthigh" offset="5,0" width="40" height="20" />
168+
<default>0</default>
169+
<hideonvalue>0</hideonvalue>
170+
<script file="common/scripts/number_crosslink_unlink.lua" />
171+
</basicnumber>
172+
<label_fieldtop name="label_hitshots">
173+
<anchored to="hitshots" />
174+
<static textres="weapon_label_hitshots" />
175+
<readonly />
176+
<center />
177+
</label_fieldtop>
178+
<recovershots name="recoverhits">
179+
<anchored to="hitshots" position="right" offset="7" width="20" />
180+
<counter>hitshots</counter>
181+
<ammopicker>hitammopicker</ammopicker>
182+
<percent>hitrecoverypercentage</percent>
183+
</recovershots>
184+
</sheetdata>
185+
</windowclass>
186+
</root>

extension.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
<name>3.5E</name>
1313
</ruleset>
1414
<ruleset>
15-
<name>PFRPG</name>
15+
<name>4E</name>
1616
</ruleset>
1717
<ruleset>
18-
<name>4E</name>
18+
<name>PFRPG</name>
1919
</ruleset>
20+
<!--<ruleset>
21+
<name>PFRPG2</name>
22+
</ruleset>-->
2023
<ruleset>
2124
<name>5E</name>
2225
</ruleset>
@@ -28,6 +31,7 @@
2831
<base>
2932
<!-- Campaign Records -->
3033
<includefile ruleset="PFRPG|3.5E" source="campaign/pfrpg_record_char_actions.xml" />
34+
<includefile ruleset="PFRPG2" source="campaign/pfrpg2_record_char_actions.xml" />
3135
<includefile ruleset="4E" source="campaign/4e_record_char_combat.xml" />
3236
<includefile ruleset="5E" source="campaign/5e_record_char_weapon.xml" />
3337

scripts/manager_ammunition.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ function onInit()
209209

210210
onPostAttackResolve_old = ActionAttack.onPostAttackResolve
211211
ActionAttack.onPostAttackResolve = onPostAttackResolve_new
212+
212213
if sRuleset == 'PFRPG' or sRuleset == '3.5E' then
213214
table.insert(tLoadWeapons, 'firearm')
214215
table.insert(tLoadWeapons, 'crossbow')

0 commit comments

Comments
 (0)