Skip to content

Commit

Permalink
Flamethrower spell, more tweaks, remove "tower" subtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDinamit committed Oct 15, 2023
1 parent 42b7808 commit cd9dbbb
Show file tree
Hide file tree
Showing 23 changed files with 75 additions and 137 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3133,6 +3133,7 @@
#include "code\modules\spells\aimed\_aimed.dm"
#include "code\modules\spells\aimed\dispell.dm"
#include "code\modules\spells\aimed\fireball.dm"
#include "code\modules\spells\aimed\flamethrower.dm"
#include "code\modules\spells\aimed\healing.dm"
#include "code\modules\spells\aimed\passage.dm"
#include "code\modules\spells\aimed\spark_bolt.dm"
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/effects/magic_orb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
icon = 'icons/effects/magic_orb.dmi'
icon_state = "orb"
anchored = TRUE
particles = new /particles/magic_orb
var/datum/sound_token/sound_token
var/sound_id
var/ambient_sound = 'sound/magic/orb_ambience.ogg'
Expand All @@ -14,7 +15,6 @@
return
sound_id = "[type]_[sequential_id(/obj/effect/magic_orb)]"
sound_token = GLOB.sound_player.PlayLoopingSound(src, sound_id, ambient_sound, 50, 14, 4)
particles = new /particles/magic_orb()

/obj/effect/magic_orb/Destroy()
QDEL_NULL(sound_token)
Expand All @@ -27,9 +27,9 @@
if(!CanUseOrb(user))
return
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_ORB_PICKUP, src, user)
playsound(src, 'sound/magic/orb_pickup.ogg', 75, FALSE, 3)
playsound(src, 'sound/magic/orb_pickup.ogg', 100, FALSE, 10, 3)
var/obj/effect/temp_visual/decoy/D = new /obj/effect/temp_visual/decoy(loc, dir, src, 10)
animate(D, alpha = 0, color = "#aaaaff", transform = matrix()*2, time = 10)
animate(D, alpha = 0, color = "#aaaaff", transform = matrix()*1.5, time = 10)
OrbEffect(user)
qdel(src)
return
Expand Down
4 changes: 0 additions & 4 deletions code/game/objects/effects/temporary.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,3 @@

/obj/effect/temp_visual/slash/proc/FadeOut()
animate(src, alpha = 0, time = 5)

// Used by water slash spell
/obj/effect/temp_visual/slash/water
color = COLOR_BLUE
64 changes: 0 additions & 64 deletions code/modules/codex/entries/spells.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,67 +49,3 @@
/datum/codex_entry/heal_target
associated_paths = list(/datum/spell/targeted/heal_target)
antag_text = "Grants you the ability to heal yourself or a nearby target slightly."

/datum/codex_entry/create_air/tower
associated_paths = list(/datum/spell/create_air/tower)
antag_text = "Allows you to generate a livable atmosphere in the area you are in."

/datum/codex_entry/acid_spray/tower
associated_paths = list(/datum/spell/acid_spray/tower)
antag_text = "The simplest form of aggressive conjuration: acid spray is quite effective in melting both man and object."

/datum/codex_entry/forcewall/tower
associated_paths = list(/datum/spell/aoe_turf/conjure/forcewall/tower)
antag_text = "A temporary invincible wall for you to summon."

/datum/codex_entry/faithful_hound/tower
associated_paths = list(/datum/spell/aoe_turf/conjure/faithful_hound/tower)
antag_text = "This spell allows you to summon a singular spectral dog that guards the nearby area. Anyone without the password is barked at or bitten."

/datum/codex_entry/dyrnwyn/tower
associated_paths = list(/datum/spell/targeted/equip_item/dyrnwyn/tower)
antag_text = "This spell allows you to summon a golden firey sword for a short duration."

/datum/codex_entry/shield/tower
associated_paths = list(/datum/spell/targeted/equip_item/shield/tower)
antag_text = "This spell allows you to summon a magical shield for a short duration."

/datum/codex_entry/fireball/tower
associated_paths = list(/datum/spell/aimed/fireball/tower)
antag_text = "Imbue yourself with the power of exploding fire."

