Files
Bubberstation/code/datums/components/face_decal.dm
T
Ghom 10c2b7364e The fishening v3: Fishing lures. (#86007)
## About The Pull Request
Over half of the line changes are merely from splitting the
fish_types.dm into several files since it was over 1k lines already.

One of the small issues with fishing right now is RNG. You want to get
some specific fish, and you go through all the micromanaging with hooks,
reels and baits only for the random number god to say "nope", and that's
only going to get worse the more fish are in the game.

However, I've a solution: (unconsumable/reusable) fishing lures, each of
which attracts different fish based on different conditions. The only
caveat is that they require to be spun at set intervals (usually 1 to 3
seconds, depending on the lure, with a second-long window). Worry not,
there're visual cues in the form of a green/red light hovering the
fishing float, so you won't get screwed up by the server slowing down or
whatever.
The whole box of lures (12 so far) can be from cargo for the fair price
of 450 credits.

I've also added 5 new fish: monkfish, plaice, pike, another punnier
variant of the pike, perch and squid. The latter is quite special
because of the ink production trait, which lets players use it to blind
others at a close range and when butchered, it yields an ink sac, which
can be processed into a can of squid ink (one less item exclusive to the
produce console), or thrown at people in a sort-of-similar fashion of
banana cream pies (except it's ink).

<details>
  <summary>Images</summary>

Fishing lures (forgot to take my cursor off the veggie one before the
screenshot):

![immagine](https://github.com/user-attachments/assets/8ba7a0f2-2a9f-4177-9c0d-ebeabd8a0ef7)

The five new fish:

![immagine](https://github.com/user-attachments/assets/1c251079-3b39-48bb-af6c-0a35623953a7)

</details>

<details>
<summary>A table of fish catchable wth each lure (excluding
holodeck)</summary>


![table](https://github.com/user-attachments/assets/dee95855-405b-4945-bfc2-70e816e46109)

</details>

A few more things in the CL, baitfish are a thing now.

## Why It's Good For The Game
There should be ways to contrast some of the RNG fishing has. After all,
it's only going to get more random the more fish are in the game.
Furthermore, I find it disappointing that a lot of food stuff is
exclusive to the ingredients console and there're no other ways to get
it.

## Changelog

🆑
add: Added fishing lures to the game. They don't get used up like baits
and let you catch specific kinds of fish, though they need to be spun
every few seconds. The whole set can be ordered from cargo for 450
credits.
balance: The magnet hook now removes dud chances.
add: Added five new fish types: perch, two types of pike, monkfish,
plaice and squid. Squids have a fairly special ink production trait,
which lets you use them (unless dead) to ink people face at close range,
and can be butchered for an ink sac, which can either be processed into
canned squid ink, or thrown at someone.
fix: Refactored throwing a little. Some items (specifically
components/elements) won't be triggered when caught. no more plates
shattering despite being caught for example.
add: Goldfish, lavaloops, needlefish and armorfish can now be used as
baits.
/🆑
2024-09-06 19:50:28 -04:00

154 lines
4.7 KiB
Plaintext

/**
* Face decal component
*
* For when you have some dirt on your face
*/
/datum/component/face_decal
dupe_mode = COMPONENT_DUPE_HIGHLANDER
/// Overlay we use for non-carbon mobs
var/mutable_appearance/normal_overlay
/// Bodypart overlay we use for carbon mobs
var/datum/bodypart_overlay/simple/bodypart_overlay
/// Cached head for carbons, to ensure proper removal of our overlay
var/obj/item/bodypart/my_head
/// Base icon state we use for the effect
var/icon_state
/// Layers for the bodypart_overlay to draw on
var/layers
/// Color that the overlay is modified by
var/color
/datum/component/face_decal/Initialize(icon_state, layers, color)
src.icon_state = icon_state
src.layers = layers
src.color = color
/datum/component/face_decal/Destroy(force)
. = ..()
normal_overlay = null
my_head = null
QDEL_NULL(bodypart_overlay)
/datum/component/face_decal/RegisterWithParent()
if(iscarbon(parent))
var/mob/living/carbon/human/carbon_parent = parent
my_head = carbon_parent.get_bodypart(BODY_ZONE_HEAD)
if(!my_head) //just to be sure
qdel(src)
return
bodypart_overlay = new()
bodypart_overlay.layers = layers
if(carbon_parent.bodyshape & BODYSHAPE_SNOUTED) //stupid, but external organ bodytypes are not stored on the limb
bodypart_overlay.icon_state = "[icon_state]_lizard"
else if(my_head.bodyshape & BODYSHAPE_MONKEY)
bodypart_overlay.icon_state = "[icon_state]_monkey"
else
bodypart_overlay.icon_state = "[icon_state]_human"
if (!isnull(color))
bodypart_overlay.draw_color = color
my_head.add_bodypart_overlay(bodypart_overlay)
RegisterSignals(my_head, list(COMSIG_BODYPART_REMOVED, COMSIG_QDELETING), PROC_REF(lost_head))
carbon_parent.update_body_parts()
else
normal_overlay = get_normal_overlay()
normal_overlay.color = color
RegisterSignals(parent, list(
COMSIG_COMPONENT_CLEAN_ACT,
COMSIG_COMPONENT_CLEAN_FACE_ACT),
PROC_REF(clean_up)
)
if (!isnull(normal_overlay))
if (!isnull(color))
normal_overlay.color = color
var/atom/atom_parent = parent
RegisterSignal(atom_parent, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(update_overlays))
atom_parent.update_appearance()
/datum/component/face_decal/proc/get_normal_overlay()
return
/datum/component/face_decal/UnregisterFromParent()
UnregisterSignal(parent, list(
COMSIG_COMPONENT_CLEAN_ACT,
COMSIG_COMPONENT_CLEAN_FACE_ACT))
if(my_head)
if(bodypart_overlay)
my_head.remove_bodypart_overlay(bodypart_overlay)
if(!my_head.owner)
my_head.update_icon_dropped()
QDEL_NULL(bodypart_overlay)
UnregisterSignal(my_head, list(COMSIG_BODYPART_REMOVED, COMSIG_QDELETING))
my_head = null
if(iscarbon(parent))
var/mob/living/carbon/carbon_parent = parent
carbon_parent.update_body_parts()
if(normal_overlay)
var/atom/atom_parent = parent
UnregisterSignal(atom_parent, COMSIG_ATOM_UPDATE_OVERLAYS)
atom_parent.update_appearance()
normal_overlay = null
///Callback to remove our decal
/datum/component/face_decal/proc/clean_up(datum/source, clean_types)
SIGNAL_HANDLER
if(!(clean_types & CLEAN_TYPE_BLOOD))
return NONE
qdel(src)
return COMPONENT_CLEANED
/// Ensures normal_overlay overlay in case the mob is not a carbon
/datum/component/face_decal/proc/update_overlays(atom/parent_atom, list/overlays)
SIGNAL_HANDLER
if(normal_overlay)
overlays += normal_overlay
/// Removes the decal when the head gets dismembered
/datum/component/face_decal/proc/lost_head(obj/item/bodypart/source, mob/living/carbon/owner, dismembered)
SIGNAL_HANDLER
qdel(src)
/// splat subtype, handling signals and mood logic
GLOBAL_LIST_INIT(splattable, zebra_typecacheof(list(
/mob/living/carbon/human = "human",
/mob/living/basic/pet/dog/corgi = "corgi",
/mob/living/silicon/ai = "ai",
)))
/datum/component/face_decal/splat
///The mood_event that we add
var/mood_event_type
/datum/component/face_decal/splat/Initialize(icon_state, layers, color, memory_type = /datum/memory/witnessed_creampie, mood_event_type = /datum/mood_event/creampie)
if(!is_type_in_typecache(parent, GLOB.splattable))
return COMPONENT_INCOMPATIBLE
. = ..()
SEND_SIGNAL(parent, COMSIG_MOB_HIT_BY_SPLAT, src)
add_memory_in_range(parent, 7, memory_type, protagonist = parent)
src.mood_event_type = mood_event_type
/datum/component/face_decal/splat/get_normal_overlay()
return mutable_appearance('icons/mob/effects/face_decal.dmi', "[icon_state]_[GLOB.splattable[type]]")
/datum/component/face_decal/splat/RegisterWithParent()
. = ..()
if(iscarbon(parent))
var/mob/living/carbon/human/carbon_parent = parent
carbon_parent.add_mood_event("splat", mood_event_type)
/datum/component/face_decal/splat/UnregisterFromParent()
. = ..()
if(iscarbon(parent))
var/mob/living/carbon/carbon_parent = parent
carbon_parent.clear_mood_event("splat")