From d5e99e9cefd457e0fabdc1725f6f32a83c1bcfd8 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 13 Jan 2021 05:56:10 +0200 Subject: [PATCH 1/8] TESTING --- code/game/atoms_movable.dm | 6 ++--- code/game/objects/items.dm | 17 ++++++++++++- code/modules/antagonists/revenant/revenant.dm | 24 +++++++++++++------ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 4715c3bed3..c9d471e82a 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -492,13 +492,13 @@ return TRUE //TODO: Better floating -/atom/movable/proc/float(on) +/atom/movable/proc/float(on, float_height) if(throwing) return if(on && (!(movement_type & FLOATING) || floating_need_update)) - animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) + animate(src, pixel_y = pixel_y + 2 + float_height, time = 10, loop = -1) sleep(10) - animate(src, pixel_y = pixel_y - 2, time = 10, loop = -1) + animate(src, pixel_y = pixel_y - 2 - float_height, time = 10, loop = -1) if(!(movement_type & FLOATING)) setMovetype(movement_type | FLOATING) else if (!on && movement_type & FLOATING) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 1c75f1e533..dc84006c2d 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -11,7 +11,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb name = "item" icon = 'icons/obj/items_and_weapons.dmi' blocks_emissive = EMISSIVE_BLOCK_GENERIC - + attack_hand_speed = 0 attack_hand_is_action = FALSE attack_hand_unwieldlyness = 0 @@ -467,6 +467,21 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb melee_attack_chain(usr, over) usr.FlushCurrentAction() return TRUE //returning TRUE as a "is this overridden?" flag + if(isrevenant(usr)) + var/mob/living/simple_animal/revenant/spooker = usr + if(!anchored && !spooker.telekinesis_cooldown) + spooker.change_essence_amount(-5, FALSE, "telekinesis") + spooker.stun(10) + spooker.reveal(20) + spooker.telekinesis_cooldown = TRUE + float(TRUE, 2) + sleep(10) + throw_at(src_location) + new /obj/effect/temp_visual/telekinesis(get_turf(src)) + addtimer(CALLBACK(src, /atom/movable.proc/float, FALSE), 2) + addtimer(CALLBACK(spooker, /mob/living/simple_animal/revenant.proc/telekinesis_cooldown_end), 30) + return + if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index f5ebcffe35..1a45663ff7 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -72,6 +72,7 @@ var/list/drained_mobs = list() //Cannot harvest the same mob twice var/perfectsouls = 0 //How many perfect, regen-cap increasing souls the revenant has. //TODO, add objective for getting a perfect soul(s?) var/generated_objectives_and_spells = FALSE + var/telekinesis_cooldown /mob/living/simple_animal/revenant/Initialize(mapload) . = ..() @@ -93,13 +94,16 @@ /mob/living/simple_animal/revenant/Login() ..() - to_chat(src, "You are a revenant.") - to_chat(src, "Your formerly mundane spirit has been infused with alien energies and empowered into a revenant.") - to_chat(src, "You are not dead, not alive, but somewhere in between. You are capable of limited interaction with both worlds.") - to_chat(src, "You are invincible and invisible to everyone but other ghosts. Most abilities will reveal you, rendering you vulnerable.") - to_chat(src, "To function, you are to drain the life essence from humans. This essence is a resource, as well as your health, and will power all of your abilities.") - to_chat(src, "You do not remember anything of your past lives, nor will you remember anything about this one after your death.") - to_chat(src, "Be sure to read the wiki page to learn more.") + var/revenant_greet + revenant_greet += "You are a revenant." + revenant_greet += "Your formerly mundane spirit has been infused with alien energies and empowered into a revenant." + revenant_greet += "You are not dead, not alive, but somewhere in between. You are capable of limited interaction with both worlds." + revenant_greet += "You are invincible and invisible to everyone but other ghosts. Most abilities will reveal you, rendering you vulnerable." + revenant_greet += "To function, you are to drain the life essence from humans. This essence is a resource, as well as your health, and will power all of your abilities." + revenant_greet += "You do not remember anything of your past lives, nor will you remember anything about this one after your death." + revenant_greet += "Be sure to read the wiki page to learn more." + revenant_greet += "You are also able to telekinetically throw objects by clickdragging them." + to_chat(src, revenant_greet) if(!generated_objectives_and_spells) generated_objectives_and_spells = TRUE mind.assigned_role = ROLE_REVENANT @@ -317,6 +321,12 @@ to_chat(src, "Lost [essence_amt]E[source ? " from [source]":""].") return 1 +/mob/living/simple_animal/revenant/proc/telekinesis_cooldown_end() + if(!telekinesis_cooldown) + CRASH("telekinesis_cooldown_end ran when telekinesis_cooldown on [src] was false") + else + telekinesis_cooldown = FALSE + /mob/living/simple_animal/revenant/proc/death_reset() revealed = FALSE unreveal_time = 0 From 2f619ffc4e30d06093b6a5199e60b467eb98b4b0 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 13 Jan 2021 10:27:10 +0200 Subject: [PATCH 2/8] Traits --- code/__DEFINES/traits.dm | 1 + code/_globalvars/traits.dm | 3 ++- code/game/objects/items.dm | 41 +++++++++++++++++++++++++++++++++----- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 2275c4b90b..b7750556d5 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -253,6 +253,7 @@ // item traits #define TRAIT_NODROP "nodrop" +#define TRAIT_SPOOKY_THROW "spooky_throw" // common trait sources #define TRAIT_GENERIC "generic" diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 4e593ba904..f376ba50d7 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -130,7 +130,8 @@ GLOBAL_LIST_INIT(traits_by_type, list( ), /obj/item = list( "TRAIT_NODROP" = TRAIT_NODROP, - "TRAIT_NO_TELEPORT" = TRAIT_NO_TELEPORT + "TRAIT_NO_TELEPORT" = TRAIT_NO_TELEPORT, + "TRAIT_SPOOKY_THROW" = TRAIT_SPOOKY_THROW ) )) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index dc84006c2d..bf53947ad6 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -454,6 +454,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb /obj/item/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params) //Copypaste of /atom/MouseDrop() since this requires code in a very specific spot if(!usr || !over) return + message_admins("[src], [usr], [over], [src_location], [over_location], [src_control], [over_control], [params]") if(SEND_SIGNAL(src, COMSIG_MOUSEDROP_ONTO, over, usr) & COMPONENT_NO_MOUSEDROP) //Whatever is receiving will verify themselves for adjacency. return if(over == src) @@ -472,14 +473,19 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb if(!anchored && !spooker.telekinesis_cooldown) spooker.change_essence_amount(-5, FALSE, "telekinesis") spooker.stun(10) - spooker.reveal(20) + spooker.reveal(30) spooker.telekinesis_cooldown = TRUE float(TRUE, 2) sleep(10) - throw_at(src_location) - new /obj/effect/temp_visual/telekinesis(get_turf(src)) + safe_throw_at(over, 10, 2) + ADD_TRAIT(src, TRAIT_SPOOKY_THROW) + src.DoRevenantThrowEffects() + var/obj/effect/temp_visual/telekinesis/T = new(get_turf(src)) + T.color = purple addtimer(CALLBACK(src, /atom/movable.proc/float, FALSE), 2) - addtimer(CALLBACK(spooker, /mob/living/simple_animal/revenant.proc/telekinesis_cooldown_end), 30) + addtimer(CALLBACK(spooker, /mob/living/simple_animal/revenant.proc/telekinesis_cooldown_end), 50) + sleep(2) + REMOVE_TRAIT(src, TRAIT_SPOOKY_THROW) return if(!Adjacent(usr) || !over.Adjacent(usr)) @@ -487,7 +493,32 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb over.MouseDrop_T(src,usr) return - +/obj/item/proc/DoRevenantThrowEffects() + var/hijink_to_do + switch(istype) + if(obj/item/gun) + hijink_to_do = "shoot" + if(obj/item/storage) + if(GetComponent(datum/component/storage)) + hijink_to_do = "scatter items" + if(obj/item/card/id) + hijink_to_do = "flash id" + if(obj/item/weldingtool) + hijink_to_do = "welder toggle" + if(obj/item/tank) + hijink_to_do = "toggle tank" + if(obj/item/paper) + hijink_to_do = "paper into plane" + if(obj/item/paper_bin) + hijink_to_do = "paperbin scatter" + if(obj/item/assembly/flash) + hijink_to_do = "flash randomly" + if(obj/item/flashlight) + hijinks_to_do = "toggle flashlight" + if(obj/item/grenade/flashbang) + + if(obj/item/grenade/stingbang) + while(HAS_TRAIT(src, TRAIT_SPOOKY_THROW)) // called after an item is placed in an equipment slot // user is mob that equipped it // slot uses the slot_X defines found in setup.dm From 3737c52df802cb053ef432dce0c79d959c71cbed Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 20 Jan 2021 15:23:34 +0200 Subject: [PATCH 3/8] Funny actions --- code/controllers/subsystem/throwing.dm | 2 ++ code/game/objects/items.dm | 40 ++++++---------------- code/game/objects/items/candle.dm | 4 +++ code/game/objects/items/cigs_lighters.dm | 3 ++ code/game/objects/items/eightball.dm | 3 ++ code/game/objects/items/extinguisher.dm | 15 +++++--- code/game/objects/items/pinpointer.dm | 6 +++- code/game/objects/items/plushes.dm | 4 +++ code/game/objects/items/pneumaticCannon.dm | 40 ++++++++++++++++------ code/game/objects/items/stunbaton.dm | 3 ++ code/modules/paperwork/paper.dm | 10 ++++++ code/modules/projectiles/gun.dm | 32 +++++++++++------ 12 files changed, 107 insertions(+), 55 deletions(-) diff --git a/code/controllers/subsystem/throwing.dm b/code/controllers/subsystem/throwing.dm index 8c5abc5469..567eed9bf6 100644 --- a/code/controllers/subsystem/throwing.dm +++ b/code/controllers/subsystem/throwing.dm @@ -71,6 +71,8 @@ SUBSYSTEM_DEF(throwing) target = null thrower = null callback = null + if(HAS_TRAIT(thrownthing, TRAIT_SPOOKY_THROW) + REMOVE_TRAIT(thrownthing, TRAIT_SPOOKY_THROW) return ..() /datum/thrownthing/proc/tick() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index bf53947ad6..846e49682f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -475,17 +475,16 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb spooker.stun(10) spooker.reveal(30) spooker.telekinesis_cooldown = TRUE - float(TRUE, 2) + float(TRUE, 1) sleep(10) safe_throw_at(over, 10, 2) ADD_TRAIT(src, TRAIT_SPOOKY_THROW) - src.DoRevenantThrowEffects() + DoRevenantThrowEffects(over) + log_combat(usr, over, "spooky telekinesised at", src) var/obj/effect/temp_visual/telekinesis/T = new(get_turf(src)) T.color = purple addtimer(CALLBACK(src, /atom/movable.proc/float, FALSE), 2) addtimer(CALLBACK(spooker, /mob/living/simple_animal/revenant.proc/telekinesis_cooldown_end), 50) - sleep(2) - REMOVE_TRAIT(src, TRAIT_SPOOKY_THROW) return if(!Adjacent(usr) || !over.Adjacent(usr)) @@ -493,32 +492,13 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb over.MouseDrop_T(src,usr) return -/obj/item/proc/DoRevenantThrowEffects() - var/hijink_to_do - switch(istype) - if(obj/item/gun) - hijink_to_do = "shoot" - if(obj/item/storage) - if(GetComponent(datum/component/storage)) - hijink_to_do = "scatter items" - if(obj/item/card/id) - hijink_to_do = "flash id" - if(obj/item/weldingtool) - hijink_to_do = "welder toggle" - if(obj/item/tank) - hijink_to_do = "toggle tank" - if(obj/item/paper) - hijink_to_do = "paper into plane" - if(obj/item/paper_bin) - hijink_to_do = "paperbin scatter" - if(obj/item/assembly/flash) - hijink_to_do = "flash randomly" - if(obj/item/flashlight) - hijinks_to_do = "toggle flashlight" - if(obj/item/grenade/flashbang) - - if(obj/item/grenade/stingbang) - while(HAS_TRAIT(src, TRAIT_SPOOKY_THROW)) + +//Use this for effects you want to happen when a revenant throws itself, check the TRAIT_SPOOKY_THROW if you want to know if its still being thrown +/obj/item/proc/DoRevenantThrowEffects(atom/target) + var/datum/component/storage/STR = GetComponent(/datum/component/storage) + if(STR) + + // called after an item is placed in an equipment slot // user is mob that equipped it // slot uses the slot_X defines found in setup.dm diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index a3366e714e..960e3ce499 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -82,4 +82,8 @@ /obj/item/candle/infinite/hugbox heats_space = FALSE +/obj/item/candle/DoRevenantThrowEffects(atom/target) + if(!infinite) + put_out_candle() + #undef CANDLE_LUMINOSITY diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index de32375642..a21c7780b2 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -136,6 +136,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM STOP_PROCESSING(SSobj, src) . = ..() +/obj/item/clothing/mask/cigarette/DoRevenantThrowEffects(atom/target) + attackby(src) + /obj/item/clothing/mask/cigarette/attackby(obj/item/W, mob/user, params) if(!lit && smoketime > 0) var/lighting_text = W.ignition_effect(src, user) diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm index 0d5c9a22aa..39c8143ee9 100644 --- a/code/game/objects/items/eightball.dm +++ b/code/game/objects/items/eightball.dm @@ -46,6 +46,9 @@ if(.) new /obj/item/toy/eightball/haunted(loc) +/obj/item/toy/eightball/DoRevenantThrowEffects(atom/target) + MakeHaunted() + /obj/item/toy/eightball/attack_self(mob/user) if(shaking) return diff --git a/code/game/objects/items/extinguisher.dm b/code/game/objects/items/extinguisher.dm index b1f51f608d..c1579dfe15 100644 --- a/code/game/objects/items/extinguisher.dm +++ b/code/game/objects/items/extinguisher.dm @@ -235,16 +235,23 @@ return EmptyExtinguisher(user) -/obj/item/extinguisher/proc/EmptyExtinguisher(var/mob/user) - if(loc == user && reagents.total_volume) +/obj/item/extinguisher/DoRevenantThrowEffects(atom/target) + EmptyExtinguisher() + +/obj/item/extinguisher/proc/EmptyExtinguisher(mob/user) + if(!reagents.total_volume) + return + if(loc == user || !user) reagents.clear_reagents() var/turf/T = get_turf(loc) if(isopenturf(T)) var/turf/open/theturf = T theturf.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS) - - user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "You quietly empty out \the [src] by using its release valve.") + if(user) + user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "You quietly empty out \the [src] by using its release valve.") + else + user.visible_message("The release valve of \the [src] suddenly opens and sprays it's contents on the floor!") //firebot assembly /obj/item/extinguisher/attackby(obj/O, mob/user, params) diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm index abd9cec950..81bae3d54b 100644 --- a/code/game/objects/items/pinpointer.dm +++ b/code/game/objects/items/pinpointer.dm @@ -30,9 +30,13 @@ target = null return ..() +/obj/item/pinpointer/DoRevenantThrowEffects(atom/target) + attack_self() + /obj/item/pinpointer/attack_self(mob/living/user) active = !active - user.visible_message("[user] [active ? "" : "de"]activates [user.p_their()] pinpointer.", "You [active ? "" : "de"]activate your pinpointer.") + if(user) + user.visible_message("[user] [active ? "" : "de"]activates [user.p_their()] pinpointer.", "You [active ? "" : "de"]activate your pinpointer.") playsound(src, 'sound/items/screwdriver2.ogg', 50, 1) if(active) START_PROCESSING(SSfastprocess, src) diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm index d1174cded7..3470d5e2c8 100644 --- a/code/game/objects/items/plushes.dm +++ b/code/game/objects/items/plushes.dm @@ -45,6 +45,10 @@ return set_snowflake_from_config(id) +/obj/item/toy/plush/DoRevenantThrowEffects(atom/target) + var/datum/component/squeak/squeaker = GetComponent(datum/component/squeak) + squeaker.do_play_squeak(TRUE) + /obj/item/toy/plush/Initialize(mapload, set_snowflake_id) . = ..() AddComponent(/datum/component/squeak, squeak_override) diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index 23be8cbb9a..6cd00f3434 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -43,6 +43,14 @@ /obj/item/pneumatic_cannon/proc/init_charge() //wrapper so it can be vv'd easier START_PROCESSING(SSobj, src) +/obj/item/pneumatic_cannon/DoRevenantThrowEffects(atom/target) + var/target + var/list/possible_targets = range(3,src) + target = pick(possible_targets) + if(target) + discharge = TRUE + Fire(null, target) + /obj/item/pneumatic_cannon/process() if(++charge_tick >= charge_ticks && charge_type) fill_with_type(charge_type, charge_amount) @@ -134,21 +142,29 @@ Fire(user, target) /obj/item/pneumatic_cannon/proc/Fire(mob/living/user, var/atom/target) - if(!istype(user) && !target) + if(!target) return + if(user) + if(!isliving(user)) + return var/discharge = 0 if(!can_trigger_gun(user)) return if(!loadedItems || !loadedWeightClass) - to_chat(user, "\The [src] has nothing loaded.") + if(user) + to_chat(user, "\The [src] has nothing loaded.") return if(!tank && checktank) - to_chat(user, "\The [src] can't fire without a source of gas.") + if(user) + to_chat(user, "\The [src] can't fire without a source of gas.") return if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting)) - to_chat(user, "\The [src] lets out a weak hiss and doesn't react!") + if(user) + to_chat(user, "\The [src] lets out a weak hiss and doesn't react!") + else + visible_message(src, "\The [src] lets out a weak hiss and doesn't react!") return - if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(75) && clumsyCheck && iscarbon(user)) + if(user && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(75) && clumsyCheck && iscarbon(user)) var/mob/living/carbon/C = user C.visible_message("[C] loses [C.p_their()] grip on [src], causing it to go off!", "[src] slips out of your hands and goes off!") C.dropItemToGround(src, TRUE) @@ -157,15 +173,19 @@ else var/list/possible_targets = range(3,src) target = pick(possible_targets) - discharge = 1 + discharge = TRUE if(!discharge) user.visible_message("[user] fires \the [src]!", \ "You fire \the [src]!") - log_combat(user, target, "fired at", src) + if(user) + log_combat(user, target, "fired at", src) var/turf/T = get_target(target, get_turf(src)) - playsound(src, 'sound/weapons/sonic_jackhammer.ogg', 50, 1) - fire_items(T, user) - if(pressureSetting >= 3 && iscarbon(user)) + playsound(src, 'sound/weapons/sonic_jackhammer.ogg', 50, TRUE) + if(user) + fire_items(T, user) + else + fire_items(T) + if(user && pressureSetting >= 3 && iscarbon(user)) var/mob/living/carbon/C = user C.visible_message("[C] is thrown down by the force of the cannon!", "[src] slams into your shoulder, knocking you down!") C.DefaultCombatKnockdown(60) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 16efecec7c..0b0f37a1e0 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -47,6 +47,9 @@ cell = new preload_cell_type(src) update_icon() +/obj/item/melee/baton/DoRevenantThrowEffects(atom/target) + switch_status() + /obj/item/melee/baton/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) ..() //Only mob/living types have stun handling diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 20ec678e45..1f5280a5ce 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -194,6 +194,16 @@ add_fingerprint(user) fire_act(I.get_temperature()) +/obj/item/paper/DoRevenantThrowEffects(atom/target) + sleep(5) + if(HAS_TRAIT(src, TRAIT_SPOOKY_THROW)) + sleep(5) + DoRevenantThrowEffects(atom/target) + return + var/obj/item/paperplane/plane = new(get_turf(src)) + qdel(src) + plane.safe_throw_at(over, 10, 2) + /obj/item/paper/attackby(obj/item/P, mob/living/user, params) if(burn_paper_product_attackby_check(P, user)) SStgui.close_uis(src) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 1c3a0d230f..9e8af0cd00 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -146,7 +146,8 @@ return TRUE /obj/item/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj) - to_chat(user, "*click*") + if(user) + to_chat(user, "*click*") playsound(src, "gun_dry_fire", 30, 1) /obj/item/gun/proc/shoot_live_shot(mob/living/user, pointblank = FALSE, mob/pbtarget, message = 1, stam_cost = 0) @@ -175,7 +176,7 @@ /obj/item/gun/afterattack(atom/target, mob/living/user, flag, params) . = ..() - if(!CheckAttackCooldown(user, target)) + if(user && !CheckAttackCooldown(user, target)) return process_afterattack(target, user, flag, params) @@ -184,6 +185,8 @@ return if(firing) return + if(!user) + return var/stamloss = user.getStaminaLoss() if(flag) //It's adjacent, is the user, or is on the user's person if(target in user.contents) //can't shoot stuff inside us. @@ -290,7 +293,8 @@ return busy_action || firing || ((last_fire + fire_delay) > world.time) /obj/item/gun/proc/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0, stam_cost = 0) - add_fingerprint(user) + if(user) + add_fingerprint(user) if(on_cooldown()) return @@ -328,7 +332,7 @@ shoot_with_empty_chamber(user) return else - if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot + if(user && get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot shoot_live_shot(user, 1, target, message, stam_cost) else shoot_live_shot(user, 0, target, message, stam_cost) @@ -342,29 +346,29 @@ return TRUE /obj/item/gun/proc/do_burst_shot(mob/living/user, atom/target, message = TRUE, params=null, zone_override = "", sprd = 0, randomized_gun_spread = 0, randomized_bonus_spread = 0, rand_spr = 0, iteration = 0, stam_cost = 0) - if(!user || !firing) - firing = FALSE + if(!firing) return FALSE - if(!issilicon(user)) + if(user && !issilicon(user)) if(iteration > 1 && !(user.is_holding(src))) //for burst firing firing = FALSE return FALSE if(chambered && chambered.BB) if(HAS_TRAIT(user, TRAIT_PACIFISM)) // If the user has the pacifist trait, then they won't be able to fire [src] if the round chambered inside of [src] is lethal. if(chambered.harmful) // Is the bullet chambered harmful? - to_chat(user, " [src] is lethally chambered! You don't want to risk harming anyone...") + if(user) + to_chat(user, " [src] is lethally chambered! You don't want to risk harming anyone...") return if(randomspread) sprd = round((rand() - 0.5) * DUALWIELD_PENALTY_EXTRA_MULTIPLIER * (randomized_gun_spread + randomized_bonus_spread), 1) else //Smart spread sprd = round((((rand_spr/burst_size) * iteration) - (0.5 + (rand_spr * 0.25))) * (randomized_gun_spread + randomized_bonus_spread), 1) - before_firing(target,user) + before_firing(target, user) if(!chambered.fire_casing(target, user, params, ,suppressed, zone_override, sprd, src)) shoot_with_empty_chamber(user) firing = FALSE return FALSE else - if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot + if(user && get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot shoot_live_shot(user, 1, target, message, stam_cost) else shoot_live_shot(user, 0, target, message, stam_cost) @@ -621,3 +625,11 @@ . = recoil if(user && !user.has_gravity()) . = recoil*5 + +/obj/item/gun/DoRevenantThrowEffects(atom/target) + while(HAS_TRAIT(src, TRAIT_SPOOKY_THROW)) + var/target + var/list/possible_targets = range(3,src) + target = pick(possible_targets) + if(target) + process_fire(null, target) From 16e0b85b4416f266513c3974da07b5a47a45876e Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 20 Jan 2021 18:23:28 +0200 Subject: [PATCH 4/8] More funshit --- code/controllers/subsystem/throwing.dm | 4 ++-- code/datums/components/storage/storage.dm | 4 ++++ code/game/atoms_movable.dm | 8 +++---- code/game/objects/items.dm | 23 +----------------- code/game/objects/items/cigs_lighters.dm | 8 ++++++- code/game/objects/items/devices/flashlight.dm | 7 ++++-- code/game/objects/items/plushes.dm | 2 +- code/game/objects/items/pneumaticCannon.dm | 14 +++++------ code/game/objects/items/tools/weldingtool.dm | 9 +++++-- code/modules/antagonists/revenant/revenant.dm | 24 +++++++++++++++++++ code/modules/assembly/flash.dm | 3 +++ code/modules/paperwork/paper.dm | 9 +++---- code/modules/projectiles/gun.dm | 12 +++++----- 13 files changed, 73 insertions(+), 54 deletions(-) diff --git a/code/controllers/subsystem/throwing.dm b/code/controllers/subsystem/throwing.dm index 567eed9bf6..9814f3e46e 100644 --- a/code/controllers/subsystem/throwing.dm +++ b/code/controllers/subsystem/throwing.dm @@ -65,14 +65,14 @@ SUBSYSTEM_DEF(throwing) var/last_move = 0 /datum/thrownthing/Destroy() + if(HAS_TRAIT_FROM(thrownthing, TRAIT_SPOOKY_THROW, "revenant")) + REMOVE_TRAIT(thrownthing, TRAIT_SPOOKY_THROW, "revenant") SSthrowing.processing -= thrownthing thrownthing.throwing = null thrownthing = null target = null thrower = null callback = null - if(HAS_TRAIT(thrownthing, TRAIT_SPOOKY_THROW) - REMOVE_TRAIT(thrownthing, TRAIT_SPOOKY_THROW) return ..() /datum/thrownthing/proc/tick() diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index f93d40bb04..2fa5a20d7a 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -449,6 +449,10 @@ // this must come before the screen objects only block, dunno why it wasn't before if(over_object == M) user_show_to_mob(M) + return + if(isrevenant(M)) + RevenantThrow(over_object, M, source) + return if(!M.incapacitated()) if(!istype(over_object, /obj/screen)) dump_content_at(over_object, M) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index c9d471e82a..09a0fad645 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -492,13 +492,13 @@ return TRUE //TODO: Better floating -/atom/movable/proc/float(on, float_height) - if(throwing) +/atom/movable/proc/float(on, throw_override) + if(throwing || !throw_override) return if(on && (!(movement_type & FLOATING) || floating_need_update)) - animate(src, pixel_y = pixel_y + 2 + float_height, time = 10, loop = -1) + animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) sleep(10) - animate(src, pixel_y = pixel_y - 2 - float_height, time = 10, loop = -1) + animate(src, pixel_y = pixel_y - 2, time = 10, loop = -1) if(!(movement_type & FLOATING)) setMovetype(movement_type | FLOATING) else if (!on && movement_type & FLOATING) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 846e49682f..fa5ab19fba 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -469,22 +469,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb usr.FlushCurrentAction() return TRUE //returning TRUE as a "is this overridden?" flag if(isrevenant(usr)) - var/mob/living/simple_animal/revenant/spooker = usr - if(!anchored && !spooker.telekinesis_cooldown) - spooker.change_essence_amount(-5, FALSE, "telekinesis") - spooker.stun(10) - spooker.reveal(30) - spooker.telekinesis_cooldown = TRUE - float(TRUE, 1) - sleep(10) - safe_throw_at(over, 10, 2) - ADD_TRAIT(src, TRAIT_SPOOKY_THROW) - DoRevenantThrowEffects(over) - log_combat(usr, over, "spooky telekinesised at", src) - var/obj/effect/temp_visual/telekinesis/T = new(get_turf(src)) - T.color = purple - addtimer(CALLBACK(src, /atom/movable.proc/float, FALSE), 2) - addtimer(CALLBACK(spooker, /mob/living/simple_animal/revenant.proc/telekinesis_cooldown_end), 50) + if(RevenantThrow(over, usr, src)) return if(!Adjacent(usr) || !over.Adjacent(usr)) @@ -493,12 +478,6 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb over.MouseDrop_T(src,usr) return -//Use this for effects you want to happen when a revenant throws itself, check the TRAIT_SPOOKY_THROW if you want to know if its still being thrown -/obj/item/proc/DoRevenantThrowEffects(atom/target) - var/datum/component/storage/STR = GetComponent(/datum/component/storage) - if(STR) - - // called after an item is placed in an equipment slot // user is mob that equipped it // slot uses the slot_X defines found in setup.dm diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index a21c7780b2..4280e7105f 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -137,7 +137,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM . = ..() /obj/item/clothing/mask/cigarette/DoRevenantThrowEffects(atom/target) - attackby(src) + if(lit) + attackby() + else + light() /obj/item/clothing/mask/cigarette/attackby(obj/item/W, mob/user, params) if(!lit && smoketime > 0) @@ -520,6 +523,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM overlay_state = pick(overlay_list) update_icon() +/obj/item/lighter/DoRevenantThrowEffects(atom/target) + set_lit() + /obj/item/lighter/suicide_act(mob/living/carbon/user) if (lit) user.visible_message("[user] begins holding \the [src]'s flame up to [user.p_their()] face! It looks like [user.p_theyre()] trying to commit suicide!") diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index a2459bce9f..e29519406a 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -37,11 +37,14 @@ /obj/item/flashlight/attack_self(mob/user) on = !on update_brightness(user) - playsound(user, on ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, 1) + playsound(src, on ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, TRUE) for(var/X in actions) var/datum/action/A = X A.UpdateButtonIcon() - return 1 + return TRUE + +/obj/item/flashlight/DoRevenantThrowEffects(atom/target) + attack_self() /obj/item/flashlight/suicide_act(mob/living/carbon/human/user) if (user.eye_blind) diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm index 3470d5e2c8..a5a3762a4f 100644 --- a/code/game/objects/items/plushes.dm +++ b/code/game/objects/items/plushes.dm @@ -46,7 +46,7 @@ set_snowflake_from_config(id) /obj/item/toy/plush/DoRevenantThrowEffects(atom/target) - var/datum/component/squeak/squeaker = GetComponent(datum/component/squeak) + var/datum/component/squeak/squeaker = GetComponent(/datum/component/squeak) squeaker.do_play_squeak(TRUE) /obj/item/toy/plush/Initialize(mapload, set_snowflake_id) diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index 6cd00f3434..1db5cdd526 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -44,12 +44,11 @@ START_PROCESSING(SSobj, src) /obj/item/pneumatic_cannon/DoRevenantThrowEffects(atom/target) - var/target + var/picked_target var/list/possible_targets = range(3,src) - target = pick(possible_targets) + picked_target = pick(possible_targets) if(target) - discharge = TRUE - Fire(null, target) + Fire(null, picked_target) /obj/item/pneumatic_cannon/process() if(++charge_tick >= charge_ticks && charge_type) @@ -148,7 +147,7 @@ if(!isliving(user)) return var/discharge = 0 - if(!can_trigger_gun(user)) + if(user && !can_trigger_gun(user)) return if(!loadedItems || !loadedWeightClass) if(user) @@ -174,14 +173,13 @@ var/list/possible_targets = range(3,src) target = pick(possible_targets) discharge = TRUE - if(!discharge) + if(!discharge && user) user.visible_message("[user] fires \the [src]!", \ "You fire \the [src]!") - if(user) - log_combat(user, target, "fired at", src) var/turf/T = get_target(target, get_turf(src)) playsound(src, 'sound/weapons/sonic_jackhammer.ogg', 50, TRUE) if(user) + log_combat(user, target, "fired at", src) fire_items(T, user) else fire_items(T) diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 92b222aed7..6b92b885bb 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -57,6 +57,9 @@ else item_state = "[initial(item_state)]" +/obj/item/weldingtool/DoRevenantThrowEffects(atom/target) + attack_self() + /obj/item/weldingtool/update_overlays() . = ..() if(change_icons) @@ -208,12 +211,14 @@ //Switches the welder on /obj/item/weldingtool/proc/switched_on(mob/user) if(!status) - to_chat(user, "[src] can't be turned on while unsecured!") + if(user) + to_chat(user, "[src] can't be turned on while unsecured!") return welding = !welding if(welding) if(get_fuel() >= 1) - to_chat(user, "You switch [src] on.") + if(user) + to_chat(user, "You switch [src] on.") playsound(loc, acti_sound, 50, 1) force = 15 damtype = "fire" diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index 1a45663ff7..f4ad961d54 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -441,6 +441,30 @@ qdel(revenant) ..() +/proc/RevenantThrow(over, mob/user, obj/item/throwable) + var/mob/living/simple_animal/revenant/spooker = user + if(!istype(throwable)) + return + if(!throwable.anchored && !spooker.telekinesis_cooldown && spooker.castcheck(-5)) + spooker.change_essence_amount(-5, FALSE, "telekinesis") + spooker.stun(20) + spooker.reveal(50) + spooker.telekinesis_cooldown = TRUE + throwable.float(TRUE) + sleep(10) + throwable.DoRevenantThrowEffects(over) + throwable.throw_at(over, 10, 2) + ADD_TRAIT(throwable, TRAIT_SPOOKY_THROW, "revenant") + throwable.float(FALSE, TRUE) + log_combat(throwable, over, "spooky telekinesised at", throwable) + var/obj/effect/temp_visual/telekinesis/T = new(get_turf(throwable)) + T.color = "#8715b4" + addtimer(CALLBACK(spooker, /mob/living/simple_animal/revenant.proc/telekinesis_cooldown_end), 50) + +//Use this for effects you want to happen when a revenant throws itself, check the TRAIT_SPOOKY_THROW if you want to know if its still being thrown +/obj/item/proc/DoRevenantThrowEffects(atom/target) + return TRUE + //objectives /datum/objective/revenant var/targetAmount = 100 diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 8a0645f311..07a9f499f8 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -30,6 +30,9 @@ attack(user,user) return FIRELOSS +/obj/item/assembly/flash/DoRevenantThrowEffects(atom/target) + AOE_flash() + /obj/item/assembly/flash/update_icon(flash = FALSE) cut_overlays() attached_overlays = list() diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 1f5280a5ce..a00145f9dc 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -193,16 +193,13 @@ user.visible_message(ignition_message) add_fingerprint(user) fire_act(I.get_temperature()) - +//I would have it become a paper plane before the throw, but that would risk runtimes /obj/item/paper/DoRevenantThrowEffects(atom/target) - sleep(5) + sleep(10) if(HAS_TRAIT(src, TRAIT_SPOOKY_THROW)) - sleep(5) - DoRevenantThrowEffects(atom/target) return - var/obj/item/paperplane/plane = new(get_turf(src)) + new /obj/item/paperplane(get_turf(src)) qdel(src) - plane.safe_throw_at(over, 10, 2) /obj/item/paper/attackby(obj/item/P, mob/living/user, params) if(burn_paper_product_attackby_check(P, user)) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 9e8af0cd00..eb75a37f19 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -626,10 +626,10 @@ if(user && !user.has_gravity()) . = recoil*5 + /obj/item/gun/DoRevenantThrowEffects(atom/target) - while(HAS_TRAIT(src, TRAIT_SPOOKY_THROW)) - var/target - var/list/possible_targets = range(3,src) - target = pick(possible_targets) - if(target) - process_fire(null, target) + var/picked_target + var/list/possible_targets = range(3,src) + picked_target = pick(possible_targets) + if(picked_target) + process_fire(null, picked_target) From 87c92017074325935634763cc63d66289c3d1318 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 20 Jan 2021 19:51:11 +0200 Subject: [PATCH 5/8] No gunning sadly --- code/game/objects/items/tanks/tanks.dm | 6 ++++++ code/modules/antagonists/revenant/revenant.dm | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 08b91332ef..0c55cdd701 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -73,6 +73,12 @@ /obj/item/tank/proc/populate_gas() return +/obj/item/tank/DoRevenantThrowEffects(atom/target) + if(air_contents) + var/turf/location = get_turf(src) + location.assume_air(air_contents) + visible_message(" Date: Wed, 20 Jan 2021 20:25:36 +0200 Subject: [PATCH 6/8] Tank memes finished --- code/game/objects/items/tanks/tanks.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 0c55cdd701..d57f0cc51f 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -75,9 +75,12 @@ /obj/item/tank/DoRevenantThrowEffects(atom/target) if(air_contents) - var/turf/location = get_turf(src) - location.assume_air(air_contents) - visible_message(" Date: Wed, 20 Jan 2021 22:30:14 +0200 Subject: [PATCH 7/8] Forgot to undo some testing changes --- code/game/objects/items.dm | 1 - code/modules/projectiles/gun.dm | 32 ++++++++++---------------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 46ac106b45..9cc8617b5e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -455,7 +455,6 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb /obj/item/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params) //Copypaste of /atom/MouseDrop() since this requires code in a very specific spot if(!usr || !over) return - message_admins("[src], [usr], [over], [src_location], [over_location], [src_control], [over_control], [params]") if(SEND_SIGNAL(src, COMSIG_MOUSEDROP_ONTO, over, usr) & COMPONENT_NO_MOUSEDROP) //Whatever is receiving will verify themselves for adjacency. return if(over == src) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 25a718ff29..e3a2da68da 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -148,8 +148,7 @@ return TRUE /obj/item/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj) - if(user) - to_chat(user, "*click*") + to_chat(user, "*click*") playsound(src, "gun_dry_fire", 30, 1) /obj/item/gun/proc/shoot_live_shot(mob/living/user, pointblank = FALSE, mob/pbtarget, message = 1, stam_cost = 0) @@ -188,7 +187,7 @@ /obj/item/gun/afterattack(atom/target, mob/living/user, flag, params) . = ..() - if(user && !CheckAttackCooldown(user, target, TRUE)) + if(!CheckAttackCooldown(user, target, TRUE)) return process_afterattack(target, user, flag, params) @@ -200,8 +199,6 @@ return if(firing) return - if(!user) - return var/stamloss = user.getStaminaLoss() if(flag) //It's adjacent, is the user, or is on the user's person if(target in user.contents) //can't shoot stuff inside us. @@ -308,8 +305,7 @@ return busy_action || firing || ((last_fire + fire_delay) > world.time) /obj/item/gun/proc/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0, stam_cost = 0) - if(user) - add_fingerprint(user) + add_fingerprint(user) if(on_cooldown()) return @@ -347,7 +343,7 @@ shoot_with_empty_chamber(user) return else - if(user && get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot + if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot shoot_live_shot(user, 1, target, message, stam_cost) else shoot_live_shot(user, 0, target, message, stam_cost) @@ -361,29 +357,29 @@ return TRUE /obj/item/gun/proc/do_burst_shot(mob/living/user, atom/target, message = TRUE, params=null, zone_override = "", sprd = 0, randomized_gun_spread = 0, randomized_bonus_spread = 0, rand_spr = 0, iteration = 0, stam_cost = 0) - if(!firing) + if(!user || !firing) + firing = FALSE return FALSE - if(user && !issilicon(user)) + if(!issilicon(user)) if(iteration > 1 && !(user.is_holding(src))) //for burst firing firing = FALSE return FALSE if(chambered && chambered.BB) if(HAS_TRAIT(user, TRAIT_PACIFISM)) // If the user has the pacifist trait, then they won't be able to fire [src] if the round chambered inside of [src] is lethal. if(chambered.harmful) // Is the bullet chambered harmful? - if(user) - to_chat(user, " [src] is lethally chambered! You don't want to risk harming anyone...") + to_chat(user, " [src] is lethally chambered! You don't want to risk harming anyone...") return if(randomspread) sprd = round((rand() - 0.5) * DUALWIELD_PENALTY_EXTRA_MULTIPLIER * (randomized_gun_spread + randomized_bonus_spread), 1) else //Smart spread sprd = round((((rand_spr/burst_size) * iteration) - (0.5 + (rand_spr * 0.25))) * (randomized_gun_spread + randomized_bonus_spread), 1) - before_firing(target, user) + before_firing(target,user) if(!chambered.fire_casing(target, user, params, ,suppressed, zone_override, sprd, src)) shoot_with_empty_chamber(user) firing = FALSE return FALSE else - if(user && get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot + if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot shoot_live_shot(user, 1, target, message, stam_cost) else shoot_live_shot(user, 0, target, message, stam_cost) @@ -640,11 +636,3 @@ . = recoil if(user && !user.has_gravity()) . = recoil*5 - - -/obj/item/gun/DoRevenantThrowEffects(atom/target) - var/picked_target - var/list/possible_targets = range(3,src) - picked_target = pick(possible_targets) - if(picked_target) - process_fire(null, picked_target) From b569d592718ea4baeb942c1ca161a95da2826776 Mon Sep 17 00:00:00 2001 From: Artur Date: Mon, 25 Jan 2021 22:07:04 +0200 Subject: [PATCH 8/8] Did the suggestion --- code/modules/antagonists/revenant/revenant.dm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index 32d16b687d..ef58e5af39 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -445,10 +445,16 @@ var/mob/living/simple_animal/revenant/spooker = user if(!istype(throwable)) return - if(!throwable.anchored && !spooker.telekinesis_cooldown && spooker.castcheck(-25)) + if(!throwable.anchored && !spooker.telekinesis_cooldown && spooker.essence > 20) + if(7 < get_dist(throwable, spooker)) + return + if(3 >= get_dist(throwable, spooker)) + spooker.stun(10) + spooker.reveal(25) + else + spooker.stun(20) + spooker.reveal(50) spooker.change_essence_amount(-20, FALSE, "telekinesis") - spooker.stun(20) - spooker.reveal(50) spooker.telekinesis_cooldown = TRUE throwable.float(TRUE, TRUE) sleep(20) @@ -463,7 +469,7 @@ throwable.float(FALSE, TRUE) -//Use this for effects you want to happen when a revenant throws itself, check the TRAIT_SPOOKY_THROW if you want to know if its still being thrown +//Use this for effects you want to happen when a revenant throws stuff, check the TRAIT_SPOOKY_THROW if you want to know if its still being thrown /obj/item/proc/DoRevenantThrowEffects(atom/target) return TRUE