Made some slightly less uglier sprites for attack effects.dmi

Melee attacks, gun firing, and things being hit by bullets will now still give witnesses a message, but only if they are less than 3 tiles away. The attacker still doesn't get the message for its own attacks.

I added two arguments to visible_message(), one to specify the visibility range, and one to ignore a specific mob that shouldn't get the message.
This commit is contained in:
phil235
2016-10-15 16:10:28 +02:00
committed by phil235
parent 43812be1b0
commit f9c71fbfb0
26 changed files with 129 additions and 86 deletions
+5 -1
View File
@@ -55,6 +55,9 @@
return
/obj/attacked_by(obj/item/I, mob/living/user)
if(I.force)
visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>", null, null, 2, user)
//only witnesses close by and the victim see a hit message.
take_damage(I.force, I.damtype, "melee", 1)
/mob/living/attacked_by(obj/item/I, mob/living/user)
@@ -101,6 +104,7 @@
var/attack_message = "[src] has been [message_verb][message_hit_area] with [I]."
if(user in viewers(src, null))
attack_message = "[user] has [message_verb] [src][message_hit_area] with [I]!"
src << "<span class='userdanger'>[attack_message]</span>"
visible_message("<span class='danger'>[attack_message]</span>", \
"<span class='userdanger'>[attack_message]</span>", null, 2,user)
return 1
+8 -4
View File
@@ -46,7 +46,8 @@
if(!damage)
playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1)
D << "<span class='warning'>[A] has attempted to [atk_verb] [D]!</span>"
D.visible_message("<span class='warning'>[A] has attempted to [atk_verb] [D]!</span>", \
"<span class='userdanger'>[A] has attempted to [atk_verb] [D]!</span>", null, 2, A)
add_logs(A, D, "attempted to [atk_verb]")
return 0
@@ -54,7 +55,8 @@
var/armor_block = D.run_armor_check(affecting, "melee")
playsound(D.loc, A.dna.species.attack_sound, 25, 1, -1)
D << "<span class='userdanger'>[A] has [atk_verb]ed [D]!</span>"
D.visible_message("<span class='danger'>[A] has [atk_verb]ed [D]!</span>", \
"<span class='userdanger'>[A] has [atk_verb]ed [D]!</span>", null, 2, A)
D.apply_damage(damage, BRUTE, affecting, armor_block)
@@ -105,7 +107,8 @@
var/damage = rand(5, 8) + A.dna.species.punchdamagelow
if(!damage)
playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1)
D << "<span class='warning'>[A] has attempted to hit [D] with a [atk_verb]!</span>"
D.visible_message("<span class='warning'>[A] has attempted to [atk_verb] [D]!</span>", \
"<span class='userdanger'>[A] has attempted to [atk_verb] [D]!</span>", null, 2, A)
add_logs(A, D, "attempted to hit", atk_verb)
return 0
@@ -115,7 +118,8 @@
playsound(D.loc, A.dna.species.attack_sound, 25, 1, -1)
D << "<span class='userdanger'>[A] has hit [D] with a [atk_verb]!</span>"
D.visible_message("<span class='danger'>[A] has [atk_verb]ed [D]!</span>", \
"<span class='userdanger'>[A] has [atk_verb]ed [D]!</span>", null, 2, A)
D.apply_damage(damage, STAMINA, affecting, armor_block)
add_logs(A, D, "punched (boxing) ")
@@ -129,7 +129,8 @@
if(user in viewers(src, null))
attack_message = "[user] has [message_verb] [src] with [I]!"
if(message_verb)
src << "<span class='userdanger'>[attack_message]</span>"
visible_message("<span class='danger'>[attack_message]</span>",
"<span class='userdanger'>[attack_message]</span>", null, 2, user)
return TRUE
/mob/living/carbon/true_devil/Process_Spacemove(movement_dir = 0)
+1
View File
@@ -247,6 +247,7 @@ Class Procs:
else
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
user.visible_message("<span class='danger'>[user.name] smashes against \the [src.name] with its paws.</span>", null, null, 2, user)
take_damage(4, BRUTE, "melee", 1)
+2
View File
@@ -56,6 +56,7 @@
user.changeNext_move(CLICK_CD_MELEE) // Ugh. Ideally we shouldn't be setting cooldowns outside of click code.
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
playsound(loc, 'sound/weapons/tap.ogg', 40, 1, -1)
user.visible_message("<span class='danger'>[user] hits [name]. Nothing happens</span>", null, null, 2, user)
log_message("Attack by hand/paw. Attacker - [user].",1)
log_append_to_last("Armor saved.")
@@ -93,6 +94,7 @@
log_message("Attack by hulk. Attacker - [user].",1)
user.changeNext_move(CLICK_CD_MELEE)
add_logs(user, src, "punched", "hulk powers")
user.visible_message("<span class='danger'>[user] hits [name]. The metal creaks and bends.</span>", null, null, 2, user)
user.do_attack_animation(src, ATTACK_EFFECT_SMASH)
take_damage(15, BRUTE, "melee", 0, get_dir(src, user))
return 1
+3
View File
@@ -63,12 +63,14 @@
/obj/bullet_act(obj/item/projectile/P)
. = ..()
playsound(src, P.hitsound, 50, 1)
visible_message("<span class='danger'>[src] is hit by \a [P]!</span>", null, null, 2)
take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180))
/obj/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0)
if(user.a_intent == "harm")
..(user, 1)
visible_message("<span class='danger'>[user] smashes [src]!</span>", null, null, 2, user)
if(density)
playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
@@ -132,6 +134,7 @@
return 0
else
return 0
visible_message("<span class='danger'>[M.name] has hit [src].</span>", null, null, 2, M.occupant)
return take_damage(M.force*3, mech_damtype, "melee", play_soundeffect, get_dir(src, M)) // multiplied by 3 so we can hit objs hard but not be overpowered against mobs.
/obj/singularity_act()
@@ -161,6 +161,7 @@
//prevents remote "kicks" with TK
if (!Adjacent(user))
return
user.visible_message("<span class='danger'>[user] kicks the display case.</span>", null, null, 2, user)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
take_damage(2)
+2
View File
@@ -43,12 +43,14 @@
/obj/structure/grille/attack_hand(mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
user.visible_message("<span class='warning'>[user] hits [src].</span>", null, null, 2, user)
if(!shock(user, 70))
take_damage(rand(5,10), BRUTE, "melee", 1)
/obj/structure/grille/attack_alien(mob/living/user)
user.do_attack_animation(src)
user.changeNext_move(CLICK_CD_MELEE)
user.visible_message("<span class='warning'>[user] mangles [src].</span>", null, null, 2, user)
if(!shock(user, 70))
take_damage(20, BRUTE, "melee", 1)
@@ -439,6 +439,7 @@
/obj/structure/rack/attack_hand(mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
user.visible_message("<span class='danger'>[user] kicks [src].</span>", null, null, 2, user)
take_damage(rand(4,8), BRUTE, "melee", 1)
+1
View File
@@ -89,6 +89,7 @@
switch(M.damtype)
if(BRUTE)
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
visible_message("<span class='danger'>[M.name] has hit [src]!</span>", null, null, 2, M.occupant)
if(prob(hardness + M.force) && M.force > 20)
dismantle_wall(1)
playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1)
+2 -1
View File
@@ -120,7 +120,8 @@
if(answer == "Yes")
card.removePersonality()
var/turf/T = get_turf(src.loc)
T.visible_message("<span class='notice'>[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"</span>", "<span class='notice'>[src] bleeps electronically.</span>")
T.visible_message("<span class='notice'>[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"</span>", null, \
"<span class='notice'>[src] bleeps electronically.</span>")
death(0)
else
src << "Aborting suicide attempt."
@@ -35,7 +35,8 @@ In all, this is a lot like the monkey code. /N
if (health > 0)
M.do_attack_animation(src, ATTACK_EFFECT_BITE)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
src << "<span class='userdanger'>[M.name] bites [src]!</span>"
visible_message("<span class='danger'>[M.name] bites [src]!</span>", \
"<span class='userdanger'>[M.name] bites [src]!</span>", null, 2, M)
adjustBruteLoss(1)
add_logs(M, src, "attacked")
updatehealth()
@@ -17,7 +17,7 @@
hitverb = "slammed"
playsound(loc, "punch", 25, 1, -1)
visible_message("<span class='danger'>[user] has [hitverb] [src]!</span>", \
"<span class='userdanger'>[user] has [hitverb] [src]!</span>")
"<span class='userdanger'>[user] has [hitverb] [src]!</span>", null, 2, user)
return 1
/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M)
@@ -27,7 +27,8 @@
var/damage = rand(1, 9)
if (prob(90))
playsound(loc, "punch", 25, 1, -1)
src << "<span class='userdanger'>[M] has punched [src]!</span>"
visible_message("<span class='danger'>[M] has punched [src]!</span>", \
"<span class='userdanger'>[M] has punched [src]!</span>", null, 2, M)
if ((stat != DEAD) && (damage > 9 || prob(5)))//Regular humans have a very small chance of weakening an alien.
Paralyse(2)
visible_message("<span class='danger'>[M] has weakened [src]!</span>", \
@@ -37,7 +38,8 @@
add_logs(M, src, "attacked")
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
src << "<span class='userdanger'>[M] has attempted to punch [src]!</span>"
visible_message("<span class='userdanger'>[M] has attempted to punch [src]!</span>", \
"<span class='userdanger'>[M] has attempted to punch [src]!</span>", null, 2, M)
if ("disarm")
if (!lying)
@@ -51,10 +53,12 @@
if (prob(50))
drop_item()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
src << "<span class='userdanger'>[M] has disarmed [src]!</span>"
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
"<span class='userdanger'>[M] has disarmed [src]!</span>", null, 2, M)
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
src << "<span class='userdanger'>[M] has attempted to disarm [src]!</span>"
visible_message("<span class='userdanger'>[M] has attempted to disarm [src]!</span>",\
"<span class='userdanger'>[M] has attempted to disarm [src]!</span>", null, 2, M)
@@ -6,7 +6,8 @@
if (prob(90))
playsound(loc, "punch", 25, 1, -1)
add_logs(M, src, "attacked")
src << "<span class='userdanger'>[M] has kicked [src]!</span>"
visible_message("<span class='danger'>[M] has kicked [src]!</span>", \
"<span class='userdanger'>[M] has kicked [src]!</span>", null, 2, M)
if ((stat != DEAD) && (damage > 4.9))
Paralyse(rand(5,10))
@@ -14,7 +15,8 @@
apply_damage(damage, BRUTE, affecting)
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
src << "<span class='userdanger'>[M] has attempted to kick [src]!</span>"
visible_message("<span class='danger'>[M] has attempted to kick [src]!</span>", \
"<span class='userdanger'>[M] has attempted to kick [src]!</span>", null, 2, M)
/mob/living/carbon/alien/larva/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0)
if(user.a_intent == "harm")
@@ -331,7 +331,8 @@
update_damage_overlays()
updatehealth()
src << "<span class='userdanger'>[M.name] has hit [src]!</span>"
visible_message("<span class='danger'>[M.name] has hit [src]!</span>", \
"<span class='userdanger'>[M.name] has hit [src]!</span>", null, 2, M.occupant)
add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
else
@@ -985,7 +985,8 @@
if(!damage || !affecting)
playsound(target.loc, user.dna.species.miss_sound, 25, 1, -1)
target << "<span class='userdanger'>[user] has attempted to [atk_verb] [target]!</span>"
target.visible_message("<span class='danger'>[user] has attempted to [atk_verb] [target]!</span>",\
"<span class='userdanger'>[user] has attempted to [atk_verb] [target]!</span>", null, 2, user)
return 0
@@ -993,7 +994,8 @@
playsound(target.loc, user.dna.species.attack_sound, 25, 1, -1)
target << "<span class='userdanger'>[user] has [atk_verb]ed [target]!</span>"
target.visible_message("<span class='danger'>[user] has [atk_verb]ed [target]!</span>", \
"<span class='userdanger'>[user] has [atk_verb]ed [target]!</span>", null, 2, user)
if(user.limb_destroyer)
target.dismembering_strike(user, affecting.body_zone)
@@ -1020,7 +1022,8 @@
var/randn = rand(1, 100)
if(randn <= 25)
playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
target << "<span class='userdanger'>[user] has pushed [target]!</span>"
target.visible_message("<span class='danger'>[user] has pushed [target]!</span>",
"<span class='userdanger'>[user] has pushed [target]!</span>", null, 2, user)
target.apply_effect(2, WEAKEN, target.run_armor_check(affecting, "melee", "Your armor prevents your fall!", "Your armor softens your fall!"))
target.forcesay(hit_appends)
return
@@ -1037,13 +1040,15 @@
if(!talked) //BubbleWrap
if(target.drop_item())
target << "<span class='userdanger'>[user] has disarmed [target]!</span>"
target.visible_message("<span class='danger'>[user] has disarmed [target]!</span>", \
"<span class='userdanger'>[user] has disarmed [target]!</span>", null, 2, user)
playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
playsound(target, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
target << "<span class='userdanger'>[user] attemped to disarm [target]!</span>"
target.visible_message("<span class='danger'>[user] attempted to disarm [target]!</span>", \
"<span class='userdanger'>[user] attemped to disarm [target]!</span>", null, 2, user)
/datum/species/proc/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style = M.martial_art)
@@ -51,7 +51,8 @@
if("harm")
M.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
if (prob(75))
src << "<span class='userdanger'>[M] has punched [name]!</span>"
visible_message("<span class='danger'>[M] has punched [name]!</span>", \
"<span class='userdanger'>[M] has punched [name]!</span>", null, 2, M)
playsound(loc, "punch", 25, 1, -1)
var/damage = rand(5, 10)
@@ -60,7 +61,7 @@
if ( (paralysis < 5) && (health > 0) )
Paralyse(rand(10, 15))
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
"<span class='userdanger'>[M] has knocked out [name]!</span>")
"<span class='userdanger'>[M] has knocked out [name]!</span>", null, 5)
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
if(!affecting)
affecting = get_bodypart("chest")
@@ -70,7 +71,8 @@
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
src << "<span class='userdanger'>[M] has attempted to punch [name]!</span>"
visible_message("<span class='danger'>[M] has attempted to punch [name]!</span>", \
"<span class='userdanger'>[M] has attempted to punch [name]!</span>", null, 2, M)
if("disarm")
if (!paralysis)
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
@@ -78,11 +80,13 @@
Paralyse(2)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
add_logs(M, src, "pushed")
src << "<span class='userdanger'>[M] has pushed down [src]!</span>"
visible_message("<span class='danger'>[M] has pushed down [src]!</span>", \
"<span class='userdanger'>[M] has pushed down [src]!</span>", null, 2, M)
else
if(drop_item())
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
src << "<span class='userdanger'>[M] has disarmed [src]!</span>"
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
"<span class='userdanger'>[M] has disarmed [src]!</span>", null, 2, M)
/mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M)
if(..()) //if harm or disarm intent.
@@ -94,9 +98,11 @@
damage = rand(20, 40)
if (paralysis < 15)
Paralyse(rand(10, 15))
src << "<span class='userdanger'>[M] has wounded [name]!</span>"
visible_message("<span class='danger'>[M] has wounded [name]!</span>", \
"<span class='userdanger'>[M] has wounded [name]!</span>", null, 2, M)
else
src << "<span class='userdanger'>[M] has slashed [name]!</span>"
visible_message("<span class='danger'>[M] has slashed [name]!</span>", \
"<span class='userdanger'>[M] has slashed [name]!</span>", null, 2, M)
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
add_logs(M, src, "attacked")
@@ -109,16 +115,19 @@
else
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
src << "<span class='userdanger'>[M] has attempted to lunge at [name]!</span>"
visible_message("<span class='danger'>[M] has attempted to lunge at [name]!</span>", \
"<span class='userdanger'>[M] has attempted to lunge at [name]!</span>", null, 2, M)
if (M.a_intent == "disarm")
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
if(prob(95))
Weaken(10)
src << "<span class='userdanger'>[M] has tackled down [name]!</span>"
visible_message("<span class='danger'>[M] has tackled down [name]!</span>", \
"<span class='userdanger'>[M] has tackled down [name]!</span>", null, 2, M)
else
if(drop_item())
src << "<span class='userdanger'>[M] has disarmed [name]!</span>"
visible_message("<span class='danger'>[M] has disarmed [name]!</span>", \
"<span class='userdanger'>[M] has disarmed [name]!</span>", null, 2, M)
add_logs(M, src, "disarmed")
updatehealth()
+15 -8
View File
@@ -109,12 +109,13 @@
else
return
updatehealth()
src << "<span class='userdanger'>[M.name] has hit [src]!</span>"
visible_message("<span class='danger'>[M.name] has hit [src]!</span>", \
"<span class='userdanger'>[M.name] has hit [src]!</span>", null, 2, M.occupant)
add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
else
step_away(src,M)
add_logs(M.occupant, src, "pushed", M)
visible_message("<span class='warning'>[M] pushes [src] out of the way.</span>")
visible_message("<span class='warning'>[M] pushes [src] out of the way.</span>", null, null, 5)
/mob/living/fire_act()
adjust_fire_stacks(3)
@@ -183,7 +184,8 @@
if (stat != DEAD)
add_logs(M, src, "attacked")
M.do_attack_animation(src)
src << "<span class='userdanger'>The [M.name] glomps [src]!</span>"
visible_message("<span class='danger'>The [M.name] glomps [src]!</span>", \
"<span class='userdanger'>The [M.name] glomps [src]!</span>", null, 2, M)
return 1
/mob/living/attack_animal(mob/living/simple_animal/M)
@@ -195,7 +197,8 @@
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
M.do_attack_animation(src)
src << "<span class='userdanger'>\The [M] [M.attacktext] [src]!</span>"
visible_message("<span class='danger'>\The [M] [M.attacktext] [src]!</span>", \
"<span class='userdanger'>\The [M] [M.attacktext] [src]!</span>", null, 2, M)
add_logs(M, src, "attacked")
return 1
@@ -213,10 +216,12 @@
if (prob(75))
add_logs(M, src, "attacked")
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
src << "<span class='userdanger'>[M.name] bites [src]!</span>"
visible_message("<span class='danger'>[M.name] bites [src]!</span>", \
"<span class='userdanger'>[M.name] bites [src]!</span>", null, 2, M)
return 1
else
src << "<span class='userdanger'>[M.name] has attempted to bite [src]!</span>"
visible_message("<span class='danger'>[M.name] has attempted to bite [src]!</span>", \
"<span class='userdanger'>[M.name] has attempted to bite [src]!</span>", null, 2, M)
return 0
/mob/living/attack_larva(mob/living/carbon/alien/larva/L)
@@ -229,11 +234,13 @@
L.do_attack_animation(src)
if(prob(90))
add_logs(L, src, "attacked")
src << "<span class='userdanger'>[L.name] bites [src]!</span>"
visible_message("<span class='danger'>[L.name] bites [src]!</span>", \
"<span class='userdanger'>[L.name] bites [src]!</span>", null, 2, L)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
return 1
else
src << "<span class='userdanger'>[L.name] has attempted to bite [src]!</span>"
visible_message("<span class='danger'>[L.name] has attempted to bite [src]!</span>", \
"<span class='userdanger'>[L.name] has attempted to bite [src]!</span>", null, 2, L)
return 0
/mob/living/attack_alien(mob/living/carbon/alien/humanoid/M)
@@ -11,13 +11,15 @@
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
if(get_active_held_item())
uneq_active()
src << "<span class='userdanger'>[M] has disabled [src]'s active module!</span>"
visible_message("<span class='danger'>[M] disarmed [src]!</span>", \
"<span class='userdanger'>[M] has disabled [src]'s active module!</span>", null, 2, M)
add_logs(M, src, "disarmed")
else
Stun(2)
step(src,get_dir(M,src))
add_logs(M, src, "pushed")
src << "<span class='userdanger'>[M] has forced back [src]!</span>"
visible_message("<span class='danger'>[M] has forced back [src]!</span>", \
"<span class='userdanger'>[M] has forced back [src]!</span>", null, 2, M)
playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
else
..()
@@ -68,7 +68,8 @@
else
M.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
playsound(src.loc, 'sound/effects/bang.ogg', 10, 1)
src << "<span class='warning'>[M] punches [src], but doesn't leave a dent.</span>"
visible_message("<span class='danger'>[M] punches [src], but doesn't leave a dent.</span>", \
"<span class='warning'>[M] punches [src], but doesn't leave a dent.</span>", null, 2, M)
return 0
/mob/living/silicon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
@@ -14,7 +14,8 @@
if("harm", "disarm")
M.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
src << "<span class='userdanger'>[M] [response_harm] [src]!</span>"
visible_message("<span class='danger'>[M] [response_harm] [src]!</span>",\
"<span class='userdanger'>[M] [response_harm] [src]!</span>", null, 2, M)
playsound(loc, attacked_sound, 25, 1, -1)
attack_threshold_check(harm_intent_damage)
add_logs(M, src, "attacked")
@@ -25,7 +26,8 @@
if(user.a_intent == "harm")
..(user, 1)
playsound(loc, "punch", 25, 1, -1)
src << "<span class='userdanger'>[user] has punched [src]!</span>"
visible_message("<span class='danger'>[user] has punched [src]!</span>", \
"<span class='userdanger'>[user] has punched [src]!</span>", null, 2, user)
adjustBruteLoss(15)
return 1
@@ -45,11 +47,13 @@
if(..()) //if harm or disarm intent.
if(M.a_intent == "disarm")
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
src << "<span class='userdanger'>[M] [response_disarm] [name]!</span>"
visible_message("<span class='danger'>[M] [response_disarm] [name]!</span>", \
"<span class='userdanger'>[M] [response_disarm] [name]!</span>", null, 2, M)
add_logs(M, src, "disarmed")
else
var/damage = rand(15, 30)
src << "<span class='userdanger'>[M] has slashed at [src]!</span>"
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
"<span class='userdanger'>[M] has slashed at [src]!</span>", null, 2, M)
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
attack_threshold_check(damage)
add_logs(M, src, "attacked")
+16 -34
View File
@@ -83,63 +83,45 @@ var/next_mob_id = 0
else
src << msg
// Show a message the src mob and to all player mobs who sees the src mob
// This would be for visible actions by the src mob
// message is the message output to anyone who can see e.g. "[src] does something!"
// Show a message to all player mobs who sees this atom
// Show a message to the src mob (if the src is a mob)
// Use for atoms performing visible actions
// message is output to anyone who can see, e.g. "The [src] does something!"
// self_message (optional) is what the src mob sees e.g. "You do something!"
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
// vision_distance (optional) define how many tiles away the message can be seen.
// ignored_mob (optional) doesn't show any message to a given mob if TRUE.
/mob/visible_message(message, self_message, blind_message)
/atom/proc/visible_message(message, self_message, blind_message, vision_distance, ignored_mob)
var/turf/T = get_turf(src)
if(!T)
return
for(var/mob/M in get_hearers_in_view(7, src))
var/range = 7
if(vision_distance)
range = vision_distance
for(var/mob/M in get_hearers_in_view(range, src))
if(!M.client)
continue
if(M == ignored_mob)
continue
var/msg = message
if(M == src) //the src always see the main message or self message
if(self_message)
msg = self_message
else
if(M.see_invisible<invisibility || T != loc) //if src is inside something or invisible to us,
if(M.see_invisible<invisibility || (T != loc && T != src))//if src is invisible to us or is inside something (and isn't a turf),
if(blind_message) // then people see blind message if there is one, otherwise nothing.
msg = blind_message
else
continue
else if(T.lighting_object)
if(T.lighting_object.invisibility <= M.see_invisible && !T.lighting_object.luminosity)
if(blind_message) //if the light object is dark and not invisible to us, we see blind_message/nothing
if(T.lighting_object.invisibility <= M.see_invisible && !T.lighting_object.luminosity) //the light object is dark and not invisible to us
if(blind_message)
msg = blind_message
else
continue
M.show_message(msg,1,blind_message,2)
// Show a message to all player mobs who sees this atom
// Use for objects performing visible actions
// message is output to anyone who can see, e.g. "The [src] does something!"
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
/atom/proc/visible_message(message, blind_message)
var/turf/T = get_turf(src)
if(!T)
return
for(var/mob/M in get_hearers_in_view(7, src))
if(!M.client)
continue
var/msg = message
if(M.see_invisible<invisibility || (T != loc && T != src))//if src is invisible to us or is inside something (and isn't a turf),
if(blind_message) // then people see blind message if there is one, otherwise nothing.
msg = blind_message
else
continue
else if(T.lighting_object)
if(T.lighting_object.invisibility <= M.see_invisible && !T.lighting_object.luminosity) //the light object is dark and not invisible to us
if(blind_message)
msg = blind_message
else
continue
M.show_message(msg,1,blind_message,2)
// Show a message to all mobs in earshot of this one
// This would be for audible actions by the src mob
// message is the message output to anyone who can hear.
@@ -300,13 +300,13 @@
radiation_pulse(get_turf(src), 1, 1, 150, 1)
/obj/machinery/power/supermatter_shard/Bumped(atom/AM as mob|obj)
/obj/machinery/power/supermatter_shard/Bumped(atom/AM)
if(isliving(AM))
AM.visible_message("<span class='danger'>\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.</span>",\
"<span class='userdanger'>You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class='italics'>You hear an unearthly noise as a wave of heat washes over you.</span>")
else if(isobj(AM) && !istype(AM, /obj/effect))
AM.visible_message("<span class='danger'>\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
AM.visible_message("<span class='danger'>\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>", null,\
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
else
return
+6 -3
View File
@@ -77,7 +77,7 @@
G.loc = loc
qdel(G.pin)
G.pin = null
visible_message("[G] can now fit a new pin, but old one was destroyed in the process.")
visible_message("[G] can now fit a new pin, but old one was destroyed in the process.", null, null, 3)
qdel(src)
/obj/item/weapon/gun/examine(mob/user)
@@ -113,8 +113,11 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
if(!message)
return
if(message)
if(pointblank)
user.visible_message("<span class='danger'>[user] fires [src] point blank at [pbtarget]!</span>", null, null, 2, user)
else
user.visible_message("<span class='danger'>[user] fires [src]!</span>", null, null, 2, user)
if(weapon_weight >= WEAPON_MEDIUM)
if(user.get_inactive_held_item())
+2 -1
View File
@@ -106,7 +106,8 @@
if(hitsound)
var/volume = vol_by_damage()
playsound(loc, hitsound, volume, 1, -1)
L << "<span class='userdanger'>[L] is hit by \a [src][organ_hit_text]!</span>"
L.visible_message("<span class='danger'>[L] is hit by \a [src][organ_hit_text]!</span>", \
"<span class='userdanger'>[L] is hit by \a [src][organ_hit_text]!</span>", null, 2)
L.on_hit(type)
var/reagent_note
Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 KiB

After

Width:  |  Height:  |  Size: 535 KiB