BalanceOfPower

 view release on metacpan or  search on metacpan

lib/BalanceOfPower/Relations/Friendship.pm  view on Meta::CPAN

{
    my $self = shift;
    return $self->status_color . $self->status . color("reset");
}

sub status_color
{
    my $self = shift;
    if($self->status eq 'ALLIANCE' || $self->status eq 'INFLUENCE PRESENT')
    {
        return color("cyan bold");
    }
    if($self->status eq 'HATE')
    {
        return color("red bold");
    }
    elsif($self->status eq 'FRIENDSHIP')
    {
        return color("green bold");
    }
    else
    {
        return "";
    }
}


sub html
{

lib/BalanceOfPower/Relations/War.pm  view on Meta::CPAN

    my $army_node2 = shift;
    my $mode = shift;
    my $army_node1_label = $army_node1 ? "[".$army_node1."] " : "";
    my $army_node2_label = $army_node2 ? " [".$army_node2."]" : "";
    my $node1 = $army_node1_label . $self->node1;
    my $node2 = $self->node2 . $army_node2_label;
    if($mode eq 'print')
    {
        if($self->node1_faction == 0)
        {
            $node1 = color("bold") . $node1 . color("reset");
        }
        else
        {
            $node2 = color("bold") . $node2 . color("reset");
        }
        return  $node1 . " -> " . $node2;
    }
    elsif($mode eq 'html')
    {
        if($self->node1_faction == 0)
        {
            $node1 = as_html_evidenced($node1);
        }
        else

lib/BalanceOfPower/Utils.pm  view on Meta::CPAN

    }
    elsif($mode eq 'html')
    {
        return "<h4>$text</h4>";
    }
}

sub as_title
{
    my $text = shift;
    return color("yellow bold") . $text . color("reset");
}
sub as_html_title
{
    my $text = shift;
    return "<h3>$text</h3>";
}
sub as_html_dangerous
{
    my $text = shift;
    return '<span class="dangerous">' . $text . '</span>';

lib/BalanceOfPower/Utils.pm  view on Meta::CPAN

    return "<p>$text</p>";
}
sub as_subtitle
{
    my $text = shift;
    return color("yellow") . $text . color("reset");
}
sub as_evidenced
{
    my $text = shift;
    return color("bold green") . $text . color("reset");
}
sub as_active
{
    my $text = shift;
    return color("bold white") . $text . color("reset");
}
sub br
{
    my $mode = shift;
    if($mode eq 'print')
    {
        return "\n";
    }
    elsif($mode eq 'html')
    {

lib/BalanceOfPower/templates/print/print_actual_nation_situation.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "$nation.name" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]
Area: [% nation.area %]
Export quote: [% nation.export_quote %]
Government strength: [% nation.government_strength %]
Internal situation:  [% nation.internal_disorder_status %]

[% IF under_influence -%]
[% nation.name %] is under influence of [% under_influence %]

[%- ELSE -%]
[%- IF influence.size > 0 -%]

lib/BalanceOfPower/templates/print/print_all_crises.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "CRISES" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]
[% i = 0 %]
[% FOREACH c IN crises %][% IF wars.$i == 1 %][% "$c.node1 <-> $c.node2 $c.print_grey_crisis_bar" | color 'red' 'bold' %][% ELSE %][% c.node1 %] <-> [% c.node2 %] [% c.print_grey_crisis_bar %][% END %][% i = i + 1 %]
[% END %]

lib/BalanceOfPower/templates/print/print_borders_analysis.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "BORDERS ANALYSIS FOR $nation" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]
[% FOREACH b IN borders.keys %]
[% FILTER color 'yellow' %]# [% b %][% END %]
   Relations: [% borders.$b.relation.colored_status %]
[% IF borders.$b.support %]   Military support in the country: [% borders.$b.support.nation %] [% borders.$b.support.relation.colored_status %][% END %]
[% END %]

lib/BalanceOfPower/templates/print/print_cargo.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "CARGO" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

Goods: [% goods %]
Luxury: [% luxury %]
Arms: [% arms %]
Tech: [% tech %]
Culture: [% culture %]

