File: modWP_Droid.lua

package info (click to toggle)
freedroidrpg 1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 273,532 kB
  • sloc: ansic: 66,191; cpp: 2,033; sh: 766; makefile: 627; python: 322; xml: 94; perl: 87
file content (429 lines) | stat: -rw-r--r-- 22,806 bytes parent folder | download
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
--[[

	Copyright (c) 2014 Scott Furry

	This file is part of Freedroid

	Freedroid is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	Freedroid is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Freedroid; see the file COPYING. If not, write to the
	Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
	MA  02111-1307  USA

]]--
--	lua module for parsing FDRPG droid file data
local modWP_Droid = {}
--	modWPCommon reference
modWP_Droid.modcommon = {}
--	Variable will contained all parsed droid information after completion of ProcessDroidData()
modWP_Droid.AllDroidData = {}
--	"struct" of droid information for each droid
--	use deep copy to pass default values to new copy
modWP_Droid.droidDataItem = {
--	Each "droid" section starts with "** Start of new Robot: **"
--	variable                    delimiter  src matching variable
	name = "",              --    : www    Droidname
	desc = "",              --    :_"*"    Default description
	is_human = false,       --    : d      Is this 'droid' a human (1=true,else false)
	graphics_prefix = "",   --    ="*"     Filename prefix for graphics
	portrait_prefix = "",   --    ="*"     Droid uses portrait rotation series with prefix
	speed_max = 0,          --    : dd     Maximum speed of this droid
	energy_max = 0,         --    : dd     Maximum energy of this droid
	droid_class = 0,        --    : dd     Class of this droid
	drop_item_class = 0,    --    =dd      Drops item class
	heal_rate = 0,          --    : dd     Rate of healing,
	destroy_xp = 0,         --    : ddd    Experience_Reward gained for destroying one of this type
	aggr_dist = 0,          --    : dd     Aggression distance of this droid
	time_eye_Tux = 0.0,     --    : f.f    Time spent eyeing Tux
	weapon = "",            --    ="*"     Weapon item
	pct_EntropyInvrtr = 0,  --    =dd      Percent to drop Entropy Inverter
	pct_PlasmaTrans = 0,    --    =dd      Percent to drop Plasma Transistor
	pct_SprCondRelay = 0,   --    =dd      Percent to drop Superconducting Relay Unit
	pct_AMConverter = 0,    --    =dd      Percent to drop Antimatter-Matter Converter
	pct_TachyonCond = 0,    --    =dd      Percent to drop Tachyon Condensator
	sound_num_greet = 0,    --    =dd      Greeting Sound number
	sound_death = "",       --    ="*"     Death sound file name (*.ogg)
	sound_attack = "",      --    ="*"     Attack animation sound file name (*.ogg)
	pct_hit = 0,            --    =dd      Chance of this robot scoring a hit
	time_hit_recover = 0.0, --    +f.ff    Time to recover after getting hit
	droid_notes = "",       --    =_"*"    Notes concerning this droid
	urlAnchor = "",         --             text to use for wiki page anchor
	image = { ext = "",     --    image extension
	          src = "",     --    source file path for image (system dependent)
	          dest = "",    --    destination folder for image link
	          name = "",    --    text to use for link to image
	},
	sensor = ""				--	="*"		one of {spectral (default), infrared, xray, radar, subsonic}
}
-- names of required modules - "modWP_Items"
modWP_Droid.wikirequiredModules = { moduleNames[3].id }

-- special sorting for "all data table"
-- [in]	a|b	elements in all data table
function modWP_Droid.SpecialAllDataSort(a,b)
	return a.name < b.name
