import sys; sys.path.insert(0, '../../b5tools'); from rec import upsert; from snd import snd W = 'min_min_willo' def attacks(b, ring, total): return [ # Spit (state 13): with fewer than `ring` Willos round her (and `total` in all), a Willo flung at Isaac at # 25, turned 15 degrees either way; it joins her ring after. {"animation": f"Spit{b}", "period": 1, "one_in": 8, "release": "Shoot", "when": [{"type_count": {"type": 808, "below": min(ring, total)}}], "spawn": [W], "spawn_speed": 25, "spawn_offset": 0, "spawn_cone": {"turn": 30, "speed_random": 0}, "sounds": [snd(0x13f, "Shoot")], "cooldown": 15, "cooldown_random": [60, 1]}, # Spit (state 14): with under half a ring, four Willos at once. {"animation": f"Spit{b}", "period": 1, "one_in": 12, "release": "Shoot", "when": [{"type_count": {"type": 808, "below": ring // 2}}], "spawn": [W], "count": 4, "spawn_offset": 30, "sounds": [snd(0x13f, "Shoot")], "cooldown": 90, "cooldown_random": [90, 1]}, # Spin (state 8): with more than two round her, random(3): her ring fires at Isaac. {"animation": f"Spin{b}", "period": 1, "one_in": 3, "release": "Shoot", "when": [{"type_count": {"type": 808, "above": 2}}], "signal": W, "sounds": [snd(0x1e3, "Shoot")], "cooldown": 90, "cooldown_random": [90, 1]}] upsert({"key": W, "name": "Min-Min's Willo", "flash_id": 80800001, "hp": 9, "mass": 3, "radius": 17, "contact_damage": 1, "gibs": {"count": 0}, "grid_collision": False, "floor_hazards": {"flight": "flying", "die_on_probe": True}, "boss_bar": {"eligibility": "never"}, "death_link": {"target_type": "min_min", "animation": "Appear", "all": True}, "behavior": {"kind": "scripted", "move": "orbit", "flying": True, "speed": 0.4, "retention": 0.7, "idle_pose": "Fly", "orbit": {"radius": 70, "spin": 0.05, "ring": 8, "center": "group", "target_type": "min_min"}, "choice": {"one_in": 1, "when": [{"flag": True}], "forced": [0], "options": []}, "shot_sounds": ["bloodshoot0.mp3", "bloodshoot1.mp3", "bloodshoot2.mp3"], "attacks": [{"animation": "Attack", "rolled": False, "release": "Shoot", "shot": "aimed", "speed": 7}]}, "death_burst": {"sounds": ["death_burst_small_0.mp3", "death_burst_small_1.mp3", "death_burst_small_2.mp3"]}, "art": "gfx/monsters/willo/willo.anm2", "death": {"anm2": "gfx/effects/fly_explosion/fly_explosion.anm2", "animation": "Die", "height": -23.5}}) upsert({"key": "min_min", "name": "Min-Min", "flash_id": 91300000, "hp": 280, "mass": 20, "radius": 35, "contact_damage": 1, "gibs": {"large": True}, "grid_collision": False, "behavior": {"kind": "scripted", "move": "path", "speed": 0.6, "retention": 1, "flying": True, "idle_pose": "Walk", "spawn_clip": {"animation": "Appear"}, "attacks": attacks('', 4, 5), # Below 40% (state 16): her second form, a ring of up to eight. "phases": [{"when": [{"hp_share_below": 0.4}], "patch": {"idle_pose": "Walk2", "spawn_clip": {"animation": "Transition"}, "attacks": attacks('2', 8, 7)}}]}, "death": {"animation": "Death"}, "death_burst": {"boss_sounds": ["rocket_blast_death_1.mp3"]}, "art": "gfx/bosses/min_min/min_min.anm2"})