Skip to content

Commit

Permalink
передалал сигналы атак
Browse files Browse the repository at this point in the history
  • Loading branch information
FatFatFat1 committed Sep 17, 2024
1 parent 5b39748 commit 53d6801
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 51 deletions.
11 changes: 8 additions & 3 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
flick(G.hud.icon_state, G.hud)
user.SetNextMove(CLICK_CD_ACTION)
user.visible_message("<span class='danger'>[user] slit [M]'s throat open with \the [name]!</span>")
M.process_aggresive_action(user, "knifed with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
M.log_combat(user, "knifed with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)
return

if (isbrain(M))
Expand All @@ -104,15 +105,19 @@
user.remove_from_mob(src)
M.equip_to_slot_if_possible(src, SLOT_HEAD, disable_warning = TRUE)
user.visible_message("<span class='danger'>[user] slams [name] on the [M]'s head!</span>")
M.process_aggresive_action(user, "slammed with [name] on the head (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(BRUTE)])")
M.log_combat(user, "slammed with [name] on the head (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(BRUTE)])")
if(force > 0)
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)
var/list/data = user.get_unarmed_attack()
// if item has no force just assume attacker smashed his fist (no scratches or any modifiers) against victim's head.
if(user.a_intent in list(INTENT_PUSH, INTENT_GRAB))
M.apply_damage(force + data["damage"], BRUTE, BP_HEAD)
playsound(M, data["sound"], VOL_EFFECTS_MASTER)
return TRUE

M.process_aggresive_action(user, "attacked with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
M.log_combat(user, "attacked with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
if(force > 0)
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)

var/power = force
if(ishuman(user) && damtype == BRUTE)
Expand Down
3 changes: 2 additions & 1 deletion code/datums/components/clickplace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@
INVOKE_ASYNC(victim, TYPE_PROC_REF(/atom/movable, do_simple_move_animation), A.loc, old_loc)
victim.Stun(2)
victim.Weaken(5)
victim.process_aggresive_action(assailant, "laid on [A]")
victim.log_combat(assailant, "laid on [A]")
SEND_SIGNAL(assailant, COMSIG_HUMAN_HARMED_OTHER, victim)
else if(assailant.a_intent != INTENT_HARM)
/// Let's pretend a face-slam doesn't exist.
to_chat(assailant, "<span class='warning'>You need a better grip to do that!</span>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
"<span class='userdanger'>[user] has stunned you with [src]!</span>")
playsound(src, 'sound/weapons/Egloves.ogg', VOL_EFFECTS_MASTER)

L.process_aggresive_action(user, "stunned with <b>[name]</b>")
L.log_combat(user, "stunned with <b>[name]</b>")
return

/obj/item/weapon/abductor_baton/proc/SleepAttack(mob/living/L,mob/living/user)
Expand All @@ -421,7 +421,7 @@
"<span class='userdanger'>You suddenly feel very drowsy!</span>")
playsound(src, 'sound/weapons/Egloves.ogg', VOL_EFFECTS_MASTER)

L.process_aggresive_action(user, "put to sleep with \a [src]")
L.log_combat(user, "put to sleep with \a [src]")
return

/obj/item/weapon/abductor_baton/proc/CuffAttack(mob/living/L,mob/living/user)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/kitchen/gibber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@
addtimer(CALLBACK(src, PROC_REF(gib_mob), user), gibtime)

/obj/machinery/gibber/proc/gib_mob(mob/user)
occupant.process_aggresive_action(user, "gibbed via [name]")

occupant.log_combat(user, "gibbed via [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, occupant)
occupant.ghostize(bancheck = TRUE)

occupant.harvest()
Expand Down
10 changes: 7 additions & 3 deletions code/game/mecha/equipment/tools/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
occupant_message("<span class='warning'>You squeeze [target] with [src.name]. Something cracks.</span>")
chassis.visible_message("<span class='warning'>[chassis] squeezes [target].</span>")

M.process_aggresive_action(chassis.occupant, "attacked via [chassis]'s [name]")
M.log_combat(chassis.occupant, "attacked via [chassis]'s [name]")
SEND_SIGNAL(chassis.occupant, COMSIG_HUMAN_HARMED_OTHER, M)
else
step_away(M,chassis)
occupant_message("You push [target] out of the way.")
Expand Down Expand Up @@ -144,7 +145,8 @@
else if(target.loc == C)
if(isliving(target))
var/mob/living/M = target
M.process_aggresive_action(chassis.occupant, "attacked via [chassis]'s [name]")
M.log_combat(chassis.occupant, "attacked via [chassis]'s [name]")
SEND_SIGNAL(chassis.occupant, COMSIG_HUMAN_HARMED_OTHER, M)

log_message("Drilled through [target]")
target.ex_act(EXPLODE_HEAVY)
Expand Down Expand Up @@ -211,7 +213,9 @@
else if(target.loc == C)
if(isliving(target))
var/mob/living/M = target
M.process_aggresive_action(chassis.occupant, "attacked via [chassis]'s [name]")
M.log_combat(chassis.occupant, "attacked via [chassis]'s [name]")
SEND_SIGNAL(chassis.occupant, COMSIG_HUMAN_HARMED_OTHER, M)

log_message("Drilled through [target]")
target.ex_act(EXPLODE_HEAVY)
return 1
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,8 @@
user.do_attack_animation(M)
playsound(M, 'sound/items/tools/screwdriver-stab.ogg', VOL_EFFECTS_MASTER)

M.process_aggresive_action(user, "eyestabbed with [name]")
M.log_combat(user, "eyestabbed with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)

add_fingerprint(user)
if(M != user)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/devices/scanners/health_analyzer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
used = 0
icon_state = "health"
to_chat(user,"<span class='warning'>Успешное облучение [M].</span>")
M.process_aggresive_action(user, "irradiated with [name]")
M.log_combat(user, "irradiated with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)
spawn((wavelength+(intensity*4))*5)
if(M)
if(intensity >= 5)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/weapons/explosives.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
to_chat(user, "Устанавливает взрывчатку...")
if(ismob(target))
var/mob/living/M = target
M.process_aggresive_action(user, "planted (attempt) with [name]")
M.log_combat(user, "planted (attempt) with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)
user.visible_message("<span class ='red'> [user.name] пытается установить взрывчатку на [M.name]!</span>")
else
user.attack_log += "\[[time_stamp()]\] <font color='red'> [user.real_name] tried planting [name] on [target.name]</font>"
Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/items/weapons/hydroponics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
if(isliving(M))
to_chat(M, "<span class='warning'>You are stunned by the powerful acid of the Deathnettle!</span>")

M.process_aggresive_action(user, "stunned with [name]")
M.log_combat(user, "stunned with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)

playsound(src, 'sound/weapons/bladeslice.ogg', VOL_EFFECTS_MASTER)

Expand Down Expand Up @@ -371,6 +372,7 @@ var/global/gourd_name = null
user.visible_message("<span class='bold warning'>[target] has attacked himself with \a [name]!</span>")

//Attack logs
target.process_aggresive_action(user, "smashed with a [name] (INTENT: [uppertext(user.a_intent)])")
target.log_combat(user, "smashed with a [name] (INTENT: [uppertext(user.a_intent)])")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, target)

qdel(src)
3 changes: 2 additions & 1 deletion code/game/objects/items/weapons/kitchen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
user.Paralyse(2)
return

M.process_aggresive_action(user, "attacked with [name]")
M.log_combat(user, "attacked with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)

var/t = user.get_targetzone()
if (t == BP_HEAD)
Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/items/weapons/makeshift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@
if(!..()) return
H.visible_message("<span class='danger'>[M] has been beaten with the [src] by [user]!</span>")

H.process_aggresive_action(user, "attacked with [name]")
H.log_combat(user, "attacked with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, H)

playsound(src, pick(SOUNDIN_GENHIT), VOL_EFFECTS_MASTER)
else if(!status)
Expand All @@ -206,7 +207,8 @@
deductcharge(hitcost)
H.visible_message("<span class='danger'>[M] has been stunned with the [src] by [user]!</span>")

H.process_aggresive_action(user, "stunned with [name]")
H.log_combat(user, "stunned with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, H)

playsound(src, 'sound/weapons/Egloves.ogg', VOL_EFFECTS_MASTER)
// if(charges < 1)
Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/items/weapons/swords_axes_etc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
add_fingerprint(user)

user.visible_message("<span class='warning'><B>[M] has been stunned with \the [src] by [user]!</B></span>", blind_message = "<span class='warning'>You hear someone fall</span>")
M.process_aggresive_action(user, "attacked with [name] (INTENT: [uppertext(user.a_intent)])")
M.log_combat(user, "attacked with [name] (INTENT: [uppertext(user.a_intent)])")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)

//Telescopic baton
/obj/item/weapon/melee/telebaton
Expand Down Expand Up @@ -232,7 +233,8 @@
playsound(src, 'sound/weapons/hit_metalic.ogg', VOL_EFFECTS_MASTER)
user.do_attack_animation(H)
H.visible_message("<span class='warning'>[user] hit [H] harmlessly with a telebaton.</span>")
H.process_aggresive_action(user, "hit harmlessly with [name]")
H.log_combat(user, "hit harmlessly with [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, H)
return
if(..())
L.apply_effect(30, AGONY, target_armor)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@
visible_message("<span class='danger'>[assailant] slams [victim]'s face against \the [src], breaking it!</span>")
playsound(src, 'sound/weapons/tablehit1.ogg', VOL_EFFECTS_MASTER)

victim.process_aggresive_action(assailant, "face-slammed against [name]")
victim.log_combat(assailant, "face-slammed against [name]")
SEND_SIGNAL(assailant, COMSIG_HUMAN_HARMED_OTHER,victim)

if(prob(30) && ishuman(victim))
var/mob/living/carbon/human/H = victim
Expand Down
9 changes: 6 additions & 3 deletions code/game/objects/structures/windows/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,25 @@
take_damage(7, BRUTE, MELEE)
visible_message("<span class='danger'>[A] slams [M] against \the [src]!</span>")

M.process_aggresive_action(user, "slammed against [name]")
M.log_combat(user, "slammed against [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)
if(2)
if (prob(50))
M.Stun(1)
M.Weaken(1)
M.apply_damage(8)
take_damage(9, BRUTE, MELEE)
visible_message("<span class='danger'>[A] bashes [M] against \the [src]!</span>")
M.process_aggresive_action(user, "bashed against [name]")
M.log_combat(user, "bashed against [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)
if(3)
M.Stun(5)
M.Weaken(5)
M.apply_damage(20)
take_damage(12, BRUTE, MELEE)
visible_message("<span class='danger'><big>[A] crushes [M] against \the [src]!</big></span>")
M.process_aggresive_action(user, "crushed against [name]")
M.log_combat(user, "crushed against [name]")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, M)
return

return ..()
Expand Down
3 changes: 2 additions & 1 deletion code/modules/clothing/gloves/power_gloves.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
var/obj/item/organ/external/BP = H.get_bodypart(attacker.get_targetzone())
calc_power *= H.get_siemens_coefficient_organ(BP)
L.visible_message("<span class='warning bold'>[L] has been touched with the gloves by [attacker]!</span>")
L.process_aggresive_action(attacker, "stungloved with [name]")
L.log_combat(attacker, "stungloved with [name]")
SEND_SIGNAL(attacker, COMSIG_HUMAN_HARMED_OTHER, L)
L.apply_damage(calc_power, HALLOSS)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread()
s.set_up(3, 1, L)
Expand Down
18 changes: 5 additions & 13 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
if(alert_admins)
msg_admin_attack("[key_name(src)] has been [msg], by [key_name(attacker)][redirected ? " (redirected)" : ""]", attacker)

/mob/living/proc/process_aggresive_action(mob/living/attacker, msg, alert_admins=TRUE, redirected=FALSE)
if(ishuman(attacker))
var/mob/living/carbon/human/H = attacker
var/obj/item/item_in_hand = H.get_active_hand()
if(item_in_hand)
if(item_in_hand.force > 0)
SEND_SIGNAL(H, COMSIG_HUMAN_HARMED_OTHER, src)
else
SEND_SIGNAL(H, COMSIG_HUMAN_HARMED_OTHER, src)
log_combat(attacker, msg, alert_admins=alert_admins, redirected=redirected)

/mob/living/proc/run_armor_check(def_zone = null, attack_flag = MELEE, absorb_text = null, soften_text = null)
var/armor = getarmor(def_zone, attack_flag)
if(armor >= 100)
Expand Down Expand Up @@ -79,7 +68,8 @@
visible_message("<span class='userdanger'>[name] is hit by the [P.name] in the [parse_zone(def_zone)]!</span>")
//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
if(P.firer)
process_aggresive_action(P.firer, "shot with <b>[P.type]</b>", alert_admins = !P.fake, redirected = P.redirected)
log_combat(P.firer, "shot with <b>[P.type]</b>", alert_admins = !P.fake, redirected = P.redirected)
SEND_SIGNAL(P.firer, COMSIG_HUMAN_HARMED_OTHER, src)
else
attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT</b> shot <b>[src]/[ckey]</b> with a <b>[src]</b>"
if(!P.fake)
Expand Down Expand Up @@ -156,7 +146,9 @@
if(L)
var/client/assailant = L.client
if(assailant)
process_aggresive_action(L, "hit with thrown [O]")
log_combat(L, "hit with thrown [O]")
if(throw_damage > 0)
SEND_SIGNAL(L, COMSIG_HUMAN_HARMED_OTHER, src)

// Begin BS12 momentum-transfer code.
if(O.throw_source && AM.fly_speed >= 15)
Expand Down
14 changes: 9 additions & 5 deletions code/modules/mob/mob_grab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
var/start_T_descriptor = "<font color='#6b5d00'>tile at [COORD(start_T)] in area [get_area(start_T)]</font>"
var/end_T_descriptor = "<font color='#6b4400'>tile at [COORD(end_T)] in area [get_area(end_T)]</font>"

L.process_aggresive_action(usr, "thrown from [start_T_descriptor] with the target [end_T_descriptor]")
L.log_combat(usr, "thrown from [start_T_descriptor] with the target [end_T_descriptor]")

qdel(src)

Expand Down Expand Up @@ -386,7 +386,8 @@
assailant.visible_message("<span class='warning'>[assailant] has reinforced \his grip on [affecting] (now neck)!</span>")
assailant.set_dir(get_dir(assailant, affecting))

affecting.process_aggresive_action(assailant, "neck-grabbed")
affecting.log_combat(assailant, "neck-grabbed")
SEND_SIGNAL(assailant, COMSIG_HUMAN_HARMED_OTHER, affecting)

affecting.Stun(10) //10 ticks of ensured grab
set_state(GRAB_NECK)
Expand All @@ -400,7 +401,8 @@

assailant.visible_message("<span class='danger'>[assailant] has tightened \his grip on [affecting]'s neck!</span>")

affecting.process_aggresive_action(assailant, "strangled")
affecting.log_combat(assailant, "strangled")
SEND_SIGNAL(assailant, COMSIG_HUMAN_HARMED_OTHER, affecting)

affecting.losebreath += 1
affecting.set_dir(WEST)
Expand Down Expand Up @@ -492,7 +494,8 @@
assailant.visible_message("<span class='danger'>[assailant] pressed \his fingers into [affecting]'s eyes!</span>")
to_chat(affecting, "<span class='danger'>You experience immense pain as you feel digits being pressed into your eyes!</span>")

affecting.process_aggresive_action(assailant, "finger-pressed into the eyes")
affecting.log_combat(assailant, "finger-pressed into the eyes")
SEND_SIGNAL(assailant, COMSIG_HUMAN_HARMED_OTHER, affecting)

var/obj/item/organ/internal/eyes/IO = affecting:organs_by_name[O_EYES]
IO.damage += rand(3,4)
Expand Down Expand Up @@ -545,7 +548,8 @@
affecting.visible_message("<span class='danger'>[affecting] has been knocked unconscious!</span>")
playsound(assailant, pick(SOUNDIN_GENHIT), VOL_EFFECTS_MASTER)

affecting.process_aggresive_action(assailant, "headbutted")
affecting.log_combat(assailant, "headbutted")
SEND_SIGNAL(assailant, COMSIG_HUMAN_HARMED_OTHER, affecting)

assailant.drop_from_inventory(src)
src.loc = null
Expand Down
4 changes: 3 additions & 1 deletion code/modules/organs/organ_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,9 @@ Note that amputating the affected organ does in fact remove the infection from t
to_chat(brainmob, "<span class='warning'>[user] severs your brain's connection to the spine with [I]!</span>")
to_chat(user, "<span class='warning'>You sever [brainmob]'s brain's connection to the spine with [I]!</span>")

brainmob.process_aggresive_action(user, "debrained with [I.name] (INTENT: [uppertext(user.a_intent)])")
brainmob.log_combat(user, "debrained with [I.name] (INTENT: [uppertext(user.a_intent)])")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, brainmob)


if(istype(src,/obj/item/organ/external/head/robot))
var/obj/item/device/mmi/posibrain/B = new(loc)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/surgery/braincore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
if(borer)
borer.detatch() //Should remove borer if the brain is removed - RR

target.process_aggresive_action(user, "debrained with [tool.name] (INTENT: [uppertext(user.a_intent)])")

target.log_combat(user, "debrained with [tool.name] (INTENT: [uppertext(user.a_intent)])")
SEND_SIGNAL(user, COMSIG_HUMAN_HARMED_OTHER, target)
var/obj/item/brain/B
B = new(target.loc)
B.transfer_identity(target)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/unarmed_combat/combos/harmful.dm
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@
var/turf/end_T = target
var/end_T_descriptor = "<font color='#6b4400'>tile at [COORD(end_T)] in area [get_area(end_T)]</font>"

M.process_aggresive_action(attacker, "throwm from [start_T_descriptor] with the target [end_T_descriptor]")

M.log_combat(attacker, "throwm from [start_T_descriptor] with the target [end_T_descriptor]")
SEND_SIGNAL(attacker, COMSIG_HUMAN_HARMED_OTHER, M)
M.throw_at(target, 6, 8, attacker)
apply_effect(3, STUN, M, attacker, attack_obj=attack_obj, min_value=1)
apply_effect(7, WEAKEN, M, attacker, attack_obj=attack_obj, min_value=1)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/unarmed_combat/living_procs_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@
visible_message("<span class='warning'><B>[attacker] tried to [damVerb] [src]!</B></span>")
return FALSE

process_aggresive_action(attacker, "[damVerb]ed")
log_combat(attacker, "[damVerb]ed")
SEND_SIGNAL(attacker, COMSIG_HUMAN_HARMED_OTHER, src)

var/armor_block = 0
var/obj/item/organ/external/BP = attacker.get_targetzone() // apply_damage accepts both the bodypart and the zone.
Expand Down
3 changes: 2 additions & 1 deletion code/modules/vehicles/spacebike.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
unload(Driver)
visible_message("<span class='danger'>[Driver] drives over [L]!</span>")

L.process_aggresive_action(Driver, "driven over with [src]")
L.log_combat(Driver, "driven over with [src]")
SEND_SIGNAL(Driver, COMSIG_HUMAN_HARMED_OTHER, L)

playsound(src, 'sound/effects/splat.ogg', VOL_EFFECTS_MASTER)
L.stop_pulling()
Expand Down

0 comments on commit 53d6801

Please sign in to comment.