-- name: [CS] Aki Model
-- description: Aki Model\n\nMade by: GeloxNG\n\n\\#ff7777\\This Pack requires Character Select\nto use as a Library!
-- category: cs

-- Replace Mod Name with your Character/Pack name.
local TEXT_PACK_NAME = "Aki Model"

-- Stops mod from loading if Character Select isn't on, Does not need to be touched
if not charSelect then
    djui_popup_create(
    "\\#ffffa0\\"..TEXT_PACK_NAME.." requires\nCharacter Select to be enabled.\n\nPlease rehost with it enabled.", 4)
    return
end

characterTable = {
    {
        -- Basic Character Info
        name = "Aki",
        nickname = "Aki",
        description = "",
        credits = "GeloxNG",
        color = { r = 255, g = 198, b = 109 },               -- Menu Color
        model = smlua_model_util_get_id("aki_geo"), -- Replace custom_model to your character model's name.
        forceChar = CT_MARIO,                                -- Builds upon Vanilla Character
        lifeIcon = get_texture_info("aki_icon"),     -- File extension (.png) not needed here, converted to .tex on refresh
        camScale = 1,                                        -- Sets the camera scale of your character in the CS menu

        graffiti = get_texture_info("aki_icon"),

        -- Health Meter Textures
        --[[meter = {
            label = {
                left = get_texture_info("aki_meter_left"),
                right = get_texture_info("aki_meter_right"),
            },
            pie = {
                [1] = get_texture_info("aki_meter_pie1"),
                [2] = get_texture_info("aki_meter_pie2"),
                [3] = get_texture_info("aki_meter_pie3"),
                [4] = get_texture_info("aki_meter_pie4"),
                [5] = get_texture_info("aki_meter_pie5"),
                [6] = get_texture_info("aki_meter_pie6"),
                [7] = get_texture_info("aki_meter_pie7"),
                [8] = get_texture_info("aki_meter_pie8"),
            }
        },]]

        --[[caps = {
            normal = smlua_model_util_get_id("aki_cap_geo"),
            wing = smlua_model_util_get_id("aki_wing_cap_geo"),
            metal = smlua_model_util_get_id("aki_metal_cap_geo"),
            metalWing = smlua_model_util_get_id("aki_metal_wing_cap_geo")
        },]]

        -- Character Palettes
        palettes = {
            {
                name     = "Default",
                [PANTS]  = 'ffc66d',
                [SHIRT]  = 'fb8045',
                [GLOVES] = 'ffffff',
                [SHOES]  = 'ffffff',
                [HAIR]   = 'ffffff',
                [SKIN]   = 'ffffff',
                [CAP]    = 'ffffff',
                [EMBLEM] = 'ffffff'
            },
        },

        -- Replaces the vanilla character sounds.
        -- Sounds in 16000hz ('0' in quality) and mono are recommended for optimization and authenticity.
        -- (.aiff, .mp3, and .mp3 are supported)
        voices = {
            [CHAR_SOUND_OKEY_DOKEY] =         'AkiStartGame.mp3', -- Starting game
        	[CHAR_SOUND_LETS_A_GO] =          'AkiStartLevel.mp3', -- Starting level
        	[CHAR_SOUND_GAME_OVER] =          'AkiGameOver.mp3', -- Game Overed
        	[CHAR_SOUND_PUNCH_YAH] =          'AkiPunch1.mp3', -- Punch 1
        	[CHAR_SOUND_PUNCH_WAH] =          'AkiPunch2.mp3', -- Punch 2
        	[CHAR_SOUND_PUNCH_HOO] =          'AkiPunch3.mp3', -- Punch 3
        	[CHAR_SOUND_YAH_WAH_HOO] =       {'AkiJump1.mp3', 'AkiJump2.mp3', 'AkiJump3.mp3'}, -- First Jump Sounds
        	[CHAR_SOUND_HOOHOO] =             'AkiDoubleJump.mp3', -- Second jump sound
        	[CHAR_SOUND_YAHOO_WAHA_YIPPEE] = {'AkiTripleJump1.mp3', 'AkiTripleJump2.mp3'}, -- Triple jump sounds
        	[CHAR_SOUND_UH] =                 'AkiBonk.mp3', -- Soft wall bonk
        	[CHAR_SOUND_UH2] =                'AkiLedgeGetUp.mp3', -- Quick ledge get up
        	[CHAR_SOUND_UH2_2] =              'AkiLongJumpLand.mp3', -- Landing after long jump
        	[CHAR_SOUND_DOH] =                'AkiBonk.mp3', -- Hard wall bonk
        	[CHAR_SOUND_OOOF] =               'AkiBonk.mp3', -- Attacked in air
        	[CHAR_SOUND_OOOF2] =              'AkiBonk.mp3', -- Land from hard bonk
        	[CHAR_SOUND_HAHA] =               'AkiTripleJumpLand.mp3', -- Landing triple jump
        	[CHAR_SOUND_HAHA_2] =             'AkiWaterLanding.mp3', -- Landing in water from big fall
        	[CHAR_SOUND_YAHOO] =              'AkiLongJump.mp3', -- Long jump
        	[CHAR_SOUND_DOH] =                'AkiBonk.mp3', -- Long jump wall bonk
        	[CHAR_SOUND_WHOA] =               'AkiGrabLedge.mp3', -- Grabbing ledge
        	[CHAR_SOUND_EEUH] =               'AkiClimbLedge.mp3', -- Climbing over ledge
        	[CHAR_SOUND_WAAAOOOW] =           'AkiFalling.mp3', -- Falling a long distance
        	[CHAR_SOUND_TWIRL_BOUNCE] =       'AkiFlowerBounce.mp3', -- Bouncing off of a flower spring
        	[CHAR_SOUND_GROUND_POUND_WAH] =   'AkiGroundPound.mp3', -- Ground Pound after startup
        	[CHAR_SOUND_WAH2] =               'AkiThrow.mp3', -- Throwing something
        	[CHAR_SOUND_HRMM] =               'AkiLift.mp3', -- Lifting something
        	[CHAR_SOUND_HERE_WE_GO] =         'AkiGetStar.mp3', -- Star get
        	[CHAR_SOUND_SO_LONGA_BOWSER] =    'AkiThrowBowser.mp3', -- Throwing Bowser
        --DAMAGE
        	[CHAR_SOUND_ATTACKED] =     'AkiDamaged.mp3', -- Damaged
        	[CHAR_SOUND_PANTING] =      'AkiPanting.mp3', -- Low health
        	[CHAR_SOUND_PANTING_COLD] = 'AkiPanting.mp3', -- Getting cold
        	[CHAR_SOUND_ON_FIRE] =      'AkiBurned.mp3', -- Burned
        --SLEEP SOUNDS
        	[CHAR_SOUND_IMA_TIRED] = 'AkiTired.mp3', -- Mario feeling tired
        	[CHAR_SOUND_YAWNING] =   'AkiYawn.mp3', -- Mario yawning before he sits down to sleep
        	[CHAR_SOUND_SNORING1] =  'AkiSnore.mp3', -- Snore Inhale
        	[CHAR_SOUND_SNORING2] =  'AkiExhale.mp3', -- Exhale
        	[CHAR_SOUND_SNORING3] =  'AkiSleepTalk.mp3', -- Sleep talking / mumbling
        --COUGHING (USED IN THE GAS MAZE)
        	[CHAR_SOUND_COUGHING1] = 'AkiCough1.mp3', -- Cough take 1
        	[CHAR_SOUND_COUGHING2] = 'AkiCough2.mp3', -- Cough take 2
        	[CHAR_SOUND_COUGHING3] = 'AkiCough3.mp3', -- Cough take 3
        --DEATH
        	[CHAR_SOUND_DYING] =    'AkiDying.mp3', -- Dying from damage
        	[CHAR_SOUND_DROWNING] = 'AkiDrowning.mp3', -- Running out of air underwater
        	[CHAR_SOUND_MAMA_MIA] = 'AkiLeaveLevel.mp3' -- Booted out of level
        },
        
        -- Replaces Vanilla Animations or Adds Custom Animations.
        --[[anims = {
            -- CS Menu Anim Pose
            [charSelect.CS_ANIM_MENU] = 'CS_CUSTOM',
        },

        -- Forces Eye State if in Animation.
        eyes = {
            [charSelect.CS_ANIM_MENU] = MARIO_EYES_OPEN,
        },

        -- Forces Hand State if in Animation.
        hands = {
            [charSelect.CS_ANIM_MENU] = MARIO_HAND_PEACE_SIGN,
        },]]
    },

    -- Copy and Paste below to add another character in the table.
}

-- This function loads and applies Character Data based on the table above, does not need to be touched
local function on_character_select_load()
    for i, char in pairs(characterTable) do
        local _ENV = setmetatable(char, { __index = _G })
        tablePos = charSelect.character_add(name, description, credits, color, model, forceChar, lifeIcon, camScale)
        if caps then character_add_caps(model, caps) end
        if voices then charSelect.character_add_voice(model, voices) end
        if palettes then
            for i = 1, #palettes do
                charSelect.character_add_palette_preset(model, palettes[i], palettes[i].name)
            end
        end
        charSelect.character_set_category(tablePos, TEXT_PACK_NAME)
        charSelect.character_add_graffiti(tablePos, graffiti)

        if anims then charSelect.character_add_animations(model, anims, eyes, hands) end

        if meter then charSelect.character_add_health_meter(tablePos, meter) end
    end
end

hook_event(HOOK_ON_MODS_LOADED, on_character_select_load)