diff --git a/code/modules/mining/lavaland/loot/ashdragon_loot.dm b/code/modules/mining/lavaland/loot/ashdragon_loot.dm index dcf6e895f93..e5ac63480a7 100644 --- a/code/modules/mining/lavaland/loot/ashdragon_loot.dm +++ b/code/modules/mining/lavaland/loot/ashdragon_loot.dm @@ -201,11 +201,10 @@ /obj/item/lava_staff name = "staff of lava" desc = "The power of fire and rocks in your hands!" - icon_state = "staffofstorms" - item_state = "staffofstorms" + icon_state = "lavastaff" + item_state = "lavastaff" icon = 'icons/obj/guns/magic.dmi' slot_flags = SLOT_BACK - item_state = "staffofstorms" w_class = WEIGHT_CLASS_BULKY force = 25 damtype = BURN diff --git a/code/modules/mining/lavaland/loot/legion_loot.dm b/code/modules/mining/lavaland/loot/legion_loot.dm index 4501ff2f6cb..ba6f267aa42 100644 --- a/code/modules/mining/lavaland/loot/legion_loot.dm +++ b/code/modules/mining/lavaland/loot/legion_loot.dm @@ -1,4 +1,4 @@ -/obj/item/staff/storm +/obj/item/storm_staff name = "staff of storms" desc = "An ancient staff retrieved from the remains of Legion. The wind stirs as you move it." icon_state = "staffofstorms" @@ -8,16 +8,27 @@ w_class = WEIGHT_CLASS_BULKY force = 25 damtype = BURN - hitsound = 'sound/weapons/sear.ogg' + resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF needs_permit = TRUE - var/storm_type = /datum/weather/ash_storm - var/storm_cooldown = 0 + var/max_thunder_charges = 3 + var/thunder_charges = 3 + var/thunder_charge_time = 15 SECONDS + var/static/list/excluded_areas = list(/area/space) + ///This is a list of turfs currently being targeted. + var/list/targeted_turfs = list() -/obj/item/staff/storm/attack_self(mob/user) - if(storm_cooldown > world.time) - to_chat(user, "The staff is still recharging!") - return +/obj/item/storm_staff/Destroy() + targeted_turfs = null + return ..() +/obj/item/storm_staff/examine(mob/user) + . = ..() + . += "It has [thunder_charges] charges remaining." + . += "Use it in hand to dispel storms." + . += "Use it on targets to summon thunderbolts from the sky." + . += "The thunderbolts are boosted if in an area with weather effects." + +/obj/item/storm_staff/attack_self(mob/user) var/area/user_area = get_area(user) var/turf/user_turf = get_turf(user) if(!user_area || !user_turf) @@ -39,16 +50,81 @@ "You hold [src] skyward, dispelling the storm!") playsound(user, 'sound/magic/staff_change.ogg', 200, 0) A.wind_down() - return - else - A = new storm_type(list(user_turf.z)) - A.name = "staff storm" - A.area_type = user_area.type - A.telegraph_duration = 100 - A.end_duration = 100 + var/old_color = user.color + user.color = list(340/255, 240/255, 0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1, 0,0,0,0) + var/old_transform = user.transform + user.transform *= 1.2 + animate(user, color = old_color, transform = old_transform, time = 1 SECONDS) - user.visible_message("[user] holds [src] skywards as red lightning crackles into the sky!", \ - "You hold [src] skyward, calling down a terrible storm!") - playsound(user, 'sound/magic/staff_change.ogg', 200, 0) - A.telegraph() - storm_cooldown = world.time + 200 +/obj/item/storm_staff/afterattack(atom/target, mob/user, proximity_flag, click_parameters) + . = ..() + if(!thunder_charges) + to_chat(user, "The staff needs to recharge.") + return + var/turf/target_turf = get_turf(target) + var/area/target_area = get_area(target) + var/area/user_area = get_area(user) + if(!target_turf || !target_area || (is_type_in_list(target_area, excluded_areas)) || !user_area || (is_type_in_list(user_area, excluded_areas))) + to_chat(user, "The staff will not work here.") + return + if(target_turf in targeted_turfs) + to_chat(user, "That SPOT is already being shocked!") + return + if(HAS_TRAIT(user, TRAIT_PACIFISM)) + to_chat(user, "You don't want to hurt anyone!") + return + var/power_boosted = FALSE + for(var/V in SSweather.processing) + var/datum/weather/W = V + if((target_turf.z in W.impacted_z_levels) && W.area_type == target_area.type) + power_boosted = TRUE + break + playsound(src, 'sound/magic/lightningshock.ogg', 10, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE, falloff_distance = 0) + targeted_turfs += target_turf + to_chat(user, "You aim at [target_turf]!") + new /obj/effect/temp_visual/thunderbolt_targeting(target_turf) + addtimer(CALLBACK(src, PROC_REF(throw_thunderbolt), target_turf, power_boosted), 1.5 SECONDS) + thunder_charges-- + addtimer(CALLBACK(src, PROC_REF(recharge)), thunder_charge_time) + +/obj/item/storm_staff/proc/recharge(mob/user) + thunder_charges = min(thunder_charges + 1, max_thunder_charges) + playsound(src, 'sound/magic/charge.ogg', 10, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE, falloff_distance = 0) + +/obj/item/storm_staff/proc/throw_thunderbolt(turf/target, boosted) + targeted_turfs -= target + new /obj/effect/temp_visual/thunderbolt(target) + var/list/affected_turfs = list(target) + if(boosted) + for(var/direction in GLOB.alldirs) + var/turf_to_add = get_step(target, direction) + if(!turf_to_add) + continue + affected_turfs += turf_to_add + for(var/turf/T as anything in affected_turfs) + new /obj/effect/temp_visual/electricity(T) + for(var/mob/living/hit_mob in T) + to_chat(hit_mob, "You've been struck by lightning!") + hit_mob.electrocute_act(15 * (isanimal(hit_mob) ? 3 : 1) * (T == target ? 2 : 1) * (boosted ? 2 : 1), src, flags = SHOCK_TESLA|SHOCK_NOSTUN) + + for(var/obj/hit_thing in T) + hit_thing.take_damage(20, BURN, ENERGY, FALSE) + playsound(target, 'sound/magic/lightningbolt.ogg', 100, TRUE) + target.visible_message("A thunderbolt strikes [target]!") + explosion(target, -1, -1, light_impact_range = (boosted ? 1 : 0), flame_range = (boosted ? 2 : 1), silent = TRUE) + + +/obj/effect/temp_visual/thunderbolt_targeting + icon_state = "target_circle" + layer = BELOW_MOB_LAYER + light_range = 1 + duration = 2 SECONDS + +/obj/effect/temp_visual/thunderbolt + icon_state = "thunderbolt" + icon = 'icons/effects/32x96.dmi' + duration = 0.6 SECONDS + +/obj/effect/temp_visual/electricity + icon_state = "electricity3" + duration = 0.5 SECONDS diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm index ee8e7791340..7ee14ad12db 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm @@ -43,8 +43,8 @@ Difficulty: Medium internal_gps = /obj/item/gps/internal/legion medal_type = BOSS_MEDAL_LEGION score_type = LEGION_SCORE - loot = list(/obj/item/staff/storm) - crusher_loot = list(/obj/item/staff/storm, /obj/item/crusher_trophy/empowered_legion_skull) + loot = list(/obj/item/storm_staff) + crusher_loot = list(/obj/item/storm_staff, /obj/item/crusher_trophy/empowered_legion_skull) vision_range = 13 elimination = TRUE appearance_flags = 0 diff --git a/icons/effects/32x96.dmi b/icons/effects/32x96.dmi new file mode 100644 index 00000000000..b5eed61222b Binary files /dev/null and b/icons/effects/32x96.dmi differ diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index 9db0364de2e..91983912feb 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ diff --git a/icons/mob/clothing/back.dmi b/icons/mob/clothing/back.dmi index 29db0c666ef..4477b2d6c74 100644 Binary files a/icons/mob/clothing/back.dmi and b/icons/mob/clothing/back.dmi differ diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi index 87ef3e598c9..3d609d2d40d 100644 Binary files a/icons/mob/inhands/items_lefthand.dmi and b/icons/mob/inhands/items_lefthand.dmi differ diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi index b66341600da..3297447dce9 100644 Binary files a/icons/mob/inhands/items_righthand.dmi and b/icons/mob/inhands/items_righthand.dmi differ diff --git a/icons/obj/guns/magic.dmi b/icons/obj/guns/magic.dmi index e4153046565..88c124d8257 100644 Binary files a/icons/obj/guns/magic.dmi and b/icons/obj/guns/magic.dmi differ