Skip to content

Commit

Permalink
Marisa now holds still when she's attacked without protection
Browse files Browse the repository at this point in the history
  • Loading branch information
ToriningenGames committed Oct 22, 2022
1 parent 248b194 commit c0c70aa
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
Binary file modified Art/TileData.gb
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ Inside game:
<li />~~[ ] Redo collision to be more robust and less slow!~~
<li />[ ] Give up on optimizing collision speed and find a way to accept lag
<li />[x] Add the hat interactions
<li />[ ] Push Marisa when she's hit without her hat to protect her
<li />[ ] Fix the danmaku hitboxes being stupid
<li />[x] ~~Push~~ Stop Marisa when she's hit without her hat to protect her
<li />[x] Fix the danmaku hitboxes being stupid
<li />[x] Add danmaku to the second ending
<li />[x] Make danmaku animated
</ul>
15 changes: 10 additions & 5 deletions Source/Chara.asm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ _HatValues:

;This is what happens when a danmaku hits Marisa
Hit_Task:
;DE=(X,Y) of attack source direction
;D=X of attack source direction
;Is Marisa wearing her hat?
LD HL,HatSig
LDI A,(HL)
Expand All @@ -109,12 +109,17 @@ Hit_Task:
XOR B
JR z,+
;Marisa not wearing her hat. Push her back
LD A,60
LD A,20
LD (Hitstun),A
LD C,15
-
RST $00
;Straight line away from the danmaku
;for a fixed number of frames
;Hold still for a bit?
LDH A,($FE)
AND %00001111
LDH ($FE),A
DEC C
JR nz,-
JP EndTask
+
;Marisa wearing her hat. Make it fly away
Expand All @@ -128,7 +133,7 @@ Hit_Task:
LD A,C
LDI (HL),A
LD (HL),B
LD A,120
LD A,60
LD (Hitstun),A
LD A,1
LD ($C0D0),A
Expand Down
8 changes: 4 additions & 4 deletions Source/Collision.asm
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ HitboxHit:
LD H,>HitboxHitStart
-
LDD A,(HL) ;Dirty approximation of euclidean distance (manhattan)
ADD 4
SUB C
BIT 7,A
JR z,+
Expand All @@ -376,24 +377,23 @@ HitboxHit:
+
LD D,A
LDD A,(HL)
ADD 4
SUB B
BIT 7,A
JR z,+
CPL
INC A
+
ADD D
CP 6
CP 8
JR nc,+
;Point hit
;Get hit direction into DE for the hit task
INC L
LDI A,(HL)
ADD 4
SUB B
LD D,A
LD A,(HL)
SUB C
LD E,A
LD BC,Hit_Task
RST $28
RET
Expand Down
5 changes: 3 additions & 2 deletions Source/Cutscenes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ Cs_TransitionIn:
SetVar8 varOldMap,0
UseVarAsVal varMapPtr+1,2
SetVar8 varOldMap+1,0
SetVar varHitstun,127
SetVar varHitstun,40
Return

Cs_ResetFairies:
Expand Down Expand Up @@ -1225,7 +1225,7 @@ Cs_MushroomCollect:
Break
LD A,(Cutscene_Actors)
OR A
CALL z,BreakRet
JR z,+
CALL Access_ActorDE
LD BC,$12 ;_ParentChar
ADD HL,BC
Expand All @@ -1239,6 +1239,7 @@ Cs_MushroomCollect:
XOR C
XOR B
LD ($C000),A
+
CALL BreakRet
JumpRelNZ varAns,3
AssignHat 0,1
Expand Down
1 change: 0 additions & 1 deletion Source/Fairy.asm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ FairyConstructor:
JP NewTaskLo

FairyFrame:
CALL HitboxPushAdd
;Init check
LD HL,_ShootTimer
ADD HL,DE
Expand Down
8 changes: 4 additions & 4 deletions Source/Memory.asm
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ MemAlloc:
LDD (HL),A
DEC E
;If the pointer is $0000, we ran out of memory (bad!)
LD A,D
OR E
RET nz
LD B,B ;Software breakpoint
; LD A,D
; OR E
; RET nz
; LD B,B ;Software breakpoint
RET

MemFree:
Expand Down

0 comments on commit c0c70aa

Please sign in to comment.