Restrict Shard-Modifying Spell to Certain Shard Types Only?

I'm trying to build a spell based on Ceresa's Corruption, except instead of changing any friendly shard to a Death Shard, it randomly changes the shard into a Death or a Fire Shard.  However, I don't want a player to be able to circumvent the randomness by simply casting the spell again until they get the shard they want, so Corruption's "<SpellTargetType>RegularShard</SpellTargetType>" is too broad.

So, is there any way that I could restrict the target to Water/Earth/Life/Air shards only?  I hoped to do this by adding a new <SpellTargetType> (i.e. "NotFireOrDeathShard"), but I can't find any xml that would let me add custom target types.  Alternatively, is there a way to check to see what the shard is when the spell is cast, and only change it if it isn't a Death/Fire shard?  If no, are there any other clever ideas out there on how I might pull this restriction off?

18,290 views 6 replies
Reply #1 Top

<AppliesRandomModifier>1</AppliesRandomModifier>

See the Destiny's Gift spell, or Pandemonium

Reply #2 Top

Oh I got that far, thanks :)  My question was:

So, is there any way that I could restrict the target to Water/Earth/Life/Air shards only? I hoped to do this by adding a new(i.e. "NotFireOrDeathShard"), but I can't find any xml that would let me add custom target types. Alternatively, is there a way to check to see what the shard is when the spell is cast, and only change it if it isn't a Death/Fire shard? If no, are there any other clever ideas out there on how I might pull this restriction off?

Basically, I don't want a player to just cast the spell a second time to get the shard they want, since that would circumvent the whole point of a random transformation.

Reply #3 Top

Maybe turn the terrain underneath the shard into something else, then make it so you can't cast the spell on that type of terrain. You'd still be able to cast it once on non-transformed fire/death shards.

 

Reply #4 Top

Ooooh I like that:  both clever and effective.  Thanks!

 

(Also, just realized I've been posting all these questions in the FE Modding forum, and not the LH forum.  No wonder it's so quiet in here ;)

Reply #5 Top

Hrm.  It's looking promising; I added a new terrain type which does block the spell, and works on the tile below the targeted shard.  But I've run into a new problem:  The <AppliesRandomModifier> that I'm using to randomly select between Death and Fire is also taking the PlaceTerrain gamemodifier as an option, meaning the spell chooses between one of the three options, instead of always changing the terrain + choosing randomly between the two shard transformations.

Is there a way to restrict <AppliesRandomModifier> so that one of the three <GameModifier> tags is always applied, while the other two are randomly selected?  (Alternatively, is there a way to group the shard change and the terrain change together, so that AppliesRandomModifier has only two options to choose from, but both of them will alter the terrain as well as change the shard?)  I've tried changing the order of the tags, but it seems AppliesRandomModifier will always choose randomly from all GameModifiers in the spell.

Here's the pertinent code:

