Fixes missing cooldowns, missing cult blade sound.

This commit is contained in:
mwerezak
2015-09-09 15:13:30 -04:00
parent 6e66ad307c
commit af52b475ff
21 changed files with 50 additions and 45 deletions

View File

@@ -82,6 +82,7 @@
// Click cooldown // Click cooldown
#define DEFAULT_ATTACK_COOLDOWN 8 //Default timeout for aggressive actions #define DEFAULT_ATTACK_COOLDOWN 8 //Default timeout for aggressive actions
#define DEFAULT_QUICK_COOLDOWN 4
#define MIN_SUPPLIED_LAW_NUMBER 15 #define MIN_SUPPLIED_LAW_NUMBER 15

View File

@@ -10,7 +10,7 @@ item/resolve_attackby() calls the target atom's attackby() proc.
Mobs: Mobs:
mob/living/attackby() after checking for surgery, calls the item's attack() proc. mob/living/attackby() after checking for surgery, calls the item's attack() proc.
item/attack() generates attack logs and calls the mob's attacked_with_item() proc. item/attack() generates attack logs, sets click cooldown and calls the mob's attacked_with_item() proc. If you override this, consider whether you need to set a click cooldown, play attack animations, and generate logs yourself.
mob/attacked_with_item() should then do mob-type specific stuff (like determining hit/miss, handling shields, etc) and then possibly call the item's apply_hit_effect() proc to actually apply the effects of being hit. mob/attacked_with_item() should then do mob-type specific stuff (like determining hit/miss, handling shields, etc) and then possibly call the item's apply_hit_effect() proc to actually apply the effects of being hit.
Item Hit Effects: Item Hit Effects:

View File

@@ -20,16 +20,20 @@
if(ishuman(user)) if(ishuman(user))
var/mob/living/carbon/human/H = user var/mob/living/carbon/human/H = user
var/obj/item/organ/external/affecting = H.get_organ(zone) var/obj/item/organ/external/affecting = H.get_organ(zone)
user << "<span class='warning'>An unexplicable force rips through your [affecting.name], tearing the sword from your grasp!</span>" user << "<span class='danger'>An unexplicable force rips through your [affecting.name], tearing the sword from your grasp!</span>"
else else
user << "<span class='warning'>An unexplicable force rips through you, tearing the sword from your grasp!</span>" user << "<span class='danger'>An unexplicable force rips through you, tearing the sword from your grasp!</span>"
//random amount of damage between half of the blade's force and the full force of the blade. //random amount of damage between half of the blade's force and the full force of the blade.
user.apply_damage(rand(force/2, force), BRUTE, zone, 0) user.apply_damage(rand(force/2, force), BRUTE, zone, 0, sharp=1, edge=1)
user.Weaken(5) user.Weaken(5)
user.drop_from_inventory(src) user.drop_from_inventory(src)
throw_at(get_edge_target_turf(src, pick(alldirs)), rand(1,3), throw_speed) throw_at(get_edge_target_turf(src, pick(alldirs)), rand(1,3), throw_speed)
var/spooky = pick('sound/hallucinations/growl1.ogg', 'sound/hallucinations/growl2.ogg', 'sound/hallucinations/growl3.ogg', 'sound/hallucinations/wail.ogg')
playsound(loc, spooky, 50, 1)
return 1 return 1
/obj/item/weapon/melee/cultblade/pickup(mob/living/user as mob) /obj/item/weapon/melee/cultblade/pickup(mob/living/user as mob)

View File

@@ -441,6 +441,9 @@ var/list/global/slot_flags_enumeration = list(
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>" M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") //BS12 EDIT ALG msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") //BS12 EDIT ALG
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
src.add_fingerprint(user) src.add_fingerprint(user)
//if((CLUMSY in user.mutations) && prob(50)) //if((CLUMSY in user.mutations) && prob(50))
// M = user // M = user

View File

@@ -39,6 +39,9 @@
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to flash [M.name] ([M.ckey])</font>") user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to flash [M.name] ([M.ckey])</font>")
msg_admin_attack("[user.name] ([user.ckey]) Used the [src.name] to flash [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") msg_admin_attack("[user.name] ([user.ckey]) Used the [src.name] to flash [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
if(!clown_check(user)) return if(!clown_check(user)) return
if(broken) if(broken)
user << "<span class='warning'>\The [src] is broken.</span>" user << "<span class='warning'>\The [src] is broken.</span>"
@@ -112,6 +115,9 @@
/obj/item/device/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0) /obj/item/device/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
if(!user || !clown_check(user)) return if(!user || !clown_check(user)) return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(broken) if(broken)
user.show_message("<span class='warning'>The [src.name] is broken</span>", 2) user.show_message("<span class='warning'>The [src.name] is broken</span>", 2)
return return

View File

@@ -79,6 +79,8 @@
user << "<span class='notice'>\The [M]'s pupils narrow slightly, but are still very dilated.</span>" user << "<span class='notice'>\The [M]'s pupils narrow slightly, but are still very dilated.</span>"
else else
user << "<span class='notice'>\The [M]'s pupils narrow.</span>" user << "<span class='notice'>\The [M]'s pupils narrow.</span>"
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) //can be used offensively
flick("flash", M.flash) flick("flash", M.flash)
else else
return ..() return ..()