/datum/codex_entry/force_portal/tower
associated_paths = list(/datum/spell/aoe_turf/conjure/force_portal/tower)
antag_text = "This spell allows you to summon a force portal. Anything that hits the portal gets sucked inside and is then thrown out when the portal explodes."

/datum/codex_entry/slippery_surface/tower
associated_paths = list(/datum/spell/hand/slippery_surface/tower)
antag_text = "Allows you to slicken a small patch of floor. Anyone without sure-footing will find it hard to stay upright."

/datum/codex_entry/smoke/tower
associated_paths = list(/datum/spell/aoe_turf/smoke/tower)
antag_text = "Allows you to distill the nearby air into smoke."

/datum/codex_entry/knock/tower
associated_paths = list(/datum/spell/aoe_turf/knock/tower)
antag_text = "Allows you to open nearby doors without the keys."

/datum/codex_entry/burning_grip/tower
associated_paths = list(/datum/spell/hand/burning_grip/tower)
antag_text = "Allows you cause an object to heat up intensly in someone's hand, making them drop it and whatever skin is attached."

/datum/codex_entry/ethereal_jaunt/tower
associated_paths = list(/datum/spell/targeted/ethereal_jaunt/tower)
antag_text = "Allows you to liquify for a short duration, letting them pass through all dense objects."

/datum/codex_entry/heal_target/tower
associated_paths = list(/datum/spell/aimed/heal_target/tower)
antag_text = "Allows you to heal yourself, or others, for a slight amount."

/datum/codex_entry/heal_target/major/tower
associated_paths = list(/datum/spell/aimed/heal_target/major/tower)
antag_text = "Allows you to heal others for a great amount."

/datum/codex_entry/heal_target/area/tower
associated_paths = list(/datum/spell/targeted/heal_target/area/tower)
antag_text = "Allows you to heal everyone in an area for minor damage."
2 changes: 2 additions & 0 deletions code/modules/spellbook/_spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ GLOBAL_LIST_EMPTY(spells_by_categories)
dat += "<A href='byond://?src=\ref[src];purchase=[S]'>Purchase ([initial(S.spell_cost)] points)</a><br>"
else
for(var/upgrade_type in OS.spell_levels)
if(OS.level_max[upgrade_type] <= 0)
continue
dat += "Current [upgrade_type] level: [OS.spell_levels[upgrade_type]]/[OS.level_max[upgrade_type]].<br>"
if(!OS.can_improve(upgrade_type))
continue
Expand Down
5 changes: 1 addition & 4 deletions code/modules/spells/aimed/fireball.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

level_max = list(UPGRADE_TOTAL = 5, UPGRADE_SPEED = 0, UPGRADE_POWER = 5)

categories = list(SPELL_CATEGORY_EXPLOSIVE)
categories = list(SPELL_CATEGORY_FIRE, SPELL_CATEGORY_EXPLOSIVE)
spell_cost = 5
mana_cost = 20

Expand All @@ -35,9 +35,6 @@

return "The spell [src] now has a larger explosion."

/datum/spell/aimed/fireball/tower
charge_max = 2

/datum/spell/aimed/fireball/prox_cast(list/targets, spell_holder)
var/turf/T = get_turf(spell_holder)
if(LAZYLEN(targets))
Expand Down
59 changes: 59 additions & 0 deletions code/modules/spells/aimed/flamethrower.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/datum/spell/aimed/flamethrower
name = "Flamethrower"
desc = "This spell sets a small targeted area on fire."
deactive_msg = "You discharge the flamethrower spell..."
active_msg = "You charge the flamethrower spell!"

charge_max = 10 SECONDS
cooldown_reduc = 4 SECONDS

invocation = "Flamma!"
invocation_type = INVOKE_SHOUT
level_max = list(UPGRADE_TOTAL = 3, UPGRADE_SPEED = 2, UPGRADE_POWER = 2)

range = 8
hud_state = "wiz_flame"
cast_sound = 'sound/magic/fire.ogg'
spell_cost = 2
mana_cost = 6
categories = list(SPELL_CATEGORY_FIRE)

var/flame_power = 20
var/flame_distance = 4
var/flame_color = COLOR_RED_GRAY

/datum/spell/aimed/flamethrower/TargetCastCheck(mob/living/user, mob/living/target)
if(get_dist(user, target) > range)
to_chat(user, SPAN_WARNING("The target is too far away!"))
return FALSE
return ..()

