-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmagicks.dm
206 lines (150 loc) · 3.89 KB
/
magicks.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#define MAGIC_BASE 50
proc/Ticker()
while(1)
for(var/mob/M in world)
if(M.key)
if(!M.atonement)
continue //no mana fro you you muggle you
M.Magick()
sleep(10)
mob
var
magic_xp = 0
level = 0
mana = 0
atonement
max_mana = 0
level_threshold = 0
datum/spell_holder/spells
proc/Set_Threshold()
if(!level||!atonement)
return //this shouldn't happen, panic now
var/nl = 50
var/i
var/add_on = MAGIC_BASE
for(i=1,i<level,i++)
add_on *= 2
nl += add_on
return nl
proc/Level_Up()
level++
level_threshold = Set_Threshold()
max_mana = 150 * level
proc/Gain_Exp(var/N)
magic_xp += N
if(magic_xp >= level_threshold)
src << "\blue You feel enlightened.."
Level_Up()
proc/Magick()
mana = min(mana + level,max_mana)
proc/CastSpell()
set name = "Cast Spell"
set category = "Magic"
var/spell = input("Choose spell to cast.") in spells.spells
if(atonement != spell:alignment)
src << "\red You are not educated in the ways of [spell:alignment]"
return
if(mana <= spell:mana_cost)
src << "\red You feel to weak to cast this spell."
return
Gain_Exp(rand(spell:min_xp,spell:max_xp))
mana -= spell:mana_cost
spell:Cast(src)
proc/Init_Magic()
level = 1
max_mana = 150
mana = 150
level_threshold = 50
verbs += /mob/proc/CastSpell
proc/Add_Spell(var/datum/spell/S)
spells.spells += new S
src << "\blue You have learned the [S] spell!"
datum/spell_holder
var/mob/holder
var/list/spells = list()
datum/spell
var/name
var/min_xp = 0
var/max_xp = 0
var/alignment
var/mana_cost = 0
proc/Cast()
datum/spell/handsup
name = "Put Yo Hands Up"
min_xp = 15
max_xp = 25
alignment = "Floosh"
mana_cost = 50
Cast(mob/M)
viewers(M) << "\blue [M] does a dang good mofo dance, and I ain't talkin' bout chicken an' gravy BIATCH!"
for(var/mob/MO in view(M))
viewers(MO) << "\bold [MO] puts dem hands up!"
datum/spell/hurt
name = "Hurt Spell"
min_xp = 15
max_xp = 35
alignment = "Death"
mana_cost = 60
Cast(mob/M)
var/choice = input(M,"Choose a target.") in view(M) as mob
if(!istype(M,/mob)) return
viewers(M) << "\red\bold [M] casts a spell of harm on [choice]!"
choice:Dmg(rand(10,60))
choice << "<font size = 5><font color=red>YOU ARE ENVELOPED IN THROES OF PAIN!"
datum/spell/bleed
name = "Bleed Spell"
min_xp = 20
max_xp = 50
alignment = "Death"
mana_cost = 80
Cast(mob/M)
var/choice = input(M,"Choose a target.") in view(M) as mob
if(!istype(M,/mob)) return
viewers(M) << "\red\bold [M] casts a spell of bleeding on [choice]!"
spawn choice:Bleed(rand(2,5),rand(10,30))
choice << "<font size = 5><font color=red>YOU FEEL LIKE BLEEDING! MIGHT AS WELL BLEED!!"
datum/spell/bounty
name = "HOLLA HOLLA BIG DOLLA"
min_xp = 40
max_xp = 60
alignment = "Floosh"
mana_cost = 90
Cast(mob/M)
viewers(M) << "\blue [M] is the fo shnizzle, ya know? Less give him some big dolla!"
viewers(M) << "<font size = 5><font color = yellow>HOLLA HOLLA BIG DOLLA"
for(var/turf/T in view(M,5))
if(prob(10))
if(prob(5))
new/obj/swagpotion(T)
continue
if(prob(5))
new/obj/deathsword(T)
continue
if(prob(5))
new/obj/clothes/sglass(T)
continue
if(prob(5))
new/obj/Rifle(T)
continue
new/obj/Sword(T)
datum/sphere
var/name
var/list/starting_spells = list()
proc/Add_Spells(mob/M)
if(M.atonement == name)
M << "\blue You area already wise in the ways of [name]!"
return
if(!M.spells) M.spells = new/datum/spell_holder
for(var/i in starting_spells)
var/io = new i
M.spells.spells += io
M << "\blue You have learned the [io:name] spell!"
M << "\green You are now wise in the ways of [name]!"
M.Init_Magic()
M.atonement = name
datum/sphere/floosh
name = "Floosh"
starting_spells = list(/datum/spell/handsup,/datum/spell/bounty)
datum/sphere/death
name = "Death"
starting_spells = list(/datum/spell/hurt,/datum/spell/bleed)