ID:145343
 
Code:login problem
client
MouseDown(O)
var/mob/Player/me = usr
if((istype(O,/obj/) || istype(O,/mob/Player)) && me.tkyes == 1)
me.tkobj = O
MouseUp(O,loca)
var/mob/Player/me = usr
if(me.tkobj!=null)
walk_towards(me.tkobj,loca,0)
me.tkobj = null
world
mob = /mob/Choosing
loop_checks = 0
//hub = "" //Make a hub on BYOND, and enter the path between the "", remove the first two //
obj
Fireball
var/thrownby
icon = 'obj.dmi'
icon_state = "fireball"
density = 1
Bump(M)
if(istype(M,/mob/Player/))
M << "You've been hit by [src.thrownby]!"
oview(M) << "[M] has been hit by [src.thrownby]!"
var/mob/Player/user = src.thrownby
var/mob/Player/target = M
target.power -= user.power
call(M,/mob/Player/proc/Deathcheck)()
del(src)
athame
var/thrownby
icon = 'obj.dmi'
icon_state = "sathame"
density = 1
verb
Throw()
thrownby = usr
walk(src,usr.dir,0)
sleep(20)
if(src)
del(src)
Get()
set src in oview(1)
src.loc = usr
usr << "You get a [src]."
Drop()
set src in usr
src.loc = usr.loc
usr << "You drop a [src]."
Bump(M)
if(istype(M,/mob/Player/))
M << "You've been hit by [src.thrownby]!"
oview(M) << "[M] has been hit by [src.thrownby]!"
var/mob/Player/user = src.thrownby
var/mob/Player/target = M
target.power -= user.power

call(M,/mob/Player/proc/Deathcheck)()

del(src)
chest
icon = 'obj.dmi'
icon_state = "box"
density = 1
verb
Open_Chest()
set src in view(1)
var/take = input("What do you wish to take?","A Charmed Game",null) in list("Athame","Cancel")
if(take == "Athame")
usr << "You get an athame from the chest."
new /obj/athame(usr)
book
icon = 'obj.dmi'
icon_state = "book"
verb
Read_Book()
set src in view(1)
var/mob/Player/m = usr
if(m.stamina>=10 && m.busy==0)
m.stamina -= 10
m.busy = 1
usr << "You study for a while."
sleep(30)
m.maxpower += 10
m.busy = 0
usr << "You finish studying."
//gain powers
if(m.class == "Witch" && m.witchtype == "TK" && m.maxpower>=200)
usr << "You can now move things with the power of your mind."
m.tkyes = 1
if(m.class == "Witch" && m.witchtype == "Molecular Control" && m.maxpower>=200)
usr << "You can now Freeze Time."
m.verbs += /mob/Power/verb/Freeze_Time
if(m.class == "Witch" && m.witchtype == "Premonition" && m.maxpower>=200)
usr << "You can now use Premonition."
m.verbs += /mob/Power/verb/Premonition
if(m.class == "Whitelighter" && m.maxpower>=200)
usr << "You can now use Orb"
m.verbs += /mob/Power/verb/Orb
if(m.class == "Demon" && m.maxpower>=200)
usr << "You can now use Fireball"
m.verbs += /mob/Power/verb/Fireball
portal
icon = 'turf.dmi'
icon_state = "portal"
var{xloc;yloc;zloc}
mob
Choosing
Login()
var/savefile/s = new("players.sav")
var/list/d = s.dir
if(d.Find("[ckey]")) // player's file found
usr << "Loading into your character."
s["/[ckey]"] >> usr
return 0
else
var/mob/Player/newmob = new()
//if not...
usr << "New User"
newmob.name = input("What is your name?","A Charmed Game",null) as text
var/g = input("What is your name?","A Charmed Game",null) in list("Male","Female")
var/c = input("What are you?","A Charmed Game",null) in list("Witch","Demon","Whitelighter")
if(c == "Witch")
var/t = input("Which type?","A Charmed Game",null) in list("TK","Molecular Control","Premonition")
newmob.witchtype = t
newmob.icon = 'player.dmi'
if(g=="Male")
newmob.gender = MALE
newmob.icon_state = "male"
else
newmob.gender = FEMALE
newmob.icon_state = "female"
newmob.class = c

X if(c=="Witch")
newmob.loc = locate(13,13,1)
X if(c=="Demon")
newmob.loc = locate(4,190,1)
X if(c=="Whitelighter")
newmob.loc = locate(5,1,1)


