A Prototype Fishing Code!!! ><>

This is just a first try, so anybody is welcome to improve on it. But for those who always wanted to fish, I figured out a simple way! Yay!

Pond is a room. A fishing pole is a kind of thing. The player carries a fishing pole. Understand “Cast [fishing pole]” as fishing. Fishing is an action applying to one visible thing.

Fish are a kind of thing. Fish are edible. A salmon is a fish. Salmon can be found in the pond. Fish can be found everywhere.

Instead of fishing:
if a random chance of 1 in 5 succeeds:
move the salmon to the player;
say “You have caught the salmon! Sadly, you can only carry one at a time.”;
otherwise:
say “You missed the fish!”

You may want to consider making the fish quantifiable. There are several options for doing this. Here is what I did in Gotomomi:


A species is a kind of value. The plural of species is species. The species are Bristlemouth, Rattail, Barreleye, and Ridgehead.

A fish is a kind of thing. The plural of fish is fish. A fish has a species. The species of a fish is usually Bristlemouth. The description of a fish is usually "A [species], [one of]disfigured[or]crippled[or]killed[or]visibly affected[at random] by [one of]cadmium[or]mercury[or]radioactive iodine[or]grey water[or]industrial sewage[at random] contamination."
Understand the species property as describing a fish.

Before listing contents: group fish together.

Rule for printing the name of a fish:
	say "[species]".

Rule for printing the plural name of a fish while grouping together:
	say "[species]s".

Rule for printing the name of a fish while grouping together:
	say "a [species]".

Rule for printing a number of fish (called the target): 
	if the listing group size is less than 4:
		say "a few "; 
	else if the listing group size is less than 6:
		say "some ";
	else if the listing group size is less than 8:
		say "a bunch of ";
	else:
		 say "many ";
	carry out the printing the plural name activity with the target.

Ooooh, thank you! That’s some neat stuff. Yeah, like I said, this was just a code in early development. Also, forgot to put the code into code mode here in the forum. It took me forever to come up with just that. Yours sounds a lot cooler. :slight_smile: Now If I could only come up with something for cooking. Eeesh. Tried something, but didn’t work out. That right there is more complicated.

If you’re unsure of how you want it to behave, try writing out a mock transcript that shows what a player would see. That tends to make everything a lot more concrete.

I tried going over the fishing code while adding part of mine into it in order to fish, but it’s not working. Any advice you’d like to give? Also, I’m thinking about having the player only use the pole around 20 times before it breaks.

Off the top of my head (I don’t have a running Inform IDE): How about you change your code to the following and add my previous code:

[code]
Pond is a room. A fishing pole is a kind of thing. The player carries a fishing pole. Understand “Cast [fishing pole]” as fishing. Fishing is an action applying to one visible thing.
In the Pond are 10 fish.
When play begins:
repeat with X running through fish in the Pond:
if a random chance of 2 in 3 succeeds:
now the species of X is a random species;

Instead of fishing:
if a random chance of 1 in 5 succeeds:
Let X be a random fish in the location of the player:
unless X is nothing:
move X to the player:
say “You have caught a [species of X].”:
otherwise:
say “You missed the fish!”;[/code]

Thank you. I’ll try that. I can figure out the broken rod code myself. This will help. :slight_smile: