mob/electshopkeeper
icon='shopkeepers.dmi'
verb/Buy()
set src in oview(1)
if(usr.wanted==0)
var/totalprice
for(var/obj/eitemsdmi/O in usr.scart)
totalprice+=O.price
usr<<"That will be [totalprice] dollars"
if(usr.cash>=totalprice)
usr.cash-=totalprice
for(var/obj/eitemsdmi/O in usr.scart)
if(O.parent_type==/obj/eitemsdmi/cd)
new/obj/eitemsdmi/cd(usr)
if(O.parent_type==/obj/eitemsdmi/cdplayer)
new/obj/eitemsdmi/cd(usr)
if(O.parent_type==/obj/eitemsdmi/scouter)
new/obj/eitemsdmi/cd(usr)
else
usr<<"You do not have enough money"
switch(input("What will you do?","Do?")in list("Put back Items","Run"))
if("Put back Items")
for(var/obj/eitemsdmi/O in usr.scart)
del(O)
if("Run")
world<<"[usr] has just robbed the electronic store 300 Zeni reward!"
usr.wanted=1
bounty=300
usr.overlays+='wanted.dmi'
else
usr<<"GET OUT OF MY STORE!!!"
usr<<"The shopkeeper takes out a shotgun"
usr.hp-=rand(1,5)
Here is my code. Is there an easier way to transfer something from a list as in scart to the users contents easier then what I have up there in the area around
for(var/obj/eitemsdmi/O in usr.scart)
if(O.parent_type==/obj/eitemsdmi/cd)
new/obj/eitemsdmi/cd(usr)
if(O.parent_type==/obj/eitemsdmi/cdplayer)
new/obj/eitemsdmi/cd(usr)
if(O.parent_type==/obj/eitemsdmi/scouter)
new/obj/eitemsdmi/cd(usr)?
ID:267080
Nov 24 2002, 6:05 am
|
|
In response to Xooxer
|
|
I'm so stupid...I can't believe that I didn't notice it.
|
DBZ Kidd wrote:
Here is my code. Is there an easier way to transfer something from a list as in scart to the users contents easier then what I have up there in the area around Question here: Did you intend for later players to be able to buy merchandise? If you want to be able to buy the same thing later in infinite supply, Xooxer's suggestion to use Move() won't work out for you; you will in fact need to create new items as above. However, there are a few problems in the code as it stands:
for(var/obj/eitemsdmi/O in usr.scart) Lummox JR |
In response to DBZ Kidd
|
|
After reading LummoxJR's reply, I'll ditto that! :)
~X |
O.Move(usr)