DeathCheck(mob/Killer)
if(src.HP<=0)
if(src.key) //if its a player you wana do something different right?
src<<"You were Killed by [Killer]!" //a quick death message so u know u died
src.HP=src.MaxHP //restores users HP and MP after dying
src.MP=src.MaxMP
src.loc=locate(8,16,1) //sends the dead guy back to the start
else
Killer<<"You Killed a [src]! Gained [src.Exp] EXP and [src.Gold] Gold"
Killer.Exp+=src.Exp
Killer.Gold+=src.Gold
Killer.LevelCheck() //check if the player has enough EXP to level up
del src //this will simply delete the monster, no respawning
thats my deathscheck from rpgstarter by falacy and now i want to use a new deathengine and use it at my old.
the new deathsengine is created by Worldweaver!
var/HAZE_LAYER = MOB_LAYER-1
proc/distance(atom/A, atom/B) // This procedure gets the distance from one object to another.
return sqrt((A.x - B.x)**2 + (A.y - B.y)**2) // Standard distance formula you might find in a math textbook.
mob
proc
death(usr.) // Defines the death Procedure.
new/obj/Corpse(src.loc,src) // Creates a new Corpse
src.gravelocate()
src.invisibility = 1 // These lines change the player to simulate death
src.icon_state = "Ghost"
src.sight = SEE_SELF
src.dead = 1
for(var/area/death_haze/A in world) // To add the haze
if(A.coverhaze)
src << A.coverhaze
gravelocate() // We'll use this to find the closest grave
var/closestnum = 999999999
var/obj/Grave_Stone/Z
for(var/obj/Grave_Stone/G in world)
if(G.z == src.z)
var/dist = distance(src,G) // Calls the distance formuka
if(dist < closestnum) // Compares the distance to the distance to the previously determined closest distance and completes necessary actions if it is less.
closestnum = dist
Z = G
src.loc = Z.loc // Locates at the closest grave
//////////////////////The Principles for the Haze were drawn from shadowdarke's RoofLib
area
var// Necessary variable
icon/hazeicon
haze_state = ""
image/coverhaze
Del()
if(coverhaze)
del(coverhaze)
..()
New()
..()
if(hazeicon)
coverhaze = image(hazeicon,src,haze_state,HAZE_LAYER) // Defines the coverhaze
death_haze
icon = 'icons.dmi'
hazeicon = 'DeathHaze.dmi'
var
grave_num = 0
obj
Grave_Stone
icon = 'icons.dmi'
icon_state = "gstone"
density = 1
var
idtag
New()
..()
spawn(rand(1,10))
grave_num += 1
src.name = "Grave [grave_num]"
verb
Ressurect() // Resurrection
set src in oview(1)
if(usr.dead)
switch(input("Would You like to ressurect here? You will lose half your experience if you do so. You may also find your corpse and ressurect for no penalty.") in list ("Yes","No, I Will find my corpse."))
if("Yes")
usr.Exp = round(usr.Exp/2) // Necessary ressurection penalties
usr.icon_state = "Mob"
usr.invisibility = 0
usr.dead = 0
for(var/obj/Corpse/C in world) // Deletes corpse
if(C.name == "[usr]"'s Corpse")
del(C)
for(var/area/death_haze/A in world) // Removes the player's haze.
if(A.coverhaze)
usr.client.images -= A.coverhaze
else
usr << "You are not dead."
obj/Corpse // The corpse
var
ownedby = ""
New(Loc,mob/owner,position)// We want the corpse to be able to be identified and to do some other cool stuff on creation
src.name = addtext(owner.name,""'s Corpse")
src.ownedby = "[owner.name]"
src.icon = 'icons.dmi'
src.icon_state = "Mob1Death"
src.dir = owner.dir
verb/Ressurect() // Ressurect yourself!
set src in oview(1)
if(usr.key)
if(src.ownedby == "[usr]")
usr.icon_state = "Mob" // Stuff here resets the player
usr.invisibility = 0
usr.dead = 0
for(var/area/death_haze/A in world) // Removes the death haze
if(A.coverhaze)
usr.client.images -= A.coverhaze
del(src)
Now my Problem i Cant get that both to work... would be nice if anyone can help me...
only learning by doing is hard
ID:138848
Oct 20 2011, 3:09 am
|
|
In response to Robertbanks2
|
|
DeathCheck(mob/Killer) thats my deathscheck from rpgstarter by falacy and now i want to use a new deathengine and use it at my old. the new deathsengine is created by Worldweaver! var/HAZE_LAYER = MOB_LAYER-1 Now my Problem i Cant get that both to work... would be nice if anyone can help me... only learning by doing is hard ---------------------------------- Ok, I think it's a little bit easier to read now. Next time don't forget dm tags. |
2. You need to give sufficient information about what problem you're having. Posting 2 pages of code and saying "It broke, fix it," won't get you any help.
3. Don't copy paste a bunch of libraries together to make a game, that's not what they're for.