/
fish.dm
198 lines (166 loc) · 7.49 KB
/
fish.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Fish path used for autogenerated fish
/obj/item/fish
name = "generic looking aquarium fish"
desc = "very bland"
w_class = WEIGHT_CLASS_TINY
/// Automatically generates object of given base path from the behaviour type in loc
/proc/generate_fish(loc,behaviour_type,base_path=/obj/item/fish)
var/datum/aquarium_behaviour/behaviour = behaviour_type
var/obj/item/fish = new base_path(loc)
fish.name = initial(behaviour.name)
fish.icon = initial(behaviour.icon)
fish.icon_state = initial(behaviour.icon_state)
fish.desc = initial(behaviour.desc)
if(initial(behaviour.color))
fish.add_atom_colour(initial(behaviour.color), FIXED_COLOUR_PRIORITY)
if(ispath(behaviour_type,/datum/aquarium_behaviour/fish))
var/datum/aquarium_behaviour/fish/fish_behaviour = behaviour_type
var/fillet_type = initial(fish_behaviour.fillet_type)
if(fillet_type)
fish.AddElement(/datum/element/processable, TOOL_KNIFE, fillet_type, 1, 5)
fish.AddElement(/datum/element/deferred_aquarium_content, behaviour_type)
return fish
/// Returns random fish, using random_case_rarity probabilities.
/proc/random_fish_type(case_fish_only=TRUE, required_fluid)
var/static/probability_table
var/argkey = "fish_[required_fluid]_[case_fish_only]" //If this expands more extract bespoke element arg generation to some common helper.
if(!probability_table || !probability_table[argkey])
if(!probability_table)
probability_table = list()
var/chance_table = list()
for(var/_fish_behavior in subtypesof(/datum/aquarium_behaviour/fish))
var/datum/aquarium_behaviour/fish/fish_behavior = _fish_behavior
if(required_fluid && initial(fish_behavior.required_fluid_type) != required_fluid)
continue
if(initial(fish_behavior.availible_in_random_cases) || !case_fish_only)
chance_table[fish_behavior] = initial(fish_behavior.random_case_rarity)
probability_table[argkey] = chance_table
return pickweight(probability_table[argkey])
// Actual fish definitions below - there's no specific paths, they are autogenerated from behaviours
// Freshwater fish
/datum/aquarium_behaviour/fish/goldfish
name = "goldfish"
desc = "Despite common belief, goldfish do not have three-second memories. They can actually remember things that happened up to three months ago."
icon_state = "goldfish"
sprite_width = 8
sprite_height = 8
stable_population = 3
/datum/aquarium_behaviour/fish/angelfish
name = "angelfish"
desc = "Young Angelfish often live in groups, while adults prefer solitary life. They become territorial and aggressive toward other fish when they reach adulthood."
icon_state = "angelfish"
dedicated_in_aquarium_icon_state = "bigfish"
sprite_height = 7
source_height = 7
stable_population = 3
/datum/aquarium_behaviour/fish/guppy
name = "guppy"
desc = "Guppy is also known as rainbow fish because of the brightly colored body and fins."
icon_state = "guppy"
dedicated_in_aquarium_icon_state = "fish_greyscale"
aquarium_vc_color = "#91AE64"
sprite_width = 8
sprite_height = 5
stable_population = 6
/datum/aquarium_behaviour/fish/plasmatetra
name = "plasma tetra"
desc = "Due to their small size, tetras are prey to many predators in their watery world, including eels, crustaceans, and invertebrates."
icon_state = "plastetra"
dedicated_in_aquarium_icon_state = "fish_greyscale"
aquarium_vc_color = "#D30EB0"
stable_population = 3
/datum/aquarium_behaviour/fish/catfish
name = "cory catfish"
desc = "A catfish has about 100,000 taste buds, and their bodies are covered with them to help detect chemicals present in the water and also to respond to touch."
icon_state = "catfish"
dedicated_in_aquarium_icon_state = "fish_greyscale"
aquarium_vc_color = "#907420"
stable_population = 3
/datum/aquarium_behaviour/fish/spacecarp
name = "space carp"
desc = "This space predator fish is known to cause yearly damage to space stations during their migrations."
icon_state = "carp"
sprite_width = 8
sprite_height = 8
availible_in_random_cases = FALSE
// Saltwater fish below
/datum/aquarium_behaviour/fish/clownfish
name = "clownfish"
desc = "Clownfish catch prey by swimming onto the reef, attracting larger fish, and luring them back to the anemone. The anemone will sting and eat the larger fish, leaving the remains for the clownfish."
icon_state = "clownfish"
dedicated_in_aquarium_icon_state = "clownfish_small"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
sprite_width = 8
sprite_height = 5
stable_population = 4
/datum/aquarium_behaviour/fish/cardinal
name = "cardinalfish"
desc = "Cardinalfish are often found near sea urchins, where the fish hide when threatened."
icon_state = "cardinalfish"
dedicated_in_aquarium_icon_state = "fish_greyscale"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
stable_population = 4
/datum/aquarium_behaviour/fish/greenchromis
name = "green chromis"
desc = "The Chromis can vary in color from blue to green depending on the lighting and distance from the lights."
icon_state = "greenchromis"
dedicated_in_aquarium_icon_state = "fish_greyscale"
aquarium_vc_color = "#00ff00"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
stable_population = 5
/datum/aquarium_behaviour/fish/firefish
name = "firefish goby"
desc = "To communicate in the wild, the firefish uses its dorsal fin to alert others of potential danger."
icon_state = "firefish"
sprite_width = 6
sprite_height = 5
required_fluid_type = AQUARIUM_FLUID_SALTWATER
stable_population = 3
/datum/aquarium_behaviour/fish/pufferfish
name = "pufferfish"
desc = "One Pufferfish contains enough toxins in its liver to kill 30 people."
icon_state = "pufferfish"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
sprite_width = 8
sprite_height = 8
stable_population = 3
/datum/aquarium_behaviour/fish/lanternfish
name = "lanternfish"
desc = "Typically found in areas below 6600 feet below the surface of the ocean, they live in complete darkness."
icon_state = "lanternfish"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
random_case_rarity = FISH_RARITY_VERY_RARE
source_width = 28
source_height = 21
sprite_width = 8
sprite_height = 8
stable_population = 3
//Tiziran Fish
/datum/aquarium_behaviour/fish/dwarf_moonfish
name = "dwarf moonfish"
desc = "Ordinarily in the wild, the Zagoskian moonfish is around the size of a tuna, however through selective breeding a smaller breed suitable for being kept as an aquarium pet has been created."
icon_state = "dwarf_moonfish"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
stable_population = 2
fillet_type = /obj/item/food/fishmeat/moonfish
/datum/aquarium_behaviour/fish/gunner_jellyfish
name = "gunner jellyfish"
desc = "So called due to their resemblance to an artillery shell, the gunner jellyfish is native to Tizira, where it is enjoyed as a delicacy. Produces a mild hallucinogen that is destroyed by cooking."
icon_state = "gunner_jellyfish"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
stable_population = 4
fillet_type = /obj/item/food/fishmeat/gunner_jellyfish
/datum/aquarium_behaviour/fish/needlefish
name = "needlefish"
desc = "A tiny, transparent fish which resides in large schools in the oceans of Tizira. A common food for other, larger fish."
icon_state = "needlefish"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
stable_population = 12
fillet_type = null
/datum/aquarium_behaviour/fish/armorfish
name = "armorfish"
desc = "A small shellfish native to Tizira's oceans, known for its exceptionally hard shell. Consumed similarly to prawns."
icon_state = "armorfish"
required_fluid_type = AQUARIUM_FLUID_SALTWATER
stable_population = 10
fillet_type = /obj/item/food/fishmeat/armorfish