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

Phone overhaul #29

Merged
merged 11 commits into from
Oct 26, 2023
Merged
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
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@
#define COMSIG_HUMAN_SURGERY_APPLY_MODIFIERS "human_surgery_apply_modifiers"
/// From /mob/living/carbon/human/proc/get_flags_cold_protection()
#define COMSIG_HUMAN_COLD_PROTECTION_APPLY_MODIFIERS "human_cold_protection_apply_modifiers"

/// From /mob/living/carbon/human/UnarmedAttack()
#define COMSIG_HUMAN_BEFORE_ATTACK_HAND "human_before_attack_hand"
#define COMPONENT_CANCEL_HUMAN_ATTACK_HAND (1<<0)
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@

/// From /obj/item/proc/pickup() : (obj/item/picked_up)
#define COMSIG_MOB_PICKUP_ITEM "mob_pickup_item"

/// From /mob/proc/say_dead(message)
#define COMSIG_DEAD_SPEAK "comsig_dead_speak"
#define COMPONENT_OVERRIDE_DEAD_SPEAK (1<<0)
20 changes: 20 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,23 @@

///When the transform or an atom is varedited through vv topic.
#define COMSIG_ATOM_VV_MODIFY_TRANSFORM "atom_vv_modify_transform"

/// From /mob/living/carbon/human/UnarmedAttack()
#define COMSIG_ATOM_BEFORE_HUMAN_ATTACK_HAND "atom_before_human_attack_hand"
#define COMPONENT_CANCEL_ATTACK_HAND (1<<0)

/// From /mob/proc/click_adjacent()
#define COMSIG_ATOM_MOB_ATTACKBY "atom_mob_attackby"
#define COMPONENT_CANCEL_ATTACKBY (1<<0)

/// From /atom/proc/attack_hand()
#define COMSIG_ATOM_ATTACK_HAND "atom_attack_hand"

/// From /datum/component/phone/proc/picked_up_call() and /datum/component/phone/proc/post_call_phone()
#define COMSIG_ATOM_PHONE_PICKED_UP "atom_phone_picked_up"
/// From /datum/component/phone/proc/recall_handset()
#define COMSIG_ATOM_PHONE_HUNG_UP "atom_phone_hung_up"
/// From /datum/component/phone/proc/call_phone()
#define COMSIG_ATOM_PHONE_RINGING "atom_phone_ringing"
/// From /datum/component/phone/proc/reset_call()
#define COMSIG_ATOM_PHONE_STOPPED_RINGING "atom_phone_stopped_ringing"
5 changes: 5 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
/// From /atom/movable/proc/launch_towards
#define COMSIG_MOVABLE_PRE_THROW "movable_pre_throw"
#define COMPONENT_CANCEL_THROW (1<<0)

///from base of atom/movable/Moved(): (/atom, dir, forced)
#define COMSIG_MOVABLE_MOVED "movable_moved"
/// From /atom/movable/Move(): (atom/NewLoc)
#define COMSIG_MOVABLE_PRE_MOVE "movable_pre_move"
#define COMPONENT_CANCEL_MOVE (1<<0)
/// From /atom/movable/proc/forceMove(): (atom/NewLoc)
#define COMSIG_MOVABLE_FORCEMOVED "movable_forcemove"

/// From /turf/open/gm/river/Entered(): (turf/open/gm/river/river, covered)
#define COMSIG_MOVABLE_ENTERED_RIVER "movable_entered_river"

Expand All @@ -29,3 +33,4 @@
#define COMSIG_MOVABLE_UPDATE_GLIDE_SIZE "movable_glide_size"

#define COMSIG_MOVABLE_TURF_ENTER "movable_turf_enter"

3 changes: 0 additions & 3 deletions code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#define COMSIG_SENTRY_EMPTY_AMMO_ALERT "signal_sentry_empty_ammo"
#define COMSIG_SENTRY_DESTROYED_ALERT "signal_sentry_destroyed"

/// from /obj/structure/transmitter/update_icon()
#define COMSIG_TRANSMITTER_UPDATE_ICON "transmitter_update_icon"

#define COMSIG_TENT_COLLAPSING "tent_collapsing"

/// from /obj/proc/afterbuckle()
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/dcs/signals/atom/signals_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/// From /turf/closed/wall/resin/attackby(): (obj/item/I, mob/M)
#define COMSIG_WALL_RESIN_ATTACKBY "wall_resin_attackby"
#define COMPONENT_CANCEL_ATTACKBY (1<<0)
#define COMPONENT_CANCEL_RESIN_ATTACKBY (1<<0)

///from /turf/closed/wall/proc/place_poster
#define COMSIG_POSTER_PLACED "poster_placed"
12 changes: 8 additions & 4 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,11 @@ var/global/list/uniform_categories = list(
#define PHONE_UPP_SOLDIER "Soldier"
#define PHONE_IO "IO"

#define PHONE_DND_FORCED 2
#define PHONE_DND_ON 1
#define PHONE_DND_OFF 0
#define PHONE_DND_FORBIDDEN -1
#define PHONE_DO_NOT_DISTURB_FORCED 2
#define PHONE_DO_NOT_DISTURB_ON 1
#define PHONE_DO_NOT_DISTURB_OFF 0
#define PHONE_DO_NOT_DISTURB_FORBIDDEN -1

#define PHONE_ON_BASE_UNIT_ICON_STATE "[initial(icon_state)]"
#define PHONE_OFF_BASE_UNIT_ICON_STATE "[initial(icon_state)]_ear"
#define PHONE_RINGING_ICON_STATE "[initial(icon_state)]_ring"
3 changes: 3 additions & 0 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
if(W.attack_speed && !src.contains(A)) //Not being worn or carried in the user's inventory somewhere, including internal storages.
next_move += W.attack_speed

if(SEND_SIGNAL(A, COMSIG_ATOM_MOB_ATTACKBY, W, src) & COMPONENT_CANCEL_ATTACKBY)
return

if(!A.attackby(W, src, mods) && A && !QDELETED(A))
// in case the attackby slept
if(!W)
Expand Down
4 changes: 4 additions & 0 deletions code/_onclick/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,16 @@
to_chat(src, SPAN_NOTICE("You try to move your [temp.display_name], but cannot!"))
return

if(SEND_SIGNAL(A, COMSIG_ATOM_BEFORE_HUMAN_ATTACK_HAND, src, click_parameters) & COMPONENT_CANCEL_HUMAN_ATTACK_HAND)
return

A.attack_hand(src, click_parameters)

/datum/proc/handle_click(mob/living/carbon/human/user, atom/A, params) //Heres our handle click relay proc thing.
return HANDLE_CLICK_PASS_THRU

/atom/proc/attack_hand(mob/user)
SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user)
return

/mob/living/carbon/human/MouseDrop_T(atom/dropping, mob/user)
Expand Down
Loading
Loading