mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Pixel adjustments to mobs are now sourced / Refactors riding (#89320)
Fixes #85980 - Pixel adjustments are now sourced When tweaking a mob's pixel w, x, y, z, is is now done via `add_offsets` and must have a source string associated - Refactors riding Refactors how riding component selects the offsets to use. It's now all done via the getter rather than a weird mix of a var, a cache, and a getter. - Moves a bunch of animations to use `pixel_w` / `pixel_z` Largely to prevent conflicts with adjustments to a mob's pixel position, but also as many animations are not actual movements, but visual movements. Floating is one such example. It just works 🆑 Melbert fix: Fixed grab offsets not showing for anything but passive grab fix: Fix jank with mob offsets when riding things refactor: Refactored riding component, particularly how it selects layer and offsets. Report any oddities refactor: Refactored pixel offsets of mobs. Report any oddities /🆑
This commit is contained in:
@@ -104,6 +104,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(
|
||||
RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(on_injured)) // this means we got hurt and it's go time
|
||||
RegisterSignal(src, COMSIG_ANIMAL_PET, PROC_REF(on_pet))
|
||||
RegisterSignal(src, COMSIG_KB_MOB_DROPITEM_DOWN, PROC_REF(drop_item_on_signal))
|
||||
ADD_TRAIT(src, TRAIT_CAN_MOUNT_HUMANS, INNATE_TRAIT)
|
||||
|
||||
/mob/living/basic/parrot/Destroy()
|
||||
// should have cleaned these up on death, but let's be super safe in case that didn't happen
|
||||
@@ -264,13 +265,19 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(
|
||||
UnregisterSignal(src, COMSIG_LIVING_SET_BUCKLED)
|
||||
toggle_perched(perched = FALSE)
|
||||
|
||||
#define PERCH_SOURCE "perched"
|
||||
|
||||
/mob/living/basic/parrot/proc/toggle_perched(perched)
|
||||
if(!perched)
|
||||
REMOVE_TRAIT(src, TRAIT_PARROT_PERCHED, TRAIT_GENERIC)
|
||||
REMOVE_TRAIT(src, TRAIT_PARROT_PERCHED, PERCH_SOURCE)
|
||||
remove_offsets(PERCH_SOURCE)
|
||||
else
|
||||
ADD_TRAIT(src, TRAIT_PARROT_PERCHED, TRAIT_GENERIC)
|
||||
ADD_TRAIT(src, TRAIT_PARROT_PERCHED, PERCH_SOURCE)
|
||||
add_offsets(PERCH_SOURCE, y_add = 9)
|
||||
update_appearance(UPDATE_ICON_STATE)
|
||||
|
||||
#undef PERCH_SOURCE
|
||||
|
||||
/// Master proc which will determine the intent of OUR attacks on an object and summon the relevant procs accordingly.
|
||||
/// This is pretty much meant for players, AI will use the task-specific procs instead.
|
||||
/mob/living/basic/parrot/early_melee_attack(atom/target, list/modifiers, ignore_cooldown)
|
||||
|
||||
Reference in New Issue
Block a user