Fixed the table function to not suck

pinebook
silverwizard 5 years ago
parent bafe3a95ef
commit c0c5b6cf2c
  1. 53
      Cyberpunk.pl

@ -338,56 +338,15 @@ sub name{
sub table{
my $return;
$return = $_[10] . ": ";
my $var = roll(10,1);
SWITCH: {
$var == 1 && do {
$return = $return . $_[0];
last SWITCH;
};
$var == 2 && do {
$return = $return . $_[1];
last SWITCH;
};
$var == 3 && do {
$return = $return . $_[2];
last SWITCH;
};
$var == 4 && do {
$return = $return . $_[3];
last SWITCH;
};
$var == 5 && do {
$return = $return . $_[4];
last SWITCH;
};
$var == 6 && do {
$return = $return . $_[5];
last SWITCH;
};
$var == 7 && do {
$return = $return . $_[6];
last SWITCH;
};
$var == 8 && do {
$return = $return . $_[7];
last SWITCH;
};
$var == 9 && do {
$return = $return . $_[8];
last SWITCH;
};
$var == 10 && do {
$return = $return . $_[9];
last SWITCH;
};
}
$return = $return . "\n\n";
my $length = scalar @_;
$return = $_[$length-1] . ": ";
my $var = roll($length-2,1);
$return = $return . $_[$var] . "\n\n";
return $return;
}
sub win{
my $return;
$return = $return . "You had a big win!\n\n";
$return = "You had a big win!\n\n";
my $win = roll(10,1);
SWITCH: {
$win == 1 && do {
@ -446,7 +405,7 @@ sub win{
}
sub romance{
my $return;
my $return = "";
my $workedout = roll(10,1);
if($workedout <= 4){
$return = $return . "You had a happy love affair, it worked out well\n\n";

Loading…
Cancel
Save