Skip to content

Commit

Permalink
Merge pull request Monkestation#1137 from wraith-54321/clock-what
Browse files Browse the repository at this point in the history
Ranged melee effects fix
  • Loading branch information
wraith-54321 authored Feb 3, 2024
2 parents 415d729 + 891fd39 commit c12e067
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions monkestation/code/modules/antagonists/clock_cult/items/weaponry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
/// Typecache of valid turfs to have the weapon's special effect on
var/static/list/effect_turf_typecache = typecacheof(list(/turf/open/floor/bronze, /turf/open/indestructible/reebe_flooring))


/obj/item/clockwork/weapon/afterattack(mob/living/target, mob/living/user)
. = ..()
var/turf/gotten_turf = get_turf(user)
if(!.)
return

var/turf/gotten_turf = get_turf(user)
if(!is_type_in_typecache(gotten_turf, effect_turf_typecache))
return

if((!QDELETED(target) && (!ismob(target) || (ismob(target) && target.stat != DEAD && !IS_CLOCK(target) && !target.can_block_magic(MAGIC_RESISTANCE_HOLY)))))
hit_effect(target, user)


/obj/item/clockwork/weapon/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..()
if(.)
Expand All @@ -46,12 +46,10 @@
if(!target.can_block_magic(MAGIC_RESISTANCE_HOLY) && !IS_CLOCK(target))
hit_effect(target, throwingdatum.thrower, TRUE)


/// What occurs to non-holy people when attacked from brass tiles
/obj/item/clockwork/weapon/proc/hit_effect(mob/living/target, mob/living/user, thrown = FALSE)
return


/obj/item/clockwork/weapon/brass_spear
name = "brass spear"
desc = "A razor-sharp spear made of brass. It thrums with barely-contained energy."
Expand Down Expand Up @@ -155,7 +153,6 @@
hitsound = 'sound/weapons/smash.ogg'
block_chance = 10


/obj/item/clockwork/weapon/brass_battlehammer/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, \
Expand All @@ -164,7 +161,6 @@
force_wielded = 30, \
)


/obj/item/clockwork/weapon/brass_battlehammer/hit_effect(mob/living/target, mob/living/user, thrown = FALSE)
if((!thrown && !HAS_TRAIT(src, TRAIT_WIELDED)) || !istype(target))
return
Expand All @@ -175,7 +171,6 @@
/obj/item/clockwork/weapon/brass_battlehammer/update_icon_state()
icon_state = "[base_icon_state]0"
return ..()

/obj/item/clockwork/weapon/brass_sword
name = "brass longsword"
desc = "A large sword made of brass."
Expand All @@ -189,7 +184,6 @@
block_chance = 35
COOLDOWN_DECLARE(emp_cooldown)


/obj/item/clockwork/weapon/brass_sword/hit_effect(mob/living/target, mob/living/user, thrown)
if(!COOLDOWN_FINISHED(src, emp_cooldown))
return
Expand All @@ -202,7 +196,6 @@
to_chat(user, span_brass("You strike [target] with an electromagnetic pulse!"))
playsound(user, 'sound/magic/lightningshock.ogg', 40)


/obj/item/clockwork/weapon/brass_sword/attack_atom(obj/attacked_obj, mob/living/user, params)
. = ..()
var/turf/gotten_turf = get_turf(user)
Expand All @@ -222,11 +215,9 @@
to_chat(user, span_brass("You strike [target] with an electromagnetic pulse!"))
playsound(user, 'sound/magic/lightningshock.ogg', 40)


/obj/item/clockwork/weapon/brass_sword/proc/send_message(mob/living/target)
to_chat(target, span_brass("[src] glows, indicating the next attack will disrupt electronics of the target."))


/obj/item/gun/ballistic/bow/clockwork
name = "brass bow"
desc = "A bow made from brass and other components that you can't quite understand. It glows with a deep energy and frabricates arrows by itself. \
Expand Down Expand Up @@ -282,37 +273,31 @@
playsound(src, 'sound/weapons/draw_bow.ogg', 75, 0) //gets way too high pitched if the freq varies
update_icon()


/// Recharges a bolt, done after the delay in shoot_live_shot
/obj/item/gun/ballistic/bow/clockwork/proc/recharge_bolt()
var/obj/item/ammo_casing/caseless/arrow/clockbolt/bolt = new
magazine.give_round(bolt)
chambered = bolt
update_icon()


/obj/item/gun/ballistic/bow/clockwork/attackby(obj/item/I, mob/user, params)
return


/obj/item/gun/ballistic/bow/clockwork/update_icon_state()
. = ..()
icon_state = "[base_icon_state]_[chambered ? "chambered" : "unchambered"]_[drawn ? "drawn" : "undrawn"]"


/obj/item/ammo_box/magazine/internal/bow/clockwork
ammo_type = /obj/item/ammo_casing/caseless/arrow/clockbolt
start_empty = FALSE


/obj/item/ammo_casing/caseless/arrow/clockbolt
name = "energy bolt"
desc = "An arrow made from a strange energy."
icon = 'monkestation/icons/obj/clock_cult/ammo.dmi'
icon_state = "arrow_redlight"
projectile_type = /obj/projectile/energy/clockbolt


/obj/projectile/energy/clockbolt
name = "energy bolt"
icon = 'monkestation/icons/obj/clock_cult/projectiles.dmi'
Expand Down

0 comments on commit c12e067

Please sign in to comment.