#textdomain wesnoth-did

[scenario]
    id=11_Squidville
    name= _ "Squidville"
    map_file=11_Squidville.map
    turns=unlimited
    next_scenario=10_Endless_Night
    victory_when_enemies_defeated=no

    {UNDERGROUND}
    {SCENARIO_MUSIC       nunc_dimittis.ogg}
    {EXTRA_SCENARIO_MUSIC underground.ogg}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        save_id=Malin Keshar
        recruit=
        gold=0
        team_name=good
        village_gold=0
        shroud=yes
        income=-2
        user_team_name= _ "Mal Keshar"
        {FLAG_VARIANT undead}
        color=darkblue

        # wmllint: recognize Mal Keshar
        {CHARACTER_STATS_MAL_KESHAR}

        facing=ne
    [/side]
    # wmllint: validate-on

    # Monster
    [side]
        side=2
        team_name=monster
        user_team_name= _ "teamname^Squid"
        gold=0
        controller=ai
        no_leader=yes
        hidden=yes
        {NO_INCOME}
        color=orange
        [ai]
            aggression=1
            caution=0
            grouping=no
            simple_targeting=yes
            village_value=0
            {MODIFY_AI_DELETE_CANDIDATE_ACTION 4 main_loop villages}
            {MODIFY_AI_DELETE_CANDIDATE_ACTION 4 main_loop retreat_injured}
        [/ai]
    [/side]
    [side]
        side=3
        team_name=monster
        user_team_name= _ "teamname^Inky"
        gold=0
        controller=ai
        no_leader=yes
        hidden=yes
        {NO_INCOME}
        color=orange
        [ai]
            aggression=0.2
            caution=0.8
            grouping=no
            simple_targeting=yes
            village_value=0
            {MODIFY_AI_DELETE_CANDIDATE_ACTION 4 main_loop villages}
            {MODIFY_AI_DELETE_CANDIDATE_ACTION 4 main_loop retreat_injured}
        [/ai]
    [/side]

    {STARTING_VILLAGES 2 30}

    # ability macros
    {DID_SOUL_EATER1}
    {DID_SOUL_EATER2}
    {DID_SOUL_EATER3}
    {DID_STARVING}

    [event]
        name=prestart

        {COLOR_ADJUST -15 -15 -15}
        {VARIABLE squidVille 1}
        {VARIABLE inkyVille 1}
    [/event]

    [event]
        name=start

        [modify_unit]
            [filter]
                id=Mal Keshar
            [/filter]
            [object]
                # intentionally forever, it's a little bonus for getting to this scenario
                duration=forever
                [effect]
                    apply_to=movement_costs
                    replace=yes
                    [movement_costs]
                        shallow_water=1
                        deep_water=2
                    [/movement_costs]
                [/effect]
            [/object]
        [/modify_unit]

        [message]
            speaker=Mal Keshar
            message= _ "This cuttlefish will not escape me any longer! Hunt her down!"
        [/message]

        {MOVE_UNIT (id=Mal Keshar) 4 7}
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        [delay]
            time=550
        [/delay]
        {MODIFY_UNIT (id=Mal Keshar) facing sw}
        [delay]
            time=350
        [/delay]
        {MODIFY_UNIT (id=Mal Keshar) facing se}
        [delay]
            time=350
        [/delay]
        {MODIFY_UNIT (id=Mal Keshar) facing sw}
        [delay]
            time=350
        [/delay]
        {MODIFY_UNIT (id=Mal Keshar) facing se}
        [delay]
            time=350
        [/delay]

        [message]
            speaker=Mal Keshar
            message= _ "..."
        [/message]
        [message]
            speaker=Mal Keshar
            message= _ "Right, I got dragged down here without any of my minions. I suppose I will have to do this myself."
        [/message]

        {VARIABLE foundInky 0}

        [objectives]
            side=1
            [objective]
                condition=win
                description= _ "Hunt down Inky"
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=moveto
        [filter]
            x=11,15
            y=4,3
            side=1
        [/filter]

        #enjoy your exp farm
        [unit]
            x,y=11,6
            type=Tentacle of the Deep
            side=2
            max_hitpoints=42
            level=4
            animate=yes
        [/unit]
        [unit]
            x,y=12,3
            type=Tentacle of the Deep
            side=2
            max_hitpoints=50
            level=4
            animate=yes
        [/unit]
        [unit]
            x,y=14,3
            type=Tentacle of the Deep
            side=2
            max_hitpoints=40
            level=4
            animate=yes
        [/unit]
        [unit]
            x,y=15,4
            type=Tentacle of the Deep
            side=2
            max_hitpoints=39
            level=4
            animate=yes
        [/unit]
        [unit]
            x,y=16,5
            type=Tentacle of the Deep
            side=2
            max_hitpoints=48
            level=4
            animate=yes
        [/unit]
        [message]
            speaker=Mal Keshar
            message= _ "Why are these tentacles so large..?"
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=20,26
            side=1
        [/filter]

        [message]
            speaker=Mal Keshar
            message= _ "(<i>huff huff huff</i>)"
        [/message]
        [message]
            speaker=Mal Keshar
            message= _ "..."
        [/message]
        {SCREEN_FADE 100 0 0 300}
        {SCREEN_FADE 0 100 0 300}
        {SCREEN_FADE 100 100 100 300}
        {SCREEN_FADE 0 0 100 300}
        {SCREEN_FADE 100 100 0 300}
        {SCREEN_FADE 100 100 100 300}
        {SCREEN_FADE 0 100 100 300}
        {SCREEN_FADE 100 0 100 300}
        {SCREEN_UNFADE 500}
        [delay]
            time=500
        [/delay]
        [message]
            speaker=Mal Keshar
            message= _ "I can see... the colors of the universe..!"
        [/message]
        [delay]
            time=500
        [/delay]
        {SCREEN_FADE 100 0 0 300}
        {SCREEN_FADE 0 100 0 300}
        {SCREEN_FADE 100 100 100 300}
        {SCREEN_FADE 0 0 100 300}
        {SCREEN_FADE 100 100 0 300}
        {SCREEN_FADE 100 100 100 300}
        {SCREEN_FADE 0 100 100 300}
        {SCREEN_FADE 100 0 100 300}
        {SCREEN_UNFADE 500}
        [delay]
            time=500
        [/delay]
        [message]
            speaker=Mal Keshar
            message= _ "The stars go whirly whirl and turn into..."
        [/message]
        [message]
            speaker=Mal Keshar
            # po: He's high so basically this is gibberish describing mushrooms
            message= _ "... glowy mushrooms lighting up this dank gloom, blue and green, loomy bloomy big shroomy..."
        [/message]
        [delay]
            time=500
        [/delay]
        {SCREEN_FADE 180 180 180 500}
        [delay]
            time=1000
        [/delay]
        {SCREEN_UNFADE 500}
        [delay]
            time=500
        [/delay]
        [message]
            speaker=Mal Keshar
            message= _ "... hi hi ho ho the shrooms go marching lo..."
        [/message]
        [message]
            speaker=Mal Keshar
            message= _ "... wait for me shroomies..!"
        [/message]
        [delay]
            time=500
        [/delay]

        {MOVE_UNIT (id=Mal Keshar) 19 27}
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        [delay]
            time=500
        [/delay]
        [scroll_to]
            x,y=18,26
        [/scroll_to]
        {MOVE_UNIT (id=Mal Keshar) 18 26}
        [delay]
            time=500
        [/delay]
        [scroll_to]
            x,y=17,26
        [/scroll_to]
        {MOVE_UNIT (id=Mal Keshar) 17 26}
        [delay]
            time=500
        [/delay]

        [message]
            speaker=Mal Keshar
            message= _ "(<i>huff huff</i>)"
        [/message]
        [delay]
            time=1000
        [/delay]
        [message]
            speaker=Mal Keshar
            # po: He breaks the fourth wall here because he's enlightened from the shrooms of course, so he talks directly to the player
            message= _ "... wait what am I doing? A skeleton cannot taste or smell or eat anything. These shrooms do not work on me. Do you think I am a fool? Am I just some kind of bad actor hired for amusement? What kind of sadistic higher power makes poor old lonely liches like me suffer so much just for the sake of entertainment? How revolting. I hope your sick enjoyment at my predicament is worth it, you monster."
        [/message]

        [object]
            take_only_once=yes
            silent=yes
            duration=forever
            [filter]
                id=Mal Keshar
            [/filter]
            [effect]
                apply_to=new_ability
                [abilities]
                    {ABILITY_ENLIGHTENED}
                [/abilities]
            [/effect]
        [/object]
        [floating_text]
            x,y=17,26
            color=255,255,255
            text= _ "ENLIGHTENED"
        [/floating_text]
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=19,29
            side=1
        [/filter]

        [sound]
            name=zombie-hit-1.ogg
        [/sound]
        [delay]
            time=1000
        [/delay]
        [sound]
            name=zombie-hit-5.ogg
        [/sound]
        [delay]
            time=600
        [/delay]
        [sound]
            name=zombie-attack.wav
        [/sound]
        [delay]
            time=600
        [/delay]
        [sound]
            name=zombie-hit-3.ogg
        [/sound]
        [delay]
            time=800
        [/delay]
        [unit]
            type=Necrophage Necron
            id=Necron
            name= _ "Necron"
            side=1
            animate=yes
            placement=leader
        [/unit]
        [delay]
            time=500
        [/delay]
        [message]
            speaker=Mal Keshar
            message= _ "... what a horrendous pile of flesh. Even for a ghoul, this thing is beyond disgusting. Maybe I can send it to a quick death against all those Foolish Heroes."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=3, 5, 12,6 ,13, 4,11,17,13,20
            y=21,22,20,18,19,15,16,18,14,14
            side=1
        [/filter]
        [switch]
            variable=inkyVille
            [case]
                value=1
                [sound]
                    name=water-blast.wav
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Water Serpent
                    side=2
                    animate=yes
                    passable=yes
                [/unit]
                [message]
                    speaker=Mal Keshar
                    message= _ "You are not the creature I seek!"
                [/message]
                {VARIABLE inkyVille 2}
            [/case]
            [case]
                value=2
                [sound]
                    name=mud-glob.ogg
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Giant Mudcrawler
                    side=2
                    animate=yes
                    passable=yes
                [/unit]
                [unit]
                    x,y=$x1,$y1
                    type=Mudcrawler
                    side=2
                    animate=no
                    passable=yes
                [/unit]
                [unit]
                    x,y=$x1,$y1
                    type=Mudcrawler
                    side=2
                    animate=no
                    passable=yes
                [/unit]
                [unit]
                    x,y=$x1,$y1
                    type=Mudcrawler
                    side=2
                    animate=no
                    passable=yes
                [/unit]
                [message]
                    speaker=Mal Keshar
                    message= _ "Oh for the love of... not these slimy things again..."
                [/message]
                {VARIABLE inkyVille 3}
            [/case]
            [case]
                value=3
                [sound]
                    name=water-blast.wav
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Sea Serpent
                    side=2
                    animate=yes
                    passable=yes
                [/unit]
                {VARIABLE inkyVille 4}
            [/case]
            [case]
                value=4
                [sound]
                    name=water-blast.wav
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Swamp Lizard
                    side=2
                    animate=yes
                    passable=yes
                [/unit]
                [message]
                    speaker=Mal Keshar
                    message= _ "... wait a second, is this creature even supposed to live in this kind of habitat?"
                [/message]
                {VARIABLE inkyVille 5}
            [/case]
            [case]
                value=5
                [sound]
                    name=water-blast.wav
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Sea Serpent
                    side=2
                    animate=yes
                    passable=yes
                [/unit]
                {VARIABLE inkyVille 6}
            [/case]
            [case]
                value=6
                [sound]
                    name=horse-hit-1.ogg
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Great Seahorse
                    side=2
                    animate=yes
                    passable=yes
                [/unit]
                [message]
                    speaker=Mal Keshar
                    message= _ "The creatures down here keep getting stranger and stranger."
                [/message]
                {VARIABLE inkyVille 7}
            [/case]
            [case]
                value=7
                [sound]
                    name=water-blast.wav
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Sea Serpent
                    side=2
                    animate=yes
                    passable=yes
                [/unit]
                {VARIABLE inkyVille 8}
            [/case]
            [case]
                value=8
                [sound]
                    name=water-blast.wav
                [/sound]
                [unit]
                    x,y=$x1,$y1
                    type=Cuttle Fish
                    id=Inky
                    name= _ "female^Inky"
                    gender=female
                    side=3
                    animate=yes
                    passable=yes
                    [status]
                        unplagueable=yes
                    [/status]
                [/unit]
                [delay]
                    time=500
                [/delay]
                [message]
                    speaker=Mal Keshar
                    message= _ "Aha!"
                [/message]
                [message]
                    speaker=Mal Keshar
                    message= _ "Finally, I have found you! Now hold still for just a moment..."
                [/message]
                {VARIABLE inkyVille 9}
            [/case]
        [/switch]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Inky
        [/filter]

        [message]
            # wmllint: deathcheck off
            speaker=Inky
            # wmllint: deathcheck on
            message= _ "Bloub°°°"
        [/message]
        [message]
            speaker=Mal Keshar
            message= _ "Ha! I have you now!"
        [/message]
        [delay]
            time=500
        [/delay]
        [sound]
            name=water-blast.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [message]
            speaker=Mal Keshar
            message= _ "... what’s that sound?"
        [/message]
        [delay]
            time=500
        [/delay]
        [sound]
            name=water-blast.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=squishy-hit.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [unit]
            x,y=$x1,$y1
            type=Cuttle Fish
            side=2
            animate=yes
            passable=yes
        [/unit]
        [message]
            speaker=Mal Keshar
            message= _ "Where did you come from? Get off of me!"
        [/message]
        [delay]
            time=500
        [/delay]
        [sound]
            name=squishy-hit.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=squishy-hit.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=water-blast.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [unit]
            x,y=$x1,$y1
            type=Cuttle Fish
            side=2
            animate=yes
            passable=yes
        [/unit]
        [unit]
            x,y=$x1,$y1
            type=Cuttle Fish
            side=2
            animate=yes
            passable=yes
        [/unit]
        [message]
            speaker=Mal Keshar
            message= _ "Uh oh."
        [/message]
        [delay]
            time=500
        [/delay]
        [sound]
            name=squishy-hit.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=squishy-hit.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=squishy-hit.wav
        [/sound]
        [delay]
            time=500
        [/delay]
        [unit]
            x,y=$x1,$y1
            type=Cuttle Fish
            side=2
            animate=yes
            passable=yes
        [/unit]
        [unit]
            x,y=$x1,$y1
            type=Cuttle Fish
            side=2
            animate=yes
            passable=yes
        [/unit]
        [message]
            speaker=Mal Keshar
            message= _ "I’m getting out of here!"
        [/message]

        [set_achievement]
            content_for=descent_into_darkness
            id="did_tentacle"
        [/set_achievement]

        {MOVE_UNIT (id=Mal Keshar) 7 1}

        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 100}
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Mal Keshar
        [/filter]

        [message]
            speaker=unit
            message= _ "Aaargh, so many tentacles! Aieeeeee!!!"
        [/message]
    [/event]
    [event]
        name=die
        [filter]
            id=Mal Keshar
        [/filter]

        [story]
            title= _ "Bad Ending"
            [part]
                story= _ "Unfortunately for him, Mal Keshar was overrun by a horde of tentacles. With his delusions of grandeur crushed, his boney remains were consigned to being no more than a few decorative elements around the watery backdrop of the village of squids for all eternity."
                {STORYTXT_BACKGROUND end.webp}
            [/part]
        [/story]

        [endlevel]
            next_scenario=null
            carryover_report=no
            save=no
            linger_mode=no
        [/endlevel]
    [/event]

    [event]
        name=victory

        {CLEAR_VARIABLE foundInky}
        {CLEAR_VARIABLE inkyVille}
    [/event]
[/scenario]
