quick & simple:

have your own protection array:
	
	int *protection;

then initialize it with
	int *init_protection()

	protection = PROTECTION_D->init_protection();

and you can set/add protections (in %:s)
	int set_protection(int *prot, string type, int amount);

	PROTECTION_D->set_protection(protection, "slash", 10);
        PROTECTION_D->add_protection(protection, "fire", 5);

and you can calculate total damage with
	calc_true_damage(int *prot, string type, int dam);

	PROTECTION_D->calc_true_damage(protection, "slash", 50);


[ very bad example of documentation :) ]
						+) Dazzt