View File

@@ -42,6 +42,7 @@
/obj/item/weapon/soap/attack(mob/living/target, mob/living/user, var/target_zone) /obj/item/weapon/soap/attack(mob/living/target, mob/living/user, var/target_zone)
if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == "mouth" ) if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == "mouth" )
user.visible_message("<span class='danger'>\The [user] washes \the [target]'s mouth out with soap!</span>") user.visible_message("<span class='danger'>\The [user] washes \the [target]'s mouth out with soap!</span>")
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //prevent spam
return return
..() ..()

View File

@@ -113,6 +113,9 @@
if(!do_after(user,50)) if(!do_after(user,50))
return return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(M)
M.visible_message("<span class='danger'>\The [M] has been injected with \the [src] by \the [user].</span>") M.visible_message("<span class='danger'>\The [M] has been injected with \the [src] by \the [user].</span>")
var/mob/living/carbon/human/H = M var/mob/living/carbon/human/H = M

View File

@@ -41,6 +41,7 @@
if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/) || istype(target, /obj/item/clothing/accessory/storage/) || istype(target, /obj/item/clothing/under)) if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/) || istype(target, /obj/item/clothing/accessory/storage/) || istype(target, /obj/item/clothing/under))
return return
user << "Planting explosives..." user << "Planting explosives..."
user.do_attack_animation(target)
if(do_after(user, 50) && in_range(user, target)) if(do_after(user, 50) && in_range(user, target))
user.drop_item() user.drop_item()

View File

@@ -73,6 +73,9 @@
msg_admin_attack("[key_name(user)] attempted to handcuff [key_name(H)]") msg_admin_attack("[key_name(user)] attempted to handcuff [key_name(H)]")
feedback_add_details("handcuffs","H") feedback_add_details("handcuffs","H")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(H)
user.visible_message("<span class='danger'>\The [user] has put [cuff_type] on \the [H]!</span>") user.visible_message("<span class='danger'>\The [user] has put [cuff_type] on \the [H]!</span>")
// Apply cuffs. // Apply cuffs.

View File

@@ -30,18 +30,18 @@
if (!istype(M, /mob/living/carbon)) if (!istype(M, /mob/living/carbon))
return return
if (user && src.imp) if (user && src.imp)
for (var/mob/O in viewers(M, null)) M.visible_message("<span class='warning'>[user] is attemping to implant [M].</span>")
O.show_message("<span class='warning'>[user] is attemping to implant [M].</span>", 1)
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(M)
var/turf/T1 = get_turf(M) var/turf/T1 = get_turf(M)
if (T1 && ((M == user) || do_after(user, 50))) if (T1 && ((M == user) || do_after(user, 50)))
if(user && M && (get_turf(M) == T1) && src && src.imp) if(user && M && (get_turf(M) == T1) && src && src.imp)
for (var/mob/O in viewers(M, null)) M.visible_message("<span class='warning'>[M] has been implanted by [user].</span>")
O.show_message("<span class='warning'>[M] has been implanted by [user].</span>", 1)
admin_attack_log(user, M, "Implanted using \the [src.name] ([src.imp.name])", "Implanted with \the [src.name] ([src.imp.name])", "used an implanter, [src.name] ([src.imp.name]), on") admin_attack_log(user, M, "Implanted using \the [src.name] ([src.imp.name])", "Implanted with \the [src.name] ([src.imp.name])", "used an implanter, [src.name] ([src.imp.name]), on")
user.show_message("<span class='warning'>You implanted the implant into [M].</span>")
if(src.imp.implanted(M)) if(src.imp.implanted(M))
src.imp.loc = M src.imp.loc = M
src.imp.imp_in = M src.imp.imp_in = M

View File

@@ -82,13 +82,6 @@
return return
return ..() return ..()
/obj/item/weapon/material/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
user << "<span class='warning'>You somehow managed to cut yourself with the [src].</span>"
user.take_organ_damage(20)
return
return ..()
/obj/item/weapon/material/kitchen/utensil/knife/plastic /obj/item/weapon/material/kitchen/utensil/knife/plastic
default_material = "plastic" default_material = "plastic"

View File

