3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

More nickometer tweaks

This commit is contained in:
Pragmatic Software 2014-05-02 03:57:19 +00:00
parent 8e07eb300e
commit af447c2614
2 changed files with 7 additions and 2 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 563,
BUILD_REVISION => 564,
BUILD_DATE => "2014-05-01",
};

View File

@ -25,6 +25,7 @@ sub nickometer ($) {
# Deal with special cases (precede with \ to prevent de-k3wlt0k)
my %special_cost = (
'__' => 200,
'69' => 500,
'dea?th' => 500,
'dark' => 400,
@ -62,6 +63,10 @@ sub nickometer ($) {
}
}
while(m/[A-Z]([^A-Z]+)\b/g) {
&punish(250, "length 1 between capitals") if length $1 == 1;
}
# Allow Perl referencing
s/^\\([A-Za-z])/$1/;
@ -139,7 +144,7 @@ sub nickometer ($) {
$remains =~ tr/a-zA-Z0-9//d;
my $remains_length = length($remains);
&punish(50 * $remains_length + &slow_pow(9, $remains_length),
&punish(150 * $remains_length + &slow_pow(9, $remains_length),
$remains_length . ' extraneous ' .
(($remains_length == 1) ? 'symbol' : 'symbols'))
if $remains;