command p => {
help => q(usage: .p X:Y:Z | or .p nick with high enough access),
+ type => 'member',
}, class extends NDIRC::Command {
method execute($c,$msg) {
my $eff = class extends NDIRC::Command {
use ND::Include;
method execute($c,$msg) {
- my ($amount,$ship,$target) = $msg =~ /^(-?\d+(?:\.\d+)?[hkMG]?) (\w+)(?: (\w+))?/
+ my ($amount,$ship,$target) = $msg =~ /^(-?\d+(?:\.\d+)?[hkMG]?) ([\w\%]+)(?: (\w+))?/
or die 'ARGS';
- $ship = "\%$ship\%";
+ $ship = "$ship\%";
$target //= '%';
my $value;
if ($self->name =~ /^v.+$/){
my $feud = '';
my $s= $c->model->selectrow_hashref(q{
-SELECT name,t1,t2,t3,"type",damage
+SELECT ship,t1,t2,t3,"type",damage
,metal+crystal+eonium AS cost
,init,"class",guns,race,eres,armor
-FROM ship_stats WHERE name ILIKE ?
+FROM ship_stats WHERE ship ILIKE ?
}, undef, $ship);
return unless $s;
if (defined $value){
$amount = int(($value*100/$s->{cost}));
- $feud = '(FEUD: '.prettyValue(int($amount/0.86)).') ';
+ $feud = '(Dem/Tot: '.prettyValue(int($amount/0.92)).') ';
}
$value = prettyValue(($amount*$s->{cost}/100));
- my $name = shipColor($s->{name},$s->{type});
+ my $name = shipColor($s->{ship},$s->{type});
my $text = prettyValue($amount)." $feud $name ($s->{init}:$value) :";
for my $tn ('t1','t2','t3'){
next unless defined ($self->target($s,$tn));
$text .= " <b><c03>" . $self->target($s,$tn) . "</c></b>: ";
my $st = $self->query(q{
-SELECT name,"class","type",armor
+SELECT ship,"class","type",armor
,metal+crystal+eonium AS cost
,init,t1,t2,t3,eres,race
,damage,guns
while (my $t = $st->fetchrow_hashref()){
my $number = $self->calcEff($s,$t,$tn,$amount);
$value = prettyValue($number*$t->{cost}/100);
- my $name = shipColor($t->{name},$t->{type});
+ my $name = shipColor($t->{ship},$t->{type});
$text .= " <b>$number</b> $name ($t->{init}:$value),";
}
chop $text;