Code Readability - Spells (#18141)

* changed fake disintegrate to not need a permit (as far as sec bots are concerned)

* prefer boolean defines to magic numbers

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* added check

* spells

* Revert "added check"

This reverts commit 082aa40246.

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
KalevTait
2022-07-01 15:52:12 -05:00
committed by GitHub
co-authored by AffectedArc07
parent 8b876914ce
commit d1da076958
24 changed files with 83 additions and 83 deletions
+11 -11
View File
@@ -76,8 +76,8 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
name = "Spell" // Only rename this if the spell you're making is not abstract
desc = "A wizard spell"
panel = "Spells"//What panel the proc holder needs to go on.
density = 0
opacity = 0
density = FALSE
opacity = FALSE
var/school = "evocation" //not relevant at now, but may be important later if there are changes to how spells work. the ones I used for now will probably be changed... maybe spell presets? lacking flexibility but with some other benefit?
@@ -92,11 +92,11 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
var/holder_var_type = "bruteloss" //only used if charge_type equals to "holder_var"
var/holder_var_amount = 20 //same. The amount adjusted with the mob's var when the spell is used
var/ghost = 0 // Skip life check.
var/clothes_req = 1 //see if it requires clothes
var/human_req = 0 //spell can only be cast by humans
var/nonabstract_req = 0 //spell can only be cast by mobs that are physical entities
var/stat_allowed = 0 //see if it requires being conscious/alive, need to set to 1 for ghostpells
var/ghost = FALSE // Skip life check.
var/clothes_req = TRUE //see if it requires clothes
var/human_req = FALSE //spell can only be cast by humans
var/nonabstract_req = FALSE //spell can only be cast by mobs that are physical entities
var/stat_allowed = CONSCIOUS //see if it requires being conscious/alive, need to set to 1 for ghostpells
var/invocation = "HURP DURP" //what is uttered when the wizard casts the spell
var/invocation_emote_self = null
var/invocation_type = "none" //can be none, whisper and shout
@@ -110,7 +110,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
var/overlay_icon_state = "spell"
var/overlay_lifespan = 0
var/sparks_spread = 0
var/sparks_spread = FALSE
var/sparks_amt = 0 //cropped at 10
var/smoke_spread = 0 //1 - harmless, 2 - harmful
var/smoke_amt = 0 //cropped at 10
@@ -387,8 +387,8 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
var/obj/effect/overlay/spell = new /obj/effect/overlay(location)
spell.icon = overlay_icon
spell.icon_state = overlay_icon_state
spell.anchored = 1
spell.density = 0
spell.anchored = TRUE
spell.density = FALSE
spawn(overlay_lifespan)
qdel(spell)
@@ -568,7 +568,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
name = "Summon Servant"
desc = "This spell can be used to call your servant, whenever you need it."
charge_max = 100
clothes_req = 0
clothes_req = FALSE
invocation = "JE VES"
invocation_type = "whisper"
level_max = 0 //cannot be improved
+1 -1
View File
@@ -1,5 +1,5 @@
/obj/effect/proc_holder/spell/area_teleport
nonabstract_req = 1
nonabstract_req = TRUE
var/randomise_selection = 0 //if it lets the usr choose the teleport loc or picks it from the list
var/invocation_area = 1 //if the invocation appends the selected area
+1 -1
View File
@@ -7,7 +7,7 @@
school = "transmutation"
charge_max = 300
clothes_req = 1
clothes_req = TRUE
cooldown_min = 100 //50 deciseconds reduction per rank
action_icon_state = "clown"
+4 -4
View File
@@ -2,14 +2,14 @@
name = "Blood Crawl"
desc = "Use pools of blood to phase out of existence."
charge_max = 0
clothes_req = 0
clothes_req = FALSE
cooldown_min = 0
should_recharge_after_cast = FALSE
overlay = null
action_icon_state = "bloodcrawl"
action_background_icon_state = "bg_demon"
panel = "Demon"
var/phased = 0
var/phased = FALSE
/obj/effect/proc_holder/spell/bloodcrawl/create_new_targeting()
var/datum/spell_targeting/targeted/T = new()
@@ -34,8 +34,8 @@
var/obj/effect/decal/cleanable/target = targets[1] // TODO Test this spell
if(phased)
if(user.phasein(target))
phased = 0
phased = FALSE
else
if(user.phaseout(target))
phased = 1
phased = TRUE
start_recharge()
+8 -8
View File
@@ -3,7 +3,7 @@
desc = "This spell can be used to recharge a variety of things in your hands, from magical artifacts to electrical components. A creative wizard can even use it to grant magical power to a fellow magic user."
school = "transmutation"
charge_max = 600
clothes_req = 0
clothes_req = FALSE
invocation = "DIRI CEL"
invocation_type = "whisper"
cooldown_min = 400 //50 deciseconds reduction per rank
@@ -16,7 +16,7 @@
for(var/mob/living/L in targets)
var/list/hand_items = list(L.get_active_hand(),L.get_inactive_hand())
var/charged_item = null
var/burnt_out = 0
var/burnt_out = FALSE
if(L.pulling && (istype(L.pulling, /mob/living)))
var/mob/living/M = L.pulling
@@ -29,7 +29,7 @@
to_chat(M, "<span class='notice'>You feel raw magical energy flowing through you, it feels good!</span>")
else
to_chat(M, "<span class='notice'>You feel very strange for a moment, but then it passes.</span>")
burnt_out = 1
burnt_out = TRUE
charged_item = M
break
for(var/obj/item in hand_items)
@@ -40,20 +40,20 @@
L.visible_message("<span class='warning'>[I] catches fire!</span>")
qdel(I)
else
I.used = 0
I.used = FALSE
charged_item = I
break
else
to_chat(L, "<span class='caution'>Glowing red letters appear on the front cover...</span>")
to_chat(L, "<span class='warning'>[pick("NICE TRY BUT NO!","CLEVER BUT NOT CLEVER ENOUGH!", "SUCH FLAGRANT CHEESING IS WHY WE ACCEPTED YOUR APPLICATION!", "CUTE!", "YOU DIDN'T THINK IT'D BE THAT EASY, DID YOU?")]</span>")
burnt_out = 1
burnt_out = TRUE
else if(istype(item, /obj/item/gun/magic))
var/obj/item/gun/magic/I = item
if(prob(80) && !I.can_charge)
I.max_charges--
if(I.max_charges <= 0)
I.max_charges = 0
burnt_out = 1
burnt_out = TRUE
I.charges = I.max_charges
if(istype(item,/obj/item/gun/magic/wand) && I.max_charges != 0)
var/obj/item/gun/magic/W = item
@@ -67,7 +67,7 @@
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
burnt_out = TRUE
C.charge = C.maxcharge
charged_item = C
break
@@ -81,7 +81,7 @@
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
burnt_out = TRUE
C.charge = C.maxcharge
item.update_icon()
charged_item = item
+1 -1
View File
@@ -6,7 +6,7 @@
school = "transmutation"
charge_max = 600
clothes_req = 1
clothes_req = TRUE
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "clown"
+7 -7
View File
@@ -4,12 +4,12 @@
school = "transmutation"
charge_max = 300
clothes_req = 1
clothes_req = TRUE
invocation = "none"
invocation_type = "none"
cooldown_min = 100 //50 deciseconds reduction per rank
nonabstract_req = 1
centcom_cancast = 0 //Prevent people from getting to centcom
nonabstract_req = TRUE
centcom_cancast = FALSE //Prevent people from getting to centcom
var/sound1 = 'sound/magic/ethereal_enter.ogg'
var/jaunt_duration = 50 //in deciseconds
var/jaunt_in_time = 5
@@ -32,14 +32,14 @@
INVOKE_ASYNC(src, .proc/do_jaunt, target)
/obj/effect/proc_holder/spell/ethereal_jaunt/proc/do_jaunt(mob/living/target)
target.notransform = 1
target.notransform = TRUE
var/turf/mobloc = get_turf(target)
var/obj/effect/dummy/spell_jaunt/holder = new jaunt_type_path(mobloc)
new jaunt_out_type(mobloc, target.dir)
target.ExtinguishMob()
target.forceMove(holder)
target.reset_perspective(holder)
target.notransform = 0 //mob is safely inside holder now, no need for protection.
target.notransform = FALSE //mob is safely inside holder now, no need for protection.
if(jaunt_water_effect)
jaunt_steam(mobloc)
@@ -86,8 +86,8 @@
var/reappearing = 0
var/movedelay = 0
var/movespeed = 2
density = 0
anchored = 1
density = FALSE
anchored = TRUE
invisibility = 60
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
+1 -1
View File
@@ -5,7 +5,7 @@
school = "evocation"
charge_max = 600
clothes_req = 0
clothes_req = FALSE
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "gib"
+1 -1
View File
@@ -6,7 +6,7 @@
charge_max = 150
charge_counter = 0
clothes_req = FALSE
stat_allowed = FALSE
stat_allowed = CONSCIOUS
invocation = "KN'A FTAGHU, PUCK 'BTHNK!"
invocation_type = "shout"
cooldown_min = 30 //30 deciseconds reduction per rank
+1 -1
View File
@@ -5,7 +5,7 @@
school = "conjuration"
charge_max = 600
clothes_req = 1
clothes_req = TRUE
cooldown_min = 10 //Gun wizard
action_icon_state = "bolt_action"
+1 -1
View File
@@ -4,7 +4,7 @@
school = "transmutation"
charge_max = 100
clothes_req = 0
clothes_req = FALSE
invocation = "AULIE OXIN FIERA"
invocation_type = "whisper"
cooldown_min = 20 //20 deciseconds reduction per rank
+3 -3
View File
@@ -3,8 +3,8 @@
desc = "A dark necromantic pact that can forever bind your soul to an item of your choosing. So long as both your body and the item remain intact and on the same plane you can revive from death, though the time between reincarnations grows steadily with use."
school = "necromancy"
charge_max = 10
clothes_req = 0
centcom_cancast = 0
clothes_req = FALSE
centcom_cancast = FALSE
invocation = "NECREM IMORTIUM!"
invocation_type = "shout"
level_max = 0 //cannot be improved
@@ -113,7 +113,7 @@
desc = "Rise from the dead! You will reform at the location of your phylactery and your old body will crumble away."
charge_max = 1800 //3 minute cooldown, if you rise in sight of someone and killed again, you're probably screwed.
charge_counter = 1800
stat_allowed = 1
stat_allowed = UNCONSCIOUS
marked_item.name = "Ensouled [marked_item.name]"
marked_item.desc = "A terrible aura surrounds this item, its very existence is offensive to life itself..."
marked_item.color = "#003300"
+7 -7
View File
@@ -8,9 +8,9 @@
invocation_emote_self = "<span class='notice'>You form a wall in front of yourself.</span>"
summon_lifespan = 300
charge_max = 300
clothes_req = 0
clothes_req = FALSE
cast_sound = null
human_req = 1
human_req = TRUE
action_icon_state = "mime"
action_background_icon_state = "bg_mime"
@@ -33,9 +33,9 @@
desc = "Make or break a vow of silence."
school = "mime"
panel = "Mime"
clothes_req = 0
clothes_req = FALSE
charge_max = 3000
human_req = 1
human_req = TRUE
action_icon_state = "mime_silence"
action_background_icon_state = "bg_mime"
@@ -93,9 +93,9 @@
desc = "Shoot lethal, silencing bullets out of your fingers! 3 bullets available per cast. Use your fingers to holster them manually."
school = "mime"
panel = "Mime"
clothes_req = 0
clothes_req = FALSE
charge_max = 300
human_req = 1
human_req = TRUE
action_icon_state = "fingergun"
action_background_icon_state = "bg_mime"
@@ -144,7 +144,7 @@
to_chat(user, "<span class='notice'>You flip through the pages. Nothing of interest to you.</span>")
/obj/item/spellbook/oneuse/mime/onlearned(mob/user)
used = 1
used = TRUE
if(!locate(/obj/effect/proc_holder/spell/mime/speak) in user.mind.spell_list) //add vow of silence if not known by user
user.mind.AddSpell(new /obj/effect/proc_holder/spell/mime/speak)
to_chat(user, "<span class='notice'>You have learned how to use silence to improve your performance.</span>")
+1 -1
View File
@@ -7,7 +7,7 @@
school = "transmutation"
charge_max = 300
clothes_req = 1
clothes_req = TRUE
cooldown_min = 100 //50 deciseconds reduction per rank
action_icon_state = "mime"
+1 -1
View File
@@ -4,7 +4,7 @@
school = "transmutation"
charge_max = 600
clothes_req = 0
clothes_req = FALSE
invocation = "GIN'YU CAPAN"
invocation_type = "whisper"
selection_activated_message = "<span class='notice'>You prepare to transfer your mind. Click on a target to cast the spell.</span>"
+1 -1
View File
@@ -3,7 +3,7 @@
desc = "Toggle your nightvision mode."
charge_max = 10
clothes_req = 0
clothes_req = FALSE
message = "<span class='notice'>You toggle your night vision!</span>"
+2 -2
View File
@@ -14,7 +14,7 @@
var/proj_lingering = 0 //if it lingers or disappears upon hitting an obstacle
var/proj_homing = 1 //if it follows the target
var/proj_insubstantial = 0 //if it can pass through dense objects or not
var/proj_insubstantial = FALSE //if it can pass through dense objects or not
var/proj_trigger_range = 0 //the range from target at which the projectile triggers cast(target)
var/proj_lifespan = 15 //in deciseconds * proj_step_delay
@@ -69,7 +69,7 @@
var/obj/effect/overlay/trail = new /obj/effect/overlay(projectile.loc)
trail.icon = proj_trail_icon
trail.icon_state = proj_trail_icon_state
trail.density = 0
trail.density = FALSE
spawn(proj_trail_lifespan)
qdel(trail)
+1 -1
View File
@@ -2,7 +2,7 @@
name = "Rathen's Secret"
desc = "Summons a powerful shockwave around you that tears the appendix and limbs off of enemies."
charge_max = 500
clothes_req = 1
clothes_req = TRUE
invocation = "APPEN NATH!"
invocation_type = "shout"
cooldown_min = 200
+5 -5
View File
@@ -1,14 +1,14 @@
/obj/effect/proc_holder/spell/rod_form
name = "Rod Form"
desc = "Take on the form of an immovable rod, destroying all in your path."
clothes_req = 1
human_req = 0
clothes_req = TRUE
human_req = FALSE
charge_max = 600
cooldown_min = 200
invocation = "CLANG!"
invocation_type = "shout"
action_icon_state = "immrod"
centcom_cancast = 0
centcom_cancast = FALSE
sound = 'sound/effects/whoosh.ogg'
var/rod_delay = 2
@@ -24,7 +24,7 @@
W.max_distance += spell_level * 3 //You travel farther when you upgrade the spell
W.start_turf = start
M.forceMove(W)
M.notransform = 1
M.notransform = TRUE
M.status_flags |= GODMODE
//Wizard Version of the Immovable Rod
@@ -43,6 +43,6 @@
/obj/effect/immovablerod/wizard/Destroy()
if(wizard)
wizard.status_flags &= ~GODMODE
wizard.notransform = 0
wizard.notransform = FALSE
wizard.forceMove(get_turf(src))
return ..()
+4 -4
View File
@@ -1,8 +1,8 @@
/obj/effect/proc_holder/spell/shapeshift
name = "Shapechange"
desc = "Take on the shape of another for a time to use their natural abilities. Once you've made your choice it cannot be changed."
clothes_req = 0
human_req = 0
clothes_req = FALSE
human_req = FALSE
charge_max = 200
cooldown_min = 50
invocation = "RAC'WA NO!"
@@ -48,8 +48,8 @@
current_shapes |= shape
current_casters |= caster
clothes_req = 0
human_req = 0
clothes_req = FALSE
human_req = FALSE
caster.mind.transfer_to(shape)
+1 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell can be used to recall a previously marked item to your hand from anywhere in the universe."
school = "transmutation"
charge_max = 100
clothes_req = 0
clothes_req = FALSE
invocation = "GAR YOK"
invocation_type = "whisper"
level_max = 0 //cannot be improved
+2 -2
View File
@@ -52,7 +52,7 @@
school = "evocation"
charge_max = 600
clothes_req = 1
clothes_req = TRUE
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "gib"
@@ -64,7 +64,7 @@
school = "transmutation"
charge_max = 600
clothes_req = 1
clothes_req = TRUE
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "statue"
+3 -3
View File
@@ -1,13 +1,13 @@
/obj/effect/proc_holder/spell/turf_teleport
name = "Turf Teleport"
desc = "This spell teleports the target to the turf in range."
nonabstract_req = 1
nonabstract_req = TRUE
var/inner_tele_radius = 1
var/outer_tele_radius = 2
var/include_space = 0 //whether it includes space tiles in possible teleport locations
var/include_dense = 0 //whether it includes dense tiles in possible teleport locations
var/include_space = FALSE //whether it includes space tiles in possible teleport locations
var/include_dense = FALSE //whether it includes dense tiles in possible teleport locations
/// Whether the spell can teleport to light locations
var/include_light_turfs = TRUE
+15 -15
View File
@@ -4,7 +4,7 @@
school = "evocation"
charge_max = 200
clothes_req = 1
clothes_req = TRUE
invocation = "FORTI GY AMA"
invocation_type = "shout"
cooldown_min = 60 //35 deciseconds reduction per rank
@@ -42,7 +42,7 @@
school = "evocation"
charge_max = 60
clothes_req = 0
clothes_req = FALSE
invocation = "HONK GY AMA"
invocation_type = "shout"
cooldown_min = 60 //35 deciseconds reduction per rank
@@ -89,11 +89,11 @@
school = "transmutation"
charge_max = 400
clothes_req = 1
clothes_req = TRUE
invocation = "BIRUZ BENNAR"
invocation_type = "shout"
message = "<span class='notice'>You feel strong! You feel a pressure building behind your eyes!</span>"
centcom_cancast = 0
centcom_cancast = FALSE
traits = list(TRAIT_LASEREYES)
duration = 300
@@ -115,7 +115,7 @@
school = "conjuration"
charge_max = 120
clothes_req = 0
clothes_req = FALSE
invocation = "none"
invocation_type = "none"
cooldown_min = 20 //25 deciseconds reduction per rank
@@ -132,7 +132,7 @@
name = "Disable Tech"
desc = "This spell disables all weapons, cameras and most other technology in range."
charge_max = 400
clothes_req = 1
clothes_req = TRUE
invocation = "NEC CANTIO"
invocation_type = "shout"
cooldown_min = 200 //50 deciseconds reduction per rank
@@ -148,7 +148,7 @@
school = "abjuration"
charge_max = 20
clothes_req = 1
clothes_req = TRUE
invocation = "none"
invocation_type = "none"
cooldown_min = 5 //4 deciseconds reduction per rank
@@ -160,7 +160,7 @@
inner_tele_radius = 0
outer_tele_radius = 6
centcom_cancast = 0 //prevent people from getting to centcom
centcom_cancast = FALSE //prevent people from getting to centcom
action_icon_state = "blink"
@@ -176,7 +176,7 @@
school = "abjuration"
charge_max = 600
clothes_req = 1
clothes_req = TRUE
invocation = "SCYAR NILA"
invocation_type = "shout"
cooldown_min = 200 //100 deciseconds reduction per rank
@@ -233,7 +233,7 @@
name = "Stop Time"
desc = "This spell stops time for everyone except for you, allowing you to move freely while your enemies and even projectiles are frozen."
charge_max = 500
clothes_req = 1
clothes_req = TRUE
invocation = "TOKI WO TOMARE"
invocation_type = "shout"
cooldown_min = 100
@@ -253,7 +253,7 @@
school = "conjuration"
charge_max = 1200
clothes_req = 1
clothes_req = TRUE
invocation = "NOUK FHUNMM SACP RISSKA"
invocation_type = "shout"
@@ -272,7 +272,7 @@
school = "conjuration"
charge_max = 600
clothes_req = 0
clothes_req = FALSE
invocation = "none"
invocation_type = "none"
@@ -292,7 +292,7 @@
school = "conjuration"
charge_max = 1200
clothes_req = 0
clothes_req = FALSE
invocation = "IA IA"
invocation_type = "shout"
summon_amt = 10
@@ -311,7 +311,7 @@
school = "transmutation"
charge_max = 300
clothes_req = 0
clothes_req = FALSE
invocation = "STI KALY"
invocation_type = "whisper"
message = "<span class='notice'>Your eyes cry out in pain!</span>"
@@ -438,7 +438,7 @@
name = "Sacred Flame"
desc = "Makes everyone around you more flammable, and lights yourself on fire."
charge_max = 60
clothes_req = 0
clothes_req = FALSE
invocation = "FI'RAN DADISKO"
invocation_type = "shout"
action_icon_state = "sacredflame"