From 377dfe894d81d83d4fd1bdfb4e2619a6577b52e0 Mon Sep 17 00:00:00 2001 From: Markolie Date: Sun, 22 Feb 2015 21:15:54 +0100 Subject: [PATCH] Add attack animations --- .../components/portables_connector.dm | 2 +- code/_onclick/item_attack.dm | 9 +- code/_onclick/other_mobs.dm | 2 +- code/datums/spell.dm | 28 +- code/game/gamemodes/blob/theblob.dm | 16 +- code/game/gamemodes/events/ninja_equipment.dm | 25 +- code/game/machinery/Sleeper.dm | 7 + code/game/machinery/bots/bots.dm | 3 + code/game/machinery/camera/camera.dm | 1 + code/game/machinery/computer/computer.dm | 28 +- code/game/machinery/doors/windowdoor.dm | 3 + code/game/machinery/newscaster.dm | 2 +- code/game/machinery/shieldgen.dm | 12 +- code/game/machinery/turrets.dm | 23 +- code/game/mecha/mecha.dm | 15 +- code/game/objects/effects/aliens.dm | 4 + code/game/objects/items/weapons/stunbaton.dm | 1 + .../structures/crates_lockers/closets.dm | 1 + .../crates_lockers/closets/fireaxe.dm | 6 +- code/game/objects/structures/grille.dm | 13 +- code/game/objects/structures/mirror.dm | 12 +- code/game/objects/structures/tables_racks.dm | 17 +- code/game/objects/structures/window.dm | 11 +- code/game/turfs/simulated/walls.dm | 4 +- code/modules/flufftext/Hallucination.dm | 317 ++++++++---------- .../mob/living/carbon/alien/humanoid/emote.dm | 2 +- .../living/carbon/alien/humanoid/humanoid.dm | 261 +++++++++----- .../mob/living/carbon/alien/larva/emote.dm | 2 +- .../mob/living/carbon/alien/larva/larva.dm | 185 ++++++++-- code/modules/mob/living/carbon/carbon.dm | 3 + code/modules/mob/living/carbon/human/emote.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 26 +- .../living/carbon/human/human_attackalien.dm | 2 + .../living/carbon/human/human_attackhand.dm | 2 + .../living/carbon/human/human_attackpaw.dm | 11 +- .../mob/living/carbon/human/human_defense.dm | 6 +- code/modules/mob/living/carbon/human/life.dm | 10 +- .../mob/living/carbon/metroid/metroid.dm | 29 +- .../modules/mob/living/carbon/monkey/emote.dm | 2 +- .../mob/living/carbon/monkey/monkey.dm | 150 +++++---- code/modules/mob/living/living.dm | 30 ++ code/modules/mob/living/silicon/ai/ai.dm | 26 +- code/modules/mob/living/silicon/pai/pai.dm | 2 + .../modules/mob/living/silicon/robot/robot.dm | 66 ++-- .../mob/living/simple_animal/constructs.dm | 1 + .../mob/living/simple_animal/simple_animal.dm | 102 +++--- code/modules/mob/mob.dm | 3 + code/modules/power/apc.dm | 5 +- code/modules/power/lighting.dm | 18 +- code/modules/recycling/disposal.dm | 8 + 50 files changed, 939 insertions(+), 577 deletions(-) diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index 09fe000ec25..45428f121f0 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -137,7 +137,7 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (connected_device) - user << "\red You cannot unwrench this [src], dettach [connected_device] first." + user << "\red You cannot unwrench this [src], detach [connected_device] first." return 1 if (locate(/obj/machinery/portable_atmospherics, src.loc)) return 1 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index ab9c788c079..431abf25980 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -4,15 +4,17 @@ return // No comment -/atom/proc/attackby(obj/item/W, mob/user) +/atom/proc/attackby(obj/item/W, mob/living/user) return -/atom/movable/attackby(obj/item/W, mob/user) +/atom/movable/attackby(obj/item/W, mob/living/user) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) if(!(W.flags&NOBLUDGEON)) visible_message("[src] has been hit by [user] with [W].") /mob/living/attackby(obj/item/I, mob/user) + user.changeNext_move(CLICK_CD_MELEE) if(istype(I) && ismob(user)) - user.changeNext_move(CLICK_CD_MELEE) I.attack(src, user) @@ -129,6 +131,7 @@ var/showname = "." if(user) showname = " by [user]." + user.do_attack_animation(src) if(!(user in viewers(M, null))) showname = "." diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 353d39347b3..1dd064219a5 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -69,7 +69,7 @@ if(..()) return if(a_intent != "harm" || !ismob(A)) return - if(istype(wear_mask, /obj/item/clothing/mask/muzzle)) + if(is_muzzled()) return var/mob/living/carbon/ML = A var/dam_zone = ran_zone(pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")) diff --git a/code/datums/spell.dm b/code/datums/spell.dm index d131db35dda..e03f172f2a2 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -48,7 +48,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin var/icon_power_button var/power_button_name -/obj/effect/proc_holder/spell/wizard/proc/cast_check(skipcharge = 0, mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell +/obj/effect/proc_holder/spell/wizard/proc/cast_check(skipcharge = 0, mob/living/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell if(!(src in user.spell_list)) user << "You shouldn't have this spell! Something's wrong." @@ -75,27 +75,27 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin return 0 if(!ghost) - if(usr.stat && !stat_allowed) - usr << "Not when you're incapacitated." + if(user.stat && !stat_allowed) + user << "Not when you're incapacitated." return 0 - if(ishuman(usr) || ismonkey(usr)) - if(istype(usr.wear_mask, /obj/item/clothing/mask/muzzle)) - usr << "Mmmf mrrfff!" + if(ishuman(user) || ismonkey(user)) + if(user.is_muzzled()) + user << "Mmmf mrrfff!" return 0 var/obj/effect/proc_holder/spell/wizard/noclothes/spell = locate() in user.spell_list if(clothes_req && !(spell && istype(spell)))//clothes check - if(!istype(usr, /mob/living/carbon/human)) - usr << "You aren't a human, Why are you trying to cast a human spell, silly non-human? Casting human spells is for humans." + if(!istype(user, /mob/living/carbon/human)) + user << "You aren't a human, Why are you trying to cast a human spell, silly non-human? Casting human spells is for humans." return 0 - if(!istype(usr:wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(user:wear_suit, /obj/item/clothing/suit/space/rig/wizard)) - usr << "I don't feel strong enough without my robe." + if(!istype(user:wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(user:wear_suit, /obj/item/clothing/suit/space/rig/wizard)) + user << "I don't feel strong enough without my robe." return 0 - if(!istype(usr:shoes, /obj/item/clothing/shoes/sandal)) - usr << "I don't feel strong enough without my sandals." + if(!istype(user:shoes, /obj/item/clothing/shoes/sandal)) + user << "I don't feel strong enough without my sandals." return 0 - if(!istype(usr:head, /obj/item/clothing/head/wizard) && !istype(usr:head, /obj/item/clothing/head/helmet/space/rig/wizard)) - usr << "I don't feel strong enough without my hat." + if(!istype(user:head, /obj/item/clothing/head/wizard) && !istype(user:head, /obj/item/clothing/head/helmet/space/rig/wizard)) + user << "I don't feel strong enough without my hat." return 0 if(!skipcharge) diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 9bcdefdd0b8..c2e0deb52c0 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -129,8 +129,9 @@ return 0 - attackby(var/obj/item/weapon/W, var/mob/user) + attackby(var/obj/item/weapon/W, var/mob/living/user) user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) playsound(get_turf(src), 'sound/effects/attackblob.ogg', 50, 1) src.visible_message("\red The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]") var/damage = 0 @@ -145,6 +146,19 @@ health -= damage update_icon() return + + attack_animal(mob/living/simple_animal/M as mob) + M.changeNext_move(CLICK_CD_MELEE) + M.do_attack_animation(src) + playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1) + src.visible_message("The [src.name] has been attacked by \the [M]!") + var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) + if(!damage) // Avoid divide by zero errors + return + damage /= max(src.brute_resist, 1) + health -= damage + update_icon() + return proc/change_to(var/type) if(!ispath(type)) diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm index 8ea5ab28f8c..41a9408c6d2 100644 --- a/code/game/gamemodes/events/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -1554,30 +1554,31 @@ It is possible to destroy the net by the occupant or someone else. ..() return - attack_hand() - if (HULK in usr.mutations) - usr << text("\blue You easily destroy the energy net.") + attack_hand(mob/living/user) + if (HULK in user.mutations) + user << text("\blue You easily destroy the energy net.") for(var/mob/O in oviewers(src)) - O.show_message(text("\red [] rips the energy net apart!", usr), 1) + O.show_message(text("\red [] rips the energy net apart!", user), 1) health-=50 healthcheck() return - attack_paw() - return attack_hand() + attack_paw(mob/living/user) + return attack_hand(user) - attack_alien() - if (islarva(usr)) + attack_alien(mob/living/user) + if (islarva(user)) return - usr << text("\green You claw at the net.") + user.do_attack_animation(src) + user << text("\green You claw at the net.") for(var/mob/O in oviewers(src)) - O.show_message(text("\red [] claws at the energy net!", usr), 1) + O.show_message(text("\red [] claws at the energy net!", user), 1) playsound(get_turf(src), 'sound/weapons/slash.ogg', 80, 1) health -= rand(10, 20) if(health <= 0) - usr << text("\green You slice the energy net to pieces.") + user << text("\green You slice the energy net to pieces.") for(var/mob/O in oviewers(src)) - O.show_message(text("\red [] slices the energy net apart!", usr), 1) + O.show_message(text("\red [] slices the energy net apart!", user), 1) healthcheck() return diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 52476c7ce02..5a657637d1e 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -68,6 +68,13 @@ src.connected = sleepernew return return + +/obj/machinery/sleeper/attack_animal(var/mob/living/simple_animal/M)//Stop putting hostile mobs in things guise + if(M.environment_smash) + M.do_attack_animation(src) + visible_message("[M.name] smashes [src] apart!") + qdel(src) + return /obj/machinery/sleep_console/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) if (istype(G, /obj/item/weapon/screwdriver)) diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index e676f69c130..f58e11bcd50 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -145,6 +145,8 @@ user << "[src] is in pristine condition." /obj/machinery/bot/attack_alien(var/mob/living/carbon/alien/user as mob) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) health -= rand(15,30)*brute_dam_coeff visible_message("[user] has slashed [src]!") playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) @@ -154,6 +156,7 @@ /obj/machinery/bot/attack_animal(var/mob/living/simple_animal/M as mob) + M.do_attack_animation(src) if(M.melee_damage_upper == 0) return health -= M.melee_damage_upper diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 865bf2f3cb8..eaf2648ee2b 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -103,6 +103,7 @@ return if(indestructible) return + user.do_attack_animation(src) status = 0 visible_message("\The [user] slashes at [src]!") playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 9dab90e6ed3..b76726d4b55 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -127,8 +127,28 @@ src.attack_hand(user) return +/obj/machinery/computer/attack_paw(mob/living/user) + user.do_attack_animation(src) + if(circuit) + if(prob(10)) + user.visible_message("[user.name] smashes the [src.name] with its paws.",\ + "You smash the [src.name] with your paws.",\ + "You hear a smashing sound.") + set_broken() + return + user.visible_message("[user.name] smashes against the [src.name] with its paws.",\ + "You smash against the [src.name] with your paws.",\ + "You hear a clicking sound.") - - - - +/obj/machinery/computer/attack_alien(mob/living/user) + user.do_attack_animation(src) + if(circuit) + if(prob(80)) + user.visible_message("[user.name] smashes the [src.name] with its claws.",\ + "You smash the [src.name] with your claws.",\ + "You hear a smashing sound.") + set_broken() + return + user.visible_message("[user.name] smashes against the [src.name] with its claws.",\ + "You smash against the [src.name] with your claws.",\ + "You hear a clicking sound.") diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 2dafc4b32cd..29c52c3f133 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -196,12 +196,14 @@ if(src.operating) return user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) user.visible_message("[user] smashes against the [src.name].", \ "[user] smashes against the [src.name].") take_damage(damage) /obj/machinery/door/window/attack_alien(mob/living/user as mob) + if(islarva(user)) return attack_generic(user, 25) @@ -332,6 +334,7 @@ //If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway) if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card) ) user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) if( (I.flags&NOBLUDGEON) || !I.force ) return var/aforce = I.force diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 85b4e35f7af..3ed4e23bedc 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -736,7 +736,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co src.updateUsrDialog() -/obj/machinery/newscaster/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/newscaster/attackby(obj/item/I as obj, mob/living/user as mob) if(istype(I, /obj/item/weapon/wrench)) user << "Now [anchored ? "un" : ""]securing [name]" playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 39e9e903c1a..0137af2133a 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -38,7 +38,7 @@ if (src.health <= 0) - visible_message("\blue The [src] dissapates") + visible_message("\blue The [src] dissipates") del(src) return @@ -51,7 +51,7 @@ src.health -= max_health*0.75 //3/4 health as damage if(src.health <= 0) - visible_message("\blue The [src] dissapates") + visible_message("\blue The [src] dissipates") del(src) return @@ -63,7 +63,7 @@ health -= Proj.damage ..() if(health <=0) - visible_message("\blue The [src] dissapates") + visible_message("\blue The [src] dissipates") del(src) return opacity = 1 @@ -112,7 +112,7 @@ //Handle the destruction of the shield if (src.health <= 0) - visible_message("\blue The [src] dissapates") + visible_message("\blue The [src] dissipates") del(src) return @@ -489,8 +489,8 @@ user << "\red Access denied." else - src.add_fingerprint(user) - visible_message("\red The [src.name] has been hit with the [W.name] by [user.name]!") + add_fingerprint(user) + ..() /obj/machinery/shieldwallgen/proc/cleanup(var/NSEW) var/obj/machinery/shieldwall/F diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 90dd7f27d71..37248dd64bf 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -299,7 +299,8 @@ /obj/machinery/turret/attackby(obj/item/weapon/W, mob/user)//I can't believe no one added this before/N ..() - playsound(get_turf(src), 'sound/weapons/smash.ogg', 60, 1) + user.changeNext_move(CLICK_CD_MELEE) + playsound(src.loc, 'sound/weapons/smash.ogg', 60, 1) src.spark_system.start() src.health -= W.force * 0.5 if (src.health <= 0) @@ -433,26 +434,31 @@ popup.open() + /obj/machinery/turret/attack_animal(mob/living/simple_animal/M as mob) + M.changeNext_move(CLICK_CD_MELEE) + M.do_attack_animation(src) if(M.melee_damage_upper == 0) return if(!(stat & BROKEN)) - visible_message("\red [M] [M.attacktext] [src]!") - M.attack_log += text("\[[time_stamp()]\] attacked [src.name]") + visible_message("[M] [M.attacktext] [src]!") + add_logs(M, src, "attacked", admin=0) //src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") src.health -= M.melee_damage_upper if (src.health <= 0) src.die() else - M << "\red That object is useless to you." + M << "That object is useless to you." return /obj/machinery/turret/attack_alien(mob/living/carbon/alien/humanoid/M as mob) + M.changeNext_move(CLICK_CD_MELEE) + M.do_attack_animation(src) if(!(stat & BROKEN)) - playsound(get_turf(src), 'sound/weapons/slash.ogg', 25, 1, -1) - visible_message("\red [] has slashed at []!", M, src) + playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1) + visible_message("[M] has slashed at [src]!") src.health -= 15 if (src.health <= 0) src.die() @@ -574,7 +580,10 @@ return attack_hand(user) -/obj/machinery/gun_turret/attack_alien(mob/user as mob) +/obj/machinery/gun_turret/attack_alien(mob/living/user as mob) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) + playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1) user.visible_message("[user] slashes at [src]", "You slash at [src]") take_damage(15) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 5c9616e0e61..ae5bbba8c11 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -453,7 +453,9 @@ src.destroy() return -/obj/mecha/attack_hand(mob/user as mob) +/obj/mecha/attack_hand(mob/living/user as mob) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) src.log_message("Attack by hand/paw. Attacker - [user].",1) if(ishuman(user)) @@ -470,12 +472,14 @@ src.log_append_to_last("Armor saved.") return -/obj/mecha/attack_paw(mob/user as mob) +/obj/mecha/attack_paw(mob/living/user as mob) return src.attack_hand(user) -/obj/mecha/attack_alien(mob/user as mob) +/obj/mecha/attack_alien(mob/living/user as mob) src.log_message("Attack by alien. Attacker - [user].",1) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) if(!prob(src.deflect_chance)) src.take_damage(15) src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) @@ -496,6 +500,7 @@ if(user.melee_damage_upper == 0) user.emote("[user.friendly] [src]") else + user.do_attack_animation(src) if(!prob(src.deflect_chance)) var/damage = rand(user.melee_damage_lower, user.melee_damage_upper) src.take_damage(damage) @@ -674,8 +679,10 @@ src.check_for_internal_damage(list(MECHA_INT_FIRE, MECHA_INT_TEMP_CONTROL)) return -/obj/mecha/proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/mecha/proc/dynattackby(obj/item/weapon/W as obj, mob/living/user as mob) src.log_message("Attacked by [W]. Attacker - [user]") + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) if(prob(src.deflect_chance)) user << "\red The [W] bounces off [src.name] armor." src.log_append_to_last("Armor saved.") diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 34f0ca4a1ff..9c79e121a3f 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -102,6 +102,7 @@ /obj/structure/alien/resin/attack_hand(mob/living/user) if(HULK in user.mutations) + user.do_attack_animation(src) user.visible_message("[user] destroys [src]!") health = 0 healthcheck() @@ -112,6 +113,8 @@ /obj/structure/alien/resin/attack_alien(mob/living/user) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) if(islarva(user)) return user.visible_message("[user] claws at the resin!") @@ -123,6 +126,7 @@ /obj/structure/alien/resin/attackby(obj/item/I, mob/living/user) + user.changeNext_move(CLICK_CD_MELEE) health -= I.force playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) healthcheck() diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 99cd5b3e97b..361abb07c12 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -118,6 +118,7 @@ if(user.a_intent != "harm") if(status) + user.do_attack_animation(L) baton_stun(L, user) else L.visible_message("[L] has been prodded with [src] by [user]. Luckily it was off.", \ diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 1054dbfcb1e..f36664ad57c 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -162,6 +162,7 @@ /obj/structure/closet/attack_animal(mob/living/simple_animal/user as mob) if(user.environment_smash) + user.do_attack_animation(src) visible_message("\red [user] destroys the [src]. ") for(var/atom/movable/A as mob|obj in src) A.loc = src.loc diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index 87eb2cb8114..14807277647 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -14,14 +14,14 @@ var/locked = 1 var/smashed = 0 - attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri + attackby(var/obj/item/O as obj, var/mob/living/user as mob) //Marker -Agouri //..() //That's very useful, Erro var/hasaxe = 0 //gonna come in handy later~ if(fireaxe) hasaxe = 1 - if (isrobot(usr) || src.locked) + if (isrobot(user) || src.locked) if(istype(O, /obj/item/device/multitool)) user << "\red Resetting circuitry..." playsound(user, 'sound/machines/lockreset.ogg', 50, 1) @@ -31,6 +31,7 @@ update_icon() return else if(istype(O, /obj/item/weapon)) + user.changeNext_move(CLICK_CD_MELEE) var/obj/item/weapon/W = O if(src.smashed || src.localopened) if(localopened) @@ -39,6 +40,7 @@ spawn(10) update_icon() return else + user.do_attack_animation(src) playsound(user, 'sound/effects/Glasshit.ogg', 100, 1) //We don't want this playing every time if(W.force < 15) user << "\blue The cabinet's protective glass glances off the hit." diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index ea8665e5a9a..85c5e281bac 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -55,11 +55,12 @@ if(ismob(user)) shock(user, 70) -/obj/structure/grille/attack_paw(mob/user as mob) +/obj/structure/grille/attack_paw(mob/living/user as mob) attack_hand(user) -/obj/structure/grille/attack_hand(mob/user as mob) +/obj/structure/grille/attack_hand(mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user] kicks [src].", \ "You kick [src].", \ @@ -73,9 +74,10 @@ health -= 1 healthcheck() -/obj/structure/grille/attack_alien(mob/user as mob) +/obj/structure/grille/attack_alien(mob/living/user as mob) if(istype(user, /mob/living/carbon/alien/larva)) return user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user] mangles [src].", \ "You mangle [src].", \ @@ -86,8 +88,9 @@ healthcheck() return -/obj/structure/grille/attack_slime(mob/user as mob) +/obj/structure/grille/attack_slime(mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) var/mob/living/carbon/slime/S = user if (!S.is_adult) return @@ -104,7 +107,7 @@ /obj/structure/grille/attack_animal(var/mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) return M.changeNext_move(CLICK_CD_MELEE) - + M.do_attack_animation(src) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) M.visible_message("[M] smashes against [src].", \ "You smash against [src].", \ diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 59771219737..4a3f908b192 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -71,7 +71,8 @@ ..() -/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob) +/obj/structure/mirror/attackby(obj/item/I as obj, mob/living/user as mob) + user.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return @@ -84,8 +85,9 @@ playsound(src.loc, 'sound/effects/Glasshit.ogg', 70, 1) -/obj/structure/mirror/attack_alien(mob/user as mob) +/obj/structure/mirror/attack_alien(mob/living/user as mob) if(islarva(user)) return + user.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return @@ -93,10 +95,11 @@ shatter() -/obj/structure/mirror/attack_animal(mob/user as mob) +/obj/structure/mirror/attack_animal(mob/living/user as mob) if(!isanimal(user)) return var/mob/living/simple_animal/M = user if(M.melee_damage_upper <= 0) return + M.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return @@ -104,10 +107,11 @@ shatter() -/obj/structure/mirror/attack_slime(mob/user as mob) +/obj/structure/mirror/attack_slime(mob/living/user as mob) var/mob/living/carbon/slime/S = user if (!S.is_adult) return + user.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index ab4f0bea78b..324c7d736d4 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -278,26 +278,30 @@ if(prob(75)) destroy() -/obj/structure/table/attack_paw(mob/user) +/obj/structure/table/attack_paw(mob/living/user) if(HULK in user.mutations) + user.do_attack_animation(src) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) visible_message("[user] smashes the [src] apart!") destroy() -/obj/structure/table/attack_alien(mob/user) +/obj/structure/table/attack_alien(mob/living/user) + user.do_attack_animation(src) visible_message("[user] slices [src] apart!") destroy() /obj/structure/table/attack_animal(mob/living/simple_animal/user) if(user.environment_smash) + user.do_attack_animation(src) visible_message("[user] smashes [src] apart!") destroy() -/obj/structure/table/attack_hand(mob/user) +/obj/structure/table/attack_hand(mob/living/user) if(HULK in user.mutations) + user.do_attack_animation(src) visible_message("[user] smashes [src] apart!") user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) destroy() @@ -766,20 +770,23 @@ destroy() -/obj/structure/rack/attack_paw(mob/user) +/obj/structure/rack/attack_paw(mob/living/user) if(HULK in user.mutations) + user.do_attack_animation(src) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) visible_message("[user] smashes [src] apart!") destroy() -/obj/structure/rack/attack_alien(mob/user) +/obj/structure/rack/attack_alien(mob/living/user) + user.do_attack_animation(src) visible_message("[user] slices [src] apart!") destroy() /obj/structure/rack/attack_animal(mob/living/simple_animal/user) if(user.environment_smash) + user.do_attack_animation(src) visible_message("[user] smashes [src] apart!") destroy() diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 829908025b4..cf880025688 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -179,8 +179,9 @@ var/global/wcColored /obj/structure/window/attack_paw(mob/user as mob) return attack_hand(user) -/obj/structure/window/proc/attack_generic(mob/user as mob, damage = 0) //used by attack_alien, attack_animal, and attack_slime +/obj/structure/window/proc/attack_generic(mob/living/user as mob, damage = 0) //used by attack_alien, attack_animal, and attack_slime user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) health -= damage if(health <= 0) user.visible_message("[user] smashes through [src]!") @@ -193,25 +194,25 @@ var/global/wcColored playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1) -/obj/structure/window/attack_alien(mob/user as mob) +/obj/structure/window/attack_alien(mob/living/user as mob) if(islarva(user)) return attack_generic(user, 15) -/obj/structure/window/attack_animal(mob/user as mob) +/obj/structure/window/attack_animal(mob/living/user as mob) if(!isanimal(user)) return var/mob/living/simple_animal/M = user if(M.melee_damage_upper <= 0) return attack_generic(M, M.melee_damage_upper) -/obj/structure/window/attack_slime(mob/user as mob) +/obj/structure/window/attack_slime(mob/living/user as mob) var/mob/living/carbon/slime/S = user if (!S.is_adult) return attack_generic(user, rand(10, 15)) -/obj/structure/window/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/window/attackby(obj/item/weapon/W as obj, mob/living/user as mob) if(!istype(W)) return//I really wish I did not need this if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) var/obj/item/weapon/grab/G = W diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 8025554f667..ab044524ac0 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -240,9 +240,10 @@ //Interactions -/turf/simulated/wall/attack_paw(mob/user as mob) +/turf/simulated/wall/attack_paw(mob/living/user as mob) user.changeNext_move(CLICK_CD_MELEE) if ((HULK in user.mutations)) + user.do_attack_animation(src) if (prob(40)) usr << text("\blue You smash through the wall.") usr.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) @@ -257,6 +258,7 @@ /turf/simulated/wall/attack_animal(var/mob/living/simple_animal/M) M.changeNext_move(CLICK_CD_MELEE) + M.do_attack_animation(src) if(M.environment_smash >= 2) if(istype(src, /turf/simulated/wall/r_wall)) if(M.environment_smash == 3) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index bc39a2cbf00..bc65a28cf5a 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -11,18 +11,19 @@ Gunshots/explosions/opening doors/less rare audio (done) */ -mob/living/carbon/var - image/halimage - image/halbody - obj/halitem - hal_screwyhud = 0 //1 - critical, 2 - dead, 3 - oxygen indicator, 4 - toxin indicator - handling_hal = 0 - hal_crit = 0 +mob/living/carbon/ + var/image/halimage + var/image/halbody + var/obj/halitem + var/hal_screwyhud = 0 //1 - critical, 2 - dead, 3 - oxygen indicator, 4 - toxin indicator + var/handling_hal = 0 + var/hal_crit = 0 mob/living/carbon/proc/handle_hallucinations() - if(handling_hal) return + if(handling_hal) + return handling_hal = 1 - while(client && hallucination > 20) + while(hallucination > 20) sleep(rand(200,500)/(hallucination/25)) var/halpick = rand(1,100) switch(halpick) @@ -77,9 +78,7 @@ mob/living/carbon/proc/handle_hallucinations() halitem.name = "Flashbang" if(client) client.screen += halitem spawn(rand(100,250)) - if(client) - client.screen -= halitem - halitem = null + qdel(halitem) if(26 to 40) //Flashes of danger //src << "Danger Flash" @@ -111,7 +110,7 @@ mob/living/carbon/proc/handle_hallucinations() if(41 to 65) //Strange audio //src << "Strange Audio" - switch(rand(1,12)) + switch(rand(1,14)) if(1) src << 'sound/machines/airlock.ogg' if(2) if(prob(50))src << 'sound/effects/Explosion1.ogg' @@ -142,9 +141,14 @@ mob/living/carbon/proc/handle_hallucinations() 'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg', 'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg', 'sound/hallucinations/over_here3.ogg',\ 'sound/hallucinations/turn_around1.ogg', 'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg', 'sound/hallucinations/wail.ogg') src << pick(creepyasssounds) + if(13) + src << "You feel a tiny prick!" + if(14) + src << "

