Files
Bubberstation/code/modules/keybindings
SkyratBot 3f95ebbd5e [MIRROR] Fishing, Version 1 [MDB IGNORE] (#14370)
* Fishing, Version 1 (#67691)

Adds fishing and fishing minigame.
You use fishing rod to fish.
Equipping specific bait/hook/reels will affect your success chances.
You can fish out fish,items and other things.

Fishing Equipment
Fishing rods have three slots: Bait, Reel and Hook.
Any food can be used as bait but dedicated bait makes fishing easier.
You can buy hook and line sets
New bait types:

Worms : Buy can of them at cargo (alternative acquirement method pending)
Doughballs : Use knife on flat piece of dough to get five of them.
Fishing rod types:

Basic : Print these at the lathe, nothing fancy here.
Tech: Experimental tech. Provides infinite bait
Fishing rods can also hook and reel normal items.

Equipment screen and reeling video
Fishing spots
Keep in mind this PR is meant to add the basic systems and i intend to fill these with more fish in future PR's so wait with suggestions until then.

Lavaland lava (no fish here right now, just other stuff), requires reinforced line to fish in.
Maintenance moisture traps.
Beach away mission water.
Fishing portal available for purchase from cargo - This is stopgap until we fill more spots.
Difficulty depends on fishing spot, fish type, and the fish traits and rod setup combinations.
All fish types can have specific traits, most common ones being favourite and disliked bait types/categories.

Other
Fishing catalog now lists fishing related info
New admin debug verb, fishing calculator that show probabilities with different setups so it's easier to balance this.
Fish now have average weight and size. Make sure to boast if you catch a big one.
Adds tgui mouse passthrough
Screens
Sprites:

Fishing portal sprite by @ ArcaneMusic
Other sprites by @ Mey-Ha-Zah
Bad ones by me. (Could still use better fishing minigame backgrounds)
Sounds:

https://freesound.org/people/soundscalpel.com/sounds/110393/
https://freesound.org/people/soundslikewillem/sounds/343748/

* Fishing, Version 1

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
2022-06-17 00:30:40 +01:00
..

In-code keypress handling system

This whole system is heavily based off of forum_account's keyboard library. Thanks to forum_account for saving the day, the library can be found here!

.dmf macros have some very serious shortcomings. For example, they do not allow reusing parts of one macro in another, so giving cyborgs their own shortcuts to swap active module couldn't inherit the movement that all mobs should have anyways. The webclient only supports one macro, so having more than one was problematic. Additionally each keybind has to call an actual verb, which meant a lot of hidden verbs that just call one other proc. Also our existing macro was really bad and tied unrelated behavior into Northeast(), Southeast(), Northwest(), and Southwest().

The basic premise of this system is to not screw with .dmf macro setup at all and handle pressing those keys in the code instead. We have every key call client.keyDown() or client.keyUp() with the pressed key as an argument. Certain keys get processed directly by the client because they should be doable at any time, then we call keyDown() or keyUp() on the client's holder and the client's mob's focus. By default mob.focus is the mob itself, but you can set it to any datum to give control of a client's keypresses to another object. This would be a good way to handle a menu or driving a mech. You can also set it to null to disregard input from a certain user.

Movement is handled by having each client call client.keyLoop() every game tick. As above, this calls holder and focus.keyLoop(). atom/movable/keyLoop() handles movement Try to keep the calculations in this proc light. It runs every tick for every client after all!

You can also tell which keys are being held down now. Each client a list of keys pressed called keys_held. Each entry is a key as a text string associated with the world.time when it was pressed.

No client-set keybindings at this time, but it shouldn't be too hard if someone wants.

Notes about certain keys:

  • Tab has client-sided behavior but acts normally
  • T, O, and M move focus to the input when pressed. This fires the keyUp macro right away.
  • \ needs to be escaped in the dmf so any usage is \\

You cannot TICK_CHECK or check world.tick_usage inside of procs called by key down and up events. They happen outside of a byond tick and have no meaning there. Key looping works correctly since it's part of a subsystem, not direct input.