<commit_before>
// third-party stuff
use deadlogger
import deadlogger/[Log, Logger]

use chipmunk
import chipmunk

use dye
import dye/[core, sprite, primitives, math]

use gnaar
import gnaar/[utils]

// sdk stuff
import math, math/Random
import structs/[ArrayList, List]

// our stuff
import isaac/[level, shadow, enemy, hero, utils, paths, boss,
    ballbehavior, tear, explosion, fly]

DukeOfFlies: class extends Boss {

    part: DukePart

    init: func (.level, .pos) {
        super(level, pos)

        part = DukePart new(level, pos)
        parts add(part)
    }

    maxHealth: func -> Float {
        part maxLife
    }

    onDeath: func {
        part releaseFlies()
    }

}

DukePart: class extends Mob {

    scale := 0.8

    shadow: Shadow
    shadowFactor := 0.7
    shadowYOffset := 50

    moveCount := 60
    moveCountMax := 80

    behavior: BallBehavior
    maxLife := 80.0

    maxFlies := 8
    flies := ArrayList<Fly> new()

    flyCounter := 0
    flyCounterThreshold := 70

    baseAngle := 0.0
    baseAngleIncr := 0.5
    flyRadius := 80.0
    maxSpawns := 3

    init: func (.level, .pos) {
        super(level, pos)

        life = maxLife

        sprite = GlSprite new(getSpritePath())
        sprite scale set!(scale, scale)
        shadow = Shadow new(level, sprite width * scale * shadowFactor)

        level charGroup add(sprite)
        sprite pos set!(pos)

        behavior = BallBehavior new(this)<commit_msg>Slightly harder duke (spawns flies more often)<commit_after>
// third-party stuff
use deadlogger
import deadlogger/[Log, Logger]

use chipmunk
import chipmunk

use dye
import dye/[core, sprite, primitives, math]

use gnaar
import gnaar/[utils]

// sdk stuff
import math, math/Random
import structs/[ArrayList, List]

// our stuff
import isaac/[level, shadow, enemy, hero, utils, paths, boss,
    ballbehavior, tear, explosion, fly]

DukeOfFlies: class extends Boss {

    part: DukePart

    init: func (.level, .pos) {
        super(level, pos)

        part = DukePart new(level, pos)
        parts add(part)
    }

    maxHealth: func -> Float {
        part maxLife
    }

    onDeath: func {
        part releaseFlies()
    }

}

DukePart: class extends Mob {

    scale := 0.8

    shadow: Shadow
    shadowFactor := 0.7
    shadowYOffset := 50

    moveCount := 60
    moveCountMax := 80

    behavior: BallBehavior
    maxLife := 80.0

    maxFlies := 8
    flies := ArrayList<Fly> new()

    flyCounter := 0
    flyCounterThreshold := 60

    baseAngle := 0.0
    baseAngleIncr := 0.5
    flyRadius := 80.0
    maxSpawns := 3

    init: func (.level, .pos) {
        super(level, pos)

        life = maxLife

        sprite = GlSprite new(getSpritePath())
        sprite scale set!(scale, scale)
        shadow = Shadow new(level, sprite width * scale * shadowFactor)

        level charGroup add(sprite)
        sprite pos set!(pos)

        behavior = BallBehavior new(this)
{'fraction_non_alphanumeric': 0.10207553589656346, 'fraction_numerical': 0.01701258931609391, 'mean_word_length': 2.4146341463414633, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2186998', 'n_tokens_mistral': 1016, 'n_tokens_neox': 913, 'n_words': 285}