Priority Announcement

" + src << "

The Emergency Shuttle has docked with the station. You have 3 minutes to board the Emergency Shuttle.

" + src << sound('sound/AI/shuttledock.ogg') if(66 to 70) //Flashes of danger - //src << "Danger Flash" if(!halbody) var/list/possible_points = list() for(var/turf/simulated/floor/F in view(src,world.view)) @@ -158,8 +162,6 @@ mob/living/carbon/proc/handle_hallucinations() halbody = image('icons/mob/human.dmi',target,"husk_s",TURF_LAYER) if(4) halbody = image('icons/mob/alien.dmi',target,"alienother",TURF_LAYER) - // if(5) - // halbody = image('xcomalien.dmi',target,"chryssalid",TURF_LAYER) if(client) client.images += halbody spawn(rand(50,80)) //Only seen for a brief moment. @@ -167,55 +169,58 @@ mob/living/carbon/proc/handle_hallucinations() halbody = null if(71 to 72) //Fake death -// src.sleeping_willingly = 1 src.sleeping = 20 hal_crit = 1 hal_screwyhud = 1 spawn(rand(50,100)) -// src.sleeping_willingly = 0 src.sleeping = 0 hal_crit = 0 hal_screwyhud = 0 + if(73 to 75) + fake_attack() handling_hal = 0 +/mob/living/carbon/proc/fake_attack() +// var/list/possible_clones = new/list() + var/mob/living/carbon/human/clone = null + var/clone_weapon = null + for(var/mob/living/carbon/human/H in living_mob_list) + if(H.stat || H.lying) + continue +// possible_clones += H + clone = H + break //changed the code a bit. Less randomised, but less work to do. Should be ok, world.contents aren't stored in any particular order. -/*obj/machinery/proc/mockpanel(list/buttons,start_txt,end_txt,list/mid_txts) +// if(!possible_clones.len) return +// clone = pick(possible_clones) + if(!clone) + return - if(!mocktxt) + //var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(outside_range(target)) + var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(src.loc) + if(clone.l_hand) + if(!(locate(clone.l_hand) in non_fakeattack_weapons)) + clone_weapon = clone.l_hand.name + F.weap = clone.l_hand + else if (clone.r_hand) + if(!(locate(clone.r_hand) in non_fakeattack_weapons)) + clone_weapon = clone.r_hand.name + F.weap = clone.r_hand - mocktxt = "" + F.name = clone.name + F.my_target = src + F.weapon_name = clone_weapon + src.hallucinations += F - var/possible_txt = list("Launch Escape Pods","Self-Destruct Sequence","\[Swipe ID\]","De-Monkify",\ - "Reticulate Splines","Plasma","Open Valve","Lockdown","Nerf Airflow","Kill Traitor","Nihilism",\ - "OBJECTION!","Arrest Stephen Bowman","Engage Anti-Trenna Defenses","Increase Captain IQ","Retrieve Arms",\ - "Play Charades","Oxygen","Inject BeAcOs","Ninja Lizards","Limit Break","Build Sentry") + F.left = image(clone,dir = WEST) + F.right = image(clone,dir = EAST) + F.up = image(clone,dir = NORTH) + F.down = image(clone,dir = SOUTH) - if(mid_txts) - while(mid_txts.len) - var/mid_txt = pick(mid_txts) - mocktxt += mid_txt - mid_txts -= mid_txt + F.updateimage() - while(buttons.len) - - var/button = pick(buttons) - - var/button_txt = pick(possible_txt) - - mocktxt += "[button_txt]
" - - buttons -= button - possible_txt -= button_txt - - return start_txt + mocktxt + end_txt + "" - -proc/check_panel(mob/M) - if (istype(M, /mob/living/carbon/human) || istype(M, /mob/living/silicon/ai)) - if(M.hallucination < 15) - return 1 - return 0*/ /obj/effect/fake_attacker icon = null @@ -231,7 +236,7 @@ proc/check_panel(mob/M) var/image/stand_icon = null var/image/currentimage = null var/icon/base = null - var/s_tone + var/skin_tone var/mob/living/clone = null var/image/left var/image/right @@ -241,99 +246,103 @@ proc/check_panel(mob/M) var/health = 100 - attackby(var/obj/item/weapon/P as obj, mob/user as mob) +/obj/effect/fake_attacker/attackby(var/obj/item/weapon/P as obj, mob/living/user as mob) + step_away(src,my_target,2) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) + my_target << sound(pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')) + my_target.visible_message("[my_target] flails around wildly.", \ + "[my_target] has attacked [src]!") + + src.health -= P.force + + + return + +/obj/effect/fake_attacker/Crossed(var/mob/M, somenumber) + if(M == my_target) step_away(src,my_target,2) - for(var/mob/M in oviewers(world.view,my_target)) - M << "\red [my_target] flails around wildly." - my_target.show_message("\red [src] has been attacked by [my_target] ", 1) //Lazy. + if(prob(30)) + for(var/mob/O in oviewers(world.view , my_target)) + O << "[my_target] stumbles around." - src.health -= P.force +/obj/effect/fake_attacker/New() + ..() + spawn(300) + if(my_target) + my_target.hallucinations -= src + qdel(src) + step_away(src,my_target,2) + spawn attack_loop() - return - - Crossed(var/mob/M, somenumber) - if(M == my_target) - step_away(src,my_target,2) - if(prob(30)) - for(var/mob/O in oviewers(world.view , my_target)) - O << "\red [my_target] stumbles around." - - New() - ..() - spawn(300) - if(my_target) - my_target.hallucinations -= src - del(src) - step_away(src,my_target,2) - spawn attack_loop() +/obj/effect/fake_attacker/proc/updateimage() +// del src.currentimage - proc/updateimage() - // del src.currentimage + if(src.dir == NORTH) + del src.currentimage + src.currentimage = new /image(up,src) + else if(src.dir == SOUTH) + del src.currentimage + src.currentimage = new /image(down,src) + else if(src.dir == EAST) + del src.currentimage + src.currentimage = new /image(right,src) + else if(src.dir == WEST) + del src.currentimage + src.currentimage = new /image(left,src) + my_target << currentimage - if(src.dir == NORTH) - del src.currentimage - src.currentimage = new /image(up,src) - else if(src.dir == SOUTH) - del src.currentimage - src.currentimage = new /image(down,src) - else if(src.dir == EAST) - del src.currentimage - src.currentimage = new /image(right,src) - else if(src.dir == WEST) - del src.currentimage - src.currentimage = new /image(left,src) - my_target << currentimage - - - proc/attack_loop() - while(1) - sleep(rand(5,10)) - if(src.health < 0) - collapse() - continue - if(get_dist(src,my_target) > 1) - src.dir = get_dir(src,my_target) - step_towards(src,my_target) - updateimage() - else - if(prob(15)) - if(weapon_name) - my_target << sound(pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')) - my_target.show_message("\red [my_target] has been attacked with [weapon_name] by [src.name] ", 1) - my_target.staminaloss += 30 - if(prob(20)) my_target.eye_blurry += 3 - if(prob(33)) - if(!locate(/obj/effect/overlay) in my_target.loc) - fake_blood(my_target) - else - my_target << sound(pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')) - my_target.show_message("\red [src.name] has punched [my_target]!", 1) - my_target.staminaloss += 30 - if(prob(33)) - if(!locate(/obj/effect/overlay) in my_target.loc) - fake_blood(my_target) - +/obj/effect/fake_attacker/proc/attack_loop() + while(1) + sleep(rand(5,10)) + if(src.health < 0) + collapse() + continue + if(get_dist(src,my_target) > 1) + src.dir = get_dir(src,my_target) + step_towards(src,my_target) + updateimage() + else if(prob(15)) - step_away(src,my_target,2) + src.do_attack_animation(my_target) + if(weapon_name) + my_target << sound(pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')) + my_target.show_message("[src.name] has attacked [my_target] with [weapon_name]!", 1) + my_target.staminaloss += 30 + if(prob(20)) + my_target.eye_blurry += 3 + if(prob(33)) + if(!locate(/obj/effect/overlay) in my_target.loc) + fake_blood(my_target) + else + my_target << sound(pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')) + my_target.show_message("[src.name] has punched [my_target]!", 1) + my_target.staminaloss += 30 + if(prob(33)) + if(!locate(/obj/effect/overlay) in my_target.loc) + fake_blood(my_target) - proc/collapse() - collapse = 1 - updateimage() + if(prob(15)) + step_away(src,my_target,2) -/proc/fake_blood(var/mob/target) +/obj/effect/fake_attacker/proc/collapse() + collapse = 1 + updateimage() + +/obj/effect/fake_attacker/proc/fake_blood(var/mob/target) var/obj/effect/overlay/O = new/obj/effect/overlay(target.loc) O.name = "blood" var/image/I = image('icons/effects/blood.dmi',O,"floor[rand(1,7)]",O.dir,1) target << I spawn(300) - del(O) + qdel(O) return var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/item/ammo_box/a357,\ - /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow, /obj/item/weapon/melee/energy/sword,\ + /obj/item/weapon/gun/energy/crossbow, /obj/item/weapon/melee/energy/sword,\ /obj/item/weapon/storage/box/syndicate, /obj/item/weapon/storage/box/emps,\ /obj/item/weapon/cartridge/syndicate, /obj/item/clothing/under/chameleon,\ /obj/item/clothing/shoes/syndigaloshes, /obj/item/weapon/card/id/syndicate,\ @@ -347,65 +356,3 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite /obj/item/clothing/under/rank/captain, /obj/item/device/aicard,\ /obj/item/clothing/shoes/magboots, /obj/item/blueprints, /obj/item/weapon/disk/nuclear,\ /obj/item/clothing/suit/space/nasavoid, /obj/item/weapon/tank) - -/proc/fake_attack(var/mob/living/target) -// var/list/possible_clones = new/list() - var/mob/living/carbon/human/clone = null - var/clone_weapon = null - - for(var/mob/living/carbon/human/H in living_mob_list) - if(H.stat || H.lying) continue -// possible_clones += H - clone = H - break //changed the code a bit. Less randomised, but less work to do. Should be ok, world.contents aren't stored in any particular order. - -// if(!possible_clones.len) return -// clone = pick(possible_clones) - if(!clone) return - - //var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(outside_range(target)) - var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(target.loc) - if(clone.l_hand) - if(!(locate(clone.l_hand) in non_fakeattack_weapons)) - clone_weapon = clone.l_hand.name - F.weap = clone.l_hand - else if (clone.r_hand) - if(!(locate(clone.r_hand) in non_fakeattack_weapons)) - clone_weapon = clone.r_hand.name - F.weap = clone.r_hand - - F.name = clone.name - F.my_target = target - F.weapon_name = clone_weapon - target.hallucinations += F - - - F.left = image(clone,dir = WEST) - F.right = image(clone,dir = EAST) - F.up = image(clone,dir = NORTH) - F.down = image(clone,dir = SOUTH) - -// F.base = new /icon(clone.stand_icon) -// F.currentimage = new /image(clone) - -/* - - - - F.left = new /icon(clone.stand_icon,dir=WEST) - for(var/icon/i in clone.overlays) - F.left.Blend(i) - F.up = new /icon(clone.stand_icon,dir=NORTH) - for(var/icon/i in clone.overlays) - F.up.Blend(i) - F.down = new /icon(clone.stand_icon,dir=SOUTH) - for(var/icon/i in clone.overlays) - F.down.Blend(i) - F.right = new /icon(clone.stand_icon,dir=EAST) - for(var/icon/i in clone.overlays) - F.right.Blend(i) - - target << F.up - */ - - F.updateimage() diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm index 71dc56ef402..d0f4cf86aad 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm @@ -8,7 +8,7 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) - var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) + var/muzzled = is_muzzled() switch(act) if ("me") diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index ab33e676ed0..3724a44582c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -70,15 +70,12 @@ ///mob/living/carbon/alien/humanoid/bullet_act(var/obj/item/projectile/Proj) taken care of in living /mob/living/carbon/alien/humanoid/emp_act(severity) - if(wear_suit) wear_suit.emp_act(severity) - if(head) head.emp_act(severity) if(r_store) r_store.emp_act(severity) if(l_store) l_store.emp_act(severity) ..() /mob/living/carbon/alien/humanoid/ex_act(severity) - if(!blinded) - flick("flash", flash) + ..() var/shielded = 0 @@ -86,7 +83,6 @@ var/f_loss = null switch (severity) if (1.0) - b_loss += 500 gib() return @@ -122,11 +118,10 @@ if(shielded) damage /= 4 - - show_message("\red The blob attacks!") + show_message("The blob attacks!") adjustFireLoss(damage) return - + /mob/living/carbon/alien/humanoid/meteorhit(O as obj) for(var/mob/M in viewers(src, null)) if ((M.client && !( M.blinded ))) @@ -138,6 +133,35 @@ updatehealth() return +/mob/living/carbon/alien/humanoid/attack_paw(mob/living/carbon/monkey/M as mob) + if(!ismonkey(M)) return//Fix for aliens receiving double messages when attacking other aliens. + + if (!ticker) + M << "You cannot attack people before the game has started." + return + + if (istype(loc, /turf) && istype(loc.loc, /area/start)) + M << "No attacking people at spawn, you jackass." + return + ..() + + switch(M.a_intent) + + if ("help") + help_shake_act(M) + else + M.do_attack_animation(src) + if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) + return + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!") + if (health > -100) + adjustBruteLoss(rand(1, 3)) + updatehealth() + return + + /mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M as mob) if (!ticker) M << "You cannot attack people before the game has started." @@ -145,12 +169,11 @@ if(M.Victim) return // can't attack while eating! - if (health > -100) - - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red The [M.name] glomps []!", src), 1) + if (stat > -100) + M.do_attack_animation(src) + visible_message("The [M.name] glomps [src]!", \ + "The [M.name] glomps [src]!") var/damage = rand(1, 3) if(M.is_adult) @@ -177,9 +200,8 @@ if(M.powerlevel < 0) M.powerlevel = 0 - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red The [M.name] has shocked []!", src), 1) + visible_message("The [M.name] has shocked [src]!", \ + "The [M.name] has shocked [src]!") Weaken(power) if (stuttering < power) @@ -198,6 +220,19 @@ return +/mob/living/carbon/alien/humanoid/attack_animal(mob/living/simple_animal/M as mob) + if(M.melee_damage_upper == 0) + M.emote("[M.friendly] [src]") + else + M.do_attack_animation(src) + if(M.attack_sound) + playsound(loc, M.attack_sound, 50, 1, 1) + visible_message("[M] [M.attacktext] [src]!", \ + "[M] [M.attacktext] [src]!") + var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) + adjustBruteLoss(damage) + updatehealth() + /mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M as mob) if (!ticker) M << "You cannot attack people before the game has started." @@ -207,95 +242,135 @@ M << "No attacking people at spawn, you jackass." return + if(..()) //to allow surgery to return properly. + return + + switch(M.a_intent) + + if ("help") + help_shake_act(M) + + if ("grab") + if (M == src || anchored) + return + var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src) + + M.put_in_active_hand(G) + + G.synch() + + LAssailant = M + + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + visible_message("[M] has grabbed [src] passively!") + + if ("harm") + M.do_attack_animation(src) + var/damage = rand(1, 9) + if (prob(90)) + if (HULK in M.mutations)//HULK SMASH + damage += 14 + spawn(0) + Weaken(damage) // Why can a hulk knock an alien out but not knock out a human? Damage is robust enough. + step_away(src,M,15) + sleep(3) + step_away(src,M,15) + playsound(loc, "punch", 25, 1, -1) + visible_message("[M] has punched [src]!", \ + "[M] has punched [src]!") + if ((stat != DEAD) && (damage > 9||prob(5)))//Regular humans have a very small chance of weakening an alien. + Weaken(1,5) + visible_message("[M] has weakened [src]!", \ + "[M] has weakened [src]!", \ + "You hear someone fall.") + adjustBruteLoss(damage) + updatehealth() + else + playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + visible_message("[M] has attempted to punch [src]!") + + if ("disarm") + if (!lying) + if (prob(5))//Very small chance to push an alien down. + Weaken(2) + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + visible_message("[M] has pushed down [src]!", \ + "[M] has pushed down [src]!") + else + if (prob(50)) + drop_item() + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + visible_message("[M] has disarmed [src]!", \ + "[M] has disarmed [src]!") + else + playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + visible_message("[M] has attempted to disarm [src]!") + return + +/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other. +As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble. +In all, this is a lot like the monkey code. /N +*/ + +/mob/living/carbon/alien/humanoid/attack_alien(mob/living/carbon/alien/humanoid/M as mob) + if (!ticker) + M << "You cannot attack people before the game has started." + return + + if (istype(loc, /turf) && istype(loc.loc, /area/start)) + M << "No attacking people at spawn, you jackass." + return + ..() switch(M.a_intent) if ("help") + sleeping = max(0,sleeping-5) + resting = 0 + AdjustParalysis(-3) + AdjustStunned(-3) + AdjustWeakened(-3) + visible_message("[M.name] nuzzles [src] trying to wake it up!") + + else if (health > 0) - help_shake_act(M) - else - if (M.health >= -75.0) - if (((M.head && M.head.flags & 4) || ((M.wear_mask && !( M.wear_mask.flags & 32 )) || ((head && head.flags & 4) || (wear_mask && !( wear_mask.flags & 32 )))))) - M << "\blue Remove that mask!" - return - var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) - O.source = M - O.target = src - O.s_loc = M.loc - O.t_loc = loc - O.place = "CPR" - requests += O - spawn( 0 ) - O.process() - return + M.do_attack_animation(src) + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + var/damage = rand(1, 3) + visible_message("[M.name] bites [src]!!", \ + "[M.name] bites [src]!!") - if ("grab") - if (M == src || anchored) - return - var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src) - - M.put_in_active_hand(G) - - grabbed_by += G - G.synch() - - LAssailant = M - - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has grabbed [] passively!", M, src), 1) - - if ("harm") - var/damage = rand(1, 9) - if (prob(90)) - if (HULK in M.mutations)//HULK SMASH - damage += 14 - spawn(0) - Paralyse(1) - step_away(src,M,15) - sleep(3) - step_away(src,M,15) - playsound(loc, "punch", 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has punched []!", M, src), 1) - if (damage > 9||prob(5))//Regular humans have a very small chance of weakening an alien. - Paralyse(2) - for(var/mob/O in viewers(M, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has weakened []!", M, src), 1, "\red You hear someone fall.", 2) adjustBruteLoss(damage) updatehealth() else - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has attempted to punch []!", M, src), 1) - - if ("disarm") - if (!lying) - if (prob(5))//Very small chance to push an alien down. - Paralyse(2) - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has pushed down []!", M, src), 1) - else - if (prob(50)) - drop_item() - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has disarmed []!", M, src), 1) - else - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has attempted to disarm []!", M, src), 1) + M << "[name] is too injured for that." return + +/mob/living/carbon/alien/humanoid/attack_larva(mob/living/carbon/alien/larva/L as mob) + + switch(L.a_intent) + if("help") + visible_message("[L] rubs its head against [src].") + + + else + if (health > 0) + L.do_attack_animation(src) + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + var/damage = rand(1, 3) + visible_message("[L.name] bites [src]!!", \ + "[L.name] bites [src]!!") + + adjustBruteLoss(damage) + updatehealth() + else + L << "[name] is too injured for that." + return + + + /mob/living/carbon/alien/humanoid/restrained() if (handcuffed) return 1 diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm index 375c5c6b0c9..12ad431f3c3 100644 --- a/code/modules/mob/living/carbon/alien/larva/emote.dm +++ b/code/modules/mob/living/carbon/alien/larva/emote.dm @@ -8,7 +8,7 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) - var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) + var/muzzled = is_muzzled() switch(act) if ("me") diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index ac66a310d76..a2774c4022a 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -71,14 +71,12 @@ /mob/living/carbon/alien/larva/ex_act(severity) - if(!blinded) - flick("flash", flash) + ..() var/b_loss = null var/f_loss = null switch (severity) if (1.0) - b_loss += 500 gib() return @@ -119,7 +117,7 @@ //paralysis += 1 - show_message("\red The blob attacks you!") + show_message("The blob attacks you!") adjustFireLoss(damage) @@ -130,7 +128,7 @@ //can't equip anything /mob/living/carbon/alien/larva/attack_ui(slot_id) return - + /mob/living/carbon/alien/larva/meteorhit(O as obj) for(var/mob/M in viewers(src, null)) if ((M.client && !( M.blinded ))) @@ -142,31 +140,164 @@ updatehealth() return -/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M as mob) - if(..()) - var/damage = rand(1, 9) - if (prob(90)) - if (HULK in M.mutations) - damage += 5 - spawn(0) - Paralyse(1) - step_away(src,M,15) - sleep(3) - step_away(src,M,15) - playsound(loc, "punch", 25, 1, -1) - add_logs(M, src, "attacked") - visible_message("[M] has kicked [src]!", \ - "[M] has kicked [src]!") - if ((stat != DEAD) && (damage > 4.9)) - Paralyse(rand(5,10)) +/mob/living/carbon/alien/larva/attack_animal(mob/living/simple_animal/M as mob) + if(M.melee_damage_upper == 0) + M.emote("[M.friendly] [src]") + else + M.do_attack_animation(src) + if(M.attack_sound) + playsound(loc, M.attack_sound, 50, 1, 1) + visible_message("[M] [M.attacktext] [src]!", \ + "[M] [M.attacktext] [src]!") + var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) + adjustBruteLoss(damage) + add_logs(M, src, "attacked", admin=0) + updatehealth() - adjustBruteLoss(damage) - updatehealth() + +/mob/living/carbon/alien/larva/attack_paw(mob/living/carbon/monkey/M as mob) + if(!(istype(M, /mob/living/carbon/monkey))) return//Fix for aliens receiving double messages when attacking other aliens. + + if (!ticker) + M << "You cannot attack people before the game has started." + return + + if (istype(loc, /turf) && istype(loc.loc, /area/start)) + M << "No attacking people at spawn, you jackass." + return + ..() + + switch(M.a_intent) + + if ("help") + help_shake_act(M) else - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - visible_message("[M] has attempted to kick [src]!", \ - "[M] has attempted to kick [src]!") + M.do_attack_animation(src) + if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) + return + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!") + if (health > -100) + adjustBruteLoss(rand(1, 3)) + updatehealth() + return + +/mob/living/carbon/alien/larva/attack_slime(mob/living/carbon/slime/M as mob) + if (!ticker) + M << "You cannot attack people before the game has started." + return + + if(M.Victim) + return // can't attack while eating! + + if (stat != DEAD) + M.do_attack_animation(src) + visible_message("The [M.name] glomps [src]!", \ + "The [M.name] glomps [src]!") + var/damage = rand(1, 3) + + if(M.is_adult) + damage = rand(20, 40) + else + damage = rand(5, 35) + + + adjustBruteLoss(damage) + updatehealth() + + return + +/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M as mob) + if (!ticker) + M << "You cannot attack people before the game has started." + return + + if (istype(loc, /turf) && istype(loc.loc, /area/start)) + M << "No attacking people at spawn, you jackass." + return + + ..() + + switch(M.a_intent) + + if ("help") + help_shake_act(M) + + if ("grab") + if (M == src || anchored) + return + var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src ) + + M.put_in_active_hand(G) + + G.synch() + + LAssailant = M + + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + visible_message("[M] has grabbed [src] passively!") + + else + M.do_attack_animation(src) + var/damage = rand(1, 9) + if (prob(90)) + if (HULK in M.mutations) + damage += 5 + spawn(0) + Paralyse(1) + step_away(src,M,15) + sleep(3) + step_away(src,M,15) + playsound(loc, "punch", 25, 1, -1) + visible_message("[M] has kicked [src]!", \ + "[M] has kicked [src]!") + if ((stat != DEAD) && (damage > 4.9)) + Weaken(rand(5,10)) + visible_message("[M] has weakened [src]!", \ + "[M] has weakened [src]!", \ + "You hear someone fall.") + adjustBruteLoss(damage) + updatehealth() + else + playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + visible_message("[M] has attempted to kick [src]!", \ + "[M] has attempted to kick [src]!") + return + +/mob/living/carbon/alien/larva/attack_alien(mob/living/carbon/alien/humanoid/M as mob) + if (!ticker) + M << "You cannot attack people before the game has started." + return + + if (istype(loc, /turf) && istype(loc.loc, /area/start)) + M << "No attacking people at spawn, you jackass." + return + + ..() + + switch(M.a_intent) + + if ("help") + sleeping = max(0,sleeping-5) + resting = 0 + AdjustParalysis(-3) + AdjustStunned(-3) + AdjustWeakened(-3) + visible_message("[M.name] nuzzles [src] trying to wake it up!") + + else + if (health > 0) + M.do_attack_animation(src) + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + var/damage = 1 + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!") + adjustBruteLoss(damage) + updatehealth() + else + M << "[name] is too injured for that." return /mob/living/carbon/alien/larva/restrained() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0aba7817abf..121a3e93f13 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -588,3 +588,6 @@ /mob/living/carbon/proc/canBeHandcuffed() return 0 + +/mob/living/carbon/is_muzzled() + return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index fc7ef06d8ea..15cd226ec68 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -9,7 +9,7 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) - var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) + var/muzzled = is_muzzled() //var/m_type = 1 for (var/obj/item/weapon/implant/I in src) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 8d9ba741425..6f29823609d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -368,6 +368,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) for(var/mob/O in viewers(src, null)) @@ -384,6 +385,25 @@ apply_damage(damage, BRUTE, affecting, armor, M.name) if(armor >= 2) return +/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L as mob) + + switch(L.a_intent) + if("help") + visible_message("[L] rubs its head against [src].") + + + else + L.do_attack_animation(src) + var/damage = rand(1, 3) + visible_message("[L] bites [src]!", \ + "[L] bites [src]!") + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + + if(stat != DEAD) + L.amount_grown = min(L.amount_grown + damage, L.max_grown) + var/datum/organ/external/affecting = get_organ(ran_zone(L.zone_sel.selecting)) + var/armor_block = run_armor_check(affecting, "melee") + apply_damage(damage, BRUTE, affecting, armor_block) /mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M) for(var/L in M.contents) @@ -398,9 +418,9 @@ if (health > -100) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red The [M.name] glomps []!", src), 1) + M.do_attack_animation(src) + visible_message("The [M.name] glomps [src]!", \ + "The [M.name] glomps [src]!") var/damage = rand(1, 3) diff --git a/code/modules/mob/living/carbon/human/human_attackalien.dm b/code/modules/mob/living/carbon/human/human_attackalien.dm index 64d74d916de..c6e088f2c01 100644 --- a/code/modules/mob/living/carbon/human/human_attackalien.dm +++ b/code/modules/mob/living/carbon/human/human_attackalien.dm @@ -23,6 +23,7 @@ visible_message(text("\red [] has grabbed [] passively!", M, src)) if("harm") + M.do_attack_animation(src) if (w_uniform) w_uniform.add_fingerprint(M) var/damage = rand(15, 30) @@ -43,6 +44,7 @@ updatehealth() if("disarm") + M.do_attack_animation(src) var/randn = rand(1, 100) if (randn <= 80) playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 6310c3a8175..2caa0285dc0 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -18,6 +18,7 @@ if((M != src) && check_shields(0, M.name)) add_logs(src, M, "attempted to touch") + M.do_attack_animation(src) visible_message("\red [M] attempted to touch [src]!") return 0 @@ -120,6 +121,7 @@ return //end vampire codes + M.do_attack_animation(src) add_logs(src, M, "[pick(attack.attack_verb)]ed") if(!iscarbon(M)) diff --git a/code/modules/mob/living/carbon/human/human_attackpaw.dm b/code/modules/mob/living/carbon/human/human_attackpaw.dm index afa59fafed6..7d2159637a6 100644 --- a/code/modules/mob/living/carbon/human/human_attackpaw.dm +++ b/code/modules/mob/living/carbon/human/human_attackpaw.dm @@ -1,17 +1,18 @@ -/mob/living/carbon/human/attack_paw(mob/M as mob) +/mob/living/carbon/human/attack_paw(mob/living/M as mob) ..() if (M.a_intent == "help") help_shake_act(M) else - if (istype(wear_mask, /obj/item/clothing/mask/muzzle)) + M.do_attack_animation(src) + if (M.is_muzzled()) return - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [M.name] has bit []!", src), 1) + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!") + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) var/damage = rand(1, 3) var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone)) apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee")) - return diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index de100bc759b..bc3a0bf1af4 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -242,8 +242,10 @@ emp_act return 0 var/hit_area = affecting.display_name - if((user != src) && check_shields(I.force, "the [I.name]")) - return 0 + if(user != src) + user.do_attack_animation(src) + if(check_shields(I.force, "the [I.name]")) + return 0 if(istype(I,/obj/item/weapon/card/emag)) emag_act(user, affecting) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ceeae892199..c25fa8e0e25 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -244,7 +244,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc var/x_offset = pixel_x + rand(-2,2) //Should probably be moved into the twitch emote at some point. var/y_offset = pixel_y + rand(-1,1) animate(src, pixel_x = pixel_x + x_offset, pixel_y = pixel_y + y_offset, time = 1) - animate(pixel_x = pixel_x - x_offset, pixel_y = pixel_y - y_offset, time = 1) + animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y), time = 1) if (disabilities & NERVOUS) speech_problem_flag = 1 if (prob(10)) @@ -1046,11 +1046,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc adjustOxyLoss(1)*/ if(hallucination && !(species.flags & IS_SYNTHETIC)) - if(hallucination >= 20) - if(prob(3)) - fake_attack(src) - if(!handling_hal) - spawn handle_hallucinations() //The not boring kind! + spawn handle_hallucinations() if(hallucination<=2) hallucination = 0 @@ -1174,7 +1170,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc var/pixel_y_diff = rand(-amplitude/3, amplitude/3) animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = 6) - animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = pixel_y - pixel_y_diff, time = 2) + animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y) , time = 2) jitteriness = max(jitteriness-1, 0) //Other diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index dc6f59289cb..4a388a66c1d 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -255,7 +255,8 @@ if (Victim) return // can't attack while eating! if (health > -100) - + + M.do_attack_animation(src) visible_message(" The [M.name] has glomped [src]!", \ " The [M.name] has glomped [src]!") var/damage = rand(1, 3) @@ -275,6 +276,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!", \ @@ -308,6 +310,7 @@ if (istype(wear_mask, /obj/item/clothing/mask/muzzle)) return if (health > 0) + M.do_attack_animation(src) attacked += 10 //playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) visible_message("[M.name] has attacked [src]!", \ @@ -316,7 +319,26 @@ updatehealth() return +/mob/living/carbon/slime/attack_larva(mob/living/carbon/alien/larva/L as mob) + switch(L.a_intent) + + if("help") + visible_message("[L] rubs its head against [src].") + + + else + L.do_attack_animation(src) + attacked += 10 + visible_message("[L] bites [src]!", \ + "[L] bites [src]!") + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + + if(stat != DEAD) + var/damage = rand(1, 3) + L.amount_grown = min(L.amount_grown + damage, L.max_grown) + adjustBruteLoss(damage) + /mob/living/carbon/slime/attack_hand(mob/living/carbon/human/M as mob) if (!ticker) M << "You cannot attack people before the game has started." @@ -415,7 +437,7 @@ visible_message("[M] has grabbed [src] passively!") else - + M.do_attack_animation(src) var/damage = rand(1, 9) attacked += 10 @@ -462,7 +484,7 @@ visible_message("[M] caresses [src] with its scythe like arm.") if ("harm") - + M.do_attack_animation(src) if (prob(95)) attacked += 10 playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) @@ -496,6 +518,7 @@ visible_message(" [M] has grabbed [name] passively!") if ("disarm") + M.do_attack_animation(src) playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) var/damage = 5 attacked += 10 diff --git a/code/modules/mob/living/carbon/monkey/emote.dm b/code/modules/mob/living/carbon/monkey/emote.dm index d5328183f31..706029df8c9 100644 --- a/code/modules/mob/living/carbon/monkey/emote.dm +++ b/code/modules/mob/living/carbon/monkey/emote.dm @@ -9,7 +9,7 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) - var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) + var/muzzled = is_muzzled() switch(act) if ("me") diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 716b2cc856e..b82b063607c 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -188,30 +188,47 @@ if ((O.icon_state == "flaming" && !( shielded ))) adjustFireLoss(40) health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - return - -//mob/living/carbon/monkey/bullet_act(var/obj/item/projectile/Proj)taken care of in living - - -/mob/living/carbon/monkey/attack_paw(mob/M as mob) + return + +/mob/living/carbon/monkey/attack_paw(mob/living/M as mob) ..() if (M.a_intent == "help") help_shake_act(M) else - if ((M.a_intent == "harm" && !( istype(wear_mask, /obj/item/clothing/mask/muzzle) ))) - if ((prob(75) && health > 0)) + if (M.a_intent == "harm" && !(istype(src.wear_mask, /obj/item/clothing/mask/muzzle))) + M.do_attack_animation(src) + if (prob(75)) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - O.show_message("\red [M.name] has bit [name]!", 1) + visible_message("[M.name] bites [name]!", \ + "[M.name] bites [name]!") var/damage = rand(1, 5) - adjustBruteLoss(damage) - health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() + if (health > -100) + adjustBruteLoss(damage) + health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() else - for(var/mob/O in viewers(src, null)) - O.show_message("\red [M.name] has attempted to bite [name]!", 1) + visible_message("[M.name] has attempted to bite [name]!", \ + "[M.name] has attempted to bite [name]!") return +/mob/living/carbon/monkey/attack_larva(mob/living/carbon/alien/larva/L as mob) + + switch(L.a_intent) + if("help") + visible_message("[L] rubs its head against [src].") + + + else + L.do_attack_animation(src) + var/damage = rand(1, 3) + visible_message("[L] bites [src]!", \ + "[L] bites [src]!") + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + + if(stat != DEAD) + L.amount_grown = min(L.amount_grown + damage, L.max_grown) + adjustBruteLoss(damage) + /mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M as mob) if (!ticker) M << "You cannot attack people before the game has started." @@ -221,33 +238,35 @@ M << "No attacking people at spawn, you jackass." return + if(..()) //To allow surgery to return properly. + return + if (M.a_intent == "help") help_shake_act(M) + else if (M.a_intent == "harm") - if ((prob(75) && health > 0)) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has punched [name]!", M), 1) + M.do_attack_animation(src) + if (prob(75)) + visible_message("[M] has punched [name]!", \ + "[M] has punched [name]!") playsound(loc, "punch", 25, 1, -1) var/damage = rand(5, 10) if (prob(40)) damage = rand(10, 15) - if (paralysis < 5) + if ( (paralysis < 5) && (health > 0) ) Paralyse(rand(10, 15)) spawn( 0 ) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has knocked out [name]!", M), 1) + visible_message("[M] has knocked out [name]!", \ + "[M] has knocked out [name]!") return adjustBruteLoss(damage) updatehealth() else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has attempted to punch [name]!", M), 1) + visible_message("[M] has attempted to punch [name]!", \ + "[M] has attempted to punch [name]!") else if (M.a_intent == "grab") if (M == src || anchored) @@ -257,28 +276,24 @@ M.put_in_active_hand(G) - grabbed_by += G G.synch() LAssailant = M playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [] has grabbed [name] passively!", M), 1) + visible_message("[M] has grabbed [name] passively!") else if (!( paralysis )) if (prob(25)) Paralyse(2) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has pushed down [name]!", M), 1) + visible_message("[M] has pushed down [src]!", \ + "[M] has pushed down [src]!") else if(drop_item()) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has disarmed [name]!", M), 1) + visible_message("[M] has disarmed [src]!", \ + "[M] has disarmed [src]!") return /mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M as mob) @@ -292,11 +307,10 @@ switch(M.a_intent) if ("help") - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1) + visible_message(" [M] caresses [src] with its scythe like arm.") if ("harm") + M.do_attack_animation(src) if ((prob(95) && health > 0)) playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) var/damage = rand(15, 30) @@ -304,50 +318,45 @@ damage = rand(20, 40) if (paralysis < 15) Paralyse(rand(10, 15)) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has wounded [name]!", M), 1) + visible_message("[M] has wounded [name]!", \ + "[M] has wounded [name]!") else - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has slashed [name]!", M), 1) - adjustBruteLoss(damage) - updatehealth() + visible_message("[M] has slashed [name]!", \ + "[M] has slashed [name]!") + if (stat != DEAD) + adjustBruteLoss(damage) + updatehealth() else playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has attempted to lunge at [name]!", M), 1) + visible_message("[M] has attempted to lunge at [name]!", \ + "[M] has attempted to lunge at [name]!") if ("grab") - if (M == src) + if (M == src || anchored) return - var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src ) + var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src ) M.put_in_active_hand(G) - grabbed_by += G G.synch() LAssailant = M playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [] has grabbed [name] passively!", M), 1) + visible_message("[M] has grabbed [name] passively!") if ("disarm") + M.do_attack_animation(src) playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) var/damage = 5 if(prob(95)) - Weaken(15) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has tackled down [name]!", M), 1) + Weaken(10) + visible_message("[M] has tackled down [name]!", \ + "[M] has tackled down [name]!") else if(drop_item()) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has disarmed [name]!", M), 1) + visible_message("[M] has disarmed [name]!", \ + "[M] has disarmed [name]!") adjustBruteLoss(damage) updatehealth() return @@ -356,12 +365,12 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) - for(var/mob/O in viewers(src, null)) - O.show_message("\red [M] [M.attacktext] [src]!", 1) - M.attack_log += text("\[[time_stamp()]\] attacked [src.name] ([src.ckey])") - src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") + visible_message("[M] [M.attacktext] [src]!", \ + "[M] [M.attacktext] [src]!") + add_logs(M, src, "attacked", admin=0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) adjustBruteLoss(damage) updatehealth() @@ -376,9 +385,9 @@ if (health > -100) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red The [M.name] glomps []!", src), 1) + M.do_attack_animation(src) + visible_message("The [M.name] glomps [src]!", \ + "The [M.name] glomps [src]!") var/damage = rand(1, 3) @@ -406,9 +415,8 @@ if(M.powerlevel < 0) M.powerlevel = 0 - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red The [M.name] has shocked []!", src), 1) + visible_message("[M] shocked [src]!", \ + "[M] shocked [src]!") Weaken(power) if (stuttering < power) @@ -426,7 +434,7 @@ updatehealth() return - + /mob/living/carbon/monkey/Stat() ..() statpanel("Status") diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index eaa4c170f7d..f94d2bf54b7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -761,3 +761,33 @@ /mob/living/proc/can_use_vents() return "You can't fit into that vent." + + + +/atom/movable/proc/do_attack_animation(atom/A) + var/pixel_x_diff = 0 + var/pixel_y_diff = 0 + var/direction = get_dir(src, A) + switch(direction) + if(NORTH) + pixel_y_diff = 8 + if(SOUTH) + pixel_y_diff = -8 + if(EAST) + pixel_x_diff = 8 + if(WEST) + pixel_x_diff = -8 + if(NORTHEAST) + pixel_x_diff = 8 + pixel_y_diff = 8 + if(NORTHWEST) + pixel_x_diff = -8 + pixel_y_diff = 8 + if(SOUTHEAST) + pixel_x_diff = 8 + pixel_y_diff = -8 + if(SOUTHWEST) + pixel_x_diff = -8 + pixel_y_diff = -8 + animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2) + animate(pixel_x = initial(pixel_x), pixel_y = initial(pixel_y), time = 2) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index a15da8d0749..549b80ebaea 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -536,7 +536,7 @@ var/list/ai_list = list() if(A && target) A.cameraFollow = target - A << text("Now tracking [] on camera.", target.name) + A << "Now tracking [target.name] on camera." if (usr.machine == null) usr.machine = usr @@ -565,6 +565,7 @@ var/list/ai_list = list() updatehealth() return 2 + /mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M as mob) if (!ticker) M << "You cannot attack people before the game has started." @@ -577,38 +578,35 @@ var/list/ai_list = list() switch(M.a_intent) if ("help") - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\blue [M] caresses [src]'s plating with its scythe like arm."), 1) + visible_message("[M] caresses [src]'s plating with its scythe like arm.") else //harm + M.do_attack_animation(src) var/damage = rand(10, 20) if (prob(90)) playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has slashed at []!", M, src), 1) + visible_message("[M] has slashed at [src]!",\ + "[M] has slashed at [src]!") if(prob(8)) flick("noise", flash) adjustBruteLoss(damage) updatehealth() else playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] took a swipe at []!", M, src), 1) + visible_message("[M] took a swipe at [src]!", \ + "[M] took a swipe at [src]!") + return /mob/living/silicon/ai/attack_animal(mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) - for(var/mob/O in viewers(src, null)) - O.show_message("\red [M] [M.attacktext] [src]!", 1) - M.attack_log += text("\[[time_stamp()]\] attacked [src.name] ([src.ckey])") - src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") + visible_message("[M] [M.attacktext] [src]!") + add_logs(M, src, "attacked", admin=0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) adjustBruteLoss(damage) updatehealth() diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 9edeb1ed082..2cddf0236ee 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -213,6 +213,7 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) for(var/mob/O in viewers(src, null)) @@ -240,6 +241,7 @@ O.show_message(text("\blue [M] caresses [src]'s casing with its scythe like arm."), 1) else //harm + M.do_attack_animation(src) var/damage = rand(10, 20) if (prob(90)) playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index d77f0b3c099..2c1e5a6e91f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -671,6 +671,7 @@ user << "Nothing to fix here!" return var/obj/item/weapon/weldingtool/WT = W + user.changeNext_move(CLICK_CD_MELEE) if (WT.remove_fuel(0)) adjustBruteLoss(-30) updatehealth() @@ -921,23 +922,21 @@ if ("help") for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) - O.show_message(text("\blue [M] caresses [src]'s plating with its scythe like arm."), 1) + O.show_message(text("[M] caresses [src]'s plating with its scythe like arm."), 1) if ("grab") - if (M == src) + if (M == src || anchored) return - var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src ) + var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src ) M.put_in_active_hand(G) - grabbed_by += G G.synch() playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has grabbed [] passively!", M, src), 1) + visible_message("[M] has grabbed [src] passively!") if ("harm") + M.do_attack_animation(src) var/damage = rand(10, 20) if (prob(90)) /* @@ -949,33 +948,31 @@ What is this?*/ playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [] has slashed at []!", M, src), 1) + visible_message("[M] has slashed at [src]!",\ + "[M] has slashed at [src]!") if(prob(8)) flick("noise", flash) adjustBruteLoss(damage) updatehealth() else playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] took a swipe at []!", M, src), 1) + visible_message("[M] took a swipe at [src]!", \ + "[M] took a swipe at [src]!") if ("disarm") if(!(lying)) + M.do_attack_animation(src) if (rand(1,100) <= 85) Stun(7) step(src,get_dir(M,src)) spawn(5) step(src,get_dir(M,src)) playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has forced back []!", M, src), 1) + visible_message("[M] has forced back [src]!",\ + "[M] has forced back [src]!") else playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] attempted to force back []!", M, src), 1) + visible_message("[M] attempted to force back [src]!",\ + "[M] attempted to force back [src]!") return @@ -988,10 +985,9 @@ if(M.Victim) return // can't attack while eating! if (health > -100) - - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red The [M.name] glomps []!", src), 1) + M.do_attack_animation(src) + visible_message("The [M.name] glomps [src]!",\ + "The [M.name] glomps [src]!") var/damage = rand(1, 3) @@ -1022,7 +1018,7 @@ for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) - O.show_message(text("\red The [M.name] has electrified []!", src), 1) + O.show_message(text("The [M.name] has electrified []!", src), 1) flick("noise", flash) @@ -1042,12 +1038,11 @@ if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) - for(var/mob/O in viewers(src, null)) - O.show_message("\red [M] [M.attacktext] [src]!", 1) - M.attack_log += text("\[[time_stamp()]\] attacked [src.name] ([src.ckey])") - src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") + visible_message("[M] [M.attacktext] [src]!") + add_logs(M, src, "attacked", admin=0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) adjustBruteLoss(damage) updatehealth() @@ -1058,21 +1053,22 @@ add_fingerprint(user) if(opened && !wiresexposed && (!istype(user, /mob/living/silicon))) - var/datum/robot_component/cell_component = components["power cell"] if(cell) cell.updateicon() cell.add_fingerprint(user) user.put_in_active_hand(cell) user << "You remove \the [cell]." cell = null - cell_component.wrapped = null - cell_component.installed = 0 updateicon() - else if(cell_component.installed == -1) - cell_component.installed = 0 - var/obj/item/broken_device = cell_component.wrapped - user << "You remove \the [broken_device]." - user.put_in_active_hand(broken_device) + + if(!opened && (!istype(user, /mob/living/silicon))) + if (user.a_intent == "help") + user.visible_message("[user] pets [src]!", \ + "You pet [src]!") + +/mob/living/silicon/robot/attack_paw(mob/user) + + return attack_hand(user) /mob/living/silicon/robot/proc/allowed(mob/M) //check if it doesn't require any access at all diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index ce63e4e9460..148f5ba364d 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -101,6 +101,7 @@ if(M.melee_damage_upper <= 0) M.emote("[M.friendly] \the [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) for(var/mob/O in viewers(src, null)) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 80290e7c514..9702d9b1abb 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -236,18 +236,16 @@ m_type = 2 ..() - - /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) - M.emote("[M.friendly] [src]") + M.emote("me", 1, "[M.friendly] [src]") else + M.do_attack_animation(src) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) - for(var/mob/O in viewers(src, null)) - O.show_message("\red \The [M] [M.attacktext] [src]!", 1) - M.attack_log += text("\[[time_stamp()]\] attacked [src.name] ([src.ckey])") - src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") + visible_message("\The [M] [M.attacktext] [src]!", \ + "\The [M] [M.attacktext] [src]!") + add_logs(M, src, "attacked", admin=0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) adjustBruteLoss(damage) @@ -266,10 +264,8 @@ if("help") if (health > 0) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message("\blue [M] [response_help] [src].") - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + visible_message(" [M] [response_help] [src].") + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) if("grab") if (M == src || anchored) @@ -281,34 +277,51 @@ M.put_in_active_hand(G) - grabbed_by += G G.synch() LAssailant = M - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has grabbed [] passively!", M, src), 1) - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + visible_message("[M] has grabbed [src] passively!") + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) if("harm", "disarm") + M.do_attack_animation(src) + visible_message("[M] [response_harm] [src]!") + playsound(loc, "punch", 25, 1, -1) adjustBruteLoss(harm_intent_damage) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message("\red [M] [response_harm] [src]!") - playsound(loc, "punch", 25, 1, -1) return +/mob/living/simple_animal/attack_paw(mob/living/carbon/monkey/M as mob) + if(!(istype(M, /mob/living/carbon/monkey))) + return // Fix for aliens receiving double messages when attacking simple animals. + + ..() + + switch(M.a_intent) + + if ("help") + if (health > 0) + visible_message(" [M] [response_help] [src].") + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + else + M.do_attack_animation(src) + if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) + return + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!") + if (health > -100) + adjustBruteLoss(rand(1, 3)) + return + /mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M as mob) switch(M.a_intent) if ("help") - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1) + visible_message("[M] caresses [src] with its scythe like arm.") if ("grab") if(M == src || anchored) return @@ -319,18 +332,18 @@ M.put_in_active_hand(G) - grabbed_by += G G.synch() LAssailant = M playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has grabbed [] passively!", M, src), 1) + visible_message("[M] has grabbed [src] passively!") - else + if("harm", "disarm") + M.do_attack_animation(src) var/damage = rand(15, 30) - visible_message("\red [M] has slashed at [src]!") + visible_message("[M] has slashed at [src]!", \ + "[M] has slashed at [src]!") + playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) adjustBruteLoss(damage) return @@ -339,17 +352,19 @@ switch(L.a_intent) if("help") - visible_message("\blue [L] rubs it's head against [src]") + visible_message("[L] rubs its head against [src].") else - + L.do_attack_animation(src) var/damage = rand(5, 10) - visible_message("\red [L] bites [src]!") + visible_message("[L] bites [src]!", \ + "[L] bites [src]!") + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) if(stat != DEAD) - adjustBruteLoss(damage) L.amount_grown = min(L.amount_grown + damage, L.max_grown) + adjustBruteLoss(damage) /mob/living/simple_animal/attack_slime(mob/living/carbon/slime/M as mob) @@ -359,22 +374,24 @@ if(M.Victim) return // can't attack while eating! - visible_message("\red [M.name] glomps [src]!") + if (health > 0) + M.do_attack_animation(src) + visible_message("[M.name] glomps [src]!", \ + "[M.name] glomps [src]!") - var/damage = rand(1, 3) + var/damage = rand(1, 3) - if(M.is_adult) - damage = rand(20, 40) - else - damage = rand(5, 35) + if(M.is_adult) + damage = rand(20, 40) + else + damage = rand(5, 35) - adjustBruteLoss(damage) + adjustBruteLoss(damage) return - -/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri +/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/living/user as mob) //Marker -Agouri if(istype(O, /obj/item/stack/medical)) if(stat != DEAD) var/obj/item/stack/medical/MED = O @@ -403,6 +420,7 @@ harvest() else user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) var/damage = 0 if(O.force) if(O.force >= force_threshold) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index be3b63ba2ab..7fc84fdd8ec 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -855,6 +855,9 @@ var/list/slot_equipment_priority = list( \ return 0 src << message return 1 + +/mob/proc/is_muzzled() + return 0 /mob/proc/show_viewers(message) for(var/mob/M in viewers()) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 2e09cd993a9..5e6f0940fdd 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -365,7 +365,7 @@ //attack with an item - open/close cover, insert cell, or (un)lock interface -/obj/machinery/power/apc/attackby(obj/item/W, mob/user) +/obj/machinery/power/apc/attackby(obj/item/W, mob/living/user) if (istype(user, /mob/living/silicon) && get_dist(src,user)>1) return src.attack_hand(user) @@ -577,6 +577,7 @@ (istype(W, /obj/item/device/multitool) || \ istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/assembly/signaler))) return src.attack_hand(user) + user.do_attack_animation(src) user.visible_message("\red The [src.name] has been hit with the [W.name] by [user.name]!", \ "\red You hit the [src.name] with your [W.name]!", \ "You hear bang") @@ -671,6 +672,8 @@ return if(indestructible) return + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) user.visible_message("\red [user.name] slashes at the [src.name]!", "\blue You slash at the [src.name]!") playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 4d40d213faf..4a8453cd2bd 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -21,7 +21,7 @@ var/obj/machinery/light/newlight = null var/sheets_refunded = 2 -/obj/item/light_fixture_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/light_fixture_frame/attackby(obj/item/weapon/W as obj, mob/living/user as mob) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded ) del(src) @@ -99,7 +99,7 @@ usr << "The casing is closed." return -/obj/machinery/light_construct/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/light_construct/attackby(obj/item/weapon/W as obj, mob/living/user as mob) src.add_fingerprint(user) if (istype(W, /obj/item/weapon/wrench)) if (src.stage == 1) @@ -344,7 +344,7 @@ // attack with item - insert light (if right type), otherwise try to break the light -/obj/machinery/light/attackby(obj/item/W, mob/user) +/obj/machinery/light/attackby(obj/item/W, mob/living/user) //Light replacer code if(istype(W, /obj/item/device/lightreplacer)) @@ -390,7 +390,7 @@ else if(status != LIGHT_BROKEN && status != LIGHT_EMPTY) - + user.do_attack_animation(src) if(prob(1+W.force * 5)) user << "You hit the light, and it smashes!" @@ -405,7 +405,7 @@ broken() else - user << "You hit the light!" + user.visible_message("[user.name] hits the light.") // attempt to stick weapon into light socket else if(status == LIGHT_EMPTY) @@ -471,8 +471,8 @@ user << "\green That object is useless to you." return else if (status == LIGHT_OK||status == LIGHT_BURNED) - for(var/mob/M in viewers(src)) - M.show_message("\red [user.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2) + user.do_attack_animation(src) + visible_message("[user.name] smashed the light!", "You hear a tinkle of breaking glass") broken() return @@ -482,8 +482,8 @@ M << "\red That object is useless to you." return else if (status == LIGHT_OK||status == LIGHT_BURNED) - for(var/mob/O in viewers(src)) - O.show_message("\red [M.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2) + M.do_attack_animation(src) + visible_message("[M.name] smashed the light!", "You hear a tinkle of breaking glass") broken() return // attack with hand - remove tube/bulb diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index c6bec8f69f4..41c4fdf9dc7 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -238,6 +238,14 @@ return */ interact(user, 0) + + // hostile mob escape from disposals + attack_animal(var/mob/living/simple_animal/M) + if(M.environment_smash) + M.do_attack_animation(src) + visible_message("[M.name] smashes \the [src] apart!") + qdel(src) + return // user interaction interact(mob/user, var/ai=0)