A quick fix for the Monster Drops issue.
1/ Modify the "HandleDrops.asm" script (in the "Routines\Basic\ModuleScripts\HurtWinLoseDeath" folder) , replacing with this code:
2/ And you have to fix the "HandleHurtMonster.asm" (in the "GameEngineData\Routines\Basic\ModuleScripts\HurtWinLoseDeath") folder, replacing the "tempx" by "tempy" at line 64 and line 75.
Before:
After:
3/ If you are using the sprite-based sword weapon (that comes by default with the 4.1), you also have to modify the HandleSpriteWeapon.asm:
http://nesmakers.com/viewtopic.php?f=3&t=1738
4/ And also have to modify the HandleObjectCollision.asm around line 200, replacing:
By:
Updates:
2019-01-21 fixed a typo in the 4/ (the f**** auto-correction of macOS or Safari... don't know which one)
2019-01-20 added the HandleHurtMonster modifications.
1/ Modify the "HandleDrops.asm" script (in the "Routines\Basic\ModuleScripts\HurtWinLoseDeath" folder) , replacing with this code:
Code:
;;; monster objects drop at random.
LDA otherCenterX
SBC #$08
STA temp
LDA otherCenterY
SBC #$08
STA temp1
LDA Object_scroll,x
SBC #$00
STA temp3
JSR GetRandomNumber
AND #%00000111 ;; now, we have a number between 0 and 7
BNE notPickup0 ;;
;; zero case here;
;;; here, we'll create health
CreateObject temp, temp1, #$04, #$00, temp3
JMP donePickup
notPickup0:
CMP #$01
BNE notPickup1
;; one case here;
;;; here, we'll create currency
CreateObject temp, temp1, #$07, #$00, temp3
JMP donePickup
notPickup1:
CMP #$02
BNE notPickup2
;; two case here;
;;; here, we'll create currency
CreateObject temp, temp1, #$07, #$00, temp3
JMP donePickup
notPickup2:
;;;; do the same for each case.
;;;; blank cases will simply return 'nothing'.
donePickup:
;;; ALL cases create a "pow"
CreateObject temp, temp1, #OBJ_MONSTER_DEATH, #$00, temp3
2/ And you have to fix the "HandleHurtMonster.asm" (in the "GameEngineData\Routines\Basic\ModuleScripts\HurtWinLoseDeath") folder, replacing the "tempx" by "tempy" at line 64 and line 75.
Before:
Code:
TXA
STA tempx
AddValue #$08, myScore, #$01, #$00
;STA hudElementTilesToLoad
; LDA #$00
; STA hudElementTilesMax
; LDA DrawHudBytes
; ora #HUD_myScore
; STA DrawHudBytes
UpdateHud HUD_myScore
LDX tempx
After:
Code:
TXA
STA tempy
AddValue #$08, myScore, #$01, #$00
;STA hudElementTilesToLoad
; LDA #$00
; STA hudElementTilesMax
; LDA DrawHudBytes
; ora #HUD_myScore
; STA DrawHudBytes
UpdateHud HUD_myScore
LDX tempy
3/ If you are using the sprite-based sword weapon (that comes by default with the 4.1), you also have to modify the HandleSpriteWeapon.asm:
http://nesmakers.com/viewtopic.php?f=3&t=1738
4/ And also have to modify the HandleObjectCollision.asm around line 200, replacing:
Code:
isLethalInvincible:
LDX tempx
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1
CreateObject temp, temp1, #OBJ_MONSTER_DEATH, #$00, currentNametable ;; create "splat"
LDX tempx
;;; ordinarily we'll want to destroy the instance.
DeactivateCurrentObject
;; incrase score, you killed a monster
PlaySound #SND_SPLAT
TXA
STA tempx
AddValue #$08, myScore, #$01, #$00
;;; we also need to set up the routine to update the HUD
;; for this to work right, health must be a "blank-then-draw" type element.
;STA hudElementTilesToLoad
; LDA #$00
; STA hudElementTilesMax
; LDA DrawHudBytes
; ora #HUD_myScore
; STA DrawHudBytes
UpdateHud HUD_myScore
LDX tempx
By:
Code:
isLethalInvincible:
LDX tempx
;LDA Object_x_hi,x
;STA temp
;LDA Object_y_hi,x
;STA temp1
;;;;;;;;CreateObject temp, temp1, #OBJ_MONSTER_DEATH, #$00, currentNametable ;; create "splat"
;LDX tempx
;;; ordinarily we'll want to destroy the instance.
DeactivateCurrentObject
;; incrase score, you killed a monster
PlaySound #SND_SPLAT
TXA
STA tempx
AddValue #$08, myScore, #$01, #$00
;;; we also need to set up the routine to update the HUD
;; for this to work right, health must be a "blank-then-draw" type element.
;STA hudElementTilesToLoad
; LDA #$00
; STA hudElementTilesMax
; LDA DrawHudBytes
; ora #HUD_myScore
; STA DrawHudBytes
UpdateHud HUD_myScore
LDX tempx
JSR HandleDrops
Updates:
2019-01-21 fixed a typo in the 4/ (the f**** auto-correction of macOS or Safari... don't know which one)
2019-01-20 added the HandleHurtMonster modifications.