;;; CGRAM ;;; { BG palette 5: Draygon body Sprite palette 1: Clone of palette 7, seemingly unused. Used by unused enemy projectile $8E6C Sprite palette 2: Draygon foaming at the mouth, Draygon goop Sprite palette 3: Draygon goop when shot. Black palette (due to a bug, see $A5:8687) Sprite palette 7: Draygon eye/tail/arms, mini-Draygon } ;;; WRAM ;;; { Slot ID Enemy Enemy RAM 0 $DE3F Draygon body $0F78..0FB7 1 $DE7F Draygon eye $0FB8..0FF7 2 $DEBF Draygon tail $0FF8..1037 3 $DEFF Draygon arms $1038..1077 ; Draygon body $0FA8: Draygon body function $0FAA: Draygon body function timer / Draygon swoop Y position index $0FAC: Draygon swoop duration * 4. Swoop duration referring to the time taken to reach the apex of a swoop from the starting/ending point $0FAE: Draygon X speed $0FB0: Draygon X subspeed ; Draygon eye $0FE8: Draygon eye function $0FF2: Draygon eye angle to Samus. Used to save some cycles by not redundantly setting the eye instruction list $7E:2000..2FFF: BG2 tilemap (initialised to 0338h). Size = 400h. Modified by instruction lists via extended tilemap entries $7E:7800: Draygon left side reset X position. Set to spawn X position (= -50h) $7E:7802: Draygon reset Y position. Set to spawn Y position (= -50h) $7E:7804: Draygon right side reset X position. Set to spawn X position + 2A0h (= 250h) $7E:7806: Draygon goop counter. Number of remaining goops to fire, counts down from 10h $7E:780A: Draygon spiral X radius $7E:780C: Draygon spiral X position $7E:780E: Draygon spiral Y position $7E:7810: Draygon spiral angle $7E:7812: Draygon spiral X subradius $7E:7814: Draygon spiral Y subposition $7E:7816: Draygon spiral angle delta. Unit 1/100h angle-unit $7E:7818: Draygon tail whip timer $7E:781A: Draygon goop Y oscillation angle $7E:781C: Draygon health-based palette table index $7E:781E: Draygon swoop Y acceleration. Unit 1/100h px/frameĀ². Initialised to 18h. Increased by 8 in enemy shot up to 98h (even for dud shots) $7E:8000: Draygon facing direction. 0 = left, 1 = right $7E:8010: Draygon death drift X speed. Calculate on fatal damage, but never read $7E:8012: Draygon death drift X subspeed. Calculate on fatal damage, but never read $7E:8014: Draygon death drift Y speed. Calculate on fatal damage, but never read $7E:8016: Draygon death drift Y subspeed. Calculate on fatal damage, but never read $7E:8800..0B: Draygon turret destroyed flags. Word per turret. First two entries are unused, last entry is set in Draygon init, otherwise they're set by the turret PLMs $7E:8806: Angle temporary in $9185 and $960D. Pretty pointless in both cases $7E:880C: Draygon fight intro dance index $7E:883C: Draygon body graphics X displacement $7E:883E: Draygon body graphics Y displacement $7E:9002..97FF: Draygon swoop Y positions. Entries are 4 bytes apart (even though only 2 bytes are used). Iterate backwards for downwards movement, forwards for upwards movement } ;;; Execution flow ;;; { $8687: Draygon body initialisation { Enemy graphics drawn hook = $A5:9342 Draygon body instruction list pointer = $9889 Draygon body function = $871B } $C46B: Draygon eye initialisation { Draygon eye instruction list pointer = $9944 Draygon eye function = RTS } $C599: Draygon tail initialisation { Draygon tail instruction list pointer = $99FC } $C5AD: Draygon arms initialisation { Draygon arms instruction list pointer = $97E7 } $86FC: Draygon body main AI { Execute Draygon body function } $C486: Draygon eye main AI { Execute Draygon eye function } Draygon body functions: { $871B: Fight intro { $871B: Initial delay $878B: Dance { Draygon body function = $87F4 (swoop right) } } $87F4: Swoop right { $87F4: Setup { Draygon body instruction list pointer = $97D1 } $88B1: Descending { Draygon arms instruction list pointer = $9C06 } $8922: Apex $8951: Ascending { Draygon arms instruction list pointer = $9BDA If [random number] % 2 != 0: Draygon body function = $89B3 (swoop left) Else: Draygon body function = $8C8E (goop left) } } $89B3: Swoop left { $89B3: Setup { Draygon body instruction list pointer = $97BB } $8A00: Descending { Draygon arms instruction list pointer = $9813 } $8A50: Apex $8A90: Ascending { Draygon arms instruction list pointer = $97E7 If [random number] % 2 != 0: Draygon body function = $87F4 (swoop right) Else: Draygon body function = $8B0A (goop right) } } $8B0A: Goop right { $8B0A: Setup { Draygon arms instruction list pointer = $9C06 Draygon body instruction list pointer = $97D1 } $8B52: Move until Samus in range $8BAE: Firing goops { If [Samus X speed divisor] != 0: Draygon body function = $8E19 (chase Samus) Else: { Draygon body instruction list pointer = $9C90 Draygon arms instruction list pointer = $9BDA } } $8C33: Move until off-screen { Draygon body function = $89B3 (swoop left) } } $8C8E: Goop left { $8C8E: Setup { Draygon arms instruction list pointer = $9C06 Draygon body instruction list pointer = $97BB } $8CD4: Move until Samus in range $8D30: Firing goops { If [Samus X speed divisor] != 0: Draygon body function = $8E19 (chase Samus) Else: { Draygon body instruction list pointer = $98FE Draygon arms instruction list pointer = $97E7 } } $8DB2: Move until off-screen { If [Samus X speed divisor] != 0: Draygon body function = $8E19 (chase Samus) Else: Draygon body function = $87F4 (swoop right) } } $8E19: Chase Samus { If [Samus X speed divisor] = 0: Draygon body function = $9154 (fly straight up) Else if grabbed Samus: { Draygon arms instruction list pointer = $9845/$9C38 If grapple active: Draygon body function = $8F10 (repelled by grapple) Else: Draygon body function = $8F1E (grabbed Samus) } } $8F10: Repelled by grapple { Draygon body function = $9128 (flail tail and fly straight up) } $8F1E: Grabbed Samus { $8F1E: Moving to target position { Draygon body instruction list pointer = $9922/$9CB4 If Samus released from Draygon: Draygon body function = $9154 (fly straight up) } $8FD6: Rising spiral movement { If [random number] % 100h = 0: Draygon body function = $90D4 (tail whip) Else if [Draygon spiral Y position] < 40h: Draygon body function = $9105 (final tail whip) Else if Samus released from Draygon: Draygon body function = $9154 (fly straight up) } $90D4: Tail whip { Draygon tail instruction list pointer = $9AE8/$9EA1 If Samus released from Draygon: Draygon body function = $9154 (fly straight up) Draygon body function = $8FD6 (rising spiral movement) } $9105: Final tail whips { $9105: Start { Draygon tail instruction list pointer = $9A68/$9E21 If Samus released from Draygon: Draygon body function = $9154 (fly straight up) } $9124: Ongoing { If Samus released from Draygon: Draygon body function = $9154 (fly straight up) ; Draygon tail instruction list eventually sets Draygon body function = $9128 (flail tail and fly straight up) } } } $9128: Flail tail and fly straight up { Draygon body function = $9154 (fly straight up) Draygon tail instruction list pointer = $9B5A/$9F15 } $9154: Fly straight up { Draygon body function = $87F4 (swoop right) } $9185: Death sequence { $9185: Drift to death spot { Draygon body instruction list pointer = $97B9 Draygon eye instruction list pointer = $999C/$9D3E } $9294: Wait for mini-Draygons $92AB: Buried by mini-Draygons { Draygon body instruction list pointer = $98ED (delete) } } } } ;;; Enemy headers ;;; { __________________________________ $DE3F: Draygon body | _________________________ $DE7F: Draygon eye | | ________________ $DEBF: Draygon tail | | | _______ $DEFF: Draygon arms | | | | 2000 1800 1800 1800 ; 0: Tile data size A1F7 8069 A1F7 A1F7 ; 2: Palette 1770 1770 1770 1770 ; 4: Health 00A0 00A0 00A0 00A0 ; 6: Damage 0040 0002 0010 0018 ; 8: Width 0040 0002 0020 0018 ; Ah: Height A5 A5 A5 A5 ; Ch: Bank 04 00 00 00 ; Dh: Hurt AI time 0000 0000 0000 0000 ; Eh: Cry 0008 0000 0000 0000 ; 10h: Boss value 8687 C46B C599 C5AD ; 12h: Initialisation AI 0001 0001 0001 0001 ; 14h: Number of parts 86FC C486 C5AA C5C4 ; 18h: Main AI 8000 800F 800F 800F ; 1Ah: Grapple AI 954D 804C 804C 804C ; 1Ch: Hurt AI 8041 8041 8041 8041 ; 1Eh: Frozen AI 0000 0000 0000 0000 ; 20h: X-ray AI 0000 0000 0000 0000 ; 22h: Death animation 9607 804C 804C 804C ; 28h: Power bomb reaction 95EA 804C 8023 804C ; 30h: Enemy touch 95F0 804C 802D 804C ; 32h: Enemy shot B0C800 B0C800 B0C800 B0C800 ; 36h: Tile data 05 05 05 05 ; 39h: Layer F440 F446 F440 F440 ; 3Ah: Drop chances ($B4) F144 F144 F144 F144 ; 3Ch: Vulnerabilities ($B4) 0000 0000 0000 0000 ; 3Eh: Enemy name ($B4) } ;;; Enemy vulnerabilities ;;; { ; Vulnerability format: ; v = fddddddd ; If v = FFh: ; Freeze, no damage ; Else: ; d: Damage multiplier * 2 ; f: Does not freeze ; _________________________________________________________________ 0: Power ; | ______________________________________________________________ 1: Wave ; | | ___________________________________________________________ 2: Ice ; | | | ________________________________________________________ 3: Ice + wave ; | | | | _____________________________________________________ 4: Spazer ; | | | | | __________________________________________________ 5: Spazer + wave ; | | | | | | _______________________________________________ 6: Spazer + ice ; | | | | | | | ____________________________________________ 7: Spazer + ice + wave ; | | | | | | | | _________________________________________ 8: Plasma ; | | | | | | | | | ______________________________________ 9: Plasma + wave ; | | | | | | | | | | ___________________________________ Ah: Plasma + ice ; | | | | | | | | | | | ________________________________ Bh: Plasma + ice + wave ; | | | | | | | | | | | | ; | | | | | | | | | | | | ____________________________ Ch: Missile ; | | | | | | | | | | | | | _________________________ Dh: Super missile ; | | | | | | | | | | | | | | ______________________ Eh: Bomb ; | | | | | | | | | | | | | | | ___________________ Fh: Power bomb ; | | | | | | | | | | | | | | | | ________________ 10h: Speed booster ; | | | | | | | | | | | | | | | | | _____________ 11h: Shinespark ; | | | | | | | | | | | | | | | | | | __________ 12h: Screw attack ; | | | | | | | | | | | | | | | | | | | _______ 13h: Charged beam ; | | | | | | | | | | | | | | | | | | | | ____ 14h: Pseudo screw attack ; | | | | | | | | | | | | | | | | | | | | | _ 15h: Unused ; | | | | | | | | | | | | | | | | | | | | | | $B4:F144 db 80,80,80,80,80,80,80,80,80,80,80,80, 82,82,80,80,80,81,80,82,82,80 } ;;; Enemy drop chances ;;; { ; ________________ ; 0: Small health ; | _____________ ; 1: Big health ; | | __________ ; 2: Missiles ; | | | _______ ; 3: Nothing ; | | | | ____ ; 4: Super missiles ; | | | | | _ ; 5: Power bombs ; | | | | | | $B4:F440 db 32,32,32,00,32,37 ; 19.6% 19.6% 19.6% 19.6% 21.6% - Draygon body/tail/arms $B4:F446 db 05,1E,6E,64,05,05 ; 2.0% 11.8% 43.1% 39.2% 2.0% 2.0% - Draygon eye (used for goop) } ;;; Enemy population ;;; { ; ____________________________________ Enemy ID ; | _______________________________ X position ; | | __________________________ Y position ; | | | _____________________ Initialisation parameter ; | | | | ________________ Properties (2000h: process instructions, 800h: process off-screen, 400h: intangible) ; | | | | | ___________ Extra properties (4: extended spritemap format) ; | | | | | | ______ Parameter 1 ; | | | | | | | _ Parameter 2 ; | | | | | | | | $A1:D314 dx DE3F,FFB0,FFB0,0000,2800,0004,0000,0000, ; Draygon body DE7F,FFB0,FFB0,0000,2C00,0004,0000,0000, ; Draygon eye DEBF,FFB0,FFB0,0000,2C00,0004,0000,0000, ; Draygon tail DEFF,FFB0,FFB0,0000,2C00,0004,0000,0000, ; Draygon arms FFFF, 00 } ;;; Library background commands ;;; { ; Draygon alive $8F:E108 dx 0002,7E2000,4800,1000, ; Copies the blank tilemap initialised by Draygon's init AI to VRAM BG2 0000 ; Draygon dead $8F:E113 dx 000A, 0000 }