I am trying to make a game, where, after buying the seperate peices, you can fit 4 peices together to make a Beyblade. If you do not know what this is, it doesn't matter whether you think it an item or a weapon. That's not the point. :P
What I am getting at is this:
My buying code is this :
mob
Shop1
name = "Beyblade Shopkeeper"
icon = 'Mobs.dmi'
icon_state = "SK1"
Click()
usr<<"Welcome to my shop!"
switch(input("What would you like to buy?","Beyblade Shopkeeper",text) in list ("Full Beyblades","Attack Rings","Weight Rings","Bases"))
if("Full Beyblades")
if(usr.Cash>=600)
switch(input("What would you like to buy? (Everything listed here costs 600)","Beyblade Shopkeeper",text) in list ("Baku-shin-oh","Roller Attacker","Dragoon S","Raziel","None"))
if("Baku-shin-oh")
usr<<"You bought Baku-shin-oh!!!"
usr.Cash -= 600
usr.AttackRings.Add("Baku-shin-oh")
usr.WeightRings.Add("Baku-shin-oh")
usr.Bases.Add("Baku-shin-oh")
if("Roller Attacker")
usr<<"You bought Roller Attacker!!!"
usr.Cash -= 600
usr.AttackRings.Add("Roller Attacker")
usr.WeightRings.Add("Roller Attacker")
usr.Bases.Add("Roller Attacker")
if("Dragoon S")
usr<<"You bought Dragoon S!!!"
usr.Cash -= 600
usr.AttackRings.Add("Dragoon S")
usr.WeightRings.Add("Dragoon S")
usr.Bases.Add("Dragoon S")
if("Razeil")
usr<<"You bought Razeil!!!"
usr.Cash -= 600
usr.AttackRings.Add("Razeil")
usr.WeightRings.Add("Razeil")
usr.Bases.Add("Razeil")
if("None")
usr<<"You bought nothing!"
else
usr<<"You need 600 cash!"
This works fine, and they get the thing added to their list. Then to let them put it on their Beyblade I put :
mob
verb
CustomAttackRing(attack as null|anything in src.AttackRings)
//Lets them customize their Beyblade
set name = "Customize your Beyblade Attack Ring"
switch("attack")
if("Baku-shin-oh")
for(var/obj/Beyblade/Custom/Attack/A in src.contents)
if(A.name != "N/A")
src.AttackRings += A.name
src.AttackRings.Remove("Baku-shin-oh")
src.AttackRing = "Baku-shin-oh"
A.name = "Baku-shin-oh"
A.Att = 6
A.Def = 4
A.End = 2
if("Roller Attacker")
for(var/obj/Beyblade/Custom/Attack/A in src.contents)
if(A.name != "N/A")
src.AttackRings += A.name
src.AttackRings.Remove("Roller Attacker")
src.AttackRing = "Roller Attacker"
A.name = "Roller Attacker"
A.Att = 2
A.Def = 4
A.End = 4
if("Razeil")
for(var/obj/Beyblade/Custom/Attack/A in src.contents)
if(A.name != "N/A")
src.AttackRings += A.name
src.AttackRings.Remove("Razeil")
src.AttackRing = "Razeil"
A.name = "Razeil"
A.Att = 3
A.Def = 3
A.End = 1
if("DragoonS")
for(var/obj/Beyblade/Custom/Attack/A in src.contents)
if(A.name != "N/A")
src.AttackRings += A.name
src.AttackRings.Remove("DragoonS")
src.AttackRing = "DragoonS"
A.name = "DragoonS"
A.Att = 4
A.Def = 1
A.End = 3
CustomWeightDisk(weight as null|anything in src.WeightRings)
//Lets them customize their Beyblade
set name = "Customize your Beyblade Weight Disk"
switch("weight")
if("Baku-shin-oh")
for(var/obj/Beyblade/Custom/Weight/W in src.contents)
if(W.name != "N/A")
src.WeightRings += W.name
src.WeightRings.Remove("Baku-shin-oh")
src.WeightRing = "Baku-shin-oh"
W.name = "Baku-shin-oh"
W.Att = 2
W.Def = 1
W.End = 3
if("Roller Attacker")
for(var/obj/Beyblade/Custom/Weight/W in src.contents)
if(W.name != "N/A")
src.WeightRings += W.name
src.WeightRings.Remove("Roller Attacker")
src.WeightRing = "Roller Attacker"
W.name = "Roller Attacker"
W.Att = 1
W.Def = 3
W.End = 2
if("Razeil")
for(var/obj/Beyblade/Custom/Weight/W in src.contents)
if(W.name != "N/A")
src.WeightRings += W.name
src.WeightRings.Remove("Razeil")
src.WeightRing = "Razeil"
W.name = "Razeil"
W.Att = 3
W.Def = 3
W.End = 5
if("DragoonS")
for(var/obj/Beyblade/Custom/Weight/W in src.contents)
if(W.name != "N/A")
src.WeightRings += W.name
src.WeightRings.Remove("DragoonS")
src.WeightRing = "DragoonS"
W.name = "DragoonS"
W.Att = 1
W.Def = 4
W.End = 7
CustomBase(base as null|anything in src.Bases)
//Lets them customize their Beyblade
set name = "Customize your Beyblade Base"
switch("base")
if("Baku-shin-oh")
for(var/obj/Beyblade/Custom/Base/B in src.contents)
if(B.name != "N/A")
src.Bases += B.name
src.Bases.Remove("Baku-shin-oh")
src.Base = "Baku-shin-oh"
B.name = "Baku-shin-oh"
B.Att = 2
B.Def = 1
B.End = 3
if("Roller Attacker")
for(var/obj/Beyblade/Custom/Base/B in src.contents)
if(B.name != "N/A")
src.Bases += B.name
src.Bases.Remove("Roller Attacker")
src.Base = "Roller Attacker"
B.name = "Roller Attacker"
B.Att = 1
B.Def = 3
B.End = 2
if("Razeil")
for(var/obj/Beyblade/Custom/Base/B in src.contents)
if(B.name != "N/A")
src.Bases += B.name
src.Bases.Remove("Razeil")
src.Base = "Razeil"
B.name = "Razeil"
B.Att = 3
B.Def = 3
B.End = 5
if("DragoonS")
for(var/obj/Beyblade/Custom/Base/B in src.contents)
if(B.name != "N/A")
src.Bases += B.name
src.Bases.Remove("DragoonS")
src.Base = "DragoonS"
B.name = "DragoonS"
B.Att = 1
B.Def = 4
B.End = 7
Which is AMAZINGLY lengthy as you can see, and doesn't actually work! It doesn't remove the thing from the list, or add it to the var.
I have objects for the 4 things, which define their vars:
obj
Beyblade
Razeil
Weight
Att = 3
Def = 3
End = 5
Attack
Att = 3
Def = 3
End = 1
Base
Att = 1
Def = 4
End = 6
Bakushinoh
Weight
Att = 2
Def = 1
End = 3
Attack
Att = 6
Def = 4
End = 2
Base
Att = 4
Def = 2
End = 3
RollerAttacker
Weight
Att = 1
Def = 3
End = 2
Attack
Att = 2
Def = 4
End = 4
Base
Att = 4
Def = 2
End = 3
DragoonS
Weight
Att = 1
Def = 4
End = 7
Attack
Att = 4
Def = 1
End = 3
Base
Att = 6
Def = 3
End = 1
And I was thinking, that there MUST be a shorter way of doing what I did, and making it work.
Later in the game, (which I haven't coded yet) MANY things, will depend on the Customized Beyblades vars, so I need something that works, and I kinda need it soon.
If you need anymore code, to help me, I will be happy to give it!
Sorry for taking up all your time, but hopefully this will be a decent game, and we will have one more small step against the DBZ Rips :P
~GokuSS4Neo~
I need this so bad, that if you help me, and the code you give me REALLY helps, I will give you GM powers, and I will ask for a forward on my allowance so that I can pay you over PayPal (probably only about $1, because my allowence has already been forwarded to January).
Please, any help would be more than gratefully accepted!
~GokuSS4Neo~