client.mob = newmob
del(usr)
Power
verb
Freeze_Time()
for(var/mob/Player/m in oview())
m.busy = 1
spawn(20)
m.busy = 0
for(var/obj/o in oview())
walk(o,0)
Premonition()
var/list/being = new()
for(var/mob/Player/m in world)
being += m
being += "Cancel"
var/who = input("Who do you wish to use Premonition on?","A Charmed Game",null) in being
if(being!="Cancel")
client.perspective = EYE_PERSPECTIVE
client.eye = who
sleep(20)
client.perspective = MOB_PERSPECTIVE
client.eye = usr
Orb()
var/list/being = new()
for(var/mob/Player/m in world)
being += m
being += "Cancel"
var/mob/Player/who = input("Who do you wish to use Orb to?","A Charmed Game",null) in being

usr.overlays += /obj/effects/orb1
sleep(8)
invisibility = 1
usr.overlays -= /obj/effects/orb1

usr.loc = who.loc

usr.overlays += /obj/effects/orb2
invisibility = 0
who << "[usr] orbs behind you!"
usr << "You orb behind [who]!"
sleep(8)
usr.overlays -= /obj/effects/orb2
Fireball()
var/obj/Fireball/F = new(usr.loc)
F.thrownby = usr
walk(F,usr.dir,0)
sleep(20)
if(F)
del(F)
Player
Login()
usr << "Welcome to CHARMED ONLINE!"
world << "[name] has logged in."
if(xloc!=null&&yloc!=null&&zloc!=null)
loc = locate(xloc,yloc,zloc)
if(class == "Witch" && witchtype == "Molecular Control" && maxpower>=200)
verbs += /mob/Power/verb/Freeze_Time
if(class == "Witch" && witchtype == "Premonition" && maxpower>=200)
verbs += /mob/Power/verb/Premonition
if(class == "Whitelighter" && maxpower>=200)
verbs += /mob/Power/verb/Orb
if(class == "Demon" && maxpower>=200)
verbs += /mob/Power/verb/Fireball
var
power = 100
maxpower = 100
class
witchtype
busy = 0
stamina = 100
maxstamina = 100

tkyes
tkobj

xloc
yloc
zloc
verb
Say(msg as text)
view() << "[usr] says, \"[msg]\""
World(msg as text)
world << "<b>[usr] worldsays, \"[msg]\"</b>"
Rest()
if(busy == 0)
busy = 1
usr << "You begin to rest."
sleep(30)
power = maxpower
stamina = maxstamina
busy = 0
usr << "You finish resting."
Save()
Saveme()

proc
Deathcheck()
if(src.power<=0)
src << "You are dead."
src.loc = locate(1,1,2)
Saveme()
var/savefile/s = new("players.sav")
src.xloc = src.x
src.yloc = src.y
src.zloc = src.z
s["/[src.ckey]"] << src
src << "You are saved."
Stat()
stat("Name:",name)
stat("Class:",class)
stat("Power:","[power]/[maxpower]")
stat("Stamina:","[stamina]/[maxstamina]")
statpanel("Inventory",contents)
Move()
if(busy == 1)
return
else
..()
Logout()
Saveme()
world << "[name] has logged out."
..()
turf
icon = 'turf.dmi'
grass
icon_state = "grass"
water
icon_state = "water"
density = 1
ground
icon_state = "dirt"
teleporter
Enter(O)
if(istype(O,/mob/Player/))
var/mob/Player/m = O
m.loc = locate(5,5,1)
m << "You leave the portal and live on!"

obj/effects
icon = 'player.dmi'
layer = MOB_LAYER + 1
orb1
icon_state = "orb"
orb2
icon_state = "orb2"


Problem description:ok at the X's there will be if(c=="Witch") and the locate code, none of them work heeelp pllz


Did you just post the whole source code of that free-2-rip charmed thinger? o.o;

Dude, that rip is lame. Half of the coding is wrong.

Pfft. usr in login.
Not to mention the usr in Entered o.o;
In response to DivineO'peanut
last time i seen one of your posts you advised someone to use lololololz in their code..so i dunno
In response to VolksBlade
Advised? I used lolololz 'cuase I didn't have anything else to name the var/obj/w/e I named lololoz. I probably did it 'cuase of boredness, yet I'd never give a code snippet to anyone of it was made wrong.

Plus, what does it has to do with you ripping a complete source code and posting it here with a problem description no one can understand?
Well, among problems already pointed out, I'll add this: Your fireball is done wrong.

First off, the fireball itself should handle its own movement by setting everything up in New(). That should not be left to the proc that creates it. Always create projectiles by sending at least the information about who fired it.

Second, in your Bump() proc you're doing needless typecasting because you can simply define M as a /mob/player, and also your use of call() there is ridiculous. Just use M.DeathCheck(). Or, since presumably you want to give the killer some credit, M.DeathCheck(owner), where owner is the player who created the fireball.

Lummox JR