mob/verb
Ki_Blast()
set category = "Techniques"
var/kicost= 5
stamcost= 5
if(src.Tired_Check())
src<< "[RESTRICTIVEFONT]You are too tired to do that. Maybe you should get some rest.[FONTCLOSURE]"
return
Busy()
if(!busy)
if(src.ki<= kicost)
src << "[RESTRICTIVEFONT]You can't seem to gather enough energy.[FONTCLOSURE]"
if(src.ki >= kicost)
busy= 1
sleep(4)
src.ki-= kicost
src.stamina-= stamcost
view(src)<< sound('Ki Blast.wav')
var/obj/Ki_Blast/O = new /obj/Ki_Blast(src.loc)
O.shooter= src
O.damage= src.pl/5
walk(O,src.dir)
busy= 0
obj/Ki_Blast
var/mob/shooter as mob
var/damage
icon= 'Ki Blast.dmi'
density= 1
Bump(mob/combatant/M)
if(istype(M,/mob/combatant/))
if(M.kiresistance/10>= damage)
if(prob(50))
view(src)<< "[COMBATFONT][M] has deflected away [shooter]'s [src]![FONTCLOSURE]"
del(src)
return
if(prob(50))
view(src)<< "[COMBATFONT][M] has dodged [shooter]'s [src]![FONTCLOSURE]"
del(src)
return
if(prob(5))
view(src)<< "[COMBATFONT][M] has dodged [shooter]'s [src]![FONTCLOSURE]"
del(src)
return
if(prob(5))
view(src)<< "[COMBATFONT][M] has dodged [shooter]'s [src]![FONTCLOSURE]"
del(src)
return
if(prob(round(M.kiresistance- damage/250)))
if(prob(50))
view(src)<< "[COMBATFONT][M] has deflected away [shooter]'s [src]![FONTCLOSURE]"
del(src)
return
if(prob(50))
view(src)<< "[COMBATFONT][M] has dodged [shooter]'s [src]![FONTCLOSURE]"
del(src)
return
M.pl-= damage
view(M)<< "[COMBATFONT][shooter]'s ki blast slams into [M]![FONTCLOSURE]"
if(M.Death_Check())
world<< "[BATTLEINFOFONT][M] has been killed by [shooter]![FONTCLOSURE]"
var/x= M.x
var/y= M.y
var/z= M.z
del(M)
new/obj/Crater(locate(x,y,z))
shooter.exp+= M.expgiven
shooter.Exp_Check()
del(src)
Problem description: This is the code for my ki blast. It Makes a blast and saves the src of the verb ki blast to the ki blast's variable shooter. It is then supposed to give the shooter the exp. But it doesn't give the shooter anything. I obviously did this wrong so how should I do it?
... ? Indendation?
All of that junk should be passed in the New() proc
Eurr? .. Wha? Why's that twice over there?
5/100*2= 10/200 = 5/100
Eurr. What if M is a player? Constant disconnect!
And how is it going to give the shooter M.expgiven, when there is no M!
Redundant!
Should be;
Makes no sense. Does nothing.
Snippet of how I see it should be;
Any mistakes, I'll edit, it's 8 in the morning. >.>;