end
--	Droid_Archetypes.dat file parsed line-by-line into table
modWP_Droid.DroidFileData = {}
--	table of FDRPG filepaths used for parsing droid information
modWP_Droid.files = {
	droid = ""
}
--	text items for Droid parsing and presentation
--	id) key, label) text to display testInLoop) when searching, test for this id in loop?
--	srchPatn) text/pattern to use to find data
--	extrctPatn) how to extract found data
modWP_Droid.textDroid = {
	{ id = "spec_item_start",   label = "end_of_level",                testInLoop = true,  srchPatn = "Start of new Robot:",                                  extrctPatn = "[TEXT]" },
	{ id = "name",              label = "Name",                        testInLoop = true,  srchPatn = "Droidname:%s*([%w]+)",                                 extrctPatn = "[MATCH]" },
	{ id = "desc",              label = "Description",                 testInLoop = true,  srchPatn = "Default description:",                                 extrctPatn = "[EOL]" },
	{ id = "is_human",          label = "Is Human",                    testInLoop = true,  srchPatn = "Is this \'droid\' a human%s*:%s*[%d]+",                extrctPatn = "[%d]+" },
	{ id = "graphics_prefix",   label = "Graphics Prefix",             testInLoop = true,  srchPatn = "Filename prefix for graphics=",                        extrctPatn = "[EOL]" },
	{ id = "portrait_prefix",   label = "Portrait_Prefix",             testInLoop = true,  srchPatn = "Droid uses portrait rotation series with prefix=",     extrctPatn = "[EOL]" },
	{ id = "speed_max",         label = "Max Speed",                   testInLoop = true,  srchPatn = "Maximum speed of this droid:%s*[%d]+",                 extrctPatn = "%d+" },
	{ id = "energy_max",        label = "Max Energy",                  testInLoop = true,  srchPatn = "Maximum energy of this droid:%s*[%d]+",                extrctPatn = "%d+" },
	{ id = "droid_class",       label = "Class",                       testInLoop = true,  srchPatn = "Class of this droid:%s*[%d]+",                         extrctPatn = "%d+" },
	{ id = "drop_item_class",   label = "Drop Item Class",             testInLoop = true,  srchPatn = "Drops item class=%s*[%d]+",                            extrctPatn = "%d+" },
	{ id = "heal_rate",         label = "Heal Rate",                   testInLoop = true,  srchPatn = "Rate of healing:%s*[%d]+[.%d+]*",                      extrctPatn = "[%d]+[.%d+]*" },
	{ id = "destroy_xp",        label = "Destroy XP Gain",             testInLoop = true,  srchPatn = "Experience_Reward gained for destroying one of this type:%s*[%d]+", extrctPatn = "[%d]+" },
	{ id = "aggr_dist",         label = "Aggression Distance",         testInLoop = true,  srchPatn = "Aggression distance of this droid=%s*[%d]+",           extrctPatn = "[%d]+" },
	{ id = "time_eye_Tux",      label = "Time Spent Eyeing Tux",       testInLoop = true,  srchPatn = "Time spent eyeing Tux=[%d]+[.%d+]*",                   extrctPatn = "[%d]+[.%d+]*" },
	{ id = "weapon",            label = "Weapon",                      testInLoop = true,  srchPatn = "Weapon item=",                                         extrctPatn = "[EOL]" },
	{ id = "droppct",           label = "Drop Percentages",            testInLoop = false, srchPatn = "" },
	{ id = "pct_EntropyInvrtr", label = "Entropy Inverter",            testInLoop = true,  srchPatn = "Percent to drop Entropy Inverter=%s*[%d]+",            extrctPatn = "[%d]+" },
	{ id = "pct_PlasmaTrans",   label = "Plasma Transistor",           testInLoop = true,  srchPatn = "Percent to drop Plasma Transistor=%s*[%d]+",           extrctPatn = "[%d]+" },
	{ id = "pct_SprCondRelay",  label = "Superconducting Relay Unit",  testInLoop = true,  srchPatn = "Percent to drop Superconducting Relay Unit=%s*[%d]+",  extrctPatn = "[%d]+" },
	{ id = "pct_AMConverter",   label = "Antimatter-Matter Converter", testInLoop = true,  srchPatn = "Percent to drop Antimatter-Matter Converter=%s*[%d]+", extrctPatn = "[%d]+" },
	{ id = "pct_TachyonCond",   label = "Tachyon Condensator",         testInLoop = true,  srchPatn = "Percent to drop Tachyon Condensator=%s*[%d]+",         extrctPatn = "[%d]+" },
	{ id = "sound_num_greet",   label = "Greeting Sound Number",       testInLoop = true,  srchPatn = "Greeting Sound number=%s*[%d]+",                       extrctPatn = "[%d]+" },
	{ id = "sound_death",       label = "Death Sound File Name",       testInLoop = true,  srchPatn = "Death sound file name=",                               extrctPatn = "[EOL]" },
	{ id = "sound_attack",      label = "Attack Sound File Name",      testInLoop = true,  srchPatn = "Attack animation sound file name=",                    extrctPatn = "[EOL]" },
	{ id = "pct_hit",           label = "Hit Percentage",              testInLoop = true,  srchPatn = "Chance of this robot scoring a hit=%s*[%d]+",          extrctPatn = "[%d]+" },
	{ id = "time_hit_recover",  label = "Hit Recovery Time",           testInLoop = true,  srchPatn = "Time to recover after getting hit=[%d]+[.%d+]*",       extrctPatn = "[%d]+[.%d+]*" },
	{ id = "droid_notes",       label = "Notes concerning this droid", testInLoop = true,  srchPatn = "Notes concerning this droid=",                         extrctPatn = "[EOL]" },
	{ id = "sensor",			label = "Sensor",					   testInLoop = true,  srchPatn = "Sensor ID=",                         					extrctPatn = "[EOL]" },
	{ id = "spec_file_end",     label = "end_of_level",                testInLoop = true,  srchPatn = "End of Robot Data Section",                            extrctPatn = "[TEXT]" },
}

