import math, sys; sys.path.insert(0, '../../b5tools'); from rec import upsert; from snd import snd TONGUES = [[round(22.4 * math.cos(i * math.pi / 4), 2), round(22.4 * math.sin(i * math.pi / 4), 2)] for i in range(8)] def attacks(rage): out = [ # 0 Attack1 (state 8): a Fistuloid out toward Isaac. {"animation": "Attack1", "rolled": False, "release": "Shoot", "spawn": ["fistuloid"], "spawn_speed": 5, "spawn_offset": 20, "sounds": [snd(0x74, "Start"), snd(0x109, "Shoot")]}, # 1 Attack2 (state 9): eight Chubber tongues lashed out all round at 22.4. {"animation": "Attack2", "rolled": False, "release": "Shoot", "spawn": ["chubber_tongue"], "count": 8, "spawn_velocity": TONGUES, "spawn_at": [[v[0] * 1.5, v[1] * 1.5] for v in TONGUES], "sounds": [snd(0xd5, "Shoot")]}, # 2 Attack3 (state 10): one big shot at Isaac at 10 leaving red creep. {"animation": "Attack3", "rolled": False, "release": "Shoot", "shots": [{"shot": "green", "speed": 10, "scale": 2, "green": {"creep": "red", "velocity_scale": 1}}], "sounds": [snd([0x13e, 0xd4], "Shoot")], "cooldown": 90, "cooldown_random": [60, 1]}, # 3-4 Jump (state 6): a hop at Isaac. {"animation": "Jump", "rolled": False, "leap": 10, "lunge_from": "Jump", "lunge_end": "Land", "retention": 1, "sounds": [snd(0x73, "Land")]}, {"animation": "Jump2", "rolled": False, "leap": 10, "lunge_from": "Jump", "lunge_end": "Land", "retention": 1, "sounds": [snd(0x73, "Land")]}, # 5 A damage mark crossed: she flinches and small Fistulas break off. {"animation": "Flinch", "rolled": False, "release": "Start", "spawn": ["fistula_small"], "count": 2, "spawn_speed": 3, "spawn_offset": 40, "spawn_cone": {"turn": 90, "speed_random": 2}, "sounds": [snd(0x1c, "Start")]}, ] if rage: # 6-8 Rage (state 13): Fistuloids at half health thrown out every eighth tick, half the time. out += [{"animation": "RageBegin", "rolled": False, "sounds": [snd(0x74, "Shoot")], "next": 7}, {"animation": "RageLoop", "rolled": False, "loop": {"at": "Back", "to": "Start", "count": 10}, "spawn": ["fistuloid"], "spawn_on": "Spawn", "spawn_speed": 7, "spawn_offset": 20, "spawn_health": [0.5], "spawn_cone": {"turn": 180, "speed_random": 3}, "next": 8}, {"animation": "RageEnd", "rolled": False}] return out def choice(rage): options = [0, 1, 2, 3, 4] + ([6] if rage else []) weights = [{"weight": 120, "per": -40, "type": 308}, {"weight": 100}, {"weight": 150}, {"weight": 250}, {"weight": 250}] return {"one_in": 6, "options": options, "weights": weights + ([{"weight": 60, "rest": 300, "rest_weight": 0}] if rage else [])} def phase(share, rage): return {"when": [{"hp_share_below": share}], "attack": 5, "patch": {"attacks": attacks(rage), "choice": choice(rage)}} upsert({"key": "the_matriarch", "name": "The Matriarch", "flash_id": 41300000, "hp": 700, "mass": 100, "radius": 60, "contact_damage": 1, "gibs": {"large": True}, "behavior": {"kind": "scripted", "move": "still", "retention": 0.5, "idle_pose": "Idle", "spawn_clip": {"animation": "Appear"}, "attacks": attacks(False), "choice": choice(False), # Damage marks at 80, 65, 50 and 35%; rage from the third; at 20% she bursts into Fistulas, a # Fistuloid and Chub (state 16). "phases": [phase(0.8, False), phase(0.65, False), phase(0.5, True), phase(0.35, True), {"when": [{"hp_share_below": 0.2}], "attack": 0, "patch": {"choice": None, "attacks": [{"animation": "Death", "rolled": False, "release": "Explosion", "spawn": ["fistula_medium", "fistula_small", "fistula_small", "fistuloid", "chub", "chub"], "count": 6, "spawn_in_order": True, "spawn_offset": 40, "untouchable": {"from": "Start", "to": "Explosion"}, "become": {"type": "chub", "health": 140}, "sounds": [snd(0x8d, "Explosion")]}]}}]}, "death": {"animation": "Death"}, "death_burst": {"boss_sounds": ["rocket_blast_death_1.mp3"]}, "art": "gfx/bosses/the_matriarch/the_matriarch.anm2"})