Okay, so, here it is!
NOTE: I'm keeping addresses and bytes here for referential purposes. I'm well aware from your last post that these should be removed for insertion.
LDY $8F ; number of monsters in the current group
DEY
BEQ done ; if only 1 monster, then no need to pluralize, so we're done
DEX ; back up to [end-FA]
DEX ; back up to final letter of monster name
LDA $60F1,X ; read final letter of monster name
CMP #$0F ; "f"
BEQ $885E ; -f -> -ves (not used)
CMP #$22 ; "y"
BEQ $8874 ; -y -> -ies
CMP #$12 ; "i"
BEQ $8863 ; -i -> -ies
CMP #$1C ; "s"
BEQ $8835 ; -rus -> -rii, -s -> -ses
CMP #$11 ; "h"
BEQ $886B ; -ch -> -ches, -sh -> -shes, -h -> -hs
CMP #$17 ; "n"
BEQ $889C ; -man -> -men, -Man -> -Men, -n -> -ns
CMP #$0A ; "a"
BEQ e_handler ; Madusa -> Madusae
CMP #$1B ; "r"
BEQ d_handler ; Man O' War -> Men O' War
; control flow target (from $883A, $8841, $8863, $8884, $888F, $889D, $88E1)
; append "s" to monster name
; default pluralization if not handled above
add_s:
INX
LDA #$1C ; "s"
STA $60F1,X ; append "s" to monster name
INX
LDA #$FA ; [end-FA]
STA $60F1,X ; append [end-FA] to monster name
INX
; control flow target (from $87F8, $8843)
done:
SEC
RTS
; -s pluralization handler: Cyclops, Gigantes, and Atlas don't change, Magus changes to Magi otherwise add es
$8835: LDA $60F0,X ; read second-last letter of monster name
$8838: CMP #$0E ; "e"
$883A: BEQ $8830 ; if -es, singular=plural
$883C: CMP #$0A ; "a"
$883F: BEQ $8830 ; if -as, singular=plural
$8841: CMP #$19 ; "p"
$8843: BEQ $8830 ; if -ps, singular=plural
$8845: LDA $60EF,X ; read third-last letter of monster name
$8848: CMP #$10 ; "g"
$884A: BEQ $8855 ; Shortcut here, if g_s (Magus) replace us with i
$884C: BNE $885D ; If not either Cyclops or Atlas (or Magus), add -es
; append "es" to monster name
$884E:E8 INX
$884F:A9 0E LDA #$0E ; "e"
$8851:9D F1 60 STA $60F1,X ; append "e" to monster name
$8854:D0 BE BNE $8823 ; append "s" to monster name; note that this branch is always taken
$8856: STA $60F0,X ; replace -us with -ii (how do I change this to replace -us to -i?)
$8859: STA $60F1,X
$885C: SEC
$885D: RTS
; -f pluralization handler: -f -> -ves (no need to have this, but if there's space, might keep it for possible hacks)
$885E:A9 1F LDA #$1F ; "v"
$8860:4C 6C 88 JMP $886C ; replace "f" with "v" then append "es"
; -i pluralization handler: -i -> -ies (same as above)
$8863:A9 12 LDA #$12 ; "i"
; unused control flow target (from $8867)
$8865:9D F1 60 STA $60F1,X ; replace final letter with "i"
$8868:4C 5D 88 JMP $884E ; append "es"
; -h pluralization handler: -ch -> -ches, -sh -> -shes, -h -> -hs (no longer need ch, keeps Mech as Mechs)
$886B:BD F0 60 LDA $60F0,X ; read second-last letter of monster name
$886E:C9 1C CMP #$1C ; "s"
$8870:F0 E0 BEQ $885D ; if -sh, append "es"
$8872:D0 A4 BNE $8823 ; else, append "s"
; -y pluralization handler: like -i, except needs exceptions for boy-boys and dragonfry-no change
$8874 LDA $60F0,X ; read second-last letter of monster name
$8877 CMP #$18 ; "o"
$8879 BEQ $8823 ; if -oy, append "s"
$887B CMP #$18 ; "r"
$887D BEQ $8830 ; if -ry, no change
$887F BNE $886C ; otherwise replace y with -ies
; -a pluralization handler: needed for madusa -> madusae
$8881 LDA $60F0,X ; read second-last letter of monster name
$8884 CMP #$1C ; "s"
$8886 BEQ ; if -sa add "e"
$8888 BNE $8823 ; if not -sa append "s"
;adding "e"
$888A INX
$888B LDA #$0E ; "e"
$888D STA $60F1,X ; append "e" to monster name
$8890 JMP 8829
; -r pluralization handler: needed for man o' war
$8893 LDA $60E9,X ; read ninth from end letter of monster name
$8895 CMP #$0A ; "a"
$8897 BNE $8823 ; if not "a" append "s"
$8899 STA $60E9,X ; replace "a" with "e" so that Man o' War becomes "Men o' War" <-IS THIS RIGHT?
; -n pluralization handler: -man -> -men, -Man -> -Men, -n -> -ns
$889C:BD F0 60 LDA $60F0,X ; read second-last letter of monster name
$889F:C9 0A CMP #$0A ; "a"
$88A1:D0 9D BNE $8823 ; if not -an, append "s"
$88A3:BD EF 60 LDA $60EF,X ; read third-last letter of monster name
$88A6:C9 16 CMP #$16 ; "m"
$88A8:F0 04 BEQ $8891 ; -man -> -men
$88AA:C9 30 CMP #$30 ; "M"
$88AC:D0 92 BNE $8823 ; if not -Man, append "s"
; control flow target (from $888B)
$88AE:A9 0E LDA #$0E ; "e"
$88B0:9D F0 60 STA $60F0,X ; replace second-last letter of monster name
; control flow target (from $88DF)
$88B3:38 SEC
$88B4:60 RTS
Not neading the -dead or -mouse codes freed up a bunch of space. So much so, I thought I'd just keep some of the extra codes I didn't necessarily need like f-ves or i-ies in case someone wants to use my script port as a base for a hack that needs new monster names.
I just had a couple of confused points. I'm not quite sure how the replace text code works so I'm a little stumped at changing the old -us to -ii code to just -us to -i (Magus to Magi)
$8856: STA $60F0,X ; replace -us with -ii (how do I change this to replace -us to -i?)
$8859: STA $60F1,X
$885C: SEC
$885D: RTS
and I just wanted to run my Man O' War to Men O' War code by you
; -r pluralization handler: needed for man o' war
$8893 LDA $60E9,X ; read ninth from end letter of monster name
$8895 CMP #$0A ; "a"
$8897 BNE $8823 ; if not "a" append "s"
$8899 STA $60E9,X ; replace "a" with "e" so that Man o' War becomes "Men o' War" <-IS THIS RIGHT?