mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-09 16:05:07 +00:00
* Converts traders to basic mobs (#79187) ## About The Pull Request This PR converts the two trader mobs into basic mobs, these being the basic debug trader that buys ectoplasm and sells ghost burgers, and Mr Bones, who buys empty milk cartons and bones, and sells bone relate paraphernalia. Traders now use dynamic appearance generation. The old sprites still exist as hallucinations, and as shop signs. Trader UI is now summoned via `COMSIG_ATOM_ATTACK_HAND`, which properly cancels the attack chain, so there is no longer need to put it on Interact. I kept most of the original behaviour, but moved them off into a component. I have also cached all the images generated for the radials, I hope I have not overengineered it. I have also created a new datum, which stores the trader's wares, needs, and speech patterns. Admins can put the component along with the trader data on any living mobs with an AI controller, turning them into traders. Keep in mind that most AI has random idle movement, meaning they have a chance to walk off, closing your trader radial.  The trader AI consists of the following, first, when a trader sees someone, they will deploy their shop, if one does not already exists. The shop consists of a chair, and a holographic sign. If you attack them, they will chase you with their weapons, and then return to their chair when victorious. If the chair is somehow destroyed, they will create a new shop when they see a new potential customer.  Mr Bones uses a variant of the AI, where they will run at you, and deploy their shop when they reach you. I call this the jumpscare variant. Below you can see me getting actually jumpscared because Mr Bones has stepped on a yelling frog when I opened the maintenance door.  I have also made an element that toggles an ai controlled combat mode when it gains a target, and when it loses it. I am using it to make Traders unable to trade while they are trying to kill a robber. To aid this, I a have made `/datum/ai_controller/proc/sig_remove_from_blackboard` send the `COMSIG_AI_BLACKBOARD_KEY_CLEARED` signal, in case the trader kills a mob that deletes itself on death. This means I could remove a signup `/datum/component/appearance_on_aggro` was doing towards Qdeleting. Below you can see Mr Bones shooting me with candy corn.   Traders actually only shoot you until you are conscious, so I survived here in crit. Most mobs don't have crit state, so they just die, so I am sticking by this voice line. Thank you @ CoiledLamb for help with the sale sign! ## Why It's Good For The Game Two more mobs off the list. The AI and Componentized behaviours allows us to set up new kind of traders. ## Changelog 🆑 refactor: Traders are basic mobs now. Please alert us of any strange behaviours! code: If there is only one option, radial lists will autopick it. This behaviour can be turned off via a new argument. /🆑 * Converts traders to basic mobs --------- Co-authored-by: Profakos <profakos@gmail.com>