Skip to content

Commit

Permalink
formatting stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
doy committed Nov 4, 2009
1 parent d15373b commit 2951d54
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
8 changes: 4 additions & 4 deletions lib/TAEB/Action/Move.pm
Expand Up @@ -83,10 +83,10 @@ sub done {
# If we pushed a boulder, then if it's still there, it
# must be genuine.
TAEB->current_tile->known_genuine_boulder(0);
my $beyond =
TAEB->current_level->at_safe(
TAEB->x * 2 - $self->starting_tile->x,
TAEB->y * 2 - $self->starting_tile->y);
my $beyond = TAEB->current_level->at_safe(
TAEB->x * 2 - $self->starting_tile->x,
TAEB->y * 2 - $self->starting_tile->y,
);
$beyond->known_genuine_boulder(1)
if $beyond && $beyond->has_boulder;
}
Expand Down
16 changes: 10 additions & 6 deletions lib/TAEB/World/Cartographer.pm
Expand Up @@ -23,12 +23,16 @@ has y => (
has fov => (
isa => 'ArrayRef',
is => 'ro',
default => sub { calculate_fov(TAEB->x, TAEB->y, sub {
defined $_[0] or $_[0] = TAEB->x,
defined $_[1] or $_[1] = TAEB->y,
my $tile = TAEB->current_level->at(@_);
$tile && $tile->is_transparent ? 1 : 0;
}) },
default => sub {
calculate_fov(TAEB->x, TAEB->y, sub {
my @coords = @_;
$coords[0] = TAEB->x unless defined $coords[0];
$coords[1] = TAEB->y unless defined $coords[1];
my $tile = TAEB->current_level->at(@coords);
return unless $tile;
return $tile->is_transparent;
})
},
clearer => 'invalidate_fov',
lazy => 1,
);
Expand Down
3 changes: 2 additions & 1 deletion lib/TAEB/World/Level.pm
Expand Up @@ -119,7 +119,8 @@ has pit_and_hole_traps_untrapped => (
subscribe covered_pit => sub {
my $self = shift;
$self->pit_and_hole_traps_untrapped(
$self->pit_and_hole_traps_untrapped + 1);
$self->pit_and_hole_traps_untrapped + 1
);
};

# Note that the quest portal can be on the rogue level, so this can't
Expand Down
9 changes: 5 additions & 4 deletions lib/TAEB/World/Tile/Altar.pm
Expand Up @@ -11,11 +11,12 @@ has align => (

sub debug_color {
my $self = shift;
my $align = $self->align;

if (defined $self->align) {
return display(COLOR_RED) if $self->align eq 'Cha';
return display(COLOR_GREEN) if $self->align eq 'Neu';
return display(COLOR_CYAN) if $self->align eq 'Law';
if (defined $align) {
return display(COLOR_RED) if $align eq 'Cha';
return display(COLOR_GREEN) if $align eq 'Neu';
return display(COLOR_CYAN) if $align eq 'Law';
}

return display(COLOR_MAGENTA);
Expand Down

0 comments on commit 2951d54

Please sign in to comment.