Code: xml
  1. &lt;AutoUnlock&gt;1&lt;/AutoUnlock&gt;
  2. &lt;SpellBookSortCategory&gt;World&lt;/SpellBookSortCategory&gt;
  3. &lt;SpellBookSortSubCategory&gt;Other&lt;/SpellBookSortSubCategory&gt;
  4. &lt;SpellType&gt;Strategic&lt;/SpellType&gt;
  5. &lt;SpellClass&gt;Other&lt;/SpellClass&gt;
  6. &lt;SpellSubClass&gt;Other&lt;/SpellSubClass&gt;
  7. &lt;SpellTargetType&gt;RegularShard&lt;/SpellTargetType&gt;
  8. &lt;SpellTargetZOCType&gt;Friendly&lt;/SpellTargetZOCType&gt;
  9. &lt;Prereq&gt;
  10. &lt;Type&gt;AbilityBonusOption&lt;/Type&gt;
  11. &lt;Attribute&gt;Spell_PromiseOfAsshai&lt;/Attribute&gt;
  12. &lt;/Prereq&gt;
  13.     &lt;SpellResourceCost&gt;
  14.     &lt;Resource&gt;Mana&lt;/Resource&gt;
  15. &lt;Amount&gt;50&lt;/Amount&gt;
  16. &lt;/SpellResourceCost&gt;
  17. &lt;GameModifier&gt;
  18. &lt;ModType&gt;Map&lt;/ModType&gt;
  19. &lt;Attribute&gt;PlaceTerrain&lt;/Attribute&gt;
  20. &lt;TerrainType&gt;AshenLand&lt;/TerrainType&gt;
  21. &lt;/GameModifier&gt;
  22. &lt;AppliesRandomModifier&gt;1&lt;/AppliesRandomModifier&gt;
  23. &lt;GameModifier&gt;
  24. &lt;ModType&gt;Map&lt;/ModType&gt;
  25. &lt;Attribute&gt;ChangeShardType&lt;/Attribute&gt;
  26. &lt;StrVal&gt;DeathShard&lt;/StrVal&gt;
  27. &lt;/GameModifier&gt;
  28. &lt;GameModifier&gt;
  29. &lt;ModType&gt;Map&lt;/ModType&gt;
  30. &lt;Attribute&gt;ChangeShardType&lt;/Attribute&gt;
  31. &lt;StrVal&gt;FireShard&lt;/StrVal&gt;
  32. &lt;/GameModifier&gt;
  33. &lt;ValidTerrainType&gt;Land&lt;/ValidTerrainType&gt;
  34. &lt;ValidTerrainType&gt;Rugged_Land&lt;/ValidTerrainType&gt;
  35. &lt;ValidTerrainType&gt;Fertile_Land&lt;/ValidTerrainType&gt;
  36. &lt;ValidTerrainType&gt;Chasm&lt;/ValidTerrainType&gt;
  37. &lt;ValidTerrainType&gt;ChasmEdge&lt;/ValidTerrainType&gt;
  38. &lt;ValidTerrainType&gt;DesertTerrain&lt;/ValidTerrainType&gt;
  39. &lt;ValidTerrainType&gt;HillsTerrain&lt;/ValidTerrainType&gt;
  40. &lt;ValidTerrainType&gt;SwampTerrain&lt;/ValidTerrainType&gt;
  41. &lt;ValidTerrainType&gt;ArcticTerrain&lt;/ValidTerrainType&gt;
  42. &lt;ValidTerrainType&gt;MountainRange&lt;/ValidTerrainType&gt;
  43. &lt;ValidTerrainType&gt;MountainSide&lt;/ValidTerrainType&gt;
  44. &lt;ValidTerrainType&gt;Forest&lt;/ValidTerrainType&gt;
  45. &lt;ValidTerrainType&gt;Beach&lt;/ValidTerrainType&gt;
  46. &lt;ValidTerrainType&gt;Cliff&lt;/ValidTerrainType&gt;
  47. &lt;ValidTerrainType&gt;River&lt;/ValidTerrainType&gt;
  48. &lt;ValidTerrainType&gt;City&lt;/ValidTerrainType&gt;
  49. &lt;ValidTerrainType&gt;Submerged&lt;/ValidTerrainType&gt;
  50. &lt;ValidTerrainType&gt;BurningLands&lt;/ValidTerrainType&gt;
  51. &lt;ValidTerrainType&gt;Fissure&lt;/ValidTerrainType&gt;
  52. &lt;ValidTerrainType&gt;CurgensTomb&lt;/ValidTerrainType&gt;
  53. &lt;ValidTerrainType&gt;Imperium&lt;/ValidTerrainType&gt;
  54. &lt;ValidTerrainType&gt;Scrapyard&lt;/ValidTerrainType&gt;
  55. &lt;ValidTerrainType&gt;CaveWall&lt;/ValidTerrainType&gt;
  56. &lt;ValidTerrainType&gt;Unknown&lt;/ValidTerrainType&gt;
  57. &lt;ValidTerrainType&gt;Tomb&lt;/ValidTerrainType&gt;

Thanks for your help!

Reply #6 Top

Wouldn't <CanStack> work in this situation? Have you tried it?