Files
Bubberstation/code/datums/ai/cursed/cursed_controller.dm
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

73 lines
3.4 KiB
Plaintext

/**
* # cursed item ai!
*
* Haunted AI tries to not be interacted with, and will attack people who do.
* Cursed AI instead tries to be interacted with, and will attempt to equip itself onto people.
* Added by /datum/element/cursed, and as such will try to remove this element and go dormant when it finds a victim to curse
*/
/datum/ai_controller/cursed
movement_delay = 0.4 SECONDS
blackboard = list(
BB_CURSE_TARGET,
BB_TARGET_SLOT,
BB_CURSED_THROW_ATTEMPT_COUNT
)
planning_subtrees = list(/datum/ai_planning_subtree/cursed)
idle_behavior = /datum/idle_behavior/idle_ghost_item
/datum/ai_controller/cursed/TryPossessPawn(atom/new_pawn)
if(!isitem(new_pawn))
return AI_CONTROLLER_INCOMPATIBLE
RegisterSignal(new_pawn, COMSIG_MOVABLE_IMPACT, PROC_REF(on_throw_hit))
RegisterSignal(new_pawn, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
return ..() //Run parent at end
/datum/ai_controller/cursed/UnpossessPawn()
UnregisterSignal(pawn, list(COMSIG_MOVABLE_IMPACT, COMSIG_ITEM_EQUIPPED))
return ..() //Run parent at end
///signal called by the pawn hitting something after a throw
/datum/ai_controller/cursed/proc/on_throw_hit(datum/source, atom/hit_atom, datum/thrownthing/throwing_datum, caught)
SIGNAL_HANDLER
if(caught || !iscarbon(hit_atom))
return
//equipcode has sleeps all over it.
INVOKE_ASYNC(src, PROC_REF(try_equipping_to_target_slot), hit_atom)
///signal called by picking up the pawn, will try to equip to where it should actually be and start the curse
/datum/ai_controller/cursed/proc/on_equip(datum/source, mob/equipper, slot)
SIGNAL_HANDLER
INVOKE_ASYNC(src, PROC_REF(try_equipping_to_target_slot), equipper, slot)
/**
* curse of hunger component; for very hungry items.
*
* called when someone grabs the cursed item or the cursed item impacts with a mob it's throwing itself at
* arguments:
* * curse_victim: whomever we're attaching this to
* * slot_already_in: the slot the item is already in before this was called, possibly null but at least in hands if picked up
*/
/datum/ai_controller/cursed/proc/try_equipping_to_target_slot(mob/living/carbon/curse_victim, slot_already_in)
var/obj/item/item_pawn = pawn
var/attempted_slot = blackboard[BB_TARGET_SLOT]
if(slot_already_in && (attempted_slot & slot_already_in)) //thanks for making it easy
what_a_horrible_night_to_have_a_curse()
return
if(attempted_slot & ITEM_SLOT_HANDS) //hands needs some different checks
curse_victim.drop_all_held_items()
if(curse_victim.put_in_hands(item_pawn, del_on_fail = FALSE))
to_chat(curse_victim, span_danger("[item_pawn] leaps into your hands!"))
what_a_horrible_night_to_have_a_curse()
return
var/obj/item/blocking = curse_victim.get_item_by_slot(attempted_slot)
if(!curse_victim.dropItemToGround(blocking, silent = TRUE))
return //cannot equip to this person so whatever just keep whacking them until they die or fugg off
curse_victim.equip_to_slot_if_possible(item_pawn, attempted_slot, qdel_on_fail = FALSE, disable_warning = FALSE)
to_chat(curse_victim, span_danger("[item_pawn] equips [item_pawn.p_them()]self onto you!"))
what_a_horrible_night_to_have_a_curse()
///proc called when the cursed object successfully attaches itself to someone, removing the cursed element and by extension the ai itself
/datum/ai_controller/cursed/proc/what_a_horrible_night_to_have_a_curse()
var/obj/item/item_pawn = pawn
item_pawn.RemoveElement(/datum/element/cursed)