//
// Copyright-Only Dedication (based on United States law)
//
// The person or persons who have associated their work with this document (the
// "Dedicator") hereby dedicate the entire copyright in the work of authorship
// identified below (the "Work") to the public domain.
//
// Dedicator makes this dedication for the benefit of the public at large and
// to the detriment of Dedicator's heirs and successors. Dedicator intends this
// dedication to be an overt act of relinquishment in perpetuity of all present
// and future rights under copyright law, whether vested or contingent, in the
// Work. Dedicator understands that such relinquishment of all rights includes
// the relinquishment of all rights to enforce (by lawsuit or otherwise) those
// copyrights in the Work.
//
// Dedicator recognizes that, once placed in the public domain, the Work may be
// freely reproduced, distributed, transmitted, used, modified, built upon, or
// otherwise exploited by anyone for any purpose, commercial or non-commercial,
// and in any way, including by methods that have not yet been invented or
// conceived.
//
/* P_wilderness.ghul
 *
 *
 */
#ifndef p_wilderness_ghul
#define p_wilderness_ghul

#define CONFIG_WILDERNESS_GOBLIN_GENERATOR

#ifdef CONFIG_WILDERNESS_GOBLIN_GENERATOR
MAKE_NPC_PARTY_GENERATOR_MECH(t_wilderness_goblin_generator, "goblin cave", 
                              t_goblin_horde, (ALIGN_MONSTER),
                              p_wilderness, 25, 15, 1, 1, 
                              0.0010);
#endif

// A mandrake patch is kind of special-purpose, so no macro for now...
MECH_TYPE mech_mandrake_patch {
        name "mandrake patch";
        defaults {
                pmask PASS_ALL;
                invisible 1;
        }
        states {
                {
                        name "growing";
                        sprite null;
                }
        }
        transitions {
                state "growing";
                event MECH_FULL_MOON;
                next_state "growing";
                actions {
                        create_object reagent_mandrake 1 p_wilderness
                                37 21 1 1 1.0;
                }
        }
}

MAP m_wilderness {
        type    ascii;
        width   40;
        height  40;
        palette pal_expanded;
        terrain {
                //           111111111122222222223333333333
                // 0123456789012345678901234567890123456789
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ";  //  0
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ";  //  1
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ";  //  2
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ -- -- -- -- -- -- -- -- -- -- -- __ __ __ __ __ __ __ ";  //  3
                "__ __ __ __ __ __ __ __ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- .. .. .. .. .. .. .. .. .. -- -- -- -- -- __ __ __ ";  //  4
                "__ __ __ __ __ __ __ -- -- .. .. .. .. .. tt tt tt tt .. {{ {{ {{ {{ {{ {{ {{ {{ {{ {{ tt tt .. .. .. %% {{ -- __ __ __ ";  //  5
                "__ __ __ -- -- -- -- -- -- .. .. .. tt tt tt {{ {{ {{ {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ {{ tt tt .. .. .. -- __ __ __ ";  //  6
                "__ __ __ -- .. .. .. .. tt tt tt tt {{ {{ {{ {{ ^^ ^^ ^^ ^^ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ tt .. .. .. -- -- .. __ ";  //  7
                "__ __ __ -- .. .. tt tt tt || {{ {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ tt .. .. .. .. .. -- .. .. ";  //  8
                ".. __ __ -- .. .. tt tt {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ {{ {{ {{ {{ ^^ ^^ ^^ {{ {{ {{ tt .. .. .. .. -- .. .. ";  //  9
                ".. __ __ -- .. tt tt {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ {{ {{ {{ {{ tt tt tt {{ {{ {{ {{ {{ {{ {{ tt .. /0 /d /d == /d /a ";  // 10
                ".. __ __ -- .. .. tt tt {{ {{ ^^ ^^ ^^ ^^ {{ {{ {{ ^^ ^^ {{ {{ tt tt tt .. .. .. .. .. .. .. .. .. .. /6 .. .. -- .. .. ";  // 11
                ".. -- -- -- .. .. .. .. tt {{ {{ {{ {{ {{ {{ ^^ ^^ ^^ ^^ ^^ {{ {{ {{ {{ {{ {{ {{ {{ tt tt tt tt .. .. /7 .. .. -- -- .. ";  // 12
                "__ -- .. .. .. .. .. .. .. tt tt {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ ^^ ^^ {{ {{ {{ {{ tt .. .. /7 .. .. .. -- .. ";  // 13
                "__ -- .. .. .. .. .. .. .. .. {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ tt .. .. /7 .. .. .. -- __ ";  // 14
                "__ -- .. .. .. .. {{ {{ {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ {{ tt tt .. .. /7 .. .. .. -- __ ";  // 15
                "__ -- .. .. .. {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ {{ {{ tt tt tt .. .. .. /7 .. .. -- -- __ ";  // 16
                "__ -- .. .. .. .. {{ {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ {{ {{ tt tt tt .. .. .. .. .. /7 .. -- -- __ __ ";  // 17
                "-- -- .. .. .. .. .. .. .. {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ tt tt tt tt tt .. .. .. .. tt tt tt /7 tt -- -- __ __ ";  // 18
                "-- -- tt tt tt tt .. tt tt tt {{ {{ {{ {{ ^^ ^^ ^^ ^^ ^^ ^^ {{ {{ tt tt .. .. .. .. tt tt tt tt || || /7 || || -- -- -- ";  // 19
                "|| ~~ || || tt tt .. .. tt tt tt tt .. {{ {{ {{ ^^ ^^ ^^ ^^ ^^ {{ {{ tt tt .. .. tt tt || || || || || /8 /2 || || ~~ tt ";  // 20
                "|| ~~ ~~ || || tt .. .. tt tt .. .. .. .. .. {{ {{ {{ ^^ ^^ ^^ ^^ {{ {{ tt .. .. tt || || || || || || || /7 || || ~~ ~~ ";  // 21
                ".. .. == .. .. .. .. tt tt tt tt tt tt tt .. .. .. {{ {{ ^^ {{ {{ {{ .. .. .. .. tt || || || b  tt b  tt /b .. || || ~~ ";  // 22
                ".. || ~~ ~~ || || tt tt tt tt ~~ ~~ ~~ -- -- -- .. .. {{ {{ {{ -- -- -- .. .. .. tt tt || || tt tt .. .. .. .. || ~~ ~~ ";  // 23
                ".. || || ~~ tt tt tt tt .. %% %% ~~ ~~ -- __ -- -- .. .. .. .. .. -- -- .. .. .. .. tt || || b  tt b  tt .. .. ~~ ~~ .. ";  // 24
                "|| || || ~~ tt tt tt .. .. .. %% %% ~~ -- __ __ -- -- -- -- .. .. -- -- -- .. .. .. tt || || || || || || .. .. == .. .. ";  // 25
                "|| || || ~~ tt tt .. .. .. %% .. %% %% -- __ __ __ __ __ -- -- -- -- -- .. .. .. .. tt tt tt || || || || || -- -- -- || ";  // 26
                "|| || || ~~ .. .. .. %% %% .. %% %% ~~ -- __ __ __ __ __ __ __ __ __ -- -- .. .. .. .. .. tt tt tt -- -- -- -- __ -- -- ";  // 27
                "-- || -- -- ~~ ~~ %% %% ~~ %% %% ~~ -- -- __ __ __ __ __ __ __ __ __ -- -- -- -- -- -- -- -- -- -- -- __ __ __ __ __ -- ";  // 28
                "-- -- -- __ __ -- -- -- ~~ ~~ ~~ ~~ -- -- __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ";  // 29
                "__ __ __ __ __ -- -- -- %% %% %% %% -- -- __ __ ^^ ^^ ^^ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ";  // 30
                "__ __ __ __ __ __ -- -- -- .. .. .. -- -- -- -- -- -- ^^ -- -- __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ";  // 31
                "__ __ __ __ __ __ __ -- -- -- ^^ {{ ^^ {{ {{ {{ ^^ -- ^^ ^^ ^^ -- -- __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ";  // 32
                "__ __ __ __ __ __ __ __ __ -- -- {{ {{ {{ ^^ {{ ^^ -- {{ {{ ^^ ^^ -- -- __ __ __ __ __ -- ^^ ^^ ^^ __ __ __ __ __ __ __ ";  // 33
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ^^ ^^ -- ^^ ^^ ^^ ^^ -- -- __ __ __ __ __ -- -- !  ^^ ^^ ^^ ^^ -- __ __ __ ";  // 34
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ -- -- -- ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ !  !  !  ^^ !  -- -- __ __ ";  // 35
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ -- ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ !  !  !  ^^ -- __ __ ";  // 36
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ^^ !  !  ^^ ^^ ^^ ^^ __ __ __ ";  // 37
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ^^ !  ^^ ^^ __ __ __ __ __ __ ";  // 38
                "__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ -- -- -- -- __ __ __ __ __ __ __ ";  // 39
                //           111111111122222222223333333333
                // 0123456789012345678901234567890123456789
        } // terrain
} // MAP m_wilderness_c


PLACE  p_wilderness {
        type        wilderness;
        parent      null;
        x           0;
        y           0;
        name        "The Great Wild";
        wraps       1;
        map         m_wilderness;
        underground 0;
        objects {          
                
                //--------------------------------------------------
                // vehicles:
                //--------------------------------------------------
                vt_ship 35 27 west 50;
                vt_horse 34 15 east 1;
                
                //--------------------------------------------------
                // npc parties:
                //--------------------------------------------------
                // tag, x, y, alignment, home, conversation, vehicle
                //t_goblin_horde                4 14 (ALIGN_MONSTER) 0 c_goblin null;
                //t_undead_brigade              2 26 (ALIGN_MONSTER) 0 null     vt_ship;
                t_undead_brigade               32  4 (ALIGN_MONSTER) 0 null     vt_ship;
                t_snakes                       33 16 (ALIGN_MONSTER) 0 null     null;
                t_gazer_pod_with_goblin_slaves 30 20 (ALIGN_MONSTER) 0 null     null;                
                
                //--------------------------------------------------
                // mechs
                //--------------------------------------------------
                
#ifdef CONFIG_WILDERNESS_GOBLIN_GENERATOR
                // goblin generator
                t_turn_trigger                goblin_cave_trigger 0  0  "active";
                t_wilderness_goblin_generator goblin_cave         15 25 "active";
                CONNECT goblin_cave_trigger => goblin_cave;
#endif
                
                // mandrake patch
                mech_mandrake_patch           mandrake_patch      37 21 "growing";
                
        }
        
        // gmcnutt: typical_npc_parties is obsolescent. Npc party generation should
        // be done by mechs. However, for camping ambushes we still need this.
        typical_npc_parties {
                // party_type chance (alignment)
                //     chance is n * 0.01% 
                t_goblin_horde                 10  (ALIGN_MONSTER);
                t_gazer_pod_with_goblin_slaves 1   (ALIGN_MONSTER);
                t_nixies                       10 (ALIGN_MONSTER);
        }
        
} // PLACE  p_wilderness

// Make castle level 1 be precisely below castle level 2
//STACK_PLACES p_lcb2 p_lcb1;

#endif // p_wilderness_ghul

/* eof */
