110 lines
8.2 KiB
Plaintext
110 lines
8.2 KiB
Plaintext
#using scripts\codescripts\struct;
|
|
|
|
|
|
|
|
#using scripts\shared\scene_shared;
|
|
|
|
#using scripts\shared\array_shared;
|
|
#using scripts\shared\util_shared;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function main()
|
|
{
|
|
level.ladybug_scenes = [];
|
|
|
|
level.ladybug_scenes[ "bbq" ] = Array(
|
|
"p7_fxanim_mp_mini_ladybug_bbq_idle_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_bbq_01_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_bbq_02_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_bbq_03_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_bbq_04_bundle"
|
|
);
|
|
|
|
level.ladybug_scenes[ "cake" ] = Array(
|
|
"p7_fxanim_mp_mini_ladybug_cake_idle_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_cake_01_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_cake_02_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_cake_03_bundle"
|
|
);
|
|
|
|
level.ladybug_scenes[ "coffee" ] = Array(
|
|
"p7_fxanim_mp_mini_ladybug_coffee_idle_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_coffee_01_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_coffee_02_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_coffee_03_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_coffee_04_bundle"
|
|
);
|
|
|
|
level.ladybug_scenes[ "plant" ] = Array(
|
|
"p7_fxanim_mp_mini_ladybug_plant_idle_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_plant_01_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_plant_02_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_plant_03_bundle"
|
|
);
|
|
|
|
level.ladybug_scenes[ "soda" ] = Array(
|
|
"p7_fxanim_mp_mini_ladybug_soda_idle_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_soda_01_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_soda_02_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_soda_03_bundle",
|
|
"p7_fxanim_mp_mini_ladybug_soda_04_bundle"
|
|
);
|
|
|
|
foreach ( str_id, a_scenes in level.ladybug_scenes )
|
|
{
|
|
scene::add_scene_func( level.ladybug_scenes[ str_id ][ 0 ], &run_ladybug, "play", str_id );
|
|
|
|
// Idles should play first but aren't placed in the map, so grab the first non-idle stage bundle and play the idle on it
|
|
s_scene = struct::get( level.ladybug_scenes[ str_id ][ 1 ], "scriptbundlename" );
|
|
s_scene thread scene::play( level.ladybug_scenes[ str_id ][ 0 ] );
|
|
}
|
|
}
|
|
|
|
function run_ladybug( a_ents, str_id )
|
|
{
|
|
if(!isdefined(self.n_ladybug_stage))self.n_ladybug_stage=0;
|
|
|
|
bug = a_ents[ "ladybug_" + str_id ];
|
|
bug.takedamage = 1;
|
|
|
|
if( self.n_ladybug_stage != 0 )
|
|
{
|
|
bug util::waittill_notify_or_timeout( "damage", RandomIntRange( 10, 20 ) );
|
|
}
|
|
|
|
self.n_ladybug_stage++;
|
|
if ( self.n_ladybug_stage >= level.ladybug_scenes[ str_id ].size )
|
|
{
|
|
self.n_ladybug_stage = 1;
|
|
}
|
|
|
|
self scene::play( level.ladybug_scenes[ str_id ][ self.n_ladybug_stage ], a_ents );
|
|
self thread scene::play( level.ladybug_scenes[ str_id ][ 0 ], a_ents ); // idle
|
|
}
|