Users browsing this thread: 1 Guest(s)
Espers teaching Stat gains

#5
Posts: 179
Threads: 3
Thanks Received: 24
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
If I understand correctly, I think you can do this with a lookup table. Put your spell index in the accumulator, subtract $25 then transfer to x and load from the lookup table. Your lookup table will be an array of bytes, one for each skill-up value. You can put the table anywhere that you have free space.

Code:
; turn $25 into $09, etc.
   sec
   sbc #$25
   tax
   lda lookup_table,x

; somewhere in free space
lookup_table:
   .db $09,$09,$09,$0a,$0a,$0a,...

Alternatively, if the conversion from spell index to skill-up id is a simple mathematical function (i.e. skill-up = 9 + (spell - $25) * 3) you could write an algorithm to convert it. This might save a few bytes but it won't be as flexible.
  Find
Quote  
[-] The following 1 user says Thank You to Everything for this post:
  • Morendo (11-12-2020)



Messages In This Thread
Espers teaching Stat gains - by Morendo - 09-09-2020, 04:28 PM
RE: Espers teaching Stat gains - by Turbotastic - 09-17-2020, 12:42 AM
RE: Espers teaching Stat gains - by Morendo - 09-25-2020, 12:00 PM
RE: Espers teaching Stat gains - by Morendo - 11-12-2020, 05:09 AM
RE: Espers teaching Stat gains - by Everything - 11-12-2020, 03:28 PM
RE: Espers teaching Stat gains - by Bropedio - 12-10-2020, 05:38 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite