Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@

#define COMSIG_LIVING_PREBITE_SELF "living_prebite"
#define COMSIG_LIVING_POSTBITE_SELF "living_postbite"

/// From [mob/living/MiddleClickOn] before a middle mouse intent is performed
#define COMSIG_MOB_PRE_SPECIAL_MIDDLE "pre_special_middle"
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals_objectives.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#define COMSIG_MOB_BUTCHERED "mob_butchered"
/// from /datum/species/proc/kicked() (mob/user, mob/target, zone_hit, damage_blocked)
#define COMSIG_MOB_KICK "mob_kick"
/// from /datum/species/proc/kicked() (mob/user, mob/target, zone_hut, damage_blocked)
#define COMSIG_MOB_KICKED "mob_kicked"
/// from /obj/structure/closet/dirthole/attackby() (mob/user)
#define COMSIG_GRAVE_ROBBED "grave_robbed"
/// from /datum/action/cooldown/spell/find_flaw/cast() (datum/charflaw/flaw, mob/target)
Expand Down
7 changes: 0 additions & 7 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,6 @@
/area/flick_overlay_view(mutable_appearance/display, duration)
return

/proc/flick_overlay_view(image/I, atom/target, duration) //wrapper for the above, flicks to everyone who can see the target atom
var/list/viewing = list()
for(var/mob/M as anything in viewers(target))
if(M.client)
viewing += M.client
flick_overlay(I, viewing, duration)

/proc/get_active_player_count(alive_check = 0, afk_check = 0, human_check = 0)
// Get active players who are playing in the round
var/active_players = 0
Expand Down
159 changes: 82 additions & 77 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,93 +223,94 @@


/mob/living/MiddleClickOn(atom/A, list/modifiers)
..()
. = ..()
if(!mmb_intent)
if(!A.Adjacent(src))
return
A.MiddleClick(src, modifiers)
else
switch(mmb_intent.type)
if(INTENT_KICK)
if(src.usable_legs < 2)
return
if(!A.Adjacent(src))
return

SEND_SIGNAL(src, COMSIG_MOB_PRE_SPECIAL_MIDDLE, A)

switch(mmb_intent.type)
if(INTENT_KICK)
if(src.usable_legs < 2)
return
if(!A.Adjacent(src))
return
if(A == src)
var/list/mobs_here = list()
for(var/mob/M in get_turf(src))
if(M.invisibility || M == src)
continue
mobs_here += M
if(mobs_here.len)
A = pick(mobs_here)
if(A == src) //auto aim couldn't select another target
return
if(A == src)
var/list/mobs_here = list()
for(var/mob/M in get_turf(src))
if(M.invisibility || M == src)
continue
mobs_here += M
if(mobs_here.len)
A = pick(mobs_here)
if(A == src) //auto aim couldn't select another target
if(IsOffBalanced())
to_chat(src, span_warning("I haven't regained my balance yet."))
return
changeNext_move(mmb_intent.clickcd)
face_atom(A)

if(ismob(A))
var/mob/living/M = A
if(src.used_intent)

do_attack_animation(M, visual_effect_icon = ATTACK_EFFECT_KICK, used_item = FALSE, atom_bounce = TRUE)
playsound(src, pick(PUNCHWOOSH), 100, FALSE, -1)

sleep(src.used_intent.swingdelay)
if(QDELETED(src) || QDELETED(M))
return
if(!M.Adjacent(src))
return
if(src.incapacitated(IGNORE_GRAB))
return
if(IsOffBalanced())
to_chat(src, span_warning("I haven't regained my balance yet."))
return
changeNext_move(mmb_intent.clickcd)
face_atom(A)

if(ismob(A))
var/mob/living/M = A
if(src.used_intent)

do_attack_animation(M, visual_effect_icon = ATTACK_EFFECT_KICK, used_item = FALSE, atom_bounce = TRUE)
playsound(src, pick(PUNCHWOOSH), 100, FALSE, -1)

