Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes pixel offsets once and for all #658

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,11 @@
#define HOMEOSTASIS_HANDLED (1<<0)
/// Return to not reduce hunger at all
#define HOMEOSTASIS_NO_HUNGER (1<<1)

//from base of living/set_pull_offset(): (mob/living/pull_target, grab_state)
#define COMSIG_LIVING_SET_PULL_OFFSET "living_set_pull_offset"
//from base of living/reset_pull_offsets(): (mob/living/pull_target, override)
#define COMSIG_LIVING_RESET_PULL_OFFSETS "living_reset_pull_offsets"
//from base of living/CanAllowThrough(): (atom/movable/mover, border_dir)
#define COMSIG_LIVING_CAN_ALLOW_THROUGH "living_can_allow_through"
#define COMPONENT_LIVING_PASSABLE (1<<0)
2 changes: 0 additions & 2 deletions code/__DEFINES/dcs/signals/signals_movetype.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// /datum/element/movetype_handler signals
/// Called when the floating anim has to be temporarily stopped and restarted later: (timer)
#define COMSIG_PAUSE_FLOATING_ANIM "pause_floating_anim"
/// From base of datum/element/movetype_handler/on_movement_type_trait_gain: (flag, old_movement_type)
#define COMSIG_MOVETYPE_FLAG_ENABLED "movetype_flag_enabled"
/// From base of datum/element/movetype_handler/on_movement_type_trait_loss: (flag, old_movement_type)
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,9 @@
#define UPDATE_MEDHUD (UPDATE_MEDHUD_HEALTH | UPDATE_MEDHUD_STATUS)
/// Updates associated self-huds on the mob
#define UPDATE_SELF (UPDATE_SELF_DAMAGE | UPDATE_SELF_HEALTH)

// Used in living mob offset list for determining pixel offsets
#define PIXEL_W_OFFSET "w"
#define PIXEL_X_OFFSET "x"
#define PIXEL_Y_OFFSET "y"
#define PIXEL_Z_OFFSET "z"
3 changes: 3 additions & 0 deletions code/__DEFINES/robots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,6 @@ DEFINE_BITFIELD(janitor_mode_flags, list(
#define MEDIBOT_VOICED_THE_END "Is this the end?"
#define MEDIBOT_VOICED_NOOO "Nooo!"
#define MEDIBOT_VOICED_CHICKEN "LOOK AT ME?! I am a chicken."

/// Default offsets for riding a cyborg
#define DEFAULT_ROBOT_RIDING_OFFSETS list(TEXT_NORTH = list(0, 4), TEXT_SOUTH = list(0, 4), TEXT_EAST = list(-6, 3), TEXT_WEST = list(6, 3))
5 changes: 5 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file contains all of the "static" define strings that tie to a trait.

Check failure on line 1 in code/__DEFINES/traits/declarations.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Define Sanity

TRAIT_CAN_MOUNT_HUMANS is defined in code/__DEFINES/traits/declarations.dm but not added to code/_globalvars/traits/_traits.dm!

Check failure on line 1 in code/__DEFINES/traits/declarations.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Define Sanity

TRAIT_CAN_MOUNT_CYBORGS is defined in code/__DEFINES/traits/declarations.dm but not added to code/_globalvars/traits/_traits.dm!
// WARNING: The sections here actually matter in this file as it's tested by CI. Please do not toy with the sections."

// BEGIN TRAIT DEFINES
Expand Down Expand Up @@ -1066,4 +1066,9 @@
/// Mob doesn't get closed eyelids overlay when it gets knocked out cold or dies
#define TRAIT_NO_EYELIDS "no_eyelids"

/// Apply this trait to mobs which can buckle humans
#define TRAIT_CAN_MOUNT_HUMANS "can_mount_humans"
/// Apply this trait to mobs which can buckle cyborgs
#define TRAIT_CAN_MOUNT_CYBORGS "can_mount_cyborgs"

// END TRAIT DEFINES
7 changes: 7 additions & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@

/// A trait gained from a mob's leap action, like the leaper
#define LEAPING_TRAIT "leaping"
/// From grabbing someone
#define GRABBING_TRAIT "grabbing"
/// A trait gained from a mob's vanish action, like the herophant
#define VANISHING_TRAIT "vanishing"
/// A trait gained from a mob's swoop action, like the ash drake
Expand Down Expand Up @@ -176,6 +178,11 @@
/// Trait applied by MODsuits.
#define MOD_TRAIT "mod"

/// Trait from mob/living/update_transform()
#define UPDATE_TRANSFORM_TRAIT "update_transform"
/// Trait from mob/living/update_offsets()
#define UPDATE_OFFSET_TRAIT "update_offset"

/// Trait granted by the berserker hood.
#define BERSERK_TRAIT "berserk_trait"
/// Trait granted by [/obj/item/rod_of_asclepius]
Expand Down
3 changes: 0 additions & 3 deletions code/__DEFINES/vehicles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,3 @@
#define VIM_SOUND_COOLDOWN (1 SECONDS)
///how much vim heals per weld
#define VIM_HEAL_AMOUNT 20

/// The vehicle being ridden requires pixel offsets for all directions
#define RIDING_OFFSET_ALL "ALL"
2 changes: 1 addition & 1 deletion code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
**/
/proc/list_clear_nulls(list/list_to_clear)
return (list_to_clear.RemoveAll(null) > 0)


/**
* Removes any empty weakrefs from the list
Expand Down
16 changes: 6 additions & 10 deletions code/__HELPERS/visual_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* This is just so you can apply the animation to things which can be animated but are not movables (like images)
*/
#define DO_FLOATING_ANIM(target) \
animate(target, pixel_y = 2, time = 1 SECONDS, loop = -1, flags = ANIMATION_RELATIVE); \
animate(pixel_y = -2, time = 1 SECONDS, flags = ANIMATION_RELATIVE)
animate(target, pixel_z = 2, time = 1 SECONDS, loop = -1, flags = ANIMATION_RELATIVE); \
animate(pixel_z = -2, time = 1 SECONDS, flags = ANIMATION_RELATIVE)

/**
* Stops the passed atom / image from appearing floating
Expand All @@ -17,16 +17,12 @@
* This is just so you can apply the animation to things which can be animated but are not movables (like images)
*/
#define STOP_FLOATING_ANIM(target) \
var/final_pixel_y = 0; \
var/final_pixel_z = 0; \
if(ismovable(target)) { \
var/atom/movable/movable_target = target; \
final_pixel_y = movable_target.base_pixel_y; \
var/atom/movable/__movable_target = target; \
final_pixel_z = __movable_target.base_pixel_z; \
}; \
if(isliving(target)) { \
var/mob/living/living_target = target; \
final_pixel_y += living_target.body_position_pixel_y_offset; \
}; \
animate(target, pixel_y = final_pixel_y, time = 1 SECONDS)
animate(target, pixel_z = final_pixel_z, time = 1 SECONDS)

/// The duration of the animate call in mob/living/update_transform
#define UPDATE_TRANSFORM_ANIMATION_TIME (0.2 SECONDS)
Expand Down
Loading
Loading