from core.template.animation import Frame, Frames
from core.template.item import Loot
from core.template.monster import Spawner

from siege.util import PixelVector

spawner = Spawner(
    name = "Snow Golem Spawner",
    monster = 'snow_golem',
    biomes = ["Mountain"],
    stats = {
        'HP': 300,
        'DEF': 35,
        'MIND': 45,
    },
    addStatsOnLevel = {
        'HP': 20,
        'DEF': 4,
        'MIND': 5,
    },
    loot = [
        Loot("syle_core", dropRates={1: 100}),
        Loot("stone", dropRates={2: 50, 3: 50}),
    ]
)

idle = spawner.getSpriteFrames(Frame(0, 0, size=(27, 45)))
disabled = spawner.getSpriteFrames(Frame(81, 0, size=(27, 45)))
spawning = spawner.getSpriteFrames(
    frames = [
        Frame(25, 0),
        Frame(54, 0)
    ],
    size = PixelVector(27, 45)
)

spawner.animations(
    start = 'idle',
    idle = Frames(idle()),
    disabled = Frames(disabled()),
    spawning = (
        Frames(spawning(1, 2, 1), time=100),
        Frames(idle(), time=500)
    ),
    disableLooping = ['spawning']
)
