ID:148733
 
This Fusion Code has problems, for one...I can't get it to defuse without crashing, and second, it crashes BYOND after a while of being fused...can someone help me? Also, how would I go about deleting a character while inside the game?

obj
fusion
name = "Poratta Earrings"
icon = 'poratta.dmi'
verb
Wear()
set category = "Inventory"
if(src.worn == 1)
src.worn = 0
usr.overlays -= 'poratta.dmi'
usr << "You remove the [src.name]."
usr.poratta = 0
else
src.worn = 1
usr.overlays += 'poratta.dmi'
usr << "You wear the [src.name]."
usr.poratta = 1
Drop()
set category = "Inventory"
if(src.worn == 1)
usr << "Not while its being worn."
if(src.worn == 0)
src.loc=locate(usr.x,usr.y+1,usr.z)
Get()
set category = "Inventory"
set src in oview(1)
Move(usr)
Fuse(mob/characters/M in oview(1))
set category = "Fighting"
if(M.race == usr.race||usr.race == "All")
if(M.poratta == 1)
if(M.name == usr.name)
usr.fused = 1
if(usr.fused == 1||M.fused == 1)
usr.maxpowerlevel += M.maxpowerlevel
M.maxpowerlevel += usr.maxpowerlevel
else
var/lead = copytext(usr.name,1,5)
var/load = copytext(M.name,6)
usr.random = rand(1,2)
if(usr.random == 1)
var/hairover = 'hairstrip.dmi'
hairover += rgb(M.rhair,M.ghair,M.bhair)
usr.overlays += hairover
if(usr.random == 2)
var/hairovertwo = 'hairstrip2.dmi'
hairovertwo += rgb(M.rhair,M.ghair,M.bhair)
usr.overlays += hairovertwo

view(6) << "[M] and [usr] fuse to make [lead][load]!!!"
view(6) << "---===FUSION HA!!!===---"
M.icon = 0
M.density = 0
M.overlays = 0
M.movable = 0
M.plarper = 1
usr.maxpowerlevel = (M.maxpowerlevel + usr.maxpowerlevel)
M.name = "[lead][load]"
usr.name = "[lead][load]"
usr.overlays += M.overlays
usr.contents += M.contents
M.overlays = 0
M.loc=locate(usr.x,usr.y,usr.z)
M.follow = usr.name
M.fusionfollow()
All that looks fine. It's your fusionfollow() that is to blame.
In response to Garthor
I agree with garthor, yet, you should put in another verb to use as the Defuse. It should be opposite everything you have raised, and return user icons to their original states. For example, here would be a simple Un-Fuse Code:

mob/verb/Un-Fuse
if(usr.fuse == 1)
if(mob/goku(varies from game to game))
usr.icon = 'goku.dmi'
usr.maxpowerlevel /= M.maxpowerlevel

and so on. But, since your game doesn't run on the same base as mine, you would have to tweak that code alot!
Heh... Just to nitpick, it's "Potarra" earrings instead of "Poratta"...
In response to Kamion
mob
var{fuse=0}
verb/Un_Fuse()
{if(usr.fuse==1)}
if(istype(usr,/mob/goku)){
usr.icon = 'goku.dmi';
usr.maxpowerlevel/=M.maxpowerlevel}


Talk about alot of tweaking needed. Can't have a - in a verb, missing the () at the end of the verb, no such thing as if(mob/goku(variables blah) ect.. That code looks like it's from MM "Migzor Maker"

RaeKwon
In response to RaeKwon
Also wouldnt it be easier to store all your icons etc in tempoary vars instead of having to define Goku, Krillin etc?
In response to Mrhat99au
Lol, just to clear the slate, I threw that fusion code togethor in about 10 seconds, not looking for errors, bugs, etc. And, no its not from MM. If it looks like it, wow, I know MM's fusion code :) J/P!
In response to SuperSaiyanGokuX
lol...good eye...LOL terriffic job spotting it out, but does it solve meb problem...**SNIFF**