Skip to content

Commit

Permalink
Отработка по багам и компонентам
Browse files Browse the repository at this point in the history
  • Loading branch information
msw7007 committed Oct 20, 2024
1 parent d3f9b1b commit 08530a8
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 14 deletions.
30 changes: 21 additions & 9 deletions modular_ss220/species/_components/appearance/mob_overlay_shift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
*/
/datum/component/mob_overlay_shift
var/dir = NORTH

var/list/shift_data = list()

/datum/component/mob_overlay_shift/Initialize(list/shift_list)
// Define body parts and positions
var/list/body_parts = list("inhand", "belt", "back", "head")
var/list/positions = list("center", "side", "front")

// Initialize shifts using the provided shift_data list or default to zero
for(var/body_part in body_parts)
// Create a nested list for each body part if it doesn't exist
Expand All @@ -25,19 +23,21 @@
// Set default values for x and y shifts if not provided
shift_data[body_part][position]["x"] = shift_list[body_part][position]["x"] ? shift_list[body_part][position]["x"] : 0
shift_data[body_part][position]["y"] = shift_list[body_part][position]["y"] ? shift_list[body_part][position]["y"] : 0
shift_call(parent)

/datum/component/mob_overlay_shift/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATOM_DIR_CHANGE, PROC_REF(shift_call))
RegisterSignal(parent, COMSIG_LIVING_LIFE, PROC_REF(update_call))
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, PROC_REF(shift_call))

/datum/component/mob_overlay_shift/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_ATOM_DIR_CHANGE)
UnregisterSignal(parent, COMSIG_LIVING_LIFE)
UnregisterSignal(parent, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT))

//datum/component/mob_overlay_shift/process()
//shift_call(parent)

//Проки, срабатываемые при получении или исцелении урона
/datum/component/mob_overlay_shift/proc/shift_call(mob/living/carbon/human/mob, old_dir, new_dir)
if(new_dir)
dir = new_dir
/datum/component/mob_overlay_shift/proc/shift_call(mob/living/carbon/human/mob)
if(mob.dir)
dir = mob.dir

var/list/body_parts = list("inhand", "belt", "back", "head")
var/position
Expand Down Expand Up @@ -308,3 +308,15 @@

mob.apply_overlay(LEFT_EAR_LAYER)
mob.apply_overlay(RIGHT_EAR_LAYER)

/mob/equip_to_slot(obj/item/W, slot, initial = FALSE)
. = .. ()
SEND_SIGNAL(src, COMSIG_ATOM_DIR_CHANGE)

/mob/facedir(ndir)
. = .. ()
SEND_SIGNAL(src, COMSIG_ATOM_DIR_CHANGE)

/mob/ClickOn(atom/A, params)
. = .. ()
SEND_SIGNAL(src, COMSIG_ATOM_DIR_CHANGE)
4 changes: 2 additions & 2 deletions modular_ss220/species/_components/attacking/double_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
/datum/component/double_attack/proc/hand_pre_attack(obj/item/weapon, mob/living/target, mob/living/user, def_zone)
SIGNAL_HANDLER
var/hand_item = user.get_active_hand()
state_attack = TRUE
if(hand_item && state_attack)
if(hand_item && !state_attack)
state_attack = TRUE
addtimer(CALLBACK(src, PROC_REF(hand_attack), target, user, def_zone, hand_item), (user.next_move_modifier / 5) SECONDS)

/datum/component/double_attack/proc/hand_attack(mob/living/target, mob/living/user, def_zone, obj/item/hand_item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@

carrier.loaded = AM
carrier.update_icon()
carrier.throw_alert("holding", /atom/movable/screen/alert/carrying)

/datum/component/gadom_cargo/proc/try_unload_cargo()
var/dirn = carrier.dir
Expand All @@ -125,6 +126,7 @@
step(carrier.loaded, dirn)
carrier.loaded.crate_carrying_person = null
carrier.loaded = null
carrier.clear_alert("holding")
carrier.update_icon(UPDATE_OVERLAYS)

//Расширение прока для переноса ящика на моба
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

puppet.loaded = AM
puppet.update_icon()
puppet.throw_alert("holding", /atom/movable/screen/alert/carrying)

/datum/component/gadom_living/proc/load_mob(mob/living/carbon/human/puppet, mob/living/M)
puppet.can_buckle = TRUE
Expand All @@ -81,6 +82,7 @@
carrier.unbuckle_all_mobs()
carrier.can_buckle = TRUE
carrier.update_icon(UPDATE_OVERLAYS)
carrier.clear_alert("holding")

//Обновление при отстегивании для восстановления слоя моба
/mob/living/carbon/human/post_unbuckle_mob(mob/living/M)
Expand Down
5 changes: 5 additions & 0 deletions modular_ss220/species/serpentids/code/_defines/alerts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@
name = "Сильные повреждения панциря"
desc = "Ваш панцирь поврежден. Нарушения целостности лишило вас сопротивлению окружающей среде."
icon_state = "carapace_break_rig"

/atom/movable/screen/alert/carrying
name = "Перенос"
desc = "Ваш хвост обвязал случайного зеваку или ящик. Нажмите, что бы отгрузить."
icon_state = "holding"
6 changes: 3 additions & 3 deletions modular_ss220/species/serpentids/code/mob/serpentids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
var/gene_lastcall = 0
var/list/shift_data = list(
"head" = list(
"center" = list("x" = 0, "y" = 10),
"center" = list("x" = 0, "y" = 9),
"side" = list("x" = 3, "y" = 0),
"front" = list("x" = 0, "y" = 0)
),
"inhand" = list(
"center" = list("x" = 0, "y" = 3),
"center" = list("x" = 0, "y" = 1),
"side" = list("x" = 0, "y" = 0),
"front" = list("x" = 0, "y" = 0)
),
Expand Down Expand Up @@ -169,7 +169,7 @@
H.buckle_lying = buckle_lying
H.update_transform()
H.AddComponent(/datum/component/footstep, FOOTSTEP_MOB_SLIME, 1, -6)
H.AddComponent(/datum/component/mob_overlay_shift, shift_data) //shift_xs_hand = 12
H.AddComponent(/datum/component/mob_overlay_shift, shift_data)
H.AddComponent(/datum/component/gadom_living)
H.AddComponent(/datum/component/gadom_cargo)
H.verbs |= /mob/living/carbon/human/proc/emote_gasroar
Expand Down
Binary file modified modular_ss220/species/serpentids/icons/organs.dmi
Binary file not shown.
Binary file modified modular_ss220/species/serpentids/icons/screen_alert.dmi
Binary file not shown.

0 comments on commit 08530a8

Please sign in to comment.