Closed TheCowness closed 7 years ago
I think that the spells aren't properly randomized quite yet. I know this because my own seed in my marathon wasn't working correctly either. I must be mighty close, but...
I'm not sure exactly what it's used for yet, but there's a lookup table at $40f84 of how many field spells each spellcasting hero learns (6, 7, 5, 3, 4).
More generally, the data related to spellcasting and item usage is spread out over a lot of places and a substantial proportion of it appears to be hardcoded (i.e. instead of one set of lookup tables there's a lot of lda item_idx; cmp #item_x; beq item_x_handler
scattered all over the game code) The female-only armor is hardcoded this way, as are the effects when you use/equip the Meteorite Armband and, for some reason, the Boomerang.
Also, you've got the spell totals wrong. Cristo learns 13 total spells (not 12) and Brey and Mara both learn 15 (not 14). By the way, there are pointer tables to the learn-which-spells bitmasks (what your code comments call the "gap") and the learn-at-what-level data, so it is theoretically possible to increase the total number of spells a character learns by repointing the data. Just make sure you change both copies of the pointer tables! (there's one set used when initializing characters at the start of a chapter, and another used when you gain a level. Both point to the same data).
I just noticed that the Open spell from DW2 and DW3 exists as an unused spell and is fully functional, though its name is a blank space (in the US version--in the Japanese DQ4 it has the same name as it did in DQ2 and DQ3) It's spell number $39. Costs 0 MP and opens any locked door.
This should be resolved. Please let me know if I'm missing anything; if not, please close. Thanks!
Reiska42 is saying this is fixed, so I'm closing this issue as well.
On seed 948913225 with ludicrous randomization I hit the end of the game and my field spells consisted of one Heal, three Healmores, one Healus, and a NumbOff. No Vivify, Revive, Outside, Return, Antidote, Stepguard, Repel... Hero had Return in battle, but not in the field. Everyone had all of their battle spells, and plenty of ?s on their field list, though those seemed to correspond to the field spells they normally learn.
Is any of this a bug, or was I just horribly unlucky?