/datum/spell/aimed/flamethrower/fire_projectile(mob/living/user, mob/living/target)
. = ..()
var/turf/start_turf = get_step(get_turf(user), get_dir(user, target))
var/turf/target_turf = get_ranged_target_turf_direct(start_turf, target, flame_distance)
var/list/flame_line = getline(start_turf, target_turf)
for(var/i = 1 to length(flame_line))
var/turf/T = flame_line[i]
if(T.density)
break
var/dense_obj = FALSE
for(var/obj/O in T)
if(O.density)
dense_obj = TRUE
break
if(dense_obj)
break
addtimer(CALLBACK(src, .proc/PlaceFlame, T), i-1)

/datum/spell/aimed/flamethrower/proc/PlaceFlame(turf/T)
T.IgniteTurf(flame_power, flame_color)
T.hotspot_expose((flame_power * 3) + 380, 500)

/datum/spell/aimed/flamethrower/empower_spell()
if(!..())
return FALSE

flame_power += 20
flame_color = flame_power >= 60 ? COLOR_PURPLE : COLOR_RED
return "The [src] spell is now much more powerful."
12 changes: 0 additions & 12 deletions code/modules/spells/aimed/healing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@
robo_damage -= 7
return "[src] will now heal more."

// Admin subtype
/datum/spell/aimed/heal_target/tower
name = "Instant Cure Light Wounds"
charge_max = 2
spell_book_visible = FALSE

/datum/spell/aimed/heal_target/touch
name = "Healing Touch"
desc = "Heals an adjacent target for a reasonable amount of health."
Expand Down Expand Up @@ -134,12 +128,6 @@

return "[src] heals more, and heals organ damage and radiation."

// Admin subtype
/datum/spell/aimed/heal_target/major/tower
charge_max = 1
spell_flags = 0
spell_book_visible = FALSE

/datum/spell/aimed/heal_target/sacrifice
name = "Sacrifice"
desc = "This spell heals immensily. For a price. Does not require wizard garb."
Expand Down
14 changes: 9 additions & 5 deletions code/modules/spells/aimed/water_slash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
level_max = list(UPGRADE_TOTAL = 3, UPGRADE_SPEED = 2, UPGRADE_POWER = 2)

range = 8
hud_state = "slash"
hud_state = "wiz_slash"
cast_sound = 'sound/magic/water.ogg'
spell_cost = 2
mana_cost = 10

var/slash_damage = 50
var/slash_distance = 4
var/slash_color = COLOR_DEEP_SKY_BLUE

/datum/spell/aimed/water_slash/TargetCastCheck(mob/living/user, mob/living/target)
if(get_dist(user, target) > range)
Expand All @@ -28,12 +29,14 @@

/datum/spell/aimed/water_slash/fire_projectile(mob/living/user, mob/living/target)
. = ..()
var/turf/start_turf = get_step(get_turf(user), get_dir(user, target))
var/turf/start_turf = get_turf(user)
var/turf/target_turf = get_ranged_target_turf_direct(start_turf, target, slash_distance)
/// The turf where the slash effect will visibly travel
var/turf/move_turf = target_turf
var/list/attack_line = list()
for(var/turf/T in getline(start_turf, target_turf))
if(T == start_turf)
continue
if(T.density)
break
var/dense_obj = FALSE
Expand All @@ -46,12 +49,13 @@
attack_line += T
move_turf = T

var/obj/effect/temp_visual/slash/water/S = new(start_turf)
var/obj/effect/temp_visual/slash/S = new(start_turf)
S.color = slash_color
var/matrix/M = new
M.Turn(Get_Angle(start_turf, target_turf))
S.transform = M
animate(S, alpha = 225, pixel_x = (move_turf.x - start_turf.x) * world.icon_size, pixel_y = (move_turf.y - start_turf.y) * world.icon_size, transform = matrix(S.transform) * 3, time = 1)
addtimer(CALLBACK(S, /obj/effect/temp_visual/slash/proc/FadeOut), 1)
animate(S, alpha = 225, pixel_x = (move_turf.x - start_turf.x) * world.icon_size, pixel_y = (move_turf.y - start_turf.y) * world.icon_size, transform = matrix(S.transform) * 3, time = 1.5)
addtimer(CALLBACK(S, /obj/effect/temp_visual/slash/proc/FadeOut), 1.5)
var/list/already_hit = list()
for(var/turf/T in attack_line)
for(var/turf/TT in range(1, T))
Expand Down
4 changes: 0 additions & 4 deletions code/modules/spells/aoe_turf/conjure/faithful_hound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@
..()
var/password = sanitize(input("What password will this beast listen to?") as text, MAX_NAME_LEN)
newVars = list("password" = password, "allowed_mobs" = list(usr))

