From 7f394a8220f9a4e9538c9909fc32f952742d2fef Mon Sep 17 00:00:00 2001 From: Someone Date: Wed, 10 Feb 2016 22:35:17 +0100 Subject: [PATCH] no idea what i did back then --- bot.pl | 63 ++++++++++++++++++++++++++++++++---------------------- events.txt | 2 ++ 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/bot.pl b/bot.pl index 5e48d15..f9b3361 100755 --- a/bot.pl +++ b/bot.pl @@ -360,7 +360,12 @@ sub parse { my @vnicks = map { $rps{$_}{nick} } keys(%auto_login); while (@vnicks) { sts("MODE $opts{botchan} +".('v' x $opts{modesperline})." ".join(" ",@vnicks[0..$opts{modesperline}-1])); - splice(@vnicks,0,$opts{modesperline}); + splice(@vnicks,0,$opts{modesperline}-1); + } + my @onicks = map { $rps{$_}{nick} } grep { $rps{$_}{isadmin} == 1 } keys(%auto_login); + while (@onicks) { + sts("MODE $opts{botchan} +".('o' x $opts{modesperline})." ".join(" ",@onicks[0..$opts{modesperline}-1])); + splice(@onicks,0,$opts{modesperline}-1); } } } @@ -1759,42 +1764,46 @@ sub calamity { # suffer a little one my @players = grep { $rps{$_}{online} } keys(%rps); return unless @players; my $player = $players[rand(@players)]; - if (rand(10) < 1) { + if (rand(15) < 2) { my @items = ("amulet","charm","weapon","tunic","set of leggings", - "shield"); + "shield","pair of boots"); my $type = $items[rand(@items)]; + my $suffix=""; + if ($rps{$player}{item}{$type} =~ /(\D)$/) { $suffix=$1; } + $rps{$player}{item}{$type} = int(int($rps{$player}{item}{$type}) * .9); + $rps{$player}{item}{$type}.=$suffix; if ($type eq "amulet") { chanmsg(clog("$player fell, chipping the stone in his amulet! ". - "$player\'s $type loses 10% of its effectiveness.")); + "$player\'s $type loses 10% of its effectiveness: ".$rps{$player}{item}{$type})); + } + elsif ($type eq "pair of boots") { + chanmsg(clog("$player stepped in dog poop! ". + "$player\'s $type loses 10% of its effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "charm") { chanmsg(clog("$player slipped and dropped his charm in a dirty ". "bog! $player\'s $type loses 10% of its ". - "effectiveness.")); + "effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "weapon") { chanmsg(clog("$player left his weapon out in the rain to rust! ". - "$player\'s $type loses 10% of its effectiveness.")); + "$player\'s $type loses 10% of its effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "tunic") { chanmsg(clog("$player spilled a level 7 shrinking potion on his ". "tunic! $player\'s $type loses 10% of its ". - "effectiveness.")); + "effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "shield") { chanmsg(clog("$player\'s shield was damaged by a dragon's fiery ". "breath! $player\'s $type loses 10% of its ". - "effectiveness.")); + "effectiveness: ".$rps{$player}{item}{$type})); } else { chanmsg(clog("$player burned a hole through his leggings while ". "ironing them! $player\'s $type loses 10% of its ". - "effectiveness.")); + "effectiveness: ".$rps{$player}{item}{$type})); } - my $suffix=""; - if ($rps{$player}{item}{$type} =~ /(\D)$/) { $suffix=$1; } - $rps{$player}{item}{$type} = int(int($rps{$player}{item}{$type}) * .9); - $rps{$player}{item}{$type}.=$suffix; } else { my $time = int(int(5 + rand(8)) / 100 * $rps{$player}{next}); @@ -1819,39 +1828,43 @@ sub godsend { # bless the unworthy my @players = grep { $rps{$_}{online} } keys(%rps); return unless @players; my $player = $players[rand(@players)]; - if (rand(10) < 1) { + if (rand(15) < 2) { my @items = ("amulet","charm","weapon","tunic","set of leggings", - "shield"); + "shield","pair of boots"); my $type = $items[rand(@items)]; + my $suffix=""; + if ($rps{$player}{item}{$type} =~ /(\D)$/) { $suffix=$1; } + $rps{$player}{item}{$type} = int(int($rps{$player}{item}{$type}) * 1.1); + $rps{$player}{item}{$type}.=$suffix; if ($type eq "amulet") { chanmsg(clog("$player\'s amulet was blessed by a passing cleric! ". - "$player\'s $type gains 10% effectiveness.")); + "$player\'s $type gains 10% effectiveness: ".$rps{$player}{item}{$type})); + } + elsif ($type eq "pair of boots") { + chanmsg(clog("A wandring cobbler refit $player\'s boots! ". + "$player\'s $type gains 10% effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "charm") { chanmsg(clog("$player\'s charm ate a bolt of lightning! ". - "$player\'s $type gains 10% effectiveness.")); + "$player\'s $type gains 10% effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "weapon") { chanmsg(clog("$player sharpened the edge of his weapon! ". - "$player\'s $type gains 10% effectiveness.")); + "$player\'s $type gains 10% effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "tunic") { chanmsg(clog("A magician cast a spell of Rigidity on $player\'s ". - "tunic! $player\'s $type gains 10% effectiveness.")); + "tunic! $player\'s $type gains 10% effectiveness: ".$rps{$player}{item}{$type})); } elsif ($type eq "shield") { chanmsg(clog("$player reinforced his shield with a dragon's ". - "scales! $player\'s $type gains 10% effectiveness.")); + "scales! $player\'s $type gains 10% effectiveness: ".$rps{$player}{item}{$type})); } else { chanmsg(clog("The local wizard imbued $player\'s pants with a ". "Spirit of Fortitude! $player\'s $type gains 10% ". - "effectiveness.")); + "effectiveness: ".$rps{$player}{item}{$type})); } - my $suffix=""; - if ($rps{$player}{item}{$type} =~ /(\D)$/) { $suffix=$1; } - $rps{$player}{item}{$type} = int(int($rps{$player}{item}{$type}) * 1.1); - $rps{$player}{item}{$type}.=$suffix; } else { my $time = int(int(5 + rand(8)) / 100 * $rps{$player}{next}); diff --git a/events.txt b/events.txt index 21b5fd8..6dfe92e 100755 --- a/events.txt +++ b/events.txt @@ -1,3 +1,4 @@ +C lost terminal C was swimming in the sea while BP dumped some kilotons oil into that water C watched the Nuclear meltdown in Fukushima for too long C was hit by a 150 year old collapsing pedestrian bridge @@ -48,6 +49,7 @@ G discovered caffeinated coffee G was visited by a very pretty nymph G found kitten G learned Perl +G found a fresh piece of pizza G found an exploit in the IRPG code G bribed the local IRPG administrator G tamed a wild horse -- 2.43.0