Object Spell System v1.0

It is now fully implemented, though I might continue work on it (especially with all the bugs no doubt present in the code). To turn on wizards spawning with an spellbook that gives object spells as opposed to verb spells, uncomment the FEATURE_OBJECT_SPELL_SYSTEM line in config.txt
For the end user, the vanilla (without spell var editing) wizard, the only two differences are having to click spells to use them (not being able to right-click stuff and cast spells that way or type them in the command line) and having a nice little countdown for a spell's recharge time.
 Changelog
It is now less horribly blue on white and more nicely black on white.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1381 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
uporotiy
2011-04-05 20:34:41 +00:00
parent 6fb2e86a5c
commit be85fc280d
21 changed files with 445 additions and 351 deletions
+4
View File
@@ -23,6 +23,7 @@
var/vote_no_dead = 0 // dead people can't vote (tbi)
var/enable_authentication = 0 // goon authentication
var/del_new_on_log = 1 // del's new players if they log before they spawn in
var/feature_object_spell_system = 0 //spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard
var/list/mode_names = list()
var/list/modes = list() // allowed modes
@@ -174,6 +175,9 @@
if ("dont_del_newmob")
config.del_new_on_log = 0
if ("feature_object_spell_system")
config.feature_object_spell_system = 1
if ("probability")
var/prob_pos = findtext(value, " ")
var/prob_name = null
+36 -16
View File
@@ -1,29 +1,40 @@
var/list/spells = list(/obj/spell/blind,/obj/spell/blink,/obj/spell/conjure,/obj/spell/disintegrate,/obj/spell/ethereal_jaunt,/obj/spell/fireball,/obj/spell/forcewall,/obj/spell/knock,/obj/spell/magic_missile,/obj/spell/mutate,/obj/spell/teleport) //needed for the badmin verb for now
var/list/spells = list(/obj/spell/blind,/obj/spell/blink,/obj/spell/conjure,/obj/spell/disable_tech,/obj/spell/disintegrate,/obj/spell/ethereal_jaunt,/obj/spell/fireball,/obj/spell/forcewall,/obj/spell/knock,/obj/spell/magic_missile,/obj/spell/mind_transfer,/obj/spell/mutate,/obj/spell/smoke,/obj/spell/teleport) //needed for the badmin verb for now
/obj/spell
name = "Spell"
desc = "A wizard spell"
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?
var/recharge = 100 //recharge time in deciseconds
var/charge_type = "recharge" //can be recharge or charges, see charge_max and charge_counter descriptions
var/charge_max = 100 //recharge time in deciseconds if charge_type = "recharge" or starting charges if charge_type = "charges"
var/charge_counter = 0 //can only cast spells if it equals recharge, ++ each decisecond if charge_type = "recharge" or -- each cast if charge_type = "charges"
var/clothes_req = 1 //see if it requires clothes
var/stat_allowed = 0 //see if it requires being conscious
var/invocation = "HURP DURP" //what is uttered when the wizard casts the spell
var/invocation_type = "none" //can be none, whisper and shout
var/range = 7 //the range of the spell
var/cast = 0 //the only way I could think of making it temporarily disable
var/message = "derp herp" //whatever it says to the guy affected by it. not always needed
/obj/spell/proc/cast_check() //checks if the spell can be cast based on its settings, plus handles chanting and recharge
/obj/spell/proc/cast_check() //checks if the spell can be cast based on its settings
if(!(src in usr.spell_list))
usr << "\red You shouldn't have this spell! Something's wrong."
return 0
if(cast)
usr << "[name] is still recharging."
return 0
switch(charge_type)
if("recharge")
if(charge_counter != charge_max)
usr << "[name] is still recharging."
return 0
if("charges")
if(!charge_counter)
usr << "[name] has no charges left."
return 0
if(usr.stat && !stat_allowed)
usr << "Not when you're incapacitated."
return 0
if(clothes_req) //clothes check
if(!istype(usr:wear_suit, /obj/item/clothing/suit/wizrobe))
usr << "I don't feel strong enough without my robe."
@@ -37,14 +48,7 @@ var/list/spells = list(/obj/spell/blind,/obj/spell/blink,/obj/spell/conjure,/obj
return 1
/obj/spell/proc/invocation() //spelling the spell out and setting it on recharge
src.cast = 1
var/old_name = src.name
src.name += " (cast)"
spawn(recharge)
src.cast = 0
src.name = old_name
/obj/spell/proc/invocation() //spelling the spell out and setting it on recharge/reducing charges amount
switch(invocation_type)
if("shout")
@@ -54,4 +58,20 @@ var/list/spells = list(/obj/spell/blind,/obj/spell/blink,/obj/spell/conjure,/obj
else
playsound(usr.loc, pick('vs_chant_conj_hf.wav','vs_chant_conj_lf.wav','vs_chant_ench_hf.wav','vs_chant_ench_lf.wav','vs_chant_evoc_hf.wav','vs_chant_evoc_lf.wav','vs_chant_illu_hf.wav','vs_chant_illu_lf.wav','vs_chant_necr_hf.wav','vs_chant_necr_lf.wav'), 100, 1)
if("whisper")
usr.whisper(invocation)
usr.whisper(invocation)
switch(charge_type)
if("recharge")
charge_counter = 0
spawn(0)
while(charge_counter < charge_max)
sleep(1)
charge_counter++
if("charges")
charge_counter--
/obj/spell/New()
..()
charge_counter = charge_max
+4 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell temporarly blinds a single person and does not require wizard garb."
school = "transmutation"
recharge = 300
charge_max = 300
clothes_req = 0
invocation = "STI KALY"
invocation_type = "whisper"
@@ -21,6 +21,9 @@
var/mob/M = input("Choose whom to blind", "ABRAKADABRA") as mob in oview(usr,range)
if(!M)
return
invocation()
var/obj/overlay/B = new /obj/overlay( M.loc )
+4 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell randomly teleports you a short distance."
school = "abjuration"
recharge = 20
charge_max = 20
clothes_req = 1
invocation = "none"
invocation_type = "none"
@@ -25,6 +25,9 @@
else
M = usr
if(!M)
return
invocation()
var/list/turfs = new/list()
-1
View File
@@ -1 +0,0 @@
//gotta test the framework in its fullest first, since it messes with it
+1 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell conjures an elite carp."
school = "conjuration"
recharge = 1200
charge_max = 1200
clothes_req = 1
invocation = "NOUK FHUNMM SACP RISSKA"
invocation_type = "shout"
+2 -2
View File
@@ -1,8 +1,8 @@
/obj/spell/disable_tech
name = "Disable Tech"
desc = "This spell disables all weapons, cameras and most other technology in range and doesn't require wizard garb."
recharge = 400
clothes_req = 0
charge_max = 400
clothes_req = 1
invocation = "NEC CANTIO"
invocation_type = "whisper"
range = 7
+4 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell instantly kills somebody adjacent to you with the vilest of magick."
school = "evocation"
recharge = 600
charge_max = 600
clothes_req = 1
invocation = "EI NATH"
invocation_type = "shout"
@@ -21,6 +21,9 @@
var/mob/M = input("Choose whom to [kill_type]", "ABRAKADABRA") as mob in oview(usr,range)
if(!M)
return
invocation()
if(sparks_spread)
+4 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell creates your ethereal form, temporarily making you invisible and able to pass through walls."
school = "transmutation"
recharge = 300
charge_max = 300
clothes_req = 1
invocation = "none"
invocation_type = "none"
@@ -23,6 +23,9 @@
else
M = usr
if(!M)
return
invocation()
spawn(0)
+5 -2
View File
@@ -3,7 +3,7 @@
desc = "This spell fires a fireball at a target and does not require wizard garb."
school = "evocation"
recharge = 200
charge_max = 200
clothes_req = 0
invocation = "ONI SOMA"
invocation_type = "shout"
@@ -21,7 +21,10 @@
if(!cast_check())
return
var/mob/M = input("Choose whom to fireball", "ABRAKADABRA") as mob|obj|turf in oview(usr,range)
var/mob/M = input("Choose whom to fireball", "ABRAKADABRA") as mob in oview(usr,range)
if(!M)
return
invocation()
+1 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb."
school = "transmutation"
recharge = 100
charge_max = 100
clothes_req = 0
invocation = "TARCOL MINTI ZHERI"
invocation_type = "whisper"
+1 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell opens nearby doors and does not require wizard garb."
school = "transmutation"
recharge = 100
charge_max = 100
clothes_req = 0
invocation = "AULIE OXIN FIERA"
invocation_type = "whisper"
+2 -2
View File
@@ -1,9 +1,9 @@
/obj/spell/magic_missile
name = "Magic missile"
name = "Magic Missile"
desc = "This spell fires several, slow moving, magic projectiles at nearby targets."
school = "evocation"
recharge = 100
charge_max = 100
clothes_req = 1
invocation = "FORTI GY AMA"
invocation_type = "shout"
+4 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell causes you to turn into a hulk and gain telekinesis for a short while."
school = "transmutation"
recharge = 400
charge_max = 400
clothes_req = 1
invocation = "BIRUZ BENNAR"
invocation_type = "shout"
@@ -25,6 +25,9 @@
else
M = usr
if(!M)
return
invocation()
M << text("[message]")
+4 -1
View File
@@ -3,7 +3,7 @@
desc = "This spell teleports you to a type of area of your selection."
school = "abjuration"
recharge = 600
charge_max = 600
clothes_req = 1
invocation = "SCYAR NILA"
invocation_type = "none" //hardcoded into the spell due to its specifics
@@ -23,6 +23,9 @@
else
M = usr
if(!M)
return
invocation()
var/A