{ id: "white_shooting_flower", hitpoints: 8, zorder: 0, timer_frequency: 5, properties: { team: "'evil'", }, vars: { stem_size: 3, stem_voffset: 14, sidle_range: 20, sidle_speed: 8, }, on_create: "[map(range(stem_size),'n',spawn('white_shooting_flower.stem',midpoint_x,midpoint_y-stem_voffset*(n+1),facing)), spawn('white_shooting_flower.flower',midpoint_x,midpoint_y-stem_voffset*(stem_size+1),facing)]", #on_end_normal_anim="if(facing != desired_facing, animation('turn'), animation('shoot')) where desired_facing = if(level.player.x < x, -1, 1)" on_end_normal_anim: "[animation('normal'),set(time_in_animation,1d6)]", on_die: "map(stems, 'stem', set(stem.hitpoints, 0))", on_timer: "[if(find(stems, value.hitpoints <= 0),[map(stems, set(hitpoints, 0)),die()] ), map(stems,'stem', set(stem.vars.target_x, context.midpoint_x + ((index+1)*context.target_x/stem_size)))] where target_x = (wave(cycle*sidle_speed)*sidle_range)/1000", on_child_spawned: "[set(vars.stems, vars.stems+[child]),set(child.vars.len_index,size(vars.stems)+1), set(child.zorder,context.zorder + size(vars.stems)+1)]", on_collide_feet: "map(vars.stems, 'stem', set(stem.midpoint_y, context.midpoint_y - stem_voffset*(index+1) ))", solid_area: [5,5,20,15], # don't use this enemy right now #editor_info: { # category: "plants", #}, animation: [ { image: "enemies/white-shooting-flower.png", pad: 3, accel_y: 80, body_area: "all", id: "editor", rect: [37,1,107,28], frames: 3, frames_per_row: 1, duration: 10, }, { image: "enemies/white-shooting-flower.png", pad: 3, accel_y: 80, body_area: "all", id: "normal", rect: [5,5,31,24], frames: 2, frames_per_row: 1, duration: 12, }, ], object_type: [ { id: "stem", hitpoints: 8, properties: { team: "'evil'", handle_knockback: "def(collide_with) null", }, on_die: "null", #on_end_normal_anim="if(facing != desired_facing, animation('turn'), animation('shoot')) where desired_facing = if(level.player.x < x, -1, 1)" on_process: "set(x,x+ if(3d4 >4, if(target_x > midpoint_x,1,-1)))", on_end_normal_anim: "[animation('normal'),set(time_in_animation,1d6)]", animation: { image: "enemies/white-shooting-flower.png", pad: 3, body_area: "all", id: "normal", rect: [5,5,31,24], frames: 2, frames_per_row: 1, duration: 12, }, }, { id: "flower", prototype: ["stationary_vulnerable"], hitpoints: 2, zorder: 8, has_feet: false, properties: { team: "'evil'", }, vars: { points_value: 12, }, consts: { basic_type: "white_shooting_flower", frogourmet_tag: "white_shooting_flower", }, on_end_normal_anim: "if(facing != desired_facing, animation('turn'), if(1d3=1,animation('shoot'),animation('normal'))) where desired_facing = if(level.player.x < x, -1, 1)", #on_end_normal_anim="animation('shoot')" on_end_shoot_anim: "animation('normal')", on_end_turn_anim: "[facing(if(level.player.x < x, -1, 1)), animation('normal')]", on_end_spring_anim: "animation('normal')", on_process: "[ set(rotate, -facing*((midpoint_y - level.player.midpoint_y)*55)/ max(abs(midpoint_x - level.player.midpoint_x), abs(midpoint_y - level.player.midpoint_y))), set(x,x+ if(3d4 >3, if(target_x > midpoint_x,1,-1)))]", on_shoot: "[spawn('white_shooting_flower.shot', midpoint_x, midpoint_y, facing, [set(zorder, zorder-1), set(velocity_x,400*facing), set(velocity_y, -(400*(midpoint_y - level.player.midpoint_y))/ max(abs(midpoint_x - level.player.midpoint_x), abs(midpoint_y - level.player.midpoint_y)))]),sound('FlowerShot.ogg')]", solid_area: [20,6,52,24], animation: [ { image: "enemies/white-shooting-flower.png", pad: 3, body_area: "all", id: "normal", rect: [37,1,107,28], frames: 3, frames_per_row: 1, duration: 10, }, { image: "enemies/white-shooting-flower.png", pad: 3, body_area: "all", id: "spring", rect: [37,1,107,28], frames: 3, frames_per_row: 1, duration: 10, }, { image: "enemies/white-shooting-flower.png", pad: 3, body_area: "all", id: "shoot", rect: [111,1,181,28], frames: 4, frames_per_row: 1, duration: 6, events: "6:shoot", }, { image: "enemies/white-shooting-flower.png", pad: 3, body_area: "all", id: "turn", rect: [37,94,107,121], frames: 1, duration: 10, }, { image: "enemies/white-shooting-flower.png", pad: 3, body_area: "all", id: "hurt", rect: [37,1,107,28], }, ], }, { id: "shot", always_active: true, affected_by_currents: true, object_level_collisions: true, prototype: ["shot"], on_create: "add_particles('particles')", on_die: "spawn('pollen_impact_particle', midpoint_x, midpoint_y, 0)", on_timer: "[set(rotate, cycle*10)]", timer_frequency: 4, on_end_anim: "die()", on_enter_water: "[add_wave(midpoint_x, y2, 500, velocity_y, 10*velocity_y, 100, 100), add_wave(midpoint_x, y2, -500, velocity_y, 10*velocity_y, 100, 100), die()]", zorder: 10, animation: { id: "normal", image: "enemies/shooting-plant.png", rect: [90,2,100,12], frames: 1, duration: 250, body_area: "all", attack_area: "all", }, particle_system: { id: "particles", type: "point", generation_rate_millis: 250, dot_size: 3, dot_rounded: true, time_to_live: 12, time_to_live_rand: 24, colors: ["f9f9dbff","ffc20eff","ffc20eaa","ff7e00aa","ae4a2855"], pos_x: 5, pos_y: 5, velocity_x: -1500, velocity_x_rand: 3000, velocity_y: -1500, velocity_y_rand: 3000, }, }, ], }