Users browsing this thread: 2 Guest(s)
Making a Weapon Deal 2x Damage to a New Monster Type

#5
Posts: 2,550
Threads: 98
Thanks Received: 148
Thanks Given: 160
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
I have a bit of a question regarding this: I just attempted to do this, also for dragons. I set it up to the weapon extra effect of 0xC 'Curative attributes', which is the Heal Rod code which I have unused. So, I set up my weapon, then, since I'm already using the unused bit 4 for the Special Byte 3 flags, I went with the one directly after the 'is Human' flag, which would be unused bit 6... So, I set the dragon monster to have this flag, and tested it out, and it would not pick up the flag being checked and thus skip the double damage part:

$C2/3F7E 4C DA 41    JMP $41DA  [$C2:41DA] (had to jump to free space due to needing 1 more byte)
$C2/41DA B9 95 3C    LDA $3C95,y[$7E:3C99]
$C2/41DD 89 20       BIT #$20
$C2/41DF F0 04       BEQ $04    [$41E5]
$C2/41E5 60          RTS

Now, according to this tutorial I'm pretty sure I did it correctly, putting the BIT check as $20, because since it is the bit directly after the Human one, it would be $20, right?
00100000 = bit 6 (unused) = 32 dec = 20 hex = 89 20

But like I say this did not work. So I tried just putting the human check of A9 10, and it seems to work as intended:

$C2/3F7E 4C DA 41    JMP $41DA  [$C2:41DA] (had to jump to free space due to needing 1 more byte)
$C2/41DA B9 95 3C    LDA $3C95,y[$7E:3C99]
$C2/41DD 89 10       BIT #$10
$C2/41DF F0 04       BEQ $04    [$41E5]
$C2/41E1 E6 BC       INC $BC    [$00:00BC]
$C2/41E3 E6 BC       INC $BC    [$00:00BC]
$C2/41E5 60          RTS        

But I am confused as to why it does, and why what I first tried did not. The monster in question has the new unused bit directly after human, not human, so...why would it still work with $10? And why wouldn't it work with $20, which is the unused bit I intended to use. Thank you.

EDIT: Annnnnd crap I see that this 2x to dragon-type weapon/flag is also triggering on 'is human' monsters, probably from sharing the BIT #$10 bit I'd imagine... So that's a fail. So my question persists about why the unused bit 6 I'm trying to use is not working.


We are born, live, die and then do the same thing over again.
Quote  



Messages In This Thread
RE: Newbie Coding 01: Making a Weapon Deal 2x Dmg to a New Monster Type - by Gi Nattak - 01-28-2018, 08:23 PM

Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite