From c0c70aa3b90f64a666d66f9780aa8bdd2bf6f3bc Mon Sep 17 00:00:00 2001 From: Orion Chandler Date: Sat, 22 Oct 2022 00:24:36 -0500 Subject: [PATCH] Marisa now holds still when she's attacked without protection --- Art/TileData.gb | Bin 6144 -> 6144 bytes README.md | 4 ++-- Source/Chara.asm | 15 ++++++++++----- Source/Collision.asm | 8 ++++---- Source/Cutscenes.asm | 5 +++-- Source/Fairy.asm | 1 - Source/Memory.asm | 8 ++++---- 7 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Art/TileData.gb b/Art/TileData.gb index 3dcd6ca3e48d3062206dc1dd8274dbb39a619fb1..0b62aa5f8e88bc17f39812e01c393e7db4312549 100644 GIT binary patch delta 25 gcmZoLXfW82z&4ptP+@ZeTLa@{PCkKl#nfd2mf1OE*_F#`c1JpmOJ0r!CLfcb#=fbhWhi2j~`e;ok< V0r3Iz1LFe+2Ol5){~~[ ] Redo collision to be more robust and less slow!~~
  • [ ] Give up on optimizing collision speed and find a way to accept lag
  • [x] Add the hat interactions -
  • [ ] Push Marisa when she's hit without her hat to protect her -
  • [ ] Fix the danmaku hitboxes being stupid +
  • [x] ~~Push~~ Stop Marisa when she's hit without her hat to protect her +
  • [x] Fix the danmaku hitboxes being stupid
  • [x] Add danmaku to the second ending
  • [x] Make danmaku animated diff --git a/Source/Chara.asm b/Source/Chara.asm index 42128bf..22eb75a 100644 --- a/Source/Chara.asm +++ b/Source/Chara.asm @@ -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) @@ -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 @@ -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 diff --git a/Source/Collision.asm b/Source/Collision.asm index c0667dd..e5585f6 100644 --- a/Source/Collision.asm +++ b/Source/Collision.asm @@ -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,+ @@ -376,6 +377,7 @@ HitboxHit: + LD D,A LDD A,(HL) + ADD 4 SUB B BIT 7,A JR z,+ @@ -383,17 +385,15 @@ HitboxHit: 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 diff --git a/Source/Cutscenes.asm b/Source/Cutscenes.asm index be429d1..3a820ad 100644 --- a/Source/Cutscenes.asm +++ b/Source/Cutscenes.asm @@ -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: @@ -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 @@ -1239,6 +1239,7 @@ Cs_MushroomCollect: XOR C XOR B LD ($C000),A ++ CALL BreakRet JumpRelNZ varAns,3 AssignHat 0,1 diff --git a/Source/Fairy.asm b/Source/Fairy.asm index 793e90f..a39f315 100644 --- a/Source/Fairy.asm +++ b/Source/Fairy.asm @@ -171,7 +171,6 @@ FairyConstructor: JP NewTaskLo FairyFrame: - CALL HitboxPushAdd ;Init check LD HL,_ShootTimer ADD HL,DE diff --git a/Source/Memory.asm b/Source/Memory.asm index 707047a..bbb2e24 100644 --- a/Source/Memory.asm +++ b/Source/Memory.asm @@ -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: