Games::Lacuna::Task::Role::Ships - Helper methods for fetching and building ships


    package Games::Lacuna::Task::Action::MyTask;
    use Moose;
    extends qw(Games::Lacuna::Task::Action);
    with qw(Games::Lacuna::Task::Role::Ships);


This role provides ship-related helper methods.



    my @avaliable_scows = $self->get_ships(
        planet          => $planet_stats,
        ships_needed    => 3, # get three
        ship_type       => 'scow',

Tries to fetch the given number of available ships. If there are not enough ships available then the required number of ships are built.

The following arguments are accepted

  • planet

    Planet data has [Required]

  • ships_needed

    Number of required ships. If ships_needed is a negative number it will return all matching ships and build as many new ships as possible while keeping ships_needed * -1 space port slots free [Required]

  • ship_type

    Ship type [Required]

  • travelling

    If true will not build new ships if there are matchig ships currently travelling

  • name_prefix

    Will only return ships with the given prefix in their names. Newly built ships will be renamed to add the prefix.


 my $trade_ships = $self->trade_ships($body_id,$cargo_list);

Returns a hashref with cargo ship ids as keys and cargo lists as values.



Pushes the selected ships from one body to another