Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds fishing #3790

Merged
merged 10 commits into from
Apr 8, 2024
Merged

Adds fishing #3790

merged 10 commits into from
Apr 8, 2024

Conversation

MistakeNot4892
Copy link
Contributor

@MistakeNot4892 MistakeNot4892 commented Mar 12, 2024

Description of changes

  • Ports several fish icons from Polaris and adds subtypes to use them.
  • Adds craftable fishing rods and fishing line.
  • Adds infrastructure for fishing in submerged turfs.

Why and what will this PR improve

Fishing good.

TODO

  • Add some fish or other item rewards for fishing to exoplanets as an example for main code.
  • Add sound effects and visuals to fishing.

Authorship

Code is mine, icons are adapted from Polaris.

Changelog

🆑
add: Added fishing!
/:cl:

@MistakeNot4892 MistakeNot4892 added the work in progress This PR is under development and shouldn't be merged. label Mar 12, 2024
@MistakeNot4892 MistakeNot4892 changed the title Feature/fishes Adds fishing Mar 12, 2024
@MistakeNot4892 MistakeNot4892 added ready for review This PR is ready for review and merge. and removed work in progress This PR is under development and shouldn't be merged. labels Mar 17, 2024
@MistakeNot4892
Copy link
Contributor Author

Calling this ready to go. It'll need some playtesting and refinement, and I'd like to make the actual minigame more interesting, but it'll do for the time being.

@MistakeNot4892 MistakeNot4892 force-pushed the feature/fishes branch 4 times, most recently from 9b8e6aa to 1ff3644 Compare March 17, 2024 08:51
@MistakeNot4892
Copy link
Contributor Author

If I keep messing with this I'm never going to stop.


. = new loot_type(origin)

// This is pretty rancid but we're limited in our ability to actually refine a
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this block out for review as in general I don't like it, but I can't think of anything less bad.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could potentially make it use /datum/atom_creator like closets?

Copy link
Contributor Author

@MistakeNot4892 MistakeNot4892 Mar 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my other comment I'm not sure I see how that would be an improvement.
EDIT: I think I get what you mean but I don't think it's a suitable solution.

if(!SSatoms.initialized || !length(spawned_atoms))
return INITIALIZE_HINT_QDEL

// Hang around for a tick in case someone wants our spawn results.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about re: bad.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this! /datum/atom_creator/weighted() is better for things where code might need to access the results, in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how you can access results from datum/atom_creator/weighted, it just seems to dump stuff into the loc the same as a random spawner does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see what you mean, but it's not really what I want. It would lock the fishing results to a single type unless I regenerated the list every time I wanted to get a result from it.

@MistakeNot4892 MistakeNot4892 force-pushed the feature/fishes branch 5 times, most recently from 995a742 to 402fc83 Compare March 19, 2024 06:25

. = new loot_type(origin)

// This is pretty rancid but we're limited in our ability to actually refine a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could potentially make it use /datum/atom_creator like closets?

if(!SSatoms.initialized || !length(spawned_atoms))
return INITIALIZE_HINT_QDEL

// Hang around for a tick in case someone wants our spawn results.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this! /datum/atom_creator/weighted() is better for things where code might need to access the results, in my opinion.

@MistakeNot4892
Copy link
Contributor Author

I just rolled back the random item handling, it can get sorted out in another PR.

out-of-phaze
out-of-phaze previously approved these changes Apr 2, 2024
@PlayerDeer
Copy link
Contributor

Does this feature the stardew valley style fishing minigame? If not and you need icons for that later feel free to hit me up MistakeNot :)

@MistakeNot4892
Copy link
Contributor Author

No minigame currently, but it would be nice...

var/is_fishing = FALSE
var/obj/item/bait
var/obj/item/fishing_line/line
var/line_integrity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable is unused

if(!target.submerged())
to_chat(user, SPAN_WARNING("The water is not deep enough to fish there."))
return FISHING_FAILED_WARNING
return FISHING_POSSIBLE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't check if something is blocking our path, and doing so is currently nontrivial. i have a commit that fixes this pretty well if you'd like, ask about it on Discord and i'll link it to you assuming i've pushed it by then

if(QDELETED(line))
to_chat(user, SPAN_DANGER("Your fishing line snaps!"))
line = null
update_icon()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update_icon()
update_icon()
result.throw_at(get_turf(user), get_dist(src, result), 0.5, user, FALSE)

This way, you actually 'reel' the catch in and don't have to wade out into the water to collect your fish.


// TODO: more interesting fishing minigame.
/obj/item/fishing_rod/proc/do_fishing_minigame(mob/user, turf/target)
user.visible_message(SPAN_NOTICE("\The [user] casts \the [src] into \the [target]."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
user.visible_message(SPAN_NOTICE("\The [user] casts \the [src] into \the [target]."))
user.visible_message(SPAN_NOTICE("\The [user] casts \the [src] into \the [target.get_fluid_name()]."))

ideally you cast it into the water (lava, blood, etc), not into the mud

@MistakeNot4892
Copy link
Contributor Author

Grabbed your commits and put some time into the minigame. Need to add some sounds and visual cues but the logic seems to be working.

@MistakeNot4892 MistakeNot4892 added work in progress This PR is under development and shouldn't be merged. and removed ready for review This PR is ready for review and merge. labels Apr 4, 2024
@MistakeNot4892 MistakeNot4892 added ready for review This PR is ready for review and merge. and removed work in progress This PR is under development and shouldn't be merged. labels Apr 4, 2024
Copy link
Member

@out-of-phaze out-of-phaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed some cases of [target], but the minigame looks fine!


if(is_fishing)
if(isnull(is_fishing.hooked))
to_chat(user, SPAN_NOTICE("You reel your line back in and abandon fishing in \the [is_fishing.target]."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to_chat(user, SPAN_NOTICE("You reel your line back in and abandon fishing in \the [is_fishing.target]."))
to_chat(user, SPAN_NOTICE("You reel your line back in and abandon fishing in \the [is_fishing.target.get_fluid_name()]."))

Missed one, sorry.

return FISHING_FAILED_WARNING
var/list/hit = check_trajectory(target, src, pass_flags=PASS_FLAG_TABLE, lifespan = get_dist(target, src))
if(length(hit))
to_chat(user, SPAN_WARNING("Your fishing line is blocked from reaching \the [target] by \the [hit[1]]."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to_chat(user, SPAN_WARNING("Your fishing line is blocked from reaching \the [target] by \the [hit[1]]."))
to_chat(user, SPAN_WARNING("Your fishing line is blocked from reaching \the [target.get_fluid_name()] by \the [hit[1]]."))

@MistakeNot4892 MistakeNot4892 force-pushed the feature/fishes branch 5 times, most recently from ca2ab5c to 012509c Compare April 6, 2024 08:28
out-of-phaze
out-of-phaze previously approved these changes Apr 6, 2024
@out-of-phaze out-of-phaze merged commit 040de0a into NebulaSS13:dev Apr 8, 2024
12 checks passed
@MistakeNot4892 MistakeNot4892 deleted the feature/fishes branch May 23, 2024 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is ready for review and merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants