Refactors Fish

Cleans up fish code to not be (as) reliant on some ugly associated lists
and strings.

Tweaks fish breeding:
- Breeding now only requires an additional 0.2 food level, instead of
the previous 2.0 food level
- Fish may refuse to cross-breed with other fish, resulting in dud eggs
unless another member of their species is present. Currently, shrimp and
eels refuse to breed with other types of fish.
- When breeding, fish will attempt to pick a partner and base their
success off the pair
- If the first parent will not cross-breed, they will successfully lay
an egg of their type if at least one other fish of their species is
present, otherwise they will always lay a dud
- If the first parent will cross-breed but the second parent will not,
the egg will always be a dud
- If both fish are the same type of cross-breeders, there is a 90%
chance of them successfully laying an egg of their type, otherwise the
result is a dud egg
- If the fish are different types of cross-breeders, there is a 30%
chance of them laying a dud egg, otherwise they will lay an egg of the
same type as one of the parents

Code refactor includes making adding more fish with their own special
interactions with the tank (like the catfish and feeder fish
interactions) cleaner and hopefully easier.
- New "fish" are on the way, hopefully coming soon once sprites are
available.
- Fish mutating will be added at such time to accomodate the obtaining
of new and exciting sea-life.

🆑
tweak: Fish breeding has been tweaked to support fish refusing to
cross-breed and improved egg chances with same-species parents.
/🆑
This commit is contained in:
FalseIncarnate
2017-03-06 04:16:09 -05:00
parent 110bdad1d3
commit b5cfca5ea8
5 changed files with 166 additions and 103 deletions
+13 -24
View File
@@ -5,81 +5,70 @@
icon = 'icons/obj/fish_items.dmi'
icon_state = "eggs"
w_class = 2
var/fish_type = null //Holds the name of the fish that the egg is for
var/datum/fish/fish_type = null //Holds the datum of the fish that the egg is for, null means dud eggs
/obj/item/fish_eggs/New()
..()
var/global/list/fish_eggs_list = list("dud" = /obj/item/fish_eggs,
"goldfish" = /obj/item/fish_eggs/goldfish,
"clownfish" = /obj/item/fish_eggs/clownfish,
"shark" = /obj/item/fish_eggs/shark,
"baby space carp" = /obj/item/fish_eggs/babycarp,
"catfish" = /obj/item/fish_eggs/catfish,
"feederfish" = /obj/item/fish_eggs/feederfish,
"salmon" = /obj/item/fish_eggs/salmon,
"shrimp" = /obj/item/fish_eggs/shrimp,
"electric eel" = /obj/item/fish_eggs/electric_eel,
"glofish" = /obj/item/fish_eggs/glofish,
)
if(fish_type)
fish_type = new fish_type
/obj/item/fish_eggs/goldfish
name = "goldfish eggs"
desc = "Goldfish eggs, surprisingly, don't contain actual gold."
icon_state = "gold_eggs"
fish_type = "goldfish"
fish_type = /datum/fish/goldfish
/obj/item/fish_eggs/clownfish
name = "clownfish eggs"
desc = "Even as eggs, they are funnier than the clown. HONK!"
icon_state = "clown_eggs"
fish_type = "clownfish"
fish_type = /datum/fish/clownfish
/obj/item/fish_eggs/shark
name = "shark eggs"
desc = "We're gonna need a- Oh wait, they're still eggs."
icon_state = "shark_eggs"
fish_type = "shark"
fish_type = /datum/fish/shark
/obj/item/fish_eggs/babycarp
name = "baby space carp eggs"
desc = "Eggs from the substantially smaller form of the intergalactic terror."
icon_state = "babycarp_eggs"
fish_type = "baby space carp"
fish_type = /datum/fish/babycarp
/obj/item/fish_eggs/catfish
name = "catfish eggs"
desc = "A bottom-feeding species noted for their similarity to cats and Tajaran."
icon_state = "catfish_eggs"
fish_type = "catfish"
fish_type = /datum/fish/catfish
/obj/item/fish_eggs/feederfish
name = "feeder fish eggs"
desc = "These generic fish are commonly found being eaten by larger fish."
icon_state = "feederfish_eggs"
fish_type = "feederfish"
fish_type = /datum/fish/feederfish
/obj/item/fish_eggs/salmon
name = "salmon eggs"
desc = "A collection of salmon eggs."
icon_state = "salmon_eggs"
fish_type = "salmon"
fish_type = /datum/fish/salmon
/obj/item/fish_eggs/shrimp
name = "shrimp eggs"
desc = "Eggs for shrimp. You figured they'd be smaller though..."
icon_state = "shrimp_eggs"
fish_type = "shrimp"
fish_type = /datum/fish/shrimp
/obj/item/fish_eggs/electric_eel
name = "electric eel eggs"
desc = "A pile of eggs for a slimy, shocking, sea-serpent."
icon_state = "electric_eel_eggs"
fish_type = "electric eel"
fish_type = /datum/fish/electric_eel
/obj/item/fish_eggs/glofish
name = "glofish eggs"
desc = "A cluster of bright neon eggs belonging to a bio-luminescent species of fish."
icon_state = "glofish_eggs"
fish_type = "glofish"
fish_type = /datum/fish/glofish