sleep(src.used_intent.swingdelay)
if(QDELETED(src) || QDELETED(M))
return
if(!M.Adjacent(src))
return
if(src.incapacitated(IGNORE_GRAB))
return
if(M.checkmiss(src))
return
if(M.checkdefense(src.used_intent, src))
return
if(M.checkmiss(src))
return
if(!M.checkdefense(mmb_intent, src))
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.dna.species.kicked(src, H)
else
M.onkick(src)
OffBalance(15) // Off balance for human enemies moved to dna.species.onkick
else
A.onkick(src)
OffBalance(10)
return
if(INTENT_JUMP)
jump_action(A)
if(INTENT_BITE)
if(!A.Adjacent(src))
return
if(A == src)
return
if(src.incapacitated(IGNORE_GRAB))
return
if(stat != CONSCIOUS)
return
if(is_mouth_covered())
to_chat(src, span_warning("My mouth is blocked."))
return
if(HAS_TRAIT(src, TRAIT_NO_BITE))
to_chat(src, span_warning("I can't bite."))
return
if(iscarbon(src))
var/mob/living/carbon/C = src
if(C.mouth)
to_chat(src, span_warning("My mouth has something in it."))
if(M.checkdefense(src.used_intent, src))
return
changeNext_move(mmb_intent.clickcd)
face_atom(A)
bite(A)
if(M.checkmiss(src))
return
if(!M.checkdefense(mmb_intent, src))
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.dna.species.kicked(src, H)
else
M.onkick(src)
OffBalance(15) // Off balance for human enemies moved to dna.species.onkick
else
A.onkick(src)
OffBalance(10)
if(INTENT_JUMP)
jump_action(A)
if(INTENT_BITE)
if(!A.Adjacent(src))
return
if(INTENT_STEAL)
steal_action(A)
if(A == src)
return
if(src.incapacitated(IGNORE_GRAB))
return
if(stat != CONSCIOUS)
return
if(is_mouth_covered())
to_chat(src, span_warning("My mouth is blocked."))
return
if(HAS_TRAIT(src, TRAIT_NO_BITE))
to_chat(src, span_warning("I can't bite."))
return
if(iscarbon(src))
var/mob/living/carbon/C = src
if(C.mouth)
to_chat(src, span_warning("My mouth has something in it."))
return
changeNext_move(mmb_intent.clickcd)
face_atom(A)
bite(A)
if(INTENT_STEAL)
steal_action(A)

//Return TRUE to cancel other attack hand effects that respect it.
/atom/proc/attack_hand(mob/user, list/modifiers)
Expand Down Expand Up @@ -524,6 +525,10 @@
to_chat(src, span_warning("That's too high for me..."))
return

if(has_status_effect(/datum/status_effect/debuff/exposed))
to_chat(src, span_warning("I'm exposed and lost my footing! I can't jump!"))
return FALSE

changeNext_move(mmb_intent?.clickcd ? mmb_intent.clickcd : CLICK_CD_MELEE)

face_atom(A)
Expand Down
64 changes: 50 additions & 14 deletions code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -488,50 +488,85 @@

msg_stage++

/// Prevents use of weapon special attacks
/datum/status_effect/debuff/specialcd
id = "specialcd"
alert_type = /atom/movable/screen/alert/status_effect/debuff/specialcd
duration = 30 SECONDS
status_type = STATUS_EFFECT_UNIQUE
/// Prevent clicks for the duration of the ability
/datum/status_effect/debuff/clickcd
id = "clickcd"
alert_type = /atom/movable/screen/alert/status_effect/debuff/clickcd
duration = 3 SECONDS

/datum/status_effect/debuff/clickcd/on_creation(mob/living/new_owner, duration_override, ...)
new_owner.changeNext_move(duration)
return ..()

/atom/movable/screen/alert/status_effect/debuff/specialcd
name = "Special Manouevre Cooldown"
/atom/movable/screen/alert/status_effect/debuff/clickcd
name = "Action Delayed"
desc = "I cannot take another action."
icon_state = "clickcd"

/datum/status_effect/debuff/clashcd
id = "clashcd"
alert_type = /atom/movable/screen/alert/status_effect/debuff/clashcd
duration = 20 SECONDS

/atom/movable/screen/alert/status_effect/debuff/clashcd
name = "Riposte / Guard Cooldown"
desc = "I used it. I must wait."
icon_state = "specialcd"
icon_state = "guardcd"

/datum/status_effect/debuff/exposed
id = "nofeint"
id = "exposed"
alert_type = /atom/movable/screen/alert/status_effect/debuff/exposed
duration = 10 SECONDS
mob_overlay_icon_state = "eff_exposed"

/atom/movable/screen/alert/status_effect/debuff/exposed
name = "Exposed"
desc = "My defenses are exposed. I can be hit through my parry and dodge!"
desc = "My defenses are completely exposed. I can be hit through my parry and dodge to great effect!"
icon_state = "exposed"

/datum/status_effect/debuff/vulnerable
id = "vulnerable"
alert_type = /atom/movable/screen/alert/status_effect/debuff/vulnerable
duration = 10 SECONDS
mob_overlay_icon_state = "eff_vulnerable"

/atom/movable/screen/alert/status_effect/debuff/vulnerable
name = "Vulnerable"
desc = "A mistake. I can be hit through my parry and dodge to a lighter effect!"
icon_state = "vulnerable"

/datum/status_effect/debuff/feinted
id = "feinted"
alert_type = /atom/movable/screen/alert/status_effect/debuff/feinted
duration = 5 SECONDS
duration = 30 SECONDS

/atom/movable/screen/alert/status_effect/debuff/feinted

name = "Feinted"
desc = span_boldwarning("I've been feinted. It won't happen again so soon.")
icon_state = "feinted"

/datum/status_effect/debuff/feintcd
id = "feintcd"
alert_type = /atom/movable/screen/alert/status_effect/debuff/feintcd
duration = 10 SECONDS
duration = 30 SECONDS

