Added an intense amount of updates

pinebook
Silverwizard 5 years ago
parent d62540f8b5
commit ab0e0ed3d0
  1. 61
      Cyberpunk.pl

@ -1,6 +1,7 @@
#!/usr/local/bin/perl #!/usr/local/bin/perl
use strict; use strict;
use warnings; use warnings;
use File::Random qw/:all/;
use constant depth => 5; use constant depth => 5;
@ -68,8 +69,8 @@ sub generate {
}else{ }else{
printf $CHAR " twin"; printf $CHAR " twin";
} }
my $ch = name(); my $ch = name($_[0],$_[1],depth+1,0);
printf $CHAR " sibling, named " . substr($ch, 0, -1) . " who "; printf $CHAR " sibling, named " . $ch . " who ";
$var = roll(10,1); $var = roll(10,1);
if(($var == 1)||($var == 2)){ if(($var == 1)||($var == 2)){
printf $CHAR "dislikes you\n\n"; printf $CHAR "dislikes you\n\n";
@ -86,7 +87,6 @@ sub generate {
if(($var == 9)||($var == 10)){ if(($var == 9)||($var == 10)){
printf $CHAR "hates you\n\n"; printf $CHAR "hates you\n\n";
} }
#generate($_[0] . "/" . substr(join('_', split(/ /,$ch)),0,-1), substr($ch,0,-1));
$i = $i - 1; $i = $i - 1;
} }
} }
@ -151,7 +151,7 @@ sub generate {
last SWITCH; last SWITCH;
}; };
$var == 6 && do { $var == 6 && do {
printf $CHAR "Lover, friend, or relative killed. You lost someone you really cared about (named " . name() . ") "; printf $CHAR "Lover, friend, or relative killed. You lost someone you really cared about (named " . name($_[0],$_[1],$_[2],0) . ") ";
my $how = roll(10,1); my $how = roll(10,1);
if($how <= 5){ if($how <= 5){
printf $CHAR "They died accidentally.\n\n"; printf $CHAR "They died accidentally.\n\n";
@ -228,18 +228,14 @@ sub generate {
}elsif($var <= 6){ }elsif($var <= 6){
$var = roll(10,1); $var = roll(10,1);
if($var <= 5){ if($var <= 5){
my $ch = name(); #DEBUG
printf $CHAR "You made a friend named [" . substr($ch,0,-1) . "](" . substr($ch,0,-1) . ".html).\n\n"; print "0: " . $_[0] . " 2: " . $_[2] . "\n";
my $ch = name($_[0],$_[1],$_[2]);
printf $CHAR "You made a friend named [" . $ch . "](" . $ch . ".html).\n\n";
printf $CHAR table("They are like a big brother/sister to you.", "They are like a kid sister/brother to you.", "They are like a teacher or mentor.", "They are like a partner or co-worker.", "They're an old lover.", "They're an old enemy.", "They are like a foster parent to you.", "They're a relative.", "You've reconnected with an old childhood friend.", "You met through a common interest.", "Your relationship"); printf $CHAR table("They are like a big brother/sister to you.", "They are like a kid sister/brother to you.", "They are like a teacher or mentor.", "They are like a partner or co-worker.", "They're an old lover.", "They're an old enemy.", "They are like a foster parent to you.", "They're a relative.", "You've reconnected with an old childhood friend.", "You met through a common interest.", "Your relationship");
if($_[2] < depth){
generate($_[0], substr($ch,0,-1), $_[2]+1);
}
}else{ }else{
my $ch = name(); my $ch = name($_[0],$_[1],$_[2]);
printf $CHAR "You made an enemy named [" . substr($ch,0,-1) . "](" . substr($ch,0,-1) . ".html).\n\n"; printf $CHAR "You made an enemy named [" . $ch . "](" . $ch . ".html).\n\n";
if($_[2] < depth){
generate($_[0], substr($ch,0,-1), $_[2]+1);
}
printf $CHAR table("Ex friend.", "Ex lover.", "Relative.", "Childhood enemy.", "Person working for you.", "Person you work for.", "Partner or co-worker.", "Booster gang member.", "Corporate Exec.", "Government official.", "Who are they"); printf $CHAR table("Ex friend.", "Ex lover.", "Relative.", "Childhood enemy.", "Person working for you.", "Person you work for.", "Partner or co-worker.", "Booster gang member.", "Corporate Exec.", "Government official.", "Who are they");
my $why = roll(10,1); my $why = roll(10,1);
SWITCH: { SWITCH: {
@ -298,12 +294,9 @@ sub generate {
} }
} }
}elsif($var <= 8){ }elsif($var <= 8){
my $ch = name(); my $ch = name($_[0],$_[1],depth+1,0);
printf $CHAR "You had a romance! With someone named [" . substr($ch,0,-1) . "](" . substr($ch,0,-1) . ".html).\n\n"; printf $CHAR "You had a romance! With someone named [" . $ch . "](" . $ch . ".html).\n\n";
printf $CHAR romance(); printf $CHAR romance();
if($_[2] < depth){
generate($_[0], substr($ch,0,-1), $_[2]+1);
}
}elsif($var <=10){ }elsif($var <=10){
printf $CHAR "You have an uneventful year\n\n"; printf $CHAR "You have an uneventful year\n\n";
} }
@ -334,9 +327,33 @@ sub roll{
} }
sub name{ sub name{
my $name = `notwhoami|head -n1`; my $name;
$name =~ s/ /_/g; my $flip;
return $name my $named = 0;
if(scalar @_ > 3){
$flip = $_[3];
}else{
$flip = roll(10,1);
}
print "Flip:" . $flip . "3:" . $_[3];
if($flip >= 3){
print " and entered\n";
$name = File::Random::random_file(-dir=>"$ARGV[0]");
$name =~ s/.md$//g;
print "Target: " . $name . " Source: " . $_[1] . "\n";
if($name ne $_[1]){
$named = 1;
}
}
if($named > 0 && $name eq "" ){
$name = `notwhoami|head -n1`;
$name =~ s/ /_/g;
if($_[2] < depth){
generate($_[0], $name, $_[2]+1);
}
}
print $name . "\n";
return $name;
} }
sub table{ sub table{

Loading…
Cancel
Save