-- retrieve the anchortext associated with this id value
function modWP_Droid.GetItemUrlText( idvalue )
	local retText = ""
	if ( not idvalue ) then
		return retText
	end
	local droid = select(1,modWP_Droid.modcommon.Extract.GetTableItem(modWP_Droid.AllDroidData,"name", idvalue))
	if ( droid ~= nil ) then
		retText = modWP_Droid.modcommon.outputfilenames.droids .. droid.urlAnchor
	end
	return retText
end

--	Look up droidDataItem variable value and its presentation label
--	Assumes DroidFileData is populated and processed
--	[in]	droiditem	droid object under examination (type droidDataItem)
--	[in]	idvalue	search id - same as id value in textDroid
--	[ret]	pair of strings representing label|data from droid item
function modWP_Droid.GetDroidStringsPair( droiditem, idvalue )
	local retLabel, retData = "", ""
	if (( idvalue == nil ) or ( type(idvalue) ~= 'string' ) or ( idvalue:len() <= 0 )) then
		return retLabel, retData
	end
	local labelitem = select(1,modWP_Droid.modcommon.Extract.GetTableItem( modWP_Droid.textDroid, "id", idvalue))
	if ( labelitem ~= nil ) then
		retLabel = labelitem.label
		if	( idvalue == "droppct") then
			retData = ""
		else
			retData = tostring(droiditem[idvalue])
		end
	end
	return retLabel, retData
end

--	Process file data for all droid information
--	Populates DroidFileData variable
function modWP_Droid.ParseDroidSpec()
	local tempdroidspecitem = {}
	--	firstpass - are we passing through the file for the first time?
	--	prevents "saving" droid data when first start-of-section is read
	local firstpass = true
	--	foundsensor - was a sensor value found when reading droid data?
	local foundsensor = false
	-- loop through droid data file line-by-line
	for key,line in pairs(modWP_Droid.DroidFileData)do
		-- for each line - compare to each item in textDroid array
		for subkey, textitem in pairs(modWP_Droid.textDroid)do

			-- should we test for this item? N0 - start next iteration
			if ( not textitem.testInLoop ) then goto PARSE_DROID_NEXT_SRCH_PATTERN end
			-- for test item - extract value based on search pattern
			local value = modWP_Droid.modcommon.Extract.SearchText( line, textitem.srchPatn, textitem.extrctPatn )
			-- value not found - start next iteration
			if ( not value ) then goto PARSE_DROID_NEXT_SRCH_PATTERN end
			-- value found - what was found?
			if	( textitem.id == "spec_item_start" ) then
				--	found start-of-droid data section
				if (firstpass) then
					-- found first start-of-droid data section in file
					-- no previous data to save
					firstpass = false
				else
					--	save previous and setup for next pass
					if ( foundsensor == false) then
						-- no sensor data found - set to default
						tempdroidspecitem.sensor = "spectral"
					end
					-- reset sensor flag for next droid data section
					foundsensor = false
					-- save found droid data to array
					table.insert(modWP_Droid.AllDroidData, tempdroidspecitem)
				end
				-- reset temp droid data holder for next droid data section
				tempdroidspecitem = modWP_Droid.modcommon.Extract.TblDeepCopy(modWP_Droid.droidDataItem)

			elseif ( textitem.id == "spec_file_end" ) then
				--	reached the end of droid specs data in file
				--	save previous before exit
				if ( foundsensor == false) then
					-- no sensor data found - set to default
					tempdroidspecitem.sensor = "spectral"
				end
				-- save found droid data to array
				table.insert(modWP_Droid.AllDroidData, tempdroidspecitem)
				-- reset sensor flag for next iteration
				foundsensor = false
				-- will exit nested loops after this point

			elseif ( textitem.id == "is_human" ) then
				-- element data forced to boolean - saved in droid data file as integer
				tempdroidspecitem[textitem.id] = ( value ~= 0 )
			else
				-- have extracted value to be saved to current tempdroidspecitem
				if (textitem.id == "sensor" ) then
					-- sensor data found - set flag to prevent using default
					foundsensor = true
				end
				tempdroidspecitem[textitem.id] = value
			end		--	process extracted value read from file
