diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 3656a2d3681..a1ed1bf3648 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -39,7 +39,7 @@ Pipelines + Other Objects -> Pipe network pipe_color = null ..() -/obj/machinery/atmospherics/attackby(atom/A, mob/user as mob) +/obj/machinery/atmospherics/attackby(atom/A, mob/user as mob, params) if(istype(A, /obj/item/device/pipe_painter)) return ..() diff --git a/code/ATMOSPHERICS/chiller.dm b/code/ATMOSPHERICS/chiller.dm index 717a2304ffc..80b0a06e9c6 100644 --- a/code/ATMOSPHERICS/chiller.dm +++ b/code/ATMOSPHERICS/chiller.dm @@ -47,7 +47,7 @@ cell.emp_act(severity) ..(severity) -/obj/machinery/space_heater/air_conditioner/attackby(obj/item/I, mob/user) +/obj/machinery/space_heater/air_conditioner/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/stock_parts/cell)) if(open) if(cell) diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index 0ac8ab62997..843b7dc6518 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -70,7 +70,7 @@ return 1 -/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) anchored = !anchored user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor." diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 4766883a645..9da08d5b117 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -152,7 +152,7 @@ src.updateUsrDialog() return -/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() if (on) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 944ed53de16..6091f7240cc 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -184,7 +184,7 @@ Thus, the two variables affect pump operation are set in New(): if(old_stat != stat) update_icon() -/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index 65eaabe40ab..cd30bf8cd2f 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -171,7 +171,7 @@ Thus, the two variables affect pump operation are set in New(): if(old_stat != stat) update_icon() -/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index ab97a6f2fd8..dbc1e1420b7 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -70,7 +70,7 @@ if(old_stat != stat) update_icon() -/obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if(!istype(W, /obj/item/weapon/wrench)) return ..() diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index 09fe000ec25..fda49cd6efc 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -133,11 +133,11 @@ return null -/obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) 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/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 677e5d4de2a..24ce446edb7 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -156,7 +156,7 @@ Filter types: set_frequency(frequency) ..() -/obj/machinery/atmospherics/trinary/filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/trinary/filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() var/datum/gas_mixture/int_air = return_air() diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 228be72020d..841e9761231 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -114,7 +114,7 @@ return 1 -/obj/machinery/atmospherics/trinary/mixer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/trinary/mixer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() var/datum/gas_mixture/int_air = return_air() diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index 22f9171ba74..da4a9cbb7bd 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -358,7 +358,7 @@ else go_to_side() -/obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() if (istype(src, /obj/machinery/atmospherics/tvalve/digital)) diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index cd92aa19d36..54e49e89378 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -65,7 +65,7 @@ return 1 - attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() var/turf/T = src.loc diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm index 605af38671e..1f5c78de6cf 100644 --- a/code/ATMOSPHERICS/components/unary/thermal_plate.dm +++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm @@ -68,7 +68,7 @@ icon_state = "[prefix]off" return - attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() var/turf/T = src.loc diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 68e0c52892a..d2092ce7e54 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -307,7 +307,7 @@ update_icon() return -/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user) +/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if (WT.remove_fuel(0,user)) @@ -343,7 +343,7 @@ if(old_stat != stat) update_icon() -/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index b62139cf508..05d60c80c96 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -276,7 +276,7 @@ if(old_stat != stat) update_icon() -/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index e8b99a9fb99..d004239acd9 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -299,7 +299,7 @@ else open() -/obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() if (istype(src, /obj/machinery/atmospherics/valve/digital) && src:frequency) diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index 671f0d95158..2a143c80c51 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -62,7 +62,7 @@ ..() -/obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (istype(src, /obj/machinery/atmospherics/pipe/tank)) return ..() if (istype(src, /obj/machinery/atmospherics/pipe/vent)) @@ -1220,7 +1220,7 @@ return null -/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob) +/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob, params) if(istype(W, /obj/item/device/pipe_painter)) return diff --git a/code/__HELPERS/constants.dm b/code/__HELPERS/constants.dm new file mode 100644 index 00000000000..f7db3166605 --- /dev/null +++ b/code/__HELPERS/constants.dm @@ -0,0 +1,2 @@ +var/global/const/TICKS_IN_DAY = 864000 +var/global/const/TICKS_IN_SECOND = 10 \ No newline at end of file diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 5e65bc57536..e7721b4a4a6 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -15,7 +15,6 @@ return if(control_disabled || stat) return - next_move = world.time + 9 if(ismob(A)) ai_actual_track(A) @@ -60,7 +59,6 @@ if(world.time <= next_move) return - next_move = world.time + 9 if(aiCamera.in_camera_mode) aiCamera.camera_mode_off() diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index fb2f17d46a9..3fbd6cde855 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -77,6 +77,7 @@ return M.click_action(A,src) if(restrained()) + changeNext_move(CLICK_CD_HANDCUFFED) //Doing shit in cuffs shall be vey slow RestrainedClickOn(A) return @@ -87,37 +88,26 @@ var/obj/item/W = get_active_hand() if(W == A) - next_move = world.time + 6 - if(W.flags&USEDELAY) - next_move += 5 W.attack_self(src) if(hand) update_inv_l_hand(0) else update_inv_r_hand(0) - return // operate two STORAGE levels deep here (item in backpack in src; NOT item in box in backpack in src) var/sdepth = A.storage_depth(src) if(A == loc || (A in loc) || (sdepth != -1 && sdepth <= 1)) - - // faster access to objects already on you - if(A in contents) - next_move = world.time + 6 // on your person - else - next_move = world.time + 8 // in a box/bag or in your square - // No adjacency needed if(W) - if(W.flags&USEDELAY) - next_move += 5 - var/resolved = A.attackby(W,src) if(!resolved && A && W) W.afterattack(A,src,1,params) // 1 indicates adjacency else + if(ismob(A)) + changeNext_move(CLICK_CD_MELEE) UnarmedAttack(A, 1) + return if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that @@ -126,19 +116,17 @@ // Allows you to click on a box's contents, if that box is on the ground, but no deeper than that sdepth = A.storage_depth_turf() if(isturf(A) || isturf(A.loc) || (sdepth != -1 && sdepth <= 1)) - next_move = world.time + 10 - if(A.Adjacent(src)) // see adjacent.dm if(W) - if(W.flags&USEDELAY) - next_move += 5 - - // Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example) - var/resolved = A.attackby(W,src) + // Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example, params) + var/resolved = A.attackby(W,src,params) if(!resolved && A && W) W.afterattack(A,src,1,params) // 1: clicking something Adjacent else + if(ismob(A)) + changeNext_move(CLICK_CD_MELEE) UnarmedAttack(A, 1) + return else // non-adjacent click if(W) @@ -148,10 +136,12 @@ return +/mob/proc/changeNext_move(num) + next_move = world.time + num + // Default behavior: ignore double clicks, consider them normal clicks instead /mob/proc/DblClickOn(var/atom/A, var/params) - ClickOn(A,params) - + return /* Translates into attack_hand, etc. @@ -164,6 +154,8 @@ in human click code to allow glove touches only at melee range. */ /mob/proc/UnarmedAttack(var/atom/A, var/proximity_flag) + if(ismob(A)) + changeNext_move(CLICK_CD_MELEE) return /* @@ -178,22 +170,12 @@ if(ishuman(src) && (istype(src:gloves, /obj/item/clothing/gloves/yellow/power)) && a_intent == "harm") PowerGlove(A) if(!mutations.len) return - if((M_LASER in mutations) && a_intent == "harm") + if((LASER in mutations) && a_intent == "harm") LaserEyes(A) // moved into a proc below return - else if(M_TK in mutations) - switch(get_dist(src,A)) - if(0) - ; - if(1 to 5) // not adjacent may mean blocked by window - next_move += 2 - if(5 to 7) - next_move += 5 - if(8 to tk_maxrange) - next_move += 10 - else - return - A.attack_tk(src) + else + if(TK in mutations) + A.attack_tk(src) /* Restrained ClickOn @@ -309,7 +291,7 @@ return /mob/living/LaserEyes(atom/A) - next_move = world.time + 6 + changeNext_move(CLICK_CD_RANGE) var/turf/T = get_turf(src) var/turf/U = get_turf(A) diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 4e20ef9ec32..6d497cff462 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -72,21 +72,13 @@ return if(W == A) - next_move = world.time + 8 - if(W.flags&USEDELAY) - next_move += 5 - W.attack_self(src) return // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents) if(A == loc || (A in loc) || (A in contents)) // No adjacency checks - next_move = world.time + 8 - if(W.flags&USEDELAY) - next_move += 5 - - var/resolved = A.attackby(W,src) + var/resolved = A.attackby(W,src,params, params) if(!resolved && A && W) W.afterattack(A,src,1,params) return @@ -97,16 +89,11 @@ // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc)) if(isturf(A) || isturf(A.loc)) if(A.Adjacent(src)) // see adjacent.dm - next_move = world.time + 10 - if(W.flags&USEDELAY) - next_move += 5 - - var/resolved = A.attackby(W, src) + var/resolved = A.attackby(W, src, params, params) if(!resolved && A && W) W.afterattack(A, src, 1, params) return else - next_move = world.time + 10 W.afterattack(A, src, 0, params) return return diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 1e07b13142a..8f8058aa9e3 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -52,7 +52,6 @@ return 1 if(usr.next_move >= world.time) return - usr.next_move = world.time + 6 if(usr.stat || usr.restrained() || usr.stunned || usr.lying) return 1 @@ -87,7 +86,7 @@ /obj/screen/storage name = "storage" -/obj/screen/storage/Click() +/obj/screen/storage/Click(location, control, params) if(world.time <= usr.next_move) return 1 if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) @@ -97,8 +96,7 @@ if(master) var/obj/item/I = usr.get_active_hand() if(I) - master.attackby(I, usr) - usr.next_move = world.time+2 + master.attackby(I, usr, params, params) return 1 /obj/screen/gun @@ -583,12 +581,10 @@ if(iscarbon(usr)) var/mob/living/carbon/C = usr C.activate_hand("r") - usr.next_move = world.time+2 if("l_hand") if(iscarbon(usr)) var/mob/living/carbon/C = usr C.activate_hand("l") - usr.next_move = world.time+2 if("swap") usr:swap_hand() if("hand") @@ -597,5 +593,4 @@ if(usr.attack_ui(slot_id)) usr.update_inv_l_hand(0) usr.update_inv_r_hand(0) - usr.next_move = world.time+6 return 1 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 07fb74b8359..8722906def5 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -4,13 +4,16 @@ return // No comment -/atom/proc/attackby(obj/item/W, mob/user) +/atom/proc/attackby(obj/item/W, mob/living/user, params) return -/atom/movable/attackby(obj/item/W, mob/user) +/atom/movable/attackby(obj/item/W, mob/living/user, params) + 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) +/mob/living/attackby(obj/item/I, mob/user, params) + user.changeNext_move(CLICK_CD_MELEE) if(istype(I) && ismob(user)) I.attack(src, user) @@ -50,7 +53,7 @@ ///////////////////////// var/power = force - if(M_HULK in user.mutations) + if(HULK in user.mutations) power *= 2 if(!istype(M, /mob/living/carbon/human)) @@ -128,6 +131,7 @@ var/showname = "." if(user) showname = " by [user]." + user.do_attack_animation(src) if(!(user in viewers(M, null))) showname = "." @@ -159,7 +163,7 @@ if (istype(location, /turf/simulated)) location:add_blood_floor(M) if("fire") - if (!(M_RESIST_COLD in M.mutations)) + if (!(RESIST_COLD in M.mutations)) M.take_organ_damage(0, power) M << "Aargh it burns!" M.updatehealth() diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 210140bdf9f..79e080e74bd 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -19,8 +19,8 @@ if(client.buildmode) build_click(src, client.buildmode, params, A) return - if(world.time <= next_move) return - next_move = world.time + 8 + if(world.time <= next_move) + return var/list/modifiers = params2list(params) if(modifiers["shift"]) diff --git a/code/_onclick/oldcode.dm b/code/_onclick/oldcode.dm index f81c3f9e37f..954d2eac3fd 100644 --- a/code/_onclick/oldcode.dm +++ b/code/_onclick/oldcode.dm @@ -270,7 +270,7 @@ // ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK ------- var/ignoreAA = 0 //Ignore afterattack(). Surgery uses this. if (t5) - ignoreAA = src.attackby(W, usr) + ignoreAA = src.attackby(W, usr, params) if (W && !ignoreAA) W.afterattack(src, usr, (t5 ? 1 : 0), params) @@ -326,7 +326,7 @@ // ------- YOU ARE NOT RESTRAINED ------- if ((W && !( istype(src, /obj/screen) ))) // ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. ------- - src.attackby(W, usr) + src.attackby(W, usr, params) if (W) W.afterattack(src, usr,, params) else @@ -347,8 +347,8 @@ src.hand_al(usr, usr.hand) else // ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD ------- - if((M_LASER in usr:mutations) && usr:a_intent == "harm" && world.time >= usr.next_move) - // ------- YOU HAVE THE M_LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED ------- + if((LASER in usr:mutations) && usr:a_intent == "harm" && world.time >= usr.next_move) + // ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED ------- var/turf/T = get_turf(usr) var/turf/U = get_turf(src) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index c6527855100..1dd064219a5 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -30,22 +30,13 @@ /mob/living/carbon/human/RangedAttack(var/atom/A) if(!gloves && !mutations.len) return var/obj/item/clothing/gloves/G = gloves - if((M_LASER in mutations) && a_intent == "harm") + if((LASER in mutations) && a_intent == "harm") LaserEyes(A) // moved into a proc below else if(istype(G) && G.Touch(A,0)) // for magic gloves return - else if(M_TK in mutations) - switch(get_dist(src,A)) - if(1 to 5) // not adjacent may mean blocked by window - next_move += 2 - if(5 to 7) - next_move += 5 - if(8 to 15) - next_move += 10 - if(16 to 128) - return + else if(TK in mutations) A.attack_tk(src) */ @@ -78,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/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index c06485ee0ec..5fb552d4384 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -39,13 +39,13 @@ var/const/tk_maxrange = 15 /obj/item/attack_tk(mob/user) if(user.stat || !isturf(loc)) return - if((M_TK in user.mutations) && !user.get_active_hand()) // both should already be true to get here + if((TK in user.mutations) && !user.get_active_hand()) // both should already be true to get here var/obj/item/tk_grab/O = new(src) user.put_in_active_hand(O) O.host = user O.focus_object(src) else - warning("Strange attack_tk(): TK([M_TK in user.mutations]) empty hand([!user.get_active_hand()])") + warning("Strange attack_tk(): TK([TK in user.mutations]) empty hand([!user.get_active_hand()])") return @@ -56,7 +56,7 @@ var/const/tk_maxrange = 15 TK Grab Item (the workhorse of old TK) * If you have not grabbed something, do a normal tk attack - * If you have something, throw it at the target. If it is already adjacent, do a normal attackby() + * If you have something, throw it at the target. If it is already adjacent, do a normal attackby(, params) * If you click what you are holding, or attack_self(), do an attack_self_tk() on it. * Deletes itself if it is ever not in your hand, or if you should have no access to TK. */ @@ -95,33 +95,24 @@ var/const/tk_maxrange = 15 if(focus) focus.attack_self_tk(user) - afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity)//TODO: go over this + afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params)//TODO: go over this if(!target || !user) return if(last_throw+3 > world.time) return if(!host || host != user) del(src) return - if(!(M_TK in host.mutations)) + if(!(TK in host.mutations)) del(src) return if(isobj(target) && !isturf(target.loc)) return var/d = get_dist(user, target) - if(focus) d = max(d,get_dist(user,focus)) // whichever is further - switch(d) - if(0) - ; - if(1 to 5) // not adjacent may mean blocked by window - if(!proximity) - user.next_move += 2 - if(5 to 7) - user.next_move += 5 - if(8 to tk_maxrange) - user.next_move += 10 - else - user << "\blue Your mind won't reach that far." - return + if(focus) + d = max(d,get_dist(user,focus)) // whichever is further + if(d > tk_maxrange) + user << "Your mind won't reach that far." + return if(!focus) focus_object(target, user) @@ -134,7 +125,7 @@ var/const/tk_maxrange = 15 if(!istype(target, /turf) && istype(focus,/obj/item) && target.Adjacent(focus)) var/obj/item/I = focus - var/resolved = target.attackby(I, user, user:get_organ_target()) + var/resolved = target.attackby(I, user, params) if(!resolved && target && I) I.afterattack(target,user,1) // for splashing with beakers @@ -198,7 +189,7 @@ var/const/tk_maxrange = 15 //equip_to_slot_or_del(obj/item/W, slot, del_on_fail = 1) /* if(istype(user, /mob/living/carbon)) - if(user:mutations & M_TK && get_dist(source, user) <= 7) + if(user:mutations & TK && get_dist(source, user) <= 7) if(user:get_active_hand()) return 0 var/X = source:x var/Y = source:y diff --git a/code/controllers/ProcessScheduler/.gitignore b/code/controllers/ProcessScheduler/.gitignore new file mode 100644 index 00000000000..5fe19e425bf --- /dev/null +++ b/code/controllers/ProcessScheduler/.gitignore @@ -0,0 +1,6 @@ +/bower_components +/node_modules +/ProcessScheduler.dmb +/ProcessScheduler.int +/ProcessScheduler.rsc +/*.lk diff --git a/code/controllers/ProcessScheduler/LICENSE-AGPL b/code/controllers/ProcessScheduler/LICENSE-AGPL new file mode 100644 index 00000000000..abaa41e8296 --- /dev/null +++ b/code/controllers/ProcessScheduler/LICENSE-AGPL @@ -0,0 +1,212 @@ +GNU AFFERO GENERAL PUBLIC LICENSE + +Version 3, 19 November 2007 + +Copyright © 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. + +A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. + +The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. + +An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. +"This License" refers to version 3 of the GNU Affero General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based on the Program. + +To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. + +A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + +a) The work must carry prominent notices stating that you modified it, and giving a relevant date. +b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". +c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. +d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + +a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. +b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. +c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. +d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. +e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + +a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or +b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or +c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or +d) Limiting the use for publicity purposes of names of licensors or authors of the material; or +e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or +f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. +All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Remote Network Interaction; Use with the GNU General Public License. +Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. + +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +Also add information on how to contact you by electronic and paper mail. + +If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/LICENSE-CC-BY-NC b/code/controllers/ProcessScheduler/LICENSE-CC-BY-NC new file mode 100644 index 00000000000..d0955f424af --- /dev/null +++ b/code/controllers/ProcessScheduler/LICENSE-CC-BY-NC @@ -0,0 +1 @@ +This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/ProcessScheduler.dme b/code/controllers/ProcessScheduler/ProcessScheduler.dme new file mode 100644 index 00000000000..bf17734cc28 --- /dev/null +++ b/code/controllers/ProcessScheduler/ProcessScheduler.dme @@ -0,0 +1,32 @@ +// DM Environment file for ProcessScheduler.dme. +// All manual changes should be made outside the BEGIN_ and END_ blocks. +// New source code should be placed in .dm files: choose File/New --> Code File. + +// BEGIN_INTERNALS +// END_INTERNALS + +// BEGIN_FILE_DIR +#define FILE_DIR . +// END_FILE_DIR + +// BEGIN_PREFERENCES +// END_PREFERENCES + +// BEGIN_INCLUDE +#include "core\_define.dm" +#include "core\_stubs.dm" +#include "core\process.dm" +#include "core\processScheduler.dm" +#include "core\updateQueue.dm" +#include "core\updateQueueWorker.dm" +#include "test\processSchedulerView.dm" +#include "test\testDyingUpdateQueueProcess.dm" +#include "test\testHarness.dm" +#include "test\testHungProcess.dm" +#include "test\testNiceProcess.dm" +#include "test\testSlowProcess.dm" +#include "test\testUpdateQueue.dm" +#include "test\testUpdateQueueProcess.dm" +#include "test\testZombieProcess.dm" +// END_INCLUDE + diff --git a/code/controllers/ProcessScheduler/README.md b/code/controllers/ProcessScheduler/README.md new file mode 100644 index 00000000000..610800ba374 --- /dev/null +++ b/code/controllers/ProcessScheduler/README.md @@ -0,0 +1,86 @@ +ProcessScheduler +================ +A Goonstation release, maintained by Volundr + +##SUMMARY + +This is a mostly self-contained, fairly well-documented implementation of the main loop process architecture in use in Goonstation. + +##LICENSE + +This work is released under the following licenses. + +[![Creative Commons License](https://licensebuttons.net/l/by-nc/4.0/80x15.png)](http://creativecommons.org/licenses/by-nc/4.0/) + +This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. The complete text of this license is included in the file LICENSE-CC-BY-NC. + + +[![Affero GPL Version 3](http://www.gnu.org/graphics/agplv3-88x31.png)](http://www.gnu.org/licenses/agpl-3.0.html) + +This work is licensed under the Affero General Public License 3.0. The complete text of the license is included in the file LICENSE-AGPL. + +##INSTALLATION + +To integrate the process scheduler to your codebase, you will not need anything except the contents of the core/ folder. The rest of the project is simply for testing and to provide an example for the process scheduler code. + +### Test project setup +To compile and run the test project, you will require: + +- node.js +- BYOND + +Clone the repository to a path of your choosing, then change directory to it and execute: + +``` +npm install -g +bower install -g +``` + +Then you can either compile with DM or open the DM environment in DreamMaker and compile/run from there. + +##USAGE + +###BASICS +To use the process scheduler in your SS13 codebase, you'll need: + +- core/_defines.dm +- core/_stubs.dm +- core/process.dm +- core/processScheduler.dm +- core/processScheduler.js +- core/updateQueue.dm +- core/updateQueueWorker.dm + +To integrate, you can copy the contents of _defines.dm into your global defines file. Most ss13 codebases already have the code from _stubs.dm. + +The processScheduler is intended as a replacement for the old master_controller from r4407 and other fork codebases. To implement it, you need only to add the source files to your DM environment, and add the following code into world.New, above where the old master_controller is initialized. + +``` +processScheduler = new +processScheduler.setup() +processScheduler.start() +``` + +The processScheduler will automatically find all subtypes of process, and begin processing them. + +The interface code in test/processSchedulerView.dm is simply an example frontend, and can easily be rebuilt to use other styles, and/or render simple html without using javascript for refreshing the panel and killing processes. + +###DETAILS + +To implement a process, you have two options: + +1. Implement a raw loop-style processor +2. Implement an updateQueue processor + +There are clear examples of both of these paradigms in the code provided. Both styles are valid, but for processes that are just a loop calling an update proc on a bunch of objects, you should use the updateQueue. + +The updateQueue works by spawn(0)'ing your specified update proc, but it only puts one instance in the scheduler at a time. Examine the code for more details. The overall effect of this is that it doesn't block, and it lets update loops work concurrently. It enables a much smoother user experience. + +##Contributing + +I welcome pull requests and issue reports, and will try to merge/fix them as I have time. + +### Licensing for code submitted via PR: + +By submitting a pull request, you agree to release all original code submitted in the pull request under the [MIT License](http://opensource.org/licenses/MIT). You also agree that any code submitted is either your own work, or is public domain or under a equally or less restrictive license than the MIT license, or that you have the express written permission of the authors of the submitted code to submit the pull request. + diff --git a/code/controllers/ProcessScheduler/bower.json b/code/controllers/ProcessScheduler/bower.json new file mode 100644 index 00000000000..9a6be56140d --- /dev/null +++ b/code/controllers/ProcessScheduler/bower.json @@ -0,0 +1,30 @@ +{ + "name": "ProcessScheduler", + "main": "ProcessScheduler.js", + "version": "1.0.0", + "homepage": "https://github.com/goonstation/ProcessScheduler", + "authors": [ + "Volundr " + ], + "description": "BYOND SS13 Process Scheduler", + "keywords": [ + "byond", + "ss13", + "process", + "scheduler" + ], + "license": "CC-BY-NC", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "private": true, + "dependencies": { + "bootstrap2.3.2": "~2.3.2", + "jquery": "1.11.1", + "json2": "*" + } +} diff --git a/code/controllers/ProcessScheduler/core/_define.dm b/code/controllers/ProcessScheduler/core/_define.dm new file mode 100644 index 00000000000..f0165c98708 --- /dev/null +++ b/code/controllers/ProcessScheduler/core/_define.dm @@ -0,0 +1,17 @@ +// Process status defines +#define PROCESS_STATUS_IDLE 1 +#define PROCESS_STATUS_QUEUED 2 +#define PROCESS_STATUS_RUNNING 3 +#define PROCESS_STATUS_MAYBE_HUNG 4 +#define PROCESS_STATUS_PROBABLY_HUNG 5 +#define PROCESS_STATUS_HUNG 6 + +// Process time thresholds +#define PROCESS_DEFAULT_HANG_WARNING_TIME 300 // 30 seconds +#define PROCESS_DEFAULT_HANG_ALERT_TIME 600 // 60 seconds +#define PROCESS_DEFAULT_HANG_RESTART_TIME 900 // 90 seconds +#define PROCESS_DEFAULT_SCHEDULE_INTERVAL 50 // 50 ticks +#define PROCESS_DEFAULT_SLEEP_INTERVAL 2 // 2 ticks +#define PROCESS_DEFAULT_CPU_THRESHOLD 90 // 90% + +//#define UPDATE_QUEUE_DEBUG \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/core/_stubs.dm b/code/controllers/ProcessScheduler/core/_stubs.dm new file mode 100644 index 00000000000..326fd29ac2a --- /dev/null +++ b/code/controllers/ProcessScheduler/core/_stubs.dm @@ -0,0 +1,38 @@ +/** + * _stubs.dm + * + * This file contains constructs that the process scheduler expects to exist + * in a standard ss13 fork. + */ +/* +/** + * message_admins + * + * sends a message to admins + */ +/proc/message_admins(msg) + world << msg +*/ +/** + * logTheThing + * + * In goonstation, this proc writes a message to either the world log or diary. + * + * Blame Keelin. + */ +/proc/logTheThing(type, source, target, text, diaryType) + if(diaryType) + world << "Diary: \[[diaryType]:[type]] [text]" + else + world << "Log: \[[type]] [text]" + +/** + * var/disposed + * + * In goonstation, disposed is set to 1 after an object enters the delete queue + * or the object is placed in an object pool (effectively out-of-play so to speak) + */ +/datum/var/disposed +// Garbage collection (controller). +/datum/var/gcDestroyed +/datum/var/timeDestroyed \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/core/process.dm b/code/controllers/ProcessScheduler/core/process.dm new file mode 100644 index 00000000000..89048113d30 --- /dev/null +++ b/code/controllers/ProcessScheduler/core/process.dm @@ -0,0 +1,317 @@ +// Process + +/datum/controller/process + /** + * State vars + */ + // Main controller ref + var/tmp/datum/controller/processScheduler/main + + // 1 if process is not running or queued + var/tmp/idle = 1 + + // 1 if process is queued + var/tmp/queued = 0 + + // 1 if process is running + var/tmp/running = 0 + + // 1 if process is blocked up + var/tmp/hung = 0 + + // 1 if process was killed + var/tmp/killed = 0 + + // Status text var + var/tmp/status + + // Previous status text var + var/tmp/previousStatus + + // 1 if process is disabled + var/tmp/disabled = 0 + + /** + * Config vars + */ + // Process name + var/name + + // Process schedule interval + // This controls how often the process would run under ideal conditions. + // If the process scheduler sees that the process has finished, it will wait until + // this amount of time has elapsed from the start of the previous run to start the + // process running again. + var/tmp/schedule_interval = PROCESS_DEFAULT_SCHEDULE_INTERVAL // run every 50 ticks + + // Process sleep interval + // This controls how often the process will yield (call sleep(0)) while it is running. + // Every concurrent process should sleep periodically while running in order to allow other + // processes to execute concurrently. + var/tmp/sleep_interval = PROCESS_DEFAULT_SLEEP_INTERVAL + + // hang_warning_time - this is the time (in 1/10 seconds) after which the server will begin to show "maybe hung" in the context window + var/tmp/hang_warning_time = PROCESS_DEFAULT_HANG_WARNING_TIME + + // hang_alert_time - After this much time(in 1/10 seconds), the server will send an admin debug message saying the process may be hung + var/tmp/hang_alert_time = PROCESS_DEFAULT_HANG_ALERT_TIME + + // hang_restart_time - After this much time(in 1/10 seconds), the server will automatically kill and restart the process. + var/tmp/hang_restart_time = PROCESS_DEFAULT_HANG_RESTART_TIME + + // cpu_threshold - if world.cpu >= cpu_threshold, scheck() will call sleep(1) to defer further work until the next tick. This keeps a process from driving a tick into overtime (causing perceptible lag) + var/tmp/cpu_threshold = PROCESS_DEFAULT_CPU_THRESHOLD + + // How many times in the current run has the process deferred work till the next tick? + var/tmp/cpu_defer_count = 0 + + /** + * recordkeeping vars + */ + + // Records the time (server ticks) at which the process last finished sleeping + var/tmp/last_slept = 0 + + // Records the time (s-ticks) at which the process last began running + var/tmp/run_start = 0 + + // Records the number of times this process has been killed and restarted + var/tmp/times_killed + + // Tick count + var/tmp/ticks = 0 + + var/tmp/last_task = "" + + var/tmp/last_object + +datum/controller/process/New(var/datum/controller/processScheduler/scheduler) + ..() + main = scheduler + previousStatus = "idle" + idle() + name = "process" + schedule_interval = 50 + sleep_interval = 2 + last_slept = 0 + run_start = 0 + ticks = 0 + last_task = 0 + last_object = null + +datum/controller/process/proc/started() + // Initialize last_slept so we can know when to sleep + last_slept = world.timeofday + + // Initialize run_start so we can detect hung processes. + run_start = world.timeofday + + // Initialize defer count + cpu_defer_count = 0 + + running() + main.processStarted(src) + + onStart() + +datum/controller/process/proc/finished() + ticks++ + idle() + main.processFinished(src) + + onFinish() + +datum/controller/process/proc/doWork() + +datum/controller/process/proc/setup() + +datum/controller/process/proc/process() + started() + doWork() + finished() + +datum/controller/process/proc/running() + idle = 0 + queued = 0 + running = 1 + hung = 0 + setStatus(PROCESS_STATUS_RUNNING) + +datum/controller/process/proc/idle() + queued = 0 + running = 0 + idle = 1 + hung = 0 + setStatus(PROCESS_STATUS_IDLE) + +datum/controller/process/proc/queued() + idle = 0 + running = 0 + queued = 1 + hung = 0 + setStatus(PROCESS_STATUS_QUEUED) + +datum/controller/process/proc/hung() + hung = 1 + setStatus(PROCESS_STATUS_HUNG) + +datum/controller/process/proc/handleHung() + var/datum/lastObj = last_object + var/lastObjType = "null" + if(istype(lastObj)) + lastObjType = lastObj.type + + // If world.timeofday has rolled over, then we need to adjust. + if (world.timeofday < run_start) + run_start -= 864000 + + var/msg = "[name] process hung at tick #[ticks]. Process was unresponsive for [(world.timeofday - run_start) / 10] seconds and was restarted. Last task: [last_task]. Last Object Type: [lastObjType]" + logTheThing("debug", null, null, msg) + logTheThing("diary", null, null, msg, "debug") + message_admins(msg) + + main.restartProcess(src.name) + +datum/controller/process/proc/kill() + if (!killed) + var/msg = "[name] process was killed at tick #[ticks]." + logTheThing("debug", null, null, msg) + logTheThing("diary", null, null, msg, "debug") + //finished() + + // Allow inheritors to clean up if needed + onKill() + + killed = TRUE + + // This should del + del(src) + +datum/controller/process/proc/scheck(var/tickId = 0) + if (killed) + // The kill proc is the only place where killed is set. + // The kill proc should have deleted this datum, and all sleeping procs that are + // owned by it. + CRASH("A killed process is still running somehow...") + + // For each tick the process defers, it increments the cpu_defer_count so we don't + // defer indefinitely + if (world.cpu >= cpu_threshold + cpu_defer_count * 10) + sleep(1) + cpu_defer_count++ + last_slept = world.timeofday + else + // If world.timeofday has rolled over, then we need to adjust. + if (world.timeofday < last_slept) + last_slept -= 864000 + + if (world.timeofday > last_slept + sleep_interval) + // If we haven't slept in sleep_interval ticks, sleep to allow other work to proceed. + sleep(0) + last_slept = world.timeofday + +datum/controller/process/proc/update() + // Clear delta + if(previousStatus != status) + setStatus(status) + + var/elapsedTime = getElapsedTime() + + if (elapsedTime > hang_restart_time) + hung() + else if (elapsedTime > hang_alert_time) + setStatus(PROCESS_STATUS_PROBABLY_HUNG) + else if (elapsedTime > hang_warning_time) + setStatus(PROCESS_STATUS_MAYBE_HUNG) + +datum/controller/process/proc/getElapsedTime() + if (world.timeofday < run_start) + return world.timeofday - (run_start - 864000) + return world.timeofday - run_start + +datum/controller/process/proc/tickDetail() + return + +datum/controller/process/proc/getContext() + return "[name][main.averageRunTime(src)][main.last_run_time[src]][main.highest_run_time[src]][ticks]\n" + +datum/controller/process/proc/getContextData() + return list( + "name" = name, + "averageRunTime" = main.averageRunTime(src), + "lastRunTime" = main.last_run_time[src], + "highestRunTime" = main.highest_run_time[src], + "ticks" = ticks, + "schedule" = schedule_interval, + "status" = getStatusText(), + "disabled" = disabled + ) + +datum/controller/process/proc/getStatus() + return status + +datum/controller/process/proc/getStatusText(var/s = 0) + if(!s) + s = status + switch(s) + if(PROCESS_STATUS_IDLE) + return "idle" + if(PROCESS_STATUS_QUEUED) + return "queued" + if(PROCESS_STATUS_RUNNING) + return "running" + if(PROCESS_STATUS_MAYBE_HUNG) + return "maybe hung" + if(PROCESS_STATUS_PROBABLY_HUNG) + return "probably hung" + if(PROCESS_STATUS_HUNG) + return "HUNG" + else + return "UNKNOWN" + +datum/controller/process/proc/getPreviousStatus() + return previousStatus + +datum/controller/process/proc/getPreviousStatusText() + return getStatusText(previousStatus) + +datum/controller/process/proc/setStatus(var/newStatus) + previousStatus = status + status = newStatus + +datum/controller/process/proc/setLastTask(var/task, var/object) + last_task = task + last_object = object + +datum/controller/process/proc/_copyStateFrom(var/datum/controller/process/target) + main = target.main + name = target.name + schedule_interval = target.schedule_interval + sleep_interval = target.sleep_interval + last_slept = 0 + run_start = 0 + times_killed = target.times_killed + ticks = target.ticks + last_task = target.last_task + last_object = target.last_object + copyStateFrom(target) + +datum/controller/process/proc/copyStateFrom(var/datum/controller/process/target) + +datum/controller/process/proc/onKill() + +datum/controller/process/proc/onStart() + +datum/controller/process/proc/onFinish() + +datum/controller/process/proc/disable() + disabled = 1 + +datum/controller/process/proc/enable() + disabled = 0 + +/datum/controller/process/proc/getLastRunTime() + return main.getProcessLastRunTime(src) + +/datum/controller/process/proc/getTicks() + return ticks diff --git a/code/controllers/ProcessScheduler/core/processScheduler.dm b/code/controllers/ProcessScheduler/core/processScheduler.dm new file mode 100644 index 00000000000..1be24045938 --- /dev/null +++ b/code/controllers/ProcessScheduler/core/processScheduler.dm @@ -0,0 +1,320 @@ +// Singleton instance of game_controller_new, setup in world.New() +var/global/datum/controller/processScheduler/processScheduler + +/datum/controller/processScheduler + // Processes known by the scheduler + var/tmp/datum/controller/process/list/processes = new + + // Processes that are currently running + var/tmp/datum/controller/process/list/running = new + + // Processes that are idle + var/tmp/datum/controller/process/list/idle = new + + // Processes that are queued to run + var/tmp/datum/controller/process/list/queued = new + + // Process name -> process object map + var/tmp/datum/controller/process/list/nameToProcessMap = new + + // Process last start times + var/tmp/datum/controller/process/list/last_start = new + + // Process last run durations + var/tmp/datum/controller/process/list/last_run_time = new + + // Per process list of the last 20 durations + var/tmp/datum/controller/process/list/last_twenty_run_times = new + + // Process highest run time + var/tmp/datum/controller/process/list/highest_run_time = new + + // Sleep 1 tick -- This may be too aggressive. + var/tmp/scheduler_sleep_interval = 1 + + // Controls whether the scheduler is running or not + var/tmp/isRunning = 0 + + // Setup for these processes will be deferred until all the other processes are set up. + var/tmp/list/deferredSetupList = new + +/** + * deferSetupFor + * @param path processPath + * If a process needs to be initialized after everything else, add it to + * the deferred setup list. On goonstation, only the ticker needs to have + * this treatment. + */ +/datum/controller/processScheduler/proc/deferSetupFor(var/processPath) + if (!(processPath in deferredSetupList)) + deferredSetupList += processPath + +/datum/controller/processScheduler/proc/setup() + // There can be only one + if(processScheduler && (processScheduler != src)) + del(src) + return 0 + + var/process + // Add all the processes we can find, except for the ticker + for (process in typesof(/datum/controller/process) - /datum/controller/process) + if (!(process in deferredSetupList)) + addProcess(new process(src)) + + for (process in deferredSetupList) + addProcess(new process(src)) + +/datum/controller/processScheduler/proc/start() + isRunning = 1 + spawn(0) + process() + +/datum/controller/processScheduler/proc/process() + while(isRunning) + checkRunningProcesses() + queueProcesses() + runQueuedProcesses() + sleep(scheduler_sleep_interval) + +/datum/controller/processScheduler/proc/stop() + isRunning = 0 + +/datum/controller/processScheduler/proc/checkRunningProcesses() + for(var/datum/controller/process/p in running) + p.update() + + if (isnull(p)) // Process was killed + continue + + var/status = p.getStatus() + var/previousStatus = p.getPreviousStatus() + + // Check status changes + if(status != previousStatus) + //Status changed. + + switch(status) + if(PROCESS_STATUS_MAYBE_HUNG) + message_admins("Process '[p.name]' is [p.getStatusText(status)].") + if(PROCESS_STATUS_PROBABLY_HUNG) + message_admins("Process '[p.name]' is [p.getStatusText(status)].") + if(PROCESS_STATUS_HUNG) + message_admins("Process '[p.name]' is [p.getStatusText(status)].") + p.handleHung() + +/datum/controller/processScheduler/proc/queueProcesses() + for(var/datum/controller/process/p in processes) + // Don't double-queue, don't queue running processes + if (p.disabled || p.running || p.queued || !p.idle) + continue + + // If world.timeofday has rolled over, then we need to adjust. + if (world.timeofday < last_start[p]) + last_start[p] -= 864000 + + // If the process should be running by now, go ahead and queue it + if (world.timeofday > last_start[p] + p.schedule_interval) + setQueuedProcessState(p) + +/datum/controller/processScheduler/proc/runQueuedProcesses() + for(var/datum/controller/process/p in queued) + runProcess(p) + +/datum/controller/processScheduler/proc/addProcess(var/datum/controller/process/process) + processes.Add(process) + process.idle() + idle.Add(process) + + // init recordkeeping vars + last_start.Add(process) + last_start[process] = 0 + last_run_time.Add(process) + last_run_time[process] = 0 + last_twenty_run_times.Add(process) + last_twenty_run_times[process] = list() + highest_run_time.Add(process) + highest_run_time[process] = 0 + + // init starts and stops record starts + recordStart(process, 0) + recordEnd(process, 0) + + // Set up process + process.setup() + + // Save process in the name -> process map + nameToProcessMap[process.name] = process + +/datum/controller/processScheduler/proc/replaceProcess(var/datum/controller/process/oldProcess, var/datum/controller/process/newProcess) + processes.Remove(oldProcess) + processes.Add(newProcess) + + newProcess.idle() + idle.Remove(oldProcess) + running.Remove(oldProcess) + queued.Remove(oldProcess) + idle.Add(newProcess) + + last_start.Remove(oldProcess) + last_start.Add(newProcess) + last_start[newProcess] = 0 + + last_run_time.Add(newProcess) + last_run_time[newProcess] = last_run_time[oldProcess] + last_run_time.Remove(oldProcess) + + last_twenty_run_times.Add(newProcess) + last_twenty_run_times[newProcess] = last_twenty_run_times[oldProcess] + last_twenty_run_times.Remove(oldProcess) + + highest_run_time.Add(newProcess) + highest_run_time[newProcess] = highest_run_time[oldProcess] + highest_run_time.Remove(oldProcess) + + recordStart(newProcess, 0) + recordEnd(newProcess, 0) + + nameToProcessMap[newProcess.name] = newProcess + + +/datum/controller/processScheduler/proc/runProcess(var/datum/controller/process/process) + spawn(0) + process.process() + +/datum/controller/processScheduler/proc/processStarted(var/datum/controller/process/process) + setRunningProcessState(process) + recordStart(process) + +/datum/controller/processScheduler/proc/processFinished(var/datum/controller/process/process) + setIdleProcessState(process) + recordEnd(process) + +/datum/controller/processScheduler/proc/setIdleProcessState(var/datum/controller/process/process) + if (process in running) + running -= process + if (process in queued) + queued -= process + if (!(process in idle)) + idle += process + + process.idle() + +/datum/controller/processScheduler/proc/setQueuedProcessState(var/datum/controller/process/process) + if (process in running) + running -= process + if (process in idle) + idle -= process + if (!(process in queued)) + queued += process + + // The other state transitions are handled internally by the process. + process.queued() + +/datum/controller/processScheduler/proc/setRunningProcessState(var/datum/controller/process/process) + if (process in queued) + queued -= process + if (process in idle) + idle -= process + if (!(process in running)) + running += process + + process.running() + +/datum/controller/processScheduler/proc/recordStart(var/datum/controller/process/process, var/time = null) + if (isnull(time)) + time = world.timeofday + + last_start[process] = time + +/datum/controller/processScheduler/proc/recordEnd(var/datum/controller/process/process, var/time = null) + if (isnull(time)) + time = world.timeofday + + // If world.timeofday has rolled over, then we need to adjust. + if (time < last_start[process]) + last_start[process] -= 864000 + + var/lastRunTime = time - last_start[process] + + if(lastRunTime < 0) + lastRunTime = 0 + + recordRunTime(process, lastRunTime) + +/** + * recordRunTime + * Records a run time for a process + */ +/datum/controller/processScheduler/proc/recordRunTime(var/datum/controller/process/process, time) + last_run_time[process] = time + if(time > highest_run_time[process]) + highest_run_time[process] = time + + var/list/lastTwenty = last_twenty_run_times[process] + if (lastTwenty.len == 20) + lastTwenty.Cut(1, 2) + lastTwenty.len++ + lastTwenty[lastTwenty.len] = time + +/** + * averageRunTime + * returns the average run time (over the last 20) of the process + */ +/datum/controller/processScheduler/proc/averageRunTime(var/datum/controller/process/process) + var/lastTwenty = last_twenty_run_times[process] + + var/t = 0 + var/c = 0 + for(var/time in lastTwenty) + t += time + c++ + + if(c > 0) + return t / c + return c + +/datum/controller/processScheduler/proc/getStatusData() + var/list/data = new + + for (var/datum/controller/process/p in processes) + data.len++ + data[data.len] = p.getContextData() + + return data + +/datum/controller/processScheduler/proc/getProcessCount() + return processes.len + +/datum/controller/processScheduler/proc/hasProcess(var/processName as text) + if (nameToProcessMap[processName]) + return 1 + +/datum/controller/processScheduler/proc/killProcess(var/processName as text) + restartProcess(processName) + +/datum/controller/processScheduler/proc/restartProcess(var/processName as text) + if (hasProcess(processName)) + var/datum/controller/process/oldInstance = nameToProcessMap[processName] + var/datum/controller/process/newInstance = new oldInstance.type(src) + newInstance._copyStateFrom(oldInstance) + replaceProcess(oldInstance, newInstance) + oldInstance.kill() + +/datum/controller/processScheduler/proc/enableProcess(var/processName as text) + if (hasProcess(processName)) + var/datum/controller/process/process = nameToProcessMap[processName] + process.enable() + +/datum/controller/processScheduler/proc/disableProcess(var/processName as text) + if (hasProcess(processName)) + var/datum/controller/process/process = nameToProcessMap[processName] + process.disable() + +/datum/controller/processScheduler/proc/getProcess(var/name) + return nameToProcessMap[name] + +/datum/controller/processScheduler/proc/getProcessLastRunTime(var/datum/controller/process/process) + return last_run_time[process] + +/datum/controller/processScheduler/proc/getIsRunning() + return isRunning diff --git a/code/controllers/ProcessScheduler/core/updateQueue.dm b/code/controllers/ProcessScheduler/core/updateQueue.dm new file mode 100644 index 00000000000..118b6692b5a --- /dev/null +++ b/code/controllers/ProcessScheduler/core/updateQueue.dm @@ -0,0 +1,127 @@ +/** + * updateQueue.dm + */ + +#ifdef UPDATE_QUEUE_DEBUG +#define uq_dbg(text) world << text +#else +#define uq_dbg(text) +#endif +/datum/updateQueue + var/tmp/list/objects + var/tmp/previousStart + var/tmp/procName + var/tmp/list/arguments + var/tmp/datum/updateQueueWorker/currentWorker + var/tmp/workerTimeout + var/tmp/adjustedWorkerTimeout + var/tmp/currentKillCount + var/tmp/totalKillCount + +/datum/updateQueue/New(list/objects = list(), procName = "update", list/arguments = list(), workerTimeout = 2, inplace = 0) + ..() + + uq_dbg("Update queue created.") + + // Init proc allows for recycling the worker. + init(objects = objects, procName = procName, arguments = arguments, workerTimeout = workerTimeout, inplace = inplace) + +/** + * init + * @param list objects objects to update + * @param text procName the proc to call on each item in the object list + * @param list arguments optional arguments to pass to the update proc + * @param number workerTimeout number of ticks to wait for an update to + finish before forking a new update worker + * @param bool inplace whether the updateQueue should make a copy of objects. + the internal list will be modified, so it is usually + a good idea to leave this alone. Default behavior is to + copy. + */ +/datum/updateQueue/proc/init(list/objects = list(), procName = "update", list/arguments = list(), workerTimeout = 2, inplace = 0) + uq_dbg("Update queue initialization started.") + + if (!inplace) + // Make an internal copy of the list so we're not modifying the original. + initList(objects) + else + src.objects = objects + + // Init vars + src.procName = procName + src.arguments = arguments + src.workerTimeout = workerTimeout + + adjustedWorkerTimeout = workerTimeout + currentKillCount = 0 + totalKillCount = 0 + + uq_dbg("Update queue initialization finished. procName = '[procName]'") + +/datum/updateQueue/proc/initList(list/toCopy) + /** + * We will copy the list in reverse order, as our doWork proc + * will access them by popping an element off the end of the list. + * This ends up being quite a lot faster than taking elements off + * the head of the list. + */ + objects = new + + uq_dbg("Copying [toCopy.len] items for processing.") + + for(var/i=toCopy.len,i>0,) + objects.len++ + objects[objects.len] = toCopy[i--] + +/datum/updateQueue/proc/Run() + uq_dbg("Starting run...") + + startWorker() + while (istype(currentWorker) && !currentWorker.finished) + sleep(2) + checkWorker() + + uq_dbg("UpdateQueue completed run.") + +/datum/updateQueue/proc/checkWorker() + if(istype(currentWorker)) + // If world.timeofday has rolled over, then we need to adjust. + if(world.timeofday < currentWorker.lastStart) + currentWorker.lastStart -= 864000 + + if(world.timeofday - currentWorker.lastStart > adjustedWorkerTimeout) + // This worker is a bit slow, let's spawn a new one and kill the old one. + uq_dbg("Current worker is lagging... starting a new one.") + killWorker() + startWorker() + else // No worker! + uq_dbg("update queue ended up without a worker... starting a new one...") + startWorker() + +/datum/updateQueue/proc/startWorker() + // only run the worker if we have objects to work on + if(objects.len) + uq_dbg("Starting worker process.") + + // No need to create a fresh worker if we already have one... + if (istype(currentWorker)) + currentWorker.init(objects, procName, arguments) + else + currentWorker = new(objects, procName, arguments) + currentWorker.start() + else + uq_dbg("Queue is empty. No worker was started.") + currentWorker = null + +/datum/updateQueue/proc/killWorker() + // Kill the worker + currentWorker.kill() + currentWorker = null + // After we kill a worker, yield so that if the worker's been tying up the cpu, other stuff can immediately resume + sleep(-1) + currentKillCount++ + totalKillCount++ + if (currentKillCount >= 3) + uq_dbg("[currentKillCount] workers have been killed with a timeout of [adjustedWorkerTimeout]. Increasing worker timeout to compensate.") + adjustedWorkerTimeout++ + currentKillCount = 0 \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/core/updateQueueWorker.dm b/code/controllers/ProcessScheduler/core/updateQueueWorker.dm new file mode 100644 index 00000000000..66f66bbcc01 --- /dev/null +++ b/code/controllers/ProcessScheduler/core/updateQueueWorker.dm @@ -0,0 +1,83 @@ +datum/updateQueueWorker + var/tmp/list/objects + var/tmp/killed + var/tmp/finished + var/tmp/procName + var/tmp/list/arguments + var/tmp/lastStart + var/tmp/cpuThreshold + +datum/updateQueueWorker/New(var/list/objects, var/procName, var/list/arguments, var/cpuThreshold = 90) + ..() + uq_dbg("updateQueueWorker created.") + + init(objects, procName, arguments, cpuThreshold) + +datum/updateQueueWorker/proc/init(var/list/objects, var/procName, var/list/arguments, var/cpuThreshold = 90) + src.objects = objects + src.procName = procName + src.arguments = arguments + src.cpuThreshold = cpuThreshold + + killed = 0 + finished = 0 + +datum/updateQueueWorker/proc/doWork() + // If there's nothing left to execute or we were killed, mark finished and return. + if (!objects || !objects.len) return finished() + + lastStart = world.timeofday // Absolute number of ticks since the world started up + + var/datum/object = objects[objects.len] // Pull out the object + objects.len-- // Remove the object from the list + + if (istype(object) && !isturf(object) && !object.disposed && isnull(object.gcDestroyed)) // We only work with real objects + call(object, procName)(arglist(arguments)) + + // If there's nothing left to execute + // or we were killed while running the above code, mark finished and return. + if (!objects || !objects.len) return finished() + + if (world.cpu > cpuThreshold) + // We don't want to force a tick into overtime! + // If the tick is about to go overtime, spawn the next update to go + // in the next tick. + uq_dbg("tick went into overtime with world.cpu = [world.cpu], deferred next update to next tick [1+(world.time / world.tick_lag)]") + + spawn(1) + doWork() + else + spawn(0) // Execute anonymous function immediately as if we were in a while loop... + doWork() + +datum/updateQueueWorker/proc/finished() + uq_dbg("updateQueueWorker finished.") + /** + * If the worker was killed while it was working on something, it + * should delete itself when it finally finishes working on it. + * Meanwhile, the updateQueue will have proceeded on with the rest of + * the queue. This will also terminate the spawned function that was + * created in the kill() proc. + */ + if(killed) + del(src) + + finished = 1 + +datum/updateQueueWorker/proc/kill() + uq_dbg("updateQueueWorker killed.") + killed = 1 + objects = null + + /** + * If the worker is not done in 30 seconds after it's killed, + * we'll forcibly delete it, causing the anonymous function it was + * running to be terminated. Hasta la vista, baby. + */ + spawn(300) + del(src) + +datum/updateQueueWorker/proc/start() + uq_dbg("updateQueueWorker started.") + spawn(0) + doWork() \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/package.json b/code/controllers/ProcessScheduler/package.json new file mode 100644 index 00000000000..f699553fc61 --- /dev/null +++ b/code/controllers/ProcessScheduler/package.json @@ -0,0 +1,28 @@ +{ + "name": "ProcessScheduler", + "version": "1.0.0", + "description": "BYOND SS13 Process Scheduler", + "main": "processScheduler.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/goonstation/ProcessScheduler.git" + }, + "keywords": [ + "byond", + "ss13", + "process", + "scheduler" + ], + "author": "Volundr", + "license": "CC-BY-NC", + "bugs": { + "url": "https://github.com/goonstation/ProcessScheduler/issues" + }, + "homepage": "https://github.com/goonstation/ProcessScheduler", + "dependencies": { + "bower": "*" + } +} diff --git a/code/controllers/ProcessScheduler/test/processScheduler.js b/code/controllers/ProcessScheduler/test/processScheduler.js new file mode 100644 index 00000000000..0a4f111355d --- /dev/null +++ b/code/controllers/ProcessScheduler/test/processScheduler.js @@ -0,0 +1,56 @@ +(function ($) { + function setRef(theRef) { + ref = theRef; + } + + function jax(action, data) { + if (typeof data === 'undefined') + data = {}; + var params = []; + for (var k in data) { + if (data.hasOwnProperty(k)) { + params.push(encodeURIComponent(k) + '=' + encodeURIComponent(data[k])); + } + } + var newLoc = '?src=' + ref + ';action=' + action + ';' + params.join(';'); + window.location = newLoc; + } + + function requestRefresh(e) { + jax("refresh", null); + } + + function handleRefresh(processTable) { + $('#processTable').html(processTable); + initProcessTableButtons(); + } + + function requestKill(e) { + var button = $(e.currentTarget); + jax("kill", {name: button.data("process-name")}); + } + + function requestEnable(e) { + var button = $(e.currentTarget); + jax("enable", {name: button.data("process-name")}); + } + + function requestDisable(e) { + var button = $(e.currentTarget); + jax("disable", {name: button.data("process-name")}); + } + + function initProcessTableButtons() { + $(".kill-btn").on("click", requestKill); + $(".enable-btn").on("click", requestEnable); + $(".disable-btn").on("click", requestDisable); + } + + window.setRef = setRef; + window.handleRefresh = handleRefresh; + + $(function() { + initProcessTableButtons(); + $('#btn-refresh').on("click", requestRefresh); + }); +}(jQuery)); \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/test/processSchedulerView.dm b/code/controllers/ProcessScheduler/test/processSchedulerView.dm new file mode 100644 index 00000000000..ae78b3f0154 --- /dev/null +++ b/code/controllers/ProcessScheduler/test/processSchedulerView.dm @@ -0,0 +1,94 @@ +/datum/processSchedulerView + +/datum/processSchedulerView/Topic(href, href_list) + if (!href_list["action"]) + return + + switch (href_list["action"]) + if ("kill") + var/toKill = href_list["name"] + processScheduler.killProcess(toKill) + refreshProcessTable() + if ("enable") + var/toEnable = href_list["name"] + processScheduler.enableProcess(toEnable) + refreshProcessTable() + if ("disable") + var/toDisable = href_list["name"] + processScheduler.disableProcess(toDisable) + refreshProcessTable() + if ("refresh") + refreshProcessTable() + +/datum/processSchedulerView/proc/refreshProcessTable() + windowCall("handleRefresh", getProcessTable()) + +/datum/processSchedulerView/proc/windowCall(var/function, var/data = null) + usr << output(data, "processSchedulerContext.browser:[function]") + +/datum/processSchedulerView/proc/getProcessTable() + var/text = "" + // and the context of each + for (var/list/data in processScheduler.getStatusData()) + text += "" + text += "" + text += "" + text += "" + text += "" + text += "" + text += "" + text += "" + text += "" + text += "" + + text += "
NameAvg(s)Last(s)Highest(s)TickcountTickrateStateAction
[data["name"]][num2text(data["averageRunTime"]/10,3)][num2text(data["lastRunTime"]/10,3)][num2text(data["highestRunTime"]/10,3)][num2text(data["ticks"],4)][data["schedule"]][data["status"]]" + if (data["disabled"]) + text += "" + else + text += "" + text += "
" + return text + +/** + * getContext + * Outputs an interface showing stats for all processes. + */ +/datum/processSchedulerView/proc/getContext() + bootstrap_browse() + usr << browse('processScheduler.js', "file=processScheduler.js;display=0") + + var/text = {" + Process Scheduler Detail + + [bootstrap_includes()] + + + +

Process Scheduler

+
+ +
+ +

The process scheduler controls [processScheduler.getProcessCount()] loops.

"} + + text += "
" + text += getProcessTable() + text += "
" + + usr << browse(text, "window=processSchedulerContext;size=800x600") + +/datum/processSchedulerView/proc/bootstrap_browse() + usr << browse('bower_components/jquery/dist/jquery.min.js', "file=jquery.min.js;display=0") + usr << browse('bower_components/bootstrap2.3.2/bootstrap/js/bootstrap.min.js', "file=bootstrap.min.js;display=0") + usr << browse('bower_components/bootstrap2.3.2/bootstrap/css/bootstrap.min.css', "file=bootstrap.min.css;display=0") + usr << browse('bower_components/bootstrap2.3.2/bootstrap/img/glyphicons-halflings-white.png', "file=glyphicons-halflings-white.png;display=0") + usr << browse('bower_components/bootstrap2.3.2/bootstrap/img/glyphicons-halflings.png', "file=glyphicons-halflings.png;display=0") + usr << browse('bower_components/json2/json2.js', "file=json2.js;display=0") + +/datum/processSchedulerView/proc/bootstrap_includes() + return {" + + + + + "} diff --git a/code/controllers/ProcessScheduler/test/testDyingUpdateQueueProcess.dm b/code/controllers/ProcessScheduler/test/testDyingUpdateQueueProcess.dm new file mode 100644 index 00000000000..d08ec46c7da --- /dev/null +++ b/code/controllers/ProcessScheduler/test/testDyingUpdateQueueProcess.dm @@ -0,0 +1,27 @@ +/** + * testDyingUpdateQueueProcess + * This process is an example of a process using an updateQueue. + * The datums updated by this process behave badly and block the update loop + * by sleeping. If you #define UPDATE_QUEUE_DEBUG, you will see the updateQueue + * killing off its worker processes and spawning new ones to work around slow + * updates. This means that if you have a code path that sleeps for a long time + * in mob.Life once in a blue moon, the mob update loop will not hang. + */ +/datum/slowTestDatum/proc/wackyUpdateProcessName() + sleep(rand(0,20)) // Randomly REALLY slow :| + +/datum/controller/process/testDyingUpdateQueueProcess + var/tmp/datum/updateQueue/updateQueueInstance + var/tmp/list/testDatums = list() + +/datum/controller/process/testDyingUpdateQueueProcess/setup() + name = "Dying UpdateQueue Process" + schedule_interval = 30 // every 3 seconds + updateQueueInstance = new + for(var/i = 1, i < 30, i++) + testDatums.Add(new /datum/slowTestDatum) + +/datum/controller/process/testDyingUpdateQueueProcess/doWork() + updateQueueInstance.init(testDatums, "wackyUpdateProcessName") + updateQueueInstance.Run() + \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/test/testHarness.dm b/code/controllers/ProcessScheduler/test/testHarness.dm new file mode 100644 index 00000000000..2b5f1dff813 --- /dev/null +++ b/code/controllers/ProcessScheduler/test/testHarness.dm @@ -0,0 +1,35 @@ +/* + These are simple defaults for your project. + */ +#define DEBUG + +var/global/datum/processSchedulerView/processSchedulerView + +world + loop_checks = 0 + New() + ..() + processScheduler = new + processSchedulerView = new + +mob + step_size = 8 + + New() + ..() + + + verb + startProcessScheduler() + set name = "Start Process Scheduler" + processScheduler.setup() + processScheduler.start() + + getProcessSchedulerContext() + set name = "Get Process Scheduler Status Panel" + processSchedulerView.getContext() + + runUpdateQueueTests() + set name = "Run Update Queue Testsuite" + var/datum/updateQueueTests/t = new + t.runTests() \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/test/testHungProcess.dm b/code/controllers/ProcessScheduler/test/testHungProcess.dm new file mode 100644 index 00000000000..ced05dd4d70 --- /dev/null +++ b/code/controllers/ProcessScheduler/test/testHungProcess.dm @@ -0,0 +1,15 @@ +/** + * testHungProcess + * This process is an example of a simple update loop process that hangs. + */ + +/datum/controller/process/testHungProcess/setup() + name = "Hung Process" + schedule_interval = 30 // every 3 seconds + +/datum/controller/process/testHungProcess/doWork() + sleep(1000) // FUCK + // scheck is also responsible for handling hung processes. If a process + // hangs, and later resumes, but has already been killed by the scheduler, + // scheck will force the process to bail out. + scheck() \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/test/testNiceProcess.dm b/code/controllers/ProcessScheduler/test/testNiceProcess.dm new file mode 100644 index 00000000000..aa921bc62fa --- /dev/null +++ b/code/controllers/ProcessScheduler/test/testNiceProcess.dm @@ -0,0 +1,13 @@ +/** + * testNiceProcess + * This process is an example of a simple update loop process that is + * relatively fast. + */ + +/datum/controller/process/testNiceProcess/setup() + name = "Nice Process" + schedule_interval = 10 // every second + +/datum/controller/process/testNiceProcess/doWork() + sleep(rand(1,5)) // Just to pretend we're doing something + \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/test/testSlowProcess.dm b/code/controllers/ProcessScheduler/test/testSlowProcess.dm new file mode 100644 index 00000000000..b7c9e6e21e8 --- /dev/null +++ b/code/controllers/ProcessScheduler/test/testSlowProcess.dm @@ -0,0 +1,28 @@ +/** + * testSlowProcess + * This process is an example of a simple update loop process that is slow. + * The update loop here sleeps inside to provide an example, but if you had + * a computationally intensive loop process that is simply slow, you can use + * scheck() inside the loop to force it to yield periodically according to + * the sleep_interval var. By default, scheck will cause a loop to sleep every + * 2 ticks. + */ + +/datum/controller/process/testSlowProcess/setup() + name = "Slow Process" + schedule_interval = 30 // every 3 seconds + +/datum/controller/process/testSlowProcess/doWork() + // set background = 1 will cause loop constructs to sleep periodically, + // whenever the BYOND scheduler deems it productive to do so. + // This behavior is not always sufficient, nor is it always consistent. + // Rather than leaving it up to the BYOND scheduler, we can control it + // ourselves and leave nothing to the black box. + set background = 1 + + for(var/i=1,i<30,i++) + // Just to pretend we're doing something here + sleep(rand(3, 5)) + + // Forces this loop to yield(sleep) periodically. + scheck() \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/test/testUpdateQueue.dm b/code/controllers/ProcessScheduler/test/testUpdateQueue.dm new file mode 100644 index 00000000000..07b64e927f3 --- /dev/null +++ b/code/controllers/ProcessScheduler/test/testUpdateQueue.dm @@ -0,0 +1,209 @@ +var/global/list/updateQueueTestCount = list() + +/datum/updateQueueTests + var/start + proc + runTests() + world << "Running 9 tests..." + testUpdateQueuePerformance() + sleep(1) + testInplace() + sleep(1) + testInplaceUpdateQueuePerformance() + sleep(1) + testUpdateQueueReinit() + sleep(1) + testCrashingQueue() + sleep(1) + testEmptyQueue() + sleep(1) + testManySlowItemsInQueue() + sleep(1) + testVariableWorkerTimeout() + sleep(1) + testReallySlowItemInQueue() + sleep(1) + world << "Finished!" + + beginTiming() + start = world.time + + endTiming(text) + var/time = (world.time - start) / world.tick_lag + world << {"Performance - [text] - [time] ticks"} + + getCount() + return updateQueueTestCount[updateQueueTestCount.len] + + incrementTestCount() + updateQueueTestCount.len++ + updateQueueTestCount[updateQueueTestCount.len] = 0 + + assertCountEquals(count, text) + assertThat(getCount() == count, text) + + assertCountLessThan(count, text) + assertThat(getCount() < count, text) + + assertCountGreaterThan(count, text) + assertThat(getCount() > count, text) + + assertThat(condition, text) + if (condition) + world << {"PASS: [text]"} + else + world << {"FAIL: [text]"} + + testUpdateQueuePerformance() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=100000,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + + var/datum/updateQueue/uq = new(objs) + + beginTiming() + uq.Run() + endTiming("updating 100000 simple objects") + + assertCountEquals(100000, "test that update queue updates all objects expected") + del(objs) + del(uq) + + testUpdateQueueReinit() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=100,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + + var/datum/updateQueue/uq = new(objs) + uq.Run() + objs = new + + for(var/i=1,i<=100,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + uq.init(objs) + uq.Run() + assertCountEquals(200, "test that update queue reinitializes properly and updates all objects as expected.") + del(objs) + del(uq) + + testInplace() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=100,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + var/datum/updateQueue/uq = new(objects = objs, inplace = 1) + uq.Run() + assertThat(objs.len == 0, "test that update queue inplace option really works inplace") + assertCountEquals(100, "test that inplace update queue updates the right number of objects") + del(objs) + del(uq) + + testInplaceUpdateQueuePerformance() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=100000,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + + var/datum/updateQueue/uq = new(objs) + + beginTiming() + uq.Run() + endTiming("updating 100000 simple objects in place") + del(objs) + del(uq) + + testCrashingQueue() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=10,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + objs.Add(new /datum/uqTestDatum/crasher(updateQueueTestCount.len)) + for(var/i=1,i<=10,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + + var/datum/updateQueue/uq = new(objs) + uq.Run() + assertCountEquals(20, "test that update queue handles crashed update procs OK") + del(objs) + del(uq) + + testEmptyQueue() + incrementTestCount() + var/list/objs = new + var/datum/updateQueue/uq = new(objs) + uq.Run() + assertCountEquals(0, "test that update queue doesn't barf on empty lists") + del(objs) + del(uq) + + testManySlowItemsInQueue() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=30,i++) + objs.Add(new /datum/uqTestDatum/slow(updateQueueTestCount.len)) + var/datum/updateQueue/uq = new(objs) + uq.Run() + assertCountEquals(30, "test that update queue slows down execution if too many objects are slow to update") + del(objs) + del(uq) + + testVariableWorkerTimeout() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=20,i++) + objs.Add(new /datum/uqTestDatum/slow(updateQueueTestCount.len)) + var/datum/updateQueue/uq = new(objs, workerTimeout=6) + uq.Run() + assertCountEquals(20, "test that variable worker timeout works properly") + del(objs) + del(uq) + + testReallySlowItemInQueue() + incrementTestCount() + var/list/objs = new + for(var/i=1,i<=10,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + objs.Add(new /datum/uqTestDatum/reallySlow(updateQueueTestCount.len)) + for(var/i=1,i<=10,i++) + objs.Add(new /datum/uqTestDatum/fast(updateQueueTestCount.len)) + var/datum/updateQueue/uq = new(objs) + uq.Run() + assertCountEquals(20, "test that update queue skips objects that are too slow to update") + del(objs) + del(uq) + + + +datum/uqTestDatum + var/testNum + New(testNum) + ..() + src.testNum = testNum + proc/update() + updateQueueTestCount[testNum]++ + proc/lag(cycles) + set background = 1 + for(var/i=0,i 5) + world << "RUNTIMES IN ATMOS TICKER. Killing air simulation!" + world.log << "### ZAS SHUTDOWN" + + message_admins("ZASALERT: Shutting down! status: [air_master.tick_progress]") + log_admin("ZASALERT: Shutting down! status: [air_master.tick_progress]") + + air_processing_killed = TRUE + air_master.failed_ticks = 0 diff --git a/code/controllers/Processes/bot.dm b/code/controllers/Processes/bot.dm new file mode 100644 index 00000000000..a3cc23ce392 --- /dev/null +++ b/code/controllers/Processes/bot.dm @@ -0,0 +1,11 @@ +/datum/controller/process/bot/setup() + name = "bot controller" + schedule_interval = 20 // every 2 seconds + +/datum/controller/process/bot/doWork() + for(var/obj/machinery/bot/Bot in aibots) + if(!Bot.gc_destroyed) + spawn(0) + Bot.bot_process() + continue + aibots -= Bot \ No newline at end of file diff --git a/code/controllers/Processes/disease.dm b/code/controllers/Processes/disease.dm new file mode 100644 index 00000000000..a8d840097ec --- /dev/null +++ b/code/controllers/Processes/disease.dm @@ -0,0 +1,11 @@ +/datum/controller/process/disease + var/tmp/datum/updateQueue/updateQueueInstance + +/datum/controller/process/disease/setup() + name = "disease" + schedule_interval = 20 // every 2 seconds + updateQueueInstance = new + +/datum/controller/process/disease/doWork() + updateQueueInstance.init(active_diseases, "process") + updateQueueInstance.Run() diff --git a/code/controllers/Processes/emergencyShuttle.dm b/code/controllers/Processes/emergencyShuttle.dm new file mode 100644 index 00000000000..e7289311b95 --- /dev/null +++ b/code/controllers/Processes/emergencyShuttle.dm @@ -0,0 +1,9 @@ +/datum/controller/process/emergencyShuttle/setup() + name = "emergency shuttle" + schedule_interval = 20 // every 2 seconds + + if(!emergency_shuttle) + emergency_shuttle = new + +/datum/controller/process/emergencyShuttle/doWork() + emergency_shuttle.process() diff --git a/code/controllers/Processes/event.dm b/code/controllers/Processes/event.dm new file mode 100644 index 00000000000..72bc01613d2 --- /dev/null +++ b/code/controllers/Processes/event.dm @@ -0,0 +1,6 @@ +/datum/controller/process/event/setup() + name = "event controller" + schedule_interval = 20 // every 2 seconds + +/datum/controller/process/event/doWork() + event_manager.process() \ No newline at end of file diff --git a/code/controllers/Processes/garbage.dm b/code/controllers/Processes/garbage.dm new file mode 100644 index 00000000000..f589c641f5b --- /dev/null +++ b/code/controllers/Processes/garbage.dm @@ -0,0 +1,10 @@ +/datum/controller/process/garbage/setup() + name = "garbage" + schedule_interval = 20 // every 2 seconds + + if(!garbageCollector) + garbageCollector = new + +/datum/controller/process/garbage/doWork() + garbageCollector.process() + scheck() \ No newline at end of file diff --git a/code/controllers/Processes/inactivity.dm b/code/controllers/Processes/inactivity.dm new file mode 100644 index 00000000000..b610502d19e --- /dev/null +++ b/code/controllers/Processes/inactivity.dm @@ -0,0 +1,16 @@ +/datum/controller/process/inactivity/setup() + name = "inactivity" + schedule_interval = INACTIVITY_KICK + +/datum/controller/process/inactivity/doWork() + if(config.kick_inactive) + for(var/client/C in clients) + if(C.is_afk(INACTIVITY_KICK)) + if(!istype(C.mob, /mob/dead)) + log_access("AFK: [key_name(C)]") + C << "You have been inactive for more than 10 minutes and have been disconnected." + del(C) + + scheck() + +#undef INACTIVITY_KICK diff --git a/code/controllers/Processes/lighting.dm b/code/controllers/Processes/lighting.dm new file mode 100644 index 00000000000..bbf9ecd2f99 --- /dev/null +++ b/code/controllers/Processes/lighting.dm @@ -0,0 +1,26 @@ +/datum/controller/process/lighting/setup() + name = "lighting" + schedule_interval = 5 // every .5 second + lighting_controller.Initialize() + +/datum/controller/process/lighting/doWork() + lighting_controller.lights_workload_max = \ + max(lighting_controller.lights_workload_max, lighting_controller.lights.len) + + for(var/datum/light_source/L in lighting_controller.lights) + if(L && L.check()) + lighting_controller.lights.Remove(L) + + scheck() + + lighting_controller.changed_turfs_workload_max = \ + max(lighting_controller.changed_turfs_workload_max, lighting_controller.changed_turfs.len) + + for(var/turf/T in lighting_controller.changed_turfs) + if(T && T.lighting_changed) + T.shift_to_subarea() + + scheck() + + if(lighting_controller.changed_turfs && lighting_controller.changed_turfs.len) + lighting_controller.changed_turfs.len = 0 // reset the changed list diff --git a/code/controllers/Processes/machinery.dm b/code/controllers/Processes/machinery.dm new file mode 100644 index 00000000000..52274a519af --- /dev/null +++ b/code/controllers/Processes/machinery.dm @@ -0,0 +1,34 @@ +/datum/controller/process/machinery/setup() + name = "machinery" + schedule_interval = 20 // every 2 seconds + +/datum/controller/process/machinery/doWork() + //#ifdef PROFILE_MACHINES + //machine_profiling.len = 0 + //#endif + + for(var/obj/machinery/M in machines) + if(M && !M.gcDestroyed) + #ifdef PROFILE_MACHINES + var/time_start = world.timeofday + #endif + + if(M.process() == PROCESS_KILL) + //M.inMachineList = 0 We don't use this debugging function + machines.Remove(M) + continue + + if(M && M.use_power) + M.auto_use_power() + + #ifdef PROFILE_MACHINES + var/time_end = world.timeofday + + if(!(M.type in machine_profiling)) + machine_profiling[M.type] = 0 + + machine_profiling[M.type] += (time_end - time_start) + #endif + + scheck() + diff --git a/code/controllers/Processes/mob.dm b/code/controllers/Processes/mob.dm new file mode 100644 index 00000000000..b3765b0cf9c --- /dev/null +++ b/code/controllers/Processes/mob.dm @@ -0,0 +1,20 @@ +/datum/controller/process/mob + var/tmp/datum/updateQueue/updateQueueInstance + +/datum/controller/process/mob/setup() + name = "mob" + schedule_interval = 20 // every 2 seconds + updateQueueInstance = new + +/datum/controller/process/mob/started() + ..() + if(!updateQueueInstance) + if(!mob_list) + mob_list = list() + else if(mob_list.len) + updateQueueInstance = new + +/datum/controller/process/mob/doWork() + if(updateQueueInstance) + updateQueueInstance.init(mob_list, "Life") + updateQueueInstance.Run() diff --git a/code/controllers/Processes/nanoui.dm b/code/controllers/Processes/nanoui.dm new file mode 100644 index 00000000000..c8396bcab87 --- /dev/null +++ b/code/controllers/Processes/nanoui.dm @@ -0,0 +1,11 @@ +/datum/controller/process/nanoui + var/tmp/datum/updateQueue/updateQueueInstance + +/datum/controller/process/nanoui/setup() + name = "nanoui" + schedule_interval = 20 // every 2 seconds + updateQueueInstance = new + +/datum/controller/process/nanoui/doWork() + updateQueueInstance.init(nanomanager.processing_uis, "process") + updateQueueInstance.Run() diff --git a/code/controllers/Processes/obj.dm b/code/controllers/Processes/obj.dm new file mode 100644 index 00000000000..15ad98dd3d6 --- /dev/null +++ b/code/controllers/Processes/obj.dm @@ -0,0 +1,21 @@ +var/global/list/object_profiling = list() +/datum/controller/process/obj + var/tmp/datum/updateQueue/updateQueueInstance + +/datum/controller/process/obj/setup() + name = "obj" + schedule_interval = 20 // every 2 seconds + updateQueueInstance = new + +/datum/controller/process/obj/started() + ..() + if(!updateQueueInstance) + if(!processing_objects) + processing_objects = list() + else if(processing_objects.len) + updateQueueInstance = new + +/datum/controller/process/obj/doWork() + if(updateQueueInstance) + updateQueueInstance.init(processing_objects, "process") + updateQueueInstance.Run() diff --git a/code/controllers/Processes/pipenet.dm b/code/controllers/Processes/pipenet.dm new file mode 100644 index 00000000000..56a068f54ca --- /dev/null +++ b/code/controllers/Processes/pipenet.dm @@ -0,0 +1,12 @@ +/datum/controller/process/pipenet/setup() + name = "pipenet" + schedule_interval = 20 // every 2 seconds + +/datum/controller/process/pipenet/doWork() + for(var/datum/pipe_network/pipeNetwork in pipe_networks) + if(istype(pipeNetwork) && !pipeNetwork.disposed) + pipeNetwork.process() + scheck() + continue + + pipe_networks.Remove(pipeNetwork) diff --git a/code/controllers/Processes/power_machinery.dm b/code/controllers/Processes/power_machinery.dm new file mode 100644 index 00000000000..ce17c0583a6 --- /dev/null +++ b/code/controllers/Processes/power_machinery.dm @@ -0,0 +1,45 @@ +var/global/list/power_machinery_profiling = list() + +/datum/controller/process/power_machinery + var/tmp/datum/updateQueue/updateQueueInstance + +/datum/controller/process/power_machinery/setup() + name = "pow_machine" + schedule_interval = 20 // every 2 seconds + +/datum/controller/process/power_machinery/doWork() + for(var/i = 1 to power_machines.len) + if(i > power_machines.len) + break + var/obj/machinery/M = power_machines[i] + if(istype(M) && !M.gcDestroyed) + #ifdef PROFILE_MACHINES + var/time_start = world.timeofday + #endif + + if(M.process() == PROCESS_KILL) + M.inMachineList = 0 + power_machines.Remove(M) + continue + + if(M && M.use_power) + M.auto_use_power() + if(istype(M)) + #ifdef PROFILE_MACHINES + var/time_end = world.timeofday + + if(!(M.type in power_machinery_profiling)) + power_machinery_profiling[M.type] = 0 + + power_machinery_profiling[M.type] += (time_end - time_start) + #endif + else + if(!power_machines.Remove(M)) + power_machines.Cut(i,i+1) + else + if(M) + M.inMachineList = 0 + if(!power_machines.Remove(M)) + power_machines.Cut(i,i+1) + + scheck() diff --git a/code/controllers/Processes/powernet.dm b/code/controllers/Processes/powernet.dm new file mode 100644 index 00000000000..1edf194915a --- /dev/null +++ b/code/controllers/Processes/powernet.dm @@ -0,0 +1,12 @@ +/datum/controller/process/powernet/setup() + name = "powernet" + schedule_interval = 20 // every 2 seconds + +/datum/controller/process/powernet/doWork() + for(var/datum/powernet/powerNetwork in powernets) + if(istype(powerNetwork) && !powerNetwork.disposed) + powerNetwork.reset() + scheck() + continue + + powernets.Remove(powerNetwork) diff --git a/code/controllers/Processes/sun.dm b/code/controllers/Processes/sun.dm new file mode 100644 index 00000000000..f09806cef53 --- /dev/null +++ b/code/controllers/Processes/sun.dm @@ -0,0 +1,7 @@ +/datum/controller/process/sun/setup() + name = "sun" + schedule_interval = 20 // every second + sun = new + +/datum/controller/process/sun/doWork() + sun.calc_position() diff --git a/code/controllers/Processes/supply.dm b/code/controllers/Processes/supply.dm new file mode 100644 index 00000000000..891a511ec6d --- /dev/null +++ b/code/controllers/Processes/supply.dm @@ -0,0 +1,6 @@ +/datum/controller/process/supply/setup() + name = "supply controller" + schedule_interval = 300 // every 30 seconds + +/datum/controller/process/supply/doWork() + supply_controller.process() \ No newline at end of file diff --git a/code/controllers/Processes/ticker.dm b/code/controllers/Processes/ticker.dm new file mode 100644 index 00000000000..b7c45ba91a4 --- /dev/null +++ b/code/controllers/Processes/ticker.dm @@ -0,0 +1,35 @@ +var/global/datum/controller/process/ticker/tickerProcess + +/datum/controller/process/ticker + var/lastTickerTimeDuration + var/lastTickerTime + +/datum/controller/process/ticker/setup() + name = "ticker" + schedule_interval = 20 // every 2 seconds + + lastTickerTime = world.timeofday + + if(!ticker) + ticker = new + + tickerProcess = src + + spawn(0) + if(ticker) + ticker.pregame() + +/datum/controller/process/ticker/doWork() + var/currentTime = world.timeofday + + if(currentTime < lastTickerTime) // check for midnight rollover + lastTickerTimeDuration = (currentTime - (lastTickerTime - TICKS_IN_DAY)) / TICKS_IN_SECOND + else + lastTickerTimeDuration = (currentTime - lastTickerTime) / TICKS_IN_SECOND + + lastTickerTime = currentTime + + ticker.process() + +/datum/controller/process/ticker/proc/getLastTickerTimeDuration() + return lastTickerTimeDuration diff --git a/code/controllers/Processes/vote.dm b/code/controllers/Processes/vote.dm new file mode 100644 index 00000000000..5df5ce69792 --- /dev/null +++ b/code/controllers/Processes/vote.dm @@ -0,0 +1,6 @@ +/datum/controller/process/vote/setup() + name = "vote" + schedule_interval = 10 // every second + +/datum/controller/process/vote/doWork() + vote.process() diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 3aacb25c3fc..518cfafd522 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -5,7 +5,6 @@ var/global/datum/controller/game_controller/master_controller //Set in world.New() var/global/controller_iteration = 0 -var/global/last_tick_timeofday = world.timeofday var/global/last_tick_duration = 0 var/global/air_processing_killed = 0 @@ -54,8 +53,8 @@ datum/controller/game_controller/New() if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase() if(!syndicate_code_response) syndicate_code_response = generate_code_phrase() - if(!emergency_shuttle) emergency_shuttle = new /datum/emergency_shuttle_controller() - if(!shuttle_controller) shuttle_controller = new /datum/shuttle_controller() + //if(!emergency_shuttle) emergency_shuttle = new /datum/emergency_shuttle_controller() MOVED TO SCHEDULER + //if(!shuttle_controller) shuttle_controller = new /datum/shuttle_controller() datum/controller/game_controller/proc/setup() world.tick_lag = config.Ticklag @@ -63,16 +62,19 @@ datum/controller/game_controller/proc/setup() spawn(20) createRandomZlevel() + /* MOVED TO SCHEDULER if(!air_master) air_master = new /datum/controller/air_system() air_master.Setup() if(!ticker) ticker = new /datum/controller/gameticker() + */ if(!garbage) garbage = new /datum/controller/garbage_collector() + color_windows_init() setup_objects() setupgenetics() @@ -82,15 +84,17 @@ datum/controller/game_controller/proc/setup() for(var/i=0, iYou 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/datums/spells/genetic.dm b/code/datums/spells/genetic.dm index 45be50f0b75..6bf167196cd 100644 --- a/code/datums/spells/genetic.dm +++ b/code/datums/spells/genetic.dm @@ -20,7 +20,7 @@ for(var/mob/living/target in targets) for(var/x in mutations) target.mutations.Add(x) - if(x == M_HULK && ishuman(target)) + if(x == HULK && ishuman(target)) target:hulk_time=world.time + duration target.disabilities |= disabilities target.update_mutations() //update target's mutation overlays diff --git a/code/datums/spells/wizard.dm b/code/datums/spells/wizard.dm index 5672052e0a2..ae507556181 100644 --- a/code/datums/spells/wizard.dm +++ b/code/datums/spells/wizard.dm @@ -48,7 +48,7 @@ include_user = 1 centcom_cancast = 0 - mutations = list(M_LASER, M_HULK) + mutations = list(LASER, HULK) duration = 300 cooldown_min = 300 //25 deciseconds reduction per rank diff --git a/code/datums/sun.dm b/code/datums/sun.dm index 794e2dd8668..eafbcd1ee0c 100644 --- a/code/datums/sun.dm +++ b/code/datums/sun.dm @@ -1,5 +1,7 @@ #define SOLAR_UPDATE_TIME 600 //duration between two updates of the whole sun/solars positions +var/global/datum/sun/sun + /datum/sun var/angle var/dx @@ -16,11 +18,12 @@ rate = -rate solar_next_update = world.time // init the timer angle = rand (0,360) // the station position to the sun is randomised at round start - + +/* HANDLED IN PROCESS SCHEDULER /hook/startup/proc/createSun() sun = new /datum/sun() return 1 - +*/ // calculate the sun's position given the time of day // at the standard rate (100%) the angle is increase/decreased by 6 degrees every minute. // a full rotation thus take a game hour in that case diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index e8dd34ff897..8497680bd2d 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -1183,6 +1183,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine /obj/item/clothing/mask/gas/clown_hat, /obj/item/clothing/under/rank/clown, /obj/item/weapon/bikehorn, + /obj/item/weapon/storage/backpack/mime, /obj/item/clothing/under/mime, /obj/item/clothing/shoes/black, /obj/item/clothing/gloves/color/white, diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 9df9521f6bb..5eb6c3b54fc 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -4,7 +4,7 @@ anchored = 1 density = 1 - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) return attack_hand(user) attack_hand(mob/user as mob) @@ -19,7 +19,7 @@ anchored = 1 density = 0 - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) return attack_hand(user) diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index ccfda6b21c3..a95fe3a4ac2 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -830,7 +830,6 @@ icon = 'icons/obj/lightning.dmi' icon_state = "lightning" desc = "test lightning" - flags = USEDELAY New() icon = midicon diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 2a7f975e46b..fa22e742970 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -295,7 +295,7 @@ its easier to just keep the beam vertical. add_fibers(M) //He has no prints! - if (M_FINGERPRINTS in M.mutations) + if (FINGERPRINTS in M.mutations) if(fingerprintslast != M.key) fingerprintshidden += "(Has no fingerprints) Real name: [M.real_name], Key: [M.key]" fingerprintslast = M.key diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 5d4a4539e65..28c188467b4 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -108,7 +108,7 @@ src.throw_source = get_turf(src) //store the origin turf if(usr) - if(M_HULK in usr.mutations) + if(HULK in usr.mutations) src.throwing = 2 // really strong throw! var/dist_x = abs(target.x - src.x) @@ -207,9 +207,9 @@ verbs.Cut() return -/atom/movable/overlay/attackby(a, b) +/atom/movable/overlay/attackby(a, b, c) if (src.master) - return src.master.attackby(a, b) + return src.master.attackby(a, b, c) return /atom/movable/overlay/attack_paw(a, b, c) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 2aacd6e3dd9..5e451c19a92 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -191,7 +191,7 @@ if(user.pulling == L) user.pulling = null -/obj/machinery/dna_scannernew/attackby(var/obj/item/weapon/item as obj, var/mob/user as mob) +/obj/machinery/dna_scannernew/attackby(var/obj/item/weapon/item as obj, var/mob/user as mob, params) if(istype(item, /obj/item/weapon/screwdriver)) if(occupant) user << "The maintenance panel is locked." @@ -338,7 +338,7 @@ active_power_usage = 400 var/waiting_for_user_input=0 // Fix for #274 (Mash create block injector without answering dialog to make unlimited injectors) - N3X -/obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob, params) if (istype(I, /obj/item/weapon/disk/data)) //INSERT SOME diskS if (!src.disk) user.drop_item() @@ -504,7 +504,7 @@ occupantData["name"] = connected.occupant.name occupantData["stat"] = connected.occupant.stat occupantData["isViableSubject"] = 1 - if ((M_NOCLONE in connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna) + if ((NOCLONE in connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna) occupantData["isViableSubject"] = 0 occupantData["health"] = connected.occupant.health occupantData["maxHealth"] = connected.occupant.maxHealth @@ -843,7 +843,7 @@ return 1 if (bufferOption == "transfer") - if (!src.connected.occupant || (M_NOCLONE in src.connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna) + if (!src.connected.occupant || (NOCLONE in src.connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna) return irradiating = 2 diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm index 4d80cba48c5..0431d666c53 100644 --- a/code/game/dna/genes/disabilities.dm +++ b/code/game/dna/genes/disabilities.dm @@ -55,7 +55,7 @@ name="Hallucinate" activation_message="Your mind says 'Hello'." deactivation_message ="Sanity returns. Or does it?" - mutation=M_HALLUCINATE + mutation=HALLUCINATE New() block=HALLUCINATIONBLOCK @@ -82,7 +82,7 @@ name="Clumsiness" activation_message="You feel lightheaded." deactivation_message ="You regain some control of your movements" - mutation=M_CLUMSY + mutation=CLUMSY New() block=CLUMSYBLOCK @@ -155,7 +155,7 @@ desc = "This will only bring death and destruction." activation_message = "Uh oh!" deactivation_message = "Well thank god that's over with." - mutation=M_COMIC + mutation=COMIC New() block = COMICBLOCK diff --git a/code/game/dna/genes/goon_disabilities.dm b/code/game/dna/genes/goon_disabilities.dm index 1214919a441..abd64146b1f 100644 --- a/code/game/dna/genes/goon_disabilities.dm +++ b/code/game/dna/genes/goon_disabilities.dm @@ -57,7 +57,7 @@ activation_message = "You feel blubbery and lethargic!" deactivation_message = "You feel fit!" - mutation = M_OBESITY + mutation = OBESITY New() ..() @@ -219,7 +219,7 @@ deactivation_message = "Your stomach stops acting up. Phew!" instability=2 - mutation = M_TOXIC_FARTS + mutation = TOXIC_FARTS New() ..() @@ -237,7 +237,7 @@ activation_message = "You feel buff!" deactivation_message = "You feel wimpy and weak." - mutation = M_STRONG + mutation = STRONG New() ..() diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm index 00a7879906f..c154d8f9249 100644 --- a/code/game/dna/genes/goon_powers.dm +++ b/code/game/dna/genes/goon_powers.dm @@ -6,7 +6,7 @@ activation_messages=list("You feel unusually sober.") deactivation_messages = list("You feel like you could use a stiff drink.") - mutation=M_SOBER + mutation=SOBER New() block=SOBERBLOCK @@ -19,7 +19,7 @@ deactivation_messages = list("You feel oddly exposed.") instability=2 - mutation=M_PSY_RESIST + mutation=PSY_RESIST New() block=PSYRESISTBLOCK @@ -149,7 +149,7 @@ usr << "\red This will only work on normal organic beings." return - if (M_RESIST_COLD in C.mutations) + if (RESIST_COLD in C.mutations) C.visible_message("\red A cloud of fine ice crystals engulfs [C.name], but disappears almost instantly!") return var/handle_suit = 0 @@ -392,7 +392,7 @@ else usr.pixel_y -= 8 sleep(1) - if (M_FAT in usr.mutations && prob(66)) + if (FAT in usr.mutations && prob(66)) usr.visible_message("\red [usr.name] crashes due to their heavy weight!") //playsound(usr.loc, 'zhit.wav', 50, 1) usr.weakened += 10 @@ -481,7 +481,7 @@ activation_messages = list("You suddenly notice more about others than you did before.") deactivation_messages = list("You no longer feel able to sense intentions.") instability=1 - mutation=M_EMPATH + mutation=EMPATH New() ..() @@ -514,7 +514,7 @@ usr << "\red You may only use this on other organic beings." return - if (M_PSY_RESIST in M.mutations) + if (PSY_RESIST in M.mutations) usr << "\red You can't see into [M.name]'s mind at all!" return @@ -578,7 +578,7 @@ usr << "\blue Numbers: You sense the number[numbers.len>1?"s":""] [english_list(numbers)] [numbers.len>1?"are":"is"] important to [M.name]." usr << "\blue Thoughts: [M.name] is currently [thoughts]." - if (M_EMPATH in M.mutations) + if (EMPATH in M.mutations) M << "\red You sense [usr.name] reading your mind." else if (prob(5) || M.mind.assigned_role=="Chaplain") M << "\red You sense someone intruding upon your thoughts..." @@ -594,7 +594,7 @@ deactivation_messages = list("You no longer feel gassy. What a relief!") instability=1 - mutation = M_SUPER_FART + mutation = SUPER_FART New() ..() diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 81d20456736..61068c81701 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -5,7 +5,7 @@ /datum/dna/gene/basic/nobreath name="No Breathing" activation_messages=list("You feel no need to breathe.") - mutation=M_NO_BREATH + mutation=NO_BREATH instability=2 New() @@ -15,7 +15,7 @@ /datum/dna/gene/basic/regenerate name="Regenerate" activation_messages=list("You feel better.") - mutation=M_REGEN + mutation=REGEN instability=2 New() @@ -24,7 +24,7 @@ /datum/dna/gene/basic/increaserun name="Super Speed" activation_messages=list("Your leg muscles pulsate.") - mutation=M_RUN + mutation=RUN instability=1 New() @@ -34,7 +34,7 @@ /datum/dna/gene/basic/heat_resist name="Heat Resistance" activation_messages=list("Your skin is icy to the touch.") - mutation=M_RESIST_HEAT + mutation=RESIST_HEAT instability=2 New() @@ -45,7 +45,7 @@ return !(/datum/dna/gene/basic/cold_resist in M.active_genes) // Probability check var/_prob = 15 - if(M_RESIST_COLD in M.mutations) + if(RESIST_COLD in M.mutations) _prob=5 if(probinj(_prob,(flags&MUTCHK_FORCED))) return 1 @@ -56,7 +56,7 @@ /datum/dna/gene/basic/cold_resist name="Cold Resistance" activation_messages=list("Your body is filled with warmth.") - mutation=M_RESIST_COLD + mutation=RESIST_COLD instability=2 New() @@ -67,7 +67,7 @@ return !(/datum/dna/gene/basic/heat_resist in M.active_genes) // Probability check var/_prob=30 - if(M_RESIST_HEAT in M.mutations) + if(RESIST_HEAT in M.mutations) _prob=5 if(probinj(_prob,(flags&MUTCHK_FORCED))) return 1 @@ -78,7 +78,7 @@ /datum/dna/gene/basic/noprints name="No Prints" activation_messages=list("Your fingers feel numb.") - mutation=M_FINGERPRINTS + mutation=FINGERPRINTS instability=1 New() @@ -87,7 +87,7 @@ /datum/dna/gene/basic/noshock name="Shock Immunity" activation_messages=list("Your skin feels strange.") - mutation=M_NO_SHOCK + mutation=NO_SHOCK instability=2 New() @@ -96,7 +96,7 @@ /datum/dna/gene/basic/midget name="Midget" activation_messages=list("Your skin feels rubbery.") - mutation=M_DWARF + mutation=DWARF instability=1 New() @@ -104,7 +104,7 @@ can_activate(var/mob/M,var/flags) // Can't be big and small. - if(M_HULK in M.mutations) + if(HULK in M.mutations) return 0 return ..(M,flags) @@ -115,7 +115,7 @@ /datum/dna/gene/basic/xray name="X-Ray Vision" activation_messages=list("The walls suddenly disappear.") - mutation=M_XRAY + mutation=XRAY instability=2 New() @@ -124,7 +124,7 @@ /datum/dna/gene/basic/tk name="Telekenesis" activation_messages=list("You feel smarter.") - mutation=M_TK + mutation=TK activation_prob=15 instability=5 diff --git a/code/game/dna/genes/vg_disabilities.dm b/code/game/dna/genes/vg_disabilities.dm index 9105047289c..6cb2c6f6ce8 100644 --- a/code/game/dna/genes/vg_disabilities.dm +++ b/code/game/dna/genes/vg_disabilities.dm @@ -30,7 +30,7 @@ can_activate(var/mob/M,var/flags) // No loud whispering. - if(M_LOUD in M.mutations) + if(LOUD in M.mutations) return 0 return ..(M,flags) @@ -51,5 +51,5 @@ OnMobLife(var/mob/living/carbon/human/M) if(!istype(M)) return - if(M_DIZZY in M.mutations) + if(DIZZY in M.mutations) M.Dizzy(300) diff --git a/code/game/dna/genes/vg_powers.dm b/code/game/dna/genes/vg_powers.dm index b4bdee1b464..2b45360f613 100644 --- a/code/game/dna/genes/vg_powers.dm +++ b/code/game/dna/genes/vg_powers.dm @@ -26,12 +26,12 @@ Obviously, requires DNA2. can_activate(var/mob/M,var/flags) // Can't be big AND small. - if(M_DWARF in M.mutations) + if(DWARF in M.mutations) return 0 return ..(M,flags) OnDrawUnderlays(var/mob/M,var/g,var/fat) - if(M_HULK in M.mutations) + if(HULK in M.mutations) if(fat) return "hulk_[fat]_s" else @@ -40,11 +40,11 @@ Obviously, requires DNA2. OnMobLife(var/mob/living/carbon/human/M) if(!istype(M)) return - if(M_HULK in M.mutations) + if(HULK in M.mutations) var/timeleft=M.hulk_time - world.time if(M.health <= 25 || timeleft <= 0) M.hulk_time=0 // Just to be sure. - M.mutations.Remove(M_HULK) + M.mutations.Remove(HULK) //M.dna.SetSEState(HULKBLOCK,0) M.update_mutations() //update our mutation overlays M.update_body() @@ -78,7 +78,7 @@ Obviously, requires DNA2. return var/mob/living/carbon/human/M=usr M.hulk_time = world.time + HULK_DURATION - M.mutations.Add(M_HULK) + M.mutations.Add(HULK) M.update_mutations() //update our mutation overlays M.update_body() //M.say(pick("",";")+pick("HULK MAD","YOU MADE HULK ANGRY")) // Just a note to security. @@ -98,7 +98,7 @@ Obviously, requires DNA2. deactivation_messages = list("You body feels normal.") - mutation=M_MORPH + mutation=MORPH instability=2 New() @@ -197,7 +197,7 @@ Obviously, requires DNA2. /datum/dna/gene/basic/grant_spell/remotetalk name="Telepathy" activation_messages=list("You expand your mind outwards.") - mutation=M_REMOTE_TALK + mutation=REMOTE_TALK instability=1 spelltype =/obj/effect/proc_holder/spell/wizard/targeted/remotetalk @@ -244,7 +244,7 @@ Obviously, requires DNA2. var/say = strip_html(input("What do you wish to say")) for(var/mob/living/target in targets) - if(M_REMOTE_TALK in target.mutations) + if(REMOTE_TALK in target.mutations) target.show_message("\blue You hear [usr.real_name]'s voice: [say]") else target.show_message("\blue You hear a voice that seems to echo around the room: [say]") @@ -257,7 +257,7 @@ Obviously, requires DNA2. /datum/dna/gene/basic/grant_spell/remoteview name="Remote Viewing" activation_messages=list("Your mind expands.") - mutation=M_REMOTE_VIEW + mutation=REMOTE_VIEW instability=3 spelltype =/obj/effect/proc_holder/spell/wizard/targeted/remoteview @@ -283,7 +283,7 @@ Obviously, requires DNA2. var/list/targets = living_mob_list var/list/remoteviewers = new /list() for(var/mob/M in targets) - if(M_REMOTE_VIEW in M.mutations) + if(REMOTE_VIEW in M.mutations) remoteviewers += M if(!remoteviewers.len || remoteviewers.len == 1) usr << "No valid targets with remote view were found!" @@ -316,7 +316,7 @@ Obviously, requires DNA2. for(var/mob/living/L in targets) if(ishuman(L)) var/mob/living/carbon/human/H = L - if(M_PSY_RESIST in H.mutations) + if(PSY_RESIST in H.mutations) continue target = L diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 9fdcc7ce7ba..7c336b0acab 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -129,7 +129,9 @@ return 0 - attackby(var/obj/item/weapon/W, var/mob/user) + attackby(var/obj/item/weapon/W, var/mob/living/user, params) + 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 @@ -144,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/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 3a0ebf2d928..9b3bf73845c 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -148,7 +148,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" if (changeling.current.mind) if (changeling.current.mind.assigned_role == "Clown") changeling.current << "You have evolved beyond your clownish nature, allowing you to wield weapons without harming yourself." - changeling.current.mutations.Remove(M_CLUMSY) + changeling.current.mutations.Remove(CLUMSY) var/obj_count = 1 for(var/datum/objective/objective in changeling.objectives) @@ -294,7 +294,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" user << "[T] is not compatible with our biology." return - if((M_NOCLONE || SKELETON || M_HUSK) in T.mutations) + if((NOCLONE || SKELETON || HUSK) in T.mutations) user << "DNA of [target] is ruined beyond usability!" return diff --git a/code/game/gamemodes/changeling/powers/tiny_prick.dm b/code/game/gamemodes/changeling/powers/tiny_prick.dm index d7820d11188..6158b8672bd 100644 --- a/code/game/gamemodes/changeling/powers/tiny_prick.dm +++ b/code/game/gamemodes/changeling/powers/tiny_prick.dm @@ -82,7 +82,7 @@ /obj/effect/proc_holder/changeling/sting/transformation/can_sting(var/mob/user, var/mob/target) if(!..()) return - if((M_HUSK in target.mutations) || (!ishuman(target) && !ismonkey(target))) + if((HUSK in target.mutations) || (!ishuman(target) && !ismonkey(target))) user << "Our sting appears ineffective against its DNA." return 0 if(ishuman(target)) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 473afa46c1e..c856fbd4b18 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -132,7 +132,7 @@ if (mob.mind) if (mob.mind.assigned_role == "Clown") mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself." - mob.mutations.Remove(M_CLUMSY) + mob.mutations.Remove(CLUMSY) add_cult_viewpoint(mob) // give them a viewpoint diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 7be5e01f382..65310a6b250 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -92,7 +92,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", return -/obj/effect/rune/attackby(I as obj, user as mob) +/obj/effect/rune/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/tome) && iscultist(user)) user << "You retrace your steps, carefully undoing the lines of the rune." del(src) @@ -487,7 +487,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", user << "The book seems full of illegible scribbles. Is this a joke?" return - attackby(obj/item/weapon/tome/T as obj, mob/living/user as mob) + attackby(obj/item/weapon/tome/T as obj, mob/living/user as mob, params) if(istype(T, /obj/item/weapon/tome)) // sanity check to prevent a runtime error switch(alert("Copy the runes from your tome?",,"Copy", "Cancel")) if("cancel") diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 6609005f935..a09804ac74e 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -1019,7 +1019,7 @@ var/list/sacrificed = list() if(iscarbon(L)) var/mob/living/carbon/C = L flick("e_flash", C.flash) - if(C.stuttering < 1 && (!(M_HULK in C.mutations))) + if(C.stuttering < 1 && (!(HULK in C.mutations))) C.stuttering = 1 C.Weaken(1) C.Stun(1) @@ -1046,7 +1046,7 @@ var/list/sacrificed = list() else if(iscarbon(T)) var/mob/living/carbon/C = T flick("e_flash", C.flash) - if (!(M_HULK in C.mutations)) + if (!(HULK in C.mutations)) C.silent += 15 C.Weaken(25) C.Stun(25) diff --git a/code/game/gamemodes/events/biomass.dm b/code/game/gamemodes/events/biomass.dm index 55d15a6f23e..598dad6abd6 100644 --- a/code/game/gamemodes/events/biomass.dm +++ b/code/game/gamemodes/events/biomass.dm @@ -20,7 +20,7 @@ master.growth_queue -= src ..() -/obj/effect/biomass/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/effect/biomass/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (!W || !user || !W.type) return switch(W.type) if(/obj/item/weapon/circular_saw) del src diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm index a02fc5042e7..03bdc2ab943 100644 --- a/code/game/gamemodes/events/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -850,7 +850,7 @@ ________________________________________________________________________________ //=======//GENERAL SUIT PROCS//=======// -/obj/item/clothing/suit/space/space_ninja/attackby(obj/item/I, mob/U) +/obj/item/clothing/suit/space/space_ninja/attackby(obj/item/I, mob/U, params) if(U==affecting)//Safety, in case you try doing this without wearing the suit/being the person with the suit. if(istype(I, /obj/item/device/aicard))//If it's an AI card. if(s_control) @@ -1554,34 +1554,35 @@ It is possible to destroy the net by the occupant or someone else. ..() return - attack_hand() - if (M_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 - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) var/aforce = W.force health = max(0, health - aforce) healthcheck() diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 6ece3bb13a1..05b1a04ea96 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -37,7 +37,7 @@ var/global/datum/controller/gameticker/ticker var/triai = 0//Global holder for Triumvirate var/initialtpass = 0 //holder for inital autotransfer vote timer - + var/round_end_announced = 0 // Spam Prevention. Announce round end only once. /datum/controller/gameticker/proc/pregame() @@ -214,10 +214,13 @@ var/global/datum/controller/gameticker/ticker if(admins_number == 0) send2adminirc("Round has started with no admins online.") + /* DONE THROUGH PROCESS SCHEDULER supply_controller.process() //Start the supply shuttle regenerating points -- TLE master_controller.process() //Start master_controller.process() lighting_controller.process() //Start processing DynamicAreaLighting updates + */ + processScheduler.start() if(config.sql_enabled) spawn(3000) @@ -259,7 +262,7 @@ var/global/datum/controller/gameticker/ticker switch(M.z) if(0) //inside a crate or something var/turf/T = get_turf(M) - if(T && (T.z in config.station_levels)) + if(T && (T.z in config.station_levels)) M.death(0) if(1) //on a z-level 1 turf. M.death(0) @@ -373,7 +376,7 @@ var/global/datum/controller/gameticker/ticker mode.process() mode.process_job_tasks() - emergency_shuttle.process() + //emergency_shuttle.process() DONE THROUGH PROCESS SCHEDULER var/game_finished = 0 var/mode_finished = 0 @@ -487,7 +490,7 @@ var/global/datum/controller/gameticker/ticker scoreboard() karmareminder() - + //Ask the event manager to print round end information event_manager.RoundEnd() diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm index 91289631400..96aacffa9b4 100644 --- a/code/game/gamemodes/heist/heist.dm +++ b/code/game/gamemodes/heist/heist.dm @@ -15,7 +15,7 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind' required_players = 15 required_players_secret = 25 required_enemies = 4 - recommended_enemies = 6 + recommended_enemies = 5 votable = 0 var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds) diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm index 22bc4e70e60..64656fb1a7e 100644 --- a/code/game/gamemodes/malfunction/malfunction.dm +++ b/code/game/gamemodes/malfunction/malfunction.dm @@ -89,11 +89,10 @@ /datum/game_mode/malfunction/process() if (apcs >= 3 && malf_mode_declared) - AI_win_timeleft -= ((apcs/6)*last_tick_duration) //Victory timer now de-increments based on how many APCs are hacked. --NeoFite + AI_win_timeleft -= ((apcs/6)*tickerProcess.getLastTickerTimeDuration()) //Victory timer now de-increments based on how many APCs are hacked. --NeoFite ..() if (AI_win_timeleft<=0) check_win() - return /datum/game_mode/malfunction/check_win() diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 91df8611aa0..8e04c69f71f 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -148,7 +148,7 @@ del(src) return -/obj/effect/meteor/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/effect/meteor/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/pickaxe)) del(src) return diff --git a/code/game/gamemodes/mutiny/emergency_authentication_device.dm b/code/game/gamemodes/mutiny/emergency_authentication_device.dm index 7ea8bcc004f..36a8c354caa 100644 --- a/code/game/gamemodes/mutiny/emergency_authentication_device.dm +++ b/code/game/gamemodes/mutiny/emergency_authentication_device.dm @@ -75,7 +75,7 @@ // Impossible! state("Command aborted. This unit is defective.") -/obj/machinery/emergency_authentication_device/attackby(obj/item/weapon/O, mob/user) +/obj/machinery/emergency_authentication_device/attackby(obj/item/weapon/O, mob/user, params) if(activated) user << "\blue \The [src] is already active!" return diff --git a/code/game/gamemodes/nations/flagprocs.dm b/code/game/gamemodes/nations/flagprocs.dm index 439167273ac..b7dc23a2913 100644 --- a/code/game/gamemodes/nations/flagprocs.dm +++ b/code/game/gamemodes/nations/flagprocs.dm @@ -20,7 +20,7 @@ /obj/item/flag/nation/light() return -/obj/item/flag/nation/attackby(var/obj/item/weapon/W, var/mob/user) +/obj/item/flag/nation/attackby(var/obj/item/weapon/W, var/mob/user, params) return /obj/item/flag/nation/attack_paw() diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 8d4686148b1..c02d782612b 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -55,7 +55,7 @@ var/bomb_set nanomanager.update_uis(src) return -/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob) +/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob, params) if (istype(O, /obj/item/weapon/screwdriver)) src.add_fingerprint(user) if (src.auth) diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 56ae8c531a0..cb04e55949a 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -183,7 +183,7 @@ if (mob.mind) if (mob.mind.assigned_role == "Clown") mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself." - mob.mutations.Remove(M_CLUMSY) + mob.mutations.Remove(CLUMSY) var/obj/item/device/flash/T = new(mob) diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index e5c19a016be..926627a4a01 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -301,7 +301,7 @@ if (traitor_mob.mind) if (traitor_mob.mind.assigned_role == "Clown") traitor_mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself." - traitor_mob.mutations.Remove(M_CLUMSY) + traitor_mob.mutations.Remove(CLUMSY) // find a radio! toolbox(es), backpack, belt, headset var/obj/item/R = locate(/obj/item/device/pda) in traitor_mob.contents //Hide the uplink in a PDA if available, otherwise radio diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index 42eb879c5be..32541587e28 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -193,7 +193,7 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha if (vampire.current.mind) if (vampire.current.mind.assigned_role == "Clown") vampire.current << "Your lust for blood has allowed you to overcome your clumsy nature allowing you to wield weapons without harming yourself." - vampire.current.mutations.Remove(M_CLUMSY) + vampire.current.mutations.Remove(CLUMSY) var/obj_count = 1 for(var/datum/objective/objective in vampire.objectives) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 4bda30ebe02..4c185e8f628 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -174,7 +174,7 @@ if(cowsleft <= 0) del src -/obj/effect/rend/cow/attackby(obj/item/I as obj, mob/user as mob) +/obj/effect/rend/cow/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/nullrod)) visible_message("\red [I] strikes a blow against \the [src], banishing it!") spawn(1) diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm index b156f9861dc..6d27d3fd636 100644 --- a/code/game/gamemodes/wizard/rightandwrong.dm +++ b/code/game/gamemodes/wizard/rightandwrong.dm @@ -113,8 +113,8 @@ new /obj/item/clothing/head/helmet/space/rig/wizard(get_turf(H)) if("scrying") new /obj/item/weapon/scrying(get_turf(H)) - if (!(M_XRAY in H.mutations)) - H.mutations.Add(M_XRAY) + if (!(XRAY in H.mutations)) + H.mutations.Add(XRAY) H.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) H.see_in_dark = 8 H.see_invisible = SEE_INVISIBLE_LEVEL_TWO diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index 3110498f73e..58b0077d31b 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -90,7 +90,7 @@ icon_state = "construct" desc = "A wicked machine used by those skilled in magical arts. It is inactive" -/obj/structure/constructshell/attackby(obj/item/O as obj, mob/user as mob) +/obj/structure/constructshell/attackby(obj/item/O as obj, mob/user as mob, params) if(istype(O, /obj/item/device/soulstone)) O.transfer_soul("CONSTRUCT",src,user) diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 5beafdeb055..43f58169edf 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -12,7 +12,7 @@ var/op = 1 var/activepage -/obj/item/weapon/spellbook/attackby(obj/item/O as obj, mob/user as mob) +/obj/item/weapon/spellbook/attackby(obj/item/O as obj, mob/user as mob, params) if(istype(O, /obj/item/weapon/contract)) var/obj/item/weapon/contract/contract = O if(contract.used) @@ -366,8 +366,8 @@ if("scrying") feedback_add_details("wizard_spell_learned","SO") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells new /obj/item/weapon/scrying(get_turf(H)) - if (!(M_XRAY in H.mutations)) - H.mutations.Add(M_XRAY) + if (!(XRAY in H.mutations)) + H.mutations.Add(XRAY) H.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) H.see_in_dark = 8 H.see_invisible = SEE_INVISIBLE_LEVEL_TWO diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index 3962f5a7b39..45d19411b32 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -147,7 +147,7 @@ L.part = affected H.dna.SetSEState(SOBERBLOCK,1) - H.mutations += M_SOBER + H.mutations += SOBER H.check_mutations = 1 return 1 diff --git a/code/game/jobs/job/support.dm b/code/game/jobs/job/support.dm index 9ad35052c25..96e5d089b22 100644 --- a/code/game/jobs/job/support.dm +++ b/code/game/jobs/job/support.dm @@ -31,7 +31,7 @@ H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_in_backpack) H.dna.SetSEState(SOBERBLOCK,1) - H.mutations += M_SOBER + H.mutations += SOBER H.check_mutations = 1 return 1 @@ -226,7 +226,7 @@ H.equip_or_collect(new /obj/item/toy/crayon/rainbow(H), slot_in_backpack) H.equip_or_collect(new /obj/item/weapon/storage/fancy/crayons(H), slot_in_backpack) H.equip_or_collect(new /obj/item/weapon/reagent_containers/spray/waterflower(H), slot_in_backpack) - H.mutations.Add(M_CLUMSY) + H.mutations.Add(CLUMSY) H.dna.SetSEState(COMICBLOCK,1,1) genemutcheck(H,COMICBLOCK,null,MUTCHK_FORCED) return 1 @@ -247,8 +247,7 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_or_collect(new /obj/item/weapon/storage/backpack(H), slot_back) - if(H.backbag == 3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_or_collect(new /obj/item/weapon/storage/backpack/mime(H), slot_back) if(H.gender == FEMALE) H.equip_or_collect(new /obj/item/clothing/under/sexymime(H), slot_w_uniform) H.equip_or_collect(new /obj/item/clothing/mask/gas/sexymime(H), slot_wear_mask) @@ -261,14 +260,9 @@ H.equip_or_collect(new /obj/item/clothing/gloves/color/white(H), slot_gloves) H.equip_or_collect(new /obj/item/clothing/head/beret(H), slot_head) H.equip_or_collect(new /obj/item/clothing/suit/suspenders(H), slot_wear_suit) - if(H.backbag == 1) - H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) - H.equip_or_collect(new /obj/item/toy/crayon/mime(H), slot_l_store) - H.equip_or_collect(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_l_hand) - else - H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) - H.equip_or_collect(new /obj/item/toy/crayon/mime(H), slot_in_backpack) - H.equip_or_collect(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_in_backpack) + H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_or_collect(new /obj/item/toy/crayon/mime(H), slot_in_backpack) + H.equip_or_collect(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_in_backpack) H.verbs += /client/proc/mimespeak H.verbs += /client/proc/mimewall H.mind.special_verbs += /client/proc/mimespeak diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 255d6faa4e2..070b99571ce 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -44,7 +44,7 @@ min_temperature = T0C - (170 + (T*15)) current_heat_capacity = 1000 * ((H - 1) ** 2) -/obj/machinery/atmospherics/unary/cold_sink/freezer/attackby(obj/item/I, mob/user) +/obj/machinery/atmospherics/unary/cold_sink/freezer/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "freezer-o", "freezer", I)) on = 0 update_icon() @@ -201,7 +201,7 @@ max_temperature = T20C + (140 * T) current_heat_capacity = 1000 * ((H - 1) ** 2) -/obj/machinery/atmospherics/unary/heat_reservoir/heater/attackby(obj/item/I, mob/user) +/obj/machinery/atmospherics/unary/heat_reservoir/heater/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "heater-o", "heater", I)) on = 0 update_icon() diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index a3c44bf7fb7..9cdbe1fd662 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -43,7 +43,7 @@ del(src) /obj/machinery/optable/attack_paw(mob/user as mob) - if ((M_HULK in usr.mutations)) + if ((HULK in usr.mutations)) usr << text("\blue You destroy the operating table.") visible_message("\red [usr] destroys the operating table!") src.density = 0 @@ -56,7 +56,7 @@ return /obj/machinery/optable/attack_hand(mob/user as mob) - if (M_HULK in usr.mutations) + if (HULK in usr.mutations) usr << text("\blue You destroy the table.") visible_message("\red [usr] destroys the operating table!") src.density = 0 @@ -130,7 +130,7 @@ take_victim(usr,usr) -/obj/machinery/optable/attackby(obj/item/weapon/W as obj, mob/living/carbon/user as mob) +/obj/machinery/optable/attackby(obj/item/weapon/W as obj, mob/living/carbon/user as mob, params) if (istype(W, /obj/item/weapon/grab)) if(iscarbon(W:affecting)) take_victim(W:affecting,usr) diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index a7124c21120..cdf5e479ef5 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -40,7 +40,7 @@ src.colorlist += D -/obj/machinery/pdapainter/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/pdapainter/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/device/pda)) if(storedpda) user << "There is already a PDA inside." diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 52476c7ce02..841916a9a74 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -68,8 +68,15 @@ 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) +/obj/machinery/sleep_console/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params) if (istype(G, /obj/item/weapon/screwdriver)) default_deconstruction_screwdriver(user, "console-p", "console", G) return @@ -285,7 +292,7 @@ return -/obj/machinery/sleeper/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) +/obj/machinery/sleeper/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params) if(istype(G, /obj/item/weapon/reagent_containers/glass)) if(!beaker) beaker = G diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index a173afb2a4e..c4994ebe746 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -320,7 +320,7 @@ */ -/obj/machinery/body_scanconsole/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) +/obj/machinery/body_scanconsole/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params) if (istype(G, /obj/item/weapon/screwdriver)) default_deconstruction_screwdriver(user, "bodyscannerconsole-p", "bodyscannerconsole", G) return diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index 1bcb2eec634..17ee041e81b 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -28,7 +28,7 @@ src.uses = uses src.power_change() -/obj/machinery/ai_slipper/attackby(obj/item/weapon/W, mob/user) +/obj/machinery/ai_slipper/attackby(obj/item/weapon/W, mob/user, params) if(stat & (NOPOWER|BROKEN)) return if (istype(user, /mob/living/silicon)) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 76280bc3630..777268f0aef 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -930,7 +930,7 @@ updateUsrDialog() -/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob) +/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob, params) /* if (istype(W, /obj/item/weapon/wirecutters)) stat ^= BROKEN add_fingerprint(user) @@ -1062,7 +1062,7 @@ Code shamelessly copied from apc_frame icon_state = "alarm_bitem" flags = CONDUCT -/obj/item/alarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/alarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 ) del(src) @@ -1164,7 +1164,7 @@ FIRE ALARM if(prob(50/severity)) alarm() ..() -/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob) +/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob, params) src.add_fingerprint(user) if (istype(W, /obj/item/weapon/screwdriver) && buildstage == 2) @@ -1398,7 +1398,7 @@ Code shamelessly copied from apc_frame icon_state = "fire_bitem" flags = CONDUCT -/obj/item/firealarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/firealarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 ) del(src) diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm index 1d0cab15733..e6338b824e0 100644 --- a/code/game/machinery/atmo_control.dm +++ b/code/game/machinery/atmo_control.dm @@ -101,7 +101,7 @@ obj/machinery/air_sensor sensors = list() src.updateUsrDialog() - attackby(I as obj, user as mob) + attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) @@ -382,7 +382,7 @@ legend { var/cutoff_temperature = 2000 var/on_temperature = 1200 - attackby(I as obj, user as mob) + attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 8ae1166ff29..4140d7cdcfe 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -337,7 +337,7 @@ update_flag healthcheck() return -/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if(iswelder(W) && src.destroyed) if(weld(W, user)) user << "\blue You salvage whats left of \the [src]" diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index c7bc14c65d3..3da432b94f3 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -105,7 +105,7 @@ return ..() -/obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if (!istype(W, /obj/item/weapon/wrench)) return ..() playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) @@ -130,5 +130,5 @@ if (!target) src.target = loc -/obj/machinery/meter/turf/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/meter/turf/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) return diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index ea319bf2e32..ed56300120d 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -82,7 +82,7 @@ return 1 -/obj/machinery/portable_atmospherics/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/machinery/portable_atmospherics/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) var/obj/icon = src if ((istype(W, /obj/item/weapon/tank) && !( src.destroyed ))) if (src.holding) diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 08c1d42b9ed..4821ef4f15b 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -48,7 +48,7 @@ else icon_state = "scrubber:0" - attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) if(on) user << "\blue Turn it off first!" @@ -65,7 +65,7 @@ /obj/machinery/portable_atmospherics/scrubber/huge/stationary name = "Stationary Air Scrubber" - attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) user << "\blue The bolts are too tight for you to unscrew!" return diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 7eb1b51da9e..b7cdd87cdaa 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -101,7 +101,7 @@ return -/obj/machinery/autolathe/attackby(obj/item/O, mob/user) +/obj/machinery/autolathe/attackby(obj/item/O, mob/user, params) if (busy) user << "The autolathe is busy. Please wait for completion of previous operation." return 1 diff --git a/code/game/machinery/bees_apiary.dm b/code/game/machinery/bees_apiary.dm index d4e6aa6307e..9021c4ba84d 100644 --- a/code/game/machinery/bees_apiary.dm +++ b/code/game/machinery/bees_apiary.dm @@ -43,7 +43,7 @@ ..() return -/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/queen_bee)) if(health > 0) user << "\red There is already a queen in there." diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index 24335ebd65a..bf53df74ecf 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -50,7 +50,7 @@ icon_state = "biogen-work" return -/obj/machinery/biogenerator/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/biogenerator/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/reagent_containers/glass) && !panel_open) if(beaker) user << "A container is already loaded into the machine." diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index e676f69c130..11e11409ae8 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 @@ -229,7 +232,7 @@ return 1 //Successful completion. Used to prevent child process() continuing if this one is ended early. -/obj/machinery/bot/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/bot/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/screwdriver)) if(!locked) open = !open diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index a77235dad26..7bd66b6838f 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -116,7 +116,7 @@ text("[on ? "On" : "Off"]")) beacon_freq = freq updateUsrDialog() -/obj/machinery/bot/cleanbot/attackby(obj/item/weapon/W, mob/user as mob) +/obj/machinery/bot/cleanbot/attackby(obj/item/weapon/W, mob/user as mob, params) if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if(allowed(usr) && !open && !emagged) locked = !locked @@ -262,7 +262,7 @@ text("[on ? "On" : "Off"]")) qdel(src) return -/obj/item/weapon/bucket_sensor/attackby(var/obj/item/W, mob/user as mob) +/obj/item/weapon/bucket_sensor/attackby(var/obj/item/W, mob/user as mob, params) ..() if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm)) user.drop_item() diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index bffd8a07032..2c9055e29c4 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -170,7 +170,7 @@ Auto Patrol[]"}, declare_arrests = !declare_arrests updateUsrDialog() -/obj/machinery/bot/ed209/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/bot/ed209/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if (allowed(user) && !open && !emagged) locked = !locked @@ -257,7 +257,7 @@ Auto Patrol[]"}, icon_state = "[lasercolor]ed209[on]" var/mob/living/carbon/M = target if(istype(M, /mob/living/carbon/human)) - if( M.stuttering < 5 && !(M_HULK in M.mutations) ) + if( M.stuttering < 5 && !(HULK in M.mutations) ) M.stuttering = 5 M.Stun(5) M.Weaken(5) @@ -538,7 +538,7 @@ Auto Patrol[]"}, -/obj/item/weapon/ed209_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/ed209_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/pen)) diff --git a/code/game/machinery/bots/farmbot.dm b/code/game/machinery/bots/farmbot.dm index d5eff718549..c8775c7f5ca 100644 --- a/code/game/machinery/bots/farmbot.dm +++ b/code/game/machinery/bots/farmbot.dm @@ -161,7 +161,7 @@ src.updateUsrDialog() return -/obj/machinery/bot/farmbot/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/bot/farmbot/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if (src.allowed(user)) src.locked = !src.locked @@ -531,7 +531,7 @@ new /obj/structure/reagent_dispensers/watertank(src) -/obj/structure/reagent_dispensers/watertank/attackby(var/obj/item/robot_parts/S, mob/user as mob) +/obj/structure/reagent_dispensers/watertank/attackby(var/obj/item/robot_parts/S, mob/user as mob, params) if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm))) ..() @@ -547,7 +547,7 @@ user.unEquip(S) del(S) -/obj/item/weapon/farmbot_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/farmbot_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if((istype(W, /obj/item/device/analyzer/plant_analyzer)) && (!src.build_step)) src.build_step++ diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index e9a8c67093f..4af5331c8ab 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -133,7 +133,7 @@ return -/obj/machinery/bot/floorbot/attackby(var/obj/item/W , mob/user as mob) +/obj/machinery/bot/floorbot/attackby(var/obj/item/W , mob/user as mob, params) if(istype(W, /obj/item/stack/tile/plasteel)) var/obj/item/stack/tile/plasteel/T = W if(amount >= 50) @@ -477,7 +477,7 @@ obj/machinery/bot/floorbot/process_scan(var/scan_target) return -/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/plasteel/T, mob/user as mob) +/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/plasteel/T, mob/user as mob, params) if(!istype(T, /obj/item/stack/tile/plasteel)) ..() return @@ -496,7 +496,7 @@ obj/machinery/bot/floorbot/process_scan(var/scan_target) user << "You need 10 floor tiles to start building a floorbot." return -/obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob) +/obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob, params) ..() if(isprox(W)) qdel(W) @@ -516,7 +516,7 @@ obj/machinery/bot/floorbot/process_scan(var/scan_target) created_name = t -/obj/item/weapon/toolbox_tiles_sensor/attackby(var/obj/item/W, mob/user as mob) +/obj/item/weapon/toolbox_tiles_sensor/attackby(var/obj/item/W, mob/user as mob, params) ..() if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm)) qdel(W) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index aa0dd6c94ab..078d9fff2b9 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -220,7 +220,7 @@ updateUsrDialog() return -/obj/machinery/bot/medbot/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/bot/medbot/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if (allowed(user) && !open && !emagged) locked = !locked @@ -541,7 +541,7 @@ * Medbot Assembly -- Can be made out of all three medkits. */ -/obj/item/weapon/storage/firstaid/attackby(var/obj/item/robot_parts/S, mob/user as mob) +/obj/item/weapon/storage/firstaid/attackby(var/obj/item/robot_parts/S, mob/user as mob, params) if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm))) ..() @@ -567,7 +567,7 @@ qdel(src) -/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/pen)) var/t = stripped_input(user, "Enter new robot name", name, created_name,MAX_NAME_LEN) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index bbab6f7d9e7..93342641732 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -86,7 +86,7 @@ var/global/mulebot_count = 0 // screwdriver: open/close hatch // cell: insert it // other: chance to knock rider off bot -/obj/machinery/bot/mulebot/attackby(var/obj/item/I, var/mob/user) +/obj/machinery/bot/mulebot/attackby(var/obj/item/I, var/mob/user, params) if(istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda)) if(toggle_lock(user)) user << "Controls [(locked ? "locked" : "unlocked")]." diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 2b70de39797..a790767c851 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -175,7 +175,7 @@ Auto Patrol: []"}, updateUsrDialog() -/obj/machinery/bot/secbot/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/bot/secbot/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if(allowed(user) && !open && !emagged) locked = !locked @@ -241,7 +241,7 @@ Auto Patrol: []"}, icon_state = "[base_icon][on]" var/mob/living/carbon/M = target if(istype(M, /mob/living/carbon/human)) - if( M.stuttering < 5 && !(M_HULK in M.mutations) ) + if( M.stuttering < 5 && !(HULK in M.mutations) ) M.stuttering = 5 if(harmbaton) // Bots with harmbaton enabled become shitcurity. - Dave M.apply_damage(10) @@ -412,7 +412,7 @@ Auto Patrol: []"}, //Secbot Construction -/obj/item/clothing/head/helmet/attackby(var/obj/item/device/assembly/signaler/S, mob/user as mob) +/obj/item/clothing/head/helmet/attackby(var/obj/item/device/assembly/signaler/S, mob/user as mob, params) ..() if(!issignaler(S)) ..() @@ -431,7 +431,7 @@ Auto Patrol: []"}, else return -/obj/item/weapon/secbot_assembly/attackby(obj/item/I, mob/user) +/obj/item/weapon/secbot_assembly/attackby(obj/item/I, mob/user, params) ..() if(istype(I, /obj/item/weapon/weldingtool)) if(!build_step) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 865bf2f3cb8..f0633e1a3e4 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) @@ -122,7 +123,7 @@ src.view_range = num cameranet.updateVisibility(src, 0) -/obj/machinery/camera/attackby(obj/W as obj, mob/living/user as mob) +/obj/machinery/camera/attackby(obj/W as obj, mob/living/user as mob, params) //invalidateCameraCache() // DECONSTRUCTION if(isscrewdriver(W)) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index e8c7656032a..9b059b41d3f 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -21,7 +21,7 @@ 4 = Screwdriver panel closed and is fully built (you cannot attach upgrades) */ -/obj/item/weapon/camera_assembly/attackby(obj/item/W as obj, mob/living/user as mob) +/obj/item/weapon/camera_assembly/attackby(obj/item/W as obj, mob/living/user as mob, params) switch(state) diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 5a9822d6531..823671c2019 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -34,7 +34,7 @@ if(charging) usr << "Current charge: [charging.charge]" - attackby(obj/item/weapon/W, mob/user) + attackby(obj/item/weapon/W, mob/user, params) if(stat & BROKEN) return diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index f7eb7803fd4..27e16c1be95 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -328,7 +328,7 @@ return //Let's unlock this early I guess. Might be too early, needs tweaking. -/obj/machinery/clonepod/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/clonepod/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/screwdriver)) if(occupant || mess || locked) user << "The maintenance panel is locked." diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index fc2187c24db..a14da59c097 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -161,7 +161,7 @@ -/obj/machinery/computer/HolodeckControl/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) +/obj/machinery/computer/HolodeckControl/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob, params) return /obj/machinery/computer/HolodeckControl/emag_act(user as mob) @@ -365,7 +365,7 @@ var/turf/simulated/floor/FF = get_step(src,direction) FF.update_icon() //so siding get updated properly -/turf/simulated/floor/holofloor/attackby(obj/item/weapon/W as obj, mob/user as mob) +/turf/simulated/floor/holofloor/attackby(obj/item/weapon/W as obj, mob/user as mob, params) return // HOLOFLOOR DOES NOT GIVE A FUCK @@ -402,7 +402,7 @@ return // HOLOTABLE DOES NOT GIVE A FUCK -/obj/structure/table/holotable/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/table/holotable/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) var/obj/item/weapon/grab/G = W if(G.state<2) @@ -522,7 +522,7 @@ density = 1 throwpass = 1 -/obj/structure/holohoop/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/holohoop/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) var/obj/item/weapon/grab/G = W if(G.state<2) @@ -580,7 +580,7 @@ ..() -/obj/machinery/readybutton/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/readybutton/attackby(obj/item/weapon/W as obj, mob/user as mob, params) user << "The device is a solid button, there's nothing you can do with it!" /obj/machinery/readybutton/attack_hand(mob/user as mob) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 34774d936cc..d408d934c25 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -10,7 +10,7 @@ var/obj/item/device/mmi/brain = null -/obj/structure/AIcore/attackby(obj/item/P as obj, mob/user as mob) +/obj/structure/AIcore/attackby(obj/item/P as obj, mob/user as mob, params) switch(state) if(0) if(istype(P, /obj/item/weapon/wrench)) @@ -179,7 +179,7 @@ empty_playable_ai_cores -= src ..() -/obj/structure/AIcore/deactivated/attackby(var/obj/item/W, var/mob/user) +/obj/structure/AIcore/deactivated/attackby(var/obj/item/W, var/mob/user, params) if(istype(W, /obj/item/device/aicard))//Is it? var/obj/item/device/aicard/card = W card.transfer_ai("INACTIVE","AICARD",src,user) diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index febf071bfb5..51c8626c1d1 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -13,7 +13,7 @@ src.overlays += image('icons/obj/computer.dmi', "ai-fixer-empty") -/obj/machinery/computer/aifixer/attackby(I as obj, user as mob) +/obj/machinery/computer/aifixer/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/device/aicard)) if(stat & (NOPOWER|BROKEN)) user << "This terminal isn't functioning right now, get it working!" diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index eb8efc36264..23743ffc10c 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -233,7 +233,7 @@ board_type = "honkcomputer" -/obj/item/weapon/circuitboard/supplycomp/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/circuitboard/supplycomp/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I,/obj/item/device/multitool)) var/catastasis = src.contraband_enabled var/opposite_catastasis @@ -255,7 +255,7 @@ user << "DERP! BUG! Report this (And what you were doing to cause it) to Agouri" return -/obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I,/obj/item/weapon/screwdriver)) user.visible_message("\blue \the [user] adjusts the jumper on the [src]'s access protocol pins.", "\blue You adjust the jumper on the access protocol pins.") if(src.build_path == "/obj/machinery/computer/rdconsole/core") @@ -268,7 +268,7 @@ user << "\blue Access protocols set to default." return -/obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob) +/obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob, params) switch(state) if(0) if(istype(P, /obj/item/weapon/wrench)) @@ -379,7 +379,7 @@ name = "Bananium Computer-frame" icon = 'icons/obj/machines/HONKputer.dmi' -/obj/structure/computerframe/HONKputer/attackby(obj/item/P as obj, mob/user as mob) +/obj/structure/computerframe/HONKputer/attackby(obj/item/P as obj, mob/user as mob, params) switch(state) if(0) if(istype(P, /obj/item/weapon/wrench)) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 3a035c3ef7d..c48a2056572 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -53,7 +53,7 @@ return 1 // Network configuration - attackby(I as obj, user as mob) + attackby(I as obj, user as mob, params) access = list() if(istype(I,/obj/item/weapon/card/id)) // If hit by a regular ID card. var/obj/item/weapon/card/id/E = I diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 87552942026..73931aa0183 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -55,7 +55,7 @@ usr << "There is nothing to remove from the console." return -/obj/machinery/computer/card/attackby(obj/item/weapon/card/id/id_card, mob/user) +/obj/machinery/computer/card/attackby(obj/item/weapon/card/id/id_card, mob/user, params) if(!istype(id_card)) return ..() diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index e197042437f..bf28014c6e9 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -73,7 +73,7 @@ return podf -/obj/machinery/computer/cloning/attackby(obj/item/W as obj, mob/user as mob) +/obj/machinery/computer/cloning/attackby(obj/item/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES if (!src.diskette) user.drop_item() @@ -329,7 +329,7 @@ scantemp = "Error: Mental interface failure." nanomanager.update_uis(src) return - if ((M_NOCLONE in subject.mutations) && src.scanner.scan_level < 2) + if ((NOCLONE in subject.mutations) && src.scanner.scan_level < 2) scantemp = "Error: Mental interface failure." nanomanager.update_uis(src) return diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 9dab90e6ed3..13fe459ec45 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -103,7 +103,7 @@ update_icon() -/obj/machinery/computer/attackby(I as obj, user as mob) +/obj/machinery/computer/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver) && circuit) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) @@ -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/computer/honkputer.dm b/code/game/machinery/computer/honkputer.dm index 79ce2e97edf..bd9d0344a2c 100644 --- a/code/game/machinery/computer/honkputer.dm +++ b/code/game/machinery/computer/honkputer.dm @@ -90,7 +90,7 @@ onclose(user, "honkputer") -/obj/machinery/computer/HONKputer/attackby(I as obj, user as mob) +/obj/machinery/computer/HONKputer/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver) && circuit) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 47a0951b20e..6901f72d63f 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -26,7 +26,7 @@ return - attackby(obj/item/weapon/O as obj, mob/user as mob) + attackby(obj/item/weapon/O as obj, mob/user as mob, params) if (user.z > 6) user << "\red Unable to establish a connection: \black You're too far away from the station!" return @@ -63,7 +63,7 @@ var/mob/living/silicon/robot/current = null - attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) + attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params) if(istype(module, /obj/item/weapon/aiModule)) module.install(src) else diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 879e6b8f150..3cf15c5308a 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -36,7 +36,7 @@ l_color = "#50AB00" -/obj/machinery/computer/message_monitor/attackby(obj/item/weapon/O as obj, mob/living/user as mob) +/obj/machinery/computer/message_monitor/attackby(obj/item/weapon/O as obj, mob/living/user as mob, params) if(stat & (NOPOWER|BROKEN)) return if(!istype(user)) diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 94636091dde..69c68ecf8aa 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -50,7 +50,7 @@ return /* -/obj/machinery/computer/pod/attackby(I as obj, user as mob) +/obj/machinery/computer/pod/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm index e4c51cc8dab..fc325978682 100644 --- a/code/game/machinery/computer/power.dm +++ b/code/game/machinery/computer/power.dm @@ -40,7 +40,7 @@ return interact(user) -/obj/machinery/power/monitor/attackby(I as obj, user as mob) +/obj/machinery/power/monitor/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/computer/prisonshuttle.dm b/code/game/machinery/computer/prisonshuttle.dm index 9ce03c4630d..a5837969741 100644 --- a/code/game/machinery/computer/prisonshuttle.dm +++ b/code/game/machinery/computer/prisonshuttle.dm @@ -22,7 +22,7 @@ var/prison_shuttle_timeleft = 0 var/prison_break = 0 - attackby(I as obj, user as mob) + attackby(I as obj, user as mob, params) return src.attack_hand(user) @@ -34,7 +34,7 @@ var/prison_shuttle_timeleft = 0 return src.attack_hand(user) - attackby(I as obj, user as mob) + attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/computer/salvage_ship.dm b/code/game/machinery/computer/salvage_ship.dm index a67868fe3de..5e0feda0c20 100644 --- a/code/game/machinery/computer/salvage_ship.dm +++ b/code/game/machinery/computer/salvage_ship.dm @@ -36,7 +36,7 @@ return 1 -/obj/machinery/computer/salvage_ship/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/computer/salvage_ship/attackby(obj/item/I as obj, mob/user as mob, params) return attack_hand(user) /obj/machinery/computer/salvage_ship/attack_ai(mob/user as mob) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index de83237918c..1094ede2762 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -25,7 +25,7 @@ l_color = "#B40000" -/obj/machinery/computer/secure_data/attackby(obj/item/O as obj, user as mob) +/obj/machinery/computer/secure_data/attackby(obj/item/O as obj, user as mob, params) if(istype(O, /obj/item/weapon/card/id) && !scan) usr.drop_item() O.loc = src diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index 93b4c91c2c9..ee4a88fb89b 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -8,7 +8,7 @@ l_color = "#7BF9FF" - attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob, params) if(stat & (BROKEN|NOPOWER)) return if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location() || !( user ))) return if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 9a2372edd9a..9f1781519ae 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -22,7 +22,7 @@ var/order = 1 // -1 = Descending - 1 = Ascending -/obj/machinery/computer/skills/attackby(obj/item/O as obj, user as mob) +/obj/machinery/computer/skills/attackby(obj/item/O as obj, user as mob, params) if(istype(O, /obj/item/weapon/card/id) && !scan) usr.drop_item() O.loc = src diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm index 7a90e1de8b1..68ded19320d 100644 --- a/code/game/machinery/computer/specops_shuttle.dm +++ b/code/game/machinery/computer/specops_shuttle.dm @@ -252,7 +252,7 @@ var/specops_shuttle_timeleft = 0 /obj/machinery/computer/specops_shuttle/attack_paw(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer/specops_shuttle/attackby(I as obj, user as mob) +/obj/machinery/computer/specops_shuttle/attackby(I as obj, user as mob, params) if(istype(I,/obj/item/weapon/card/emag)) user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals." else diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm index a6ae2e3628a..288fa2dfdf6 100644 --- a/code/game/machinery/computer/syndicate_specops_shuttle.dm +++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm @@ -176,7 +176,7 @@ var/syndicate_elite_shuttle_timeleft = 0 if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0 else return 1 -/obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob) +/obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob, params) return attack_hand(user) /obj/machinery/computer/syndicate_elite_shuttle/attack_ai(var/mob/user as mob) @@ -186,7 +186,7 @@ var/syndicate_elite_shuttle_timeleft = 0 /obj/machinery/computer/syndicate_elite_shuttle/attack_paw(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob) +/obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob, params) if(istype(I,/obj/item/weapon/card/emag)) user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals." else diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm index 4e49e677901..f65ad4aae49 100644 --- a/code/game/machinery/computer/telecrystalconsoles.dm +++ b/code/game/machinery/computer/telecrystalconsoles.dm @@ -29,7 +29,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F name = "[name] [rand(1,999)]" -/obj/machinery/computer/telecrystals/uplinker/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/computer/telecrystals/uplinker/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item)) if(uplinkholder) diff --git a/code/game/machinery/computer/xenos_shuttle.dm b/code/game/machinery/computer/xenos_shuttle.dm index 5d5f921fdba..cdcb5efce43 100644 --- a/code/game/machinery/computer/xenos_shuttle.dm +++ b/code/game/machinery/computer/xenos_shuttle.dm @@ -85,7 +85,7 @@ return 1 -/obj/machinery/computer/xenos_station/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/computer/xenos_station/attackby(obj/item/I as obj, mob/user as mob, params) return attack_hand(user) /obj/machinery/computer/xenos_station/attack_ai(mob/user as mob) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 0d3dddbba8b..546b5956f0b 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -92,7 +92,7 @@ else desc += "." -/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P as obj, mob/user as mob) +/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P as obj, mob/user as mob, params) if(P.crit_fail) user << "This part is faulty, you cannot add this to the machine!" return @@ -270,7 +270,7 @@ to destroy them and players will be able to make replacements. /obj/machinery/vending/suitdispenser = "Suitlord 9000", /obj/machinery/vending/shoedispenser = "Shoelord 9000") -/obj/item/weapon/circuitboard/vendor/attackby(obj/item/I, mob/user) +/obj/item/weapon/circuitboard/vendor/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/screwdriver)) set_type(pick(names_paths), user) @@ -306,7 +306,7 @@ to destroy them and players will be able to make replacements. /obj/item/stack/cable_coil = 1, /obj/item/weapon/stock_parts/console_screen = 1) -/obj/item/weapon/circuitboard/thermomachine/attackby(obj/item/I, mob/user) +/obj/item/weapon/circuitboard/thermomachine/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/screwdriver)) if(build_path == /obj/machinery/atmospherics/unary/cold_sink/freezer) build_path = /obj/machinery/atmospherics/unary/heat_reservoir/heater diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index d4dc7ac6192..4a33f3511d7 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -270,7 +270,7 @@ add_fingerprint(usr) return 1 // update UIs attached to this object -/obj/machinery/atmospherics/unary/cryo_cell/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) +/obj/machinery/atmospherics/unary/cryo_cell/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params) if(istype(G, /obj/item/weapon/reagent_containers/glass)) if(beaker) user << "\red A beaker is already loaded into the machine." diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 804c0d92e3e..dec81660ef4 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -406,7 +406,7 @@ name = initial(name) -/obj/machinery/cryopod/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) +/obj/machinery/cryopod/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params) if(istype(G, /obj/item/weapon/grab)) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 94ded8abee1..8cde409e649 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -65,7 +65,7 @@ for reference: var/health = 100.0 var/maxhealth = 100.0 - attackby(obj/item/W as obj, mob/user as mob) + attackby(obj/item/W as obj, mob/user as mob, params) if (istype(W, /obj/item/stack/sheet/wood)) if (src.health < src.maxhealth) visible_message("\red [user] begins to repair the [src]!") @@ -157,7 +157,7 @@ for reference: src.icon_state = "barrier[src.locked]" - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/card/id)) if (src.allowed(user)) if (src.emagged < 2.0) diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index 84591381582..50d6eb49a0f 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -40,7 +40,7 @@ /obj/machinery/door_control/attack_paw(mob/user as mob) return src.attack_hand(user) -/obj/machinery/door_control/attackby(obj/item/weapon/W, mob/user as mob) +/obj/machinery/door_control/attackby(obj/item/weapon/W, mob/user as mob, params) /* For later implementation if (istype(W, /obj/item/weapon/screwdriver)) { @@ -142,7 +142,7 @@ /obj/machinery/driver_button/attack_paw(mob/user as mob) return src.attack_hand(user) -/obj/machinery/driver_button/attackby(obj/item/weapon/W, mob/user as mob) +/obj/machinery/driver_button/attackby(obj/item/weapon/W, mob/user as mob, params) if(istype(W, /obj/item/device/detective_scanner)) return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index daa81985978..1582c0cd6a7 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -258,6 +258,10 @@ icon = 'icons/obj/doors/Doorbananium.dmi' mineral = "clown" +/obj/machinery/door/airlock/mime + name = "Airlock" + icon = 'icons/obj/doors/Doorfreezer.dmi' + /obj/machinery/door/airlock/sandstone name = "Sandstone Airlock" icon = 'icons/obj/doors/Doorsand.dmi' @@ -298,7 +302,7 @@ user << "You do not know how to operate this airlock's mechanism." return -/obj/machinery/door/airlock/alien/attackby(C as obj, mob/user as mob) +/obj/machinery/door/airlock/alien/attackby(C as obj, mob/user as mob, params) if(isalien(user) || isrobot(user) || isAI(user)) ..(C, user) else @@ -943,7 +947,7 @@ About the new airlock wires panel: updateUsrDialog() return 0 -/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob) +/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob, params) //world << text("airlock attackby src [] obj [] mob []", src, C, user) if(!istype(usr, /mob/living/silicon)) if(src.isElectrified()) @@ -1048,7 +1052,7 @@ About the new airlock wires panel: ..() return -/obj/machinery/door/airlock/plasma/attackby(C as obj, mob/user as mob) +/obj/machinery/door/airlock/plasma/attackby(C as obj, mob/user as mob, params) if(C) ignite(is_hot(C)) ..() @@ -1066,6 +1070,7 @@ About the new airlock wires panel: playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) else if(istype(src, /obj/machinery/door/airlock/clown)) playsound(src.loc, 'sound/items/bikehorn.ogg', 30, 1) + else if(istype(src, /obj/machinery/door/airlock/mime)) else playsound(src.loc, 'sound/machines/airlock.ogg', 30, 1) if(src.closeOther != null && istype(src.closeOther, /obj/machinery/door/airlock/) && !src.closeOther.density) @@ -1102,6 +1107,7 @@ About the new airlock wires panel: playsound(src.loc, 'sound/machines/windowdoor.ogg', 30, 1) else if(istype(src, /obj/machinery/door/airlock/clown)) playsound(src.loc, 'sound/items/bikehorn.ogg', 30, 1) + else if(istype(src, /obj/machinery/door/airlock/mime)) else playsound(get_turf(src), 'sound/machines/airlock.ogg', 30, 1) @@ -1174,7 +1180,7 @@ About the new airlock wires panel: return -/obj/machinery/door/airlock/hatch/gamma/attackby(C as obj, mob/user as mob) +/obj/machinery/door/airlock/hatch/gamma/attackby(C as obj, mob/user as mob, params) //world << text("airlock attackby src [] obj [] mob []", src, C, user) if(!istype(usr, /mob/living/silicon)) if(src.isElectrified()) @@ -1207,7 +1213,7 @@ About the new airlock wires panel: return -/obj/machinery/door/airlock/highsecurity/red/attackby(C as obj, mob/user as mob) +/obj/machinery/door/airlock/highsecurity/red/attackby(C as obj, mob/user as mob, params) //world << text("airlock attackby src [] obj [] mob []", src, C, user) if(!istype(usr, /mob/living/silicon)) if(src.isElectrified()) diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index ad9d9910365..fef0ef7d66b 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -245,7 +245,7 @@ obj/machinery/access_button/update_icon() else icon_state = "access_button_off" -obj/machinery/access_button/attackby(obj/item/I as obj, mob/user as mob) +obj/machinery/access_button/attackby(obj/item/I as obj, mob/user as mob, params) //Swiping ID on the access button if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda)) attack_hand(user) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 10123890da7..ebf00444022 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -143,7 +143,7 @@ return ..() -/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/device/detective_scanner)) return if(src.operating || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them. diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index a6609c03ec1..e0c1cc4588a 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -169,7 +169,7 @@ /obj/machinery/door/firedoor/attack_hand(mob/user as mob) return attackby(null, user) -/obj/machinery/door/firedoor/attackby(obj/item/weapon/C as obj, mob/user as mob) +/obj/machinery/door/firedoor/attackby(obj/item/weapon/C as obj, mob/user as mob, params) add_fingerprint(user) if(operating) return//Already doing something. diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index eeceaf2de18..2495dbfc4bc 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -25,7 +25,7 @@ else return 0 -/obj/machinery/door/poddoor/attackby(obj/item/weapon/C as obj, mob/user as mob) +/obj/machinery/door/poddoor/attackby(obj/item/weapon/C as obj, mob/user as mob, params) src.add_fingerprint(user) if (!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) )) return diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm index 8f54535c8fe..d8f751ec89e 100644 --- a/code/game/machinery/doors/shutters.dm +++ b/code/game/machinery/doors/shutters.dm @@ -13,7 +13,7 @@ density = 0 opacity = 0 -/obj/machinery/door/poddoor/shutters/attackby(obj/item/weapon/C as obj, mob/user as mob) +/obj/machinery/door/poddoor/shutters/attackby(obj/item/weapon/C as obj, mob/user as mob, params) add_fingerprint(user) if(!(istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) )) return diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm index dce2ab37bda..8e03e874a71 100644 --- a/code/game/machinery/doors/unpowered.dm +++ b/code/game/machinery/doors/unpowered.dm @@ -10,7 +10,7 @@ return - attackby(obj/item/I as obj, mob/user as mob) + attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)) return if(src.locked) return ..() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 429bc886068..a8ebd55930a 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -195,12 +195,15 @@ /obj/machinery/door/window/proc/attack_generic(mob/user as mob, damage = 0) 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) @@ -245,7 +248,7 @@ emagged = 1 return 1 -/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/living/user as mob) +/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/living/user as mob, params) //If it's in the process of opening/closing, ignore the click if (src.operating) @@ -330,6 +333,8 @@ //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/doppler_array.dm b/code/game/machinery/doppler_array.dm index 9866dc54502..840ed1133c2 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -19,7 +19,7 @@ var/list/doppler_arrays = list() /obj/machinery/doppler_array/process() return PROCESS_KILL -/obj/machinery/doppler_array/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/doppler_array/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/wrench)) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) anchored = !anchored diff --git a/code/game/machinery/drying_rack.dm b/code/game/machinery/drying_rack.dm index 48d213a3326..f8c76de25ff 100644 --- a/code/game/machinery/drying_rack.dm +++ b/code/game/machinery/drying_rack.dm @@ -31,7 +31,7 @@ -/obj/machinery/drying_rack/attackby(var/obj/item/W as obj, var/mob/user as mob) +/obj/machinery/drying_rack/attackby(var/obj/item/W as obj, var/mob/user as mob, params) if(is_type_in_list(W,accepted)) if(!running) if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/meat)) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index d51f29655de..148e1b53322 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -38,7 +38,7 @@ // src.sd_SetLuminosity(0) //Don't want to render prison breaks impossible -/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/wirecutters)) add_fingerprint(user) src.disable = !src.disable @@ -107,7 +107,7 @@ if ((M.m_intent != "walk") && (src.anchored)) src.flash() -/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/wrench)) add_fingerprint(user) src.anchored = !src.anchored @@ -126,7 +126,7 @@ /obj/machinery/flasher_button/attack_paw(mob/user as mob) return src.attack_hand(user) -/obj/machinery/flasher_button/attackby(obj/item/weapon/W, mob/user as mob) +/obj/machinery/flasher_button/attackby(obj/item/weapon/W, mob/user as mob, params) return src.attack_hand(user) /obj/machinery/flasher_button/attack_hand(mob/user as mob) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 5a6544ba646..b6da9e11d95 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -63,7 +63,7 @@ updateicon() -/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) if (!anchored && !isinspace()) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/game/machinery/guestpass.dm b/code/game/machinery/guestpass.dm index 7acdc9e6fe2..83cf1682bd8 100644 --- a/code/game/machinery/guestpass.dm +++ b/code/game/machinery/guestpass.dm @@ -54,7 +54,7 @@ var/list/internal_log = list() var/mode = 0 // 0 - making pass, 1 - viewing logs -/obj/machinery/computer/guestpass/attackby(obj/O, mob/user) +/obj/machinery/computer/guestpass/attackby(obj/O, mob/user, params) if(istype(O, /obj/item/weapon/card/id)) if(!giver) user.drop_item() diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index 073973cdee7..cd1e5a85e62 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -50,7 +50,7 @@ obj/machinery/holosign_switch/attack_paw(mob/user as mob) return src.attack_hand(user) -/obj/machinery/holosign_switch/attackby(obj/item/weapon/W, mob/user as mob) +/obj/machinery/holosign_switch/attackby(obj/item/weapon/W, mob/user as mob, params) if(istype(W, /obj/item/device/detective_scanner)) return return src.attack_hand(user) diff --git a/code/game/machinery/hydroponics.dm b/code/game/machinery/hydroponics.dm index 58d52bc992b..ef9a7d29150 100644 --- a/code/game/machinery/hydroponics.dm +++ b/code/game/machinery/hydroponics.dm @@ -664,7 +664,7 @@ return -/obj/machinery/portable_atmospherics/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/portable_atmospherics/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(exchange_parts(user, O)) return @@ -958,7 +958,7 @@ use_power = 0 draw_warnings = 0 -/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/shovel)) user << "You clear up [src]!" del(src) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 7aba3dc25f1..9577a539203 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -71,7 +71,7 @@ icon_state = "[base_state]-p" // src.sd_SetLuminosity(0) -/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/device/detective_scanner)) return if (istype(W, /obj/item/weapon/screwdriver)) @@ -125,7 +125,7 @@ /obj/machinery/ignition_switch/attack_paw(mob/user as mob) return src.attack_hand(user) -/obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user as mob) +/obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user as mob, params) return src.attack_hand(user) /obj/machinery/ignition_switch/attack_hand(mob/user as mob) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 4063396f5c5..31b41770259 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -57,7 +57,7 @@ src.update_icon() -/obj/machinery/iv_drip/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/iv_drip/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/reagent_containers)) if(!isnull(src.beaker)) user << "There is already a reagent container loaded!" @@ -110,7 +110,7 @@ if(!istype(T)) return if(!T.dna) return - if(M_NOCLONE in T.mutations) + if(NOCLONE in T.mutations) return if(T.species && T.species.flags & NO_BLOOD) diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index d5510dbbd26..8e657b6b53f 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -78,7 +78,7 @@ else src.startgibbing(user) -/obj/machinery/gibber/attackby(obj/item/weapon/grab/G as obj, mob/user as mob) +/obj/machinery/gibber/attackby(obj/item/weapon/grab/G as obj, mob/user as mob, params) if(src.occupant) user << "\red The gibber is full, empty it first!" return diff --git a/code/game/machinery/kitchen/icecream_vat.dm b/code/game/machinery/kitchen/icecream_vat.dm index ab39761b3da..711e2020361 100644 --- a/code/game/machinery/kitchen/icecream_vat.dm +++ b/code/game/machinery/kitchen/icecream_vat.dm @@ -89,7 +89,7 @@ var/list/ingredients_source = list( user << browse(dat,"window=icecreamvat;size=600x400") -/obj/machinery/icecream_vat/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/icecream_vat/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/reagent_containers)) if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/icecream)) var/obj/item/weapon/reagent_containers/food/snacks/icecream/I = O diff --git a/code/game/machinery/kitchen/juicer.dm b/code/game/machinery/kitchen/juicer.dm index 89ead24fddb..86d59679f76 100644 --- a/code/game/machinery/kitchen/juicer.dm +++ b/code/game/machinery/kitchen/juicer.dm @@ -31,7 +31,7 @@ return -/obj/machinery/juicer/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/juicer/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (istype(O,/obj/item/weapon/reagent_containers/glass) || \ istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass)) if (beaker) diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 6eb988f98c5..cd8e806fbb0 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -71,7 +71,7 @@ * Item Adding ********************/ -/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(operating) return if(!broken && dirty < 100) diff --git a/code/game/machinery/kitchen/monkeyrecycler.dm b/code/game/machinery/kitchen/monkeyrecycler.dm index f4b373e8eab..9342e6530b3 100644 --- a/code/game/machinery/kitchen/monkeyrecycler.dm +++ b/code/game/machinery/kitchen/monkeyrecycler.dm @@ -12,7 +12,7 @@ var/grinded = 0 -/obj/machinery/monkey_recycler/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/monkey_recycler/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (src.stat != 0) //NOPOWER etc return if (istype(O, /obj/item/weapon/grab)) diff --git a/code/game/machinery/kitchen/processor.dm b/code/game/machinery/kitchen/processor.dm index aea4592faae..f466149d8d1 100644 --- a/code/game/machinery/kitchen/processor.dm +++ b/code/game/machinery/kitchen/processor.dm @@ -104,7 +104,7 @@ return P return 0 -/obj/machinery/processor/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/processor/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(src.processing) user << "\red The processor is in the process of processing." return 1 diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index 1e178bf54ff..397ee26b20a 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -75,7 +75,7 @@ * Item Adding ********************/ -/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(!src.ispowered) user << "\The [src] is unpowered and useless." return diff --git a/code/game/machinery/laprecharger.dm b/code/game/machinery/laprecharger.dm index 7570227d755..cafd5e3d297 100644 --- a/code/game/machinery/laprecharger.dm +++ b/code/game/machinery/laprecharger.dm @@ -13,7 +13,7 @@ var/icon_state_charging = "recharger1" var/icon_state_idle = "recharger0" -/obj/machinery/laprecharger/attackby(obj/item/weapon/G as obj, mob/user as mob) +/obj/machinery/laprecharger/attackby(obj/item/weapon/G as obj, mob/user as mob, params) if(istype(user,/mob/living/silicon)) return if(istype(G, /obj/item/weapon/gun/energy) || istype(G, /obj/item/weapon/melee/baton)) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 7d9eb50d44b..e30776ef6b4 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -218,7 +218,7 @@ Class Procs: if(restrained() || lying || stat || stunned || weakened) return if(be_close && !in_range(M, src)) - if(M_TK in mutations) + if(TK in mutations) var/mob/living/carbon/human/H = M if(istype(H.l_hand, /obj/item/tk_grab) || istype(H.r_hand, /obj/item/tk_grab)) return 1 diff --git a/code/game/machinery/metaldetector.dm b/code/game/machinery/metaldetector.dm index 72be4f67785..95e76eaa2c5 100644 --- a/code/game/machinery/metaldetector.dm +++ b/code/game/machinery/metaldetector.dm @@ -26,7 +26,7 @@ return 0 return 1 -/obj/machinery/metaldetector/attackby(obj/item/W as obj, mob/user as mob) +/obj/machinery/metaldetector/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/card)) for(var/ID in list(user.equipped(), user:wear_id, user:belt)) if(src.check_access(ID,list("20"))) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 414c6c365b1..a8f39a4597e 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -101,7 +101,7 @@ frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS) -/obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user) +/obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user, params) var/turf/T = loc if(T.intact) return // prevent intraction when T-scanner revealed diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 85b4e35f7af..248908ed824 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, params) if(istype(I, /obj/item/weapon/wrench)) user << "Now [anchored ? "un" : ""]securing [name]" playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) @@ -938,7 +938,7 @@ obj/item/weapon/newspaper/Topic(href, href_list) src.attack_self(src.loc) -obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) +obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/pen)) if(src.scribble_page == src.curr_page) user << "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?" diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 84ec1966a1c..21e66517422 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -388,7 +388,7 @@ Buildable meters /obj/item/pipe/attack_self(mob/user as mob) return rotate() -/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) ..() //* if (!istype(W, /obj/item/weapon/wrench)) @@ -1040,7 +1040,7 @@ Buildable meters item_state = "buildpipe" w_class = 4 -/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) ..() if (!istype(W, /obj/item/weapon/wrench)) diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index e52737efd8f..959df353b38 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -87,7 +87,7 @@ wait = 0 return -/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob) +/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob, params) src.add_fingerprint(usr) if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter)) usr << "\blue You put [W] back to [src]." diff --git a/code/game/machinery/podmen.dm b/code/game/machinery/podmen.dm index 4a698e2a4e2..58dc6dc7888 100644 --- a/code/game/machinery/podmen.dm +++ b/code/game/machinery/podmen.dm @@ -27,7 +27,7 @@ Growing it to term with nothing injected will grab a ghost from the observers. * var/found_player = 0 var/beingharvested = 0 -/obj/item/seeds/replicapod/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/seeds/replicapod/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/reagent_containers)) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 464144d832d..fa36bcc23c5 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -285,7 +285,7 @@ Status: []
"}, -/obj/machinery/porta_turret/attackby(obj/item/W as obj, mob/user as mob) +/obj/machinery/porta_turret/attackby(obj/item/W as obj, mob/user as mob, params) if(stat & BROKEN) if(istype(W, /obj/item/weapon/crowbar)) @@ -692,7 +692,7 @@ Status: []
"}, -/obj/machinery/porta_turret_construct/attackby(obj/item/W as obj, mob/user as mob) +/obj/machinery/porta_turret_construct/attackby(obj/item/W as obj, mob/user as mob, params) // this is a bit unweildy but self-explanitory switch(build_step) @@ -1018,7 +1018,7 @@ Status: []
"}, -/obj/machinery/porta_turret_cover/attackby(obj/item/W as obj, mob/user as mob) +/obj/machinery/porta_turret_cover/attackby(obj/item/W as obj, mob/user as mob, params) if ((istype(W, /obj/item/weapon/card/emag)) && (!Parent_Turret.emagged)) user << "\red You short out [Parent_Turret]'s threat assessment circuits." diff --git a/code/game/machinery/programmable_unloader.dm b/code/game/machinery/programmable_unloader.dm index f2aaefc03fa..291b5849d2f 100644 --- a/code/game/machinery/programmable_unloader.dm +++ b/code/game/machinery/programmable_unloader.dm @@ -195,7 +195,7 @@ updateUsrDialog() return -/obj/machinery/programmable/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/programmable/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I,/obj/item/weapon/wrench)) // code borrowed from pipe dispenser if (unwrenched==0) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) @@ -510,7 +510,7 @@ return playsound(loc, "punch", 25, 1, -1) - if(M_HULK in H.mutations) damage += 5 + if(HULK in H.mutations) damage += 5 if(damage < 5) visible_message("[H] gives \the [src] a weak punch.") @@ -580,7 +580,7 @@ ..() resetlists() - attackby(obj/item/I as obj, mob/user as mob) + attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I,/obj/item/device/multitool)) hacking = (hacking?0:1) if(hacking) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 758b76814ab..8f79948d09c 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -13,7 +13,7 @@ var/icon_state_charging = "recharger1" var/icon_state_idle = "recharger0" -/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) +/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob, params) if(istype(user,/mob/living/silicon)) return if(istype(G, /obj/item/weapon/gun/energy) || istype(G, /obj/item/weapon/melee/baton) || istype(G,/obj/item/device/laptop)) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index f339132dca6..6b26c084997 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -79,7 +79,7 @@ else icon_state = "borgcharger0" -/obj/machinery/recharge_station/attackby(obj/item/P as obj, mob/user as mob) +/obj/machinery/recharge_station/attackby(obj/item/P as obj, mob/user as mob, params) if (istype(P, /obj/item/weapon/screwdriver)) if(src.occupant) user << "The maintenance panel is locked." diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index edfac0425a0..3cc7919424b 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -31,7 +31,7 @@ var/const/SAFETY_COOLDOWN = 100 update_icon() -/obj/machinery/recycler/attackby(var/obj/item/I, var/mob/user) +/obj/machinery/recycler/attackby(var/obj/item/I, var/mob/user, params) if(istype(I, /obj/item/weapon/screwdriver) && emagged) emagged = 0 update_icon() diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 16d7b16572e..ed6e201a3ff 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -358,7 +358,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() return //err... hacking code, which has no reason for existing... but anyway... it's supposed to unlock priority 3 messanging on that console (EXTREME priority...) the code for that actually exists. -/obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob) +/obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob, params) /* if (istype(O, /obj/item/weapon/crowbar)) if(open) diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm index 65f31c94c0d..504f7ef8956 100644 --- a/code/game/machinery/robot_fabricator.dm +++ b/code/game/machinery/robot_fabricator.dm @@ -11,7 +11,7 @@ idle_power_usage = 20 active_power_usage = 5000 -/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (istype(O, /obj/item/stack/sheet/metal)) if (src.metal_amount < 150000.0) var/count = 0 diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm index dbb5a9d2712..f2e45ccdc41 100644 --- a/code/game/machinery/seed_extractor.dm +++ b/code/game/machinery/seed_extractor.dm @@ -6,7 +6,7 @@ density = 1 anchored = 1 -obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob) +obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob, params) // Fruits and vegetables. if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown) || istype(O, /obj/item/weapon/grown)) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 39e9e903c1a..07570114f00 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -25,7 +25,7 @@ if(!height || air_group) return 0 else return ..() -/obj/machinery/shield/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/shield/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(!istype(W)) return //Calculate damage @@ -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 @@ -241,7 +241,7 @@ user << "The device must first be secured to the floor." return -/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/card/emag)) malfunction = 1 update_icon() @@ -461,7 +461,7 @@ CF.dir = field_dir -/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user) +/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/wrench)) if(active) user << "Turn off the field generator first." @@ -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/spaceheater.dm b/code/game/machinery/spaceheater.dm index fd90622de14..9877ac6f138 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -50,7 +50,7 @@ cell.emp_act(severity) ..(severity) - attackby(obj/item/I, mob/user) + attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/stock_parts/cell)) if(open) if(cell) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 0a0d9c32ebd..66c26a8b654 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -470,7 +470,7 @@ return -/obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob, params) if(!src.ispowered) return if(istype(I, /obj/item/weapon/screwdriver)) @@ -631,7 +631,7 @@ user << "\blue The console controls are far too complicated for your tiny brain!" return -/obj/machinery/suit_cycler/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/suit_cycler/attackby(obj/item/I as obj, mob/user as mob, params) if(electrified != 0) if(src.shock(user, 100)) diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 8cc2408c46c..916ae1a23af 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -156,7 +156,7 @@ return - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/screwdriver)) if(active) user << "\red You need to deactivate the beacon first!" diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 2aff4b378e7..314f14e0ffa 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -48,7 +48,7 @@ /obj/machinery/syndicatebomb/update_icon() icon_state = "[initial(icon_state)][active ? "-active" : "-inactive"][open_panel ? "-wires" : ""]" -/obj/machinery/syndicatebomb/attackby(var/obj/item/I, var/mob/user) +/obj/machinery/syndicatebomb/attackby(var/obj/item/I, var/mob/user, params) if(istype(I, /obj/item/weapon/wrench)) if(!anchored) if(!isturf(src.loc) || istype(src.loc, /turf/space)) diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm index ef50d3ea865..2fb2cd3cc69 100644 --- a/code/game/machinery/telecomms/logbrowser.dm +++ b/code/game/machinery/telecomms/logbrowser.dm @@ -217,7 +217,7 @@ updateUsrDialog() return - attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/D as obj, var/mob/user as mob, params) if(istype(D, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index af05db47db6..55a4e604e0f 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -13,7 +13,7 @@ var/construct_op = 0 -/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob) +/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob, params) // Using a multitool lets you access the receiver's interface if(istype(P, /obj/item/device/multitool)) diff --git a/code/game/machinery/telecomms/telemonitor.dm b/code/game/machinery/telecomms/telemonitor.dm index c02ef59e1be..23969177606 100644 --- a/code/game/machinery/telecomms/telemonitor.dm +++ b/code/game/machinery/telecomms/telemonitor.dm @@ -126,7 +126,7 @@ updateUsrDialog() return - attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/D as obj, var/mob/user as mob, params) if(istype(D, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm index e2b42ddbb44..889623b60e6 100644 --- a/code/game/machinery/telecomms/traffic_control.dm +++ b/code/game/machinery/telecomms/traffic_control.dm @@ -206,7 +206,7 @@ return -/obj/machinery/computer/telecomms/traffic/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) +/obj/machinery/computer/telecomms/traffic/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob, params) if(istype(D, /obj/item/weapon/screwdriver)) playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index d9afea3dd80..9d30d7207af 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -30,7 +30,7 @@ break return power_station -/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob) +/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob, params) if(istype(I, /obj/item/device/gps)) var/obj/item/device/gps/L = I if(L.locked_location && !(stat & (NOPOWER|BROKEN))) @@ -329,7 +329,7 @@ //--FalseIncarnate return -/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user) +/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user, params) if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W)) return @@ -414,7 +414,7 @@ teleporter_hub.update_icon() ..() -/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W, mob/user) +/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/device/multitool) && !panel_open) var/obj/item/device/multitool/M = W if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 90dd7f27d71..5ecc801d985 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) @@ -359,7 +360,7 @@ //don't have to check if control_area is path, since get_area_all_atoms can take path. return -/obj/machinery/turretid/attackby(obj/item/weapon/W, mob/user) +/obj/machinery/turretid/attackby(obj/item/weapon/W, mob/user, params) if(stat & BROKEN) return if (istype(user, /mob/living/silicon)) return src.attack_hand(user) @@ -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/machinery/vending.dm b/code/game/machinery/vending.dm index 9376aae0ae4..a74d7ad5bde 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -209,7 +209,7 @@ break return total -/obj/machinery/vending/attackby(obj/item/weapon/W, mob/user) +/obj/machinery/vending/attackby(obj/item/weapon/W, mob/user, params) if (currently_vending && vendor_account && !vendor_account.suspended) var/paid = 0 var/handled = 0 diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index c48d5e3a89c..19108eec93d 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -194,7 +194,7 @@ /obj/machinery/washing_machine/update_icon() icon_state = "wm_[state][panel]" -/obj/machinery/washing_machine/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/washing_machine/attackby(obj/item/weapon/W as obj, mob/user as mob, params) /*if(istype(W,/obj/item/weapon/screwdriver)) panel = !panel user << "\blue you [panel ? "open" : "close"] the [src]'s maintenance panel"*/ diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index 87561d447ab..c253dd2d084 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -58,29 +58,29 @@ charges-- insisting = 0 - if (!(M_HULK in user.mutations)) + if (!(HULK in user.mutations)) user.dna.SetSEState(HULKBLOCK,1) - if (!(M_LASER in user.mutations)) - user.mutations.Add(M_LASER) + if (!(LASER in user.mutations)) + user.mutations.Add(LASER) - if (!(M_XRAY in user.mutations)) - user.mutations.Add(M_XRAY) + if (!(XRAY in user.mutations)) + user.mutations.Add(XRAY) user.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) user.see_in_dark = 8 user.see_invisible = SEE_INVISIBLE_LEVEL_TWO - if (!(M_RESIST_COLD in user.mutations)) - user.mutations.Add(M_RESIST_COLD) + if (!(RESIST_COLD in user.mutations)) + user.mutations.Add(RESIST_COLD) - if (!(M_RESIST_HEAT in user.mutations)) - user.mutations.Add(M_RESIST_HEAT) + if (!(RESIST_HEAT in user.mutations)) + user.mutations.Add(RESIST_HEAT) - if (!(M_TK in user.mutations)) - user.mutations.Add(M_TK) + if (!(TK in user.mutations)) + user.mutations.Add(TK) - if(!(M_REGEN in user.mutations)) - user.mutations.Add(M_REGEN) + if(!(REGEN in user.mutations)) + user.mutations.Add(REGEN) user.update_mutations() diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index efe31d5bf62..c618ec8c72f 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -548,9 +548,9 @@ if(!chassis) return return "* [src.name]" - proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) + proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob, params) if(!action_checks(user)) - return chassis.dynattackby(W,user) + return chassis.dynattackby(W,user, params) chassis.log_message("Attacked by [W]. Attacker - [user]") if(prob(chassis.deflect_chance*deflect_coeff)) user << "\red The [W] bounces off [chassis] armor." @@ -920,7 +920,7 @@ return 0 return - attackby(weapon,mob/user) + attackby(weapon,mob/user, params) var/result = load_fuel(weapon) if(isnull(result)) user.visible_message("[user] tries to shove [weapon] into [src]. What a dumb-ass.","[fuel] traces minimal. [weapon] cannot be used as fuel.") diff --git a/code/game/mecha/equipment/tools/unused_tools.dm b/code/game/mecha/equipment/tools/unused_tools.dm index 68578913813..50fcc9d62bb 100644 --- a/code/game/mecha/equipment/tools/unused_tools.dm +++ b/code/game/mecha/equipment/tools/unused_tools.dm @@ -129,11 +129,11 @@ chassis.proc_res["dynattackby"] = src return - proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) + proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob, params) if(!action_checks(user) || !active) return user.electrocute_act(shock_damage, src) - return chassis.dynattackby(W,user) + return chassis.dynattackby(W,user, params) /* diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 59883f8b8df..3ff3c66408d 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -76,7 +76,7 @@ recharge_console.update_icon() -/obj/machinery/mech_bay_recharge_port/attackby(obj/item/I, mob/user) +/obj/machinery/mech_bay_recharge_port/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "recharge_port-o", "recharge_port", I)) return diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 76d2c03c934..e69394432be 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -498,7 +498,7 @@ return result -/obj/machinery/mecha_part_fabricator/attackby(obj/W as obj, mob/user as mob) +/obj/machinery/mecha_part_fabricator/attackby(obj/W as obj, mob/user as mob, params) if(default_deconstruction_screwdriver(user, "fab-o", "fab-idle", W)) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 398c297cb24..8633d1c871f 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)) @@ -461,7 +463,7 @@ call(/obj/item/clothing/gloves/space_ninja/proc/drain)("MECHA",src,user:wear_suit) return - if ((M_HULK in user.mutations) && !prob(src.deflect_chance)) + if ((HULK in user.mutations) && !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)) user.visible_message("[user] hits [src.name], doing some damage.", "You hit [src.name] with all your might. The metal creaks and bends.") @@ -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, params) 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.") @@ -695,7 +702,7 @@ ////// AttackBy ////// ////////////////////// -/obj/mecha/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/mecha/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/device/mmi/posibrain)) if(mmi_move_inside(W,user)) diff --git a/code/game/mecha/mecha_parts.dm b/code/game/mecha/mecha_parts.dm index f89390139b6..6237bcfd523 100644 --- a/code/game/mecha/mecha_parts.dm +++ b/code/game/mecha/mecha_parts.dm @@ -20,7 +20,7 @@ construction_cost = list("metal"=20000) flags = CONDUCT - attackby(obj/item/W as obj, mob/user as mob) + attackby(obj/item/W as obj, mob/user as mob, params) if(!construct || !construct.action(W, user)) ..() return diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm index 62c8c7c5d47..b2c4b0bc0db 100644 --- a/code/game/mecha/mecha_wreckage.dm +++ b/code/game/mecha/mecha_wreckage.dm @@ -30,7 +30,7 @@ return -/obj/effect/decal/mecha_wreckage/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/effect/decal/mecha_wreckage/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(salvage_num <= 0) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index c3a05eae825..a5b6c4c8d6a 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -101,7 +101,8 @@ /obj/structure/alien/resin/attack_hand(mob/living/user) - if(M_HULK in user.mutations) + 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!") @@ -122,7 +125,8 @@ healthcheck() -/obj/structure/alien/resin/attackby(obj/item/I, mob/living/user) +/obj/structure/alien/resin/attackby(obj/item/I, mob/living/user, params) + user.changeNext_move(CLICK_CD_MELEE) health -= I.force playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) healthcheck() @@ -202,7 +206,7 @@ del(src) -/obj/structure/alien/weeds/attackby(obj/item/I, mob/user) +/obj/structure/alien/weeds/attackby(obj/item/I, mob/user, params) if(I.attack_verb.len) visible_message("[user] has [pick(I.attack_verb)] [src] with [I]!") else @@ -355,7 +359,7 @@ healthcheck() -/obj/structure/alien/egg/attackby(obj/item/I, mob/user) +/obj/structure/alien/egg/attackby(obj/item/I, mob/user, params) if(I.attack_verb.len) visible_message("[user] has [pick(I.attack_verb)] [src] with [I]!") else diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index 2a0235652ac..a0b3fff9c7b 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -35,7 +35,7 @@ qdel(src) -/obj/effect/anomaly/attackby(obj/item/I, mob/user) +/obj/effect/anomaly/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/device/analyzer)) user << "Analyzing... [src]'s unstable field is fluctuating along frequency [aSignal.code]:[format_frequency(aSignal.frequency)]." diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm index d32c2b9b7e1..7f3de1cf8c6 100644 --- a/code/game/objects/effects/decals/contraband.dm +++ b/code/game/objects/effects/decals/contraband.dm @@ -48,7 +48,7 @@ obj/structure/sign/poster/New(var/serial) icon_state = design.icon_state // poster[serial_number] ..() -obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) +obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wirecutters)) playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1) if(ruined) @@ -89,7 +89,7 @@ obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) del(src) -//seperated to reduce code duplication. Moved here for ease of reference and to unclutter r_wall/attackby() +//seperated to reduce code duplication. Moved here for ease of reference and to unclutter r_wall/attackby(, params) /turf/simulated/wall/proc/place_poster(var/obj/item/weapon/contraband/poster/P, var/mob/user) if(!istype(src,/turf/simulated/wall)) diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 4440c825215..4cb89d01ea5 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -1074,7 +1074,7 @@ steam.start() -- spawns the effect return attack_hand(var/mob/user) - if ((M_HULK in user.mutations) || (prob(75 - metal*25))) + if ((HULK in user.mutations) || (prob(75 - metal*25))) user << "\blue You smash through the metal foam wall." for(var/mob/O in oviewers(user)) if ((O.client && !( O.blinded ))) @@ -1086,7 +1086,7 @@ steam.start() -- spawns the effect return - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) if (istype(I, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = I diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 61ab55b4c68..e8b8cc4bdaf 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -133,7 +133,7 @@ floor = 1 return 1 -/obj/effect/glowshroom/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/effect/glowshroom/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() endurance -= W.force diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index e11b35ac207..62a9bb7a57b 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -20,7 +20,7 @@ qdel(src) return -/obj/effect/spider/attackby(var/obj/item/weapon/W, var/mob/user) +/obj/effect/spider/attackby(var/obj/item/weapon/W, var/mob/user, params) if(W.attack_verb.len) visible_message("\red \The [src] have been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]") else diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 24af225a8ab..399455d208c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -126,7 +126,7 @@ if(5.0) size = "huge" else - //if ((M_CLUMSY in usr.mutations) && prob(50)) t = "funny-looking" + //if ((CLUMSY in usr.mutations) && prob(50)) t = "funny-looking" usr << "This is a [src.blood_DNA ? "bloody " : ""]\icon[src][src.name]. It is a [size] item." if(src.desc) usr << src.desc @@ -155,7 +155,6 @@ else if(isliving(loc)) return 0 - user.next_move = max(user.next_move+2,world.time + 2) pickup(user) add_fingerprint(user) @@ -187,7 +186,6 @@ if(istype(src.loc, /mob/living)) return src.pickup(user) - user.next_move = max(user.next_move+2,world.time + 2) user.put_in_active_hand(src) return @@ -213,7 +211,7 @@ // Due to storage type consolidation this should get used more now. // I have cleaned it up a little, but it could probably use more. -Sayu -/obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/storage)) var/obj/item/weapon/storage/S = W if(S.use_to_pickup) @@ -302,7 +300,7 @@ if(istype(src, /obj/item/clothing/under) || istype(src, /obj/item/clothing/suit)) - if(M_FAT in H.mutations) + if(FAT in H.mutations) testing("[M] TOO FAT TO WEAR [src]!") if(!(flags & ONESIZEFITSALL)) if(!disable_warning) @@ -614,7 +612,7 @@ M.LAssailant = user src.add_fingerprint(user) - //if((M_CLUMSY in user.mutations) && prob(50)) + //if((CLUMSY in user.mutations) && prob(50)) // M = user /* M << "\red You stab yourself in the eye." diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm index b81a80a5f65..764be72b131 100644 --- a/code/game/objects/items/apc_frame.dm +++ b/code/game/objects/items/apc_frame.dm @@ -7,7 +7,7 @@ icon_state = "apc_frame" flags = CONDUCT -/obj/item/apc_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/apc_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 ) diff --git a/code/game/objects/items/ashtray.dm b/code/game/objects/items/ashtray.dm index 5e6274b7cf0..bf554463a42 100644 --- a/code/game/objects/items/ashtray.dm +++ b/code/game/objects/items/ashtray.dm @@ -14,7 +14,7 @@ src.pixel_x = rand(-6, 6) return -/obj/item/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (health < 1) return if (istype(W,/obj/item/weapon/cigbutt) || istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/weapon/match)) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 0bb680f069d..8eaf699205d 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -40,7 +40,7 @@ density = 0 - attackby(W as obj, mob/user as mob) + attackby(W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text if (user.get_active_hand() != W) @@ -127,7 +127,7 @@ usr << "\red You can't fold that up anymore.." ..() - attackby(W as obj, mob/user as mob) + attackby(W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda)) if(src.allowed(user)) src.locked = !src.locked diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 61f341f0362..a68258e6a1c 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -22,7 +22,7 @@ icon_state = "candle[i][lit ? "_lit" : ""]" - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index a2d06058e08..914ec7d6be0 100755 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1055,7 +1055,7 @@ var/global/list/obj/item/device/pda/PDAs = list() return // access to status display signals -/obj/item/device/pda/attackby(obj/item/C as obj, mob/user as mob) +/obj/item/device/pda/attackby(obj/item/C as obj, mob/user as mob, params) ..() if(istype(C, /obj/item/weapon/cartridge) && !cartridge) cartridge = C diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index fe322e30dbd..8643a20aaa5 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -16,7 +16,7 @@ /obj/item/device/flash/proc/clown_check(mob/user) - if(user && (M_CLUMSY in user.mutations) && prob(50)) + if(user && (CLUMSY in user.mutations) && prob(50)) flash_carbon(user, user, 15, 0) return 0 return 1 diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 10c31d54773..05a851b0d28 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -49,7 +49,7 @@ add_fingerprint(user) if(on && user.zone_sel.selecting == "eyes") - if(((M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly + if(((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly return ..() //just hit them in the head if(!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") //don't have dexterity @@ -77,7 +77,7 @@ if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey)) //robots and aliens are unaffected if(M.stat == DEAD || M.sdisabilities & BLIND) //mob is dead or fully blind user << "[M] pupils does not react to the light!" - else if(M_XRAY in M.mutations) //mob has X-RAY vision + else if(XRAY in M.mutations) //mob has X-RAY vision flick("flash", M.flash) //Yes, you can still get flashed wit X-Ray. user << "[M] pupils give an eerie glow!" else //they're okay! diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index d3ba41ca58c..5c104fcef54 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -5,7 +5,7 @@ icon_state = "pointer" item_state = "pen" var/pointer_icon_state - flags = CONDUCT | USEDELAY + flags = CONDUCT slot_flags = SLOT_BELT m_amt = 500 g_amt = 500 @@ -45,7 +45,7 @@ /obj/item/device/laser_pointer/attack(mob/living/M, mob/user) laser_act(M, user) -/obj/item/device/laser_pointer/attackby(obj/item/W, mob/user) +/obj/item/device/laser_pointer/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/stock_parts/micro_laser)) if(!diode) user.drop_item() diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index f4129666026..3d9e623d53b 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -71,7 +71,7 @@ ..() usr << "It has [uses] lights remaining." -/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user) +/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stack/sheet/glass)) var/obj/item/stack/sheet/glass/G = W if(G.amount - decrement >= 0 && uses < max_uses) diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 6fb0a998d0b..f9907855224 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -21,7 +21,7 @@ var/obj/structure/cable/attached // the attached cable - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) if(istype(I, /obj/item/weapon/screwdriver)) if(mode == 0) var/turf/T = loc diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index b737f9d92ca..ff5c90e0985 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -26,7 +26,7 @@ S.part2 = null master = null -/obj/item/device/radio/electropack/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/radio/electropack/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/clothing/head/helmet)) if(!b_stat) diff --git a/code/game/objects/items/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm index bd4119ecef3..2c112dc12d0 100644 --- a/code/game/objects/items/devices/radio/encryptionkey.dm +++ b/code/game/objects/items/devices/radio/encryptionkey.dm @@ -13,7 +13,7 @@ /obj/item/device/encryptionkey/New() -/obj/item/device/encryptionkey/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/encryptionkey/attackby(obj/item/weapon/W as obj, mob/user as mob, params) /obj/item/device/encryptionkey/syndicate icon_state = "cypherkey" diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 6cb551ceac3..887cc3bd25f 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -254,7 +254,7 @@ return -1 //Transciever Disabled. return ..(freq, level, 1) -/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob, params) // ..() user.set_machine(src) if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ )))) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 503fc2b5041..fc4e955a50f 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -476,7 +476,7 @@ user.show_message("\blue \the [src] can not be modified or attached!") return -/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() user.set_machine(src) if (!( istype(W, /obj/item/weapon/screwdriver) )) @@ -535,7 +535,7 @@ var/datum/robot_component/C = R.components["radio"] R.use_power(C.energy_consumption) -/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob, params) // ..() user.set_machine(src) if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ )))) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 097c60d57df..92cfb499ad0 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -110,7 +110,7 @@ REAGENT SCANNER /obj/item/device/healthanalyzer/attack(mob/living/M as mob, mob/living/user as mob) - if (( (M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) + if (( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) user << text("\red You try to analyze the floor's vitals!") for(var/mob/O in viewers(M, null)) O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1) diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 9c98165239e..577dba2fdbe 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -121,7 +121,7 @@ if (on) user << "You switch on the [src]." -/obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/screwdriver)) if(cover_open) cover_open = 0 diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 1dc2142d31a..e882adfae23 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -15,7 +15,7 @@ /obj/item/device/transfer_valve/IsAssemblyHolder() return 1 -/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user) +/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user, params) if(istype(item, /obj/item/weapon/tank)) if(tank_one && tank_two) user << "There are already two tanks attached, remove one first." diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index d83c1b56ede..3fce029a056 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -251,7 +251,7 @@ var/list/world_uplinks = list() return 0 //Refund proc for the borg teleporter (later I'll make a general refund proc if there is demand for it) -/obj/item/device/radio/headset/syndicate/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/radio/headset/syndicate/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/antag_spawner/borg_tele)) var/obj/item/weapon/antag_spawner/borg_tele/S = W if(!S.used && !S.checking) @@ -261,7 +261,7 @@ var/list/world_uplinks = list() else user << "This teleporter is already used, or is currently being used." -/obj/item/device/radio/uplink/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/radio/uplink/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/antag_spawner/borg_tele)) var/obj/item/weapon/antag_spawner/borg_tele/S = W if(!S.used && !S.checking) diff --git a/code/game/objects/items/flag.dm b/code/game/objects/items/flag.dm index 22b5285556a..e3e02dc1047 100644 --- a/code/game/objects/items/flag.dm +++ b/code/game/objects/items/flag.dm @@ -35,7 +35,7 @@ del(src) return -/obj/item/flag/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/flag/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm index f00a9ed48b5..daab9b55a69 100644 --- a/code/game/objects/items/latexballoon.dm +++ b/code/game/objects/items/latexballoon.dm @@ -43,6 +43,6 @@ burst() return -/obj/item/latexballon/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/latexballon/attackby(obj/item/W as obj, mob/user as mob, params) if (can_puncture(W)) burst() \ No newline at end of file diff --git a/code/game/objects/items/policetape.dm b/code/game/objects/items/policetape.dm index 583aaafe379..f5044b1de28 100644 --- a/code/game/objects/items/policetape.dm +++ b/code/game/objects/items/policetape.dm @@ -119,7 +119,7 @@ else return 0 -/obj/item/tape/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/tape/attackby(obj/item/weapon/W as obj, mob/user as mob, params) breaktape(W, user) /obj/item/tape/attack_hand(mob/user as mob) diff --git a/code/game/objects/items/random_items.dm b/code/game/objects/items/random_items.dm index 72cedf73e2b..4ed64721966 100644 --- a/code/game/objects/items/random_items.dm +++ b/code/game/objects/items/random_items.dm @@ -269,7 +269,7 @@ name = "\improper Mysterious Crate" desc = "What could it be?" - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) var/list/menace = pick( /mob/living/simple_animal/hostile/carp,/mob/living/simple_animal/hostile/faithless,/mob/living/simple_animal/hostile/pirate, /mob/living/simple_animal/hostile/creature,/mob/living/simple_animal/hostile/pirate/ranged, @@ -299,7 +299,7 @@ name = "Schrodinger's Crate" desc = "What happens if you open it?" - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) var/mob/living/simple_animal/cat/Cat1 = new(loc) Cat1.apply_damage(250)//,TOX) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index c28dc6ac883..775b4c24690 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -101,7 +101,7 @@ return 1 return 0 -/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/stack/sheet/metal) && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head) var/obj/item/weapon/ed209_assembly/B = new /obj/item/weapon/ed209_assembly @@ -249,7 +249,7 @@ return -/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/stock_parts/cell)) if(src.cell) @@ -271,7 +271,7 @@ user << "\blue You insert the wire!" return -/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/device/flash)) if(istype(user,/mob/living/silicon/robot)) @@ -299,7 +299,7 @@ return return -/obj/item/robot_parts/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/robot_parts/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/card/emag)) if(sabotaged) user << "\red [src] is already sabotaged!" diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index 19a2e38e179..dfd5777d9d0 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -32,7 +32,7 @@ - attackby(obj/item/W as obj, mob/user as mob) + attackby(obj/item/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0, user)) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 0bdbfe90647..e4924825b13 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -13,7 +13,7 @@ max_amount = 60 attack_verb = list("hit", "bludgeoned", "whacked") -/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob, params) ..() if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 02936a7912a..117473aa1ad 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -34,7 +34,7 @@ /obj/item/stack/sheet/glass/attack_self(mob/user as mob) construct_window(user) -/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user) +/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params) ..() if(istype(W,/obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CC = W @@ -255,7 +255,7 @@ /obj/item/stack/sheet/plasmaglass/attack_self(mob/user as mob) construct_window(user) -/obj/item/stack/sheet/plasmaglass/attackby(obj/item/W, mob/user) +/obj/item/stack/sheet/plasmaglass/attackby(obj/item/W, mob/user, params) ..() if( istype(W, /obj/item/stack/rods) ) var/obj/item/stack/rods/V = W @@ -337,7 +337,7 @@ icon_state = "sheet-plasmarglass" g_amt = MINERAL_MATERIAL_AMOUNT * 2 m_amt = MINERAL_MATERIAL_AMOUNT / 2 - origin_tech = "materials=4;plasma=2" + origin_tech = "materials=3;plasma=2" var/created_window = /obj/structure/window/plasmareinforced var/full_window = /obj/structure/window/full/plasmareinforced diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 72339452e77..97bf00120ef 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -90,7 +90,7 @@ //Step one - dehairing. -/obj/item/stack/sheet/animalhide/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/stack/sheet/animalhide/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if( istype(W, /obj/item/weapon/kitchenknife) || \ istype(W, /obj/item/weapon/kitchen/utensil/knife) || \ istype(W, /obj/item/weapon/twohanded/fireaxe) || \ diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm index 51aed957168..7b2b30660ec 100644 --- a/code/game/objects/items/stacks/sheets/light.dm +++ b/code/game/objects/items/stacks/sheets/light.dm @@ -11,7 +11,7 @@ flags = CONDUCT max_amount = 60 -/obj/item/stack/light_w/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/item/stack/light_w/attackby(var/obj/item/O as obj, var/mob/user as mob, params) ..() if(istype(O,/obj/item/weapon/wirecutters)) var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc) diff --git a/code/game/objects/items/stacks/sheets/sheets.dm b/code/game/objects/items/stacks/sheets/sheets.dm index 74ebf59b11e..8482d4a7cd1 100644 --- a/code/game/objects/items/stacks/sheets/sheets.dm +++ b/code/game/objects/items/stacks/sheets/sheets.dm @@ -14,7 +14,7 @@ // Since the sheetsnatcher was consolidated into weapon/storage/bag we now use // item/attackby() properly, making this unnecessary -/*/obj/item/stack/sheet/attackby(obj/item/weapon/W as obj, mob/user as mob) +/*/obj/item/stack/sheet/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/storage/bag/sheetsnatcher)) var/obj/item/weapon/storage/bag/sheetsnatcher/S = W if(!S.mode) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index a4f2cc60829..45b483d602d 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -203,7 +203,7 @@ ..() return -/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob, params) ..() if (istype(W, src.type)) var/obj/item/stack/S = W diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm index 688c3347116..e395acbfde4 100644 --- a/code/game/objects/items/stacks/tiles/light.dm +++ b/code/game/objects/items/stacks/tiles/light.dm @@ -25,7 +25,7 @@ else state = 0 //fine -/obj/item/stack/tile/light/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/item/stack/tile/light/attackby(var/obj/item/O as obj, var/mob/user as mob, params) ..() if(istype(O,/obj/item/weapon/crowbar)) new/obj/item/stack/sheet/metal(user.loc) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index b338a1c259a..983278dd71c 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -56,7 +56,7 @@ src.update_icon() return -/obj/item/toy/balloon/attackby(obj/O as obj, mob/user as mob) +/obj/item/toy/balloon/attackby(obj/O as obj, mob/user as mob, params) if(istype(O, /obj/item/weapon/reagent_containers/glass)) if(O.reagents) if(O.reagents.total_volume < 1) @@ -148,7 +148,7 @@ ..() return - attackby(obj/item/toy/ammo/gun/A as obj, mob/user as mob) + attackby(obj/item/toy/ammo/gun/A as obj, mob/user as mob, params) if (istype(A, /obj/item/toy/ammo/gun)) if (src.bullets >= 7) @@ -221,7 +221,7 @@ if (bullets) usr << "\blue It is loaded with [bullets] foam darts!" - attackby(obj/item/I as obj, mob/user as mob) + attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/toy/ammo/crossbow)) if(bullets <= 4) user.drop_item() @@ -330,7 +330,7 @@ attack_verb = list("struck", "hammered", "hit", "bashed") bullets = 20.0 -/obj/item/toy/crossbow/tommygun/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/toy/crossbow/tommygun/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/toy/ammo/crossbow)) if(bullets <= 19) user.drop_item() @@ -377,7 +377,7 @@ return // Copied from /obj/item/weapon/melee/energy/sword/attackby -/obj/item/toy/sword/attackby(obj/item/weapon/W, mob/living/user) +/obj/item/toy/sword/attackby(obj/item/weapon/W, mob/living/user, params) ..() if(istype(W, /obj/item/toy/sword)) if(W == src) @@ -703,7 +703,7 @@ obj/item/toy/cards/deck/attack_self(mob/user as mob) user.visible_message("[user] shuffles the deck.", "You shuffle the deck.") cooldown = world.time -obj/item/toy/cards/deck/attackby(obj/item/toy/cards/singlecard/C, mob/living/user) +obj/item/toy/cards/deck/attackby(obj/item/toy/cards/singlecard/C, mob/living/user, params) ..() if(istype(C)) if(C.parentdeck == src) @@ -723,7 +723,7 @@ obj/item/toy/cards/deck/attackby(obj/item/toy/cards/singlecard/C, mob/living/use src.icon_state = "deck_[deckstyle]_low" -obj/item/toy/cards/deck/attackby(obj/item/toy/cards/cardhand/C, mob/living/user) +obj/item/toy/cards/deck/attackby(obj/item/toy/cards/cardhand/C, mob/living/user, params) ..() if(istype(C)) if(C.parentdeck == src) @@ -827,7 +827,7 @@ obj/item/toy/cards/cardhand/Topic(href, href_list) del(src) return -obj/item/toy/cards/cardhand/attackby(obj/item/toy/cards/singlecard/C, mob/living/user) +obj/item/toy/cards/cardhand/attackby(obj/item/toy/cards/singlecard/C, mob/living/user, params) if(istype(C)) if(C.parentdeck == src.parentdeck) src.currenthand += C.cardname @@ -898,7 +898,7 @@ obj/item/toy/cards/singlecard/verb/Flip() src.name = "card" src.pixel_x = -5 -obj/item/toy/cards/singlecard/attackby(obj/item/I, mob/living/user) +obj/item/toy/cards/singlecard/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/toy/cards/singlecard/)) var/obj/item/toy/cards/singlecard/C = I if(C.parentdeck == src.parentdeck) diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 1cb3dbcd718..ec8f3e1457c 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -36,7 +36,7 @@ RCD return - attackby(obj/item/weapon/W, mob/user) + attackby(obj/item/weapon/W, mob/user, params) ..() if(istype(W, /obj/item/weapon/rcd_ammo)) if((matter + 20) > 100) diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm index 1712f52d6f2..055b28ede27 100644 --- a/code/game/objects/items/weapons/RSF.dm +++ b/code/game/objects/items/weapons/RSF.dm @@ -19,7 +19,7 @@ RSF desc = "A RSF. It currently holds [matter]/30 fabrication-units." return -/obj/item/weapon/rsf/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/rsf/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if (istype(W, /obj/item/weapon/rcd_ammo)) if ((matter + 10) > 30) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 86d90735ad6..026c058ba46 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -161,7 +161,7 @@ /obj/item/weapon/card/id/GetID() return src -/obj/item/weapon/card/id/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/card/id/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W,/obj/item/weapon/id_wallet)) user << "You slip [src] into [W]." diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 33b7f064e14..92990626a0e 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -78,7 +78,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM ..() del(reagents) -/obj/item/clothing/mask/cigarette/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/clothing/mask/cigarette/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W @@ -287,7 +287,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "cigarbutt" -/obj/item/clothing/mask/cigarette/cigar/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/clothing/mask/cigarette/cigar/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/match)) ..() else @@ -359,7 +359,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM smoketime = initial(smoketime) return -/obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/match)) ..() else diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 377ff97902a..dbbc2f807ac 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -78,7 +78,7 @@ usr << "Put the defibrillator on your back first!" return -/obj/item/weapon/defibrillator/attackby(obj/item/weapon/W, mob/user) +/obj/item/weapon/defibrillator/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/stock_parts/cell)) var/obj/item/weapon/stock_parts/cell/C = W if(bcell) @@ -231,7 +231,7 @@ update_icon() return -/obj/item/weapon/defibrillator/compact/combat/attackby(obj/item/weapon/W, mob/user) +/obj/item/weapon/defibrillator/compact/combat/attackby(obj/item/weapon/W, mob/user, params) if(W == paddles) paddles.unwield() toggle_paddles() @@ -363,7 +363,7 @@ for(var/datum/organ/external/O in H.organs) total_brute += O.brute_dam total_burn += O.burn_dam - if(H.health <= config.health_threshold_dead && total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !(M_NOCLONE in H.mutations)) + if(H.health <= config.health_threshold_dead && total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !(NOCLONE in H.mutations)) tobehealed = health + threshold tobehealed -= 5 //They get 5 of each type of damage healed so excessive combined damage will not immediately kill them after they get revived H.adjustOxyLoss(tobehealed) @@ -471,7 +471,7 @@ for(var/datum/organ/external/O in H.organs) total_brute += O.brute_dam total_burn += O.burn_dam - if(H.health <= config.health_threshold_dead && total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !(M_NOCLONE in H.mutations)) + if(H.health <= config.health_threshold_dead && total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !(NOCLONE in H.mutations)) tobehealed = health + threshold tobehealed -= 5 //They get 5 of each type of damage healed so excessive combined damage will not immediately kill them after they get revived H.adjustOxyLoss(tobehealed) diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 3cc4caebb33..19dc7b0850e 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -67,7 +67,7 @@ if(istype(M,/mob/living)) M.apply_effect(rand(5,20),IRRADIATE,0) - if (!(M_NOCLONE in M.mutations)) // prevents drained people from having their DNA changed + if (!(NOCLONE in M.mutations)) // prevents drained people from having their DNA changed // UI in syringe. if (buf.types & DNA2_BUF_UI) if (!block) //isolated block? diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 84be7792502..f0208139b81 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -44,7 +44,7 @@ explode(get_turf(user)) return . -/obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user) +/obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user, params) if(istype(I, /obj/item/weapon/screwdriver)) open_panel = !open_panel user << "You [open_panel ? "open" : "close"] the wire panel." diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index 760bef9c2e2..8896e9a77d2 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -64,7 +64,7 @@ return /* -/obj/item/weapon/extinguisher/attackby(obj/item/W, mob/user) +/obj/item/weapon/extinguisher/attackby(obj/item/W, mob/user, params) if(user.stat || user.restrained() || user.lying) return if (istype(W, /obj/item/weapon/wrench)) diff --git a/code/game/objects/items/weapons/fireworks.dm b/code/game/objects/items/weapons/fireworks.dm index 6372145968e..9a90c3ae205 100644 --- a/code/game/objects/items/weapons/fireworks.dm +++ b/code/game/objects/items/weapons/fireworks.dm @@ -4,7 +4,7 @@ obj/item/weapon/firework icon_state = "rocket_0" var/litzor = 0 var/datum/effects/system/sparkel_spread/S -obj/item/weapon/firework/attackby(obj/item/weapon/W,mob/user) +obj/item/weapon/firework/attackby(obj/item/weapon/W,mob/user, params) if(litzor) return if (istype(W, /obj/item/weapon/weldingtool) && W:welding || istype(W,/obj/item/weapon/lighter) && W:lit) @@ -26,7 +26,7 @@ obj/item/weapon/sparkler icon_state = "sparkler_0" var/litzor = 0 var/datum/effect/effect/system/spark_spread/S -obj/item/weapon/sparkler/attackby(obj/item/weapon/W,mob/user) +obj/item/weapon/sparkler/attackby(obj/item/weapon/W,mob/user, params) if(litzor) return if (istype(W, /obj/item/weapon/weldingtool) && W:welding || istype(W,/obj/item/weapon/lighter) && W:lit) diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 7a8bdb8a69c..67d4528ef1e 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -69,7 +69,7 @@ var/turflist = getline(user, target_turf) flame_turf(turflist) -/obj/item/weapon/flamethrower/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/flamethrower/attackby(obj/item/W as obj, mob/user as mob, params) if(user.stat || user.restrained() || user.lying) return if(iswrench(W) && !status)//Taking this apart var/turf/T = get_turf(src) diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 314566fe81d..c87d3f9ef3f 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -43,7 +43,7 @@ return user << "\blue You cant move." -/obj/effect/spresent/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/effect/spresent/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if (!istype(W, /obj/item/weapon/wirecutters)) diff --git a/code/game/objects/items/weapons/grenades/bananade.dm b/code/game/objects/items/weapons/grenades/bananade.dm index 119a72d59a6..a2947d7791d 100644 --- a/code/game/objects/items/weapons/grenades/bananade.dm +++ b/code/game/objects/items/weapons/grenades/bananade.dm @@ -38,7 +38,7 @@ var/turf/T var/fillamt = 0 -/obj/item/weapon/grenade/bananade/casing/attackby(var/obj/item/I, mob/user as mob) +/obj/item/weapon/grenade/bananade/casing/attackby(var/obj/item/I, mob/user as mob, params) if(istype(I, /obj/item/weapon/bananapeel)) if(fillamt < 9) usr << "You add another banana peel to the assembly." diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 3b6da3c7c2a..72ebabc0283 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -103,7 +103,7 @@ prime() -/obj/item/weapon/grenade/chem_grenade/attackby(obj/item/I, mob/user) +/obj/item/weapon/grenade/chem_grenade/attackby(obj/item/I, mob/user, params) if(istype(I,/obj/item/weapon/hand_labeler)) var/obj/item/weapon/hand_labeler/HL = I if(length(HL.label)) @@ -368,7 +368,7 @@ //I tried to just put it in the allowed_containers list but //if you do that it must have reagents. If you're going to //make a special case you might as well do it explicitly. -Sayu -/obj/item/weapon/grenade/chem_grenade/large/attackby(obj/item/I, mob/user) +/obj/item/weapon/grenade/chem_grenade/large/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/slime_extract) && stage == WIRED) user << "You add [I] to the assembly." user.drop_item() diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 5b5e25ff384..2e9c8dd64ed 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -14,7 +14,7 @@ var/display_timer = 1 /obj/item/weapon/grenade/proc/clown_check(var/mob/living/user) - if((M_CLUMSY in user.mutations) && prob(50)) + if((CLUMSY in user.mutations) && prob(50)) user << "Huh? How does this thing work?" active = 1 icon_state = initial(icon_state) + "_active" @@ -81,7 +81,7 @@ M.unEquip(src) -/obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/screwdriver)) switch(det_time) if ("1") diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 5c6da3e797b..ee83c71aa93 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -17,7 +17,7 @@ var/trashtype = null //For disposable cuffs /obj/item/weapon/restraints/handcuffs/attack(mob/living/carbon/C, mob/user) - if(M_CLUMSY in user.mutations && prob(50)) + if(CLUMSY in user.mutations && prob(50)) user << "Uh... how do those things work?!" apply_cuffs(user,user) @@ -122,7 +122,7 @@ var/last_chew = 0 desc = "Use this to keep prisoners in line. Or you know, your significant other." icon_state = "pinkcuffs" -/obj/item/weapon/restraints/handcuffs/cable/attackby(var/obj/item/I, mob/user as mob) +/obj/item/weapon/restraints/handcuffs/cable/attackby(var/obj/item/I, mob/user as mob, params) ..() if(istype(I, /obj/item/stack/rods)) var/obj/item/stack/rods/R = I diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm index 19193fdf4ea..6dd593eac7e 100644 --- a/code/game/objects/items/weapons/hydroponics.dm +++ b/code/game/objects/items/weapons/hydroponics.dm @@ -39,7 +39,7 @@ if(0) usr << "The bag now picks up one seed pouch at a time." -/obj/item/seeds/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/item/seeds/attackby(var/obj/item/O as obj, var/mob/user as mob, params) ..() if (istype(O, /obj/item/weapon/seedbag)) var/obj/item/weapon/seedbag/S = O @@ -230,7 +230,7 @@ /* * Corncob */ -/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/kitchenknife/ritual)) user << "You use [W] to fashion a pipe out of the corn cob!" diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index 15713658712..f4f9f3d2400 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -21,7 +21,7 @@ return - attackby(obj/item/weapon/I as obj, mob/user as mob) + attackby(obj/item/weapon/I as obj, mob/user as mob, params) ..() if (istype(I, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index 0edd1a87362..d03f499a26c 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -74,7 +74,7 @@ return - attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params) if(istype(G, /obj/item/weapon/grab)) if(!ismob(G:affecting)) return diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index 476ed726cd9..b589c68eea7 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -38,7 +38,7 @@ return - attackby(obj/item/weapon/implantcase/C as obj, mob/user as mob) + attackby(obj/item/weapon/implantcase/C as obj, mob/user as mob, params) ..() if(istype(C, /obj/item/weapon/implantcase)) if(!( src.case )) diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 67d83b797e1..eaa47a0d966 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -42,7 +42,7 @@ if(user.a_intent != "help") if(user.zone_sel.selecting == "head" || user.zone_sel.selecting == "eyes") - if((M_CLUMSY in user.mutations) && prob(50)) + if((CLUMSY in user.mutations) && prob(50)) M = user return eyestab(M,user) else @@ -103,7 +103,7 @@ return (BRUTELOSS) /obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob) - if ((M_CLUMSY in user.mutations) && prob(50)) + if ((CLUMSY in user.mutations) && prob(50)) user << "\red You accidentally cut yourself with the [src]." user.take_organ_damage(20) return @@ -118,7 +118,7 @@ throwforce = 10.0 /obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob) - if ((M_CLUMSY in user.mutations) && prob(50)) + if ((CLUMSY in user.mutations) && prob(50)) user << "\red You somehow managed to cut yourself with the [src]." user.take_organ_damage(20) return @@ -215,6 +215,7 @@ w_class = 3.0 attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") + /* * Trays - Agouri */ @@ -236,7 +237,6 @@ // w_class = 2 -- takes up 3 // w_class = 3 -- takes up 5 - /* ===============~~~~~================================~~~~~==================== = = diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index 7b7a7c7a829..5581eaf3bd5 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -49,7 +49,7 @@ user << "You have finished mopping!" -/obj/effect/attackby(obj/item/I, mob/user) +/obj/effect/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/mop) || istype(I, /obj/item/weapon/soap)) return ..() diff --git a/code/game/objects/items/weapons/shards.dm b/code/game/objects/items/weapons/shards.dm index cafcb4c3a44..c406a1bea1d 100644 --- a/code/game/objects/items/weapons/shards.dm +++ b/code/game/objects/items/weapons/shards.dm @@ -50,7 +50,7 @@ else return -/obj/item/weapon/shard/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/shard/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if ( istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W @@ -61,7 +61,7 @@ continue if(G.amount>=G.max_amount) continue - G.attackby(NG, user) + G.attackby(NG, user, params) usr << "You add the newly-formed glass to the stack. It now contains [NG.amount] sheets." //SN src = null del(src) diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm index eb4f6236c76..931d6e09f84 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -22,7 +22,7 @@ IsShield() return 1 - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/melee/baton)) if(cooldown < world.time - 25) user.visible_message("[user] bashes [src] with [W]!") diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index 49de496abe6..45bb865df0f 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -13,7 +13,7 @@ max_w_class = 3 max_combined_w_class = 21 -/obj/item/weapon/storage/backpack/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/storage/backpack/attackby(obj/item/weapon/W as obj, mob/user as mob, params) playsound(src.loc, "rustle", 50, 1, -5) ..() @@ -33,7 +33,7 @@ ..() return - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(crit_fail) user << "\red The Bluespace generator isn't working." return @@ -83,6 +83,12 @@ icon_state = "clownpack" item_state = "clownpack" +/obj/item/weapon/storage/backpack/mime + name = "Parcel Parceaux" + desc = "A silent backpack made for those silent workers. Silence Co." + icon_state = "mimepack" + item_state = "mimepack" + /obj/item/weapon/storage/backpack/medic name = "medical backpack" desc = "It's a backpack especially designed for use in a sterile environment." diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm index d4efe740192..20c336fa8a5 100644 --- a/code/game/objects/items/weapons/storage/bible.dm +++ b/code/game/objects/items/weapons/storage/bible.dm @@ -66,7 +66,7 @@ user.take_organ_damage(0,10) return - if ((M_CLUMSY in user.mutations) && prob(50)) + if ((CLUMSY in user.mutations) && prob(50)) user << "\red The [src] slips out of your hand and hits your head." user.take_organ_damage(10) user.Paralyse(20) @@ -115,6 +115,6 @@ A.reagents.del_reagent("water") A.reagents.add_reagent("holywater",water2holy) -/obj/item/weapon/storage/bible/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/storage/bible/attackby(obj/item/weapon/W as obj, mob/user as mob, params) playsound(src.loc, "rustle", 50, 1, -5) ..() diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 2e63b0a2cec..43957b3a695 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -562,7 +562,7 @@ for(var/i=1; i <= storage_slots; i++) new /obj/item/weapon/match(src) - attackby(obj/item/weapon/match/W as obj, mob/user as mob) + attackby(obj/item/weapon/match/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/match) && W.lit == 0) W.lit = 1 W.icon_state = "match_lit" diff --git a/code/game/objects/items/weapons/storage/briefcase.dm b/code/game/objects/items/weapons/storage/briefcase.dm index 138398c32e1..390f7632ca3 100644 --- a/code/game/objects/items/weapons/storage/briefcase.dm +++ b/code/game/objects/items/weapons/storage/briefcase.dm @@ -14,4 +14,4 @@ attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") /obj/item/weapon/storage/briefcase/New() - ..() + ..() \ No newline at end of file diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 2ff671074ef..41f998e5d6f 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -129,7 +129,7 @@ for(var/obj/item/toy/crayon/crayon in contents) overlays += image('icons/obj/crayons.dmi',crayon.colourName) -/obj/item/weapon/storage/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/storage/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/toy/crayon)) switch(W:colourName) if("mime") @@ -319,7 +319,7 @@ overlays += image(icon, src, "ledb") return -/obj/item/weapon/storage/lockbox/vials/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/storage/lockbox/vials/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() update_icon() diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm index 7caa4e9b0dc..85de627f0b8 100644 --- a/code/game/objects/items/weapons/storage/lockbox.dm +++ b/code/game/objects/items/weapons/storage/lockbox.dm @@ -17,7 +17,7 @@ var/icon_broken = "lockbox+b" - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/card/id)) if(src.broken) user << "\red It appears to be broken." diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm index 0d0367277dc..a898fa55066 100644 --- a/code/game/objects/items/weapons/storage/secure.dm +++ b/code/game/objects/items/weapons/storage/secure.dm @@ -32,7 +32,7 @@ ..() usr << text("The service panel is [src.open ? "open" : "closed"].") - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(locked) if ((istype(W, /obj/item/weapon/melee/energy/blade)) && (!src.emagged)) emag_act(user, W) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 56ac3caff67..bbe4a083468 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -1,6 +1,6 @@ // To clarify: // For use_to_pickup and allow_quick_gather functionality, -// see item/attackby() (/game/objects/items.dm) +// see item/attackby() (/game/objects/items.dm, params) // Do not remove this functionality without good reason, cough reagent_containers cough. // -Sayu @@ -326,7 +326,7 @@ return 1 //This proc is called when you want to place an item into the storage item. -/obj/item/weapon/storage/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/storage/attackby(obj/item/W as obj, mob/user as mob, params) ..() if(isrobot(user)) diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index ae0509b00fa..cb991abd057 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -59,7 +59,7 @@ if(!bcell) user <<"The baton does not have a power source installed." -/obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user) +/obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/stock_parts/cell)) var/obj/item/weapon/stock_parts/cell/C = W if(bcell) @@ -101,7 +101,7 @@ add_fingerprint(user) /obj/item/weapon/melee/baton/attack(mob/M, mob/living/user) - if(status && (M_CLUMSY in user.mutations) && prob(50)) + if(status && (CLUMSY in user.mutations) && prob(50)) user.visible_message("[user] accidentally hits themself with [src]!", \ "You accidentally hit yourself with [src]!") user.Weaken(stunforce*3) @@ -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.", \ @@ -176,7 +177,7 @@ bcell = R.cell return ..() -/obj/item/weapon/melee/baton/robot/attackby(obj/item/weapon/W, mob/user) +/obj/item/weapon/melee/baton/robot/attackby(obj/item/weapon/W, mob/user, params) return /obj/item/weapon/melee/baton/loaded/ntcane diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm index e85df4485bf..2354dcb9832 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -401,9 +401,9 @@ LOOK FOR SURGERY.DM*/ if(!istype(M)) return ..() - //if(M.mutations & M_HUSK) return ..() + //if(M.mutations & HUSK) return ..() - if((M_CLUMSY in user.mutations) && prob(50)) + if((CLUMSY in user.mutations) && prob(50)) M = user return eyestab(M,user) @@ -649,7 +649,7 @@ LOOK FOR SURGERY.DM*/ if(!istype(M)) return ..() - if((M_CLUMSY in user.mutations) && prob(50)) + if((CLUMSY in user.mutations) && prob(50)) M = user return eyestab(M,user) diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index 9cf1cee7846..c0228d3c725 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -27,7 +27,7 @@ blade_color = pick("red","blue","green","purple") /obj/item/weapon/melee/energy/sword/attack_self(mob/living/user as mob) - if ((M_CLUMSY in user.mutations) && prob(50)) + if ((CLUMSY in user.mutations) && prob(50)) user << "\red You accidentally cut yourself with [src]." user.take_organ_damage(5,5) active = !active @@ -60,7 +60,7 @@ add_fingerprint(user) return -/obj/item/weapon/melee/energy/sword/attackby(obj/item/weapon/W, mob/living/user) +/obj/item/weapon/melee/energy/sword/attackby(obj/item/weapon/W, mob/living/user, params) ..() if(istype(W, /obj/item/weapon/melee/energy/sword)) if(W == src) @@ -105,7 +105,7 @@ force = 10 /obj/item/weapon/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob) - if ((M_CLUMSY in user.mutations) && prob(50)) + if ((CLUMSY in user.mutations) && prob(50)) user << "\red You club yourself over the head." user.Weaken(3 * force) if(ishuman(user)) @@ -124,7 +124,7 @@ if (user.a_intent == "harm") if(!..()) return playsound(get_turf(src), "swing_hit", 50, 1, -1) - if (M.stuttering < 8 && (!(M_HULK in M.mutations)) /*&& (!istype(H:wear_suit, /obj/item/clothing/suit/judgerobe))*/) + 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) @@ -201,7 +201,7 @@ /obj/item/weapon/melee/telebaton/attack(mob/target as mob, mob/living/user as mob) if(on) add_fingerprint(user) - if((M_CLUMSY in user.mutations) && prob(50)) + if((CLUMSY in user.mutations) && prob(50)) user << "You club yourself over the head." user.Weaken(3 * force) if(ishuman(user)) @@ -295,7 +295,7 @@ return 0 /obj/item/weapon/shield/energy/attack_self(mob/living/user as mob) - if ((M_CLUMSY in user.mutations) && prob(50)) + if ((CLUMSY in user.mutations) && prob(50)) user << "\red You beat yourself in the head with [src]." user.take_organ_damage(5) active = !active diff --git a/code/game/objects/items/weapons/table_rack_parts.dm b/code/game/objects/items/weapons/table_rack_parts.dm index 042efc84203..2c2b44ae387 100644 --- a/code/game/objects/items/weapons/table_rack_parts.dm +++ b/code/game/objects/items/weapons/table_rack_parts.dm @@ -11,7 +11,7 @@ /* * Table Parts */ -/obj/item/weapon/table_parts/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/table_parts/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( user.loc ) @@ -36,7 +36,7 @@ /* * Reinforced Table Parts */ -/obj/item/weapon/table_parts/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/table_parts/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( user.loc ) new /obj/item/stack/rods( user.loc ) @@ -51,7 +51,7 @@ /* * Wooden Table Parts */ -/obj/item/weapon/table_parts/wood/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/table_parts/wood/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/wood( user.loc ) del(src) @@ -65,7 +65,7 @@ /* * Rack Parts */ -/obj/item/weapon/rack_parts/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/rack_parts/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( user.loc ) diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm index 21881c27986..7c39f530ace 100644 --- a/code/game/objects/items/weapons/tanks/tank_types.dm +++ b/code/game/objects/items/weapons/tanks/tank_types.dm @@ -110,7 +110,7 @@ src.air_contents.update_values() return -/obj/item/weapon/tank/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/tank/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if (istype(W, /obj/item/weapon/flamethrower)) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index f12b27f5de2..9d1907df0e8 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -78,7 +78,7 @@ del(src) -/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() var/obj/icon = src diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 8f85c3f0bff..e925b39de25 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -87,7 +87,7 @@ if(!istype(M)) return ..() if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != "head") return ..() - if((M_CLUMSY in user.mutations) && prob(50)) + if((CLUMSY in user.mutations) && prob(50)) M = user return eyestab(M,user) @@ -172,7 +172,7 @@ return -/obj/item/weapon/weldingtool/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/weldingtool/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/screwdriver)) if(welding) user << "\red Stop welding first!" diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 417cfdbbca7..5f5d913823b 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -227,7 +227,7 @@ obj/item/weapon/twohanded/ /obj/item/weapon/twohanded/dualsaber/attack(target as mob, mob/living/user as mob) ..() - if((M_CLUMSY in user.mutations) && (wielded) &&prob(40)) + if((CLUMSY in user.mutations) && (wielded) &&prob(40)) user << "\red You twirl around a bit before losing your balance and impaling yourself on the [src]." user.take_organ_damage(20,25) return @@ -267,7 +267,7 @@ obj/item/weapon/twohanded/ ..() hitsound = 'sound/weapons/blade1.ogg' -/obj/item/weapon/twohanded/dualsaber/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/twohanded/dualsaber/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/device/multitool)) if(hacked == 0) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 998d24f8abc..d63f07d4e06 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -47,7 +47,7 @@ user << "\red You don't have the dexterity to do this!" return - if ((M_CLUMSY in user.mutations) && prob(50)) + if ((CLUMSY in user.mutations) && prob(50)) user << "\red The rod slips out of your hand and hits your head." user.take_organ_damage(10) user.Paralyse(20) @@ -165,7 +165,7 @@ obj/item/weapon/wirerod m_amt = 1875 attack_verb = list("hit", "bludgeoned", "whacked", "bonked") -obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob) +obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob, params) ..() if(istype(I, /obj/item/weapon/shard)) var/obj/item/weapon/twohanded/spear/S = new /obj/item/weapon/twohanded/spear diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 19cfca4eaf4..3b37a08299c 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -178,7 +178,7 @@ LINEN BINS else icon_state = "linenbin-full" -/obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob) +/obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/bedsheet)) user.drop_item() I.loc = src diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm index b79588b78f3..13136868954 100644 --- a/code/game/objects/structures/coathanger.dm +++ b/code/game/objects/structures/coathanger.dm @@ -13,7 +13,7 @@ coat = null update_icon() -/obj/structure/coatrack/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/coatrack/attackby(obj/item/weapon/W as obj, mob/user as mob, params) var/can_hang = 0 for (var/T in allowed) if(istype(W,T)) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 1054dbfcb1e..1375ed71d61 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 @@ -181,7 +182,7 @@ src.dump_contents() del(src) -/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/rcs) && !src.opened) var/obj/item/weapon/rcs/E = W if(E.rcharges != 0) 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/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index 01505311c9b..9d14c48765c 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -58,7 +58,7 @@ new /obj/item/device/radio/headset( src ) return -/obj/structure/closet/secure_closet/personal/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/closet/secure_closet/personal/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (src.opened) if (istype(W, /obj/item/weapon/grab)) src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 3f60559f0fe..7d3fde7744c 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -65,7 +65,7 @@ else user << "Access Denied" -/obj/structure/closet/secure_closet/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/closet/secure_closet/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(src.opened) if(istype(W, /obj/item/weapon/grab)) if(src.large) diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index b8177c9b4a1..85696e2973e 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -122,7 +122,7 @@ M.meteorhit(O) shatter(M) -/obj/structure/closet/statue/attackby(obj/item/I as obj, mob/user as mob) +/obj/structure/closet/statue/attackby(obj/item/I as obj, mob/user as mob, params) health -= I.force visible_message("\red [user] strikes [src] with [I].") if(health <= 0) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 9df3987af5f..9bf8bfb5e5a 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -67,7 +67,7 @@ src.opened = 0 return 1 -/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/rcs) && !src.opened) var/obj/item/weapon/rcs/E = W if(E.rcharges != 0) @@ -246,7 +246,7 @@ else src.toggle(user) -/obj/structure/closet/crate/secure/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/closet/crate/secure/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(is_type_in_list(W, list(/obj/item/stack/packageWrap, /obj/item/stack/cable_coil, /obj/item/device/radio/electropack, /obj/item/weapon/wirecutters))) return ..() if(locked && (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade))) diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm index 62d77768e2a..3668a530ed6 100644 --- a/code/game/objects/structures/crates_lockers/largecrate.dm +++ b/code/game/objects/structures/crates_lockers/largecrate.dm @@ -9,7 +9,7 @@ user << "You need a crowbar to pry this open!" return -/obj/structure/largecrate/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/largecrate/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) new /obj/item/stack/sheet/wood(src) var/turf/T = get_turf(src) @@ -37,7 +37,7 @@ name = "cow crate" icon_state = "lisacrate" -/obj/structure/largecrate/cow/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/largecrate/cow/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) new /mob/living/simple_animal/cow(loc) ..() @@ -46,7 +46,7 @@ name = "goat crate" icon_state = "lisacrate" -/obj/structure/largecrate/goat/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/largecrate/goat/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) new /mob/living/simple_animal/hostile/retaliate/goat(loc) ..() @@ -55,7 +55,7 @@ name = "chicken crate" icon_state = "lisacrate" -/obj/structure/largecrate/chick/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/largecrate/chick/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) var/num = rand(4, 6) for(var/i = 0, i < num, i++) @@ -66,7 +66,7 @@ name = "Mysterious Crate" icon_state = "lisacrate" -/obj/structure/largecrate/ninja/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/largecrate/ninja/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) new /obj/item/clothing/gloves/space_ninja(loc) new /obj/item/clothing/mask/gas/voice/space_ninja(loc) @@ -80,7 +80,7 @@ name = "cat crate" icon_state = "lisacrate" -/obj/structure/largecrate/cat/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/largecrate/cat/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/crowbar)) new /mob/living/simple_animal/cat(loc) ..() \ No newline at end of file diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 577e28c02f9..f153035fede 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -5,7 +5,7 @@ var/obj/item/weapon/airlock_electronics/circuit = null var/state=0 -/obj/structure/displaycase_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/displaycase_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params) var/pstate=state var/turf/T=get_turf(src) switch(state) @@ -162,7 +162,7 @@ return -/obj/structure/displaycase/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/displaycase/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/card)) var/obj/item/weapon/card/id/I=W if(!check_access(I)) diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 355ec779efe..1c178848899 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -135,7 +135,7 @@ obj/structure/door_assembly -/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/pen)) var/t = copytext(stripped_input(user, "Enter the name for the door.", src.name, src.created_name),1,MAX_NAME_LEN) if(!t) return diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm index 828098fd07e..f9e49fcc40b 100644 --- a/code/game/objects/structures/electricchair.dm +++ b/code/game/objects/structures/electricchair.dm @@ -12,7 +12,7 @@ overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) return -/obj/structure/stool/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/stool/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) var/obj/structure/stool/bed/chair/C = new /obj/structure/stool/bed/chair(loc) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/game/objects/structures/engicart.dm b/code/game/objects/structures/engicart.dm index 1257195ddf7..85fee295e38 100644 --- a/code/game/objects/structures/engicart.dm +++ b/code/game/objects/structures/engicart.dm @@ -20,7 +20,7 @@ updateUsrDialog() user << "You put [I] into [src]." return -/obj/structure/engineeringcart/attackby(obj/item/I, mob/user) +/obj/structure/engineeringcart/attackby(obj/item/I, mob/user, params) var/fail_msg = "There is already one of those in [src]." if(!I.is_robot_module()) if(istype(I, /obj/item/stack/sheet/glass)) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index cfcc3c1176d..80a6e4b34a8 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -9,7 +9,7 @@ var/opened = 0 -/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user) +/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user, params) if(isrobot(user) || isalien(user)) return if(istype(O, /obj/item/weapon/extinguisher)) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index 2c586f79f5d..e00b7f1c366 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -165,7 +165,7 @@ qdel(src) return T -/obj/structure/falsewall/attackby(obj/item/weapon/W, mob/user) +/obj/structure/falsewall/attackby(obj/item/weapon/W, mob/user, params) if(opening) user << "You must wait until the door has stopped moving." return @@ -271,7 +271,7 @@ var/active = null var/last_event = 0 -/obj/structure/falsewall/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/falsewall/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob, params) radiate() ..() diff --git a/code/game/objects/structures/foodcart.dm b/code/game/objects/structures/foodcart.dm index 37c030aba81..c1a3a388d48 100644 --- a/code/game/objects/structures/foodcart.dm +++ b/code/game/objects/structures/foodcart.dm @@ -29,7 +29,7 @@ user << "You put [I] into [src]." return -/obj/structure/foodcart/attackby(obj/item/I, mob/user) +/obj/structure/foodcart/attackby(obj/item/I, mob/user, params) var/fail_msg = "There are no open spaces for this in [src]." if(!I.is_robot_module()) if(istype(I, /obj/item/weapon/reagent_containers/food/snacks)) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 7bf35f6c6e0..f5a2e615b6a 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -6,7 +6,7 @@ var/state = 0 var/health = 200 -/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench) && state == 0) if(anchored && !istype(src,/obj/structure/girder/displaced)) playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) @@ -231,7 +231,7 @@ layer = 2 var/health = 250 -/obj/structure/cultgirder/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/cultgirder/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user << "\blue Now disassembling the girder" diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 2475ee9eeed..c5114cf2ef9 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -55,10 +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].", \ @@ -66,15 +68,16 @@ if(shock(user, 70)) return - if(M_HULK in user.mutations) + if(HULK in user.mutations) health -= 5 else 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].", \ @@ -85,7 +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 @@ -101,7 +106,8 @@ /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].", \ @@ -136,7 +142,8 @@ healthcheck() return -/obj/structure/grille/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/grille/attackby(obj/item/weapon/W as obj, mob/user as mob, params) + user.changeNext_move(CLICK_CD_MELEE) if(iswirecutter(W)) if(!shock(user, 100)) playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1) diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 640a7f6951c..3cb32653054 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -101,7 +101,7 @@ attack_generic(user, rand(10, 15)) - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(!istype(W)) return if (can_puncture(W)) diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index e6c7105796c..cc7e50bf888 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -38,7 +38,7 @@ if((INFINITY * -1) to 0) usr << "It appears completely unsalvageable" -/obj/structure/stool/bed/chair/cart/attackby(obj/item/W, mob/user) +/obj/structure/stool/bed/chair/cart/attackby(obj/item/W, mob/user, params) if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if (WT.remove_fuel(0)) @@ -287,7 +287,7 @@ if(mybag) usr << "\A [mybag] is hanging on the [name]." -/obj/structure/stool/bed/chair/cart/janicart/attackby(obj/item/W, mob/user) +/obj/structure/stool/bed/chair/cart/janicart/attackby(obj/item/W, mob/user, params) ..() if(istype(W, /obj/item/weapon/mop)) if(reagents.total_volume >= 2) @@ -442,7 +442,7 @@ return -/obj/structure/janitorialcart/attackby(obj/item/I, mob/user) +/obj/structure/janitorialcart/attackby(obj/item/I, mob/user, params) var/fail_msg = "There is already one of those in [src]." if(!I.is_robot_module()) @@ -504,7 +504,7 @@ "You hear ratchet.") anchored = 0 else if(mybag) - mybag.attackby(I, user) + mybag.attackby(I, user, params) else usr << "You cannot interface your modules [src]!" diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index f0060dfe935..eb3f0a3c371 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -15,7 +15,7 @@ attack_paw(mob/user as mob) return src.attack_hand(usr) - attackby(obj/item/weapon/grab/G as obj, mob/user as mob) + attackby(obj/item/weapon/grab/G as obj, mob/user as mob, params) if(!istype(G, /obj/item/weapon/grab)) return if(istype(G.affecting, /mob/living/carbon/monkey)) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index a10448cfcc4..dfcb2f58270 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -69,5 +69,5 @@ /obj/structure/ladder/attack_paw(mob/user as mob) return attack_hand(user) -/obj/structure/ladder/attackby(obj/item/weapon/W, mob/user as mob) +/obj/structure/ladder/attackby(obj/item/weapon/W, mob/user as mob, params) return attack_hand(user) \ No newline at end of file diff --git a/code/game/objects/structures/lamarr_cage.dm b/code/game/objects/structures/lamarr_cage.dm index bd870f68341..5b6acef00ec 100644 --- a/code/game/objects/structures/lamarr_cage.dm +++ b/code/game/objects/structures/lamarr_cage.dm @@ -66,7 +66,7 @@ return -/obj/structure/lamarr/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/lamarr/attackby(obj/item/weapon/W as obj, mob/user as mob, params) src.health -= W.force src.healthcheck() ..() diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 4faf0d28596..ef8d3dd15e4 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -49,7 +49,7 @@ else return -/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob) +/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob, params) if (istype(C, /obj/item/stack/tile/plasteel) || istype(C, /obj/item/stack/rods)) var/turf/T = get_turf(src) diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index 06bd5d139a3..a022c1c722b 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -102,7 +102,7 @@ else icon_state = mineralType - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/pickaxe)) var/obj/item/weapon/pickaxe/digTool = W user << "You start digging the [name]." @@ -187,7 +187,7 @@ /obj/structure/mineral_door/transparent/plasma mineralType = "plasma" - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0, user)) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 59771219737..e32c879b304 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, params) + 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/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm index d7304c9cc57..9c25217d603 100644 --- a/code/game/objects/structures/mop_bucket.dm +++ b/code/game/objects/structures/mop_bucket.dm @@ -19,7 +19,7 @@ usr << text("\icon[] [] contains [] units of water left!", src, src.name, src.reagents.total_volume) ..() -/obj/structure/mopbucket/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/mopbucket/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/mop)) if (src.reagents.total_volume >= 2) src.reagents.trans_to(W, 2) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 5708ed9c604..c591c75b0e3 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -104,7 +104,7 @@ update() return -/obj/structure/morgue/attackby(P as obj, mob/user as mob) +/obj/structure/morgue/attackby(P as obj, mob/user as mob, params) if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text if (user.get_active_hand() != P) @@ -278,7 +278,7 @@ src.add_fingerprint(user) update() -/obj/structure/crematorium/attackby(P as obj, mob/user as mob) +/obj/structure/crematorium/attackby(P as obj, mob/user as mob, params) if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text if (user.get_active_hand() != P) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 733ff964466..ea3b35be1ae 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -332,7 +332,7 @@ user.set_machine(src) song.interact(user) -/obj/structure/piano/attackby(obj/item/O as obj, mob/user as mob) +/obj/structure/piano/attackby(obj/item/O as obj, mob/user as mob, params) if (istype(O, /obj/item/weapon/wrench)) if (!anchored && !isinspace()) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index a5ad84c20eb..d5997adfda9 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -16,7 +16,7 @@ icon_state = "nboard0[notices]" //attaching papers!! -/obj/structure/noticeboard/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob) +/obj/structure/noticeboard/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/paper)) if(notices < 5) O.add_fingerprint(user) diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 7a7d16c2eb0..d665589182e 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -142,7 +142,7 @@ FLOOR SAFES updateUsrDialog() -/obj/structure/safe/attackby(obj/item/I as obj, mob/user as mob) +/obj/structure/safe/attackby(obj/item/I as obj, mob/user as mob, params) if(open) if(I.w_class + space <= maxspace) space += I.w_class diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm index 5c387450fd5..914f8847ec0 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm @@ -70,7 +70,7 @@ overlays.Cut() ..() -/obj/structure/stool/bed/nest/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/stool/bed/nest/attackby(obj/item/weapon/W as obj, mob/user as mob, params) var/aforce = W.force health = max(0, health - aforce) playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 182d1c64050..2a493bdff37 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -121,7 +121,7 @@ icon_state = "down" anchored = 0 -/obj/structure/stool/bed/roller/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/stool/bed/roller/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/roller_holder)) if(buckled_mob) manual_unbuckle() @@ -145,7 +145,7 @@ R.add_fingerprint(user) del(src) -/obj/item/roller/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/roller/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/roller_holder)) var/obj/item/roller_holder/RH = W diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index f892ce74239..6a5598a37ef 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -16,7 +16,7 @@ handle_rotation() return -/obj/structure/stool/bed/chair/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/stool/bed/chair/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/assembly/shock_kit)) var/obj/item/assembly/shock_kit/SK = W @@ -86,7 +86,7 @@ name = "wooden chair" desc = "Old is never too old to not be in fashion." -/obj/structure/stool/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/stool/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) new /obj/item/stack/sheet/wood(src.loc) diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index bad562d595a..050dbb56629 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -26,7 +26,7 @@ new /obj/item/stack/sheet/metal(src.loc) del(src) -/obj/structure/stool/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/stool/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) new /obj/item/stack/sheet/metal(src.loc) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 676250d27a0..da7e049ef65 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) - if(M_HULK in user.mutations) +/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) - if(M_HULK in user.mutations) +/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() @@ -372,7 +376,7 @@ return -/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) var/obj/item/weapon/grab/G = W if (istype(G.affecting, /mob/living)) @@ -416,6 +420,10 @@ if(!(W.flags & ABSTRACT)) if(user.drop_item()) W.Move(loc) + var/list/click_params = params2list(params) + //Center the icon where the user clicked. + W.pixel_x = (text2num(click_params["icon-x"]) - 16) + W.pixel_y = (text2num(click_params["icon-y"]) - 16) return /obj/structure/table/proc/straight_table_check(var/direction) @@ -531,7 +539,7 @@ health = 50 autoignition_temperature = AUTOIGNITION_WOOD // TODO: Special ash subtype that looks like charred table legs. -/obj/structure/table/woodentable/attackby(obj/item/I as obj, mob/user as mob) +/obj/structure/table/woodentable/attackby(obj/item/I as obj, mob/user as mob, params) if (istype(I, /obj/item/stack/tile/grass)) del(I) @@ -581,6 +589,10 @@ if(!(I.flags & ABSTRACT)) if(user.drop_item()) I.Move(loc) + var/list/click_params = params2list(params) + //Center the icon where the user clicked. + I.pixel_x = (text2num(click_params["icon-x"]) - 16) + I.pixel_y = (text2num(click_params["icon-y"]) - 16) //if(W && W.loc) W.loc = src.loc return 1 @@ -590,7 +602,7 @@ icon_state = "pokertable" -/obj/structure/table/woodentable/poker/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/table/woodentable/poker/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = W @@ -635,6 +647,10 @@ if(!(W.flags & ABSTRACT)) if(user.drop_item()) W.Move(loc) + var/list/click_params = params2list(params) + //Center the icon where the user clicked. + W.pixel_x = (text2num(click_params["icon-x"]) - 16) + W.pixel_y = (text2num(click_params["icon-y"]) - 16) return 1 @@ -655,7 +671,7 @@ else return ..() -/obj/structure/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0, user)) @@ -742,7 +758,7 @@ step(O, get_dir(O, src)) return -/obj/structure/rack/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/rack/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/weapon/rack_parts( src.loc ) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) @@ -760,26 +776,29 @@ /obj/structure/table/attack_hand(mob/user) - if(M_HULK in user.mutations) + if(HULK in user.mutations) visible_message("[user] smashes [src] apart!") user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) destroy() -/obj/structure/rack/attack_paw(mob/user) - if(M_HULK in user.mutations) +/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/tables_racks.dm.bak b/code/game/objects/structures/tables_racks.dm.bak deleted file mode 100644 index be396a3196f..00000000000 --- a/code/game/objects/structures/tables_racks.dm.bak +++ /dev/null @@ -1,480 +0,0 @@ -/* Tables and Racks - * Contains: - * Tables - * Wooden tables - * Reinforced tables - * Racks - */ - - -/* - * Tables - */ -/obj/structure/table - name = "table" - desc = "A square piece of metal standing on four metal legs. It can not move." - icon = 'icons/obj/structures.dmi' - icon_state = "table" - density = 1 - anchored = 1.0 - layer = 2.8 - throwpass = 1 //You can throw objects over this, despite it's density.") - var/parts = /obj/item/weapon/table_parts - -/obj/structure/table/New() - ..() - for(var/obj/structure/table/T in src.loc) - if(T != src) - del(T) - update_icon() - for(var/direction in list(1,2,4,8,5,6,9,10)) - if(locate(/obj/structure/table,get_step(src,direction))) - var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction)) - T.update_icon() - -/obj/structure/table/Del() - for(var/direction in list(1,2,4,8,5,6,9,10)) - if(locate(/obj/structure/table,get_step(src,direction))) - var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction)) - T.update_icon() - ..() - -/obj/structure/table/proc/destroy() - new parts(loc) - density = 0 - del(src) - - -/obj/structure/table/update_icon() - spawn(2) //So it properly updates when deleting - var/dir_sum = 0 - for(var/direction in list(1,2,4,8,5,6,9,10)) - var/skip_sum = 0 - for(var/obj/structure/window/W in src.loc) - if(W.dir == direction) //So smooth tables don't go smooth through windows - skip_sum = 1 - continue - var/inv_direction //inverse direction - switch(direction) - if(1) - inv_direction = 2 - if(2) - inv_direction = 1 - if(4) - inv_direction = 8 - if(8) - inv_direction = 4 - if(5) - inv_direction = 10 - if(6) - inv_direction = 9 - if(9) - inv_direction = 6 - if(10) - inv_direction = 5 - for(var/obj/structure/window/W in get_step(src,direction)) - if(W.dir == inv_direction) //So smooth tables don't go smooth through windows when the window is on the other table's tile - skip_sum = 1 - continue - if(!skip_sum) //means there is a window between the two tiles in this direction - if(locate(/obj/structure/table,get_step(src,direction))) - if(direction <5) - dir_sum += direction - else - if(direction == 5) //This permits the use of all table directions. (Set up so clockwise around the central table is a higher value, from north) - dir_sum += 16 - if(direction == 6) - dir_sum += 32 - if(direction == 8) //Aherp and Aderp. Jezes I am stupid. -- SkyMarshal - dir_sum += 8 - if(direction == 10) - dir_sum += 64 - if(direction == 9) - dir_sum += 128 - - var/table_type = 0 //stand_alone table - if(dir_sum%16 in cardinal) - table_type = 1 //endtable - dir_sum %= 16 - if(dir_sum%16 in list(3,12)) - table_type = 2 //1 tile thick, streight table - if(dir_sum%16 == 3) //3 doesn't exist as a dir - dir_sum = 2 - if(dir_sum%16 == 12) //12 doesn't exist as a dir. - dir_sum = 4 - if(dir_sum%16 in list(5,6,9,10)) - if(locate(/obj/structure/table,get_step(src.loc,dir_sum%16))) - table_type = 3 //full table (not the 1 tile thick one, but one of the 'tabledir' tables) - else - table_type = 2 //1 tile thick, corner table (treated the same as streight tables in code later on) - dir_sum %= 16 - if(dir_sum%16 in list(13,14,7,11)) //Three-way intersection - table_type = 5 //full table as three-way intersections are not sprited, would require 64 sprites to handle all combinations. TOO BAD -- SkyMarshal - switch(dir_sum%16) //Begin computation of the special type tables. --SkyMarshal - if(7) - if(dir_sum == 23) - table_type = 6 - dir_sum = 8 - else if(dir_sum == 39) - dir_sum = 4 - table_type = 6 - else if(dir_sum == 55 || dir_sum == 119 || dir_sum == 247 || dir_sum == 183) - dir_sum = 4 - table_type = 3 - else - dir_sum = 4 - if(11) - if(dir_sum == 75) - dir_sum = 5 - table_type = 6 - else if(dir_sum == 139) - dir_sum = 9 - table_type = 6 - else if(dir_sum == 203 || dir_sum == 219 || dir_sum == 251 || dir_sum == 235) - dir_sum = 8 - table_type = 3 - else - dir_sum = 8 - if(13) - if(dir_sum == 29) - dir_sum = 10 - table_type = 6 - else if(dir_sum == 141) - dir_sum = 6 - table_type = 6 - else if(dir_sum == 189 || dir_sum == 221 || dir_sum == 253 || dir_sum == 157) - dir_sum = 1 - table_type = 3 - else - dir_sum = 1 - if(14) - if(dir_sum == 46) - dir_sum = 1 - table_type = 6 - else if(dir_sum == 78) - dir_sum = 2 - table_type = 6 - else if(dir_sum == 110 || dir_sum == 254 || dir_sum == 238 || dir_sum == 126) - dir_sum = 2 - table_type = 3 - else - dir_sum = 2 //These translate the dir_sum to the correct dirs from the 'tabledir' icon_state. - if(dir_sum%16 == 15) - table_type = 4 //4-way intersection, the 'middle' table sprites will be used. - - if(istype(src,/obj/structure/table/reinforced)) - switch(table_type) - if(0) - icon_state = "reinf_table" - if(1) - icon_state = "reinf_1tileendtable" - if(2) - icon_state = "reinf_1tilethick" - if(3) - icon_state = "reinf_tabledir" - if(4) - icon_state = "reinf_middle" - if(5) - icon_state = "reinf_tabledir2" - if(6) - icon_state = "reinf_tabledir3" - else if(istype(src,/obj/structure/table/woodentable)) - switch(table_type) - if(0) - icon_state = "wood_table" - if(1) - icon_state = "wood_1tileendtable" - if(2) - icon_state = "wood_1tilethick" - if(3) - icon_state = "wood_tabledir" - if(4) - icon_state = "wood_middle" - if(5) - icon_state = "wood_tabledir2" - if(6) - icon_state = "wood_tabledir3" - else - switch(table_type) - if(0) - icon_state = "table" - if(1) - icon_state = "table_1tileendtable" - if(2) - icon_state = "table_1tilethick" - if(3) - icon_state = "tabledir" - if(4) - icon_state = "table_middle" - if(5) - icon_state = "tabledir2" - if(6) - icon_state = "tabledir3" - if (dir_sum in list(1,2,4,8,5,6,9,10)) - dir = dir_sum - else - dir = 2 - -/obj/structure/table/ex_act(severity) - switch(severity) - if(1.0) - del(src) - return - if(2.0) - if (prob(50)) - del(src) - return - if(3.0) - if (prob(25)) - destroy() - else - return - - -/obj/structure/table/blob_act() - if(prob(75)) - destroy() - -/obj/structure/table/attack_paw(mob/user) - if(HULK in user.mutations) - user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) - visible_message("[user] smashes the [src] apart!") - destroy() - - -/obj/structure/table/attack_alien(mob/user) - visible_message("[user] slices [src] apart!") - -/obj/structure/table/attack_animal(mob/living/simple_animal/user) - if(user.wall_smash) - visible_message("[user] smashes [src] apart!") - destroy() - - - -/obj/structure/table/attack_hand(mob/user) - if(HULK in user.mutations) - visible_message("[user] smashes [src] apart!") - user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) - destroy() - -/obj/structure/table/attack_tk() // no telehulk sorry - return - -/obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if(air_group || (height==0)) return 1 - - if(istype(mover) && mover.checkpass(PASSTABLE)) - return 1 - else - return 0 - - -/obj/structure/table/MouseDrop_T(obj/O as obj, mob/user as mob) - - if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) - return - if(isrobot(user)) - return - user.drop_item() - if (O.loc != src.loc) - step(O, get_dir(O, src)) - return - - -/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) - var/obj/item/weapon/grab/G = W - if (istype(G.affecting, /mob/living)) - var/mob/living/M = G.affecting - if (G.state < 2) - if(user.a_intent == "hurt") - if (prob(15)) M.Weaken(5) - M.apply_damage(8,def_zone = "head") - visible_message("\red [G.assailant] slams [G.affecting]'s face against \the [src]!") - playsound(src.loc, 'sound/weapons/tablehit1.ogg', 50, 1) - else - user << "\red You need a better grip to do that!" - return - else - G.affecting.loc = src.loc - G.affecting.Weaken(5) - visible_message("\red [G.assailant] puts [G.affecting] on \the [src].") - del(W) - return - - if (istype(W, /obj/item/weapon/wrench)) - user << "\blue Now disassembling table" - playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - if(do_after(user,50)) - destroy() - return - - if(isrobot(user)) - return - - if(istype(W, /obj/item/weapon/melee/energy/blade)) - var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() - spark_system.set_up(5, 0, src.loc) - spark_system.start() - playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1) - playsound(src.loc, "sparks", 50, 1) - for(var/mob/O in viewers(user, 4)) - O.show_message("\blue The [src] was sliced apart by [user]!", 1, "\red You hear [src] coming apart.", 2) - destroy() - - user.drop_item(src) - return - - -/* - * Wooden tables - */ -/obj/structure/table/woodentable - name = "wooden table" - desc = "Do not apply fire to this. Rumour says it burns easily." - icon_state = "wood_table" - parts = /obj/item/weapon/table_parts/wood - -/* - * Reinforced tables - */ -/obj/structure/table/reinforced - name = "reinforced table" - desc = "A version of the four legged table. It is stronger." - icon_state = "reinf_table" - var/status = 2 - parts = /obj/item/weapon/table_parts/reinforced - - -/obj/structure/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W - if(WT.remove_fuel(0, user)) - if(src.status == 2) - user << "\blue Now weakening the reinforced table" - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - if (do_after(user, 50)) - if(!src || !WT.isOn()) return - user << "\blue Table weakened" - src.status = 1 - else - user << "\blue Now strengthening the reinforced table" - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - if (do_after(user, 50)) - if(!src || !WT.isOn()) return - user << "\blue Table strengthened" - src.status = 2 - return - return - - if (istype(W, /obj/item/weapon/wrench)) - if(src.status == 2) - return - - ..() - -/* - * Racks - */ -/obj/structure/rack - name = "rack" - desc = "Different from the Middle Ages version." - icon = 'icons/obj/objects.dmi' - icon_state = "rack" - density = 1 - flags = FPRINT - anchored = 1.0 - throwpass = 1 //You can throw objects over this, despite it's density. - -/obj/structure/rack/ex_act(severity) - switch(severity) - if(1.0) - del(src) - if(2.0) - del(src) - if(prob(50)) - new /obj/item/weapon/rack_parts(src.loc) - if(3.0) - if(prob(25)) - del(src) - new /obj/item/weapon/rack_parts(src.loc) - -/obj/structure/rack/blob_act() - if(prob(75)) - del(src) - return - else if(prob(50)) - new /obj/item/weapon/rack_parts(src.loc) - del(src) - return - -/obj/structure/rack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if(air_group || (height==0)) return 1 - if(src.density == 0) //Because broken racks -Agouri |TODO: SPRITE!| - return 1 - if(istype(mover) && mover.checkpass(PASSTABLE)) - return 1 - else - return 0 - -/obj/structure/rack/MouseDrop_T(obj/O as obj, mob/user as mob) - if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) - return - if(isrobot(user)) - return - user.drop_item() - if (O.loc != src.loc) - step(O, get_dir(O, src)) - return - -/obj/structure/rack/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/wrench)) - new /obj/item/weapon/rack_parts( src.loc ) - playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - del(src) - return - if(isrobot(user)) - return - user.drop_item() - if(W && W.loc) W.loc = src.loc - return - -/obj/structure/rack/meteorhit(obj/O as obj) - del(src) - - -/obj/structure/table/attack_hand(mob/user) - if(HULK in user.mutations) - visible_message("[user] smashes [src] apart!") - user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) - new /obj/item/weapon/rack_parts(loc) - density = 0 - del(src) - - -/obj/structure/rack/attack_paw(mob/user) - if(HULK in user.mutations) - user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) - visible_message("[user] smashes [src] apart!") - new /obj/item/weapon/rack_parts(loc) - density = 0 - del(src) - - -/obj/structure/rack/attack_alien(mob/user) - visible_message("[user] slices [src] apart!") - new /obj/item/weapon/rack_parts(loc) - density = 0 - del(src) - - -/obj/structure/rack/attack_animal(mob/living/simple_animal/user) - if(user.wall_smash) - visible_message("[user] smashes [src] apart!") - new /obj/item/weapon/rack_parts(loc) - density = 0 - del(src) - -/obj/structure/rack/attack_tk() // no telehulk sorry - return diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 37e019963fc..3d8b13ff08b 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -42,7 +42,7 @@ return -/obj/structure/dispenser/attackby(obj/item/I as obj, mob/user as mob) +/obj/structure/dispenser/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/tank/oxygen) || istype(I, /obj/item/weapon/tank/air) || istype(I, /obj/item/weapon/tank/anesthetic)) if(oxygentanks < 10) user.drop_item() diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm index 1e9ac37a558..08bcc985611 100644 --- a/code/game/objects/structures/target_stake.dm +++ b/code/game/objects/structures/target_stake.dm @@ -18,7 +18,7 @@ pinned_target = null density = 1 - attackby(obj/item/W as obj, mob/user as mob) + attackby(obj/item/W as obj, mob/user as mob, params) // Putting objects on the stake. Most importantly, targets if(pinned_target) return // get rid of that pinned target first! diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm index c1026c4e207..4806844ac4d 100644 --- a/code/game/objects/structures/transit_tubes/station.dm +++ b/code/game/objects/structures/transit_tubes/station.dm @@ -67,7 +67,7 @@ break -/obj/structure/transit_tube/station/attackby(obj/item/W, mob/user) +/obj/structure/transit_tube/station/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/grab) && icon_state == "open") var/obj/item/weapon/grab/G = W if(ismob(G.affecting) && G.state >= GRAB_AGGRESSIVE) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index c3032dbe840..74e351702ac 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -42,7 +42,7 @@ /obj/structure/toilet/update_icon() icon_state = "toilet[open][cistern]" -/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob) +/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob, params) if(istype(I, /obj/item/weapon/crowbar)) user << "You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]." playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1) @@ -99,7 +99,7 @@ density = 0 anchored = 1 -/obj/structure/urinal/attackby(obj/item/I as obj, mob/user as mob) +/obj/structure/urinal/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = I if(isliving(G.affecting)) @@ -149,7 +149,7 @@ for (var/atom/movable/G in src.loc) G.clean_blood() -/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob, params) if(I.type == /obj/item/device/analyzer) user << "The water temperature seems to be [watertemp]." if(istype(I, /obj/item/weapon/wrench)) @@ -360,7 +360,7 @@ V.show_message("\blue [user] washes their hands using \the [src].") -/obj/structure/sink/attackby(obj/item/O as obj, mob/user as mob) +/obj/structure/sink/attackby(obj/item/O as obj, mob/user as mob, params) if(busy) user << "\red Someone's already washing here." return @@ -424,7 +424,7 @@ ..() icon_state = "puddle" -/obj/structure/sink/puddle/attackby(obj/item/O as obj, mob/user as mob) +/obj/structure/sink/puddle/attackby(obj/item/O as obj, mob/user as mob, params) icon_state = "puddle-splash" ..() icon_state = "puddle" diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 20569ee7af8..b41b5be8afc 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -57,7 +57,7 @@ obj/structure/windoor_assembly/Destroy() return 1 -/obj/structure/windoor_assembly/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/windoor_assembly/attackby(obj/item/W as obj, mob/user as mob, params) //I really should have spread this out across more states but thin little windoors are hard to sprite. add_fingerprint(user) switch(state) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 8cdc2666bc2..3882da9cef3 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -153,7 +153,7 @@ var/global/wcColored /obj/structure/window/attack_hand(mob/user as mob) - if(M_HULK in user.mutations) + if(HULK in user.mutations) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!")) user.visible_message("[user] smashes through [src]!") var/pdiff=performWallPressureCheck(src.loc) @@ -162,11 +162,13 @@ var/global/wcColored log_admin("Window destroyed by hulk [user.real_name] ([user.ckey]) with pdiff [pdiff] at [loc]!") destroy() else if (usr.a_intent == "harm") + user.changeNext_move(CLICK_CD_MELEE) playsound(get_turf(src), 'sound/effects/glassknock.ogg', 80, 1) usr.visible_message("\red [usr.name] bangs against the [src.name]!", \ "\red You bang against the [src.name]!", \ "You hear a banging sound.") else + user.changeNext_move(CLICK_CD_MELEE) playsound(src.loc, 'sound/effects/glassknock.ogg', 80, 1) usr.visible_message("[usr.name] knocks on the [src.name].", \ "You knock on the [src.name].", \ @@ -177,7 +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]!") @@ -190,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, params) 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 @@ -279,7 +283,7 @@ var/global/wcColored continue if(G.amount>=G.max_amount) continue - G.attackby(NG, user) + G.attackby(NG, user, params) if (reinf) var/obj/item/stack/rods/NR = new (src.loc) @@ -288,7 +292,7 @@ var/global/wcColored continue if(R.amount>=R.max_amount) continue - R.attackby(NR, user) + R.attackby(NR, user, params) user << "You have disassembled the window." disassembled = 1 @@ -298,6 +302,7 @@ var/global/wcColored del(src) else if(W.damtype == BRUTE || W.damtype == BURN) + user.changeNext_move(CLICK_CD_MELEE) hit(W.force) if(health <= 7) anchored = 0 diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 9f938b58a3d..bf1b9577b21 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -494,7 +494,7 @@ var/list/mechtoys = list( onclose(user, "computer") return -/obj/machinery/computer/supplycomp/attackby(I as obj, user as mob) +/obj/machinery/computer/supplycomp/attackby(I as obj, user as mob, params) if(istype(I,/obj/item/weapon/card/emag) && !hacked) user << "\blue Special supplies unlocked." hacked = 1 diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 3691f877890..0aae7a28e69 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -457,7 +457,7 @@ turf/simulated/floor/proc/update_icon() update_icon() levelupdate() -/turf/simulated/floor/attackby(obj/item/C as obj, mob/user as mob) +/turf/simulated/floor/attackby(obj/item/C as obj, mob/user as mob, params) if(!C || !user) return 0 diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index cd139319e7e..9f1288de647 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -51,7 +51,7 @@ thermal_conductivity = 0.025 heat_capacity = 325000 -/turf/simulated/floor/engine/attackby(obj/item/weapon/C as obj, mob/user as mob) +/turf/simulated/floor/engine/attackby(obj/item/weapon/C as obj, mob/user as mob, params) if(!C) return if(!user) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 4fbe7180941..afbcc4b74be 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -240,8 +240,10 @@ //Interactions -/turf/simulated/wall/attack_paw(mob/user as mob) - if ((M_HULK in user.mutations)) +/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!" )) @@ -255,6 +257,8 @@ return src.attack_hand(user) /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) @@ -269,7 +273,8 @@ return /turf/simulated/wall/attack_hand(mob/user as mob) - if (M_HULK in user.mutations) + user.changeNext_move(CLICK_CD_MELEE) + if (HULK in user.mutations) if (prob(40) || rotting) user << text("\blue You smash through the wall.") user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) @@ -290,8 +295,8 @@ src.add_fingerprint(user) return -/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob) - +/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob, params) + user.changeNext_move(CLICK_CD_MELEE) if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") user << "You don't have the dexterity to do this!" return diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm index 0de4efd3db7..6f0e99475ab 100644 --- a/code/game/turfs/simulated/walls_mineral.dm +++ b/code/game/turfs/simulated/walls_mineral.dm @@ -68,7 +68,7 @@ radiate() ..() -/turf/simulated/wall/mineral/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob) +/turf/simulated/wall/mineral/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob, params) radiate() ..() @@ -83,7 +83,7 @@ walltype = "plasma" mineral = "plasma" -/turf/simulated/wall/mineral/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob) +/turf/simulated/wall/mineral/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(is_hot(W) > 300)//If the temperature of the object is over 300, then ignite ignite(is_hot(W)) return @@ -139,7 +139,7 @@ else return 0 -/turf/simulated/wall/mineral/proc/attackby(obj/item/weapon/W as obj, mob/user as mob) +/turf/simulated/wall/mineral/proc/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if((mineral == "gold") || (mineral == "silver")) if(shocked) shock() diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index dd9736d3685..9514e9c7afd 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -13,7 +13,7 @@ var/d_state = 0 /turf/simulated/wall/r_wall/attack_hand(mob/user as mob) - if (M_HULK in user.mutations) + if (HULK in user.mutations) if (prob(10) || rotting) usr << text("\blue You smash through the wall.") usr.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) @@ -33,7 +33,7 @@ return -/turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob) +/turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob, params) if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") user << "You don't have the dexterity to do this!" diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 0979d4fc002..6768fdf3afd 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -31,7 +31,7 @@ step(user.pulling, get_dir(user.pulling.loc, src)) return -/turf/space/attackby(obj/item/C as obj, mob/user as mob) +/turf/space/attackby(obj/item/C as obj, mob/user as mob, params) if (istype(C, /obj/item/stack/rods)) var/obj/item/stack/rods/R = C diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm index d84b33dbfe9..1d3bcac2384 100644 --- a/code/game/turfs/space/transit.dm +++ b/code/game/turfs/space/transit.dm @@ -2,7 +2,7 @@ var/pushdirection // push things that get caught in the transit tile this direction //Overwrite because we dont want people building rods in space. -/turf/space/transit/attackby(obj/O as obj, mob/user as mob) +/turf/space/transit/attackby(obj/O as obj, mob/user as mob, params) return /turf/space/transit/north // moving to the north diff --git a/code/game/vehicles/spacepods/construction.dm b/code/game/vehicles/spacepods/construction.dm index c1a68f9fa2f..aac72fc0e99 100644 --- a/code/game/vehicles/spacepods/construction.dm +++ b/code/game/vehicles/spacepods/construction.dm @@ -19,7 +19,7 @@ dir = EAST -/obj/structure/spacepod_frame/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/spacepod_frame/attackby(obj/item/W as obj, mob/user as mob, params) if(!construct || !construct.action(W, user)) ..() return diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index 55a748b26c3..a1195a22868 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -158,7 +158,7 @@ if(prob(40)) deal_damage(50) -/obj/spacepod/attackby(obj/item/W as obj, mob/user as mob) +/obj/spacepod/attackby(obj/item/W as obj, mob/user as mob, params) if(iscrowbar(W)) hatch_open = !hatch_open playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) diff --git a/code/game/verbs/atom_verbs.dm b/code/game/verbs/atom_verbs.dm index 34b6e2cad71..aa55f33da0a 100644 --- a/code/game/verbs/atom_verbs.dm +++ b/code/game/verbs/atom_verbs.dm @@ -29,7 +29,7 @@ return var/P = new /obj/effect/decal/point(tile) - usr.next_move = world.time + 10 + usr.changeNext_move(CLICK_CD_POINT) spawn (20) if(P) del(P) diff --git a/code/global.dm b/code/global.dm index 1c292b17a2b..4859d6a2a01 100644 --- a/code/global.dm +++ b/code/global.dm @@ -194,7 +194,6 @@ var/list/reverse_dir = list(2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 3 var/datum/station_state/start_state = null var/datum/configuration/config = null -var/datum/sun/sun = null var/list/combatlog = list() var/list/IClog = list() diff --git a/code/modules/DetectiveWork/evidence.dm b/code/modules/DetectiveWork/evidence.dm index 807c6138406..e2cf4ba6931 100644 --- a/code/modules/DetectiveWork/evidence.dm +++ b/code/modules/DetectiveWork/evidence.dm @@ -13,7 +13,7 @@ return evidencebagEquip(I, user) -/obj/item/weapon/evidencebag/attackby(obj/item/I, mob/user) +/obj/item/weapon/evidencebag/attackby(obj/item/I, mob/user, params) if(evidencebagEquip(I, user)) return 1 diff --git a/code/modules/admin/verbs/honksquad.dm b/code/modules/admin/verbs/honksquad.dm index a56d6cd091f..5583b36435b 100644 --- a/code/modules/admin/verbs/honksquad.dm +++ b/code/modules/admin/verbs/honksquad.dm @@ -119,7 +119,7 @@ var/global/sent_honksquad = 0 equip_to_slot_or_del(new /obj/item/toy/crayon/rainbow(src), slot_in_backpack) equip_to_slot_or_del(new /obj/item/weapon/gun/energy/clown(src), slot_in_backpack) equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/spray/waterflower(src), slot_in_backpack) - src.mutations.Add(M_CLUMSY) + src.mutations.Add(CLUMSY) diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 5e7cc3461ba..913c8f46194 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -119,7 +119,7 @@ return 0 - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(isassembly(W)) var/obj/item/device/assembly/A = W if((!A.secured) && (!secured)) diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index 2137d8b72c6..9d028acf4a2 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -23,9 +23,9 @@ overlays += bombassembly.overlays overlays += "bomb_assembly" -/obj/item/device/onetankbomb/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/onetankbomb/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/device/analyzer)) - bombtank.attackby(W, user) + bombtank.attackby(W, user, params) return if(istype(W, /obj/item/weapon/wrench) && !status) //This is basically bomb assembly code inverted. apparently it works. diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index a39cd4dc97b..127f3c5d9ca 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -130,7 +130,7 @@ return - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/screwdriver)) if(!a_left || !a_right) user << "\red BUG:Assembly part missing, please report this!" diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index a7ac697ad8f..507f879cca4 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -19,7 +19,7 @@ if(!armed) if(ishuman(usr)) var/mob/living/carbon/human/user = usr - if(((user.getBrainLoss() >= 60 || (M_CLUMSY in user.mutations)) && prob(50))) + if(((user.getBrainLoss() >= 60 || (CLUMSY in user.mutations)) && prob(50))) user << "Your hand slips, setting off the trigger." pulse(0) update_icon() @@ -69,7 +69,7 @@ if(!armed) user << "You arm [src]." else - if(((user.getBrainLoss() >= 60 || (M_CLUMSY in user.mutations)) && prob(50))) + if(((user.getBrainLoss() >= 60 || (CLUMSY in user.mutations)) && prob(50))) var/which_hand = "l_hand" if(!user.hand) which_hand = "r_hand" @@ -85,7 +85,7 @@ attack_hand(mob/living/user as mob) if(armed) - if(((user.getBrainLoss() >= 60 || M_CLUMSY in user.mutations)) && prob(50)) + if(((user.getBrainLoss() >= 60 || CLUMSY in user.mutations)) && prob(50)) var/which_hand = "l_hand" if(!user.hand) which_hand = "r_hand" diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index 20a606113b2..53bbd47beca 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -15,7 +15,7 @@ ..() return -/obj/item/assembly/shock_kit/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/assembly/shock_kit/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench) && !status) var/turf/T = loc if(ismob(T)) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index 859242947a9..ca47ab1afc7 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -137,7 +137,7 @@ obj/machinery/gateway/centerstation/process() return -/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob) +/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob, params) if(istype(W,/obj/item/device/multitool)) user << "\black The gate is already calibrated, there is no work for you to do here." return @@ -234,7 +234,7 @@ obj/machinery/gateway/centerstation/process() M.dir = SOUTH -/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob) +/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob, params) if(istype(W,/obj/item/device/multitool)) if(calibrated) user << "\black The gate is already calibrated, there is no work for you to do here." diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 3a91028f2df..180fbf7a331 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -77,9 +77,9 @@ if("Power") user << "Your wish is granted, but at a terrible cost..." user << "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart." - user.mutations.Add(M_LASER) - user.mutations.Add(M_RESIST_COLD) - user.mutations.Add(M_XRAY) + user.mutations.Add(LASER) + user.mutations.Add(RESIST_COLD) + user.mutations.Add(XRAY) user.dna.mutantrace = "shadow" user.regenerate_icons() if("Wealth") diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index dfb6b4092d2..f86d222a4a4 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1464,8 +1464,8 @@ datum/preferences else continue if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT)//character.species.flags & CAN_BE_FAT) - character.mutations += M_FAT - character.mutations += M_OBESITY + character.mutations += FAT + character.mutations += OBESITY if(disabilities & DISABILITY_FLAG_NEARSIGHTED) character.disabilities|=NEARSIGHTED if(disabilities & DISABILITY_FLAG_EPILEPTIC) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index fd68636f599..17438defd0c 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -160,7 +160,7 @@ BLIND // can't see anything var/clipped = 0 species_restricted = list("exclude","Unathi","Tajaran") -/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user) +/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/wirecutters)) if(clipped == 0) playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) @@ -344,7 +344,7 @@ BLIND // can't see anything if (AC.slot == A.slot) return 0 -/obj/item/clothing/under/attackby(obj/item/I, mob/user) +/obj/item/clothing/under/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/clothing/accessory)) var/obj/item/clothing/accessory/A = I if(can_attach_accessory(A)) @@ -362,7 +362,7 @@ BLIND // can't see anything if(accessories.len) for(var/obj/item/clothing/accessory/A in accessories) - A.attackby(I, user) + A.attackby(I, user, params) return ..() diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index dc584be1e73..84a5e7b77b8 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -158,7 +158,7 @@ /obj/item/clothing/mask/gas/sechailer/hos icon_state = "hosmask" -/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/screwdriver)) switch(aggressiveness) if(1) diff --git a/code/modules/clothing/shoes/colour.dm b/code/modules/clothing/shoes/colour.dm index 2b64c59906b..ef92c5837df 100644 --- a/code/modules/clothing/shoes/colour.dm +++ b/code/modules/clothing/shoes/colour.dm @@ -97,7 +97,7 @@ src.icon_state = "orange" return -/obj/item/clothing/shoes/orange/attackby(H as obj, loc) +/obj/item/clothing/shoes/orange/attackby(H as obj, loc, params) ..() if ((istype(H, /obj/item/weapon/restraints/handcuffs) && !( src.chained ))) //H = null diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 5bc1ecaf5ab..0c83d8e7464 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -174,7 +174,7 @@ var/global/list/breach_burn_descriptors = list( //Handles repairs (and also upgrades). -/obj/item/clothing/suit/space/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/clothing/suit/space/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/stack/sheet/mineral/plastic) || istype(W,/obj/item/stack/sheet/metal)) if(istype(src.loc,/mob/living)) diff --git a/code/modules/clothing/spacesuits/rig.dm b/code/modules/clothing/spacesuits/rig.dm index 9dfb334931a..127cc7c3bf6 100644 --- a/code/modules/clothing/spacesuits/rig.dm +++ b/code/modules/clothing/spacesuits/rig.dm @@ -221,7 +221,7 @@ helmet.flags |= NODROP H << "\blue You deploy your hardsuit helmet, sealing you off from the world." -/obj/item/clothing/suit/space/rig/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/clothing/suit/space/rig/attackby(obj/item/W as obj, mob/user as mob, params) if(!istype(user,/mob/living)) return diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm index c3b5c6f616a..12c21e2a70e 100644 --- a/code/modules/clothing/suits/storage.dm +++ b/code/modules/clothing/suits/storage.dm @@ -16,9 +16,9 @@ if (pockets.handle_mousedrop(usr, over_object)) ..(over_object) -/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob, params) ..() - pockets.attackby(W, user) + pockets.attackby(W, user, params) /obj/item/clothing/suit/storage/emp_act(severity) pockets.emp_act(severity) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 9ba54e57306..ee6800f4c18 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -35,7 +35,7 @@ src.add_fingerprint(user) //default attackby behaviour -/obj/item/clothing/accessory/attackby(obj/item/I, mob/user) +/obj/item/clothing/accessory/attackby(obj/item/I, mob/user, params) ..() //default attack_hand behaviour @@ -188,7 +188,7 @@ if(isliving(user)) user.visible_message("\red [user] displays their NanoTrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.","\red You display your NanoTrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.") -/obj/item/clothing/accessory/holobadge/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/item/clothing/accessory/holobadge/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda)) var/obj/item/weapon/card/id/id_card = null diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index a009c662f4f..3d61a789742 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -70,7 +70,7 @@ ..(user) -/obj/item/clothing/accessory/holster/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/clothing/accessory/holster/attackby(obj/item/W as obj, mob/user as mob, params) holster(W, user) /obj/item/clothing/accessory/holster/emp_act(severity) diff --git a/code/modules/clothing/under/accessories/storage.dm b/code/modules/clothing/under/accessories/storage.dm index caa7638befd..d33d5e9a263 100644 --- a/code/modules/clothing/under/accessories/storage.dm +++ b/code/modules/clothing/under/accessories/storage.dm @@ -29,8 +29,8 @@ if (hold.handle_mousedrop(usr, over_object)) ..(over_object) -/obj/item/clothing/accessory/storage/attackby(obj/item/W as obj, mob/user as mob) - return hold.attackby(W, user) +/obj/item/clothing/accessory/storage/attackby(obj/item/W as obj, mob/user as mob, params) + return hold.attackby(W, user, params) /obj/item/clothing/accessory/storage/emp_act(severity) hold.emp_act(severity) diff --git a/code/modules/clothing/under/chameleon.dm b/code/modules/clothing/under/chameleon.dm index 21147299397..3e51b7b267e 100644 --- a/code/modules/clothing/under/chameleon.dm +++ b/code/modules/clothing/under/chameleon.dm @@ -21,7 +21,7 @@ return - attackby(obj/item/clothing/under/U as obj, mob/user as mob) + attackby(obj/item/clothing/under/U as obj, mob/user as mob, params) ..() if(istype(U, /obj/item/clothing/under/chameleon)) user << "\red Nothing happens." diff --git a/code/modules/computer3/buildandrepair.dm b/code/modules/computer3/buildandrepair.dm index d525f40a73e..277d0f538c8 100644 --- a/code/modules/computer3/buildandrepair.dm +++ b/code/modules/computer3/buildandrepair.dm @@ -76,7 +76,7 @@ completed = /obj/machinery/computer3/laptop max_components = 3 -/obj/structure/computer3frame/attackby(obj/item/P as obj, mob/user as mob) +/obj/structure/computer3frame/attackby(obj/item/P as obj, mob/user as mob, params) switch(state) if(0) if(istype(P, /obj/item/weapon/wrench)) diff --git a/code/modules/computer3/component.dm b/code/modules/computer3/component.dm index ca4639c73bd..739c2472e4c 100644 --- a/code/modules/computer3/component.dm +++ b/code/modules/computer3/component.dm @@ -24,7 +24,7 @@ // If the computer is attacked by an item it will reference this to decide which peripheral(s) are affected. var/list/attackby_types = list() - proc/allow_attackby(var/obj/item/I as obj,var/mob/user as mob) + proc/allow_attackby(var/obj/item/I as obj,var/mob/user as mob, params) for(var/typekey in attackby_types) if(istype(I,typekey)) @@ -60,7 +60,7 @@ return ..() - attackby(obj/I as obj,mob/user as mob) + attackby(obj/I as obj,mob/user as mob, params) if(computer && !computer.stat) if(istype(I, /obj/item/device/aicard)) I:transfer_ai("AIFIXER","AICARD",src,user) @@ -94,7 +94,7 @@ usr << "You are unable to insert \the card, as the reader slot is occupied" return 0 - attackby(var/obj/item/I as obj, var/mob/user as mob) + attackby(var/obj/item/I as obj, var/mob/user as mob, params) if(istype(I,/obj/item/weapon/card)) insert(I) return diff --git a/code/modules/computer3/computer.dm b/code/modules/computer3/computer.dm index 796dee7cd95..9ea3bff1b36 100644 --- a/code/modules/computer3/computer.dm +++ b/code/modules/computer3/computer.dm @@ -317,7 +317,7 @@ if(os) os.error = BUSTED_ASS_COMPUTER - attackby(I as obj, mob/user as mob) + attackby(I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/screwdriver) && allow_disassemble) disassemble(user) return @@ -341,7 +341,7 @@ P = input(user,"Which component?") as null|anything in p_list if(P) - P.attackby(I,user) + P.attackby(I,user, params) return ..() diff --git a/code/modules/computer3/computers/law.dm b/code/modules/computer3/computers/law.dm index 409552cc79a..3d0cd0eb23e 100644 --- a/code/modules/computer3/computers/law.dm +++ b/code/modules/computer3/computers/law.dm @@ -24,7 +24,7 @@ return - attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) + attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params) if (user.z > 6) user << "\red Unable to establish a connection: \black You're too far away from the station!" return @@ -60,7 +60,7 @@ var/mob/living/silicon/robot/current = null - attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) + attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params) if(istype(module, /obj/item/weapon/aiModule)) module.install(src) else diff --git a/code/modules/computer3/computers/prisonshuttle.dm b/code/modules/computer3/computers/prisonshuttle.dm index f6f246e5784..e091c4dd5f5 100644 --- a/code/modules/computer3/computers/prisonshuttle.dm +++ b/code/modules/computer3/computers/prisonshuttle.dm @@ -22,7 +22,7 @@ var/prison_shuttle_timeleft = 0 var/prison_break = 0 - attackby(I as obj, user as mob) + attackby(I as obj, user as mob, params) return src.attack_hand(user) @@ -34,7 +34,7 @@ var/prison_shuttle_timeleft = 0 return src.attack_hand(user) - attackby(I as obj, user as mob) + attackby(I as obj, user as mob, params) if(istype(I, /obj/item/tool/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/modules/computer3/computers/shuttle.dm b/code/modules/computer3/computers/shuttle.dm index 9f0619ce321..37c5291bada 100644 --- a/code/modules/computer3/computers/shuttle.dm +++ b/code/modules/computer3/computers/shuttle.dm @@ -11,7 +11,7 @@ var/list/authorized = list( ) - attackby(var/obj/item/card/W as obj, var/mob/user as mob) + attackby(var/obj/item/card/W as obj, var/mob/user as mob, params) if(stat & (BROKEN|NOPOWER)) return if ((!( istype(W, /obj/item/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return if (istype(W, /obj/item/card/id)||istype(W, /obj/item/device/pda)) diff --git a/code/modules/computer3/computers/specops_shuttle.dm b/code/modules/computer3/computers/specops_shuttle.dm index 81c94614cf0..409246b9c8a 100644 --- a/code/modules/computer3/computers/specops_shuttle.dm +++ b/code/modules/computer3/computers/specops_shuttle.dm @@ -159,7 +159,7 @@ var/specops_shuttle_timeleft = 0 if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return 0 else return 1 -/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob) +/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params) return attack_hand(user) /obj/machinery/computer3/specops_shuttle/attack_ai(var/mob/user as mob) @@ -168,7 +168,7 @@ var/specops_shuttle_timeleft = 0 /obj/machinery/computer3/specops_shuttle/attack_paw(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob) +/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params) if(istype(I,/obj/item/card/emag)) user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals." else diff --git a/code/modules/computer3/computers/syndicate_shuttle.dm b/code/modules/computer3/computers/syndicate_shuttle.dm index ccd711788b3..1b4d35456c7 100644 --- a/code/modules/computer3/computers/syndicate_shuttle.dm +++ b/code/modules/computer3/computers/syndicate_shuttle.dm @@ -36,7 +36,7 @@ return 1 -/obj/machinery/computer3/syndicate_station/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/computer3/syndicate_station/attackby(obj/item/I as obj, mob/user as mob, params) return attack_hand(user) /obj/machinery/computer3/syndicate_station/attack_ai(mob/user as mob) diff --git a/code/modules/computer3/computers/syndicate_specops_shuttle.dm b/code/modules/computer3/computers/syndicate_specops_shuttle.dm index 61dc0ba975b..2e9b4bc1842 100644 --- a/code/modules/computer3/computers/syndicate_specops_shuttle.dm +++ b/code/modules/computer3/computers/syndicate_specops_shuttle.dm @@ -172,7 +172,7 @@ var/syndicate_elite_shuttle_timeleft = 0 if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0 else return 1 -/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob) +/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params) return attack_hand(user) /obj/machinery/computer3/syndicate_elite_shuttle/attack_ai(var/mob/user as mob) @@ -181,7 +181,7 @@ var/syndicate_elite_shuttle_timeleft = 0 /obj/machinery/computer3/syndicate_elite_shuttle/attack_paw(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob) +/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params) if(istype(I,/obj/item/card/emag)) user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals." else diff --git a/code/modules/computer3/lapvend.dm b/code/modules/computer3/lapvend.dm index 8979d4c1c2f..4188e3a55e8 100644 --- a/code/modules/computer3/lapvend.dm +++ b/code/modules/computer3/lapvend.dm @@ -37,7 +37,7 @@ return -/obj/machinery/lapvend/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/lapvend/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(vendmode == 1) if(istype(W, /obj/item/weapon/card)) var/obj/item/weapon/card/I = W diff --git a/code/modules/computer3/program.dm b/code/modules/computer3/program.dm index 74083b8ffde..e7c1afd082f 100644 --- a/code/modules/computer3/program.dm +++ b/code/modules/computer3/program.dm @@ -85,7 +85,7 @@ Programs are a file that can be executed */ -/datum/file/program/proc/attackby(O as obj, user as mob) +/datum/file/program/proc/attackby(O as obj, user as mob, params) return /* diff --git a/code/modules/computer3/storage.dm b/code/modules/computer3/storage.dm index acf9a76288f..3fe8279fad7 100644 --- a/code/modules/computer3/storage.dm +++ b/code/modules/computer3/storage.dm @@ -114,7 +114,7 @@ inserted = null - attackby(obj/O as obj, mob/user as mob) + attackby(obj/O as obj, mob/user as mob, params) if(inserted && istype(O,/obj/item/weapon/pen)) usr << "You use [O] to carefully pry [inserted] out of [src]." eject_disk(forced = 1) diff --git a/code/modules/crafting/guncrafting.dm b/code/modules/crafting/guncrafting.dm index a466b2431d6..e29a1b47e64 100644 --- a/code/modules/crafting/guncrafting.dm +++ b/code/modules/crafting/guncrafting.dm @@ -18,7 +18,7 @@ // CRAFTING // -/obj/item/weaponcrafting/receiver/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weaponcrafting/receiver/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/pipe)) user << "You attach the shotgun barrel to the receiver. The pins seem loose." var/obj/item/weaponcrafting/ishotgunconstruction/I = new /obj/item/weaponcrafting/ishotgunconstruction @@ -36,7 +36,7 @@ icon = 'icons/obj/improvised.dmi' icon_state = "ishotgunstep1" -/obj/item/weaponcrafting/ishotgunconstruction/attackby(var/obj/item/I, mob/user as mob) +/obj/item/weaponcrafting/ishotgunconstruction/attackby(var/obj/item/I, mob/user as mob, params) ..() if(istype(I, /obj/item/weapon/screwdriver)) var/obj/item/weaponcrafting/ishotgunconstruction2/C = new /obj/item/weaponcrafting/ishotgunconstruction2 @@ -51,7 +51,7 @@ icon = 'icons/obj/improvised.dmi' icon_state = "ishotgunstep1" -/obj/item/weaponcrafting/ishotgunconstruction2/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weaponcrafting/ishotgunconstruction2/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weaponcrafting/stock)) user << "You attach the stock to the receiver-barrel assembly." var/obj/item/weaponcrafting/ishotgunconstruction3/I = new /obj/item/weaponcrafting/ishotgunconstruction3 @@ -67,7 +67,7 @@ icon = 'icons/obj/improvised.dmi' icon_state = "ishotgunstep2" -/obj/item/weaponcrafting/ishotgunconstruction3/attackby(var/obj/item/I, mob/user as mob) +/obj/item/weaponcrafting/ishotgunconstruction3/attackby(var/obj/item/I, mob/user as mob, params) ..() if(istype(I, /obj/item/stack/packageWrap)) var/obj/item/stack/packageWrap/C = I diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 590e90d9231..2641f0e4496 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -859,7 +859,7 @@ held.loc = get_turf(user) src.held = null -/obj/item/clothing/accessory/fluff/konaa_hirano/attackby(var/obj/item/O as obj, mob/user as mob) +/obj/item/clothing/accessory/fluff/konaa_hirano/attackby(var/obj/item/O as obj, mob/user as mob, params) if(istype(O,/obj/item/weapon/paper)) if(held) usr << "[src] already has something inside it." diff --git a/code/modules/destilery/main.dm b/code/modules/destilery/main.dm index ded080d2b12..808b74411c9 100644 --- a/code/modules/destilery/main.dm +++ b/code/modules/destilery/main.dm @@ -56,7 +56,7 @@ del(milled_item) busy = 0 -/obj/machinery/mill/attackby(var/obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/mill/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/reagent_containers/food)) user.unEquip(W) W.loc = src @@ -126,7 +126,7 @@ del(fermenting_item) busy = 0 -/obj/machinery/fermenter/attackby(var/obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/fermenter/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/reagent_containers/food)) user.unEquip(W) W.loc = src @@ -187,7 +187,7 @@ del(destilling_item) busy = 0 -/obj/machinery/still/attackby(var/obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/still/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/reagent_containers/food)) user.unEquip(W) W.loc = src @@ -272,7 +272,7 @@ output += spinning_item busy = 0 -/obj/machinery/centrifuge/attackby(var/obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/centrifuge/attackby(var/obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/reagent_containers/food)) user.unEquip(W) W.loc = src diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index f389f9c2863..fad9c88110b 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -85,7 +85,7 @@ log transactions linked_db = DB break -/obj/machinery/atm/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/atm/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/card)) var/obj/item/weapon/card/id/idcard = I if(!held_card) diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index e7c16540552..ddd432d3dfc 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -56,7 +56,7 @@ machine_id = "[station_name()] Acc. DB #[num_financial_terminals++]" ..() -/obj/machinery/account_database/attackby(obj/O, mob/user) +/obj/machinery/account_database/attackby(obj/O, mob/user, params) if(!istype(O, /obj/item/weapon/card/id)) return ..() diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index b0a412bfa12..a6c8a3e74a4 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -100,7 +100,7 @@ else user << browse(null,"window=eftpos") -/obj/item/device/eftpos/attackby(O as obj, user as mob) +/obj/item/device/eftpos/attackby(O as obj, user as mob, params) if(istype(O, /obj/item/weapon/card)) //attempt to connect to a new db, and if that doesn't work then fail if(!linked_db) diff --git a/code/modules/economy/POS.dm b/code/modules/economy/POS.dm index d4bbbb9abaa..7b1c885ff10 100644 --- a/code/modules/economy/POS.dm +++ b/code/modules/economy/POS.dm @@ -482,7 +482,7 @@ var/const/POS_HEADER = {" products[pid]=LI src.attack_hand(usr) -/obj/machinery/pos/attackby(var/atom/movable/A, var/mob/user) +/obj/machinery/pos/attackby(var/atom/movable/A, var/mob/user, params) if(istype(A,/obj/item/weapon/card/id)) var/obj/item/weapon/card/id/I = A if(!logged_in) diff --git a/code/modules/events/sayuevents/wormholes.dm b/code/modules/events/sayuevents/wormholes.dm index c31645d7a00..16daa8fe7c9 100644 --- a/code/modules/events/sayuevents/wormholes.dm +++ b/code/modules/events/sayuevents/wormholes.dm @@ -46,7 +46,7 @@ /obj/effect/portal/wormhole/attack_hand(mob/user) teleport(user) -/obj/effect/portal/wormhole/attackby(obj/item/I, mob/user) +/obj/effect/portal/wormhole/attackby(obj/item/I, mob/user, params) teleport(user) /obj/effect/portal/wormhole/teleport(atom/movable/M) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index bc39a2cbf00..19405dfaf06 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, params) + 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/food/cooker.dm b/code/modules/food/cooker.dm index 9dbe39fa93d..798d0d80f07 100644 --- a/code/modules/food/cooker.dm +++ b/code/modules/food/cooker.dm @@ -90,7 +90,7 @@ obj/machinery/cooker/proc/gettype() var/obj/item/weapon/reagent_containers/food/snacks/type = new(get_turf(src)) return type -obj/machinery/cooker/attackby(obj/item/I, mob/user) +obj/machinery/cooker/attackby(obj/item/I, mob/user, params) if(stat & (NOPOWER|BROKEN)) return if (!checkValid(I, user)) diff --git a/code/modules/food/customizables.dm b/code/modules/food/customizables.dm index 29f5ad2eed8..62148b5e613 100644 --- a/code/modules/food/customizables.dm +++ b/code/modules/food/customizables.dm @@ -1,31 +1,31 @@ -/obj/item/weapon/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user as mob, params) var/obj/item/weapon/reagent_containers/food/snacks/customizable/sandwich/S = new(get_turf(user)) - S.attackby(W,user) + S.attackby(W,user, params) qdel(src) -/obj/item/weapon/reagent_containers/food/snacks/bun/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/bun/attackby(obj/item/W as obj, mob/user as mob, params) var/obj/item/weapon/reagent_containers/food/snacks/customizable/burger/S = new(get_turf(user)) - S.attackby(W,user) + S.attackby(W,user, params) qdel(src) -/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough/attackby(obj/item/W as obj, mob/user as mob, params) if(!istype(W, /obj/item/weapon/kitchenknife)) //Ignore this if object is kitchen knife - make dough slices instead of kitchen knife pizza var/obj/item/weapon/reagent_containers/food/snacks/customizable/pizza/S = new(get_turf(user)) - S.attackby(W,user) + S.attackby(W,user, params) qdel(src) else //It's a kitchen knife. Go do the parent proc (slicing) ..() -/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti/attackby(obj/item/W as obj, mob/user as mob, params) var/obj/item/weapon/reagent_containers/food/snacks/customizable/pasta/S = new(get_turf(user)) - S.attackby(W,user) + S.attackby(W,user, params) qdel(src) -/obj/item/trash/plate/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/trash/plate/attackby(obj/item/W as obj, mob/user as mob, params) var/obj/item/weapon/reagent_containers/food/snacks/customizable/fullycustom/S = new(get_turf(user)) - S.attackby(W,user) + S.attackby(W,user, params) qdel(src) /obj/item/trash/bowl @@ -34,11 +34,11 @@ icon = 'icons/obj/food.dmi' icon_state = "soup" -/obj/item/trash/bowl/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/trash/bowl/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/)) var/obj/item/weapon/reagent_containers/food/snacks/customizable/soup/S = new(get_turf(user)) - S.attackby(W,user) + S.attackby(W,user, params) qdel(src) ..() @@ -311,7 +311,7 @@ basename = "burger" toptype = new /obj/item/weapon/reagent_containers/food/snacks/bun() -/obj/item/weapon/reagent_containers/food/snacks/customizable/attackby(obj/item/I, mob/user) +/obj/item/weapon/reagent_containers/food/snacks/customizable/attackby(obj/item/I, mob/user, params) if(src.contents.len > sandwich_limit) user << "If you put anything else in or on [src] it's going to make a mess." return diff --git a/code/modules/food/icecream_vat.dm b/code/modules/food/icecream_vat.dm index 17a2e505720..19101f5b8e1 100644 --- a/code/modules/food/icecream_vat.dm +++ b/code/modules/food/icecream_vat.dm @@ -29,7 +29,7 @@ R.my_atom = src -/obj/machinery/icemachine/attackby(obj/item/I, mob/user) +/obj/machinery/icemachine/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(beaker) user << "A container is already inside [src]." diff --git a/code/modules/food/oven.dm b/code/modules/food/oven.dm index f774c8ea7d0..fc081e8aa43 100644 --- a/code/modules/food/oven.dm +++ b/code/modules/food/oven.dm @@ -15,7 +15,7 @@ ..() updatefood() -/obj/machinery/cooking/attackby(obj/item/I, mob/user) +/obj/machinery/cooking/attackby(obj/item/I, mob/user, params) if(on) user << "The machine is already running." return @@ -41,7 +41,7 @@ else icon_state = "mixer_off" C.loc = get_turf(src) - C.attackby(F,user) + C.attackby(F,user, params) playsound(loc, 'sound/machines/ding.ogg', 50, 1) updatefood() return diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 60adf1e7046..ddde6434184 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -42,7 +42,7 @@ P.card_icon = "joker" cards += P -/obj/item/weapon/deck/attackby(obj/O as obj, mob/user as mob) +/obj/item/weapon/deck/attackby(obj/O as obj, mob/user as mob, params) if(istype(O,/obj/item/weapon/hand)) var/obj/item/weapon/hand/H = O for(var/datum/playingcard/P in H.cards) @@ -118,7 +118,7 @@ usr.visible_message("\The [usr] deals a card to \the [M].") H.throw_at(get_step(M,M.dir),10,1,H) -/obj/item/weapon/hand/attackby(obj/O as obj, mob/user as mob) +/obj/item/weapon/hand/attackby(obj/O as obj, mob/user as mob, params) if(istype(O,/obj/item/weapon/hand)) var/obj/item/weapon/hand/H = O for(var/datum/playingcard/P in H.cards) diff --git a/code/modules/hydroponics/grown_inedible.dm b/code/modules/hydroponics/grown_inedible.dm index 868b4b6c5e6..ba5147785ae 100644 --- a/code/modules/hydroponics/grown_inedible.dm +++ b/code/modules/hydroponics/grown_inedible.dm @@ -50,7 +50,7 @@ origin_tech = "materials=1" attack_verb = list("bashed", "battered", "bludgeoned", "whacked") - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || (istype(W, /obj/item/weapon/twohanded/fireaxe) && W:wielded) || istype(W, /obj/item/weapon/melee/energy)) user.show_message("You make planks out of \the [src]!", 1) for(var/i=0,i<2,i++) @@ -60,7 +60,7 @@ continue if(G.amount>=G.max_amount) continue - G.attackby(NG, user) + G.attackby(NG, user, params) usr << "You add the newly-formed wood to the stack. It now contains [NG.amount] planks." del(src) return @@ -201,7 +201,7 @@ throw_speed = 4 throw_range = 20 -/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/kitchenknife/ritual)) user << "You use [W] to fashion a pipe out of the corn cob!" diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 837abe7211a..e2416733cc3 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -82,7 +82,7 @@ visible_message("\icon[src] [src] beeps and spits out [loaded_disk].") loaded_disk = null -/obj/machinery/botany/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/botany/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/seeds)) if(seed) user << "There is already a seed loaded." diff --git a/code/modules/hydroponics/vines.dm b/code/modules/hydroponics/vines.dm index 085229d417c..26819b231d9 100644 --- a/code/modules/hydroponics/vines.dm +++ b/code/modules/hydroponics/vines.dm @@ -32,7 +32,7 @@ master.growth_queue -= src ..() -/obj/effect/plantsegment/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/effect/plantsegment/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (!W || !user || !W.type) return switch(W.type) if(/obj/item/weapon/circular_saw) del src diff --git a/code/modules/jungle/jungle_plants.dm b/code/modules/jungle/jungle_plants.dm index db0cc017b75..3bc0315c581 100644 --- a/code/modules/jungle/jungle_plants.dm +++ b/code/modules/jungle/jungle_plants.dm @@ -27,7 +27,7 @@ A.loc = get_turf(src) */ -/obj/structure/bush/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/structure/bush/attackby(var/obj/I as obj, var/mob/user as mob, params) //hatchets can clear away undergrowth if(istype(I, /obj/item/weapon/hatchet) && !stump) if(indestructable) diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index dde3571a6dd..9df91110429 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -28,7 +28,7 @@ I.loc = src update_icon() -/obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob) +/obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob, params) if(istype(O, /obj/item/weapon/book) || istype(O, /obj/item/weapon/spellbook)) user.drop_item() O.loc = src @@ -178,7 +178,7 @@ else user << "This book is completely blank!" -/obj/item/weapon/book/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/book/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(carved) if(!store) if(W.w_class < 3) diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 74436079af6..c9d656a05ff 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -237,7 +237,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f user << browse(dat, "window=library") onclose(user, "library") -/obj/machinery/librarycomp/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/librarycomp/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/barcodescanner)) var/obj/item/weapon/barcodescanner/scanner = W scanner.computer = src @@ -404,7 +404,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f density = 1 var/obj/item/weapon/book/cache // Last scanned book -/obj/machinery/libraryscanner/attackby(var/obj/O as obj, var/mob/user as mob) +/obj/machinery/libraryscanner/attackby(var/obj/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/book)) user.drop_item() O.loc = src @@ -454,7 +454,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f anchored = 1 density = 1 -/obj/machinery/bookbinder/attackby(var/obj/O as obj, var/mob/user as mob) +/obj/machinery/bookbinder/attackby(var/obj/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/paper)) user.drop_item() O.loc = src diff --git a/code/modules/media/broadcast/transmitters/broadcast.dm b/code/modules/media/broadcast/transmitters/broadcast.dm index 772003efd0e..63e7c933f4e 100644 --- a/code/modules/media/broadcast/transmitters/broadcast.dm +++ b/code/modules/media/broadcast/transmitters/broadcast.dm @@ -48,7 +48,7 @@ broadcast() // Bzzt /* -/obj/machinery/media/transmitter/broadcast/attackby(var/obj/item/W, mob/user) +/obj/machinery/media/transmitter/broadcast/attackby(var/obj/item/W, mob/user, params) if(istype(W, /obj/item/device/multitool)) update_multitool_menu(user) return 1 diff --git a/code/modules/media/jukebox.dm b/code/modules/media/jukebox.dm index 3605e929f7c..e0fbf78ca6d 100644 --- a/code/modules/media/jukebox.dm +++ b/code/modules/media/jukebox.dm @@ -155,7 +155,7 @@ var/global/loopModeNames=list( popup.open() -/obj/machinery/media/jukebox/attackby(obj/item/W, mob/user) +/obj/machinery/media/jukebox/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/card/emag)) current_song=0 if(!emagged) diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm index c11f66cd196..7ca5d9496d7 100644 --- a/code/modules/mining/abandonedcrates.dm +++ b/code/modules/mining/abandonedcrates.dm @@ -91,7 +91,7 @@ else return ..() -/obj/structure/closet/crate/secure/loot/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/closet/crate/secure/loot/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(locked) if (istype(W, /obj/item/weapon/card/emag)) user << "The crate unlocks!" diff --git a/code/modules/mining/coins.dm b/code/modules/mining/coins.dm index a65916bff65..cc1e966ff46 100644 --- a/code/modules/mining/coins.dm +++ b/code/modules/mining/coins.dm @@ -75,7 +75,7 @@ credits = 20 -/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CC = W if(string_attached) diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 4b6f63445d6..7732e622cbf 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -140,7 +140,7 @@ /obj/machinery/mining/drill/attack_ai(var/mob/user as mob) return src.attack_hand(user) -/obj/machinery/mining/drill/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/mining/drill/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/screwdriver)) if(active) return open = !open @@ -323,7 +323,7 @@ icon_state = "mining_brace" var/obj/machinery/mining/drill/connected -/obj/machinery/mining/brace/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/mining/brace/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/wrench)) if(istype(get_turf(src),/turf/space)) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 82bc3a0f287..61569fb57d5 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -228,7 +228,7 @@ updateUsrDialog() return -/obj/machinery/mineral/equipment_locker/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/mineral/equipment_locker/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/mining_voucher)) RedeemVoucher(I, user) return @@ -285,7 +285,7 @@ icon_state = "data" var/points = 500 -/obj/item/weapon/card/mining_point_card/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/card/mining_point_card/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/card/id)) if(points) var/obj/item/weapon/card/id/C = I @@ -484,7 +484,7 @@ projectilesound = 'sound/weapons/Gunshot4.ogg' wanted_objects = list(/obj/item/weapon/ore) -/mob/living/simple_animal/hostile/mining_drone/attackby(obj/item/I as obj, mob/user as mob) +/mob/living/simple_animal/hostile/mining_drone/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/W = I if(W.welding && !stat) diff --git a/code/modules/mining/laborcamp/laborshuttle.dm b/code/modules/mining/laborcamp/laborshuttle.dm index c9926d429a6..4b293e71350 100644 --- a/code/modules/mining/laborcamp/laborshuttle.dm +++ b/code/modules/mining/laborcamp/laborshuttle.dm @@ -99,7 +99,7 @@ proc/move_labor_shuttle() //TODO: Security Access only; add moving the shuttle t else usr << "\blue Shuttle is already moving." -/obj/machinery/computer/labor_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/computer/labor_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/card/emag)) src.req_access = list() diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index facaf65c5da..e4abfbdbcbc 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -61,7 +61,7 @@ user << browse("[dat]", "window=console_stacking_machine") -/obj/machinery/mineral/labor_claim_console/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/mineral/labor_claim_console/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/card/id)) return attack_hand(user) ..() @@ -181,7 +181,7 @@ /obj/machinery/mineral/labor_points_checker/attack_hand(mob/user) user.examine(src) -/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/card/id)) if(istype(I, /obj/item/weapon/card/id/prisoner)) var/obj/item/weapon/card/id/prisoner/prisoner_id = I diff --git a/code/modules/mining/manufacturing.dm b/code/modules/mining/manufacturing.dm index fe86109a3da..52274b0ea32 100644 --- a/code/modules/mining/manufacturing.dm +++ b/code/modules/mining/manufacturing.dm @@ -293,7 +293,7 @@ src.updateUsrDialog() - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) var/load = 0 if(istype(W, /obj/item/weapon/ore/)) for(var/mob/O in viewers(user, null)) O.show_message(text("\blue [] loads [] into the [].", user, W, src), 1) diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index da0857c652e..8ab42b7ae1c 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -103,7 +103,7 @@ scan_state = "rock_[mineral.name][rand(1,3)]" //Not even going to touch this pile of spaghetti - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") usr << "\red You don't have the dexterity to do this!" @@ -420,7 +420,7 @@ gets_dug() return -/turf/simulated/floor/plating/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob) +/turf/simulated/floor/plating/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(!W || !user) return 0 diff --git a/code/modules/mining/money_bag.dm b/code/modules/mining/money_bag.dm index 0c4d84c00d9..3b94f63673b 100644 --- a/code/modules/mining/money_bag.dm +++ b/code/modules/mining/money_bag.dm @@ -72,7 +72,7 @@ */ user << browse("[dat]", "window=moneybag") -/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if (istype(W, /obj/item/weapon/coin)) var/obj/item/weapon/coin/C = W diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm index 866b46bae50..78e0509cc0c 100644 --- a/code/modules/mining/ore.dm +++ b/code/modules/mining/ore.dm @@ -86,7 +86,7 @@ pixel_y = rand(0,8)-8 if(src.z == ASTEROID_Z) score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet) -/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/device/core_sampler)) var/obj/item/device/core_sampler/C = W C.sample_item(src, user) diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm index fe6f8851b23..ddb82b4f6e4 100644 --- a/code/modules/mining/satchel_ore_boxdm.dm +++ b/code/modules/mining/satchel_ore_boxdm.dm @@ -18,7 +18,7 @@ var/amt_strange = 0 var/last_update = 0 -/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/ore)) user.unEquip(W) src.contents += W diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index a31c958b2c6..a6c0ce6614d 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -26,9 +26,9 @@ del(src) -/obj/item/weapon/holder/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/holder/attackby(obj/item/weapon/W as obj, mob/user as mob, params) for(var/mob/M in src.contents) - M.attackby(W,user) + M.attackby(W,user, params) /obj/item/weapon/holder/proc/show_message(var/message, var/m_type) for(var/mob/living/M in contents) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 7e6bb5ea7da..04004b1ac93 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -125,7 +125,7 @@ /mob/living/carbon/alien/proc/handle_mutations_and_radiation() if(getFireLoss()) - if((M_RESIST_HEAT in mutations) || prob(5)) + if((RESIST_HEAT in mutations) || prob(5)) adjustFireLoss(-1) // Aliens love radiation nom nom nom 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 721c2a4b3fb..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 (M_HULK in M.mutations)//M_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/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index e59f50a5e5c..22f9bec9e0c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -187,7 +187,7 @@ /mob/living/carbon/alien/humanoid/proc/handle_regular_hud_updates() - if (stat == 2 || (M_XRAY in mutations)) + if (stat == 2 || (XRAY in mutations)) sight |= SEE_TURFS sight |= SEE_MOBS sight |= SEE_OBJS 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 a918e069bb7..a2774c4022a 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -36,7 +36,7 @@ now_pushing = 1 if(ismob(AM)) var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (M_FAT in tmob.mutations)) + if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) if(prob(70)) src << "\red You fail to push [tmob]'s fat ass out of the way." now_pushing = 0 @@ -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 (M_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/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 796f0a7cc00..6930ee09dd9 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -135,7 +135,7 @@ /mob/living/carbon/alien/larva/proc/handle_regular_hud_updates() - if (stat == 2 || (M_XRAY in mutations)) + if (stat == 2 || (XRAY in mutations)) sight |= SEE_TURFS sight |= SEE_MOBS sight |= SEE_OBJS diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index e82dda81b61..c102a59ca6c 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -101,7 +101,7 @@ breath.toxins -= toxins_used breath.oxygen += toxins_used - if(breath.temperature > (T0C+66) && !(M_RESIST_COLD in mutations)) // Hot air hurts :( + if(breath.temperature > (T0C+66) && !(RESIST_COLD in mutations)) // Hot air hurts :( if(prob(20)) src << "You feel a searing heat in your lungs!" fire_alert = max(fire_alert, 1) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index e41f5b0b2ae..b7bb4ee6dd2 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -55,7 +55,7 @@ var/const/MAX_ACTIVE_TIME = 400 if (sterile) user << "It looks like the proboscis has been removed." -/obj/item/clothing/mask/facehugger/attackby(var/obj/item/O,var/mob/m) +/obj/item/clothing/mask/facehugger/attackby(var/obj/item/O,var/mob/m, params) if(O.force) Die() return diff --git a/code/modules/mob/living/carbon/alien/special/snakeman.dm b/code/modules/mob/living/carbon/alien/special/snakeman.dm index d1d55895d88..7aa7b9d5db0 100644 --- a/code/modules/mob/living/carbon/alien/special/snakeman.dm +++ b/code/modules/mob/living/carbon/alien/special/snakeman.dm @@ -33,7 +33,7 @@ M.client.mob = new/mob/living/carbon/alien/humanoid/special/snakeman(new/obj/effect/snake_egg(src.loc)) visible_message("[src] injects [M] with an egg.") visible_message("The egg absorbs [M]") - M.mutations |= M_NOCLONE + M.mutations |= NOCLONE M.update_body() M.death() else diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index abc980023f0..c8c7142fa69 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -21,7 +21,7 @@ var/mob/living/silicon/robot = null//Appears unused. var/obj/mecha = null//This does not appear to be used outside of reference in mecha.dm. - attackby(var/obj/item/O as obj, var/mob/user as mob) + attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O,/obj/item/brain) && !brainmob) //Time to stick a brain in it --NEO if(!O:brainmob) user << "\red You aren't sure where this brain came from, but you're pretty sure it's a useless brain." diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 65bf8148a56..606959d5de8 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -193,7 +193,7 @@ proc/handle_regular_hud_updates() - if (stat == 2 || (M_XRAY in src.mutations)) + if (stat == 2 || (XRAY in src.mutations)) sight |= SEE_TURFS sight |= SEE_MOBS sight |= SEE_OBJS diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index dcfc65efcae..121a3e93f13 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -17,7 +17,7 @@ src.nutrition -= HUNGER_FACTOR/10 if(src.m_intent == "run") src.nutrition -= HUNGER_FACTOR/10 - if((M_FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360) + if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360) src.bodytemperature += 2 // Moving around increases germ_level faster @@ -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/death.dm b/code/modules/mob/living/carbon/human/death.dm index 08fe26ce77f..43ac690597d 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -151,7 +151,7 @@ return /mob/living/carbon/human/proc/ChangeToHusk() - if(M_HUSK in mutations) return + if(HUSK in mutations) return if(f_style) f_style = "Shaved" //we only change the icon_state of the hair datum, so it doesn't mess up their UI/UE @@ -159,7 +159,7 @@ h_style = "Bald" update_hair(0) - mutations.Add(M_HUSK) + mutations.Add(HUSK) status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools update_body(0) update_mutantrace() @@ -167,5 +167,5 @@ /mob/living/carbon/human/proc/Drain() ChangeToHusk() - mutations |= M_NOCLONE + mutations |= NOCLONE return diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 5dd8178c3b5..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) @@ -653,7 +653,7 @@ if("fart") if(world.time-lastFart >= 600) // playsound(src.loc, 'sound/effects/fart.ogg', 50, 1, -3) //Admins still vote no to fun - if(M_TOXIC_FARTS in mutations) + if(TOXIC_FARTS in mutations) message = "[src] unleashes a [pick("horrible","terrible","foul","disgusting","awful")] fart." else message = "[src] [pick("passes wind","farts")]." @@ -661,7 +661,7 @@ var/turf/location = get_turf(src) var/aoe_range=2 // Default - if(M_SUPER_FART in mutations) + if(SUPER_FART in mutations) aoe_range+=3 //Was 5 /* // If we're wearing a suit, don't blast or gas those around us. @@ -673,7 +673,7 @@ wearing_mask=1 */ // Process toxic farts first. - if(M_TOXIC_FARTS in mutations) + if(TOXIC_FARTS in mutations) for(var/mob/M in range(location,aoe_range)) if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS)) continue @@ -698,7 +698,7 @@ sleep(10) S.start() */ - if(M_SUPER_FART in mutations) + if(SUPER_FART in mutations) visible_message("\red [name] hunches down and grits their teeth!") if(do_after(usr,30)) visible_message("\red [name] unleashes a [pick("tremendous","gigantic","colossal")] fart!","You hear a [pick("tremendous","gigantic","colossal")] fart.") diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index dfdd8b41195..e5a3413bb2e 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -205,7 +205,7 @@ if(suiciding) msg += "[t_He] appears to have commited suicide... there is no hope of recovery.\n" - if(M_DWARF in mutations) + if(DWARF in mutations) msg += "[t_He] [t_is] a halfling!\n" var/distance = get_dist(usr,src) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 778f9079d59..6f29823609d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -143,8 +143,8 @@ slime.UpdateFeed() return - if(istype(tmob, /mob/living/carbon/human) && (M_FAT in tmob.mutations)) - if(prob(40) && !(M_FAT in src.mutations)) + if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) + if(prob(40) && !(FAT in src.mutations)) src << "\red You fail to push [tmob]'s fat ass out of the way." now_pushing = 0 return @@ -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) @@ -590,7 +610,7 @@ //Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable /mob/living/carbon/human/proc/get_face_name() var/datum/organ/external/head/head = get_organ("head") - if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (M_HUSK in mutations) ) //disfigured. use id-name if possible + if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible return "Unknown" return real_name 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 2fdf3c42498..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 @@ -31,7 +32,7 @@ var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting)) var/armor_block = run_armor_check(affecting, "melee") - if(M_HULK in M.mutations) damage += 5 + if(HULK in M.mutations) damage += 5 playsound(loc, "punch", 25, 1, -1) @@ -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)) @@ -137,7 +139,7 @@ var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting)) var/armor_block = run_armor_check(affecting, "melee") - if(M_HULK in M.mutations) damage += 5 + if(HULK in M.mutations) damage += 5 playsound(loc, attack.attack_sound, 25, 1, -1) 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_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 49b6a73143c..029283f3e3b 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -110,15 +110,15 @@ hud_updateflag |= 1 << HEALTH_HUD /mob/living/carbon/human/Stun(amount) - if(M_HULK in mutations) return + if(HULK in mutations) return ..() /mob/living/carbon/human/Weaken(amount) - if(M_HULK in mutations) return + if(HULK in mutations) return ..() /mob/living/carbon/human/Paralyse(amount) - if(M_HULK in mutations) return + if(HULK in mutations) return ..() diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 553a8abf91e..7906eac6111 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/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 01bbfe7f5f3..64043e02bc2 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -11,7 +11,7 @@ if(embedded_flag) handle_embedded_objects() //Moving with objects stuck in you can cause bad times. - if((M_RUN in mutations)) return -1 + if((RUN in mutations)) return -1 var/health_deficiency = (100 - health + staminaloss) if(health_deficiency >= 40) @@ -55,12 +55,12 @@ tally += back.slowdown - if(M_FAT in src.mutations) + if(FAT in src.mutations) tally += 1.5 if (bodytemperature < 283.222) tally += (283.222 - bodytemperature) / 10 * 1.75 - if(M_RUN in mutations) + if(RUN in mutations) tally = 0 return (tally+config.human_delay) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 0f32d9d187e..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)) @@ -303,7 +303,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc return if(getFireLoss()) - if((M_RESIST_HEAT in mutations) || (prob(1))) + if((RESIST_HEAT in mutations) || (prob(1))) heal_organ_damage(0,1) @@ -389,7 +389,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc proc/breathe() if(reagents.has_reagent("lexorin")) return - if(M_NO_BREATH in mutations) return // No breath mutation means no breathing. + if(NO_BREATH in mutations) return // No breath mutation means no breathing. if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return if(species && (species.flags & NO_BREATHE)) return @@ -618,7 +618,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc else if(adjusted_pressure >= species.hazard_low_pressure) pressure_alert = -1 else - if( !(M_RESIST_COLD in mutations)) + if( !(RESIST_COLD in mutations)) take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure") pressure_alert = -2 else @@ -720,7 +720,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc var/thermal_protection_flags = get_heat_protection_flags(temperature) var/thermal_protection = 0.0 - if(M_RESIST_HEAT in mutations) + if(RESIST_HEAT in mutations) return 1 if(thermal_protection_flags) if(thermal_protection_flags & HEAD) @@ -777,7 +777,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc proc/get_cold_protection(temperature) - if(M_RESIST_COLD in mutations) + if(RESIST_COLD in mutations) return 1 //Fully protected from the cold. temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K. @@ -934,12 +934,12 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc else if (light_amount < 2) //heal in the dark heal_overall_damage(1,1) - //The fucking M_FAT mutation is the greatest shit ever. It makes everyone so hot and bothered. + //The fucking FAT mutation is the greatest shit ever. It makes everyone so hot and bothered. if(species.flags & CAN_BE_FAT) - if(M_FAT in mutations) + if(FAT in mutations) if(overeatduration < 100) src << "\blue You feel fit again!" - mutations.Remove(M_FAT) + mutations.Remove(FAT) update_mutantrace(0) update_mutations(0) update_inv_w_uniform(0) @@ -947,7 +947,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc else if(overeatduration > 500) src << "\red You suddenly feel blubbery!" - mutations.Add(M_FAT) + mutations.Add(FAT) update_mutantrace(0) update_mutations(0) update_inv_w_uniform(0) @@ -963,7 +963,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc else if(overeatduration > 1) - if(M_OBESITY in mutations) + if(OBESITY in mutations) overeatduration -= 1 // Those with obesity gene take twice as long to unfat else overeatduration -= 2 @@ -1006,7 +1006,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc silent = 0 else //ALIVE. LIGHTS ARE ON - if(M_REGEN in mutations) + if(REGEN in mutations) if(nutrition) if(prob(10)) var/randumb = rand(1,5) @@ -1017,7 +1017,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc // Sobering multiplier. // Sober block grants quadruple the alcohol metabolism. -// var/sober_str=!(M_SOBER in mutations)?1:4 +// var/sober_str=!(SOBER in mutations)?1:4 updatehealth() //TODO if(!in_stasis) @@ -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 @@ -1298,7 +1294,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO - if(M_XRAY in mutations) + if(XRAY in mutations) sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO @@ -1509,7 +1505,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(!machine.check_eye(src)) reset_view(null) else var/isRemoteObserve = 0 - if((M_REMOTE_VIEW in mutations) && remoteview_target) + if((REMOTE_VIEW in mutations) && remoteview_target) isRemoteObserve = 1 // Is he unconscious or dead? if(remoteview_target.stat!=CONSCIOUS) @@ -1517,7 +1513,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc isRemoteObserve = 0 // Does he have psy resist? - if(M_PSY_RESIST in remoteview_target.mutations) + if(PSY_RESIST in remoteview_target.mutations) src << "\red Your mind is shut out!" isRemoteObserve = 0 diff --git a/code/modules/mob/living/carbon/human/plasmaman/species.dm b/code/modules/mob/living/carbon/human/plasmaman/species.dm index a9646cdd886..edb0a7c8539 100644 --- a/code/modules/mob/living/carbon/human/plasmaman/species.dm +++ b/code/modules/mob/living/carbon/human/plasmaman/species.dm @@ -130,7 +130,7 @@ H.emote(pick("giggle", "laugh")) SA.moles = 0 - if( (abs(310.15 - breath.temperature) > 50) && !(M_RESIST_HEAT in H.mutations)) // Hot air hurts :( + if( (abs(310.15 - breath.temperature) > 50) && !(RESIST_HEAT in H.mutations)) // Hot air hurts :( if(H.status_flags & GODMODE) return 1 //godmode if(breath.temperature < cold_level_1) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 42f954669d1..c805cd8a6d2 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -286,7 +286,7 @@ handled = 1 if(message != "") - if((M_HULK in mutations) && health >= 25 && length(message)) + if((HULK in mutations) && health >= 25 && length(message)) message = "[uppertext(message)]!!!" verb = pick("yells","roars","hollers") handled = 1 @@ -309,7 +309,7 @@ message = uppertext(message) verb = "yells loudly" - if(M_COMIC in mutations) + if(COMIC in mutations) message = "[message]" returns[1] = message returns[2] = verb diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index c565c3d7be5..1fa969883f0 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -236,9 +236,9 @@ proc/get_damage_icon_part(damage_state, body_part) var/hulk_color_mod = rgb(48,224,40) var/necrosis_color_mod = rgb(10,50,0) - var/husk = (M_HUSK in src.mutations) //100% unnecessary -Agouri //nope, do you really want to iterate through src.mutations repeatedly? -Pete - var/fat = (M_FAT in src.mutations) - var/hulk = (M_HULK in src.mutations) + var/husk = (HUSK in src.mutations) //100% unnecessary -Agouri //nope, do you really want to iterate through src.mutations repeatedly? -Pete + var/fat = (FAT in src.mutations) + var/hulk = (HULK in src.mutations) var/g = (gender == FEMALE ? "f" : "m") var/has_head = 0 @@ -456,7 +456,7 @@ proc/get_damage_icon_part(damage_state, body_part) /mob/living/carbon/human/update_mutations(var/update_icons=1) var/fat - if(M_FAT in mutations) + if(FAT in mutations) fat = "fat" var/image/standing = image("icon" = 'icons/effects/genetics.dmi') @@ -475,26 +475,26 @@ proc/get_damage_icon_part(damage_state, body_part) for(var/mut in mutations) switch(mut) /* - if(M_HULK) + if(HULK) if(fat) standing.underlays += "hulk_[fat]_s" else standing.underlays += "hulk_[g]_s" add_image = 1 - if(M_RESIST_COLD) + if(RESIST_COLD) standing.underlays += "fire[fat]_s" add_image = 1 - if(M_RESIST_HEAT) + if(RESIST_HEAT) standing.underlays += "cold[fat]_s" add_image = 1 if(TK) standing.underlays += "telekinesishead[fat]_s" add_image = 1 */ - if(M_LASER) + if(LASER) standing.overlays += "lasereyes_s" add_image = 1 - if((M_RESIST_COLD in mutations) && (M_RESIST_HEAT in mutations)) + if((RESIST_COLD in mutations) && (RESIST_HEAT in mutations)) standing.underlays -= "cold[fat]_s" standing.underlays -= "fire[fat]_s" standing.underlays += "coldfire[fat]_s" @@ -507,7 +507,7 @@ proc/get_damage_icon_part(damage_state, body_part) /mob/living/carbon/human/proc/update_mutantrace(var/update_icons=1) var/fat - if( M_FAT in mutations ) + if( FAT in mutations ) fat = "fat" // var/g = "m" // if (gender == FEMALE) g = "f" @@ -594,7 +594,7 @@ proc/get_damage_icon_part(damage_state, body_part) if(!t_color) t_color = icon_state var/image/standing = image("icon_state" = "[t_color]_s") - if(M_FAT in mutations) + if(FAT in mutations) if(w_uniform.flags&ONESIZEFITSALL) standing.icon = 'icons/mob/uniform_fat.dmi' else @@ -815,7 +815,7 @@ proc/get_damage_icon_part(damage_state, body_part) standing = image("icon" = wear_suit.icon_override, "icon_state" = "[wear_suit.icon_state]") else if(wear_suit.sprite_sheets && wear_suit.sprite_sheets[species.name]) standing = image("icon" = wear_suit.sprite_sheets[species.name], "icon_state" = "[wear_suit.icon_state]") - else if(M_FAT in mutations) + else if(FAT in mutations) if(wear_suit.flags&ONESIZEFITSALL) standing = image("icon" = 'icons/mob/suit_fat.dmi', "icon_state" = "[wear_suit.icon_state]") else diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 5ed4f781cae..598bcacf1d0 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,12 +437,12 @@ visible_message("[M] has grabbed [src] passively!") else - + M.do_attack_animation(src) var/damage = rand(1, 9) attacked += 10 if (prob(90)) - if (M_HULK in M.mutations) + if (HULK in M.mutations) damage += 5 if(Victim || Target) Victim = null @@ -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 @@ -533,7 +556,7 @@ updatehealth() return -/mob/living/carbon/slime/attackby(obj/item/W, mob/user) +/mob/living/carbon/slime/attackby(obj/item/W, mob/user, params) if(istype(W,/obj/item/stack/sheet/mineral/plasma)) //Lets you feed slimes plasma. if (user in Friends) ++Friends[user] @@ -643,7 +666,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 var/Uses = 1 // uses before it goes inert var/enhanced = 0 //has it been enhanced before? - attackby(obj/item/O as obj, mob/user as mob) + attackby(obj/item/O as obj, mob/user as mob, params) if(istype(O, /obj/item/weapon/slimesteroid2)) if(enhanced == 1) user << " This extract has already been enhanced!" @@ -958,7 +981,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 max_heat_protection_temperature = FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE armor = list(melee = 80, bullet = 20, laser = 20, energy = 10, bomb = 0, bio = 0, rad = 0) -/obj/effect/golem_rune +/obj/effect/goleRUNe anchored = 1 desc = "a strange rune used to create golems. It glows when spirits are nearby." name = "rune" @@ -1118,7 +1141,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 if (environment.toxins > MOLES_PLASMA_VISIBLE)//plasma exposure causes the egg to hatch src.Hatch() -/obj/item/weapon/reagent_containers/food/snacks/egg/slime/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/egg/slime/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype( W, /obj/item/toy/crayon )) return else 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/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 01a5ca76e6d..ab619c4c1a0 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -112,15 +112,15 @@ proc/handle_mutations_and_radiation() if(getFireLoss()) - if((M_RESIST_HEAT in mutations) || prob(50)) + if((RESIST_HEAT in mutations) || prob(50)) switch(getFireLoss()) if(1 to 50) adjustFireLoss(-1) if(51 to 100) adjustFireLoss(-5) - if ((M_HULK in mutations) && health <= 25) - mutations.Remove(M_HULK) + if ((HULK in mutations) && health <= 25) + mutations.Remove(HULK) src << "\red You suddenly feel very weak." Weaken(3) emote("collapse") @@ -421,7 +421,7 @@ if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) pressure_alert = -1 else - if( !(M_RESIST_COLD in mutations) ) + if( !(RESIST_COLD in mutations) ) adjustBruteLoss( LOW_PRESSURE_DAMAGE ) pressure_alert = -2 else @@ -561,7 +561,7 @@ proc/handle_regular_hud_updates() - if (stat == 2 || (M_XRAY in mutations)) + if (stat == 2 || (XRAY in mutations)) sight |= SEE_TURFS sight |= SEE_MOBS sight |= SEE_OBJS diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 290f356cb60..b82b063607c 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -131,7 +131,7 @@ now_pushing = 1 if(ismob(AM)) var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (M_HULK in tmob.mutations)) + if(istype(tmob, /mob/living/carbon/human) && (HULK in tmob.mutations)) if(prob(70)) usr << "\red You fail to push [tmob]'s fat ass out of the way." now_pushing = 0 @@ -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/carbon/species.dm b/code/modules/mob/living/carbon/species.dm index d19baa5caad..7693a1d1eb9 100644 --- a/code/modules/mob/living/carbon/species.dm +++ b/code/modules/mob/living/carbon/species.dm @@ -208,7 +208,7 @@ spawn(0) H.emote(pick("giggle", "laugh")) SA.moles = 0 - if( (abs(310.15 - breath.temperature) > 50) && !(M_RESIST_HEAT in H.mutations)) // Hot air hurts :( + if( (abs(310.15 - breath.temperature) > 50) && !(RESIST_HEAT in H.mutations)) // Hot air hurts :( if(H.status_flags & GODMODE) return 1 //godmode if(breath.temperature < cold_level_1) if(prob(20)) @@ -550,7 +550,7 @@ brute_mod = 1.25 //greys are fragile - default_genes = list(M_REMOTE_TALK) + default_genes = list(REMOTE_TALK) primitive = /mob/living/carbon/monkey // TODO @@ -559,11 +559,11 @@ /datum/species/grey/handle_dna(var/mob/living/carbon/C, var/remove) if(!remove) C.dna.SetSEState(REMOTETALKBLOCK,1,1) - C.mutations |= M_REMOTE_TALK + C.mutations |= REMOTE_TALK genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED) else C.dna.SetSEState(REMOTETALKBLOCK,0,1) - C.mutations -= M_REMOTE_TALK + C.mutations -= REMOTE_TALK genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED) C.update_mutations() ..() diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 9126dc6bd95..fa15e893f6e 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -15,7 +15,7 @@ if(BRUTE) adjustBruteLoss(damage * blocked) if(BURN) - if(M_RESIST_HEAT in mutations) damage = 0 + if(RESIST_HEAT in mutations) damage = 0 adjustFireLoss(damage * blocked) if(TOX) adjustToxLoss(damage * blocked) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 246f6a1ba01..f94d2bf54b7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -47,9 +47,9 @@ /mob/living/proc/burn_skin(burn_amount) if(istype(src, /mob/living/carbon/human)) //world << "DEBUG: burn_skin(), mutations=[mutations]" - if(M_NO_SHOCK in src.mutations) //shockproof + if(NO_SHOCK in src.mutations) //shockproof return 0 - if (M_RESIST_HEAT in src.mutations) //fireproof + if (RESIST_HEAT in src.mutations) //fireproof return 0 var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part var/divided_damage = (burn_amount)/(H.organs.len) @@ -61,7 +61,7 @@ H.updatehealth() return 1 else if(istype(src, /mob/living/carbon/monkey)) - if (M_RESIST_HEAT in src.mutations) //fireproof + if (RESIST_HEAT in src.mutations) //fireproof return 0 var/mob/living/carbon/monkey/M = src M.adjustFireLoss(burn_amount) @@ -456,7 +456,7 @@ if(!isliving(usr) || usr.next_move > world.time) return - usr.next_move = world.time + 20 + usr.changeNext_move(CLICK_CD_RESIST) var/mob/living/L = usr @@ -539,8 +539,8 @@ if(iscarbon(L)) var/mob/living/carbon/C = L if( C.handcuffed ) - C.next_move = world.time + 100 - C.last_special = world.time + 100 + C.changeNext_move(CLICK_CD_BREAKOUT) + C.last_special = world.time + CLICK_CD_BREAKOUT C << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)" for(var/mob/O in viewers(L)) O.show_message("\red [usr] attempts to unbuckle themself!", 1) @@ -573,8 +573,8 @@ // breakout_time++ //Harder to get out of welded lockers than locked lockers //okay, so the closet is either welded or locked... resist!!! - usr.next_move = world.time + 100 - L.last_special = world.time + 100 + L.changeNext_move(CLICK_CD_BREAKOUT) + L.last_special = world.time + CLICK_CD_BREAKOUT L << "\red You lean on the back of \the [C] and start pushing the door open. (this will take about [breakout_time] minutes)" for(var/mob/O in viewers(usr.loc)) O.show_message("\red The [L.loc] begins to shake violently!", 1) @@ -640,9 +640,9 @@ ExtinguishMob() return if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time)) - CM.next_move = world.time + 100 - CM.last_special = world.time + 100 - if(isalienadult(CM) || (M_HULK in usr.mutations))//Don't want to do a lot of logic gating here. + CM.changeNext_move(CLICK_CD_BREAKOUT) + CM.last_special = world.time + CLICK_CD_BREAKOUT + if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here. usr << "\red You attempt to break your handcuffs. (This will take around 5 seconds and you need to stand still)" for(var/mob/O in viewers(CM)) O.show_message(text("\red [] is trying to break the handcuffs!", CM), 1) @@ -677,9 +677,9 @@ CM.unEquip(CM.handcuffed) else if(CM.legcuffed && CM.canmove && (CM.last_special <= world.time)) - CM.next_move = world.time + 100 - CM.last_special = world.time + 100 - if(isalienadult(CM) || (M_HULK in usr.mutations))//Don't want to do a lot of logic gating here. + CM.changeNext_move(CLICK_CD_BREAKOUT) + CM.last_special = world.time + CLICK_CD_BREAKOUT + if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here. usr << "\red You attempt to break your legcuffs. (This will take around 5 seconds and you need to stand still)" for(var/mob/O in viewers(CM)) O.show_message(text("\red [] is trying to break the legcuffs!", CM), 1) @@ -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..52bfd6b4680 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() @@ -948,7 +946,7 @@ var/list/ai_list = list() camera_light_on = world.timeofday + 1 * 20 // Update the light every 2 seconds. -/mob/living/silicon/ai/attackby(obj/item/weapon/W as obj, mob/user as mob) +/mob/living/silicon/ai/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) if(anchored) user.visible_message("\blue \The [user] starts to unbolt \the [src] from the plating...") diff --git a/code/modules/mob/living/silicon/mommi/life.dm b/code/modules/mob/living/silicon/mommi/life.dm index 73e6ee16aa5..eb7aa1dd700 100644 --- a/code/modules/mob/living/silicon/mommi/life.dm +++ b/code/modules/mob/living/silicon/mommi/life.dm @@ -133,7 +133,7 @@ / /mob/living/silicon/robot/mommi/handle_regular_hud_updates() - if (src.stat == 2 || M_XRAY in mutations || src.sight_mode & BORGXRAY) + if (src.stat == 2 || XRAY in mutations || src.sight_mode & BORGXRAY) src.sight |= SEE_TURFS src.sight |= SEE_MOBS src.sight |= SEE_OBJS diff --git a/code/modules/mob/living/silicon/mommi/mommi.dm b/code/modules/mob/living/silicon/mommi/mommi.dm index 6da8b8a72a9..b532b2f0da2 100644 --- a/code/modules/mob/living/silicon/mommi/mommi.dm +++ b/code/modules/mob/living/silicon/mommi/mommi.dm @@ -148,7 +148,7 @@ They can only use one tool at a time, they can't choose modules, and they have 1 real_name = changed_name name = real_name -/mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob) +/mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/restraints/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do return diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 9edeb1ed082..005ad324045 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) @@ -424,7 +426,7 @@ canmove = !resting //Overriding this will stop a number of headaches down the track. -/mob/living/silicon/pai/attackby(obj/item/weapon/W as obj, mob/user as mob) +/mob/living/silicon/pai/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(W.force) visible_message("[user.name] attacks [src] with [W]!") src.adjustBruteLoss(W.force) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index ff9b343a7b1..b6dd9e64ce8 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -327,7 +327,7 @@ if(s == "medical HUD") //This file has to be saved as ANSI or this will not display correctly dat += "Medical Analysis Suite [(src.medHUD) ? "" : ""]
" if(s == "universal translator") //This file has to be saved as ANSI or this will not display correctly - dat += "Universal Translator [(src.universal_speak) ? "" : ""]
" + dat += "Universal Translator [(src.translator_on) ? "" : ""]
" if(s == "projection array") dat += "Projection Array
" if(s == "camera jack") diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index e2d6c31e8f6..73ec259f7f7 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -183,7 +183,7 @@ var/mode = 1; /obj/item/device/robotanalyzer/attack(mob/living/M as mob, mob/living/user as mob) - if(( (M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) + if(( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) user << text("\red You try to analyze the floor's vitals!") for(var/mob/O in viewers(M, null)) O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 2ce2ab3022e..45f6068f963 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -167,7 +167,7 @@ S.show_message(rendered2, 2) //Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..(). -/mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob) +/mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/borg/upgrade/)) user << "\red The maintenance drone chassis not compatible with \the [W]." diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index fff8878ff0e..b9c9acc52f6 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -86,7 +86,7 @@ wrapped.loc = user //Pass the attack on to the target. This might delete/relocate wrapped. - target.attackby(wrapped,user) + target.attackby(wrapped,user, params) //If wrapped did neither get deleted nor put into target, put it back into the gripper. if(wrapped && user && (wrapped.loc == user)) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 6ecbfbd9dfc..8171b891977 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -154,7 +154,7 @@ /mob/living/silicon/robot/proc/handle_regular_hud_updates() - if (src.stat == 2 || M_XRAY in mutations || src.sight_mode & BORGXRAY) + if (src.stat == 2 || XRAY in mutations || src.sight_mode & BORGXRAY) src.sight |= SEE_TURFS src.sight |= SEE_MOBS src.sight |= SEE_OBJS diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index d446be62095..e9b9c58dd1e 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -566,7 +566,7 @@ now_pushing = 1 if(ismob(AM)) var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (M_FAT in tmob.mutations)) + if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) if(prob(20)) usr << "\red You fail to push [tmob]'s fat ass out of the way." now_pushing = 0 @@ -642,7 +642,7 @@ return !cleared -/mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob) +/mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/restraints/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do return @@ -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 0c8f61569b4..c54c1329707 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -66,7 +66,7 @@ now_pushing = 1 if(ismob(AM)) var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (M_FAT in tmob.mutations)) + if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) if(prob(5)) src << "\red You fail to push [tmob]'s fat ass out of the way." now_pushing = 0 @@ -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)) @@ -109,7 +110,7 @@ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) adjustBruteLoss(damage) -/mob/living/simple_animal/construct/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/construct/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(O.force) var/damage = O.force if (O.damtype == STAMINA) @@ -150,7 +151,7 @@ status_flags = 0 construct_spells = list(/obj/effect/proc_holder/spell/wizard/aoe_turf/conjure/lesserforcewall) -/mob/living/simple_animal/construct/armoured/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/construct/armoured/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(O.force) if(O.force >= 11) var/damage = O.force @@ -279,7 +280,7 @@ var/energy = 0 var/max_energy = 1000 -/mob/living/simple_animal/construct/behemoth/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/construct/behemoth/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(O.force) if(O.force >= 11) var/damage = O.force diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index c9dfb0cccef..d0d432ce102 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -55,7 +55,7 @@ onclose(user, "mob[real_name]") return -/mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(inventory_head && inventory_back) //helmet and armor = 100% protection if( istype(inventory_head,/obj/item/clothing/head/helmet) && istype(inventory_back,/obj/item/clothing/suit/armor) ) @@ -352,7 +352,7 @@ now_pushing = 1 if(ismob(AM)) var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (M_FAT in tmob.mutations)) + if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) if(prob(70)) src << "\red You fail to push [tmob]'s fat ass out of the way." now_pushing = 0 diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/simple_animal/friendly/crab.dm index cb5378b8bbf..6d8064d6132 100644 --- a/code/modules/mob/living/simple_animal/friendly/crab.dm +++ b/code/modules/mob/living/simple_animal/friendly/crab.dm @@ -42,7 +42,7 @@ response_harm = "stomps" //LOOK AT THIS - ..()?? -/*/mob/living/simple_animal/crab/attackby(var/obj/item/O as obj, var/mob/user as mob) +/*/mob/living/simple_animal/crab/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/wirecutters)) if(prob(50)) user << "\red \b This kills the crab." diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index cc7a6ea4028..7c27348a7e7 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -72,8 +72,9 @@ if(prob(10)) say("Nom") -/mob/living/simple_animal/hostile/retaliate/goat/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/hostile/retaliate/goat/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(stat == CONSCIOUS && istype(O, /obj/item/weapon/reagent_containers/glass)) + user.changeNext_move(CLICK_CD_MELEE) user.visible_message("[user] milks [src] using \the [O].") var/obj/item/weapon/reagent_containers/glass/G = O var/transfered = udder.trans_id_to(G, "milk", rand(5,10)) @@ -112,7 +113,7 @@ udder.my_atom = src ..() -/mob/living/simple_animal/cow/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/cow/attackby(var/obj/item/O as obj, var/mob/user as mob, params, params) if(stat == CONSCIOUS && istype(O, /obj/item/weapon/reagent_containers/glass)) user.visible_message("[user] milks [src] using \the [O].") var/obj/item/weapon/reagent_containers/glass/G = O @@ -229,7 +230,7 @@ var/global/chicken_count = 0 ..() chicken_count -= 1 -/mob/living/simple_animal/chicken/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/chicken/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/wheat)) //feedin' dem chickens if(!stat && eggsleft < 8) user.visible_message("\blue [user] feeds [O] to [name]! It clucks happily.","\blue You feed [O] to [name]! It clucks happily.") diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm index ddddc43132a..df1fc75659d 100644 --- a/code/modules/mob/living/simple_animal/friendly/slime.dm +++ b/code/modules/mob/living/simple_animal/friendly/slime.dm @@ -23,7 +23,7 @@ now_pushing = 1 if(ismob(AM)) var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (M_FAT in tmob.mutations)) + if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) if(prob(70)) src << "\red You fail to push [tmob]'s fat ass out of the way." now_pushing = 0 diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 73c4018e3b9..4729438839e 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -42,7 +42,7 @@ speak_emote = list("beeps","clicks","chirps") can_hide = 1 -/mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/device/mmi) || istype(O, /obj/item/device/mmi/posibrain)) var/obj/item/device/mmi/B = O diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index 287e24afe2c..d8f891d5c88 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -102,7 +102,7 @@ -/mob/living/simple_animal/hostile/bear/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/hostile/bear/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(stance != HOSTILE_STANCE_ATTACK && stance != HOSTILE_STANCE_ATTACKING) stance = HOSTILE_STANCE_ALERT stance_step = 6 diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index e2d8bcd485c..5670f5e55de 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -120,7 +120,7 @@ src.visible_message("The [src.name] was bruised!") bruised = 1 -/mob/living/simple_animal/hostile/mushroom/attackby(obj/item/I as obj, mob/user as mob) +/mob/living/simple_animal/hostile/mushroom/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom)) if(stat == DEAD && !recovery_cooldown) Recover() diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index df1f903f21f..c5c9c24b577 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -57,7 +57,7 @@ attacktext = "slashes" status_flags = 0 -/mob/living/simple_animal/hostile/syndicate/melee/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/hostile/syndicate/melee/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(O.force) if(prob(80)) var/damage = O.force diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index a62f0640a54..1e5badbcdb0 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -233,7 +233,7 @@ return //Mobs with objects -/mob/living/simple_animal/parrot/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/parrot/attackby(var/obj/item/O as obj, var/mob/user as mob, params) ..() if(!stat && !client && !istype(O, /obj/item/stack/medical)) if(O.force) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 6d0694c3073..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 @@ -402,6 +419,8 @@ if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch)) 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/living/simple_animal/tribbles.dm b/code/modules/mob/living/simple_animal/tribbles.dm index 649b27f334b..77a23ab6fe0 100644 --- a/code/modules/mob/living/simple_animal/tribbles.dm +++ b/code/modules/mob/living/simple_animal/tribbles.dm @@ -51,7 +51,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles, del(src) -/mob/living/simple_animal/tribble/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob) +/mob/living/simple_animal/tribble/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/scalpel)) user << "You try to neuter the tribble, but it's moving too much and you fail!" else if(istype(O, /obj/item/weapon/cautery)) @@ -190,7 +190,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles, return -/obj/structure/tribble_cage/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/tribble_cage/attackby(obj/item/weapon/W as obj, mob/user as mob, params) src.health -= W.force src.healthcheck() ..() diff --git a/code/modules/mob/living/simple_animal/vox.dm b/code/modules/mob/living/simple_animal/vox.dm index 02e8a3e9460..d350e7c4704 100644 --- a/code/modules/mob/living/simple_animal/vox.dm +++ b/code/modules/mob/living/simple_animal/vox.dm @@ -32,7 +32,7 @@ src.gib() return -/mob/living/simple_animal/vox/armalis/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/vox/armalis/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(O.force) if(O.force >= 25) var/damage = O.force @@ -110,7 +110,7 @@ set name = "Shriek" set desc = "Give voice to a psychic shriek." -/mob/living/simple_animal/vox/armalis/attackby(var/obj/item/O as obj, var/mob/user as mob) +/mob/living/simple_animal/vox/armalis/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O,/obj/item/vox/armalis_armour)) user.drop_item() armour = O diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 9900b2c0b42..144790401d0 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -331,7 +331,7 @@ var/list/slot_equipment_priority = list( \ if(slot_w_uniform) if( !(slot_flags & SLOT_ICLOTHING) ) return 0 - if((M_FAT in H.mutations) && !(flags & ONESIZEFITSALL)) + if((FAT in H.mutations) && !(flags & ONESIZEFITSALL)) return 0 if(H.w_uniform) if(!(H.w_uniform.flags & NODROP)) @@ -503,8 +503,6 @@ var/list/slot_equipment_priority = list( \ if (W) W.attack_self(src) update_inv_r_hand() - if(next_move < world.time) - next_move = world.time + 2 return /* @@ -857,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()) @@ -873,6 +874,7 @@ var/list/slot_equipment_priority = list( \ stat(null, "Instances:\t[world.contents.len]") if(master_controller) + /* HANDLED THROUGH PROCESS SCHEDULER stat(null, "MasterController-[last_tick_duration] ([master_controller.processing?"On":"Off"]-[controller_iteration])") stat(null, "Air-[master_controller.air_cost]") stat(null, "Sun-[master_controller.sun_cost]") @@ -884,13 +886,69 @@ var/list/slot_equipment_priority = list( \ stat(null, "PiNet-[master_controller.networks_cost]\t#[pipe_networks.len]") stat(null, "PoNet-[master_controller.powernets_cost]\t#[powernets.len]") stat(null, "NanoUI-[master_controller.nano_cost]\t#[nanomanager.processing_uis.len]") - stat(null,"Events-[master_controller.events_cost]\t#[event_manager.active_events.len]") // stat(null, "GC-[master_controller.gc_cost]\t#[garbage.queue.len]") - stat(null, "Tick-[master_controller.ticker_cost]") + stat(null, "Tick-[master_controller.ticker_cost]")*/ + stat(null,"Events-[master_controller.events_cost]\t#[event_manager.active_events.len]") stat(null, "ALL-[master_controller.total_cost]") else stat(null, "MasterController-ERROR") + if(processScheduler.getIsRunning()) + var/datum/controller/process/process + + process = processScheduler.getProcess("ticker") + stat(null, "TIC\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("air") + stat(null, "AIR\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("lighting") + stat(null, "LIG\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("mob") + stat(null, "MOB([mob_list.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("machinery") + stat(null, "MAC([machines.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("obj") + stat(null, "OBJ([processing_objects.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("pipenet") + stat(null, "PIP([pipe_networks.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("powernet") + stat(null, "POW([powernets.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("nanoui") + stat(null, "NAN([nanomanager.processing_uis.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + process = processScheduler.getProcess("disease") + stat(null, "DIS([active_diseases.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + //process = processScheduler.getProcess("sun") + //stat(null, "SUN\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + //process = processScheduler.getProcess("garbage") + //stat(null, "GAR\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + //process = processScheduler.getProcess("vote") + //stat(null, "VOT\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + //process = processScheduler.getProcess("shuttle controller") + //stat(null, "SHT\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + //process = processScheduler.getProcess("emergency shuttle") + //stat(null, "EME\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + //process = processScheduler.getProcess("inactivity") + //stat(null, "IAC\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + + //process = processScheduler.getProcess("event") + //stat(null, "EVE([events.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]") + else + stat(null, "processScheduler is not running.") + if(listed_turf && client) if(!TurfAdjacent(listed_turf)) listed_turf = null @@ -1151,7 +1209,7 @@ mob/proc/yank_out_object() if(!isliving(usr) || usr.next_move > world.time) return - usr.next_move = world.time + 20 + usr.changeNext_move(CLICK_CD_RESIST) if(usr.stat == 1) usr << "You are unconcious and cannot do that!" diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index cdda2f6d268..01f32df8e14 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -160,7 +160,7 @@ affecting.LAssailant = null else affecting.LAssailant = assailant - assailant.next_move = world.time + 10 + assailant.changeNext_move(CLICK_CD_TKSTRANGLE) affecting.losebreath += 1 else assailant.visible_message("[assailant] was unable to tighten \his grip on [affecting]'s neck!") @@ -189,7 +189,7 @@ s_click(hud) return if(M == assailant && state >= GRAB_AGGRESSIVE) - if( (ishuman(user) && (M_FAT in user.mutations) && iscarbon(affecting) ) || ( isalien(user) && iscarbon(affecting) ) || ( istype(user,/mob/living/carbon/human/kidan) && istype(affecting,/mob/living/carbon/monkey/diona) ) ) + if( (ishuman(user) && (FAT in user.mutations) && iscarbon(affecting) ) || ( isalien(user) && iscarbon(affecting) ) || ( istype(user,/mob/living/carbon/human/kidan) && istype(affecting,/mob/living/carbon/monkey/diona) ) ) var/mob/living/carbon/attacker = user user.visible_message("[user] is attempting to devour [affecting]!") if(istype(user, /mob/living/carbon/alien/humanoid/hunter)) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 4810c0b10f7..a68d5bc80f9 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -495,7 +495,7 @@ new_character.disabilities |= NEARSIGHTED if(client.prefs.disabilities & DISABILITY_FLAG_FAT) - new_character.mutations += M_FAT + new_character.mutations += FAT new_character.overeatduration = 600 // Max overeat if(client.prefs.disabilities & DISABILITY_FLAG_EPILEPTIC) diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 6b37eb96948..096c5f0f9c2 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -252,7 +252,7 @@ nanoui is used to open and update nano browser uis . = shared_living_nano_interaction(src_object) if(. == STATUS_INTERACTIVE && be_close) . = shared_living_nano_distance(src_object) - if(. == STATUS_UPDATE && (M_TK in mutations)) // If we have telekinesis and remain close enough, allow interaction. + if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction. return STATUS_INTERACTIVE /** diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 33ce38ba437..a48b319b3f2 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -1159,7 +1159,7 @@ obj/item/weapon/organ/head/proc/transfer_identity(var/mob/living/carbon/human/H) respawnable_list += brainmob brainmob.container = src -obj/item/weapon/organ/head/attackby(obj/item/weapon/W as obj, mob/user as mob) +obj/item/weapon/organ/head/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/scalpel)) switch(brain_op_stage) if(0) diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index dd311862f2c..9773773316f 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -42,7 +42,7 @@ overlays += "clipboard_over" return -/obj/item/weapon/clipboard/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/clipboard/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/photo)) user.drop_item() @@ -53,7 +53,7 @@ update_icon() else if(istype(toppaper) && istype(W, /obj/item/weapon/pen)) - toppaper.attackby(W, usr) + toppaper.attackby(W, usr, params) update_icon() return diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 6d3b6ea8c21..f01aa60d704 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -32,7 +32,7 @@ var/list/alldepartments = list() /obj/machinery/photocopier/faxmachine/attack_hand(mob/user as mob) ui_interact(user) -/obj/machinery/photocopier/faxmachine/attackby(obj/item/weapon/item, mob/user) +/obj/machinery/photocopier/faxmachine/attackby(obj/item/weapon/item, mob/user, params) if(istype(item,/obj/item/weapon/card/id) && !scan) scan(item) else if(istype(item, /obj/item/weapon/paper) || istype(item, /obj/item/weapon/photo) || istype(item, /obj/item/weapon/paper_bundle)) diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 613b3a39b5f..e520aa1976e 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -33,7 +33,7 @@ I.loc = src -/obj/structure/filingcabinet/attackby(obj/item/P as obj, mob/user as mob) +/obj/structure/filingcabinet/attackby(obj/item/P as obj, mob/user as mob, params) if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/folder) || istype(P, /obj/item/weapon/photo) || istype(P, /obj/item/weapon/paper_bundle) || istype(P, /obj/item/documents)) user << "You put [P] in [src]." user.drop_item() diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index c8b674fe5f3..161ad5065dd 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -30,7 +30,7 @@ overlays += "folder_paper" return -/obj/item/weapon/folder/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/folder/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/photo) || istype(W, /obj/item/weapon/paper_bundle) || istype(W, /obj/item/documents)) user.drop_item() W.loc = src diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index e1727a18ad7..b55626d3c9b 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -73,7 +73,7 @@ set category = "Object" set src in usr - if((M_CLUMSY in usr.mutations) && prob(50)) + if((CLUMSY in usr.mutations) && prob(50)) usr << "You cut yourself on the paper." return var/n_name = sanitize(copytext(input(usr, "What would you like to label the paper?", "Paper Labelling", name) as text, 1, MAX_MESSAGE_LEN)) @@ -348,7 +348,7 @@ update_icon() -/obj/item/weapon/paper/attackby(obj/item/weapon/P as obj, mob/user as mob) +/obj/item/weapon/paper/attackby(obj/item/weapon/P as obj, mob/user as mob, params) ..() var/clown = 0 if(user.mind && (user.mind.assigned_role == "Clown")) diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index a3add5a8aa7..903fbe84b9a 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -16,7 +16,7 @@ var/screen = 0 -/obj/item/weapon/paper_bundle/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/paper_bundle/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() var/obj/item/weapon/paper/P if(istype(W, /obj/item/weapon/paper)) @@ -60,7 +60,7 @@ if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/toy/crayon)) usr << browse("", "window=[name]") //Closes the dialog P = src[page] - P.attackby(W, user) + P.attackby(W, user, params) update_icon() diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 7ee5d21beb2..c56de422e79 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -75,7 +75,7 @@ return -/obj/item/weapon/paper_bin/attackby(obj/item/weapon/paper/i as obj, mob/user as mob) +/obj/item/weapon/paper_bin/attackby(obj/item/weapon/paper/i as obj, mob/user as mob, params) if(!istype(i)) return diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 2ca5834f56b..da213c0ba76 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -102,7 +102,7 @@ sleep(15) updateUsrDialog() -/obj/machinery/photocopier/attackby(obj/item/O as obj, mob/user as mob) +/obj/machinery/photocopier/attackby(obj/item/O as obj, mob/user as mob, params) if(istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo) || istype(O, /obj/item/weapon/paper_bundle)) if(!copyitem) user.drop_item() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 111acf13f5f..412d132a9ff 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -35,7 +35,7 @@ /obj/item/weapon/photo/attack_self(mob/user as mob) src.examine(user) -/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob) +/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob, params) if(istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon)) var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text) txt = copytext(txt, 1, 128) @@ -171,7 +171,7 @@ user << "You switch the camera [on ? "on" : "off"]." return -/obj/item/device/camera/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/device/camera/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/device/camera_film)) if(pictures_left) user << "[src] still has some film in it!" diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 89ba5734241..2bd10af8f20 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -145,7 +145,7 @@ //No other icons for it atm -/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user) +/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params) if(!istype(W) || !user) return if(istype(W, /obj/item/weapon/wrench)) if(!anchored) diff --git a/code/modules/power/antimatter/engine.dm b/code/modules/power/antimatter/engine.dm index 77512fb5b0b..3a0967646a8 100644 --- a/code/modules/power/antimatter/engine.dm +++ b/code/modules/power/antimatter/engine.dm @@ -37,7 +37,7 @@ return -/obj/machinery/power/am_engine/injector/attackby(obj/item/weapon/fuel/F, mob/user) +/obj/machinery/power/am_engine/injector/attackby(obj/item/weapon/fuel/F, mob/user, params) if( (stat & BROKEN) || !connected) return if(istype(F, /obj/item/weapon/fuel/H)) diff --git a/code/modules/power/antimatter/fuel.dm b/code/modules/power/antimatter/fuel.dm index f4250bf9378..b81bc1ff13a 100644 --- a/code/modules/power/antimatter/fuel.dm +++ b/code/modules/power/antimatter/fuel.dm @@ -20,7 +20,7 @@ content = "Anti-Hydrogen" fuel = 1e-12 //pico-kilogram -/obj/item/weapon/fuel/attackby(obj/item/weapon/fuel/F, mob/user) +/obj/item/weapon/fuel/attackby(obj/item/weapon/fuel/F, mob/user, params) ..() if(istype(src, /obj/item/weapon/fuel/antiH)) if(istype(F, /obj/item/weapon/fuel/antiH)) diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index 6290f15f087..736237ad55c 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -135,7 +135,7 @@ proc/cardinalrange(var/center) else if(processing) shutdown_core() -/obj/machinery/am_shielding/attackby(obj/item/W, mob/user) +/obj/machinery/am_shielding/attackby(obj/item/W, mob/user, params) if(!istype(W) || !user) return if(W.force > 10) stability -= W.force/2 @@ -213,7 +213,7 @@ proc/cardinalrange(var/center) m_amt = 100 w_amt = 2000 -/obj/item/device/am_shielding_container/attackby(var/obj/item/I, var/mob/user) +/obj/item/device/am_shielding_container/attackby(var/obj/item/I, var/mob/user, params) if(istype(I, /obj/item/device/multitool) && istype(src.loc,/turf)) new/obj/machinery/am_shielding(src.loc) del(src) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 2e09cd993a9..86dfcc247c4 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, params) 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/cable.dm b/code/modules/power/cable.dm index 54741e0245d..4e3e9410ed1 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -1,6 +1,6 @@ // attach a wire to a power machine - leads from the turf you are standing on -/obj/machinery/power/attackby(obj/item/weapon/W, mob/user) +/obj/machinery/power/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/stack/cable_coil)) @@ -120,7 +120,7 @@ /obj/structure/cable/attack_tk(mob/user) return -/obj/structure/cable/attackby(obj/item/W, mob/user) +/obj/structure/cable/attackby(obj/item/W, mob/user, params) var/turf/T = src.loc if(T.intact) @@ -278,7 +278,7 @@ usr << "\blue You cannot do that." ..() -/obj/item/stack/cable_coil/attackby(obj/item/weapon/W, mob/user) +/obj/item/stack/cable_coil/attackby(obj/item/weapon/W, mob/user, params) ..() if( istype(W, /obj/item/weapon/wirecutters) && src.amount > 1) src.amount-- diff --git a/code/modules/power/cable_heavyduty.dm b/code/modules/power/cable_heavyduty.dm index 36bd4f93eb7..111b5b7ec3d 100644 --- a/code/modules/power/cable_heavyduty.dm +++ b/code/modules/power/cable_heavyduty.dm @@ -9,7 +9,7 @@ desc = "This cable is tough. It cannot be cut with simple hand tools." layer = 2.39 //Just below pipes, which are at 2.4 -/obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user) +/obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user, params) var/turf/T = src.loc if(T.intact) diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 606d58a4724..a6a35858216 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -76,7 +76,7 @@ SNG.drain("CELL",src,H.wear_suit) return -/obj/item/weapon/stock_parts/cell/attackby(obj/item/W, mob/user) +/obj/item/weapon/stock_parts/cell/attackby(obj/item/W, mob/user, params) ..() if(istype(W, /obj/item/weapon/reagent_containers/syringe)) var/obj/item/weapon/reagent_containers/syringe/S = W diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 0acf4a854d4..bd590c766f0 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -118,7 +118,7 @@ if(stat & (BROKEN|NOPOWER)) return interact(user) -/obj/machinery/power/generator/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/power/generator/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) anchored = !anchored user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor." diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index c9ac32da530..872303d3e91 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -63,8 +63,8 @@ var/const/GRAV_NEEDS_WRENCH = 3 /obj/machinery/gravity_generator/part var/obj/machinery/gravity_generator/main/main_part = null -/obj/machinery/gravity_generator/part/attackby(obj/item/I as obj, mob/user as mob) - return main_part.attackby(I, user) +/obj/machinery/gravity_generator/part/attackby(obj/item/I as obj, mob/user as mob, params) + return main_part.attackby(I, user, params) /obj/machinery/gravity_generator/part/get_status() return main_part.get_status() @@ -177,7 +177,7 @@ var/const/GRAV_NEEDS_WRENCH = 3 // Interaction // Fixing the gravity generator. -/obj/machinery/gravity_generator/main/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/gravity_generator/main/attackby(obj/item/I as obj, mob/user as mob, params) var/old_broken_state = broken_state switch(broken_state) if(GRAV_NEEDS_SCREWDRIVER) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 5aef5c541af..856443396c5 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, params) 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, params) 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, params) //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!" @@ -399,13 +399,14 @@ continue M.show_message("[user.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2) if(on && (W.flags & CONDUCT)) - //if(!user.mutations & M_RESIST_COLD) + //if(!user.mutations & RESIST_COLD) if (prob(12)) electrocute_mob(user, get_area(src), src, 0.3) broken() else - user << "You hit the light!" + user.visible_message("[user.name] hits the light.") + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) // attempt to stick weapon into light socket else if(status == LIGHT_EMPTY) @@ -435,7 +436,7 @@ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(3, 1, src) s.start() - //if(!user.mutations & M_RESIST_COLD) + //if(!user.mutations & RESIST_COLD) if (prob(75)) electrocute_mob(user, get_area(src), src, rand(0.7,1.0)) @@ -471,8 +472,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 +483,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 @@ -511,9 +512,9 @@ else prot = 1 - if(prot > 0 || (M_RESIST_HEAT in user.mutations)) + if(prot > 0 || (RESIST_HEAT in user.mutations)) user << "You remove the light [fitting]" - else if(M_TK in user.mutations) + else if(TK in user.mutations) user << "You telekinetically remove the light [fitting]." else user << "You try to remove the light [fitting], but you burn your hand on it!" @@ -730,7 +731,7 @@ // attack bulb/tube with object // if a syringe, can inject plasma to make it explode -/obj/item/weapon/light/attackby(var/obj/item/I, var/mob/user) +/obj/item/weapon/light/attackby(var/obj/item/I, var/mob/user, params) ..() if(istype(I, /obj/item/weapon/reagent_containers/syringe)) var/obj/item/weapon/reagent_containers/syringe/S = I diff --git a/code/modules/power/pacman2.dm b/code/modules/power/pacman2.dm index 52ec28bff56..cddda73be6e 100644 --- a/code/modules/power/pacman2.dm +++ b/code/modules/power/pacman2.dm @@ -72,7 +72,7 @@ overheat() explosion(get_turf(src), 2, 5, 2, -1) - attackby(var/obj/item/O as obj, var/mob/user as mob) + attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/tank/plasma)) if(P) user << "\red The generator already has a plasma tank loaded!" diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index d918ec86711..a434098da03 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -26,7 +26,7 @@ /obj/machinery/power/port_gen/process() ideally we're looking to generate 5000 -/obj/machinery/power/port_gen/attackby(obj/item/weapon/W, mob/user) +/obj/machinery/power/port_gen/attackby(obj/item/weapon/W, mob/user, params) tank [un]loading stuff /obj/machinery/power/port_gen/attack_hand(mob/user) @@ -199,7 +199,7 @@ display round(lastgen) and plasmatank amount /obj/machinery/power/port_gen/pacman/proc/overheat() explosion(src.loc, 2, 5, 2, -1) -/obj/machinery/power/port_gen/pacman/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/power/port_gen/pacman/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if(istype(O, sheet_path)) var/obj/item/stack/addstack = O var/amount = min((max_sheets - sheets), addstack.amount) diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 0f1340ac0d8..b59c01d9a23 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -50,7 +50,7 @@ var/global/list/rad_collectors = list() ..() -/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user) +/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/device/analyzer)) user << "\blue The [W.name] detects that [last_power]W were recently produced." return 1 diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 8e9e16c9943..b198a50bd8f 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -144,7 +144,7 @@ A.process() //TODO: Carn: check this out -/obj/machinery/power/emitter/attackby(obj/item/W, mob/user) +/obj/machinery/power/emitter/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/wrench)) if(active) diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 72bbc3804ea..851bbe20eb2 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -95,7 +95,7 @@ field_generator power level display return -/obj/machinery/field_generator/attackby(obj/item/W, mob/user) +/obj/machinery/field_generator/attackby(obj/item/W, mob/user, params) if(active) user << "The [src] needs to be off." return diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm index bcd8403b54c..1a88f444d24 100644 --- a/code/modules/power/singularity/generator.dm +++ b/code/modules/power/singularity/generator.dm @@ -29,7 +29,7 @@ new /obj/machinery/singularity/(T, 50) if(src) del(src) -/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user) +/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/wrench)) anchored = !anchored playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index ed441450ca8..b645f7b6b79 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -120,7 +120,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin return -/obj/structure/particle_accelerator/attackby(obj/item/W, mob/user) +/obj/structure/particle_accelerator/attackby(obj/item/W, mob/user, params) if(istool(W)) if(src.process_tool_hit(W,user)) return @@ -314,7 +314,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin return -/obj/machinery/particle_accelerator/attackby(obj/item/W, mob/user) +/obj/machinery/particle_accelerator/attackby(obj/item/W, mob/user, params) if(istool(W)) if(src.process_tool_hit(W,user)) return diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 3fe245d34dd..1f1e01938fb 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -107,7 +107,7 @@ return -/obj/machinery/power/smes/attackby(obj/item/I, mob/user) +/obj/machinery/power/smes/attackby(obj/item/I, mob/user, params) //opening using screwdriver if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I)) update_icon() diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index b8356cacc34..7b9df9303b2 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -57,7 +57,7 @@ var/list/solars_list = list() -/obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user) +/obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/crowbar)) playsound(src.loc, 'sound/machines/click.ogg', 50, 1) @@ -223,7 +223,7 @@ var/list/solars_list = list() glass_type = null -/obj/item/solar_assembly/attackby(var/obj/item/weapon/W, var/mob/user) +/obj/item/solar_assembly/attackby(var/obj/item/weapon/W, var/mob/user, params) if(!anchored && isturf(loc)) if(istype(W, /obj/item/weapon/wrench)) @@ -396,7 +396,7 @@ var/list/solars_list = list() ui.push_data(data) return -/obj/machinery/power/solar_control/attackby(I as obj, user as mob) +/obj/machinery/power/solar_control/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm index 5cf341f9fbb..9b66f6afb91 100644 --- a/code/modules/power/tracker.dm +++ b/code/modules/power/tracker.dm @@ -58,7 +58,7 @@ if(powernet && (powernet == control.powernet)) //update if we're still in the same powernet control.cdir = angle -/obj/machinery/power/tracker/attackby(var/obj/item/weapon/W, var/mob/user) +/obj/machinery/power/tracker/attackby(var/obj/item/weapon/W, var/mob/user, params) if(istype(W, /obj/item/weapon/crowbar)) playsound(src.loc, 'sound/machines/click.ogg', 50, 1) diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 4baa6efe685..cf35f456da8 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -222,7 +222,7 @@ doors += P /* -/obj/machinery/computer/turbine_computer/attackby(I as obj, user as mob) +/obj/machinery/computer/turbine_computer/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index fc7641ab552..136d589b75d 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -30,7 +30,7 @@ -/obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/screwdriver)) if(BB) if(initial(BB.name) == "bullet") @@ -95,7 +95,7 @@ return 1 return 0 -/obj/item/ammo_box/attackby(var/obj/item/A as obj, mob/user as mob, var/silent = 0) +/obj/item/ammo_box/attackby(var/obj/item/A as obj, mob/user as mob, var/silent = 0, params) var/num_loaded = 0 if(istype(A, /obj/item/ammo_box)) var/obj/item/ammo_box/AM = A diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 35fbeb2de35..e01dbaa775b 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -78,11 +78,11 @@ return 1 /obj/item/weapon/gun/proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)//TODO: go over this - //Exclude lasertag guns from the M_CLUMSY check. + //Exclude lasertag guns from the CLUMSY check. if(clumsy_check) if(istype(user, /mob/living)) var/mob/living/M = user - if ((M_CLUMSY in M.mutations) && prob(50)) + if ((CLUMSY in M.mutations) && prob(50)) M << "[src] blows up in your face." M.take_organ_damage(0,20) M.drop_item() @@ -94,7 +94,7 @@ return if(istype(user, /mob/living)) var/mob/living/M = user - if (M_HULK in M.mutations) + if (HULK in M.mutations) M << "\red Your meaty finger is much too large for the trigger guard!" return if(ishuman(user)) @@ -153,7 +153,7 @@ in_chamber.loc = get_turf(user) in_chamber.starting = get_turf(user) in_chamber.shot_from = src - user.next_move = world.time + 4 + user.changeNext_move(CLICK_CD_RANGE) in_chamber.silenced = silenced in_chamber.current = curloc in_chamber.yo = targloc.y - curloc.y @@ -276,7 +276,7 @@ return ..() //Pistolwhippin' -/obj/item/weapon/gun/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/attackby(var/obj/item/A as obj, mob/user as mob, params) if(istype(A, /obj/item/device/flashlight/seclite)) var/obj/item/device/flashlight/seclite/S = A if(can_flashlight) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 939304a4441..befa0720b66 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -53,7 +53,7 @@ return /* - attackby(obj/item/weapon/W, mob/user) + attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/stock_parts/cell)) if(!power_supply) user.drop_item() diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 368ba27af2f..94d4869c5ec 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -58,7 +58,7 @@ return -/obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob, params) ..() if (istype(A, /obj/item/ammo_box/magazine)) var/obj/item/ammo_box/magazine/AM = A diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index 9371a09469a..e3c5ce80533 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -17,7 +17,7 @@ icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][silenced ? "-suppressed" : ""]" return -/obj/item/weapon/gun/projectile/automatic/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/automatic/attackby(var/obj/item/A as obj, mob/user as mob, params) if(..() && chambered) alarmed = 0 @@ -103,7 +103,7 @@ user << "You remove the magazine from [src]." -/obj/item/weapon/gun/projectile/automatic/l6_saw/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/automatic/l6_saw/attackby(var/obj/item/A as obj, mob/user as mob, params) if(!cover_open && istype(A, mag_type)) user << "[src]'s cover is closed! You can't insert a new mag!" return @@ -174,11 +174,11 @@ else underbarrel.afterattack(target, user, flag, params) -/obj/item/weapon/gun/projectile/automatic/c90gl/attackby(var/obj/item/A, mob/user) +/obj/item/weapon/gun/projectile/automatic/c90gl/attackby(var/obj/item/A, mob/user, params) if(select) ..() else - underbarrel.attackby(A, user) + underbarrel.attackby(A, user, params) /obj/item/weapon/gun/projectile/automatic/c90gl/attack_self(var/mob/living/user) if(select) diff --git a/code/modules/projectiles/guns/projectile/crossbow.dm b/code/modules/projectiles/guns/projectile/crossbow.dm index eea9054fce5..012f0f7dc3e 100644 --- a/code/modules/projectiles/guns/projectile/crossbow.dm +++ b/code/modules/projectiles/guns/projectile/crossbow.dm @@ -137,7 +137,7 @@ user.visible_message("[usr] draws back the string of [src]!","You continue drawing back the string of [src]!") spawn(25) increase_tension(user) -/obj/item/weapon/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob, params) if(!in_chamber) if (istype(W,/obj/item/weapon/arrow)) user.drop_item() @@ -195,7 +195,7 @@ /obj/item/weapon/gun/launcher/crossbow/french name = "french powered crossbow" -/obj/item/weapon/gun/launcher/crossbow/french/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/gun/launcher/crossbow/french/attackby(obj/item/W as obj, mob/user as mob, params) if(!in_chamber) if (istype(W,/obj/item/weapon/reagent_containers/food/snacks/baguette)) user.drop_item() @@ -255,7 +255,7 @@ if(4) usr << "It has a steel backbone, plastic lath and a cell mount installed." if(5) usr << "It has a steel cable loosely strung across the lath." -/obj/item/weapon/crossbowframe/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/crossbowframe/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/stack/rods)) if(buildstate == 0) var/obj/item/stack/rods/R = W diff --git a/code/modules/projectiles/guns/projectile/launchers.dm b/code/modules/projectiles/guns/projectile/launchers.dm index d1d7e471f1b..fee2e2fef71 100644 --- a/code/modules/projectiles/guns/projectile/launchers.dm +++ b/code/modules/projectiles/guns/projectile/launchers.dm @@ -38,7 +38,7 @@ mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/grenadelauncher" w_class = 3 -/obj/item/weapon/gun/projectile/revolver/grenadelauncher/attackby(var/obj/item/A, mob/user) +/obj/item/weapon/gun/projectile/revolver/grenadelauncher/attackby(var/obj/item/A, mob/user, params) ..() if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing)) chamber_round() diff --git a/code/modules/projectiles/guns/projectile/pneumatic.dm b/code/modules/projectiles/guns/projectile/pneumatic.dm index 6729a18663e..50f5d33d1e8 100644 --- a/code/modules/projectiles/guns/projectile/pneumatic.dm +++ b/code/modules/projectiles/guns/projectile/pneumatic.dm @@ -51,7 +51,7 @@ else usr << "There's no tank in [src]." -/obj/item/weapon/gun/launcher/pneumatic/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/gun/launcher/pneumatic/attackby(obj/item/W as obj, mob/user as mob, params) if(!tank && istype(W,/obj/item/weapon/tank)) user.drop_item() tank = W @@ -154,7 +154,7 @@ if(4) usr << "It has an outer chassis welded in place." if(5) usr << "It has a transfer valve installed." -/obj/item/weapon/cannonframe/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/cannonframe/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/pipe)) if(buildstate == 0) user.drop_item() diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm index 0e2c4d86611..0879e11caf8 100644 --- a/code/modules/projectiles/guns/projectile/revolver.dm +++ b/code/modules/projectiles/guns/projectile/revolver.dm @@ -14,7 +14,7 @@ /obj/item/weapon/gun/projectile/revolver/process_chambered() return ..(0, 1) -/obj/item/weapon/gun/projectile/revolver/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/revolver/attackby(var/obj/item/A as obj, mob/user as mob, params) var/num_loaded = 0 if(istype(A, /obj/item/ammo_box)) var/obj/item/ammo_box/AM = A @@ -115,7 +115,7 @@ M << "Your gun is now skinned as [choice]. Say hello to your new friend." return 1 -/obj/item/weapon/gun/projectile/revolver/detective/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/revolver/detective/attackby(var/obj/item/A as obj, mob/user as mob, params) ..() if(istype(A, /obj/item/weapon/screwdriver) || istype(A, /obj/item/weapon/conversion_kit)) if(magazine.caliber == "38") @@ -181,7 +181,7 @@ chamber_round() spun = 1 -/obj/item/weapon/gun/projectile/revolver/russian/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/revolver/russian/attackby(var/obj/item/A as obj, mob/user as mob, params) ..() user.visible_message("[user] spins the chamber of the revolver.", "You spin the revolver's chamber.") if(get_ammo() > 0) diff --git a/code/modules/projectiles/guns/projectile/rocket.dm b/code/modules/projectiles/guns/projectile/rocket.dm index d21987e4a1c..8df666a62a4 100644 --- a/code/modules/projectiles/guns/projectile/rocket.dm +++ b/code/modules/projectiles/guns/projectile/rocket.dm @@ -8,7 +8,7 @@ throw_speed = 2 throw_range = 10 force = 5.0 - flags = CONDUCT | USEDELAY + flags = CONDUCT origin_tech = "combat=8;materials=5" projectile = /obj/item/missile var/missile_speed = 2 @@ -22,7 +22,7 @@ if (!(usr in view(2)) && usr!=src.loc) return usr << "\blue [rockets.len] / [max_rockets] rockets." -/obj/item/weapon/gun/rocketlauncher/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/gun/rocketlauncher/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/ammo_casing/rocket)) if(rockets.len < max_rockets) user.drop_item() diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 14770f4727c..c5c7eb6cc7c 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -11,7 +11,7 @@ var/recentpump = 0 // to prevent spammage mag_type = "/obj/item/ammo_box/magazine/internal/shot" -/obj/item/weapon/gun/projectile/shotgun/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/shotgun/attackby(var/obj/item/A as obj, mob/user as mob, params) var/num_loaded = 0 if(istype(A, /obj/item/ammo_box)) var/obj/item/ammo_box/AM = A @@ -93,7 +93,7 @@ mag_type = "/obj/item/ammo_box/magazine/internal/shotriot" sawn_desc = "Come with me if you want to live." -/obj/item/weapon/gun/projectile/shotgun/riot/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/shotgun/riot/attackby(var/obj/item/A as obj, mob/user as mob, params) ..() if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/melee/energy) || istype(A, /obj/item/weapon/pickaxe/plasmacutter)) sawoff(user) @@ -150,7 +150,7 @@ mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/dualshot" sawn_desc = "Omar's coming!" -/obj/item/weapon/gun/projectile/revolver/doublebarrel/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/revolver/doublebarrel/attackby(var/obj/item/A as obj, mob/user as mob, params) ..() if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing)) chamber_round() @@ -204,7 +204,7 @@ mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/improvised" sawn_desc = "I'm just here for the gasoline." -/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/attackby(var/obj/item/A as obj, mob/user as mob) +/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/attackby(var/obj/item/A as obj, mob/user as mob, params) ..() if(istype(A, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = A diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index b030faa14d6..c992e972fa5 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -187,7 +187,7 @@ add_fingerprint(usr) return 1 // update UIs attached to this object -/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/reagent_containers/B as obj, var/mob/user as mob) +/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/reagent_containers/B as obj, var/mob/user as mob, params) if(isrobot(user)) return @@ -218,7 +218,7 @@ overlays += icon_beaker return -/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) +/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob, params) ..() if(istype(B, /obj/item/device/multitool)) if(hackedcheck == 0) @@ -314,7 +314,7 @@ for(i=1, i<=M.rating, i++) dispensable_reagents = sortList(dispensable_reagents | special_reagents[i]) -/obj/machinery/chem_dispenser/constructable/attackby(var/obj/item/I, var/mob/user) +/obj/machinery/chem_dispenser/constructable/attackby(var/obj/item/I, var/mob/user, params) if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(panel_open) user << "Close the maintenance panel first." @@ -400,7 +400,7 @@ spawn(rand(0, 15)) stat |= NOPOWER -/obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) +/obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob, params) if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B, /obj/item/weapon/reagent_containers/food/drinks/drinkingglass)) @@ -933,7 +933,7 @@ return -/obj/machinery/computer/pandemic/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/machinery/computer/pandemic/attackby(var/obj/I as obj, var/mob/user as mob, params) if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(stat & (NOPOWER|BROKEN)) return if(src.beaker) @@ -1030,7 +1030,7 @@ return -/obj/machinery/reagentgrinder/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/reagentgrinder/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (istype(O,/obj/item/weapon/reagent_containers/glass) || \ diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index fd8d1334e30..2663bc9e485 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -398,7 +398,7 @@ datum on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom - if (M_FAT in M.mutations) + if (FAT in M.mutations) M.gib() ..() return @@ -2264,46 +2264,6 @@ datum ..() return - - potassium_chloride - name = "Potassium Chloride" - id = "potassium_chloride" - description = "A delicious salt that stops the heart when injected into cardiac muscle." - reagent_state = SOLID - color = "#FFFFFF" // rgb: 255,255,255 - overdose = 30 - - on_mob_life(var/mob/living/carbon/M as mob) - var/mob/living/carbon/human/H = M - if(H.stat != 1) - if (volume >= overdose) - if(H.losebreath >= 10) - H.losebreath = max(10, H.losebreath-10) - H.adjustOxyLoss(2) - H.Weaken(10) - ..() - return - - potassium_chlorophoride - name = "Potassium Chlorophoride" - id = "potassium_chlorophoride" - description = "A specific chemical based on Potassium Chloride to stop the heart for surgery. Not safe to eat!" - reagent_state = SOLID - color = "#FFFFFF" // rgb: 255,255,255 - overdose = 20 - - on_mob_life(var/mob/living/carbon/M as mob) - if(ishuman(M)) - var/mob/living/carbon/human/H = M - if(H.stat != 1) - if(H.losebreath >= 10) - H.losebreath = max(10, M.losebreath-10) - H.adjustOxyLoss(2) - H.Weaken(10) - ..() - return - - /////////////////////////Food Reagents//////////////////////////// // Part of the food code. Nutriment is used instead of the old "heal_amt" code. Also is where all the food // condiments, additives, and such go. @@ -3298,7 +3258,7 @@ datum on_mob_life(var/mob/living/M as mob, var/alien) // Sobering multiplier. // Sober block makes it more difficult to get drunk - var/sober_str=!(M_SOBER in M.mutations)?1:2 + var/sober_str=!(SOBER in M.mutations)?1:2 M:nutrition += nutriment_factor holder.remove_reagent(src.id, FOOD_METABOLISM) if(!src.data) data = 1 @@ -3631,6 +3591,11 @@ datum reagent_state = LIQUID color = "#664300" // rgb: 102, 67, 0 + on_mob_life(var/mob/living/M as mob) + M.Stun(2) + ..() + return + changelingsting name = "Changeling Sting" id = "changelingsting" @@ -3868,10 +3833,6 @@ datum reagent_state = LIQUID color = "#664300" // rgb: 102, 67, 0 - on_mob_life(var/mob/living/M as mob) - ..() - M.stunned = 4 - return neurotoxin name = "Neurotoxin" @@ -3881,12 +3842,22 @@ datum color = "#2E2E61" // rgb: 46, 46, 97 on_mob_life(var/mob/living/M as mob) + M.weakened = max(M.weakened, 3) + if(!data) + data = 1 + data++ + M.dizziness +=6 + if(data >= 15 && data <45) + if (!M.slurring) + M.slurring = 1 + M.slurring += 3 + else if(data >= 45 && prob(50) && data <55) + M.confused = max(M.confused+3,0) + else if(data >=55) + M.druggy = max(M.druggy, 55) + else if(data >=200) + M.adjustToxLoss(2) ..() - if(!M) M = holder.my_atom - M:adjustOxyLoss(0.5) - M:adjustOxyLoss(0.5) - M:weakened = max(M:weakened, 15) - M:silent = max(M:silent, 15) return bananahonk diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 0cc8356150c..c225c2a9f69 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -338,8 +338,8 @@ datum name = "Glycerol" id = "glycerol" result = "glycerol" - required_reagents = list("cornoil" = 3, "sacid" = 2) - result_amount = 5 + required_reagents = list("cornoil" = 3, "sacid" = 1) + result_amount = 1 nitroglycerin name = "Nitroglycerin" @@ -459,20 +459,6 @@ datum required_reagents = list("ethanol" = 1, "chlorine" = 3, "water" = 1) result_amount = 1 - potassium_chloride - name = "Potassium Chloride" - id = "potassium_chloride" - result = "potassium_chloride" - required_reagents = list("sodiumchloride" = 1, "potassium" = 1) - result_amount = 2 - - potassium_chlorophoride - name = "Potassium Chlorophoride" - id = "potassium_chlorophoride" - result = "potassium_chlorophoride" - required_reagents = list("potassium_chloride" = 1, "plasma" = 1, "chloralhydrate" = 1) - result_amount = 4 - stoxin name = "Sleep Toxin" id = "stoxin" @@ -484,8 +470,8 @@ datum name = "Zombie Powder" id = "zombiepowder" result = "zombiepowder" - required_reagents = list("carpotoxin" = 1, "stoxin" = 1, "copper" = 1) - result_amount = 3 + required_reagents = list("carpotoxin" = 5, "stoxin" = 5, "copper" = 5) + result_amount = 2 mutetoxin name = "Mute toxin" @@ -1469,7 +1455,7 @@ datum required_other = 1 on_reaction(var/datum/reagents/holder) feedback_add_details("slime_cores_used","[replacetext(name," ","_")]") - var/obj/effect/golem_rune/Z = new /obj/effect/golem_rune + var/obj/effect/goleRUNe/Z = new /obj/effect/goleRUNe Z.loc = get_turf(holder.my_atom) Z.announce_to_ghosts() //Bluespace diff --git a/code/modules/reagents/dartgun.dm b/code/modules/reagents/dartgun.dm index 7760654c715..151b6ea1841 100644 --- a/code/modules/reagents/dartgun.dm +++ b/code/modules/reagents/dartgun.dm @@ -70,7 +70,7 @@ for(var/datum/reagent/R in B.reagents.reagent_list) usr << "\blue [R.volume] units of [R.name]" -/obj/item/weapon/gun/dartgun/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/gun/dartgun/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/dart_cartridge)) var/obj/item/weapon/dart_cartridge/D = I diff --git a/code/modules/reagents/grenade_launcher.dm b/code/modules/reagents/grenade_launcher.dm index 43fe7311938..54538e57a7b 100644 --- a/code/modules/reagents/grenade_launcher.dm +++ b/code/modules/reagents/grenade_launcher.dm @@ -20,7 +20,7 @@ usr << "\icon [src] Grenade launcher:" usr << "\blue [grenades] / [max_grenades] Grenades." - attackby(obj/item/I as obj, mob/user as mob) + attackby(obj/item/I as obj, mob/user as mob, params) if((istype(I, /obj/item/weapon/grenade))) if(grenades.len < max_grenades) diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 911ce73784c..76c4b2bcb6f 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -39,7 +39,7 @@ // possibly intentional, but removing it allows us to not duplicate functionality. // -Sayu (storage conslidation) /* -/obj/item/weapon/reagent_containers/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/attackby(obj/item/I as obj, mob/user as mob, params) return */ /obj/item/weapon/reagent_containers/afterattack(obj/target, mob/user , flag) diff --git a/code/modules/reagents/reagent_containers/drugs.dm b/code/modules/reagents/reagent_containers/drugs.dm index 6d8c83cf2c4..bbe868e5430 100644 --- a/code/modules/reagents/reagent_containers/drugs.dm +++ b/code/modules/reagents/reagent_containers/drugs.dm @@ -91,7 +91,7 @@ return - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) var/tmp_label = sanitize(input(user, "Enter a label for [src.name]","Label",src.label_text)) if(length(tmp_label) > 10) diff --git a/code/modules/reagents/reagent_containers/food/condiment.dm b/code/modules/reagents/reagent_containers/food/condiment.dm index dde17fa7f9a..5b7383f04d6 100644 --- a/code/modules/reagents/reagent_containers/food/condiment.dm +++ b/code/modules/reagents/reagent_containers/food/condiment.dm @@ -17,7 +17,7 @@ var/list/possible_states = list("ketchup" = list("ketchup", "Ketchup", "You feel more American already."), "capsaicin" = list("hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), "enzyme" = list("enzyme", "Universal Enzyme", "Used in cooking various dishes"), "soysauce" = list("soysauce", "Soy Sauce", "A salty soy-based flavoring"), "frostoil" = list("coldsauce", "Coldsauce", "Leaves the tongue numb in it's passage"), "sodiumchloride" = list("saltshaker", "Salt Shaker", "Salt. From space oceans, presumably"), "blackpepper" = list("pepermillsmall", "Pepper Mill", "Often used to flavor food or make people sneeze"), "cornoil" = list("oliveoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), "sugar" = list("emptycondiment", "Sugar", "Tasty spacey sugar!")) -/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/weapon/W as obj, mob/user as mob, params) return @@ -66,7 +66,7 @@ return 1 return 0 -/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/I as obj, mob/user as mob, params) return /obj/item/weapon/reagent_containers/food/condiment/afterattack(obj/target, mob/user , proximity) diff --git a/code/modules/reagents/reagent_containers/food/sandwich.dm b/code/modules/reagents/reagent_containers/food/sandwich.dm index 585a1c3711a..1ecb6bdf897 100644 --- a/code/modules/reagents/reagent_containers/food/sandwich.dm +++ b/code/modules/reagents/reagent_containers/food/sandwich.dm @@ -1,10 +1,10 @@ /* -/obj/item/weapon/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/shard) || istype(W,/obj/item/weapon/reagent_containers/food/snacks)) var/obj/item/weapon/reagent_containers/food/snacks/csandwich/S = new(get_turf(src)) - S.attackby(W,user) + S.attackby(W,user, params) del(src) ..() @@ -17,7 +17,7 @@ var/list/ingredients = list() -/obj/item/weapon/reagent_containers/food/snacks/csandwich/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/csandwich/attackby(obj/item/W as obj, mob/user as mob, params) var/sandwich_limit = 4 for(var/obj/item/O in ingredients) diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index ceedd371255..ce7af28cad7 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -134,14 +134,14 @@ usr << "\blue \The [src] was bitten multiple times!" -/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W, mob/user) +/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W, mob/user, params) if(istype(W,/obj/item/weapon/pen)) var/n_name = sanitize(copytext(input(usr, "What would you like to name this dish?", "Food Renaming", null) as text, 1, MAX_NAME_LEN)) if((loc == usr && usr.stat == 0)) name = "[n_name]" return if(istype(W,/obj/item/weapon/storage)) - ..() // -> item/attackby() + ..() // -> item/attackby(, params) if(istype(W,/obj/item/weapon/kitchen/utensil)) @@ -525,7 +525,7 @@ src.visible_message("\red [src.name] has been squashed.","\red You hear a smack.") del(src) - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype( W, /obj/item/toy/crayon )) var/obj/item/toy/crayon/C = W var/clr = C.colourName @@ -1243,8 +1243,7 @@ icon_state = "chinese2" New() ..() - reagents.add_reagent("nutriment", 5) - reagents.add_reagent("carpotoxin", 1) + reagents.add_reagent("nutriment", 6) bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/chinese/newdles @@ -2230,7 +2229,7 @@ ..() reagents.add_reagent("nutriment", 3) bitesize = 1 - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/kitchen/rollingpin)) user.visible_message( \ "[user] flattens the dough with the rolling pin!", \ @@ -2850,7 +2849,7 @@ update_icon() -/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob ) +/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob , params) if( istype(I, /obj/item/pizzabox/) ) var/obj/item/pizzabox/box = I @@ -3152,7 +3151,7 @@ reagents.add_reagent("nutriment", 3) // Flour + egg = dough -/obj/item/weapon/reagent_containers/food/snacks/flour/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/flour/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/egg)) new /obj/item/weapon/reagent_containers/food/snacks/dough(src) user << "You make some dough." @@ -3160,7 +3159,7 @@ del(src) // Egg + flour = dough -/obj/item/weapon/reagent_containers/food/snacks/egg/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/egg/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/flour)) new /obj/item/weapon/reagent_containers/food/snacks/dough(src) user << "You make some dough." @@ -3178,7 +3177,7 @@ reagents.add_reagent("nutriment", 3) // Dough + rolling pin = flat dough -/obj/item/weapon/reagent_containers/food/snacks/dough/attackby(obj/item/I, mob/user) +/obj/item/weapon/reagent_containers/food/snacks/dough/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/kitchen/rollingpin)) if(isturf(loc)) new /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough(loc) @@ -3281,7 +3280,7 @@ reagents.add_reagent("nutriment", 3) // potato + knife = raw sticks -/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/kitchen/utensil/knife)) new /obj/item/weapon/reagent_containers/food/snacks/rawsticks(src) user << "You cut the potato." diff --git a/code/modules/reagents/reagent_containers/food/snacks/grown.dm b/code/modules/reagents/reagent_containers/food/snacks/grown.dm index c2c86c01039..d3acf96a7fb 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/grown.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/grown.dm @@ -82,7 +82,7 @@ filling_color = "#E6E8DA" plantname = "potato" -/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/stack/cable_coil)) if(W:amount >= 5) @@ -239,7 +239,7 @@ filling_color = "#125709" plantname = "ambrosia" -/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris/attackby(var/obj/item/W as obj, var/mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris/attackby(var/obj/item/W as obj, var/mob/user as mob, params) if(istype(W, /obj/item/weapon/rollingpaper)) user.unEquip(W) var/obj/item/clothing/mask/cigarette/joint/J = new /obj/item/clothing/mask/cigarette/joint(user.loc) @@ -262,7 +262,7 @@ filling_color = "#229E11" plantname = "ambrosiadeus" -/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus/attackby(var/obj/item/W as obj, var/mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus/attackby(var/obj/item/W as obj, var/mob/user as mob, params) if(istype(W, /obj/item/weapon/rollingpaper)) user.unEquip(W) var/obj/item/clothing/mask/cigarette/joint/deus/J = new /obj/item/clothing/mask/cigarette/joint/deus(user.loc) @@ -317,7 +317,7 @@ filling_color = "#FAB728" plantname = "pumpkin" -/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/twohanded/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/melee/energy)) user.show_message("You carve a face into [src]!", 1) diff --git a/code/modules/reagents/reagent_containers/food/snacks/meat.dm b/code/modules/reagents/reagent_containers/food/snacks/meat.dm index 8809ddc6468..630035ef87d 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/meat.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/meat.dm @@ -9,7 +9,7 @@ reagents.add_reagent("nutriment", 3) src.bitesize = 3 -/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/kitchen/utensil/knife)) new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src) new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index ee8b39ce66b..d3c160d0216 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -158,7 +158,7 @@ spawn(5) src.reagents.clear_reagents() return - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) var/tmp_label = sanitize(input(user, "Enter a label for [src.name]","Label",src.label_text)) @@ -293,7 +293,7 @@ volume = 120 flags = OPENCONTAINER - attackby(var/obj/D, mob/user as mob) + attackby(var/obj/D, mob/user as mob, params) if(isprox(D)) user << "You add [D] to [src]." del(D) diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 34ae1e1d65c..7554c15630c 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -47,7 +47,7 @@ attack_paw() return attack_hand() - attackby(obj/item/I as obj, mob/user as mob) + attackby(obj/item/I as obj, mob/user as mob, params) return @@ -64,11 +64,11 @@ user << "\red This syringe is broken!" return - if (user.a_intent == "harm" && ismob(target)) - if((M_CLUMSY in user.mutations) && prob(50)) +/* if (user.a_intent == "harm" && ismob(target)) + if((CLUMSY in user.mutations) && prob(50)) target = user syringestab(target, user) - return + return */ switch(mode) @@ -91,7 +91,7 @@ if(!T.dna) usr << "You are unable to locate any blood. (To be specific, your target seems to be missing their DNA datum)" return - if(M_NOCLONE in T.mutations) //target done been et, no more blood in him + if(NOCLONE in T.mutations) //target done been et, no more blood in him user << "\red You are unable to locate any blood." return diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 58e883716a0..95d8694c449 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -12,7 +12,7 @@ var/amount_per_transfer_from_this = 10 var/possible_transfer_amounts = list(10,25,50,100) - attackby(obj/item/weapon/W as obj, mob/user as mob) + attackby(obj/item/weapon/W as obj, mob/user as mob, params) return New() @@ -126,7 +126,7 @@ rig = null overlays = new/list() -/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W,/obj/item/weapon/wrench)) user.visible_message("[user] wrenches [src]'s faucet [modded ? "closed" : "open"].", \ "You wrench [src]'s faucet [modded ? "closed" : "open"]") diff --git a/code/modules/reagents/syringe_gun.dm b/code/modules/reagents/syringe_gun.dm index 7192eaf1c12..965110d220b 100644 --- a/code/modules/reagents/syringe_gun.dm +++ b/code/modules/reagents/syringe_gun.dm @@ -48,7 +48,7 @@ return 1 -/obj/item/weapon/gun/syringe/attackby(var/obj/item/A as obj, mob/user as mob, var/show_msg = 1) +/obj/item/weapon/gun/syringe/attackby(var/obj/item/A as obj, mob/user as mob, var/show_msg = 1, params) if(istype(A, /obj/item/weapon/reagent_containers/syringe)) if(syringes.len < max_syringes) user.drop_item() diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index e784d8c0050..aa491bb823c 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -111,7 +111,7 @@ break // attack with item, place item on conveyor -/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user) +/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user, params) if(isrobot(user)) return //Carn: fix for borgs dropping their modules on conveyor belts user.drop_item() if(I && I.loc) I.loc = src.loc diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index e914d730c2d..fc6f51bf037 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -145,7 +145,7 @@ // wrench: (un)anchor // weldingtool: convert to real pipe - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) var/nicetype = "pipe" var/ispipe = 0 // Indicates if we should change the level of this pipe src.add_fingerprint(user) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 9de451fd848..8d2c573ce0e 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -43,7 +43,7 @@ // attack by item places it in to disposal - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) if(stat & BROKEN || !I || !user || (I.flags & NODROP)) return @@ -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) @@ -530,7 +538,7 @@ AM.loc = src if(istype(AM, /mob/living/carbon/human)) var/mob/living/carbon/human/H = AM - if(M_FAT in H.mutations) // is a human and fat? + if(FAT in H.mutations) // is a human and fat? has_fat_guy = 1 // set flag on holder if(istype(AM, /obj/structure/bigDelivery) && !hasmob) var/obj/structure/bigDelivery/T = AM @@ -861,7 +869,7 @@ //attack by item //weldingtool: unfasten and convert to obj/disposalconstruct - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) var/turf/T = src.loc if(T.intact) @@ -1015,7 +1023,7 @@ update() return - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) if(..()) return @@ -1162,7 +1170,7 @@ return // Override attackby so we disallow trunkremoval when somethings ontop -/obj/structure/disposalpipe/trunk/attackby(var/obj/item/I, var/mob/user) +/obj/structure/disposalpipe/trunk/attackby(var/obj/item/I, var/mob/user, params) //Disposal bins or chutes /* @@ -1300,7 +1308,7 @@ return - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) if(!I || !user) return src.add_fingerprint(user) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index ea9b0b6023c..43772939fd0 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -24,7 +24,7 @@ AM.loc = T ..() -/obj/structure/bigDelivery/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/bigDelivery/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/device/destTagger)) var/obj/item/device/destTagger/O = W @@ -78,7 +78,7 @@ qdel(src) -/obj/item/smallDelivery/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/smallDelivery/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/device/destTagger)) var/obj/item/device/destTagger/O = W @@ -299,7 +299,7 @@ update() return - attackby(var/obj/item/I, var/mob/user) + attackby(var/obj/item/I, var/mob/user, params) if(!I || !user) return diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 237089dea5c..a0e267392f1 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -74,7 +74,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). /obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials() return g_amount + gold_amount + diamond_amount -/obj/machinery/r_n_d/circuit_imprinter/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/r_n_d/circuit_imprinter/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (shocked) shock(user,50) if (default_deconstruction_screwdriver(user, "circuit_imprinter_t", "circuit_imprinter", O)) diff --git a/code/modules/research/designs/weapon_designs.dm b/code/modules/research/designs/weapon_designs.dm index 51b007cf7ab..2e726e4a053 100644 --- a/code/modules/research/designs/weapon_designs.dm +++ b/code/modules/research/designs/weapon_designs.dm @@ -78,7 +78,7 @@ build_path = /obj/item/weapon/gun/energy/lasercannon locked = 1 category = list("Weapons") - + /datum/design/receiver name = "Modular Receiver" desc = "A prototype modular receiver and trigger assembly for a variety of firearms." @@ -129,7 +129,6 @@ build_type = PROTOLATHE materials = list("$metal" = 5000, "$glass" = 1000) build_path = /obj/item/weapon/gun/syringe/rapidsyringe - locked = 1 category = list("Weapons") /datum/design/stunshell diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 3bbdb2f2db6..57f36ad9179 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -37,7 +37,7 @@ Note: Must be placed within 3 tiles of the R&D Console return temp_list -/obj/machinery/r_n_d/destructive_analyzer/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/r_n_d/destructive_analyzer/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (shocked) shock(user,50) if (default_deconstruction_screwdriver(user, "d_analyzer_t", "d_analyzer", O)) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 2554415323f..81fbad60c95 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -93,7 +93,7 @@ Note: Must be placed west/left of and R&D console to function. A = A / max(1, (being_built.materials[M]/efficiency_coeff)) return A -/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (shocked) shock(user,50) if (default_deconstruction_screwdriver(user, "protolathe_t", "protolathe", O)) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 94db17abdc4..309f2c2374c 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -149,7 +149,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, griefProtection() */ -/obj/machinery/computer/rdconsole/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) +/obj/machinery/computer/rdconsole/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob, params) //Loading a disk into it. if(istype(D, /obj/item/weapon/disk)) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index f6e00bc69b4..e3daebc6b36 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -118,7 +118,7 @@ env.merge(removed) -/obj/machinery/r_n_d/server/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/r_n_d/server/attackby(var/obj/item/O as obj, var/mob/user as mob, params) if (disabled) return diff --git a/code/modules/research/xenoarchaeology/artifact/artifact.dm b/code/modules/research/xenoarchaeology/artifact/artifact.dm index 83e5fea7781..0b12d5cf62a 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact.dm @@ -64,7 +64,7 @@ if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill)) M.selected.action(src) -/obj/structure/boulder/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/structure/boulder/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/device/core_sampler)) if(geological_data) src.geological_data.artifact_distance = rand(-100,100) / 100 diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm b/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm index 566e2382947..9a2fad715cf 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm @@ -128,7 +128,7 @@ user << browse(dat, "window=alien_replicator") -/obj/machinery/replicator/attackby(obj/item/weapon/W as obj, mob/living/user as mob) +/obj/machinery/replicator/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params) user.drop_item() W.loc = src stored_materials.Add(W) diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm index 98bb7a1cd8b..1351af58f79 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm @@ -244,7 +244,7 @@ var/list/valid_secondary_effect_types = list(\ if(secondary_effect && secondary_effect.effect == EFFECT_TOUCH && secondary_effect.activated) secondary_effect.DoEffectTouch(user) -/obj/machinery/artifact/attackby(obj/item/weapon/W as obj, mob/living/user as mob) +/obj/machinery/artifact/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params) if (istype(W, /obj/item/weapon/reagent_containers/)) if(W.reagents.has_reagent("hydrogen", 1) || W.reagents.has_reagent("water", 1)) diff --git a/code/modules/research/xenoarchaeology/chemistry.dm b/code/modules/research/xenoarchaeology/chemistry.dm index f2a585835e9..9bd0a22a9c2 100644 --- a/code/modules/research/xenoarchaeology/chemistry.dm +++ b/code/modules/research/xenoarchaeology/chemistry.dm @@ -89,7 +89,7 @@ datum volume = 2 flags = OPENCONTAINER -obj/item/weapon/reagent_containers/glass/solution_tray/attackby(obj/item/weapon/W as obj, mob/living/user as mob) +obj/item/weapon/reagent_containers/glass/solution_tray/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params) if(istype(W, /obj/item/weapon/pen)) var/new_label = input("What should the new label be?","Label solution tray") if(new_label) diff --git a/code/modules/research/xenoarchaeology/finds/finds.dm b/code/modules/research/xenoarchaeology/finds/finds.dm index f657b006ccf..ff8f8cb34d3 100644 --- a/code/modules/research/xenoarchaeology/finds/finds.dm +++ b/code/modules/research/xenoarchaeology/finds/finds.dm @@ -45,7 +45,7 @@ if(severity && prob(30)) src.visible_message("The [src] crumbles away, leaving some dust and gravel behind.")*/ -/obj/item/weapon/ore/strangerock/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/ore/strangerock/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/weldingtool/)) var/obj/item/weapon/weldingtool/w = W if(w.isOn()) diff --git a/code/modules/research/xenoarchaeology/finds/finds_fossils.dm b/code/modules/research/xenoarchaeology/finds/finds_fossils.dm index 57d510015fc..8338de5a3ae 100644 --- a/code/modules/research/xenoarchaeology/finds/finds_fossils.dm +++ b/code/modules/research/xenoarchaeology/finds/finds_fossils.dm @@ -33,7 +33,7 @@ icon_state = "hskull" desc = "It's a fossilised, horned skull." -/obj/item/weapon/fossil/skull/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/fossil/skull/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/fossil/bone)) var/obj/o = new /obj/skeleton(get_turf(src)) var/a = new /obj/item/weapon/fossil/bone @@ -57,7 +57,7 @@ src.breq = rand(6)+3 src.desc = "An incomplete skeleton, looks like it could use [src.breq-src.bnum] more bones." -/obj/skeleton/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/skeleton/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/fossil/bone)) if(!bstate) bnum++ diff --git a/code/modules/research/xenoarchaeology/finds/finds_misc.dm b/code/modules/research/xenoarchaeology/finds/finds_misc.dm index c15d5f76f6b..06ac8960c44 100644 --- a/code/modules/research/xenoarchaeology/finds/finds_misc.dm +++ b/code/modules/research/xenoarchaeology/finds/finds_misc.dm @@ -24,7 +24,7 @@ else return -/obj/item/weapon/shard/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/shard/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if ( istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W @@ -35,7 +35,7 @@ continue if(G.amount>=G.max_amount) continue - G.attackby(NG, user) + G.attackby(NG, user, params) usr << "You add the newly-formed plasma glass to the stack. It now contains [NG.amount] sheets." //SN src = null returnToPool(src) diff --git a/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm b/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm index bd2780835e6..a100d159d4b 100644 --- a/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm +++ b/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm @@ -47,7 +47,7 @@ datum/genesequence undiscovered_genesequences = master_controller.all_animal_genesequences.Copy() ..() -/obj/machinery/computer/reconstitutor/attackby(obj/item/W, mob/user) +/obj/machinery/computer/reconstitutor/attackby(obj/item/W, mob/user, params) if(istype(W,/obj/item/weapon/fossil)) user.drop_item() W.loc = src.loc diff --git a/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm b/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm index 776d91751c2..9209e062657 100644 --- a/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm +++ b/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm @@ -21,7 +21,7 @@ if(!owned_scanner) owned_scanner = locate(/obj/machinery/artifact_scanpad) in orange(1, src) -/obj/machinery/artifact_harvester/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/machinery/artifact_harvester/attackby(var/obj/I as obj, var/mob/user as mob, params) if(istype(I,/obj/item/weapon/anobattery)) if(!inserted_battery) user << "\blue You insert [I] into [src]." diff --git a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm index 6a44fbe72d7..3e15764fee6 100644 --- a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm +++ b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm @@ -63,7 +63,7 @@ /obj/machinery/radiocarbon_spectrometer/attack_hand(var/mob/user as mob) ui_interact(user) -/obj/machinery/radiocarbon_spectrometer/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/machinery/radiocarbon_spectrometer/attackby(var/obj/I as obj, var/mob/user as mob, params) if(scanning) user << "You can't do that while [src] is scanning!" else diff --git a/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm b/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm index fc50c956e74..ce5c546e9d5 100644 --- a/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm +++ b/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm @@ -37,7 +37,7 @@ ..() processing_objects.Add(src) -/obj/item/weapon/anodevice/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/item/weapon/anodevice/attackby(var/obj/I as obj, var/mob/user as mob, params) if(istype(I, /obj/item/weapon/anobattery)) if(!inserted_battery) user << "\blue You insert the battery." diff --git a/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm b/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm index 2437eeb0672..a90105585ee 100644 --- a/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm +++ b/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm @@ -9,7 +9,7 @@ var/obj/item/weapon/reagent_containers/held_container var/heat_time = 50 -/obj/machinery/bunsen_burner/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/bunsen_burner/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/reagent_containers)) if(held_container) user << "\red You must remove the [held_container] first." diff --git a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm index 2a6df06c6f5..dd129d48d47 100644 --- a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm +++ b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm @@ -168,7 +168,7 @@ cell = null user << "You remove the power cell" -/obj/machinery/suspension_gen/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/suspension_gen/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if (istype(W, /obj/item/weapon/screwdriver)) if(!open) if(screwed) diff --git a/code/modules/research/xenoarchaeology/tools/tools_coresampler.dm b/code/modules/research/xenoarchaeology/tools/tools_coresampler.dm index a2b42a22b97..1aa2a4a37eb 100644 --- a/code/modules/research/xenoarchaeology/tools/tools_coresampler.dm +++ b/code/modules/research/xenoarchaeology/tools/tools_coresampler.dm @@ -35,7 +35,7 @@ else return ..() -/obj/item/device/core_sampler/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/device/core_sampler/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W,/obj/item/weapon/evidencebag)) if(num_stored_bags < 10) del(W) diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index 9d94725adf6..361c384a915 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -28,7 +28,7 @@ user << "You are too primitive to use this device." return -/obj/machinery/keycard_auth/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/keycard_auth/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(stat & (NOPOWER|BROKEN)) user << "This device is not powered." return diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm index cd424dbe120..192449d7735 100644 --- a/code/modules/shieldgen/shield_capacitor.dm +++ b/code/modules/shieldgen/shield_capacitor.dm @@ -32,7 +32,7 @@ break ..() -/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user) +/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/C = W diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm index 88d4b46b89f..97375aa9c26 100644 --- a/code/modules/shieldgen/shield_gen.dm +++ b/code/modules/shieldgen/shield_gen.dm @@ -41,7 +41,7 @@ field = new/list() ..() -/obj/machinery/shield_gen/attackby(obj/item/W, mob/user) +/obj/machinery/shield_gen/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/C = W if(access_captain in C.access || access_security in C.access || access_engine in C.access) diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm index 398bc9f9259..2e7e39d9fea 100644 --- a/code/modules/shuttles/shuttle_emergency.dm +++ b/code/modules/shuttles/shuttle_emergency.dm @@ -152,7 +152,7 @@ -/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob, params) read_authorization(W) ..() diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index c7ba4e304c7..27f4fc41602 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -278,7 +278,7 @@ R.receive_pulse(power * POWER_FACTOR) return -/obj/machinery/power/supermatter/attackby(obj/item/weapon/W as obj, mob/living/user as mob) +/obj/machinery/power/supermatter/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params) user.visible_message("\The [user] touches \a [W] to \the [src] as a silence fills the room...",\ "You touch \the [W] to \the [src] when everything suddenly goes silent.\"\n\The [W] flashes into dust as you flinch away from \the [src].",\ "Everything suddenly goes silent.") diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm index 42ee7f3786f..9aefbc23297 100644 --- a/code/modules/telesci/telepad.dm +++ b/code/modules/telesci/telepad.dm @@ -27,7 +27,7 @@ E += C.rating efficiency = E -/obj/machinery/telepad/attackby(obj/item/I, mob/user) +/obj/machinery/telepad/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "pad-idle-o", "pad-idle", I)) return @@ -54,7 +54,7 @@ idle_power_usage = 20 active_power_usage = 500 var/stage = 0 -/obj/machinery/telepad_cargo/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/telepad_cargo/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) playsound(src, 'sound/items/Ratchet.ogg', 50, 1) if(anchored) diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm index 9e82bef312a..6d53a63aa10 100644 --- a/code/modules/telesci/telesci_computer.dm +++ b/code/modules/telesci/telesci_computer.dm @@ -54,7 +54,7 @@ user << "You are too primitive to use this computer." return -/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user) +/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/bluespace_crystal)) if(crystals.len >= max_crystals) user << "There are not enough crystal slots." diff --git a/code/modules/vehicles/ambulance.dm b/code/modules/vehicles/ambulance.dm index 139bf08fde4..a844526186d 100644 --- a/code/modules/vehicles/ambulance.dm +++ b/code/modules/vehicles/ambulance.dm @@ -58,14 +58,14 @@ return ..() -/obj/vehicle/train/ambulance/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/vehicle/train/ambulance/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(open && istype(W, /obj/item/weapon/wirecutters)) passenger_allowed = !passenger_allowed user.visible_message("[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src].","You [passenger_allowed ? "cut" : "mend"] the load limiter cable.") else ..() -/obj/vehicle/train/ambulance/engine/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/vehicle/train/ambulance/engine/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/key/ambulance_train)) if(!key) user.drop_item() diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm index 896ee3cc652..5d792c54d1b 100644 --- a/code/modules/vehicles/cargo_train.dm +++ b/code/modules/vehicles/cargo_train.dm @@ -59,14 +59,14 @@ return ..() -/obj/vehicle/train/cargo/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/vehicle/train/cargo/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(open && istype(W, /obj/item/weapon/wirecutters)) passenger_allowed = !passenger_allowed user.visible_message("[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src].","You [passenger_allowed ? "cut" : "mend"] the load limiter cable.") else ..() -/obj/vehicle/train/cargo/engine/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/vehicle/train/cargo/engine/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/key/cargo_train)) if(!key) user.drop_item() diff --git a/code/modules/vehicles/janicart.dm b/code/modules/vehicles/janicart.dm index 39008dfb2ba..0804d8ccb32 100644 --- a/code/modules/vehicles/janicart.dm +++ b/code/modules/vehicles/janicart.dm @@ -65,7 +65,7 @@ return ..() -/obj/vehicle/train/janitor/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/vehicle/train/janitor/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(openTop) W.loc = src user.visible_message("[user] puts [W] in [src].","You put [W] in [src].") @@ -93,7 +93,7 @@ else icon_state = "trashcart" -/obj/vehicle/train/janitor/engine/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/vehicle/train/janitor/engine/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/key/janitor_train)) if(!key) user.drop_item() diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 3af09357ca5..bb78c9e9cd8 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -61,7 +61,7 @@ else return 0 -/obj/vehicle/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/vehicle/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/hand_labeler)) return if(istype(W, /obj/item/weapon/screwdriver)) diff --git a/code/modules/virus2/analyser.dm b/code/modules/virus2/analyser.dm index 8046c48af01..e68889837c4 100644 --- a/code/modules/virus2/analyser.dm +++ b/code/modules/virus2/analyser.dm @@ -10,7 +10,7 @@ var/obj/item/weapon/virusdish/dish = null -/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/O as obj, var/mob/user as mob) +/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/O as obj, var/mob/user as mob, params) if(!istype(O,/obj/item/weapon/virusdish)) return if(dish) diff --git a/code/modules/virus2/biohazard destroyer.dm b/code/modules/virus2/biohazard destroyer.dm index abd1803de86..1c5799d07a2 100644 --- a/code/modules/virus2/biohazard destroyer.dm +++ b/code/modules/virus2/biohazard destroyer.dm @@ -6,7 +6,7 @@ density = 1 anchored = 1 -/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob, params) for(var/path in accepts) if(I.type in typesof(path)) user.drop_item() diff --git a/code/modules/virus2/centrifuge.dm b/code/modules/virus2/centrifuge.dm index b36e63ff3a0..9573e08ea50 100644 --- a/code/modules/virus2/centrifuge.dm +++ b/code/modules/virus2/centrifuge.dm @@ -9,7 +9,7 @@ var/obj/item/weapon/reagent_containers/glass/beaker/vial/sample = null var/datum/disease2/disease/virus2 = null -/obj/machinery/computer/centrifuge/attackby(var/obj/O as obj, var/mob/user as mob) +/obj/machinery/computer/centrifuge/attackby(var/obj/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/screwdriver)) return ..(O,user) diff --git a/code/modules/virus2/curer.dm b/code/modules/virus2/curer.dm index fbc4624438f..df27fdfb841 100644 --- a/code/modules/virus2/curer.dm +++ b/code/modules/virus2/curer.dm @@ -8,7 +8,7 @@ var/obj/item/weapon/reagent_containers/container = null -/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob, params) if(istype(I,/obj/item/weapon/reagent_containers)) var/mob/living/carbon/C = user if(!container) diff --git a/code/modules/virus2/diseasesplicer.dm b/code/modules/virus2/diseasesplicer.dm index 47a4402ab44..d1938d6cdb1 100644 --- a/code/modules/virus2/diseasesplicer.dm +++ b/code/modules/virus2/diseasesplicer.dm @@ -11,7 +11,7 @@ var/splicing = 0 var/scanning = 0 -/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob) +/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) return ..(I,user) diff --git a/code/modules/virus2/dishincubator.dm b/code/modules/virus2/dishincubator.dm index f6c95be8b2d..cc79387c7e6 100644 --- a/code/modules/virus2/dishincubator.dm +++ b/code/modules/virus2/dishincubator.dm @@ -14,7 +14,7 @@ var/foodsupply = 0 var/toxins = 0 -/obj/machinery/disease2/incubator/attackby(var/obj/O as obj, var/mob/user as mob) +/obj/machinery/disease2/incubator/attackby(var/obj/O as obj, var/mob/user as mob, params) if(istype(O, /obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/syringe)) if(beaker) diff --git a/code/modules/virus2/isolator.dm b/code/modules/virus2/isolator.dm index 09f07793c90..41e18e42faa 100644 --- a/code/modules/virus2/isolator.dm +++ b/code/modules/virus2/isolator.dm @@ -27,7 +27,7 @@ else icon_state = "isolator" -/obj/machinery/disease2/isolator/attackby(var/obj/O as obj, var/mob/user) +/obj/machinery/disease2/isolator/attackby(var/obj/O as obj, var/mob/user, params) if(!istype(O,/obj/item/weapon/reagent_containers/syringe)) return var/obj/item/weapon/reagent_containers/syringe/S = O diff --git a/code/modules/virus2/items_devices.dm b/code/modules/virus2/items_devices.dm index f0d9a988c3b..fbbc64f79b8 100644 --- a/code/modules/virus2/items_devices.dm +++ b/code/modules/virus2/items_devices.dm @@ -24,7 +24,7 @@ report("Scan Complete: No antibodies detected.", user) return - if (M_CLUMSY in user.mutations && prob(50)) + if (CLUMSY in user.mutations && prob(50)) // I was tempted to be really evil and rot13 the output. report("Antibodies detected: [reverse_text(antigens2string(C.antibodies))]", user) else @@ -53,7 +53,7 @@ src.virus2.makerandom(0, 1) // Virus dishes get minor effects only on creation, and have a chance of being injection type growth = rand(5, 50) -/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob) +/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob, params) if(istype(W,/obj/item/weapon/hand_labeler) || istype(W,/obj/item/weapon/reagent_containers/syringe)) return ..() @@ -78,7 +78,7 @@ icon_state = "implantcase-b" desc = "The bacteria in the dish are completely dead." -/obj/item/weapon/ruinedvirusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob) +/obj/item/weapon/ruinedvirusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob, params) if(istype(W,/obj/item/weapon/hand_labeler) || istype(W,/obj/item/weapon/reagent_containers/syringe)) return ..() diff --git a/code/setup.dm b/code/setup.dm index ff4d3f1abec..db4fe56cb65 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -198,7 +198,7 @@ var/MAX_EX_FLASH_RANGE = 14 #define NODROP 2 // This flag makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted. #define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message with the default handler #define MASKINTERNALS 8 // mask allows internals -#define USEDELAY 16 // 1 second extra delay on use (Can be used once every 2s) +//#define USEDELAY 16 // 1 second extra delay on use (Can be used once every 2s) #define NOSHIELD 32 // weapon not affected by shield #define CONDUCT 64 // conducts electricity (metal etc.) #define ABSTRACT 128 // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way @@ -217,7 +217,7 @@ var/MAX_EX_FLASH_RANGE = 14 #define EARBANGPROTECT 1024 #define THICKMATERIAL 1024 //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body. (NOTE: flag shared with NOSLIP) -#define NOSLIP 1024 //prevents from slipping on wet floors, in space etc (NOTE: flag shared with THICKMATERIAL for external suits and helmet) +#define NOSLIP 1024 //prevents from slipping on wet floors, in space etc #define OPENCONTAINER 4096 // is an open container for chemistry purposes @@ -342,18 +342,18 @@ var/MAX_EX_FLASH_RANGE = 14 /////////////////////////////////////// // Generic mutations: -#define M_TK 1 -#define M_RESIST_COLD 2 -#define M_XRAY 3 -#define M_HULK 4 -#define M_CLUMSY 5 -#define M_FAT 6 -#define M_HUSK 7 -#define M_NOCLONE 8 +#define TK 1 +#define RESIST_COLD 2 +#define XRAY 3 +#define HULK 4 +#define CLUMSY 5 +#define FAT 6 +#define HUSK 7 +#define NOCLONE 8 // Extra powers: -#define M_LASER 9 // harm intent - click anywhere to shoot lasers from eyes +#define LASER 9 // harm intent - click anywhere to shoot lasers from eyes //#define HEAL 10 // (Not implemented) healing people with hands //#define SHADOW 11 // (Not implemented) shadow teleportation (create in/out portals anywhere) (25%) //#define SCREAM 12 // (Not implemented) supersonic screaming (25%) @@ -385,32 +385,32 @@ var/MAX_EX_FLASH_RANGE = 14 #define PLANT 30 // Other Mutations: -#define M_NO_BREATH 100 // no need to breathe -#define M_REMOTE_VIEW 101 // remote viewing -#define M_REGEN 102 // health regen -#define M_RUN 103 // no slowdown -#define M_REMOTE_TALK 104 // remote talking -#define M_MORPH 105 // changing appearance -#define M_RESIST_HEAT 106 // heat resistance -#define M_HALLUCINATE 107 // hallucinations -#define M_FINGERPRINTS 108 // no fingerprints -#define M_NO_SHOCK 109 // insulated hands -#define M_DWARF 110 // table climbing +#define NO_BREATH 100 // no need to breathe +#define REMOTE_VIEW 101 // remote viewing +#define REGEN 102 // health regen +#define RUN 103 // no slowdown +#define REMOTE_TALK 104 // remote talking +#define MORPH 105 // changing appearance +#define RESIST_HEAT 106 // heat resistance +#define HALLUCINATE 107 // hallucinations +#define FINGERPRINTS 108 // no fingerprints +#define NO_SHOCK 109 // insulated hands +#define DWARF 110 // table climbing // Goon muts -#define M_OBESITY 200 // Decreased metabolism -#define M_TOXIC_FARTS 201 // Duh -#define M_STRONG 202 // (Nothing) -#define M_SOBER 203 // Increased alcohol metabolism -#define M_PSY_RESIST 204 // Block remoteview -#define M_SUPER_FART 205 // Duh -#define M_EMPATH 206 //Read minds -#define M_COMIC 207 //Comic Sans +#define OBESITY 200 // Decreased metabolism +#define TOXIC_FARTS 201 // Duh +#define STRONG 202 // (Nothing) +#define SOBER 203 // Increased alcohol metabolism +#define PSY_RESIST 204 // Block remoteview +#define SUPER_FART 205 // Duh +#define EMPATH 206 //Read minds +#define COMIC 207 //Comic Sans // /vg/ muts -#define M_LOUD 208 // CAUSES INTENSE YELLING -//#define M_WHISPER 209 // causes quiet whispering -#define M_DIZZY 210 // Trippy. +#define LOUD 208 // CAUSES INTENSE YELLING +//#define WHISPER 209 // causes quiet whispering +#define DIZZY 210 // Trippy. //disabilities #define NEARSIGHTED 1 @@ -799,8 +799,8 @@ var/list/be_special_flags = list( //feel free to add shit to lists below var/list/tachycardics = list("coffee", "inaprovaline", "hyperzine", "nitroglycerin", "thirteenloko", "nicotine") //increase heart rate var/list/bradycardics = list("neurotoxin", "cryoxadone", "clonexadone", "space_drugs", "stoxin") //decrease heart rate -var/list/heartstopper = list("potassium_phorochloride", "zombie_powder") //this stops the heart -var/list/cheartstopper = list("potassium_chloride") //this stops the heart when overdose is met -- c = conditional +var/list/heartstopper = list("zombie_powder") //this stops the heart +var/list/cheartstopper = list() //this stops the heart when overdose is met -- c = conditional //proc/get_pulse methods #define GETPULSE_HAND 0 //less accurate (hand) @@ -967,3 +967,12 @@ var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF") #define STATUS_UPDATE 1 // ORANGE Visability #define STATUS_DISABLED 0 // RED Visability #define STATUS_CLOSE -1 // Close the interface + +//Click cooldowns, in tenths of a second +#define CLICK_CD_MELEE 8 +#define CLICK_CD_RANGE 4 +#define CLICK_CD_BREAKOUT 100 +#define CLICK_CD_HANDCUFFED 10 +#define CLICK_CD_TKSTRANGLE 10 +#define CLICK_CD_POINT 10 +#define CLICK_CD_RESIST 20 diff --git a/code/world.dm b/code/world.dm index e03344d7f6e..07377b04f0c 100644 --- a/code/world.dm +++ b/code/world.dm @@ -41,16 +41,19 @@ sleep_offline = 1 + processScheduler = new master_controller = new /datum/controller/game_controller() spawn(1) + processScheduler.deferSetupFor(/datum/controller/process/ticker) + processScheduler.setup() + master_controller.setup() spawn(3000) //so we aren't adding to the round-start lag if(config.ToRban) ToRban_autoupdate() - if(config.kick_inactive) - KickInactiveClients() -// KickDisconnectedClients() + /*if(config.kick_inactive) HANDLED IN PROCESS SCHEDULER + KickInactiveClients()*/ #undef RECOMMENDED_VERSION @@ -193,6 +196,8 @@ var/world_topic_spam_protect_time = world.timeofday spawn(0) world << sound(pick('sound/AI/newroundsexy.ogg','sound/misc/apcdestroyed.ogg','sound/misc/bangindonk.ogg')) // random end sounds!! - LastyBatsy + processScheduler.stop() + for(var/client/C in clients) if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite C << link("byond://[config.server]") @@ -225,7 +230,7 @@ var/world_topic_spam_protect_time = world.timeofday sleep(sleep_length) sleep_check = world.timeofday waiting++ -#undef INACTIVITY_KICK +//#undef INACTIVITY_KICK /* #define DISCONNECTED_DELETE 6000 //10 minutes in ticks (approx) /world/proc/KickDisconnectedClients() diff --git a/icons/mob/back.dmi b/icons/mob/back.dmi index 7c7101edd5b..3fbd4b0bbee 100644 Binary files a/icons/mob/back.dmi and b/icons/mob/back.dmi differ diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi index bd5f7a74a3a..e74d32e907e 100644 Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ diff --git a/maps/cyberiad.dmm b/maps/cyberiad.dmm index 6cb4b27d292..580d4203a68 100644 --- a/maps/cyberiad.dmm +++ b/maps/cyberiad.dmm @@ -1160,7 +1160,7 @@ "awp" = (/obj/machinery/access_button{command = "cycle_exterior"; frequency = 1379; master_tag = "arrivals_airlock"; name = "exterior access button"; pixel_x = -25; pixel_y = -25; req_access_txt = "13"},/turf/simulated/floor/plating,/area) "awq" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/turf/simulated/floor/plating,/area/mimeoffice) "awr" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/turf/simulated/floor/plating,/area/mimeoffice) -"aws" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/door/firedoor,/obj/machinery/door/airlock/clown{name = "Mime's Office"; req_access_txt = "46"},/turf/simulated/floor,/area/mimeoffice) +"aws" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/door/firedoor,/obj/machinery/door/airlock/mime{name = "Mime's Office"; req_access_txt = "46"},/turf/simulated/floor,/area/mimeoffice) "awt" = (/obj/machinery/door/airlock/maintenance{req_access_txt = "12"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor/plating,/area/maintenance/fpmaint2) "awu" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/obj/machinery/door/poddoor/shutters{density = 0; dir = 2; icon_state = "shutter0"; id = "magistrate"; name = "Privacy Shutters"; opacity = 0},/turf/simulated/floor/plating,/area/magistrateoffice) "awv" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/obj/machinery/door/poddoor/shutters{density = 0; dir = 2; icon_state = "shutter0"; id = "magistrate"; name = "Privacy Shutters"; opacity = 0},/turf/simulated/floor/plating,/area/magistrateoffice) diff --git a/paradise.dme b/paradise.dme index b4e9cc5423e..4dc32c86dca 100644 --- a/paradise.dme +++ b/paradise.dme @@ -89,6 +89,7 @@ #include "code\setup.dm" #include "code\stylesheet.dm" #include "code\world.dm" +#include "code\__HELPERS\constants.dm" #include "code\__HELPERS\experimental.dm" #include "code\__HELPERS\files.dm" #include "code\__HELPERS\game.dm" @@ -175,6 +176,30 @@ #include "code\controllers\shuttle_controller.dm" #include "code\controllers\verbs.dm" #include "code\controllers\voting.dm" +#include "code\controllers\Processes\air.dm" +#include "code\controllers\Processes\bot.dm" +#include "code\controllers\Processes\disease.dm" +#include "code\controllers\Processes\emergencyShuttle.dm" +#include "code\controllers\Processes\event.dm" +#include "code\controllers\Processes\inactivity.dm" +#include "code\controllers\Processes\lighting.dm" +#include "code\controllers\Processes\machinery.dm" +#include "code\controllers\Processes\mob.dm" +#include "code\controllers\Processes\nanoui.dm" +#include "code\controllers\Processes\obj.dm" +#include "code\controllers\Processes\pipenet.dm" +#include "code\controllers\Processes\powernet.dm" +#include "code\controllers\Processes\Shuttle.dm" +#include "code\controllers\Processes\sun.dm" +#include "code\controllers\Processes\supply.dm" +#include "code\controllers\Processes\ticker.dm" +#include "code\controllers\Processes\vote.dm" +#include "code\controllers\ProcessScheduler\core\_define.dm" +#include "code\controllers\ProcessScheduler\core\_stubs.dm" +#include "code\controllers\ProcessScheduler\core\process.dm" +#include "code\controllers\ProcessScheduler\core\processScheduler.dm" +#include "code\controllers\ProcessScheduler\core\updateQueue.dm" +#include "code\controllers\ProcessScheduler\core\updateQueueWorker.dm" #include "code\datums\ai_laws.dm" #include "code\datums\browser.dm" #include "code\datums\cargoprofile.dm"