@@ -26,33 +26,7 @@
else else
user.take_organ_damage(2*force) user.take_organ_damage(2*force)
return return
/*this is already called in ..() return ..()
src.add_fingerprint(user)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
*/
if (user.a_intent == I_HURT)
if(!..()) return
//playsound(src.loc, "swing_hit", 50, 1, -1)
if (M.stuttering < 8 && (!(HULK in M.mutations)) /*&& (!istype(H:wear_suit, /obj/item/clothing/suit/judgerobe))*/)
M.stuttering = 8
M.Stun(8)
M.Weaken(8)
for(var/mob/O in viewers(M))
if (O.client) O.show_message("<span class='danger'>\The [M] has been beaten with \the [src] by [user]!</span>", 1, "<span class='warning'>You hear someone fall</span>", 2)
else
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1, -1)
M.Stun(5)
M.Weaken(5)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
msg_admin_attack("[key_name(user)] attacked [key_name(user)] with [src.name] (INTENT: [uppertext(user.a_intent)])")
src.add_fingerprint(user)
for(var/mob/O in viewers(M))
if (O.client) O.show_message("<span class='danger'>\The [M] has been stunned with \the [src] by [user]!</span>", 1, "<span class='warning'>You hear someone fall</span>", 2)
//Telescopic baton //Telescopic baton
/obj/item/weapon/melee/telebaton /obj/item/weapon/melee/telebaton

View File

@@ -115,7 +115,7 @@
item_state = "cutters_yellow" item_state = "cutters_yellow"
/obj/item/weapon/wirecutters/attack(mob/living/carbon/C as mob, mob/user as mob) /obj/item/weapon/wirecutters/attack(mob/living/carbon/C as mob, mob/user as mob)
if((C.handcuffed) && (istype(C.handcuffed, /obj/item/weapon/handcuffs/cable))) if(user.a_intent == I_HELP && (C.handcuffed) && (istype(C.handcuffed, /obj/item/weapon/handcuffs/cable)))
usr.visible_message("\The [usr] cuts \the [C]'s restraints with \the [src]!",\ usr.visible_message("\The [usr] cuts \the [C]'s restraints with \the [src]!",\
"You cut \the [C]'s restraints with \the [src]!",\ "You cut \the [C]'s restraints with \the [src]!",\
"You hear cable being cut.") "You hear cable being cut.")

View File

@@ -22,6 +22,9 @@
msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
user << "<span class='danger'>You don't have the dexterity to do this!</span>" user << "<span class='danger'>You don't have the dexterity to do this!</span>"
return return

View File

@@ -72,6 +72,9 @@ var/global/list/stool_cache = list() //haha stool
/obj/item/weapon/stool/attack(mob/M as mob, mob/user as mob) /obj/item/weapon/stool/attack(mob/M as mob, mob/user as mob)
if (prob(5) && istype(M,/mob/living)) if (prob(5) && istype(M,/mob/living))
user.visible_message("<span class='danger'>[user] breaks [src] over [M]'s back!</span>") user.visible_message("<span class='danger'>[user] breaks [src] over [M]'s back!</span>")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
user.remove_from_mob(src) user.remove_from_mob(src)
dismantle() dismantle()
qdel(src) qdel(src)

View File

@@ -38,6 +38,8 @@
/obj/item/clothing/accessory/badge/attack(mob/living/carbon/human/M, mob/living/user) /obj/item/clothing/accessory/badge/attack(mob/living/carbon/human/M, mob/living/user)
if(isliving(user)) if(isliving(user))
user.visible_message("<span class='danger'>[user] invades [M]'s personal space, thrusting [src] into their face insistently.</span>","<span class='danger'>You invade [M]'s personal space, thrusting [src] into their face insistently.</span>") user.visible_message("<span class='danger'>[user] invades [M]'s personal space, thrusting [src] into their face insistently.</span>","<span class='danger'>You invade [M]'s personal space, thrusting [src] into their face insistently.</span>")
user.do_attack_animation(M)
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
//.Holobadges. //.Holobadges.
/obj/item/clothing/accessory/badge/holo /obj/item/clothing/accessory/badge/holo

View File

@@ -256,6 +256,7 @@
user.visible_message("<span class='notice'>You open up the book and show it to [M]. </span>", \ user.visible_message("<span class='notice'>You open up the book and show it to [M]. </span>", \
"<span class='notice'> [user] opens up a book and shows it to [M]. </span>") "<span class='notice'> [user] opens up a book and shows it to [M]. </span>")
M << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[dat]", "window=book") M << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[dat]", "window=book")
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
/* /*

View File

@@ -186,7 +186,7 @@
update_held_icon() update_held_icon()
//update timing //update timing
user.setClickCooldown(4) user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.setMoveCooldown(move_delay) user.setMoveCooldown(move_delay)
next_fire_time = world.time + fire_delay next_fire_time = world.time + fire_delay

View File

@@ -37,6 +37,8 @@
user << "<span class='danger'>You cannot inject a robotic limb.</span>" user << "<span class='danger'>You cannot inject a robotic limb.</span>"
return return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(M)
user << "<span class='notice'>You inject [M] with [src].</span>" user << "<span class='notice'>You inject [M] with [src].</span>"
M << "<span class='notice'>You feel a tiny prick!</span>" M << "<span class='notice'>You feel a tiny prick!</span>"

View File

@@ -176,6 +176,9 @@
else else
user.visible_message("<span class='warning'>[user] begins hunting for an injection port on [target]'s suit!</span>") user.visible_message("<span class='warning'>[user] begins hunting for an injection port on [target]'s suit!</span>")
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(target)
if(!do_mob(user, target, injtime)) if(!do_mob(user, target, injtime))
return return