/atom/movable/screen/alert/status_effect/debuff/feintcd
name = "Feint Cooldown"
desc = span_warning("I have feinted recently, my opponents will be wary.")
icon_state = "feinted"

/// Prevents use of weapon special attacks
/datum/status_effect/debuff/specialcd
id = "specialcd"
alert_type = /atom/movable/screen/alert/status_effect/debuff/specialcd
duration = 30 SECONDS
status_type = STATUS_EFFECT_UNIQUE

/atom/movable/screen/alert/status_effect/debuff/specialcd
name = "Special Manouevre Cooldown"
desc = "I used it. I must wait."
icon_state = "specialcd"

/// 2 Speed reduction for 8 seconds + slow
/datum/status_effect/debuff/hobbled
id = "hobbled"
Expand All @@ -551,3 +586,4 @@
/datum/status_effect/debuff/hobbled/on_remove()
. = ..()
owner?.remove_movespeed_modifier(MOVESPEED_ID_STATUS_EFFECT(id))

1 change: 1 addition & 0 deletions code/datums/status_effects/rogue/roguebuff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
if(iscarbon(owner))
var/mob/living/carbon/C = owner
C.add_stress(/datum/stress_event/drunk)

/datum/status_effect/buff/drunk/on_remove()
. = ..()
if(iscarbon(owner))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/status_effect.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
var/list/effectedstats = list()

/// Variables to create a mob overlay if applicable
var/mob_overlay_icon
var/mob_overlay_icon = 'icons/mob/mob_effects.dmi'
var/mob_overlay_icon_state
var/mob_overlay_layer

Expand Down
1 change: 0 additions & 1 deletion code/datums/wounds/_wound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ GLOBAL_LIST_INIT(primordial_wounds, init_primordial_wounds())
return
to_chat(human_owner, span_danger("I feel horrible... REALLY horrible..."))
MOBTIMER_SET(human_owner, MT_PUKE)
human_owner.vomit(1, blood = TRUE, stun = FALSE)
werewolf_infection_timer = addtimer(CALLBACK(src, PROC_REF(wake_werewolf)), werewolf_infection_time, TIMER_STOPPABLE)
severity = WOUND_SEVERITY_BIOHAZARD
if(bodypart_owner)
Expand Down
24 changes: 12 additions & 12 deletions code/game/atom/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1113,13 +1113,13 @@

/atom/movable/proc/do_item_attack_animation(atom/attacked_atom, visual_effect_icon, obj/item/used_item, animation_type = ATTACK_ANIMATION_SWIPE)
if (visual_effect_icon)
var/image/attack_image = image(icon = 'icons/effects/effects.dmi', icon_state = visual_effect_icon)
attack_image.plane = attacked_atom.plane + 1
var/mutable_appearance/attack_appearance = mutable_appearance('icons/effects/effects.dmi', visual_effect_icon)
attack_appearance.plane = GAME_PLANE
// Scale the icon.
attack_image.transform *= 0.4
attack_appearance.transform *= 0.4
// The icon should not rotate.
attack_image.appearance_flags = APPEARANCE_UI
var/atom/movable/flick_visual/attack = attacked_atom.flick_overlay_view(attack_image, 1 SECONDS)
attack_appearance.appearance_flags = APPEARANCE_UI
var/atom/movable/flick_visual/attack = attacked_atom.flick_overlay_view(attack_appearance, 1 SECONDS)
var/matrix/copy_transform = new(initial(transform))
attack.dir = get_dir(src, attacked_atom)
animate(
Expand All @@ -1140,16 +1140,16 @@
if (!used_item)
return

var/image/attack_image = image(icon = used_item, icon_state = used_item.icon_state)
attack_image.plane = attacked_atom.plane + 1
attack_image.pixel_w = used_item.pixel_x + used_item.pixel_w
attack_image.pixel_z = used_item.pixel_y + used_item.pixel_z
var/mutable_appearance/attack_appearance = mutable_appearance(used_item.icon, used_item.icon_state)
attack_appearance.plane = GAME_PLANE
attack_appearance.pixel_w = used_item.pixel_x + used_item.pixel_w
attack_appearance.pixel_z = used_item.pixel_y + used_item.pixel_z
// Scale the icon.
attack_image.transform *= 0.5
attack_appearance.transform *= 0.5
// The icon should not rotate.
attack_image.appearance_flags = APPEARANCE_UI
attack_appearance.appearance_flags = APPEARANCE_UI

var/atom/movable/flick_visual/attack = attacked_atom.flick_overlay_view(attack_image, 1 SECONDS)
var/atom/movable/flick_visual/attack = attacked_atom.flick_overlay_view(attack_appearance, 1 SECONDS)
var/matrix/copy_transform = new(transform)
var/x_sign = 0
var/y_sign = 0
Expand Down
Loading
Loading