From 6383e2555427f8d0ba9511d089eb44821d164a85 Mon Sep 17 00:00:00 2001 From: silverwizard Date: Fri, 29 Nov 2019 12:59:07 -0500 Subject: [PATCH] Renamed "shopping" to CardGen Fixed some word wrapping and off the end run Added font choices Added tech for changing background colour eventually --- shopping.pl => CardGen.pl | 17 +- shopping.yml | 337 +++++++++++++++++++------------------- 2 files changed, 178 insertions(+), 176 deletions(-) rename shopping.pl => CardGen.pl (58%) diff --git a/shopping.pl b/CardGen.pl similarity index 58% rename from shopping.pl rename to CardGen.pl index 81bb807..e5ef5df 100644 --- a/shopping.pl +++ b/CardGen.pl @@ -5,24 +5,25 @@ use Text::Wrap; $Text::Wrap::columns = 30; my $cards = LoadFile('shopping.yml'); -my @card_table; -foreach my $card (keys %{$cards->{Cards}}){ +$bgcolour = $cards->{Deck}->{Background}; +$mainfont = $cards->{Deck}->{Font}; + +foreach my $card (keys %{$cards->{Deck}->{Cards}}){ my $image = Image::Magick->new(size=>'600x825'); $image->ReadImage('canvas:white'); $image->Draw(stroke=>'red', fill => 'none', strokewidth=>1, primitive=>'rectangle', points=>'38,38 562,787'); my $surface = Image::Magick->new; - $surface->ReadImage('surface-p17.jpg'); $surface->Rotate(90); $surface->Resize('600x825!'); $image->Composite(compose => 'over', image => $surface, x => 0, y => 0); - $image->Annotate(text => $card, font => 'Courier.ttf', y => -275, fill => 'black', pointsize => 70, gravity => 'Center'); my $text; - $image->Set(font => 'Courier', pointsize => 25); - foreach my $line (@{$cards->{Cards}->{$card}}){ + $image->Set(font => $mainfont, pointsize => 25); + foreach my $line (@{$cards->{Deck}->{Cards}->{$card}}){ $text = $text . wrap('', '', $line) . "\n"; } - $image->Annotate(text => $card, x => 50, y => 100, font => 'Courier', fill => 'black', pointsize => 35); - $image->Annotate(text => $text, x => 50, y => 600, font => 'Courier', fill => 'black', pointsize => 25); + $image->Annotate(text => $card, x => 50, y => 100, font => $mainfont, fill => 'black', pointsize => 60); + my $newlines = () = $text =~ /(\n)/g; + $image->Annotate(text => $text, x => 50, y => (750-(25*$newlines)), font => $mainfont, fill => 'black', pointsize => 25); $image->Write($card . '.png'); } diff --git a/shopping.yml b/shopping.yml index 486e4c2..7787292 100644 --- a/shopping.yml +++ b/shopping.yml @@ -1,168 +1,169 @@ -Cards: - Leg Boost: - - Grants +1d6 when jumping - - Cyber - Finger Blade: - - Adds +1d4 damage - - Cyber - Subcutaenous Mic: - - Allows speaking while sneaking - - Cyber - Cyberarm: - - Adds +1d8 damage - - Lifting tests are 1d10 - - Cyber - Light Pistol: - - 1d10 to hit - - 1d8 damage - - Gun - Heavy Pistol: - - 1d8 to hit - - 1d10 damage - - Gun - Rifle: - - Opponents get +1d4 in Melee - - 1d10 to hit - - 1d10 damage - - Gun - Sniper Rifle: - - Opponents get +1d10 to hit in Melee - - 1d12 to hit - - 1d12 damage - - Double damage when you have surprise - - Gun - Heavy Jacket: - - Subtract 1d6 from incoming damage - - Armour - Riot Armour: - - Subtracts 1d8 from incoming damage - - Adds 1d4 to opponent's melee attacks - - Armour - Adrenal Boost: - - Subtracts 1d4 from incoming melee attacks - - Cyber, Armour - Subcutaneous Plating: - - Subtacts 1d4 from incoming damage - - Cyber, Armour - Cyberdeck: - - 1d8 to all hacking rolls - - Computer - Candy Wrapper: - - 1d10 to stealth while hacking - - Program - Commlink: - - Computer - Common Handgun: - - Gun - Hammer: - - 1d10 damage while hacking - - Program - Ammo: - - Can only be used with one gun at a time - - If you roll all 1s (after specialties), you have run out of ammo. - - Ammo - Nice Suit: - - +1d4 to social rolls with people who care about dress - - Destroyed if you take 3 or more damage - - Armour - Nice Meal: - - Can be eaten in place of one paste - - Can be spent for its value in paste - - +1d4 to any social roll when you spend this (even if you are getting its value) - - Food - First Aid Kit: - - Allows bandaging rolls - Stim Pack: - - Heals 1d4 HP, which are removed after two hours - - Losing these HP can drop you below 0 - Medical Bench: - - Requires an hour of work - - Recovers 1d4 HP (specialities can apply to this roll) - Drug Injector: - - Allows drug injection without an action - - Cyber - Targetting Coprocessor: - - Steps up the die to hit for guns - - Cyber - Soy Processor: - - Flavours and shapes food to mimic real meals - Food Additives: - - Flavours soy - - 5 uses - Marijuana: - - Smoked or used in soy processor - - One use - - Use to ignore pain for a scene, or get +1d8 to social rolls with anyone you share this with - - Subtract 1d4 from anything that requires attention - - Drug - PCP: - - One use - - Snorted - - Gain +1d4 on attacks - - Incoming attacks subtract 1d4 - - Drug - Tobacco: - - One Use - - Smoked - - Use to add +1 to any test which requires concentration - - Drug - Heroine: - - One Use - - Injected - - Ignore pain, -4 from anything that requires concentration - - Drug - Injection Rounds: - - Loads a drug, and applies its effect as well as damage - - Ammo - Dark Clothing: - - 1d8 to Stealth checks - - Armour - Stealth Suit: - - 1d10 to Stealth checks - - Reactive camoflague - - Armour - Optical Camoflague: - - 1d12 to Stealth checks - - Armour - Goggles: - - 1d8 to visual notice rolls - Binoculours: - - 1d10 to distance notice rolls - Parabolic Mic: - - 1d10 to distance notice rolls - Keycard Copier: - - Allows copying a keycard (swipe or tap) with a sleight of hand roll - - Can store unlimited cards - Gas Mask: - - Ignore gas in an area - Rebreather: - - Ignore gas in an area - - Go without air for up to an hour - Sword: - - 1d8 damage - - Melee - - -Common Cards: - Heavy Chain: - - 1d8 damage - - Melee - Leathers: - - Subtracts one from melee damage - Cobbled Together First Aid Kit: - - Subtracts 1 from medical tests when using it - - Allows bandaging rolls - Tattoo: - - Adds 1d4 to social rolls with affiliated gangs - - Subtracts 1d4 from social rolls with unaffilated gangs - - Roll 1d8 intimidation against barrens rats affiliated with smaller gangs or no gang - - Cyber - Knife: - - 1d4 damage - - 1d10 to hit - - Melee - Moltov: - - One use - - 1d8 damage - - 2 damage until the person hit by it stops drops and rolls - - Thrown Weapon +Deck: + Background: White + Font: Courier + Cards: + Leg Boost: + - Grants +1d6 when jumping + - Cyber + Finger Blade: + - Adds +1d4 damage + - Cyber + Subcutaenous Mic: + - Allows speaking while sneaking + - Cyber + Cyberarm: + - Adds +1d8 damage + - Lifting tests are 1d10 + - Cyber + Light Pistol: + - 1d10 to hit + - 1d8 damage + - Gun + Heavy Pistol: + - 1d8 to hit + - 1d10 damage + - Gun + Rifle: + - Opponents get +1d4 in Melee + - 1d10 to hit + - 1d10 damage + - Gun + Sniper Rifle: + - Opponents get +1d10 to hit in Melee + - 1d12 to hit + - 1d12 damage + - Double damage when you have surprise + - Gun + Heavy Jacket: + - Subtract 1d6 from incoming damage + - Armour + Riot Armour: + - Subtracts 1d8 from incoming damage + - Adds 1d4 to opponent's melee attacks + - Armour + Adrenal Boost: + - Subtracts 1d4 from incoming melee attacks + - Cyber, Armour + Subcutaneous Plating: + - Subtacts 1d4 from incoming damage + - Cyber, Armour + Cyberdeck: + - 1d8 to all hacking rolls + - Computer + Candy Wrapper: + - 1d10 to stealth while hacking + - Program + Commlink: + - Computer + Common Handgun: + - Gun + Hammer: + - 1d10 damage while hacking + - Program + Ammo: + - Can only be used with one gun at a time + - If you roll all 1s (after specialties), you have run out of ammo. + - Ammo + Nice Suit: + - +1d4 to social rolls with people who care about dress + - Destroyed if you take 3 or more damage + - Armour + Nice Meal: + - Can be eaten in place of one paste + - Can be spent for its value in paste + - +1d4 to any social roll when you spend this (even if you are getting its value) + - Food + First Aid Kit: + - Allows bandaging rolls + Stim Pack: + - Heals 1d4 HP, which are removed after two hours + - Losing these HP can drop you below 0 + Medical Bench: + - Requires an hour of work + - Recovers 1d4 HP (specialities can apply to this roll) + Drug Injector: + - Allows drug injection without an action + - Cyber + Targetting Coprocessor: + - Steps up the die to hit for guns + - Cyber + Soy Processor: + - Flavours and shapes food to mimic real meals + Food Additives: + - Flavours soy + - 5 uses + Marijuana: + - Smoked or used in soy processor + - One use + - Use to ignore pain for a scene, or get +1d8 to social rolls with anyone you share this with + - Subtract 1d4 from anything that requires attention + - Drug + PCP: + - One use + - Snorted + - Gain +1d4 on attacks + - Incoming attacks subtract 1d4 + - Drug + Tobacco: + - One Use + - Smoked + - Use to add +1 to any test which requires concentration + - Drug + Heroine: + - One Use + - Injected + - Ignore pain, -4 from anything that requires concentration + - Drug + Injection Rounds: + - Loads a drug, and applies its effect as well as damage + - Ammo + Dark Clothing: + - 1d8 to Stealth checks + - Armour + Stealth Suit: + - 1d10 to Stealth checks + - Reactive camoflague + - Armour + Optical Camoflague: + - 1d12 to Stealth checks + - Armour + Goggles: + - 1d8 to visual notice rolls + Binoculours: + - 1d10 to distance notice rolls + Parabolic Mic: + - 1d10 to distance notice rolls + Keycard Copier: + - Allows copying a keycard (swipe or tap) with a sleight of hand roll + - Can store unlimited cards + Gas Mask: + - Ignore gas in an area + Rebreather: + - Ignore gas in an area + - Go without air for up to an hour + Sword: + - 1d8 damage + - Melee + Common Cards: + Heavy Chain: + - 1d8 damage + - Melee + Leathers: + - Subtracts one from melee damage + Cobbled Together First Aid Kit: + - Subtracts 1 from medical tests when using it + - Allows bandaging rolls + Tattoo: + - Adds 1d4 to social rolls with affiliated gangs + - Subtracts 1d4 from social rolls with unaffilated gangs + - Roll 1d8 intimidation against barrens rats affiliated with smaller gangs or no gang + - Cyber + Knife: + - 1d4 damage + - 1d10 to hit + - Melee + Moltov: + - One use + - 1d8 damage + - 2 damage until the person hit by it stops drops and rolls + - Thrown Weapon