Last bug seems to be that asexual people can't have romances, fix this

pinebook
Silverwizard 5 years ago
parent 526c6ddea6
commit 171483672f
  1. 40
      Cyberpunk.pl

@ -13,7 +13,7 @@ mkdir $ARGV[0], 0755 unless -d $ARGV[0];
foreach my $item (@SEXES){ foreach my $item (@SEXES){
mkdir $ARGV[0] . "/" . $item unless -d $ARGV[0] . "/" . $item; mkdir $ARGV[0] . "/" . $item unless -d $ARGV[0] . "/" . $item;
} }
generate($ARGV[0], $ARGV[1], 1,@SEXES); generate($ARGV[0], $ARGV[1], 1,\@SEXES);
sub generate { sub generate {
my $CHAR; my $CHAR;
@ -28,7 +28,9 @@ sub generate {
my $MA = roll(8,3); my $MA = roll(8,3);
my $EMP = roll(8,3); my $EMP = roll(8,3);
my $BT = roll(8,3); my $BT = roll(8,3);
my $GENDER = $_[3][roll(scalar @_[3]-1,0)]; my @POSSEX = $_[3]->[0];
my $genderroll = roll(scalar @POSSEX-1,0);
my $GENDER = $POSSEX[$genderroll];
my $SEX = table($GENDER, $GENDER, $GENDER, "Male", "Male", "Female", "Male", "Female", "Female", "Male", "Female", "Nonbinary", "Cyborg", "Sex"); my $SEX = table($GENDER, $GENDER, $GENDER, "Male", "Male", "Female", "Male", "Female", "Female", "Male", "Female", "Nonbinary", "Cyborg", "Sex");
my @ORIENTATION; my @ORIENTATION;
foreach my $item (@SEXES){ foreach my $item (@SEXES){
@ -40,7 +42,7 @@ sub generate {
$GENDER =~ s/^.*: //; $GENDER =~ s/^.*: //;
chomp($GENDER); chomp($GENDER);
chomp($GENDER); chomp($GENDER);
symlink($_[0] . "/" . $_[1] . ".md", $_[0] . "/" . $GENDER . "/" . $_[1] . ".md"); symlink("../" . "/" . $_[1] . ".md", "./" . $_[0] . "/" . $GENDER . "/" . $_[1] . ".md");
printf $CHAR table("Biker Leathers", "Blue Jeans", "Corporate Suits", "Jumpsuits", "Miniskirts", "High Fashion", "Cammos", "Normal Clothes", "Nude", "Bag Lady Chic", "Generally Wears"); printf $CHAR table("Biker Leathers", "Blue Jeans", "Corporate Suits", "Jumpsuits", "Miniskirts", "High Fashion", "Cammos", "Normal Clothes", "Nude", "Bag Lady Chic", "Generally Wears");
printf $CHAR table("Mohawk", "Long & Ratty", "Short & Spiked", "Wild & all over", "Bald", "Stripped", "Tinted", "Neat, short", "Short, curly", "Long, straight", "Hair"); printf $CHAR table("Mohawk", "Long & Ratty", "Short & Spiked", "Wild & all over", "Bald", "Stripped", "Tinted", "Neat, short", "Short, curly", "Long, straight", "Hair");
@ -72,7 +74,7 @@ sub generate {
printf $CHAR " twin"; printf $CHAR " twin";
} }
#my $ch = name($_[0],$_[1],0,0); #my $ch = name($_[0],$_[1],0,0);
my $ch = name($_[0],$_[1],$_[2],@SEXES,0); my $ch = name($_[0],$_[1],$_[2],\@SEXES,1);
#printf $CHAR " sibling, named " . $ch . " who "; #printf $CHAR " sibling, named " . $ch . " who ";
printf $CHAR " sibling, named [" . $ch . "](" . $ch . ".html) who "; printf $CHAR " sibling, named [" . $ch . "](" . $ch . ".html) who ";
$var = roll(10,1); $var = roll(10,1);
@ -155,7 +157,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($_[0],$_[1],$_[2],@SEXES,0) . ") "; printf $CHAR "Lover, friend, or relative killed. You lost someone you really cared about (named " . name($_[0],$_[1],$_[2],\@SEXES,1) . ") ";
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";
@ -232,11 +234,11 @@ 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($_[0],$_[1],$_[2],@SEXES); my $ch = name($_[0],$_[1],$_[2],\@SEXES);
printf $CHAR "You made a friend named [" . $ch . "](" . $ch . ".html).\n\n"; 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");
}else{ }else{
my $ch = name($_[0],$_[1],$_[2],@SEXES); my $ch = name($_[0],$_[1],$_[2],\@SEXES);
printf $CHAR "You made an enemy named [" . $ch . "](" . $ch . ".html).\n\n"; printf $CHAR "You made an enemy named [" . $ch . "](" . $ch . ".html).\n\n";
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);
@ -296,7 +298,7 @@ sub generate {
} }
} }
}elsif($var <= 8){ }elsif($var <= 8){
my $ch = name($_[0],$_[1],$_[2],@ORIENTATION); my $ch = name($_[0],$_[1],$_[2],\@ORIENTATION);
printf $CHAR "You had a romance! With someone named [" . $ch . "](" . $ch . ".html).\n\n"; printf $CHAR "You had a romance! With someone named [" . $ch . "](" . $ch . ".html).\n\n";
printf $CHAR romance(); printf $CHAR romance();
}elsif($var <=10){ }elsif($var <=10){
@ -332,13 +334,19 @@ sub name{
my $name; my $name;
my $flip; my $flip;
my $named = 0; my $named = 0;
if(scalar @_ > 4){ my @POSSEX = $_[3]->[0];
$flip = $_[4]; my $genderroll = roll(scalar @POSSEX-1,0);
}else{ my $GENDER = $POSSEX[$genderroll];
$flip = roll(depth*2,1); $flip = roll(depth*2,1);
} if($flip <= $_[2] || $_[2] > depth || defined $_[4] ){
if($flip <= $_[2] || $_[2] > depth){ my $dir = "./" . $ARGV[0] . "/" . $GENDER;
$name = File::Random::random_file(-dir=>"$ARGV[0]"); print "Dir: ". $dir . "\n";
$name = File::Random::random_file(
-dir => "$dir",
-follow => 1,
-recursive => 1
);
print "Name: " . $name . "\n";
$name =~ s/.md$//g; $name =~ s/.md$//g;
if($name ne $_[1]){ if($name ne $_[1]){
$named = 1; $named = 1;
@ -349,7 +357,7 @@ sub name{
$name =~ s/ /_/g; $name =~ s/ /_/g;
chomp($name); chomp($name);
if($_[2] < depth){ if($_[2] < depth){
generate($_[0], $name, $_[2]+1,@SEXES); generate($_[0], $name, $_[2]+1,\@POSSEX);
} }
} }
return $name; return $name;

Loading…
Cancel
Save