Available space: [% free %]

lib/BalanceOfPower/templates/print/print_civil_war_history.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "CIVIL WAR HISTORY" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]
[% FOREACH wn IN civil_war_names %][% wnname = wn.name %]
[% "### $wnname" | color 'yellow' %]
[% w = civil_wars.$wnname %]
*** Civil War started in [% w.start_date %] ***
[% FOREACH t IN w.get_turn_tags %][% FOREACH ev IN w.events.$t %] [% IF t != 'START' %][% t %]: [% END %][% ev.text %]
[% END %][% END %]*** Civil war ended in [% w.end_date %] ***
[% END %]

lib/BalanceOfPower/templates/print/print_diplomacy.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "DIPLOMACY FOR $nation" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FOREACH r IN relationships %][% FILTER format('%-16s') %][% IF r.node1 == nation %][% r.node2 %][% ELSE %][% r.node1 %][% END %]:[% END %] [% FILTER format('%-7s') %][% r.colored_status %][% END %]
[% END %]

lib/BalanceOfPower/templates/print/print_influences.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "INFLUENCES" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FOREACH i IN influences %][% FILTER collapse %]
[% i.print %]
[% END %]
[% END %]

lib/BalanceOfPower/templates/print/print_market.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "MARKET" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FILTER color 'yellow' %][% FILTER format('%-16s') %]NATION[% END %][% FILTER format('%-10s') %]STOCK[% END %][% FILTER format('%-10s') %]VALUE[% END %][% FILTER format('%-10s') %]STATUS[% END %]
[% END %]
[% FOREACH n IN nations %][% FILTER format('%-16s') %][% n %][% END %][% FILTER format('%-10s') %][% market_data.$n.stocks %][% END %][% FILTER format('%-10s') %][% market_data.$n.wd %][% END %][% FILTER format('%-10s') %][% market_data.$n.status %][...
[% END %]

lib/BalanceOfPower/templates/print/print_nation_statistics.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "$nation" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FILTER color 'yellow' %][% FILTER format('%-12s') %]Year[% END %][% INCLUDE 'fragments/nation_attributes_header.tt' %][% END %]
[% FOREACH t IN statistics.keys.sort %][% FILTER format('%-12s') %][% t %][% END %]
[%- nationstats = statistics.$t -%] 
[%- INCLUDE 'fragments/nation_attributes.tt' -%]
[% END %]

lib/BalanceOfPower/templates/print/print_near_analysis.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "MILITARY RANGE ANALYSIS FOR $nation" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]
[% FOREACH n IN near %]
[% FILTER color 'yellow' %]# [% n.nation %][% END %]
   Relations: [% n.relation.colored_status %]
   In range because: [% INCLUDE fragments/in_range_reason.tt reason = n %] 
[% END %]

lib/BalanceOfPower/templates/print/print_player_friendship.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "FRIENDSHIP FOR $player" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FOREACH n IN friendship.keys -%]
[% n %]: [% friendship.$n %]
[% END %]

[% IF others == 1 %]All the other nations are perfectly neutral[% END %]

lib/BalanceOfPower/templates/print/print_shop_prices.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "SHOP PRICES" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% "# $nation" | color 'yellow' %]

Goods: [% goods_price %]
Luxury: [% luxury_price %]
Arms: [% arms_price %]
Tech: [% tech_price %]
Culture: [% culture_price %]

lib/BalanceOfPower/templates/print/print_stocks.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "WALLET" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FILTER color 'yellow' %][% FILTER format('%-16s') %]NATION[% END %][% FILTER format('%-10s') %]Q[% END %][% FILTER format('%-10s') %]VALUE[% END %][% FILTER format('%-10s') %]INFLUENCE[% END %][% FILTER format('%-10s') %]WAR BONDS[% END %][% END %...
[% FOREACH n IN market_data.keys -%]
[%- FILTER format('%-16s') %][% n %][% END %][% FILTER format('%-10s') %][% market_data.$n.stocks %][% END %][% FILTER format('%-10s') %][% market_data.$n.value %][% END %][% FILTER format('%-10s') %][% market_data.$n.influence %][% END %][% FILTER f...
[% END %]
Stock value: [% stock_value %]
Money: [% money %]
Total value: [% total_value %]

lib/BalanceOfPower/templates/print/print_supports.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% title | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FOREACH s IN supports %][% FILTER collapse %]
[% s.node1 %] --> [% s.node2 %] [[% s.army %]]
[% END %]
[% END %]

lib/BalanceOfPower/templates/print/print_targets.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "TARGETS" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FILTER color "cyan" "bold" %]Mission points: [% END -%][% points %]

[% FILTER color "magenta" %]Active targets 
---[% END %]
[% FOREACH t IN targets %][% t.name %] ([% t.countdown %] turns remaining)
[% END %]

lib/BalanceOfPower/templates/print/print_travel_plan.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "AVAILABLE TRAVELS" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% "# AIR" | color 'yellow' %]
[% FOREACH n IN plan.air.keys -%]
[% n %]: [% plan.air.$n.status %] [% IF plan.air.$n.status == 'OK' %][Cost: [% plan.air.$n.cost %]][% END %]
[% END %]
[% "# GROUND" | color 'yellow' %]
[% FOREACH n IN plan.ground.keys -%]
[% n %]: [% plan.ground.$n.status %] [% IF plan.ground.$n.status == 'OK' %][Cost: [% plan.ground.$n.cost %]][% END %]
[% END -%]

lib/BalanceOfPower/templates/print/print_treaties.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% title | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FOREACH t IN treaties %][% FILTER collapse %]
[% t.node1 %] <-> [% t.node2 %] 
[% END %]
[% END %]

lib/BalanceOfPower/templates/print/print_turn_events.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% IF title %][% title | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %][% END %]
[% FOREACH t IN turns %]
[% t | color 'yellow' %]
[% "---" | color 'yellow' %]
[% FOREACH e IN events.$t %]  [% e %]
[% END %][% END %]

lib/BalanceOfPower/templates/print/print_turn_statistics.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "YEAR $year" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]

[% FILTER color 'yellow' %][% FILTER format('%-16s') %]Nation[% END %][% INCLUDE 'fragments/nation_attributes_header.tt' %][% END %]
[% FOREACH n IN names %][% FILTER format('%-16s') %][% n %][% END %]
[%- nationstats = statistics.$n -%] 
[%- INCLUDE 'fragments/nation_attributes.tt' -%]
[% END %]

lib/BalanceOfPower/templates/print/print_war_history.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "WAR HISTORY" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]
[% FOREACH wn IN war_names %][% wnname = wn.name %]
[% "### WAR $wnname" | color 'yellow' %]
[% FOREACH w IN wars.$wnname %]
[% "$w.node1 => $w.node2" | color 'white' 'bold' %]
*** War started in [% w.start_date %] ***
[% FOREACH t IN w.get_turn_tags %][% FOREACH ev IN w.events.$t %] [% IF t != 'START' %][% t %]: [% END %][% ev %]
[% END %][% END %]*** War ended in [% w.end_date %] ***
[% END %][% END %]

lib/BalanceOfPower/templates/print/print_wars.tt  view on Meta::CPAN

[% USE ANSIColor 'color' %]
[% "WARS" | color 'yellow' 'bold' %]
[% "===" | color 'yellow' 'bold' %]
[% FOREACH w IN wars %]
[% "### WAR $w.name" | color 'yellow' %]
[% FOREACH sw IN w.conflicts %][% FILTER collapse %][% IF sw.node1_faction == 0 %]
[% "[$sw.army1] $sw.node1" | color 'bold' 'white' %] --> [% sw.node2 %] [[% sw.army2 %]]
[% ELSE %]
[[% sw.army1 %]] [% sw.node1 %] --> [% "$sw.node2 [$sw.army2]" | color 'bold' 'white' %][% END %][% END %]
[% END %][% END %]

[% FOREACH cw IN civil_wars %][% cw %] is fighting civil war
[% END %]




( run in 0.478 second using v1.01-cache-2.11-cpan-5dc5da66d9d )