Header: Generates a rural encounter per Traveller rules
MaxReps: 1
Set: skillPoints ={1d6}
Set: typeDM =0
Set: sizeDM =0
Set: statSTR =0
Set: statDEX =0
Set: statEND =0
Set: statINS =0
Set: statPAC =0
Set: meleeSKI =0
Set: bonusDamage =0
Set: weaponDM =0
Set: armorDM =0
Set: crWeapons =\z
Set: tempVar =0
Define: skillList =Athletics([|Coordination|Endurance]) 0, Recon 0, Survival 0
Prompt: Terrain {Clear|Plain|Desert|Hills|Mountain|Forest|Woods|Jungle|Rainforest|Rough|Swamp|Beach|Riverbank|Shallows|Open|Deep} Clear
Prompt: Creature Type {Scavenger|Omnivore|Herbivore|Carnivore} Scavenger
Table: makeAnimal
[Habitat >> Proper]: {$prompt1} [#{$prompt1} moveTable] &
Type: &
{tempVar==2d6+{$typeDM}} &
[when]{tempVar} < 1[do][#{$prompt2} creatureType with 1][else][#{$prompt2} creatureType with {tempVar}][end] &
Size: {sizeDM==sizeDM+2d6} [when]{sizeDM} < 1[do]{sizeDM=1}[else]{sizeDM}[end] &
Weight: [#{sizeDM} weightTable]\n&
Strength: {statSTR==statSTR+[#{sizeDM} strTable]} [when]{statSTR} < 1[do]{statSTR=1}[else]{statSTR}[end] &
Dexterity: {statDEX==statDEX+[#{sizeDM} dexTable]} [when]{statDEX} < 1[do]{statDEX=1}[else]{statDEX}[end] &
Endurance: {statEND==statEND+[#{sizeDM} enduTable]} [when]{statEND} < 1[do]{statEND=1}[else]{statEND}[end] &
Intelligence: [|0|1] &
Instinct: {statINS==statINS+2d6} [when]{statINS} < 1[do]{statINS=1}[else]{statINS}[end] &
Pack: {statPAC==statPAC+2d6} [when]{statPAC} < 0[do]{statPAC=0}[else]{statPAC}[end]\n&
Weapons: &
[when]{prompt2} = Omnivore[do]{weaponDM==4}{armorDM==4}[end] &
[when]{prompt2} = Carnivore[do]{weaponDM==8}{armorDM==8}[end] &
[when]{prompt2} = Herbivore[do]{weaponDM==-6}{armorDM==-6}[end] &
[when]{prompt2} = Scavenger[do]{crWeapons=='Teeth and '}[end] &
{weaponDM==weaponDM+2d6} [when]{weaponDM} < 1[do]{weaponDM==1}[end] &
[#weaponDM weaponTable] {crWeapons} [when not]{crWeapons} = None[do]([#statSTR damTable])[end] &
Armor: &
{armorDM==armorDM+2d6} [when]{armorDM} < 1[do]{armorDM==1}[end] &
[#armorDM armorTable] &
Number encountered: [#statPAC packTable]\n&
Skills: {skillList}, Melee({crWeapons}) {meleeSKI}&
Table: moveTable
Type: dictionary
Clear: [@clearTable]
Plain: [@plainTable]
Desert: [@desertTable]
Hills: [@hillsTable]
Mountain: [@mountainTable]
Forest: [@forestTable]
Woods: [@woodsTable]
Jungle: [@jungleTable]
Rainforest: [@rainforestTable]
Rough: [@roughTable]
Swamp: [@swampTable]
Beach: [@beachTable]
Riverbank: [@riverbankTable]
Shallows: [@shallowsTable]
Open: [@openTable]
Deep: [@deepTable]
Table: clearTable
Type: Lookup
Roll: 1d6
1-4: Walking {typeDM==3}
5: Walking {sizeDM==2}{typeDM==3}
6: Flying {sizeDM==-6}{typeDM==3}
Table: plainTable
Type: Lookup
Roll: 1d6
1-3: Walking {typeDM==4}
4: Walking {sizeDM==2}{typeDM==4}
5: Walking {sizeDM==4}{typeDM==4}
6: Flying {sizeDM==-6}{typeDM==4}
Table: desertTable
Type: Lookup
Roll: 1d6
1-4: Walking {typeDM==3}
5: Flying {sizeDM==-4}{typeDM==3}
6: Flying {sizeDM==-6}{typeDM==3}
Table: hillsTable
Type: Lookup
Roll: 1d6
1-3: Walking
4: Walking {sizeDM==2}
5: Flying {sizeDM==-4}
6: Flying {sizeDM==-6}
Table: mountainTable
Type: Lookup
Roll: 1d6
1-3: Walking
4: Flying {sizeDM==-2}
5: Flying {sizeDM==-4}
6: Flying {sizeDM==-6}
Table: forestTable
Type: Lookup
Roll: 1d6
1-4: Walking {sizeDM==-4}{typeDM==-4}
5: Flying {sizeDM==-8}{typeDM==-4}
6: Flying {sizeDM==-10}{typeDM==-4}
Table: woodsTable
Type: Lookup
Roll: 1d6
1-5: Walking {sizeDM==-1}{typeDM==-2}
6: Flying {sizeDM==-7}{typeDM==-2}
Table: jungleTable
Type: Lookup
Roll: 1d6
1-4: Walking {sizeDM==-3}{typeDM==-4}
5: Walking {sizeDM==-1}{typeDM==-4}
6: Flying {sizeDM==-9}{typeDM==-4}
Table: rainforestTable
Type: Lookup
Roll: 1d6
1-3: Walking {sizeDM==-2}{typeDM==4}
4: Walking {typeDM==-2}
5: Walking {sizeDM==2}{typeDM==-2}
6: Flying {sizeDM==-8}{typeDM==-2}
Table: roughTable
Type: Lookup
Roll: 1d6
1-3: Walking {typeDM==-3}
4: Walking {sizeDM==-1}{typeDM==-3}
5: Flying {sizeDM==-7}{typeDM==-3}
6: Flying {sizeDM==-9}{typeDM==-3}
Table: swampTable
Type: Lookup
Roll: 1d6
1: Swimming {sizeDM==-2}{typeDM==-2}
2: Amphibious {sizeDM==6}{typeDM==-2}
3-4: Walking {sizeDM==4}{typeDM==-2}
5: Flying {typeDM==-2}
6: Flying {sizeDM==-2}{typeDM==-2}
Table: beachTable
Type: Lookup
Roll: 1d6
1: Swimming {sizeDM==3}{typeDM==3}
2: Amphibious {sizeDM==4}{typeDM==3}
3-4: Walking {sizeDM==2}{typeDM==3}
5: Flying {sizeDM==-2}{typeDM==3}
6: Flying {sizeDM==-4}{typeDM==3}
Table: riverbankTable
Type: Lookup
Roll: 1d6
1: Swimming {sizeDM==-3}{typeDM==1}
2: Amphibious {sizeDM==1}{typeDM==1}
3-5: Walking {sizeDM==1}{typeDM==1}
6: Flying {sizeDM==-5}{typeDM==1}
Table: shallowsTable
Type: Lookup
Roll: 1d6
1: Swimming {sizeDM==5}{typeDM==4}
2: Swimming {sizeDM==3}{typeDM==4}
3-4: Swimming {sizeDM==1}{typeDM==4}
5: Flying {sizeDM==-3}{typeDM==4}
6: Flying {sizeDM==-5}{typeDM==4}
Table: openTable
Type: Lookup
Roll: 1d6
1: Swimming {sizeDM==2}{typeDM==4}
2: Swimming {typeDM==4}
3: Swimming {sizeDM==-2}{typeDM==4}
4: Swimming {SizeDM==-4}{typeDM==4}
5: Flying {sizeDM==-8}{typeDM==4}
6: Flying {sizeDM==-10}{typeDM==4}
Table: deepTable
Type: Lookup
Roll: 1d6
1: Swimming {sizeDM==10}{typeDM==4}
2: Swimming {sizeDM==8}{typeDM==4}
3: Swimming {sizeDM==6}{typeDM==4}
4: Swimming {SizeDM==4}{typeDM==4}
5: Flying {sizeDM==2}{typeDM==4}
6: Flying {typeDM==4}
Table: creatureType
Type: Dictionary
Scavenger: [#{$1} scavengerTable]
Omnivore: [#{$1} omnivoreTable]
Herbivore: [#{$1} herbivoreTable]
Carnivore: [#{$1} carnivoreTable]
Table: scavengerTable
Type: Lookup
Default: Intimidator {skillList=='Athletics([|Coordination|Endurance]) 0, Persuade 1, Recon 0, Survival 0'}
1: Carrion-Eater {skillList=='Athletics([|Coordination|Endurance]) 0, Recon 1, Survival 0'}{statINS==2}
2: Reducer {statPAC==4}
3: Hijacker {statSTR==2}{statPAC==2}
4: Carrion-Eater {skillList=='Athletics([|Coordination|Endurance]) 0, Recon 1, Survival 0'}{statINS==2}
6: Reducer {statPAC==4}
7: Carrion-Eater {skillList=='Athletics([|Coordination|Endurance]) 0, Recon 1, Survival 0'}{statINS==2}
8: Reducer {statPAC==4}
9: Hijacker {statSTR==2}{statPAC==2}
11: Reducer {statPAC==4}
12: Hijacker {statSTR==2}{statPAC==2}
Table: omnivoreTable
Type: Lookup
Default: Gatherer {skillList=='Athletics([|Coordination|Endurance]) 0, Recon 0, Stealth 1, Survival 0'}{statINS==2}
2: Eater {statEND==4}{statPAC==2}
4: Eater {statEND==4}{statPAC==2}
6-8: Hunter {skillList=='Athletics([|Coordination|Endurance]) 0, Recon 0, Survival 1'}{statINS==2}
10: Eater {statEND==4}{statPAC==2}
11: Hunter {skillList=='Athletics([|Coordination|Endurance]) 0, Recon 0, Survival 1'}{statINS==2}
Table: herbivoreTable
Type: Lookup
Default: Grazer {statINS==2}{statPAC==4}
1-2: Filter {statEND==4}
3-6: Intermittent {statPAC=4}
Table: carnivoreTable
Type: Lookup
Default: Chaser {skillList=='Athletics([|Coordination|Endurance]) 1, Recon 0, Survival 0'}{statDEX==4}{statINS==2}{statPAC==2}
1: Pouncer {skillList=='Athletics([|Coordination|Endurance]) 1, Recon 1, Stealth 1, Survival 0'}{statDEX==4}{statINS==4}
2: Siren {skillList=='Athletics([|Coordination|Endurance]) 0, Deception 0, Recon 0, Survival 0'}{statPAC==-4}
3: Pouncer {skillList=='Athletics([|Coordination|Endurance]) 1, Recon 1, Stealth 1, Survival 0'}{statDEX==4}{statINS==4}
4: Killer {meleeSKI==1} [when]{1d2} = 1[do]{statSTR==4}[else]{statDEX==4}[end] {statINS==4}{statPAC==-2}
5: Trapper {statPAC==-2}
6: Pouncer {skillList=='Athletics([|Coordination|Endurance]) 1, Recon 1, Stealth 1, Survival 0'}{statDEX==4}{statINS==4}
10: Killer {meleeSKI==1} [when]{1d2} = 1[do]{statSTR==4}[else]{statDEX==4}[end] {statINS==4}{statPAC==-2}
12: Siren {skillList=='Athletics([|Coordination|Endurance]) 0, Deception 0, Recon 0, Survival 0'}{statPAC==-4}
Table: weightTable
Type: Lookup
Default: 5000kg
1: 1kg
2: 3kg
3: 6kg
4: 12kg
5: 25kg
6: 50kg
7: 100kg
8: 200kg
9: 400kg
10: 800kg
11: 1600kg
12: 3200kg
Table: strTable
Type: Lookup
Default: {7d6+statSTR}
1: 1
2: 2
3: {1d6+statSTR}
4: {1d6+statSTR}
5: {2d6+statSTR}
6: {2d6+statSTR}
7: {3d6+statSTR}
8: {3d6+statSTR}
9: {4d6+statSTR}
10: {4d6+statSTR}
11: {5d6+statSTR}
12: {6d6+statSTR}
Table: dexTable
Type: Lookup
Default: {1d6+statDEX}
1: {1d6+statDEX}
2: {1d6+statDEX}
3: {2d6+statDEX}
4: {2d6+statDEX}
5: {3d6+statDEX}
6: {4d6+statDEX}
7: {3d6+statDEX}
8: {3d6+statDEX}
9: {2d6+statDEX}
10: {2d6+statDEX}
11: {2d6+statDEX}
12: {1d6+statDEX}
Table: enduTable
Type: Lookup
Default: {7d6+statEND}
1: 1
2: 2
3: {1d6+statEND}
4: {1d6+statEND}
5: {2d6+statEND}
6: {2d6+statEND}
7: {3d6+statEND}
8: {3d6+statEND}
9: {4d6+statEND}
10: {4d6+statEND}
11: {5d6+statEND}
12: {6d6+statEND}
Table: weaponTable
Type: Lookup
Default: {crWeapons==crWeapon+'Thrasher'} {bonusDamage==2}
1: [when not]{prompt2} = Scavenger[do]{crWeapons=='None'}[else]{crWeapons=='Teeth'}[end]
2: {crWeapons=='Teeth'}
3: {crWeapons==crWeapons+'Horns'}
4: {crWeapons==crWeapons+'Hooves'}
5: {crWeapons=='Hooves and Teeth'}
6: {crWeapons=='Teeth'}
7: {crWeapons==crWeapons+'Claws'} {bonusDamage==1}
8: {crWeapons==crWeapons+'Stinger'} {bonusDamage==1}
9: {crWeapons==crWeapons+'Thrasher'} {bonusDamage==1}
10: {crWeapons=='Claws and Teeth'} {bonusDamage==2}
11: {crWeapons==crWeapons+'Claws'} {bonusDamage==2}
12: {crWeapons=='Teeth'} {bonusDamage==2}
Table: armorTable
Type: Lookup
Default: 5
1-3: 0
4-5: 1
6-7: 2
8-9: 3
10-11: 4
Table: damTable
Type: Lookup
Default:{6+bonusDamage}d6
1-10:{1+bonusDamage}d6
11-20:{2+bonusDamage}d6
21-30:{3+bonusDamage}d6
31-40:{4+bonusDamage}d6
41-50:{5+bonusDamage}d6
Table: packTable
Type: Lookup
Default: 5d6
0: 1
1-2: 1d3
3-5: 1d6
6-8: 2d6
9-11: 3d6
12-14: 4d6