-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshop.dm
566 lines (551 loc) · 31 KB
/
shop.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
obj/NPC/ShopKeeper
interact_dist = 2
var
list
shopinventory
item
obj
O
ItemShop1/contents = newlist(/obj/Ability/Basic/Item/Cure1,/obj/Ability/Basic/Item/Cure2,/obj/Ability/Basic/Item/Ether1,/obj/Ability/Basic/Item/Tent)
ItemShop2/contents = newlist(/obj/Ability/Basic/Item/Cure1,/obj/Ability/Basic/Item/Cure2,/obj/Ability/Basic/Item/Life,/obj/Ability/Basic/Item/Ether1,/obj/Ability/Basic/Item/Tent)
ItemShop3/contents = newlist(/obj/Ability/Basic/Item/Cure1,/obj/Ability/Basic/Item/Cure2,/obj/Ability/Basic/Item/Life,/obj/Ability/Basic/Item/Ether1,/obj/Ability/Basic/Item/Remedy,/obj/Ability/Basic/Item/Tent)
ItemShop4/contents = newlist(/obj/Ability/Basic/Item/Cure1,/obj/Ability/Basic/Item/Cure2,/obj/Ability/Basic/Item/Cure3,/obj/Ability/Basic/Item/Life,/obj/Ability/Basic/Item/Ether1,/obj/Ability/Basic/Item/Ether2,/obj/Ability/Basic/Item/Remedy,/obj/Ability/Basic/Item/Tent,/obj/Ability/Basic/Item/Cabin)
NinjaShop1/contents = newlist(/obj/Ability/Basic/Dart/Shuriken)
NinjaShop2/contents = newlist(/obj/Ability/Basic/Dart/Shuriken,/obj/Ability/Basic/Dart/Boomerang)
NinjaShop3/contents = newlist(/obj/Ability/Basic/Dart/Shuriken,/obj/Ability/Basic/Dart/Boomerang,/obj/Ability/Basic/Dart/FullMoon)
NinjaShop4/contents = newlist(/obj/Ability/Basic/Dart/Shuriken,/obj/Ability/Basic/Dart/Boomerang,/obj/Ability/Basic/Dart/FullMoon,/obj/Ability/Basic/Dart/Fuma)
NinjaShop5/contents = newlist(/obj/Ability/Basic/Dart/Shuriken,/obj/Ability/Basic/Dart/Boomerang,/obj/Ability/Basic/Dart/FullMoon,/obj/Ability/Basic/Dart/Fuma,/obj/Ability/Basic/Dart/Ninja)
WeaponShop1/contents = newlist(/obj/weapon/Knife/Dagger,/obj/weapon/Sword/Shadow,/obj/weapon/Sword/Light,/obj/weapon/Spear/Iron,/obj/weapon/Katana/Short,/obj/weapon/Wrench/Wooden,/*obj/weapon/Bow/ShortBow,*//obj/weapon/Harp/Dreamer,/obj/weapon/Rod/Rod,/obj/weapon/Staff/Staff)
WeaponShop2/contents = newlist(/obj/weapon/Knife/Mythril,/obj/weapon/Sword/Mythril,/obj/weapon/Sword/Broad,/obj/weapon/Spear/Mythril,/obj/weapon/Katana/Middle,/obj/weapon/Axe/Battle,/obj/weapon/Claw/Fire,/obj/weapon/Claw/Ice,/obj/weapon/Claw/Thunder,/obj/weapon/Whip/Whip,/obj/weapon/Wrench/Mythril,/*/obj/weapon/Bow/CrossBow,*//obj/weapon/Harp/Charm,/obj/weapon/Rod/Icerod,/obj/weapon/Staff/Silver)
WeaponShop3/contents = newlist(/obj/weapon/Knife/Silver,/obj/weapon/Sword/Broad,/obj/weapon/Sword/Black,/obj/weapon/Sword/Legend,/obj/weapon/Spear/Trident,/obj/weapon/Katana/Long,/obj/weapon/Claw/Fire,/obj/weapon/Claw/Ice,/obj/weapon/Claw/Thunder,/obj/weapon/Claw/Charm,/obj/weapon/Whip/Chain,/obj/weapon/Wrench/Iron,/*/obj/weapon/Bow/GreatBow,*//obj/weapon/Harp/Lamia,/obj/weapon/Rod/Firerod,/obj/weapon/Staff/Power)
WeaponShop4/contents = newlist(/obj/weapon/Sword/Silver,/obj/weapon/Sword/Ancient,/obj/weapon/Sword/Slumber,/obj/weapon/Spear/Wind,/obj/weapon/Katana/Katana,/obj/weapon/Axe/Dwarf,/obj/weapon/Claw/Charm,/obj/weapon/Claw/Poison,/obj/weapon/Wrench/Silver)
WeaponShop5/contents = newlist(/obj/weapon/Knife/MageMash,/obj/weapon/Whip/Blitz,/*/obj/weapon/Bow/ElvenBow,*//obj/weapon/Harp/Rune,/obj/weapon/Rod/Thunder,/obj/weapon/Staff/Lunar)
WeaponShop6/contents = newlist(/obj/weapon/Knife/Breaker,/obj/weapon/Sword/Flame,/obj/weapon/Spear/Fire,/obj/weapon/Katana/Ninja,/obj/weapon/Claw/Cat,/obj/weapon/Whip/Flame,/obj/weapon/Wrench/Scorch,/*/obj/weapon/Bow/FireBow,*//obj/weapon/Harp/FireHarp,/obj/weapon/Rod/Charm,/obj/weapon/Staff/Silence)
WeaponShop7/contents = newlist(/obj/weapon/Sword/IceBrand,/obj/weapon/Spear/Blizzard,/obj/weapon/Katana/Kotetsu,/obj/weapon/Axe/Ogre,/obj/weapon/Whip/Ice,/*/obj/weapon/Bow/IceBow,*//obj/weapon/Harp/IceHarp,/obj/weapon/Rod/Wizard,/obj/weapon/Staff/Wizard)
WeaponShop8/contents = newlist(/obj/weapon/Spear/Iron,/obj/weapon/Wrench/Iron)/*All Iron*/
WeaponShop9/contents = newlist(/obj/weapon/Knife/Mythril,/obj/weapon/Knife/Silver,/obj/weapon/Sword/Mythril,/obj/weapon/Sword/Silver,/obj/weapon/Spear/Mythril,/obj/weapon/Wrench/Mythril,/obj/weapon/Wrench/Silver,/obj/weapon/Staff/Silver)/*All Mythril or silver*/
WeaponShop10/contents = newlist(/obj/weapon/Sword/Drain,/obj/weapon/Sword/Diamond,/obj/weapon/Spear/Drain,/obj/weapon/Spear/Diamond,/obj/weapon/Katana/Tempest,/obj/weapon/Claw/Sylph,/obj/weapon/Whip/Diamond,/obj/weapon/Wrench/Earth,/*/obj/weapon/Bow/LitBow,*//obj/weapon/Harp/Apollo,/obj/weapon/Rod/Poison,/obj/weapon/Staff/White)
WeaponShop11/contents = newlist(/obj/weapon/Knife/Dancing,/obj/weapon/Sword/Blood,/obj/weapon/Sword/Darkness,/obj/weapon/Sword/Defense,/obj/weapon/Spear/Gungnir,/obj/weapon/Katana/Kusanagi,/obj/weapon/Axe/Runeaxe,/obj/weapon/Claw/Hell,/obj/weapon/Wrench/White,/*/obj/weapon/Bow/DarkBow,*//obj/weapon/Harp/Tinker,/obj/weapon/Rod/Dragon,/obj/weapon/Staff/Zeus)
WeaponShop12/contents = newlist(/obj/weapon/Knife/Assassin,/obj/weapon/Sword/Death,/obj/weapon/Sword/Excalibur,/obj/weapon/Spear/Dragoon,/obj/weapon/Katana/Ichimangi,/obj/weapon/Claw/Kaiser,/obj/weapon/Whip/Dragon,/obj/weapon/Wrench/Black,/*/obj/weapon/Bow/Samurai,*//obj/weapon/Harp/Death,/obj/weapon/Rod/Stardust,/obj/weapon/Staff/Sage)
ArmorShop1/contents = newlist(/obj/shield/Leather,/obj/helmet/Cap,/obj/helmet/Leather,/obj/armor/Robe/Cloth,/obj/armor/Robe/Prisoner,/obj/armor/Robe/Bard,/obj/armor/Robe/Leather,/obj/arm/Glove/Leather)
ArmorShop2/contents = newlist(/obj/shield/Iron,/obj/shield/Shadow,/obj/helmet/Iron,/obj/helmet/Shadow,/obj/armor/Armor/Iron,/obj/armor/Armor/Shadow,/obj/arm/Glove/Iron,/obj/arm/Glove/Shadow,/obj/arm/Ring/Iron,/obj/arm/Ring/Ruby)
ArmorShop3/contents = newlist(/obj/shield/Black,/obj/shield/Paladin,/obj/helmet/Black,/obj/helmet/Paladin,/obj/helmet/Gaea,/obj/armor/Armor/Black,/obj/armor/Armor/Paladin,/obj/armor/Robe/Gaea,/obj/armor/Robe/Karate,/obj/arm/Glove/Black,/obj/arm/Glove/Paladin,/obj/arm/Ring/Silver)
ArmorShop4/contents = newlist(/obj/shield/Silver,/obj/helmet/Silver,/obj/helmet/Headband,/obj/helmet/Bandana,/obj/armor/Armor/Silver,/obj/armor/Robe/BlBelt,/obj/arm/Glove/Silver,/obj/arm/Ring/Strength)
ArmorShop5/contents = newlist(/obj/helmet/Wizard,/obj/armor/Robe/Wizard,/obj/arm/Ring/Rune)
ArmorShop6/contents = newlist(/obj/shield/Fire,/obj/helmet/Diamond,/obj/helmet/Tiara,/obj/armor/Armor/Fire,/obj/armor/Robe/Power,/obj/armor/Robe/Sorceror,/obj/arm/Glove/Diamond,/obj/arm/Ring/Diamond)
ArmorShop7/contents = newlist(/obj/shield/Ice,/obj/helmet/Diamond,/obj/helmet/Tiara,/obj/armor/Armor/Ice,/obj/armor/Robe/Ninja,/obj/arm/Glove/Diamond,/obj/arm/Ring/Diamond)
ArmorShop8/contents = newlist(/obj/shield/Iron,/obj/helmet/Iron,/obj/armor/Armor/Iron,/obj/arm/Glove/Iron)//All Iron
ArmorShop9/contents = newlist(/obj/shield/Silver,/obj/helmet/Silver,/obj/armor/Armor/Silver,/obj/arm/Glove/Silver,/obj/arm/Ring/Silver)//All Mythril or Silver
ArmorShop10/contents = newlist(/obj/shield/Diamond,/obj/helmet/Diamond,/obj/helmet/Tiara,/obj/armor/Armor/Diamond,/obj/armor/Robe/White,/obj/armor/Robe/Black,/obj/arm/Glove/Diamond,/obj/arm/Ring/Diamond)
ArmorShop11/contents = newlist(/obj/shield/Samurai,/obj/helmet/Samurai,/obj/helmet/Tiara,/obj/armor/Armor/Samurai,/obj/armor/Robe/Ninja,/obj/armor/Robe/White,/obj/armor/Robe/Black,/obj/arm/Glove/Samurai,/obj/arm/Ring/Diamond)
ArmorShop12/contents = newlist(/obj/shield/Aegis,/obj/shield/Samurai,/obj/helmet/Tiara,/obj/helmet/Ninja,/obj/armor/Armor/Samurai,/obj/armor/Robe/White,/obj/armor/Robe/Black,/obj/arm/Glove/Samurai,/obj/arm/Ring/Diamond)
BaronClanWeaponShop/contents = newlist()
BaronClanArmorShop/contents = newlist()
LegacyClanWeaponShop/contents = newlist()
LegacyClanArmorShop/contents = newlist()
TroiaClanWeaponShop/contents = newlist()
TroiaClanArmorShop/contents = newlist()
EblanClanWeaponShop/contents = newlist()
EblanClanArmorShop/contents = newlist()
FabulClanWeaponShop/contents = newlist()
FabulClanArmorShop/contents = newlist()
DamycanClanWeaponShop/contents = newlist()
DamycanClanArmorShop/contents = newlist()
DwarfClanWeaponShop/contents = newlist()
DwarfClanArmorShop/contents = newlist()
var/const/max_name_character=16
var/const/inventory_size=20
mob/PC/var/tmp/obj/shopitem
mob/PC/proc/shop(var/action, var/obj/item, var/num)
switch(action)
if("buy")
var/cost = item.value
if(num) cost*=num
if(cost>gold){src<<"Not enough gold!";return}
gold-=cost
if(istype(item,/obj/Ability/Basic/Item))
var/obj/Ability/Basic/Item/O = locate(item.type) in src.contents
if(O) O.suffix="[(text2num(O.suffix)) + num]"
else {var/obj/Ability/Basic/Item/buy=new item.type;src.contents+=buy;buy.suffix="[num]"}
else src.contents+=new item.type
if(inmenu=="shopbuynum")
close_screen("shopbuynum_price")
close_screen("shopbuynum_numbox")
close_screen("shopbuynum")
menupos=1
curser.screen_loc="2,11:8"
// thank you screen
inmenu="shop_thanks"
screen_background(6,12,8,9,0,0,11,"shop_thanks")
screen_textl(7,12,8.5,8.5,0,0,12,,"Thank you.","shop_thanks")
if("sell")
gold+=round((item.value*num)/2)
if(istype(item,/obj/Ability/Basic/Item))
var/numitem = text2num(item.suffix)
numitem-=num
if(numitem<1) del(item)
else item.suffix="[numitem]"
else del(item)
close_screen("shopsellnum_price")
close_screen("shopsellnum_numbox")
close_screen("shopsellnum")
menupos=1
curser.screen_loc="2,11:8"
inmenu="shopsell"
shop_screen("shopsell_refresh")
src<<SOUND_CASH
// refresh gold panel
for(var/obj/onscreen/text/O in client.screen) if(O.screentag=="shop_gold") del(O)
screen_textr(10.5,16,13.5,13.5,0,0,12,,"[num2text(gold,10)]GP","shop_gold")
mob/proc
namingway(mob/p,screen)
inmenu="character_name"
//namingway's portait
screen_portrait(2,15,0,0,3,'mob/npc/namingway.dmi',"character_name")
//namingway's text
screen_background(5,16,15,16,0,0,3,"character_name_text")
screen_textl(6,16,15.5,15.5,0,0,4,,"Name your character.","character_name_text")
//character's portrait
screen_portrait(14,12,16,16,3,p.icon,"character_name")
//character's name
screen_background(4,13,12,13,0,0,3,"character_name_input")
screen_textl(5,13,12.5,12.5,0,0,4,,p.name,"character_name_input")
//controllable panel
screen_background(4,15,3,11,0,0,3,"character_name")
screen_textl(5,10,10.5,10.5,0,0,4,,"A B C D E","character_name")
screen_textl(10.5,15,10.5,10.5,0,0,4,,"a b c d e","character_name")
screen_textl(5,10,9.5,9.5,0,0,4,,"F G H I J","character_name")
screen_textl(10.5,15,9.5,9.5,0,0,4,,"f g h i j","character_name")
screen_textl(5,10,8.5,8.5,0,0,4,,"K L M N O","character_name")
screen_textl(10.5,15,8.5,8.5,0,0,4,,"k l m n o","character_name")
screen_textl(5,10,7.5,7.5,0,0,4,,"P Q R S T","character_name")
screen_textl(10.5,15,7.5,7.5,0,0,4,,"p q r s t","character_name")
screen_textl(5,10,6.5,6.5,0,0,4,,"U V W X Y","character_name")
screen_textl(10.5,15,6.5,6.5,0,0,4,,"u v w x y","character_name")
screen_textl(5,10,5.5,5.5,0,0,4,,"Z 0 1 2 3","character_name")
screen_textl(10.5,15,5.5,5.5,0,0,4,,"z ! ? % /","character_name")
screen_textl(5,10,4.5,4.5,0,0,4,,"4 5 6 7 8","character_name")
screen_textl(10.5,15,4.5,4.5,0,0,4,,": SPC","character_name")
screen_textl(5,9,3.5,3.5,0,0,4,,"9 ' . -","character_name")
screen_textl(10.5,12.5,3.5,3.5,0,0,4,,"BACK","character_name")
screen_textl(13.5,15,3.5,3.5,0,0,4,,"END","character_name")
menulist=list("A","B","C","D","E","a","b","c","d","e","F","G","H","I","J","f","g","h","i","j","K","L","M","N","O","k","l","m","n","o","P","Q","R","S","T","p","q","r","s","t","U","V","W","X","Y","u","v","w","x","y","Z","0","1","2","3","z","!","?","%","/","4","5","6","7","8",":"," ","9","'",".","-")
menuanswer=null
menupos=1
if(!curser) curser = new(client)
curser.screen_loc="4,10:12"
input_box = p.name
menuaction = p.name
//then, waiting for the user to enter its name.
while(!menuanswer) sleep(2)
close_screen("character_name_text")
close_screen("character_name_input")
close_screen("character_name")
del(curser)
inmenu=screen
return menuanswer
namingway_refresh(dflt_name)
for(var/obj/onscreen/text/O in client.screen) if(O.screentag == "character_name_input") del(O)
screen_textl(5,13,12.5,12.5,0,0,4,,dflt_name,"character_name_input")
mob/PC/proc/trade_screen(var/screen,var/PC/mob/trade)
if(screen=="trade")
inmenu="trade"
menulist = new()
menulist=src.contents
curser.screen_loc="10,14:24"
screen_background(1,9,3,17,0,0,7,"trade") //my inventory
screen_background(1,9,1,2,0,0,7,"trade") //my GP
screen_textr(1,9,1.5,1.5,0,0,8,,"[num2text(gold,10)] GP","trade")
screen_background(10,17,16,17,0,0,7,"trade") //to give
screen_textl(10,17,16.5,16.5,16,10,8,,"To Give","trade")
screen_textl(10,17,16.5,16.5,16,-10,8,,"[src.name]","trade")
screen_background(10,17,11,15,0,0,7,"trade") //what i give
screen_textr(10,17,11,11,0,10,8,,"0 GP","trade")
screen_background(10,17,8,10,0,0,7,"trade") //what i give
screen_textl(12,17,9,9,10,0,8,2,"Accept","trade")
screen_background(10,17,6,7,0,0,7,"trade")
screen_textl(10,17,6.5,6.5,16,10,8,,"[src.name]'s","trade")
screen_textl(10,17,6.5,6.5,16,-10,8,,"Giving You","trade")
screen_background(10,17,1,5,0,0,7,"trade") //what i take
screen_textr(10,17,1,1,0,10,8,,"0 GP","trade")
var/itemslot=0
var/turf/T = loc
for(var/obj/O in src.contents)
itemslot++
var/Color
if(istype(O,/obj/Ability/Basic/Item) && (!O:CanUse || O:CanUse == 2 || (O:CanUse == 3&&T.worldmap))) Color=0
else if(istype(O,/obj/Key_Item)) Color=1
else Color=2
switch(itemslot)
if(1)
screen_invicon(2,16.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,16.5,16.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,16.5,16.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,16.5,16.5,0,0,8,Color,O.suffix,"trade")
if(2)
screen_invicon(2,15.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,15.5,15.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,15.5,15.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,15.5,15.5,0,0,8,Color,O.suffix,"trade")
if(3)
screen_invicon(2,14.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,14.5,14.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,14.5,14.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,14.5,14.5,0,0,8,Color,O.suffix,"trade")
if(4)
screen_invicon(2,13.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,13.5,13.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,13.5,13.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,13.5,13.5,0,0,8,Color,O.suffix,"trade")
if(5)
screen_invicon(2,12.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,12.5,12.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,12.5,12.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,12.5,12.5,0,0,8,Color,O.suffix,"trade")
if(6)
screen_invicon(2,11.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,11.5,11.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,11.5,11.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,11.5,11.5,0,0,8,Color,O.suffix,"trade")
if(7)
screen_invicon(2,10.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,10.5,10.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,10.5,10.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,10.5,10.5,0,0,8,Color,O.suffix,"trade")
if(8)
screen_invicon(2,9.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,9.5,9.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,9.5,9.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,9.5,9.5,0,0,8,Color,O.suffix,"trade")
if(9)
screen_invicon(2,8.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,8.5,8.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,8.5,8.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,8.5,8.5,0,0,8,Color,O.suffix,"trade")
if(10)
screen_invicon(2,7.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,7.5,7.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,7.5,7.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,7.5,7.5,0,0,8,Color,O.suffix,"trade")
if(11)
screen_invicon(2,6.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,6.5,6.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,6.5,6.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,6.5,6.5,0,0,8,Color,O.suffix,"trade")
if(12)
screen_invicon(2,5.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,5.5,5.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,5.5,5.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,5.5,5.5,0,0,8,Color,O.suffix,"trade")
if(13)
screen_invicon(2,4.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,4.5,4.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,4.5,4.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,4.5,4.5,0,0,8,Color,O.suffix,"trade")
if(14)
screen_invicon(2,3.5,0,8,Color,O.invicon,"trade")
screen_textl(2.5,7.5,3.5,3.5,0,0,8,Color,O.name,"trade")
if(istype(O,/obj/Ability/Basic/))
screen_textl(7.5,8,3.5,3.5,0,0,8,Color,":","trade")
screen_textr(7.5,8.5,3.5,3.5,0,0,8,Color,O.suffix,"trade")
if(15)
screen_textl(9,9,3,3,0,0,8,,">","trade")
mob/PC/proc/shop_screen(var/screen,var/mob/shop)
if(screen=="shop")
inmenu="shop"
menulist = new()
menulist=shop.contents
// shop title panel
screen_background(2,7,15,16,0,0,4,"shoptitle")
screen_textl(2,6,15,15,14,10,5,,shop.name,"shoptitle")
//message panel
screen_background(6,16,15,16,0,0,5,"shopmessage")
screen_textl(7,16,15,15,0,10,6,,"May I help you?","shopmessage")
//selection panel
screen_background(2,10,13,14,0,0,5,"shop")
screen_textl(3,5,13,13,0,16,6,,"Buy","shop")
screen_textl(5,7,13,13,16,16,6,,"Sell","shop")
screen_textl(8,10,13,13,16,16,6,,"Exit","shop")
// gold panel
screen_background(11,16,13,14,-8,0,4,"shop_gold")
screen_textr(11,16,13,13,0,16,5,,"[num2text(gold,10)]GP","shop_gold")
// party panel
screen_background(14,17,6,12,0,0,5,"shop_party")
var/mob/PC/p
p = party[1]
screen_player(14,11,10,-10,6,p.icon,"battle_walk","shop_party")
if(length(party)>=2)
p = party[2]
screen_player(16,10,-10,-10,6,p.icon,"battle_walk","shop_party")
if(length(party)>=3)
p = party[3]
screen_player(14,9,10,-10,6,p.icon,"battle_walk","shop_party")
if(length(party)>=4)
p = party[4]
screen_player(16,8,-10,-10,6,p.icon,"battle_walk","shop_party")
if(length(party)>=5)
p = party[5]
screen_player(14,7,10,-10,6,p.icon,"battle_walk","shop_party")
menupos=1
curser=new(client)
curser.screen_loc="2,13:8"
else if(screen=="shopbuy"&&!shop)
inmenu="shopbuy"
for(var/obj/onscreen/text/O in client.screen) if(O.screentag=="shopmessage") del O
screen_textl(7,16,15,15,0,10,6,,"Which one?","shopmessage")
screen_background(2,13,2,12,0,0,6,"shopbuy")
shop_screen("shopbuy",1)
menupos=1
curser.screen_loc="2,11:8"
else if(screen=="shopbuy"&&shop)
for(var/obj/onscreen/text/S in client.screen) if(S.screentag=="shopbuy") del S
for(var/obj/onscreen/invicon/S in client.screen) if(S.screentag=="shopbuy") del S
menuaction=shop
var/list/wares = new()
for(var/obj/O in menulist) if(istype(O,/obj/Ability/Basic/Item)||(class in O.equip)) wares+=O
menulist=wares
wares=null
if(!length(menulist))
inmenu="shopmessage"
for(var/obj/onscreen/text/S in client.screen) if(S.screentag=="shopmessage") del S
screen_textl(7,16,15,15,0,10,6,,"Nothing to buy!","shopmessage")
spawn(20)
for(var/obj/onscreen/text/S in client.screen) if(S.screentag=="shopmessage") del S
screen_textl(7,16,15,15,0,10,6,,"May I help you?","shopmessage")
close_screen("shopbuy")
menupos=1
curser.screen_loc="2,13:8"
inmenu="shop"
var/wareslot=0
for(var/i=menuaction,i<=menuaction+10,i++)
var/obj/O
if(length(menulist)>=i)
O = menulist[i]
wareslot++
switch(wareslot)
if(1)
screen_invicon(3,11.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,11.5,11.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,11.5,11.5,0,0,8,,"[O.value]GP","shopbuy")
if(2)
screen_invicon(3,10.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,10.5,10.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,10.5,10.5,0,0,8,,"[O.value]GP","shopbuy")
if(3)
screen_invicon(3,9.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,9.5,9.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,9.5,9.5,0,0,8,,"[O.value]GP","shopbuy")
if(4)
screen_invicon(3,8.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,8.5,8.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,8.5,8.5,0,0,8,,"[O.value]GP","shopbuy")
if(5)
screen_invicon(3,7.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,7.5,7.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,7.5,7.5,0,0,8,,"[O.value]GP","shopbuy")
if(6)
screen_invicon(3,6.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,6.5,6.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,6.5,6.5,0,0,8,,"[O.value]GP","shopbuy")
if(7)
screen_invicon(3,5.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,5.5,5.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,5.5,5.5,0,0,8,,"[O.value]GP","shopbuy")
if(8)
screen_invicon(3,4.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,4.5,4.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,4.5,4.5,0,0,8,,"[O.value]GP","shopbuy")
if(9)
screen_invicon(3,3.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,3.5,3.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,3.5,3.5,0,0,8,,"[O.value]GP","shopbuy")
if(10)
screen_invicon(3,2.5,0,8,,O.invicon,"shopbuy")
screen_textl(3.5,7.5,2.5,2.5,0,0,8,,O.name,"shopbuy")
screen_textr(7,11.5,2.5,2.5,0,0,8,,"[O.value]GP","shopbuy")
if(menuaction>1) screen_textl(2.5,2,2,2,0,0,8,,"<","shopbuy")
if(length(menulist)>=menuaction+10) screen_textl(12,2,2,2,0,0,8,,">","shopbuy")
else if(screen=="shopbuynum"&&shop)
input_box = 1
shopitem = shop
inmenu="shopbuynum"
screen_background(6,11,7,11,0,0,9,"shopbuynum")
screen_invicon(6.5,10.5,0,10,,shopitem.invicon,"shopbuynum")
screen_textl(7,11,10.5,10.5,0,0,10,,shopitem.name,"shopbuynum")
screen_textl(9,9.5,9.5,9.5,0,0,10,,"x","shopbuynum")
screen_textl(7,10,8.5,8.5,0,0,10,,"That's","shopbuynum")
menupos=1
curser.screen_loc="9:16,9:8"
shop_screen("shopbuynum_refresh")
else if(screen=="shopbuynum_refresh")
for(var/obj/onscreen/text/O in client.screen) if(O.screentag=="shopbuynum_numbox"||O.screentag=="shopbuynum_price") del(O)
screen_textr(10,11,9.5,9.5,0,0,10,,"[input_box]","shopbuynum_numbox")
screen_textr(6.5,11,7.5,7.5,0,0,10,,"[shopitem.value*input_box]GP","shopbuynum_price")
else if(screen=="shopsell")
inmenu="shopsell"
screen_background(2,16,2,12,0,0,9,"shopsell")
for(var/obj/onscreen/text/O in client.screen) if(O.screentag=="shopmessage") del O
screen_textl(8,16,15.5,15.5,0,0,10,,"Which one?","shopmessage")
shop_screen("shopsell_refresh")
menupos=1
curser.screen_loc="2,11:8"
else if(screen=="shopsell_refresh")
var/itemslot=0
for(var/obj/onscreen/text/S in client.screen) if(S.screentag=="shopsell") del S
for(var/obj/onscreen/invicon/S in client.screen) if(S.screentag=="shopsell") del S
for(var/obj/O in src.contents)
itemslot++
var/color=0
if(istype(O,/obj/Key_Item)) color=1
else if(O.suffix=="Equipped") color=2
switch(itemslot)
if(1)
screen_invicon(3,11.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,11.5,11.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,11.5,11.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,11.5,11.5,0,0,11,color,O.suffix,"shopsell")
if(2)
screen_invicon(10,11.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,11.5,11.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,11.5,11.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,11.5,11.5,0,0,11,color,O.suffix,"shopsell")
if(3)
screen_invicon(3,10.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,10.5,10.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,10.5,10.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,10.5,10.5,0,0,11,color,O.suffix,"shopsell")
if(4)
screen_invicon(10,10.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,10.5,10.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,10.5,10.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,10.5,10.5,0,0,11,color,O.suffix,"shopsell")
if(5)
screen_invicon(3,9.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,9.5,9.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,9.5,9.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,9.5,9.5,0,0,11,color,O.suffix,"shopsell")
if(6)
screen_invicon(10,9.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,9.5,9.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,9.5,9.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,9.5,9.5,0,0,11,color,O.suffix,"shopsell")
if(7)
screen_invicon(3,8.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,8.5,8.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,8.5,8.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,8.5,8.5,0,0,11,color,O.suffix,"shopsell")
if(8)
screen_invicon(10,8.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,8.5,8.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,8.5,8.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,8.5,8.5,0,0,11,color,O.suffix,"shopsell")
if(9)
screen_invicon(3,7.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,7.5,7.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,7.5,7.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,7.5,7.5,0,0,11,color,O.suffix,"shopsell")
if(10)
screen_invicon(10,7.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,7.5,7.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,7.5,7.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,7.5,7.5,0,0,11,color,O.suffix,"shopsell")
if(11)
screen_invicon(3,6.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,6.5,6.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,6.5,6.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,6.5,6.5,0,0,11,color,O.suffix,"shopsell")
if(12)
screen_invicon(10,6.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,6.5,6.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,6.5,6.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,6.5,6.5,0,0,11,color,O.suffix,"shopsell")
if(13)
screen_invicon(3,5.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,5.5,5.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,5.5,5.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,5.5,5.5,0,0,11,color,O.suffix,"shopsell")
if(14)
screen_invicon(10,5.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,5.5,5.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,5.5,5.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,5.5,5.5,0,0,11,color,O.suffix,"shopsell")
if(15)
screen_invicon(3,4.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,4.5,4.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,4.5,4.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,4.5,4.5,0,0,11,color,O.suffix,"shopsell")
if(16)
screen_invicon(10,4.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,4.5,4.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,4.5,4.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,4.5,4.5,0,0,11,color,O.suffix,"shopsell")
if(17)
screen_invicon(3,3.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,3.5,3.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,3.5,3.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,3.5,3.5,0,0,11,color,O.suffix,"shopsell")
if(18)
screen_invicon(10,3.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,3.5,3.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,3.5,3.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,3.5,3.5,0,0,11,color,O.suffix,"shopsell")
if(19)
screen_invicon(3,2.5,0,11,color,O.invicon,"shopsell")
screen_textl(3.5,7.5,2.5,2.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(7.5,8,2.5,2.5,0,0,11,color,":","shopsell")
screen_textr(7.5,8.5,2.5,2.5,0,0,11,color,O.suffix,"shopsell")
if(20)
screen_invicon(10,2.5,0,11,color,O.invicon,"shopsell")
screen_textl(10.5,14.5,2.5,2.5,0,0,11,color,O.name,"shopsell")
if(istype(O,/obj/Ability/Basic/Item))
screen_textl(14.5,15,2.5,2.5,0,0,11,color,":","shopsell")
screen_textr(14.5,15.5,2.5,2.5,0,0,11,color,O.suffix,"shopsell")
else if(screen=="shopsellnum"&&shop)
input_box = 1
shopitem = shop
inmenu="shopsellnum"
screen_background(6,11,7,11,0,0,12,"shopsellnum")
screen_invicon(6.5,10.5,0,13,,shopitem.invicon,"shopsellnum")
screen_textl(7,11,10.5,10.5,0,0,13,,shopitem.name,"shopsellnum")
if(istype(shopitem,/obj/Ability/Basic/Item)) screen_textl(9,9.5,9.5,9.5,0,0,13,,"x","shopsellnum")
screen_textl(7,10,8.5,8.5,0,0,13,,"That's","shopsellnum")
menupos=1
if(istype(shopitem,/obj/Ability/Basic/Item)) curser.screen_loc="9:16,9:8"
else curser.screen_loc="2,11:8"
shop_screen("shopsellnum_refresh")
else if(screen=="shopsellnum_refresh")
for(var/obj/onscreen/text/O in client.screen) if(O.screentag=="shopsellnum_numbox"||O.screentag=="shopsellnum_price") del(O)
if(istype(shopitem,/obj/Ability/Basic/Item)) screen_textr(10,11,9.5,9.5,0,0,13,,"[input_box]","shopsellnum_numbox")
screen_textr(6.5,11,7.5,7.5,0,0,13,,"[(shopitem.value*input_box)/2]GP","shopsellnum_price")