# -*- coding: utf-8 -*-
"""Status effect data."""
from components.status_effect import StatusEffect
from status_effect_functions import damage_of_time

# todo: generate new object not copy
STATUS_EFFECT_CATALOG = {
    'POISONED':
    {
        'name': 'poisoned',
        'tile_path': 'status_effect/poisoned.png',
        'color': 'green',
        'tick_function': damage_of_time,
        'duration': 6,
        'function_kwargs': {'init_dmg': 2}  # specify as dictionary
    },

    'OFF_BALANCED':
    {
        'name': 'off-balanced',
        'tile_path': 'status_effect/off_balanced.png',
        'color': 'gray',
        'duration': 4,
        'stats': {'phys_pow': -1,
                  'defense': -2}
    },

    'VIGILANT':
    {
        'name': 'vigilant',
        'tile_path': 'status_effect/vigilant.png',
        'color': 'blue',
        'duration': 6,
        'stats': {'defense': 5}
    },
}


def 
(statfx_id):
    """Return a status effect generated from catalog."""
    statfx_data = STATUS_EFFECT_CATALOG.get(statfx_id)

    # char and color are set as placeholder, ASCII graphics features will be removed in future.
    return StatusEffect(statfx_data.get('name'),
                        statfx_data.get('tile_path'),
                        statfx_data.get('color'),
                        function_kwargs=statfx_data.get('function_kwargs'),
                        tick_function=statfx_data.get('tick_function'),
                        duration=statfx_data.get('duration'),
                        stats=statfx_data.get('stats'))

generate_status_effect