ACTION_IF (FILE_EXISTS ~override/tb#localdescriptionsforarmor.txt~)  OR
			(FILE_EXISTS ~override/tb#generdescriptionsforarmor.txt~)  THEN
// if the user wants no translation, skip some work.
	BEGIN
	ACTION_IF (~%LANGUAGE%~ STRING_EQUAL_CASE ~languages/english~) OR     // language is english
				(FILE_EXISTS ~override/tb#generdescriptionsforarmor.txt~) THEN // wants english strings
		BEGIN
		// load the descriptions from the english "2da'd tra"
		COPY ~refinements/languages/english/armor/ident.tp2~ ~refinements/languages/english/armor/ident.tp2~
			SPRINT ~findwheretra~ ~languages/english~
			READ_2DA_ENTRIES_NOW ~totalrows~ 1
			FOR (i = 0; i < totalrows; i += 1)
				BEGIN
					READ_2DA_ENTRY_FORMER ~totalrows~ i 0 name
					READ_2DA_ENTRY_FORMER ~totalrows~ i 1 desc
					SPRINT EVALUATE_BUFFER ~identarray_%name%~ ~%desc%~
				END
		BUT_ONLY_IF_IT_CHANGES

		COPY ~refinements/languages/english/armor/unide.tp2~ ~refinements/languages/english/armor/unide.tp2~
			READ_2DA_ENTRIES_NOW ~totalrows~ 1
			FOR (i = 0; i < totalrows; i += 1)
				BEGIN
					READ_2DA_ENTRY_FORMER ~totalrows~ i 0 name
					READ_2DA_ENTRY_FORMER ~totalrows~ i 1 desc
					SPRINT EVALUATE_BUFFER ~unidearray_%name%~ ~%desc%~
				END
		BUT_ONLY_IF_IT_CHANGES
	END

	// load the descriptions from the language specific "2da'd tra"; this way they'll override
	// the english ones I loaded before.
	ACTION_IF !(~%LANGUAGE%~ STRING_EQUAL_CASE ~languages/english~) THEN // is not english
		BEGIN
		ACTION_IF FILE_EXISTS ~override/tb#localdescriptionsforarmor.txt~ THEN
			BEGIN
			COPY_EXISTING ~sw1h01.itm~ ~override~
				SPRINT ~findwheretra~ ~%LANGUAGE%~
			BUT_ONLY_IF_IT_CHANGES
			END
		ACTION_IF FILE_CONTAINS_EVALUATED (~refinements/%LANGUAGE%/armor/ident.tp2~ ~___NL___~) THEN // file exists
			BEGIN
			COPY ~refinements/%LANGUAGE%/armor/ident.tp2~ ~refinements/%LANGUAGE%/armor/ident.tp2~
			READ_2DA_ENTRIES_NOW ~totalrows~ 1
			FOR (i = 0; i < totalrows; i += 1)
				BEGIN
					READ_2DA_ENTRY_FORMER ~totalrows~ i 0 name
					READ_2DA_ENTRY_FORMER ~totalrows~ i 1 desc
					SPRINT EVALUATE_BUFFER ~identarray_%name%~ ~%desc%~
				END
			BUT_ONLY_IF_IT_CHANGES
			END

		ACTION_IF FILE_CONTAINS_EVALUATED (~refinements/%LANGUAGE%/armor/unide.tp2~ ~___NL___~) THEN // file exists
			BEGIN
			COPY ~refinements/%LANGUAGE%/armor/unide.tp2~ ~refinements/%LANGUAGE%/armor/unide.tp2~
			READ_2DA_ENTRIES_NOW ~totalrows~ 1
			FOR (i = 0; i < totalrows; i += 1)
				BEGIN
					READ_2DA_ENTRY_FORMER ~totalrows~ i 0 name
					READ_2DA_ENTRY_FORMER ~totalrows~ i 1 desc
					SPRINT EVALUATE_BUFFER ~unidearray_%name%~ ~%desc%~
				END
			BUT_ONLY_IF_IT_CHANGES
			END
		END
	END

PRINT @14

COPY - ~refinements/armor/armorlist.txt~ ~refinements/armor~
	READ_2DA_ENTRIES_NOW ~_#_#_#armorlist~ 2
	FOR (i = 0; i < _#_#_#armorlist; i+=1) BEGIN
		READ_2DA_ENTRY_FORMER ~_#_#_#armorlist~ i 0 armortype
		INNER_PATCH_FILE ~refinements/armor/effects/%armortype%.txt~ BEGIN
			READ_2DA_ENTRIES_NOW ~_#_#_#armor_effects_%armortype%.txt~ 1
		END
	END

COPY - ~refinements/armor/special~ ~refinements/armor/special~
	TO_UPPER ~SOURCE_RES~
	READ_2DA_ENTRIES_NOW ~_#_#_#armor_effects_%SOURCE_RES%.txt~ 1

COPY - ~refinements/shield/shieldlist.txt~ ~refinements/shield~
	READ_2DA_ENTRIES_NOW ~_#_#_#shieldlist~ 2
	FOR (i = 0; i < _#_#_#shieldlist; i+=1) BEGIN
		READ_2DA_ENTRY_FORMER ~_#_#_#shieldlist~ i 0 armortype
		INNER_PATCH_FILE ~refinements/shield/effects/%armortype%.txt~ BEGIN
			READ_2DA_ENTRIES_NOW ~_#_#_#shield_effects_%armortype%.txt~ 1
		END
	END

COPY - ~refinements/shield/special~ ~refinements/shield/special~
	TO_UPPER ~SOURCE_RES~
	READ_2DA_ENTRIES_NOW ~_#_#_#shield_effects_%SOURCE_RES%.txt~ 1


DEFINE_ASSOCIATIVE_ARRAY armor_keywords BEGIN
w_dam_slash => "Slashing Damage Resistance: +"
w_dam_pierc => "Piercing Damage Resistance: +"
w_dam_blunt => "Blunt Damage Resistance: +"
w_dam_missi => "Missile Damage Resistance: +"
w_dex_penal => "Dexterity Penalty: "
w_mov_penal => "Movement Rate Penalty: "
w_spe_failu => "Spellcasting Failure Rate: +"
w_pic_penal => "Pickpocketing Penalty: "
w_loc_penal => "Lockpicking Penalty: "
w_tra_penal => "Trap Removal Penalty: "
w_sil_penal => "Move Silently Penalty: "
w_hid_penal => "Hide in Shadows Penalty: "
END

DEFINE_ASSOCIATIVE_ARRAY shield_keywords BEGIN
w_ac_bonus => "AC bonus: +"
w_mi_bonus => "Missile AC bonus: +"
w_pi_bonus => "Piercing AC bonus: +"
w_mo_penal => "Movement Rate Penalty: "
w_de_penal => "Dexterity Penalty: "
END