/datum/spell/aoe_turf/conjure/faithful_hound/tower
charge_max = 1
spell_flags = 0
4 changes: 0 additions & 4 deletions code/modules/spells/aoe_turf/conjure/force_portal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@

spell_cost = 2
mana_cost = 20

/datum/spell/aoe_turf/conjure/force_portal/tower
charge_max = 2
spell_flags = 0
3 changes: 0 additions & 3 deletions code/modules/spells/aoe_turf/conjure/forcewall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,3 @@
icon_state = "empty"
name = "invisible wall"
desc = "You have a bad feeling about this."

/datum/spell/aoe_turf/conjure/forcewall/tower
charge_max = 3
3 changes: 0 additions & 3 deletions code/modules/spells/aoe_turf/knock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@
/datum/spell/aoe_turf/knock/slow
name = "Slow Knock"
charge_max = 200

/datum/spell/aoe_turf/knock/tower
charge_max = 2
3 changes: 0 additions & 3 deletions code/modules/spells/aoe_turf/smoke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@
smoke_amt += 2

return "[src] will now create more smoke."

/datum/spell/aoe_turf/smoke/tower
charge_max = 2
3 changes: 0 additions & 3 deletions code/modules/spells/general/acid_spray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@
chem.set_color()
spawn(0)
chem.set_up(get_ranged_target_turf(target, angle2dir(angle+mod), 3))

/datum/spell/acid_spray/tower
charge_max = 2
3 changes: 0 additions & 3 deletions code/modules/spells/general/create_air.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@
var/datum/gas_mixture/environment = targets[1]
for(var/gas in air_change)
environment.adjust_gas(gas, air_change[gas])

/datum/spell/create_air/tower
charge_max = 5
3 changes: 0 additions & 3 deletions code/modules/spells/hand/burning_grip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@
else
E.take_external_damage(burn=6, used_weapon = "hot iron")
to_chat(H, "<span class='warning'>You look down to notice that your [E] is burned.</span>")

/datum/spell/hand/burning_grip/tower
charge_max = 3
3 changes: 0 additions & 3 deletions code/modules/spells/hand/slippery_surface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@
T.wet_floor(50)
new /obj/effect/temp_visual/temporary(T,3, 'icons/effects/effects.dmi', "sonar_ping")
return ..()

/datum/spell/hand/slippery_surface/tower
charge_max = 2
3 changes: 0 additions & 3 deletions code/modules/spells/targeted/equip/dyrnwyn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@

material = MATERIAL_SILVER
return "Dyrnwyn has been made pure: it is now made of silver."

/datum/spell/targeted/equip_item/dyrnwyn/tower
charge_max = 1
3 changes: 0 additions & 3 deletions code/modules/spells/targeted/equip/shield.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@
block_chance = 60

return "Your summoned shields will now block more often."

/datum/spell/targeted/equip_item/shield/tower
charge_max = 1
4 changes: 0 additions & 4 deletions code/modules/spells/targeted/ethereal_jaunt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,3 @@
return
/obj/effect/dummy/spell_jaunt/bullet_act(blah)
return

/datum/spell/targeted/ethereal_jaunt/tower
charge_max = 2
spell_flags = Z2NOCAST | INCLUDEUSER
6 changes: 0 additions & 6 deletions code/modules/spells/targeted/healing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,3 @@
range += 2

return "[src] now heals more in a wider area."

// Admin subtype
/datum/spell/targeted/heal_target/area/tower
name = "Instant Cure Area"
charge_max = 1
spell_book_visible = FALSE
Binary file modified icons/mob/screen_spells.dmi
Binary file not shown.

0 comments on commit cd9dbbb

Please sign in to comment.