Magic Overhaul

This commit is contained in:
ZomgPonies
2013-12-14 05:54:03 -05:00
parent 87c56b4b23
commit 12b8ae8d76
39 changed files with 1533 additions and 365 deletions
+34 -32
View File
@@ -26,6 +26,9 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/range = 7 //the range of the spell; outer radius for aoe spells
var/message = "" //whatever it says to the guy affected by it
var/selection_type = "view" //can be "range" or "view"
var/spell_level = 0 //if a spell can be taken multiple times, this raises
var/level_max = 4 //The max possible level_max is 4
var/cooldown_min = 0 //This defines what spell quickened four timeshas as a cooldown. Make sure to set this for every spell
var/overlay = 0
var/overlay_icon = 'icons/obj/wizard.dmi'
@@ -38,49 +41,53 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/smoke_amt = 0 //cropped at 10
var/critfailchance = 0
var/centcomm_cancast = 1 //Whether or not the spell should be allowed on z2
var/centcom_cancast = 1 //Whether or not the spell should be allowed on z2
/obj/effect/proc_holder/spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell
if(!(src in usr.spell_list))
usr << "\red You shouldn't have this spell! Something's wrong."
if(!(src in user.spell_list))
user << "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>"
return 0
if(usr.z == 2 && !centcomm_cancast) //Certain spells are not allowed on the centcomm zlevel
if(user.z == 2 && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
return 0
if(!skipcharge)
switch(charge_type)
if("recharge")
if(charge_counter < charge_max)
usr << "[name] is still recharging."
user << "<span class='notice'>[name] is still recharging.</span>"
return 0
if("charges")
if(!charge_counter)
usr << "[name] has no charges left."
user << "<span class='notice'>[name] has no charges left.</span>"
return 0
if(usr.stat && !stat_allowed)
usr << "Not when you're incapacitated."
if(user.stat && !stat_allowed)
user << "<span class='notice'>Not when you're incapacitated.</span>"
return 0
if(ishuman(usr) || ismonkey(usr))
if(istype(usr.wear_mask, /obj/item/clothing/mask/muzzle))
usr << "Mmmf mrrfff!"
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(istype(H.wear_mask, /obj/item/clothing/mask/muzzle))
user << "<span class='notice'>You can't get the words out!</span>"
return 0
if(clothes_req) //clothes check
if(!istype(usr, /mob/living/carbon/human))
usr << "You aren't a human, Why are you trying to cast a human spell, silly non-human? Casting human spells is for humans."
return 0
if(!istype(usr:wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(user:wear_suit, /obj/item/clothing/suit/space/rig/wizard))
usr << "I don't feel strong enough without my robe."
return 0
if(!istype(usr:shoes, /obj/item/clothing/shoes/sandal))
usr << "I don't feel strong enough without my sandals."
return 0
if(!istype(usr:head, /obj/item/clothing/head/wizard) && !istype(user:head, /obj/item/clothing/head/helmet/space/rig/wizard))
usr << "I don't feel strong enough without my hat."
if(clothes_req) //clothes check
if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(H.wear_suit, /obj/item/clothing/suit/space/rig/wizard))
H << "<span class='notice'>I don't feel strong enough without my robe.</span>"
return 0
if(!istype(H.shoes, /obj/item/clothing/shoes/sandal))
H << "<span class='notice'>I don't feel strong enough without my sandals.</span>"
return 0
if(!istype(H.head, /obj/item/clothing/head/wizard) && !istype(H.head, /obj/item/clothing/head/helmet/space/rig/wizard))
H << "<span class='notice'>I don't feel strong enough without my hat.</span>"
return 0
else
if(clothes_req)
user << "<span class='notice'>This spell can only be casted by humans!</span>"
return 0
if(!skipcharge)
@@ -95,22 +102,17 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
return 1
/obj/effect/proc_holder/spell/proc/invocation(mob/user = usr) //spelling the spell out and setting it on recharge/reducing charges amount
switch(invocation_type)
if("shout")
if(prob(50))//Auto-mute? Fuck that noise
usr.say(invocation)
user.say(invocation)
else
usr.say(replacetext(invocation," ","`"))
if(usr.gender==MALE)
playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
else
playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
user.say(replacetext(invocation," ","`"))
if("whisper")
if(prob(50))
usr.whisper(invocation)
user.whisper(invocation)
else
usr.whisper(replacetext(invocation," ","`"))
user.whisper(replacetext(invocation," ","`"))
/obj/effect/proc_holder/spell/New()
..()
+82
View File
@@ -0,0 +1,82 @@
/obj/effect/proc_holder/spell/targeted/charge
name = "Charge"
desc = "This spell can be used to charge up spent magical artifacts, among other things."
school = "transmutation"
charge_max = 600
clothes_req = 0
invocation = "DIRI CEL"
invocation_type = "whisper"
range = -1
// cooldown_min = 400 //50 deciseconds reduction per rank
include_user = 1
/obj/effect/proc_holder/spell/targeted/charge/cast(list/targets)
for(var/mob/living/user in targets)
var/list/hand_items = list(user.get_active_hand(),user.get_inactive_hand())
var/charged_item = null
var/burnt_out = 0
for(var/obj/item in hand_items)
if(istype(item, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = item
if(G.affecting)
var/mob/M = G.affecting
if(M.spell_list.len != 0)
for(var/obj/effect/proc_holder/spell/S in M.spell_list)
S.charge_counter = S.charge_max
M <<"<span class='notice'>you feel raw magic flowing through you, it feels good!</span>"
else
M <<"<span class='notice'>you feel very strange for a moment, but then it passes.</span>"
burnt_out = 1
charged_item = M
break
else if(istype(item, /obj/item/weapon/spellbook/oneuse))
var/obj/item/weapon/spellbook/oneuse/I = item
if(prob(80))
user.visible_message("<span class='warning'>[I] catches fire!</span>")
del(I)
else
I.used = 0
charged_item = I
break
else if(istype(item, /obj/item/weapon/gun/magic))
var/obj/item/weapon/gun/magic/I = item
if(prob(80))
I.max_charges--
if(I.max_charges <= 0)
I.max_charges = 0
burnt_out = 1
I.charges = I.max_charges
charged_item = I
break
else if(istype(item, /obj/item/weapon/cell/))
var/obj/item/weapon/cell/C = item
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
C.charge = C.maxcharge
charged_item = C
break
else if(item.contents)
var/obj/I = null
for(I in item.contents)
if(istype(I, /obj/item/weapon/cell/))
var/obj/item/weapon/cell/C = I
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
C.charge = C.maxcharge
item.update_icon()
charged_item = item
break
if(!charged_item)
user << "<span class='notice'>you feel magical power surging to your hands, but the feeling rapidly fades...</span>"
else if(burnt_out)
user << "<span class='caution'>[charged_item] doesn't seem to be reacting to the spell...</span>"
else
user << "<span class='notice'>[charged_item] suddenly feels very warm!</span>"
+5 -25
View File
@@ -30,8 +30,11 @@
if(summon_ignore_prev_spawn_points)
targets -= spawn_place
if(ispath(summoned_object_type,/turf))
if(istype(get_turf(usr),/turf/simulated/shuttle))
usr << "\red You can't build things on shuttles!"
break
var/turf/O = spawn_place
var/turf/N = summoned_object_type
var/N = summoned_object_type
O.ChangeTurf(N)
else
var/atom/summoned_object = new summoned_object_type(spawn_place)
@@ -61,27 +64,4 @@
summon_type = list(/obj/machinery/bot/ed209)
summon_amt = 10
range = 3
newVars = list("emagged" = 1,"name" = "Wizard's Justicebot")
//This was previously left in the old wizard code, not being included.
//Wasn't sure if I should transfer it here, or to code/datums/spells.dm
//But I decided because it is a conjuration related object it would fit better here
//Feel free to change this, I don't know.
/obj/effect/forcefield
desc = "A space wizard's magic wall."
name = "FORCEWALL"
icon = 'icons/effects/effects.dmi'
icon_state = "m_shield"
anchored = 1.0
opacity = 0
density = 1
unacidable = 1
bullet_act(var/obj/item/projectile/Proj, var/def_zone)
var/turf/T = get_turf(src.loc)
if(T)
for(var/mob/M in T)
Proj.on_hit(M,M.bullet_act(Proj, def_zone))
return
newVars = list("emagged" = 1,"name" = "Wizard's Justicebot")
+101
View File
@@ -0,0 +1,101 @@
//////////////////////////////Construct Spells/////////////////////////
/obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser
charge_max = 1800
/obj/effect/proc_holder/spell/aoe_turf/conjure/floor
name = "Floor Construction"
desc = "This spell constructs a cult floor"
school = "conjuration"
charge_max = 20
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/turf/simulated/floor/engine/cult)
centcom_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles
/obj/effect/proc_holder/spell/aoe_turf/conjure/wall
name = "Lesser Construction"
desc = "This spell constructs a cult wall"
school = "conjuration"
charge_max = 100
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/turf/simulated/wall/cult)
centcom_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles
/obj/effect/proc_holder/spell/aoe_turf/conjure/wall/reinforced
name = "Greater Construction"
desc = "This spell constructs a reinforced metal wall"
school = "conjuration"
charge_max = 300
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
centcom_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles
delay = 50
summon_type = list(/turf/simulated/wall/r_wall)
/obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone
name = "Summon Soulstone"
desc = "This spell reaches into Nar-Sie's realm, summoning one of the legendary fragments across time and space"
school = "conjuration"
charge_max = 3000
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/obj/item/device/soulstone)
/obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall
name = "Shield"
desc = "This spell creates a temporary forcefield to shield yourself and allies from incoming fire"
school = "transmutation"
charge_max = 300
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/obj/effect/forcefield)
summon_lifespan = 200
/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift
name = "Phase Shift"
desc = "This spell allows you to pass through walls"
school = "transmutation"
charge_max = 200
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = -1
include_user = 1
phaseshift = 1
jaunt_duration = 50 //in deciseconds
centcom_cancast = 0 //Stop people from getting to centcom
/obj/effect/proc_holder/spell/targeted/projectile/magic_missile/lesser
name = "Lesser Magic Missile"
desc = "This spell fires several, slow moving, magic projectiles at nearby targets."
school = "evocation"
charge_max = 400
clothes_req = 0
invocation = "none"
invocation_type = "none"
proj_lifespan = 10
max_targets = 6
+1 -1
View File
@@ -64,7 +64,7 @@
break
var/mob/living/L = locate(/mob/living) in range(projectile, proj_trigger_range) - usr
if(L)
if(L && L.stat != DEAD)
projectile.cast(L.loc)
break
+5 -1
View File
@@ -8,8 +8,9 @@
invocation = "none"
invocation_type = "none"
range = -1
cooldown_min = 100 //50 deciseconds reduction per rank
include_user = 1
centcomm_cancast = 0 //Prevent people from getting to centcomm
centcom_cancast = 0 //Prevent people from getting to centcom
var phaseshift = 0
var/jaunt_duration = 50 //in deciseconds
@@ -27,6 +28,9 @@
animation.icon_state = "liquify"
animation.layer = 5
animation.master = holder
target.ExtinguishMob()
if(target.buckled)
target.buckled.unbuckle()
if(phaseshift == 1)
animation.dir = target.dir
flick("phase_shift",animation)
+2 -4
View File
@@ -18,13 +18,11 @@
/obj/effect/proc_holder/spell/targeted/genetic/cast(list/targets)
for(var/mob/living/target in targets)
for(var/x in mutations)
target.mutations.Add(x)
target.mutations.Add(mutations)
target.disabilities |= disabilities
target.update_mutations() //update target's mutation overlays
spawn(duration)
for(var/x in mutations)
target.mutations.Remove(x)
target.mutations.Remove(mutations)
target.disabilities &= ~disabilities
target.update_mutations()
+3 -1
View File
@@ -10,6 +10,7 @@
invocation = "KN'A FTAGHU, PUCK 'BTHNK!"
invocation_type = "shout"
range = 7
cooldown_min = 30 //30 deciseconds reduction per rank
selection_type = "range"
var/list/compatible_mobs = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
@@ -34,6 +35,7 @@
magichead.voicechange = 1 //NEEEEIIGHH
target.visible_message( "<span class='danger'>[target]'s face lights up in fire, and after the event a horse's head takes its place!</span>", \
"<span class='danger'>Your face burns up, and shortly after the fire you realise you have the face of a horse!</span>")
target.equip_to_slot(magichead, slot_wear_mask)
target.drop_from_inventory(target.wear_mask)
target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
flick("e_flash", target.flash)
+6 -1
View File
@@ -17,6 +17,8 @@
var/destroys = "none" //can be "none", "gib" or "disintegrate"
var/summon_type = null //this will put an obj at the target's location
/obj/effect/proc_holder/spell/targeted/inflict_handler/cast(list/targets)
for(var/mob/living/target in targets)
@@ -56,4 +58,7 @@
target.Stun(amt_stunned)
target.eye_blind += amt_eye_blind
target.eye_blurry += amt_eye_blurry
target.eye_blurry += amt_eye_blurry
//summoning
if(summon_type)
new summon_type(target.loc, target)
+1
View File
@@ -8,6 +8,7 @@
invocation = "AULIE OXIN FIERA"
invocation_type = "whisper"
range = 3
cooldown_min = 20 //20 deciseconds reduction per rank
/obj/effect/proc_holder/spell/aoe_turf/knock/cast(list/targets)
for(var/turf/T in targets)
+1
View File
@@ -8,6 +8,7 @@
invocation = "GIN'YU CAPAN"
invocation_type = "whisper"
range = 1
cooldown_min = 200 //100 deciseconds reduction per rank
var/list/protected_roles = list("Wizard","Changeling","Cultist") //which roles are immune to the spell
var/list/compatible_mobs = list(/mob/living/carbon/human,/mob/living/carbon/monkey) //which types of mobs are affected by the spell. NOTE: change at your own risk
var/base_spell_loss_chance = 20 //base probability of the wizard losing a spell in the process
+3
View File
@@ -57,6 +57,9 @@
else
step(projectile,dir)
if(!projectile) // step and step_to sleeps so we'll have to check again.
break
if(!proj_lingering && projectile.loc == current_loc) //if it didn't move since last time
del(projectile)
break
+30 -98
View File
@@ -8,6 +8,7 @@
invocation = "FORTI GY AMA"
invocation_type = "shout"
range = 7
cooldown_min = 90 //15 deciseconds reduction per rank
max_targets = 0
@@ -42,6 +43,7 @@
mutations = list(LASER, HULK)
duration = 300
cooldown_min = 300 //25 deciseconds reduction per rank
/obj/effect/proc_holder/spell/targeted/inflict_handler/disintegrate
name = "Disintegrate"
@@ -53,6 +55,7 @@
invocation = "EI NATH"
invocation_type = "shout"
range = 1
cooldown_min = 200 //100 deciseconds reduction per rank
destroys = "gib_brain"
@@ -70,6 +73,7 @@
invocation_type = "none"
range = -1
include_user = 1
cooldown_min = 20 //25 deciseconds reduction per rank
smoke_spread = 2
smoke_amt = 10
@@ -83,6 +87,7 @@
invocation_type = "shout"
range = -1
include_user = 1
cooldown_min = 200 //50 deciseconds reduction per rank
emp_heavy = 6
emp_light = 10
@@ -98,6 +103,8 @@
invocation_type = "none"
range = -1
include_user = 1
cooldown_min = 5 //4 deciseconds reduction per rank
smoke_spread = 1
smoke_amt = 10
@@ -105,7 +112,7 @@
inner_tele_radius = 0
outer_tele_radius = 6
centcomm_cancast = 0 //prevent people from getting to centcomm
centcom_cancast = 0 //prevent people from getting to centcom
/obj/effect/proc_holder/spell/targeted/area_teleport/teleport
name = "Teleport"
@@ -118,6 +125,7 @@
invocation_type = "shout"
range = -1
include_user = 1
cooldown_min = 200 //100 deciseconds reduction per rank
smoke_spread = 1
smoke_amt = 5
@@ -132,6 +140,7 @@
invocation = "TARCOL MINTI ZHERI"
invocation_type = "whisper"
range = 0
cooldown_min = 50 //12 deciseconds reduction per rank
summon_type = list("/obj/effect/forcefield")
summon_lifespan = 300
@@ -189,6 +198,7 @@
invocation = "STI KALY"
invocation_type = "whisper"
message = "\blue Your eyes cry out in pain!"
cooldown_min = 50 //12 deciseconds reduction per rank
starting_spells = list("/obj/effect/proc_holder/spell/targeted/inflict_handler/blind","/obj/effect/proc_holder/spell/targeted/genetic/blind")
@@ -200,16 +210,32 @@
disabilities = 1
duration = 300
/obj/effect/proc_holder/spell/targeted/inflict_handler/flesh_to_stone
name = "Flesh to Stone"
desc = "This spell turns a single person into an inert statue for a long period of time."
school = "transmutation"
charge_max = 600
clothes_req = 1
range = 2
invocation = "STAUN EI"
invocation_type = "shout"
amt_stunned = 2//just exists to make sure the statue "catches" them
cooldown_min = 200 //100 deciseconds reduction per rank
summon_type = "/obj/structure/closet/statue"
/obj/effect/proc_holder/spell/dumbfire/fireball
name = "Fireball"
desc = "This spell fires a fireball at a target and does not require wizard garb."
school = "evocation"
charge_max = 100
charge_max = 60
clothes_req = 0
invocation = "ONI SOMA"
invocation_type = "shout"
range = 20
cooldown_min = 20 //10 deciseconds reduction per rank
proj_icon_state = "fireball"
proj_name = "a fireball"
@@ -219,7 +245,7 @@
proj_step_delay = 1
/obj/effect/proc_holder/spell/turf/fireball/cast(var/turf/T)
explosion(T, -1, 1, 2, 3)
explosion(T, -1, 0, 2, 3, 0, flame_range = 2)
/obj/effect/proc_holder/spell/targeted/inflict_handler/fireball
@@ -230,98 +256,4 @@
ex_severe = -1
ex_heavy = -1
ex_light = 2
ex_flash = 5
//////////////////////////////Construct Spells/////////////////////////
/obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser
charge_max = 1800
/obj/effect/proc_holder/spell/aoe_turf/conjure/floor
name = "Floor Construction"
desc = "This spell constructs a cult floor"
school = "conjuration"
charge_max = 20
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/turf/simulated/floor/engine/cult)
centcomm_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles
/obj/effect/proc_holder/spell/aoe_turf/conjure/wall
name = "Leser Construction"
desc = "This spell constructs a cult wall"
school = "conjuration"
charge_max = 100
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/turf/simulated/wall/cult)
centcomm_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles
/obj/effect/proc_holder/spell/aoe_turf/conjure/wall/reinforced
name = "Greater Construction"
desc = "This spell constructs a reinforced metal wall"
school = "conjuration"
charge_max = 300
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
centcomm_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles
delay = 50
summon_type = list(/turf/simulated/wall/r_wall)
/obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone
name = "Summon Soulstone"
desc = "This spell reaches into Nar-Sie's realm, summoning one of the legendary fragments across time and space"
school = "conjuration"
charge_max = 3000
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/obj/item/device/soulstone)
/obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall
name = "Shield"
desc = "This spell creates a temporary forcefield to shield yourself and allies from incoming fire"
school = "transmutation"
charge_max = 300
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = 0
summon_type = list(/obj/effect/forcefield)
summon_lifespan = 50
/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift
name = "Phase Shift"
desc = "This spell allows you to pass through walls"
school = "transmutation"
charge_max = 200
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = -1
include_user = 1
phaseshift = 1
jaunt_duration = 50 //in deciseconds
centcomm_cancast = 0 //Stop people from getting to centcomm
ex_flash = 5