Users browsing this thread: 1 Guest(s)
Final Requests for Help

#51
Posts: 48
Threads: 5
Thanks Received: 64
Thanks Given: 3
Joined: Apr 2018
Reputation: 6
Status
Shell
You have to pair a JSR with RTS and JSL with RTL. Since the subroutine gets called both from within C2 and from another bank, it needs paths for both.
  Find
Quote  
[-] The following 1 user says Thank You to Subtraction for this post:
  • PowerPanda (05-11-2021)

#52
Posts: 515
Threads: 46
Thanks Received: 237
Thanks Given: 131
Joined: Feb 2017
Reputation: 23
Status
None
Hey Subtraction, I have a question on this section of the code:

Code:
check_break:
PHA
PHP
JSR $2B63      ;  Multiply A by 30, size of item data block
REP #$10       ;  Set 16-bit X and Y
TAX
LDA $D85012,X  ;  equipment spell byte.  Bit 7: 1 = remove from inventory upon usage, 0 = nope
BPL no_break   ;  if the flag is not set, this tool never breaks
JSR $4B5A
AND #$1F       ;  1/32 chance of breaking
BNE no_break
LDA #$44       ;  "Orge Nix broke!" dialog. Works for most tools but gets clobbered by the Air Anchor "Move and you're dust!"
STA $3401      
SEP #$10       ;  Set 8-bit X and Y
TYX
LDA #$FF
STA $32F4,X    ;  null item index to add to inventory. This means the item will stay deducted from your inventory.
LDA $3018,X
BRA check_break_end

Specifically:
JSR $4B5A
AND #$1F       ;  1/32 chance of breaking

With it saying #$1F, does that mean that it's actually breaking 1/8th of the time? I was expecting "AND #$05". Reports from players have their tools breaking multiple times before they even hit the Returner's hideout.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#53
Posts: 48
Threads: 5
Thanks Received: 64
Thanks Given: 3
Joined: Apr 2018
Reputation: 6
Status
Shell
(05-14-2021, 12:41 PM)PowerPanda Wrote: Hey Subtraction, I have a question on this section of the code:

Specifically:
JSR $4B5A
AND #$1F       ;  1/32 chance of breaking

With it saying #$1F, does that mean that it's actually breaking 1/8th of the time? I was expecting "AND #$05". Reports from players have their tools breaking multiple times before they even hit the Returner's hideout.

No, AND #$05 would be a 1/8 chance. In fact, when I was testing this, it was taking too long for tools to break, so I changed it to AND #$03 to make them break more frequently.

JSR $4B5A sets the accumulator to a pseudo-random number, 0–255
AND #$1F clears the top 3 bits, making it a pseudo-random number from 0–31. If the number is now 0, it sets the Zero flag; otherwise it clears the Zero flag.
BNE branches if the Zero flag is clear.
  Find
Quote  

#54
Posts: 3
Threads: 0
Thanks Received: 0
Thanks Given: 0
Joined: Mar 2019
Reputation: 0
Status
None
For what it’s worth 1/32 sounds like a lot to me. A big dungeon might cause multiple breaks. If breakage is rare it might be more impactful because people forget to account for it.
  Find
Quote  

#55
Posts: 79
Threads: 12
Thanks Received: 6
Thanks Given: 21
Joined: Jun 2018
Reputation: 0
Status
None
Alternate idea (perhaps more appropriate for Setzer): make tool use cost gil, and make the cost determined by something similar to the damage formula.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite