ID:162480
 
Okay I am a newb at coding so somebody help me out with this code.This is the first code I ever made >.<

obj
Gomu_Gomu_Fruit
icon= 'gomu gomu fruit.dmi'
verb
Eat()
set src in oview(1)
view() << "[usr] ate the \a [src]"
del(src)
Get()
set src in oview(1)
usr.contents += src
view() << "[usr] picks up \a [src]"
Drop()
new/obj/Gomu_Gomu_Fruit(usr.loc)
view() << "[usr] drops \a [src]"
del(src)


What I want:This code is basically allowing the player to eat the fruit them allowing them to get a power up and letting them becoming the race of "Gomu".This is a code for the popular manga/anime One Piece if you know what manga/ anime are.I am a noob so please help >.<
obj
> Gomu_Gomu_Fruit
> icon= 'gomu gomu fruit.dmi'
> verb
> Eat()
> set src in usr //when the item is in your inventory
> view() << "[usr] ate the \a [src]"

usr.Power = usr.Power*2 //Power up (x2)
usr.Race = "Gomu" //Change their race variable
usr.icon = 'Gomu.dmi' //Change their icon

//Any other changes for their race should go in here

> del(src)
> Get()
> set src in oview(1)
> usr.contents += src
> view() << "[usr] picks up \a [src]"
> Drop()
> set src in usr
Move(usr.loc) //Drop the item
>


Now once all your changes to the player have been added in to the Eat() verb, they will essentially become the Gomu race.

If you are only looking for this to be temporary, then you can create a proc and call it in the Eat() verb.

mob/proc/Gomu_Revert()
spawn(600) //Wait 1 minute
Power = Power/2
Race = "Human"
icon = 'Human.dmi'

//Any other changes should go here too


The way to initialize this proc would be,

usr.Gomu_Revert()
In response to Dice1989
Well they won't need to revert since it's like choosing your classes/race for eternity thus they cannot turn back to original.
In response to IOwned
So then don't.
In response to Garthor
I didn't
In response to IOwned
Good then.

(I really enjoy two word sentence conversations.)