-
Notifications
You must be signed in to change notification settings - Fork 13
/
MUD5.BCL
2072 lines (2067 loc) · 62.8 KB
/
MUD5.BCL
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
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright (C) 1980 by
Roy Trubshaw & Richard Bartle,
Essex University, Colchester. CO4 3SQ.
This software is furnished on the understanding that
it may be used and or copied only with the inclusion of this
notice. No title or ownership of this software is hereby
transferred. The information in this software is subject to
change without notice. No responsibility is assumed for the
use or reliability of this software.
Released by Richard Bartle exclusively for not for profit use
18 May 2020
*/
get "mudlib"
get "dungen"
let special(sftype) be
$( let cn,nd,nm,l=0,?,?,?
switchon sftype into
$( case SF.TELL: //Tell
if dumb error("You can't tell anyone anything, you're dumb.")
if PTYPE of objct=S.LEVEL
$( ch.sendlevel(objct)
endcase
$)
interact(I.TELL)
endcase
case SF.SAY: //Say
if dumb error("You can't say anything, you're dumb.")
out("*':s*'*C*L",objname)
endcase
case SF.FLUSH:
flush()
endcase
case SF.GET: //Get
test PTYPE of instrmnt=S.PLAYER then
$( swapobjins()
interact(I.STEAL)
swapobjins()
$) or switchon PTYPE of objct into
$( case S.OBJECT:
gett()
endcase
case S.ALL:
test RELAXED/\WIZARD of profile=1/\(spectacular=0\/(spectacular ne 0/\maint)) then get.all() or
test spectacular/\(WIZARD of profile=0) then Error("Not during a spectacular!") or
$( let newnd,nd,portal,gotone,all=?,?,DOOR+place(room),false,objct
unless A.HIDEAWAY bitand ATTRIB of room
$( lockup(@nd,@newnd)
while nd do
$( newnd_LINK of nd
unless FIXED of nd ne 0\/NOGET of nd ne 0\/(DESTROYED of nd ls 0) //the ne 0's are needed
$( objct_find.word(PNAME of nd)
objname_PNAME of objct
unlock()
action()
gotone_true
lock(portal)
$)
nd_newnd //2 simultaneous get alls will cause trouble...
$)
unlock()
$)
unless gotone error("Nothing taken.")
objct_all
objname_PNAME of objct //needed?
$)
endcase
case S.CLASS:
get.class()
endcase
case S.PLAYER:
interact(I.STEAL)
default:
error("I don't know what :s means.",objname)
$)
endcase
case SF.KEEP:
$( let val=?
test PTYPE of objct=S.OBJECT then
val_(D1 of DREC of objct)<<18\/objname or
test PTYPE of objct=S.CLASS /\ valof
$( val_toting.class(P1 of objct)
resultis val
$) then val_(PTYPE of val)<<18\/(PNAME of val)
or error("You can only keep hold of objects.")
if val=kept out("You're already keeping :s.*C*L",objname)<>endcase
if kept /\ toting(LH from kept) out("Stopped keeping :s. ", kept)
out("Keeping :s.*C*L", objname)
kept_val
endcase
$)
case SF.UNKEEP:
test kept then
$( out(":U unkept.*C*L", kept)
kept_0
$) or outs("You aren't keeping anything anyway!*C*L")
endcase
case SF.DROP: //Drop
test PTYPE of instrmnt=S.PLAYER then
$( swapobjins()
interact(I.GIVE)
swapobjins()
$) or
switchon PTYPE of objct into
$( case S.OBJECT:
drop()
endcase
case S.ALL:
test RELAXED/\WIZARD of profile=1/\(spectacular=0\/(spectacular ne 0/\maint)) then drop.everything(true) or
$( let all=objct
and ptr=carry
objname_PNAME of objct
unless carry error("You aren't carrying anything!")
while ptr test PTYPE of ptr=LH from kept then
$( out(":U kept.*C*L", PNAME of ptr)
ptr of_LINK
$) or
$( let nd=LINK of ptr
objct_find.word(PNAME of ptr)
action()
ptr_nd
$)
objct_all
objname_PNAME of objct //needed?
$)
endcase
case S.CLASS:
drop.class()
endcase
case S.PLAYER:
interact(I.GIVE)
endcase
default:
error("I don't know what :s means.",objname)
$)
endcase
case SF.BYE:
checkforced()
test RELAXED then Quit(true) or quit()
endcase
case SF.SGO:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( unless us(me) then error()
unless WIZARD of profile Error()
$( let game=Sixbit(objname)
scanner()
quit(PNAME of scan.info,game)
$)
endcase
$)
CASE SF.KILL: case SF.PROVOKE:
if peace test sftype=SF.PROVOKE then Jump(mainloop) or Error("Fighting is currently forbidden.")
test PTYPE of objct = S.PLAYER then interact(I.KILL) or
$( let obj, tipe, watchers,wiz=?, PTYPE of objct, 0,who.copy
unless tipe=S.OBJECT\/tipe=S.CLASS error(":U is not a player.", objname)
obj_tipe=S.CLASS-> PTYPE of valof
$( let v=here.or.toting.class(P1 of objct)
unless v error("You can't :s that!", verbname)
resultis v
$), D1 of DREC of objct
obj_here.or.toting(obj)
test sftype=SF.KILL then
$( unless objct ne fake error("To use the verb :p you have to give someone's name!", verbname)
unless DESTROYED of obj gr 0 error("You can't :s that!", verbname)
if fight!player.no=obj error("You're already fighting the :s!", objname)
if fight!player.no error("You can't fight more than one non-player at once!")
$) or
$( if fight!player.no ne 0\/obj=0 jump(mainloop)
out("You are attacked by the :p!*C*L",objname)
$)
quitflg_false
if MOTN of obj
$( FIGHTS of MOTN of obj bitor_player.bit
watchers_SNOOPERS of MOTN of obj
$)
fight!player.no_obj
for i=0 to 35 if player.names!i/\WIZARD of LH from player.names!i ne 0 wiz bitor_1<<i
sendall(wiz,sftype=SF.PROVOKE->K.MFM,K.IFM,false,false,objname)
test sftype=SF.KILL then
send(player.no, 0, WIZARD of profile->K.ISAHM,
DEXTERITY of profile gr 60->K.ISAHM, K.ISAMM, WIZARD of profile->10000, random((STRENGTH of profile)/F.DMGE1)+1)
or send(player.no, 0,WIZARD of profile\/random(100) le 40 -> K.ISAM,
K.ISAH,random((WEIGHT of obj)/1000/F.DMGE2)+1)
if watchers broadcast(K.SFO,watchers,obj)
$)
endcase
case SF.EXORCISE:
spcheck()
if us(objname) unless maint error("You haven't a ghost of a chance.")
exorcise()
endcase
case SF.QUIT: //Quit
checkforced()
quit()
endcase
case SF.EXITS:
$( let cnt, beendir, rm1, rm, trvtab
=0, 0, WIZARD of profile=1/\find.room(objname), (rm1->LH of rm1, room), TRAVEL of rm
if visible() until LH of trvtab=RHMASK do
$( switchon 1!trvtab->CONDTYPE of trvtab, 0 into
$(
case 2:
unless valof
$( let s,o,v,t=false,?,CONDVAL of trvtab,carrying(v,false,carry)
jar(rm+DOOR)
unless t s_is.or.was.here(v,ROBJT of rm)
o_t bitor s
while o
$( if P4 of o=0\/DESTROYED of o ls 0 unjar(rm+DOOR)<>resultis true
if t t_carrying(v,false,LINK of t)
unless t s_is.or.was.here(v,s->LINK of s,ROBJT of rm)
o_t bitor s
$)
unjar(rm+DOOR)
endcase
$) endcase
case 0 ... 1:
case 4:
case 7 ... 8:
$( let d, dir, rm=LH of trvtab, ?, RH of trvtab
if FORCED of rm rm of_FORCED
for i=1 to 18
if d bitand 1<<i /\ \beendir bitand 1<<i
$( dir_motvec!i
unless WIZARD of profile if ~(visible(rm))\/((A.DEATH bitor A.NOLOOK) bitand ATTRIB of rm) endcase
out(":S*T:C", dir, LENGTH of dir ge 7 ->'*0','*T')
if WIZARD of profile out(":6*T", !rm)
desc.short(rm)
cnt+_1
$)
beendir bitor_ d
$)
default 0 ... 10:
endcase
$)
trvtab+_2
$)
unless cnt Error("You don't see any exits.")
endcase
$)
case SF.ATTACH:
spcheck()
attach()
case SF.DETACH:
spcheck()
detach() //I hate these once-only-called procedures
case SF.PURGE:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( checkforced()
spcheck()
purge()
$)
endcase
case SF.SAVE:
checkforced()
spcheck()
if ATTED of profile Error("Not to an attached persona!")
unless WIZARD of profile if savescr=SCORE of profile
error("You haven't changed score since your last :s.",verbname)
save()
savescr_SCORE of profile
endcase
case SF.SCRE: //Score
$( let oldprof,pno=profile,player.no
if WIZARD of profile=1/\PTYPE of objct=S.PLAYER
$( person(objct)
pno_P1 of objct
profile_LH from player.names!(pno)
$)
out("Score to date: :n*C*L",SCORE of profile)
out("Level of experience: :p:s*C*L", (SEX of profile->female,male)!(player.level()), BZK/\BERSERK of profile->" & berserk", "")
out("Strength: :n*TStamina: :n*TDexterity: :n*TSex: :s*C*L",
STRENGTH of profile,new.stamina(pno),DEXTERITY of profile,SEX of profile->"female", "male")
out("Maximum stamina: :n*C*L",STAMINAMAX of profile)
out("Weight carried: :ng (max. weight: :ng)*C*L",CARRY.COUNT of profile, max.wt())
out("Objects carried: :n (max. number: :n)*C*L", OBJ.CARRIED of profile, max.obj())
out("Games played to date: :n*C*L",GAMES.PLAYED of profile)
profile_oldprof
endcase
$)
case SF.LOOK: //Look
test PTYPE of objct=S.MOTION then
test (WIZARD of profile=1)\/random(player.level()+2) then move(DREC of objct) or
error("You can't tell.") or
$( if PTYPE of objct=S.OBJECT\/PTYPE of objct=S.CLASS
$( let bag=object()
if bag/\CONTENTS of bag Sayinsides(bag,0,objname, true)<>endcase
$)
if WIZARD of profile
$( let l=find.room(objname)
if l describe(LH of l,true)<>endcase
$)
describe(room,true)
$)
endcase
case SF.MAP:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( unless essex error()
$( let rm,old=WIZARD of profile=1/\find.room(objname),logstr
rm_rm->LH of rm,room
unless visible() error(blind->"You can't see, you're blind.","The room is too dark to see anything.")
rm of_MAPWD
unless rm Error("The room is too difficult to map.")
logstr_0
dscribe(rm, mapput)
unless old endcase
logstr_old
old_snoopedon
snoopedon_0
writes(logstr,"*C*L(Maps are not printable).*C*L")
snoopedon_old
endcase
$)
$)
case SF.P: //Pretend to be doing something else
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( checkforced()
unless WIZARD of profile error()
for i=0 to 30 $[ $outstr $az " *C*L" $]
pretend_not pretend
if \snooping transmit(snooping,0,K.IWSS)<>snooping_true
if snobj SNOOPERS of MOTN of snobj bitand_\player.bit<>snobj_false
verb_0
endcase
$)
case SF.PRONOUNS:
outz($az "Pronouns are as follows:*C*L")
out("it*T:s*C*Lhim*T:u*C*Lher*T:u*C*Lthem*T:u*C*Lme*T:u*C*L",
it->it, "(not known)", him->him,"(not known)",
her->her, "(not known)", them->them, "(not known)", me)
if PTYPE of objct then unless objct=fake/\hidden(P1 of objct) out("Default object is :s*C*L", objname)
if instrmnt out("Default instrument is :s*C*L", insname)
if WIZARD of profile=1/\there out("there*T:F*C*L",there)
out("Last direction (for going back)*T:U*C*L", motvec!lastdir)
endcase
case SF.QOTE: //Quoted mode.
if dumb error("You can't do that, you're dumb.")
sendall(who.copy,K.TEXT,true,false,!verbname,verbname!1,
verbname!2,verbname!3,verbname!4,verbname!5,verbname!6,verbname!7,verbname!8,
verbname!9,verbname!10,verbname!11,verbname!12,verbname!13)
verb_0
objct_fake.node("that")
endcase
case SF.LAUGH:
if dumb error("You can't do that, you're dumb.")
test WIZARD of profile then
$( read.message(mbuffer)
sendall(who.copy,K.LAUGH,true,false,!mbuffer,mbuffer!1,
mbuffer!2,mbuffer!3,mbuffer!4,mbuffer!5,mbuffer!6,mbuffer!7,mbuffer!8,mbuffer!9,
mbuffer!10,mbuffer!11,mbuffer!12,mbuffer!13)
$)
or sendall(who.copy, K.LAUGH, true, false, 0)
reset()
endcase
case SF.BERSERK:
test BZK then
$( checkforced()
if demo error("Not during a demo - sorry!*C*L")
$( let pl=?
if BERSERK of profile error("You're already :s!", verbname)
pl_player.level()
if WIZARD of profile pl_max.level
if pl error("No :s can go :s!", (SEX of profile-> female, male)!pl, verbname)
$)
for i=0 to 35 if fight!i error("Not in the middle of a fight, chum!")
BERSERK of profile_true
out("*C*LWARNING: this will be permanent! You can't enter :s mode if*C*L", (SEX of profile-> female, male)!max.level)
outs("you go ahead. Still want to? ")
dormant()
unless valof
$[ $clrbfi
again: $inchrw ac
$clrbfi
$tro ac, #40
$cain ac, 'y'
$jrst does
$caie ac, 'n'
$jrst eh
$( unless ESSEX
$[ $outstr $az"*C*LN"
$]
$)
$outstr $az"o*C*L"
$( resultis false $)
does: $( unless ESSEX
$[ $outstr $az"*C*LY"
$]
$)
$outstr $az"es*C*L"
$( resultis true $)
eh: $outstr $az"*C*LEh? Yes or no? "
$jrst again
$]
$( alive()
BERSERK of profile_false
jump(mainloop)
$)
out("You are now :s!*C*L", verbname)
STRENGTH of profile+_10
DEXTERITY of profile-_10
normalise(STAMINAMAX, 100)
normalise(STAMINA, STAMINAMAX of profile)
normalise(STRENGTH, 100)
normalise(DEXTERITY, 90)
alive()
endcase
$) or error()
case SF.SHELVE:
case SF.UNSHELVE:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( unless us(PNAME of profile) error()
sftype_sftype=SF.SHELVE
unless PTYPE of objct=S.OBJECT Error("Only objects, please!")
$( let obj, nd, oldnd=
D1 of DREC of objct,sftype->carry,shelf,sftype->lvcarry,@shelf
until nd=0 \/LH of nd=obj
$( oldnd_nd
nd_LINK of nd
$)
unless nd error("Can't find it!")
LINK of oldnd_LINK of nd
test sftype then
$( ROBJT of profile_carry
CARRY.COUNT of profile-_WEIGHT of nd
OBJ.CARRIED of profile-_1
adjustdown(nd)
LINK of nd_shelf
shelf_nd
$) or
$( LINK of oldnd_LINK of nd
pushlist(lvcarry,nd)
ROBJT of profile_carry
CARRY.COUNT of profile+_WEIGHT of nd
OBJ.CARRIED of profile+_1
adjustup(nd)
$)
setit(nd)
Outs("The shelf contains ")
inventory(shelf, 0, true)
outz($az"*C*L")
$)
endcase
$)
case SF.BEGONE: case SF.PROOF:
$( let bits=true
unless us(PNAME of profile) error()
sftype_sftype=SF.BEGONE
read.message(mbuffer)
if PTYPE of objct=S.PLAYER
$( person(objct)
bits_1<<(P1 of objct)
$)
if sftype locked_true
sendall(bits,sftype->K.BGON,K.PIM,true,false,!mbuffer,mbuffer!1,
mbuffer!2,mbuffer!3,mbuffer!4,mbuffer!5,mbuffer!6,mbuffer!7,mbuffer!8,mbuffer!9,
mbuffer!10,mbuffer!11,mbuffer!12,mbuffer!13)
endcase
$)
case SF.NEWHOURS:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( unless WIZARD of profile=1/\maint error()
$( let day=(LH from ud.time()) rem 7
Out("*C*LNew hours (for today only)*C*L")
day_times!day
while day
$( let st, ft=STIME of day, FTIME of day
out(":N*T:N*C*L", st, ft)
out(":N -> ", st)
STIME of day_nextnum(st)
out(":N -> ", ft)
FTIME of day_nextnum(ft)
day of_LINK
$)
out("Min. no. of free jobs before allow play: :N -> ", low2)
low2_nextnum(low2)
out("Max. no. of free jobs before stop play: :N -> ",low1)
low1_nextnum(low1)
$)
endcase
$)
case SF.SPECTACULAR:
// test CORELOW then
// error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
// or
$( unless maint error()
test spectacular then
$( spectacular_false
locked_false
autowho_-1
if RELAXED special(SF.LOG)
Outz($az"*C*LSpectacular ended.*C*L")
$) or
$( let count, one=0, ?
spectacular_true
locked_true
if RELAXED special(SF.LOG)
autowho_autoint
peace_false
unless logstr special(SF.SPECLOG)
for i=0 to 35 if player.names!i unless WIZARD of LH from player.names!i count+_1
one_count=1
out("*C*LThere :S :N mortal:c playing.*C*L", one->"is","are",count,one->'*0','s')
$)
test chcnt>0 then
$( read.message(mbuffer)
cn_(LENGTH of mbuffer)/5
cn_cn>13->13,cn
$) or
$( !mbuffer_0
cn_0
$)
for i=0 to 35 do if player.no\=i/\player.names!i then
$( nd_getmblock()
copy(mbuffer,nd+2,cn)
send(i,nd,sftype=K.SPEC,nd!2)
$)
verb_0
endcase
$)
case SF.SHOUT:
if dumb error("You can't shout anything, you're dumb.")
cn_(LENGTH of verbname)/5
cn_cn>13->13,cn
for i=0 to 35 unless i=player.no if player.names!i
$( nd_getmblock()
copy(verbname, nd+2, cn)
send(i,nd,((who.copy bitand (1<<i))\/(WIZARD of profile))->K.BELW,K.DIST,nd!2)
$)
verb_0
objct_fake.node("that")
endcase
case SF.LOG:
unless RELAXED error()
if logstr then
$( close(logstr)
logstr_0
writes(tty,"Logging terminated.*C*L")
return
$)
case SF.SPECLOG:
writes(tty,"Logging commenced.*C*L")
$( let old.snoop=snoopedon
logstr_appendfile("dsk",me,"log",ppn,label(problem))
snoopedon_false
write(logstr,"*C*LLogging :s on :D at :T*C*L", @mudnam,
valof $[ $DATE AC, 0 $],
valof $[ $MSTIME AC, 0 $])
verb_0 //In case people press it twice by mistake
snoopedon_old.snoop
endcase
problem: writes(tty,"Problem with log file*C*L")
snoopedon_old.snoop
logstr_0
endcase
$)
case SF.INVN://Inven
test carry then
$( outz($az"You are currently holding the following:*C*L")
ccnt_0
inventory(carry, 0, true)
$) or outz($az"You aren't carrying anything!")
outz($az"*C*L")
endcase
case SF.FLEE:
if paralysed error("You can't :s, you're crippled.", verbname)
unless PTYPE of objct=S.MOTION error("Direction expected after :P",verbname)
verb_objct
objct_fake.node("that")
stop.fighting(true)
lose.followers()
move()
endcase
case SF.DBUG: //Debug mode!
spcheck()
scanch_-1
if seq(objname, "lock") test WIZARD of profile/\(RELAXED\/us(me)) then
$( locked_true
out("*C*LThe game is now locked.*C*L")
endcase
$) or error()
if seq(objname, "unlock") test WIZARD of profile/\(RELAXED\/us(me)) then
$( locked_false
out("*C*LThe game is now unlocked.*C*L")
endcase
$) or error()
unless seq(objname,"mode")
$( if dumb error("You can't use the :s command, you're dumb.",verbname)
ch.sendlevel(verb)
endcase
$)
if nowiz error("No.*C*L")
unless ISWIZ of profile ne 0 test realwiz(me) then ISWIZ of profile_true or
Error("This persona may not enter :s mode.",(SEX of profile->female,male)!max.level)
if BZK/\BERSERK of profile unless maint error("Not you, you're berserk!")
test WIZARD of profile then
$( WIZARD of profile_false
cccnt_CCTRIP*10
$) or
$( WIZARD of profile_true
if snoopedon then for i=0 to 35 do if (1<<i) bitand snoopedon do unless invisible(i)
out(":p is snooping on you!*C*L",player.names!i)
cccnt_CCTRIP
out("*CWelcome Oh :s!*C*L", SEX of profile -> "mistress", "master")
if BZK/\BERSERK of profile unless us(PNAME of profile) BERSERK of profile_false
$)
announcechange()
verb,objct_0,fake.node("that")
if chcnt>0 until scanner()=S.CONT do $(/*Nothing*/$)
endcase
case SF.PASSWORD:
checkforced()
$( let opret, one, two=pretend, ?, ?
if pwcnt error("You can only change passwords once per game - sorry!")
pwcnt+_1
pretend_true
private()
outs("What is your present password?*C*L**")
noecho()
check.stuff()
scanner()
one_PNAME of scan.info
one_encrypt(one)
unless one=ps.word
$( echo()
pretend_opret
public()
error("Sorry, incorrect.")
$)
out("*C*LNew password for persona - up to :N letters please.*C*L**",NAMELENGTH)
reset()
check.stuff()
scanner()
one_PNAME of scan.info
one_encrypt(one)
Outs("*C*LEnter it again to make sure it's correct, please.*C*L")
reset()
check.stuff()
scanner()
echo()
pretend_opret
public()
two_PNAME of scan.info
two_encrypt(two)
unless one=two error("No, they're different - password remains unchanged.")
ps.word_two
out("*C*LYour password will be updated when you leave the game.*C*L")
flush()
$)
endcase
case SF.HOURS:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( outz($az"*C*LOpening hours as follows:*C*L")
for i=0 to 6
$( let day=(i+4) rem 7
and ptr=times!day
out(":s*C*L", days!i)
test ptr then
while ptr
$( let s, f=STIME of ptr, FTIME of ptr
out("*T:C:N00 to :C:N00*C*L", s<10->'0','*0',s,f<10->'0','*0',f)
ptr of_LINK
$)
or outz("*T No access*C*L")
$)
if demo outz($az"A demonstration is in progress at the moment.*C*L")
endcase
$)
case SF.DEMO:
unless maint error("You need to be a maintainer.*C*L")
demo_not demo
out("The demonstration is :s in progress.*C*L", demo->"now", "no longer")
endcase
case SF.FREEZE:
spcheck()
melted_false
endcase
case SF.UNFREEZE:
spcheck()
melted_true
endcase
case SF.INVIS:
spcheck()
INVIS of profile_true
endcase
case SF.VIS:
INVIS of profile_false
endcase
case SF.PEACE:
spcheck()
peace_true
endcase
case SF.WAR:
spcheck()
peace_false
endcase
case SF.HUMBLE:
unless us(PNAME of profile) error()
unless nowiz sendall(true, K.GOWM,true,true)
nowiz_~nowiz
endcase
case SF.RESET:
$( let ok=maint/\WIZARD of profile ne 0
for i=0 to 35 if fight!i error("Not while you're fighting!")
unless ok
$( jar(@inidr)
if player
$( unjar(@inidr)
error("There is more than just you in this game so you can't reset it")
$)
$)
unless resetgame()
$( unless ok unjar(@inidr)
error("Sorry old bean, can't get at the .EXE file")
$)
if ok out("*C*LYou are now in a superseded game.*C*L")<>endcase
unjar(@inidr)
quit(mud6, !room)
$)
case SF.STAMINA:
unless WIZARD of profile Error()
$( let o1, mobile, container=object(),MOTN of o1, CONTENTS of o1
out("*C*LName*T*T:U*C*L",PNAME of o1)
if mobile
$( outs("Room*T*T")
test CURROOM of mobile then write6(tty,!(CURROOM of mobile)) or outs("(immobile)")
out("*C*Lmove every*T:N*Tcount*T*T:N*C*L",MOTION of mobile, MOVECOUNT of mobile)
$)
if container
$( let ptr=CONTS of container
outs(mobile->"carrying*T","contains*T")
test ptr then
$( while LINK of ptr
$( out(":U, ",PNAME of ptr)
ptr_LINK of ptr
$)
out(":U*C*L", PNAME of ptr)
$) or out("nothing*C*L")
out("max. contents*T:Ng*Tcontents used*T:Ng*C*L",
MAXWT of container,WTUSED of container)
$)
out("base value*T:N*Tcurrent value*T:N*Tweight*T*T:Ng*C*Lprop*T*T:N*Tscoreprop*T:N*C*Lstamina*T*T:N*C*L",
valof $( let v=VALUE of o1
$[ $hrre 1, v
$]
$), setexp(o1,true,true),WEIGHT of o1,P4 of o1,SCOREPROP of o1,DESTROYED of o1)
$)
endcase
case SF.DIAGNOSE:
$( let st, nam, ob=?, ?, false
test PTYPE of objct=S.PLAYER/\hidden(P1 of objct)=0 then
$( nam_player.names!(P1 of objct)
st_new.stamina(P1 of objct)
$) or
$( ob_object()
nam_PNAME of ob
st_DESTROYED of ob
$)
test st le 0/\ ob then // the /\ob needed?
out("*C*LThe :U isn't alive.*C*L", nam)
or
$( st_((st-1)/RNGE)*RNGE
out("*C*L:s:p has a stamina of between :n & :n.*C*L", ob->"The ","",nam,st+1,st+RNGE)
$)
endcase
$)
case SF.DEAFEN:
deaf_1
endcase
case SF.BLIND:
blind_1
endcase
case SF.DUMB:
dumb_1
endcase
case SF.PARALYSE:
paralysed_1
endcase
case SF.UNVEIL:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( let v, t=vec 16, !objname
unpackstring(objname, v)
for i=0 to !v t*_(i+v!i)
unless t*ps.word=5732491264 error()
profile!14_!objname
profile!15_1!objname
WIZARD of profile_true
bashfull()
Out("You are seen in your true form, :p!*C*L",objname)
$)
case SF.CURE:
deaf, blind, dumb, paralysed_false,false,false,false
endcase
case SF.HASTE:
unless WIZARD of profile reset()<>error()
spcheck()
$( let moved,match,o1,val,orm=false,?,?,getnum(),room
room_place(room)
o1_object()
match_LH of o1
o1_here(match)
while o1 do
$( if MOTN of o1 moved_(MOTION of MOTN of o1)+1<>MOTION of MOTN of o1_val
o1_here(match, LINK of o1)
$)
o1_toting(match)
while o1 do
$( if MOTN of o1 moved_(MOTION of MOTN of o1)+1<>MOTION of MOTN of o1_val
o1_toting(match,LINK of o1)
$)
room_orm
test moved then out(":P now :s.*C*L", objname,
moved=val+1->"the same speed",moved<=val->"slower","faster")
or error("The :p can't move!", objname)
endcase
$)
case SF.FOD:
unless WIZARD of profile error()
checkforced()
spcheck()
if us(objname)
$( outz($az"*C*LBye-bye...*C*L")
STAMINA of profile_-1
quit()
$)
if PTYPE of objct=S.PLAYER
$( unless ~WIZVWIZ\/us(PNAME of profile)
$( if fodded error("You've already fodded someone once and you can't fod again this game!")
fodded_true
$)
interact(I.FOD)
endcase
$)
swap(@getnum, @gettrue)
case SF.RESURRECT:
unless WIZARD of profile reset()<>error()
spcheck()
$( let match, o1, val,orm=?,?,getnum(),room
room_place(room)
o1_object()
match_LH of o1
o1_here(match)
if MOTN of o1 unless val
$( outz($az "To what stamina, then?*C*L")
val_nextnum(VALUE of o1)
$)
unless RELAXED\/us(me) if val>100 val_100
while o1 do
$( DESTROYED of o1_val
o1_here(match, LINK of o1)
$)
o1_toting(match)
while o1 do
$( DESTROYED of o1_val
o1_toting(match, LINK of o1)
$)
Out(":P now :s.*C*L", objname, \val->"resurrected","deceased")
room_orm
endcase
$)
case SF.MOBILE:
test CORELOW then
error("The :s command has been temporarily removed for space reasons - sorry!", verbname)
or
$( unless WIZARD of profile error()
unless melted writes(tty,"Movement has been frozen.*C*L")
$( let tracer=movers
while tracer do
$( let obj, mobile=LH of tracer, MOTN of obj
unless A.HIDEAWAY bitand ATTRIB of CURROOM of mobile
$( write(tty,":p*T", PNAME of obj)
test CURROOM of mobile then write6(tty,!(CURROOM of mobile)) or writes(tty,"(immobile)")
write(tty,"*Tmove every :n*Tcount=:n *Tprop=:N*Tstamina=:N*C*L", MOTION of mobile, MOVECOUNT of mobile, P4 of obj, DESTROYED of obj)
$)
tracer_RH of tracer
$)
$)
endcase
$)
case SF.SLEEP:
test PTYPE of objct=S.PLAYER then
test spectacular/\WIZARD of profile=0 then Error("Not during a spectacular!") or
interact(I.SLEEP) or
$( if ASLEEP of profile error("You're already asleep!")
if (A.SMALL bitand ATTRIB of room) error("You can't get to sleep in this small place.")
kips!player.no_ud.time()
ASLEEP of profile_true
broadcast(K.IHFA,who.copy)
start.leading()
doownthing()
$)
endcase
case SF.WAKE:
if PTYPE of objct=S.PLAYER /\ hidden(P1 of objct)=0 interact(I.WAKE)
endcase
case SF.SUMMON:
unless WIZARD of profile if A.SMALL bitand ATTRIB of room
Error("The room is too small - no-one else can enter it.")
spcheck()
interact(I.SUMMON)
endcase
case SF.CHANGE:
interact(I.CHANGE)
endcase
case SF.FRCE://Make
checkforced()
spcheck()
if us(objname) error("You honestly thought I'd allow that?!")
interact(I.MAKE)
endcase
case SF.GO://Go (check if wizard otherwise ignore)
if WIZARD of profile then
$( l_find.room(objname)
start.leading()
if l then move.ser(LH of l,true)<>return
$)
if paralysed error("You're crippled, you can't :s anywhere.",verbname)
unless PTYPE of objct=S.MOTION error("Direction expected after :p.",verbname)
verb_objct
verbname_objname
objct_fake.node("that")
move()
endcase
case SF.BACK:
if paralysed error("You can't :s :s, you're crippled.",PNAME of tverb, verbname)
$( let ld = valof
$[ $move 1, lastdir
$subi 1, 1
$trc 1, 1
$addi 1, 1
$]
unless (byte 1:ld) from backword
Error("There is no opposite direction to the one you last tried.")
verb_fake.node(verbname)
DREC of verb_ld
out("Going :U.*C*L", motvec!ld)
move()
endcase
$)
case SF.BUG://Bug (append stuff to a bug file).
bug()
endcase
case SF.WEIGH:
case SF.VALUE:
unless PTYPE of objct=S.OBJECT\/PTYPE of objct=S.CLASS error("You can only :s objects, not anything else.", verbname)
$( let nd=object()
unless WIZARD of profile
if FIXED of nd \/ NOGET of nd
Error("You can't :s that!", verbname)
test sftype=SF.VALUE then
out("*C*LThe base value of the :P is :N, and the current value is :N.*C*L",
objname, valof
$( let v=VALUE of nd
$[ $hrre 1, v $]
$), setexp(nd, true, true)) or
out("*C*LThe weight of the :P is :Ng.*C*L", objname, WEIGHT of nd)
endcase
$)
case SF.AUTOWHO:
checkforced()
$( let res=getnum()
unless res autowho_-1<>endcase
autowho+_res-autoint
autoint_res
if autowho le 0
$( autowho_res
special(SF.WHO)
$)
$)
endcase
case SF.QUICKWHO:
for i=0 to 35 if player.names!i then unless hidden(i)
$( let ii=INVIS of LH from player.names!i
out(":c:p:c:s*C*L",ii->'(','*0',player.names!i,ii->')','*0',(i=player.no/\snoopedon)->" ","")
$)
endcase
case SF.WHO://Who (is playing?)
for i=0 to 35 do if player.names!i then unless hidden(i)
$( let ii=INVIS of LH from player.names!i
out(":c:p is playing:c",ii->'(','*0',player.names!i,ii->')','*0')