::PARSE_DROID_NEXT_SRCH_PATTERN::
		end	--	pattern/value found
	end	--	loop through text file data
	if (#modWP_Droid.AllDroidData > 0) then
		table.sort( modWP_Droid.AllDroidData, modWP_Droid.SpecialAllDataSort )
	end	--	sort AllDroidData table
end

--	Read in FDRPG Droid_Archetypes data file and process for each droid type.
--	All droid information is saved into lua table.
function modWP_Droid.ProcessData()
	modWP_Droid.modcommon = require("modWPCommon")
	modWP_Droid.files.droid = tostring(modWP_Droid.modcommon.paths.srcData .. modWP_Droid.modcommon.datafiles["droid"])
	modWP_Droid.modcommon.Test.Files(modWP_Droid.files)
	--	process data
	modWP_Droid.DroidFileData = modWP_Droid.modcommon.Process.FileToLines(modWP_Droid.files.droid)
	modWP_Droid.ParseDroidSpec()
	for key, droid in pairs(modWP_Droid.AllDroidData) do
		droid.urlAnchor = modWP_Droid.modcommon.Wiki.HLink .. "droid" .. droid.name
		local srcpathshort = "droids/" .. droid.graphics_prefix
		droid.image.ext = ".png"
		droid.image.src = modWP_Droid.modcommon.paths.srcGraphics .. srcpathshort .. "/portrait" .. droid.image.ext
		droid.image.dest = modWP_Droid.modcommon.paths.destRootImg .. "Droids/"
		droid.image.name = srcpathshort:gsub("%/","_")
	end
end

--	Write FDRPG droid information to file in the format needed by the website.
function modWP_Droid.WikiWrite()
	local modItems = assert(require(modWP_Droid.wikirequiredModules[1]))
	local modWIKI = modWP_Droid.modcommon.Wiki
	local filename = modWP_Droid.modcommon.outputfilenames.droids .. ".html.md.eco"
	local filepath = tostring(modWP_Droid.modcommon.paths.destRootFile .. filename)
	local wikitext = {}

	wikitext[#wikitext + 1] = "---"
	wikitext[#wikitext + 1] = "layout: 'page'"
	wikitext[#wikitext + 1] = "title: 'Droid Guide'"
	wikitext[#wikitext + 1] = "comment: 'Characteristics of the droids that can be met in the game.'"
	wikitext[#wikitext + 1] = ""
	wikitext[#wikitext + 1] = "droids:"

	--	loop to produce droid items
	for key, droiditem in pairs(modWP_Droid.AllDroidData) do
		if ( droiditem.is_human ) then
			goto WIKI_PROCESS_NEXT_DROID end
		local portraitname = ""
		--	add paths to list of images to copy
		local portaititem = modWIKI.ManagePortrait( droiditem.image.src, droiditem.image.dest, droiditem.image.name, droiditem.image.ext)
		if ( portaititem ~= nil ) then
			portraitname = portaititem.destfile
		end
		--	process data
		modWIKI.StartMapping()
		wikitext[#wikitext + 1] = modWIKI.AddAttr('id', modWIKI.WikifyLink("droid" .. droiditem.name))
		wikitext[#wikitext + 1] = modWIKI.AddAttr('name', droiditem.name)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('time_hit_recover', droiditem.time_hit_recover)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('pct_TachyonCond', droiditem.pct_TachyonCond)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('droid_class', droiditem.droid_class)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('graphics_prefix', droiditem.graphics_prefix)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('weapon', droiditem.weapon)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('speed_max', droiditem.speed_max)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('time_eye_Tux', droiditem.time_eye_Tux)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('urlAnchor', droiditem.urlAnchor)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('sound_num_greet', droiditem.sound_num_greet)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('aggr_dist', droiditem.aggr_dist)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('sensor', droiditem.sensor)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('pct_SprCondRelay', droiditem.pct_SprCondRelay)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('energy_max', droiditem.energy_max)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('destroy_xp', droiditem.destroy_xp)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('desc', droiditem.desc)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('drop_item_class', droiditem.drop_item_class)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('droid_notes', droiditem.droid_notes)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('image', droiditem.image.name .. droiditem.image.ext)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('is_human', droiditem.is_human)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('heal_rate', droiditem.heal_rate)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('pct_EntropyInvrtr', droiditem.pct_EntropyInvrtr)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('pct_PlasmaTrans', droiditem.pct_PlasmaTrans)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('portrait_prefix', droiditem.portrait_prefix)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('sound_death', droiditem.sound_death)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('pct_AMConverter', droiditem.pct_AMConverter)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('sound_attack', droiditem.sound_attack)
		wikitext[#wikitext + 1] = modWIKI.AddAttr('pct_hit', droiditem.pct_hit)
		modWIKI.EndMapping()
::WIKI_PROCESS_NEXT_DROID::
	end
	wikitext[#wikitext + 1] = "---"
	wikitext[#wikitext + 1] = ""
	wikitext[#wikitext + 1] = [[
# Droids Guide

<div class="row">
 <div class="toc col-md-2 pull-right">
  <span><b>Droid Types</b></span>
  <ul>
  <% for droid in @document.droids: %>
   <li><a href="#<%- droid.id %>"><%- droid.name %></a></li>
  <% end %>
  </ul>
 </div>

 <div class="col-md-10">
 <% for droid in @document.droids: %>
  <div class="row">
   <h1 id="<%- droid.id %>"><%- droid.name %></h1>
   <div class="obj-portrait col-md-2 text-center">
    <img src="/images/droids/<%- droid.image %>">
   </div>
   <div class="col-md-8">
    <h3><%- droid.desc %></h3>
    <p><%- droid.droid_notes %></p>
    <p><strong>Weapon</strong>: <%- droid.weapon %><br/>
       <strong>Sensor</strong>: <%- droid.sensor %><br/>
       <strong>Greeting Sound Number</strong>: <%- droid.sound_num_greet %><br/>
       <strong>Death Sound File Name</strong>: <%- droid.sound_death %><br/>
       <strong>Attack Sound File Name</strong>: <%- droid.sound_attack %></p>
    <div class="row">
     <div class="col-md-6 bordered-table">
      <table width="100%"><tbody>
       <tr>
        <td align="left" width="80%" valign="top">Class</td>
        <td align="center" valign="top"><%- droid.droid_class %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Max Speed</td>
        <td align="center" valign="top"><%- droid.speed_max %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Max Energy</td>
        <td align="center" valign="top"><%- droid.energy_max %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Drop Item Class</td>
        <td align="center" valign="top"><%- droid.drop_item_class %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Heal Rate</td>
        <td align="center" valign="top"><%- droid.heal_rate %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Destroy XP Gain</td>
        <td align="center" valign="top"><%- droid.destroy_xp %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Aggression Distance</td>
        <td align="center" valign="top"><%- droid.aggr_dist %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Time Spent Eyeing Tux</td>
        <td align="center" valign="top"><%- droid.time_eye_Tux %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Hit Percentage</td>
        <td align="center" valign="top"><%- droid.pct_hit %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Hit Recovery Time</td>
        <td align="center" valign="top"><%- droid.time_hit_recover %></td>
       </tr>
      </tbody></table>
     </div>
     <div class="col-md-6 bordered-table">
      <table width="100%"><tbody>
       <tr>
        <td colspan=2 align="center">Drop Percentages</td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Entropy Inverter</td>
        <td align="center" valign="top"><%- droid.pct_EntropyInvrtr %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Plasma Transistor</td>
        <td align="center" valign="top"><%- droid.pct_PlasmaTrans %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Superconducting Relay Unit</td>
        <td align="center" valign="top"><%- droid.pct_SprCondRelay %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Antimatter-Matter Converter</td>
        <td align="center" valign="top"><%- droid.pct_AMConverter %></td>
       </tr>
       <tr>
        <td align="left" width="80%" valign="top">Tachyon Condensator</td>
        <td align="center" valign="top"><%- droid.pct_TachyonCond %></td>
       </tr>
      </tbody></table>
     </div>
    </div>
   </div>
  </div>
  <% end %>
 </div>
</div>
]]
	--	write string to file
	modWP_Droid.modcommon.Process.DataToFile(filepath, table.concat(wikitext, "\n"))
end

--	Print out droid information based on selected verbosity.
function modWP_Droid.Verbosity()
	if (( not modWP_Droid.modcommon.verbose) and ( not modWP_Droid.modcommon.doubleverbose)) then
		return
	end
	io.stdout:write(modWP_Droid.modcommon.VerboseHeader)
	io.stdout:write("modWP_Droid\n")
	io.stdout:write("number of droid spec: " .. #modWP_Droid.AllDroidData .. "\n")
	if (modWP_Droid.modcommon.doubleverbose) then
		modWP_Droid.modcommon.Process.TblPrint(modWP_Droid.AllDroidData, nil, nil, "All Droid Data")
	end
end

return modWP_Droid