Show
Ignore:
Timestamp:
08/27/07 22:45:31 (3 years ago)
Author:
eevee
Message:

Nearly-finished item descriptions, cleanup, general rearrangement, etc. Also includes underground sprites and Fling effects. (#10)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Schema/Items.pm

    r233 r315  
    1010__PACKAGE__->load_components("PK::Auto", "Core"); 
    1111__PACKAGE__->table("items"); 
    12 __PACKAGE__->add_columns(qw/ id game_id berry_id name cost col5 hp_plus_maybe col7 col8 fling_power natural_gift_power natural_gift_type col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 effort_hp effort_at effort_de effort_sp effort_sa effort_sd hp_restored pp_restored happiness1 happiness2 happiness3 dpblurb /); 
     12__PACKAGE__->add_columns(qw/ id game_id berry_id name category cost col5 hp_plus_maybe fling_power fling_effect natural_gift_power natural_gift_type col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 effort_hp effort_at effort_de effort_sp effort_sa effort_sd hp_restored pp_restored happiness1 happiness2 happiness3 is_underground dpblurb description /); 
    1313__PACKAGE__->set_primary_key("id"); 
    1414__PACKAGE__->add_unique_constraint(["id"], undef); 
     
    2727} 
    2828 
     29sub sprite_name { 
     30    my ($self) = @_; 
     31 
     32    my $name = lc $self->name; 
     33    # TMs! 
     34 
     35    $name =~ tr/ /-/; 
     36    $name =~ tr/-a-z0-9//cd; 
     37 
     38    return $name; 
     39} 
     40 
     41sub fling_description { 
     42    my ($self) = @_; 
     43 
     44    return 'n/a' if not $self->fling_power; 
     45 
     46    my $desc = 'Inflicts regular damage with ' . $self->fling_power . ' power.'; 
     47    $desc .= '  ' . $self->fling_effect 
     48        if $self->fling_effect; 
     49 
     50    return $desc; 
     51} 
     52 
    29531; 
    3054