It seems to be working very well for what I need it to do, and Dale is some sort of Assembler 6502 Wizard.
I'm having an issue as I'm trying to incorporate the Unique Deaths for Monsters tweak as pointed out here: nesmakers.com/viewtopic.php?f=60&t=3781&p=20603
In short, I create an Action Step for my Monsters in which when they are KO'd, rather than deactivate, they go to a Death Animation unique to the monster.
It's not working the way I hoped it would, and after tinkering around with for the last few days and trying to solve this problem on my own, I'm out of ideas on how to get it to work. When you KO the monster, yes, it goes to the 8th action state for a millisecond -- but then returns to life as action state 01. You have to kill the monster several times (and it does the same thing -- flip to action state 07 for a millisecond, blink, and then return to action state 00) before it finally disappears for good. I'd love to know what I'm doing wrong and how to fix this.
I'd like, when KO'd with a projectile, for:
-the monster to go to Action State 07
-the Action State 07 animation to play out
-and then the monster be destroyed
Here is my HandleHurtMonster_DC.asm code:
Code: Select all
;;; what should we do with the monster? ;;; monster is loaded in x LDA Object_vulnerability,x AND #%00000100 ;; is it weapon immune? BEQ notWeaponImmune ;PlaySound #SFX_MISS JMP skipHurtingMonsterAndSound notWeaponImmune: LDA Object_status,x AND #HURT_STATUS_MASK BEQ dontskipHurtingMonster JMP skipHurtingMonster dontskipHurtingMonster: LDA Object_status,x ORA #%00000001 STA Object_status,x LDA #HURT_TIMER STA Object_timer_0,x ;;; assume idle is in step 0 - uses idle for hurt state - JF ChangeObjectState #$00,#$02 ;;;; unfortunately this recoil is backwards LDA Object_status,x AND #%00000100 BNE skipRecoilBecauseOnEdge LDA Object_vulnerability,x AND #%00001000 BNE skipRecoilBecauseOnEdge ;; skip recoil because bit is flipped to ignore recoil LDA selfCenterX STA recoil_otherX LDA selfCenterY STA recoil_otherY LDA otherCenterX STA recoil_selfX LDA otherCenterY STA recoil_selfY JSR DetermineRecoilDirection skipRecoilBecauseOnEdge: LDA Object_health,x SEC SBC #$01 CMP #$01 BCC + JMP notMonsterDeath + LDA Object_x_hi,x STA temp LDA Object_y_hi,x STA temp1 ChangeObjectState #$07,#$01 ;;; step 07 is destroyed monster -JF ;;; DC suggestion - uncomment this and the monster is no longer a monster ;LDA Object_flags,x ;AND #%11110111 ;; remove the "monster" flag of the object ;STA Object_flags,x ;;; destroy monster after killing - JF ;DeactivateCurrentObject PlaySound #SND_MONSTER_DEATH ;;;;;;;;;;;;;;;;;; ok, so now we also add points to score ;LDY Object_type,x ;LDA ObjectWorth,y ;STA temp ; AddValue #$03, GLOBAL_Player1_Score, temp ;arg0 = how many places this value has. ;arg1 = home variable ;arg2 = amount to add ... places? ;; and this should trip the update hud flag? ;;;; TXA STA tempy ;;dale_coop ;AddValue #$08, myScore, #$01, #$00 ;STA hudElementTilesToLoad ;UpdateHud HUD_myScore LDX tempy ;;dale_coop JSR HandleDrops ;;JSR HandleToggleScrolling ;; dale_coop removed handle scroll CountObjects #%00001000, #$00 LDA monsterCounter CLC ;;dale_coop BEQ + JMP ++ + .include SCR_KILLED_LAST_MONSTER ++ JMP skipHurtingMonster notMonsterDeath: STA Object_health,x PlaySound #SND_MONSTER_HURT skipHurtingMonster: ;;PlaySound #SND_MONSTER_HURT skipHurtingMonsterAndSound: LDX tempx LDA Object_type,x ;; we don't destroy the melee object CMP #OBJECT_PLAYER_MELEE BEQ + ;; what should we do with the projectile? DeactivateCurrentObject ;; destroy it ? +
Thanks to anyone who can help!