I think to have read that a creature with an elementals subtype (for example earth) was immune to energy connected with his element (in this case acid) and a vulnerability to the opposite energy (I guess that would be electricity).
Is that right? I didn't find it, when I looked for it now.
If so, how does that interact with resistances the creature might have or might gain by another template?
Let's look at a celestial earth elemental?
It has the earth subtype and a resistance to electricity (the amount depends on its hit dice). In the case of a small celestial earth elemental it would be Resistance electricity 5, if I remember right?
So if a creature with vulnerability electricity and resistance electricity 5 is hit by a shocking grasp dealing 10 damage, how much damage will that deal?
Is the resistance counted in first or the vulnerability?
I would apply the same set of rules as with other cases of Elemental Resistance and Vulnerability:
Calculate post-save damage. Deduct Energy Resistance. Multiply by 1.5 for Vulnerability. Done, and done.
This having been said, I cannot find any rule stating an elemental subtype automagically granting immunity to the associated energy, plus vulnerability to the opposite.
The fire subtype does. The cold subtype does. Neither of the two are necessarily Elemental subtypes (say hello to Mr. Frost Giant).
i don't think this rule applies, but 'if it did', it wouldn't be hard to resolve.
paizo addressed a similar case, that one of their AP villains had both vulnerability to an energy type and resistance to it (via spell),
which of course makes sense for a creature with vulnerability to do (have said spell cast).
in such a case, the energy damage must first get thru the resistance, and any that actually applies to the creature is increased 50%, as per vulnerability.