From c0134b6bafb74b4448fbe8874526592689341660 Mon Sep 17 00:00:00 2001 From: Silverwizard Date: Thu, 22 Aug 2019 18:55:27 -0400 Subject: [PATCH] Moved character sheet above backstory Fixed markdown type Added a tool to htmlifize the output --- Cyberpunk.pl | 47 +++++++++++++++++++++++------------------------ tohtml.sh | 4 ++++ 2 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 tohtml.sh diff --git a/Cyberpunk.pl b/Cyberpunk.pl index a64556d..af20e7e 100755 --- a/Cyberpunk.pl +++ b/Cyberpunk.pl @@ -2,12 +2,9 @@ use strict; use warnings; -#print $#ARGV; -#if($#ARGV+1 >= 2){ -# use constant depth => $ARGV[1]; -#}else{ - use constant depth => 5; -#} +use constant depth => 5; + +$ARGV[0] =~ s/ /_/g; mkdir $ARGV[0], 0755 unless -d $ARGV[0]; generate($ARGV[0], $ARGV[0], 1); @@ -26,7 +23,7 @@ sub generate { my $EMP = roll(8,3); my $BT = roll(8,3); my $GENDER = table("Male", "Male", "Female", "Male", "Female", "Female", "Male", "Female", "Nonbinary", "Cyborg", "Gender"); - my $SEX = table("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; foreach my $item ("Male", "Female", "Nonbinary", "Cyborg"){ if(roll(2,1)>1){ @@ -34,7 +31,23 @@ sub generate { } } - printf $CHAR "Name: " . $_[1] . "\n"; + printf $CHAR "Name: " . $_[1] . "\n\n"; + printf $CHAR "INT: " . $INT . "\n"; + printf $CHAR "REF: " . $REF . "\n"; + printf $CHAR "CL: " . $CL . "\n"; + printf $CHAR "TECH: " . $TECH . "\n"; + printf $CHAR "LK: " . $LK . "\n"; + printf $CHAR "ATT: " . $ATT . "\n"; + printf $CHAR "MA: " . $MA . "\n"; + printf $CHAR "EMP: " . $EMP . "\n"; + printf $CHAR "BT: " . $BT . "\n\n"; + printf $CHAR $GENDER; + printf $CHAR $SEX; + printf $CHAR "Orientation: "; + foreach my $item (@ORIENTATION) { + printf $CHAR $item . " "; + } + printf $CHAR "\n\n"; 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"); @@ -306,21 +319,6 @@ sub generate { } $age = $age-1; } - printf $CHAR "INT: " . $INT . "\n\n"; - printf $CHAR "REF: " . $REF . "\n\n"; - printf $CHAR "CL: " . $CL . "\n\n"; - printf $CHAR "TECH: " . $TECH . "\n\n"; - printf $CHAR "LK: " . $LK . "\n\n"; - printf $CHAR "ATT: " . $ATT . "\n\n"; - printf $CHAR "MA: " . $MA . "\n\n"; - printf $CHAR "EMP: " . $EMP . "\n\n"; - printf $CHAR "BT: " . $BT . "\n\n\n"; - printf $CHAR $GENDER . "\n\n"; - printf $CHAR $SEX . "\n\n"; - printf $CHAR "Orientation: "; - foreach my $item (@ORIENTATION) { - printf $CHAR $item . " "; - } printf $CHAR "\n\n"; close($CHAR); } @@ -331,7 +329,8 @@ sub roll{ sub name{ my $name = `notwhoami|head -n1`; - return $name; + $name =~ s/ /_/g; + return $name } sub table{ diff --git a/tohtml.sh b/tohtml.sh new file mode 100644 index 0000000..58f2fc1 --- /dev/null +++ b/tohtml.sh @@ -0,0 +1,4 @@ +for char in `ls $1` +do + markdown $1/$char > $1/`echo $char |sed 's/.md$/.html/'` +done