GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/being/crazymoves.cpp Lines: 1 423 0.2 %
Date: 2017-11-29 Branches: 0 228 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2011-2017  The ManaPlus Developers
4
 *
5
 *  This file is part of The ManaPlus Client.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#include "being/crazymoves.h"
22
23
#include "configuration.h"
24
#include "settings.h"
25
26
#include "being/localplayer.h"
27
28
#include "enums/being/beingdirection.h"
29
30
#include "gui/shortcut/dropshortcut.h"
31
32
#include "gui/windows/outfitwindow.h"
33
34
#include "net/packetlimiter.h"
35
#include "net/pethandler.h"
36
#include "net/playerhandler.h"
37
38
#include "resources/db/emotedb.h"
39
40
#include "resources/map/map.h"
41
42
#include "utils/timer.h"
43
44
#include "debug.h"
45
46
CrazyMoves *crazyMoves = nullptr;
47
48
CrazyMoves::CrazyMoves() :
49
    mMoveProgram(),
50
    mDisableCrazyMove(false)
51
{
52
}
53
54
void CrazyMoves::crazyMove()
55
{
56
    const bool oldDisableCrazyMove = mDisableCrazyMove;
57
    mDisableCrazyMove = true;
58
    switch (settings.crazyMoveType)
59
    {
60
        case 1:
61
            crazyMove1();
62
            break;
63
        case 2:
64
            crazyMove2();
65
            break;
66
        case 3:
67
            crazyMove3();
68
            break;
69
        case 4:
70
            crazyMove4();
71
            break;
72
        case 5:
73
            crazyMove5();
74
            break;
75
        case 6:
76
            crazyMove6();
77
            break;
78
        case 7:
79
            crazyMove7();
80
            break;
81
        case 8:
82
            crazyMove8();
83
            break;
84
        case 9:
85
            crazyMove9();
86
            break;
87
        case 10:
88
            crazyMoveA();
89
            break;
90
        default:
91
            break;
92
    }
93
    mDisableCrazyMove = oldDisableCrazyMove;
94
}
95
96
void CrazyMoves::crazyMove1()
97
{
98
    if ((localPlayer == nullptr) ||
99
        (playerHandler == nullptr) ||
100
        localPlayer->getCurrentAction() == BeingAction::MOVE)
101
    {
102
        return;
103
    }
104
105
//    if (!PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
106
//        return;
107
108
    switch (localPlayer->getDirection())
109
    {
110
        case BeingDirection::UP:
111
            localPlayer->setWalkingDir(BeingDirection::UP);
112
            localPlayer->setDirection(BeingDirection::LEFT);
113
            playerHandler->setDirection(BeingDirection::LEFT);
114
            break;
115
        case BeingDirection::LEFT:
116
            localPlayer->setWalkingDir(BeingDirection::LEFT);
117
            localPlayer->setDirection(BeingDirection::DOWN);
118
            playerHandler->setDirection(BeingDirection::DOWN);
119
            break;
120
        case BeingDirection::DOWN:
121
            localPlayer->setWalkingDir(BeingDirection::DOWN);
122
            localPlayer->setDirection(BeingDirection::RIGHT);
123
            playerHandler->setDirection(BeingDirection::RIGHT);
124
            break;
125
        case BeingDirection::RIGHT:
126
            localPlayer->setWalkingDir(BeingDirection::RIGHT);
127
            localPlayer->setDirection(BeingDirection::UP);
128
            playerHandler->setDirection(BeingDirection::UP);
129
            break;
130
        default:
131
            break;
132
    }
133
}
134
135
void CrazyMoves::crazyMove2()
136
{
137
    if ((localPlayer == nullptr) ||
138
        (playerHandler == nullptr) ||
139
        localPlayer->getCurrentAction() == BeingAction::MOVE)
140
    {
141
        return;
142
    }
143
144
//    if (!PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
145
//        return;
146
147
    switch (localPlayer->getDirection())
148
    {
149
        case BeingDirection::UP:
150
            localPlayer->setWalkingDir(BeingDirection::UP |
151
                BeingDirection::LEFT);
152
            localPlayer->setDirection(BeingDirection::RIGHT);
153
            playerHandler->setDirection(
154
                BeingDirection::DOWN | BeingDirection::RIGHT);
155
            break;
156
157
        case BeingDirection::RIGHT:
158
            localPlayer->setWalkingDir(BeingDirection::UP |
159
                BeingDirection::RIGHT);
160
            localPlayer->setDirection(BeingDirection::DOWN);
161
            playerHandler->setDirection(
162
                BeingDirection::DOWN | BeingDirection::LEFT);
163
            break;
164
165
        case BeingDirection::DOWN:
166
            localPlayer->setWalkingDir(BeingDirection::DOWN |
167
                BeingDirection::RIGHT);
168
            localPlayer->setDirection(BeingDirection::LEFT);
169
            playerHandler->setDirection(
170
                BeingDirection::UP | BeingDirection::LEFT);
171
            break;
172
173
        case BeingDirection::LEFT:
174
            localPlayer->setWalkingDir(BeingDirection::DOWN |
175
                BeingDirection::LEFT);
176
            localPlayer->setDirection(BeingDirection::UP);
177
            playerHandler->setDirection(
178
                BeingDirection::UP | BeingDirection::RIGHT);
179
            break;
180
181
        default:
182
            break;
183
    }
184
}
185
186
void CrazyMoves::crazyMove3()
187
{
188
    if ((localPlayer == nullptr) ||
189
        (playerHandler == nullptr) ||
190
        localPlayer->getCurrentAction() == BeingAction::MOVE)
191
    {
192
        return;
193
    }
194
195
    switch (settings.crazyMoveState)
196
    {
197
        case 0:
198
            localPlayer->move(1, 1);
199
            settings.crazyMoveState = 1;
200
            break;
201
        case 1:
202
            localPlayer->move(1, -1);
203
            settings.crazyMoveState = 2;
204
            break;
205
        case 2:
206
            localPlayer->move(-1, -1);
207
            settings.crazyMoveState = 3;
208
            break;
209
        case 3:
210
            localPlayer->move(-1, 1);
211
            settings.crazyMoveState = 0;
212
            break;
213
        default:
214
            break;
215
    }
216
217
//    if (!PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
218
//        return;
219
220
    localPlayer->setDirection(BeingDirection::DOWN);
221
    playerHandler->setDirection(BeingDirection::DOWN);
222
}
223
224
void CrazyMoves::crazyMove4()
225
{
226
    if ((localPlayer == nullptr) ||
227
        localPlayer->getCurrentAction() == BeingAction::MOVE)
228
    {
229
        return;
230
    }
231
232
    switch (settings.crazyMoveState)
233
    {
234
        case 0:
235
            localPlayer->move(7, 0);
236
            settings.crazyMoveState = 1;
237
        break;
238
        case 1:
239
            localPlayer->move(-7, 0);
240
            settings.crazyMoveState = 0;
241
        break;
242
        default:
243
        break;
244
    }
245
}
246
247
void CrazyMoves::crazyMove5()
248
{
249
    if ((localPlayer == nullptr) ||
250
        localPlayer->getCurrentAction() == BeingAction::MOVE)
251
    {
252
        return;
253
    }
254
255
    switch (settings.crazyMoveState)
256
    {
257
        case 0:
258
            localPlayer->move(0, 7);
259
            settings.crazyMoveState = 1;
260
            break;
261
        case 1:
262
            localPlayer->move(0, -7);
263
            settings.crazyMoveState = 0;
264
            break;
265
        default:
266
            break;
267
    }
268
}
269
270
void CrazyMoves::crazyMove6()
271
{
272
    if ((localPlayer == nullptr) ||
273
        localPlayer->getCurrentAction() == BeingAction::MOVE)
274
    {
275
        return;
276
    }
277
278
    switch (settings.crazyMoveState)
279
    {
280
        case 0:
281
            localPlayer->move(3, 0);
282
            settings.crazyMoveState = 1;
283
            break;
284
        case 1:
285
            localPlayer->move(2, -2);
286
            settings.crazyMoveState = 2;
287
            break;
288
        case 2:
289
            localPlayer->move(0, -3);
290
            settings.crazyMoveState = 3;
291
            break;
292
        case 3:
293
            localPlayer->move(-2, -2);
294
            settings.crazyMoveState = 4;
295
            break;
296
        case 4:
297
            localPlayer->move(-3, 0);
298
            settings.crazyMoveState = 5;
299
            break;
300
        case 5:
301
            localPlayer->move(-2, 2);
302
            settings.crazyMoveState = 6;
303
            break;
304
        case 6:
305
            localPlayer->move(0, 3);
306
            settings.crazyMoveState = 7;
307
            break;
308
        case 7:
309
            localPlayer->move(2, 2);
310
            settings.crazyMoveState = 0;
311
            break;
312
        default:
313
            break;
314
    }
315
}
316
317
void CrazyMoves::crazyMove7()
318
{
319
    if ((localPlayer == nullptr) ||
320
        localPlayer->getCurrentAction() == BeingAction::MOVE)
321
    {
322
        return;
323
    }
324
325
    switch (settings.crazyMoveState)
326
    {
327
        case 0:
328
            localPlayer->move(1, 1);
329
            settings.crazyMoveState = 1;
330
            break;
331
        case 1:
332
            localPlayer->move(-1, 1);
333
            settings.crazyMoveState = 2;
334
            break;
335
        case 2:
336
            localPlayer->move(-1, -1);
337
            settings.crazyMoveState = 3;
338
            break;
339
        case 3:
340
            localPlayer->move(1, -1);
341
            settings.crazyMoveState = 0;
342
            break;
343
        default:
344
            break;
345
    }
346
}
347
348
void CrazyMoves::crazyMove8()
349
{
350
    if (localPlayer == nullptr ||
351
        localPlayer->getCurrentAction() == BeingAction::MOVE)
352
    {
353
        return;
354
    }
355
    const Map *const map = localPlayer->getMap();
356
    if (map == nullptr)
357
        return;
358
    const int x = localPlayer->getTileX();
359
    const int y = localPlayer->getTileY();
360
    int idx = 0;
361
    const int dist = 1;
362
363
// look
364
//      up, ri,do,le
365
    static const int movesX[][4] =
366
    {
367
        {-1,  0,  1,  0},   // move left
368
        { 0,  1,  0, -1},   // move up
369
        { 1,  0, -1,  0},   // move right
370
        { 0, -1,  0,  1}    // move down
371
    };
372
373
// look
374
//      up, ri,do,le
375
    static const int movesY[][4] =
376
    {
377
        { 0, -1,  0,  1},   // move left
378
        {-1,  0,  1,  0},   // move up
379
        { 0,  1,  0, -1},   // move right
380
        { 1,  0, -1,  0}    // move down
381
    };
382
383
    switch (localPlayer->getDirection())
384
    {
385
        case BeingDirection::UP:
386
            idx = 0;
387
            break;
388
389
        case BeingDirection::RIGHT:
390
            idx = 1;
391
            break;
392
393
        case BeingDirection::DOWN:
394
            idx = 2;
395
            break;
396
397
        case BeingDirection::LEFT:
398
            idx = 3;
399
            break;
400
401
        default:
402
            break;
403
    }
404
405
    int mult = 1;
406
    const unsigned char blockWalkMask = localPlayer->getBlockWalkMask();
407
    if (map->getWalk(x + movesX[idx][0],
408
        y + movesY[idx][0], blockWalkMask))
409
    {
410
        while (map->getWalk(x + movesX[idx][0] * mult,
411
               y + movesY[idx][0] * mult,
412
               blockWalkMask) && mult <= dist)
413
        {
414
            mult ++;
415
        }
416
        localPlayer->move(movesX[idx][0] * (mult - 1),
417
            movesY[idx][0] * (mult - 1));
418
    }
419
    else if (map->getWalk(x + movesX[idx][1],
420
             y + movesY[idx][1], blockWalkMask))
421
    {
422
        while (map->getWalk(x + movesX[idx][1] * mult,
423
               y + movesY[idx][1] * mult,
424
               blockWalkMask) && mult <= dist)
425
        {
426
            mult ++;
427
        }
428
        localPlayer->move(movesX[idx][1] * (mult - 1),
429
            movesY[idx][1] * (mult - 1));
430
    }
431
    else if (map->getWalk(x + movesX[idx][2],
432
             y + movesY[idx][2], blockWalkMask))
433
    {
434
        while (map->getWalk(x + movesX[idx][2] * mult,
435
               y + movesY[idx][2] * mult,
436
               blockWalkMask) && mult <= dist)
437
        {
438
            mult ++;
439
        }
440
        localPlayer->move(movesX[idx][2] * (mult - 1),
441
            movesY[idx][2] * (mult - 1));
442
    }
443
    else if (map->getWalk(x + movesX[idx][3],
444
             y + movesY[idx][3], blockWalkMask))
445
    {
446
        while (map->getWalk(x + movesX[idx][3] * mult,
447
               y + movesY[idx][3] * mult,
448
               blockWalkMask) && mult <= dist)
449
        {
450
            mult ++;
451
        }
452
        localPlayer->move(movesX[idx][3] * (mult - 1),
453
            movesY[idx][3] * (mult - 1));
454
    }
455
}
456
457
void CrazyMoves::crazyMove9()
458
{
459
    int dx = 0;
460
    int dy = 0;
461
462
    if (localPlayer == nullptr ||
463
        localPlayer->getCurrentAction() == BeingAction::MOVE)
464
    {
465
        return;
466
    }
467
468
    switch (settings.crazyMoveState)
469
    {
470
        case 0:
471
            switch (localPlayer->getDirection())
472
            {
473
                case BeingDirection::UP   : dy = -1; break;
474
                case BeingDirection::DOWN : dy = 1; break;
475
                case BeingDirection::LEFT : dx = -1; break;
476
                case BeingDirection::RIGHT: dx = 1; break;
477
                default: break;
478
            }
479
            localPlayer->move(dx, dy);
480
            settings.crazyMoveState = 1;
481
            break;
482
        case 1:
483
            settings.crazyMoveState = 2;
484
            if (!localPlayer->allowAction())
485
                return;
486
            if (playerHandler != nullptr)
487
                playerHandler->changeAction(BeingAction::SIT);
488
            break;
489
        case 2:
490
            settings.crazyMoveState = 3;
491
            break;
492
        case 3:
493
            settings.crazyMoveState = 0;
494
            break;
495
        default:
496
            break;
497
    }
498
}
499
500
void CrazyMoves::crazyMoveAm() const
501
{
502
    if (localPlayer == nullptr)
503
        return;
504
505
    settings.crazyMoveState ++;
506
    if (settings.crazyMoveState < mMoveProgram.length())
507
    {
508
        int dx = 0;
509
        int dy = 0;
510
511
        signed char param = mMoveProgram[settings.crazyMoveState++];
512
        if (param == '?')
513
        {
514
            const char cmd[] = {'l', 'r', 'u', 'd', 'L', 'R', 'U', 'D'};
515
            srand(tick_time);
516
            param = cmd[rand() % 8];
517
        }
518
        switch (param)
519
        {
520
            case 'd':
521
                localPlayer->move(0, 1);
522
                break;
523
            case 'u':
524
                localPlayer->move(0, -1);
525
                break;
526
            case 'l':
527
                localPlayer->move(-1, 0);
528
                break;
529
            case 'r':
530
                localPlayer->move(1, 0);
531
                break;
532
            case 'D':
533
                localPlayer->move(1, 1);
534
                break;
535
            case 'U':
536
                localPlayer->move(-1, -1);
537
                break;
538
            case 'L':
539
                localPlayer->move(-1, 1);
540
                break;
541
            case 'R':
542
                localPlayer->move(1, -1);
543
                break;
544
            case 'f':
545
            {
546
                const uint8_t dir = localPlayer->getDirection();
547
                if ((dir & BeingDirection::UP) != 0)
548
                    dy = -1;
549
                else if ((dir & BeingDirection::DOWN) != 0)
550
                    dy = 1;
551
                if ((dir & BeingDirection::LEFT) != 0)
552
                    dx = -1;
553
                else if ((dir & BeingDirection::RIGHT) != 0)
554
                    dx = 1;
555
                localPlayer->move(dx, dy);
556
                break;
557
            }
558
            case 'b':
559
            {
560
                const uint8_t dir = localPlayer->getDirection();
561
                if ((dir & BeingDirection::UP) != 0)
562
                    dy = 1;
563
                else if ((dir & BeingDirection::DOWN) != 0)
564
                    dy = -1;
565
                if ((dir & BeingDirection::LEFT) != 0)
566
                    dx = 1;
567
                else if ((dir & BeingDirection::RIGHT) != 0)
568
                    dx = -1;
569
                localPlayer->move(dx, dy);
570
                break;
571
            }
572
            default:
573
                break;
574
        }
575
    }
576
}
577
578
void CrazyMoves::crazyMoveAd() const
579
{
580
    settings.crazyMoveState ++;
581
582
    if (settings.crazyMoveState < mMoveProgram.length())
583
    {
584
        signed char param = mMoveProgram[settings.crazyMoveState++];
585
        if (param == '?')
586
        {
587
            const char cmd[] = {'l', 'r', 'u', 'd'};
588
            srand(tick_time);
589
            param = cmd[rand() % 4];
590
        }
591
        switch (param)
592
        {
593
            case 'd':
594
//               if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
595
                {
596
                    localPlayer->setDirection(BeingDirection::DOWN);
597
                    playerHandler->setDirection(
598
                        BeingDirection::DOWN);
599
                }
600
                break;
601
            case 'u':
602
//               if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
603
                {
604
                    localPlayer->setDirection(BeingDirection::UP);
605
                    playerHandler->setDirection(
606
                        BeingDirection::UP);
607
                }
608
                break;
609
            case 'l':
610
//               if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
611
                {
612
                    localPlayer->setDirection(BeingDirection::LEFT);
613
                    playerHandler->setDirection(
614
                        BeingDirection::LEFT);
615
                }
616
                break;
617
            case 'r':
618
//               if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
619
                {
620
                    localPlayer->setDirection(BeingDirection::RIGHT);
621
                    playerHandler->setDirection(
622
                        BeingDirection::RIGHT);
623
                }
624
                break;
625
            case 'L':
626
//               if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
627
                {
628
                    uint8_t dir = 0;
629
                    switch (localPlayer->getDirection())
630
                    {
631
                        case BeingDirection::UP:
632
                            dir = BeingDirection::LEFT;
633
                            break;
634
                        case BeingDirection::DOWN:
635
                            dir = BeingDirection::RIGHT;
636
                            break;
637
                        case BeingDirection::LEFT:
638
                            dir = BeingDirection::DOWN;
639
                            break;
640
                        case BeingDirection::RIGHT:
641
                            dir = BeingDirection::UP;
642
                            break;
643
                        default:
644
                            break;
645
                    }
646
                    localPlayer->setDirection(dir);
647
                    playerHandler->setDirection(dir);
648
                }
649
                break;
650
            case 'R':
651
//               if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
652
                {
653
                    uint8_t dir = 0;
654
                    switch (localPlayer->getDirection())
655
                    {
656
                        case BeingDirection::UP:
657
                            dir = BeingDirection::RIGHT;
658
                            break;
659
                        case BeingDirection::DOWN:
660
                            dir = BeingDirection::LEFT;
661
                            break;
662
                        case BeingDirection::LEFT:
663
                            dir = BeingDirection::UP;
664
                            break;
665
                        case BeingDirection::RIGHT:
666
                            dir = BeingDirection::DOWN;
667
                            break;
668
                        default:
669
                            break;
670
                    }
671
                    localPlayer->setDirection(dir);
672
                    playerHandler->setDirection(dir);
673
                }
674
                break;
675
            case 'b':
676
//               if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
677
                {
678
                    uint8_t dir = 0;
679
                    switch (localPlayer->getDirection())
680
                    {
681
                        case BeingDirection::UP:
682
                            dir = BeingDirection::DOWN;
683
                            break;
684
                        case BeingDirection::DOWN:
685
                            dir = BeingDirection::UP;
686
                            break;
687
                        case BeingDirection::LEFT:
688
                            dir = BeingDirection::RIGHT;
689
                            break;
690
                        case BeingDirection::RIGHT:
691
                            dir = BeingDirection::LEFT;
692
                            break;
693
                        default:
694
                            break;
695
                    }
696
                    localPlayer->setDirection(dir);
697
                    playerHandler->setDirection(dir);
698
                }
699
                break;
700
            case '0':
701
                dropShortcut->dropFirst();
702
                break;
703
            case 'a':
704
                dropShortcut->dropItems();
705
                break;
706
            default:
707
                break;
708
        }
709
    }
710
}
711
712
void CrazyMoves::crazyMoveAs()
713
{
714
    settings.crazyMoveState ++;
715
    if (localPlayer->toggleSit())
716
        settings.crazyMoveState ++;
717
}
718
719
void CrazyMoves::crazyMoveAo() const
720
{
721
    settings.crazyMoveState ++;
722
    if (settings.crazyMoveState < mMoveProgram.length())
723
    {
724
        // wear next outfit
725
        if (mMoveProgram[settings.crazyMoveState] == 'n')
726
        {
727
            settings.crazyMoveState ++;
728
            outfitWindow->wearNextOutfit();
729
        }
730
        // wear previous outfit
731
        else if (mMoveProgram[settings.crazyMoveState] == 'p')
732
        {
733
            settings.crazyMoveState ++;
734
            outfitWindow->wearPreviousOutfit();
735
        }
736
    }
737
}
738
739
void CrazyMoves::crazyMoveAe() const
740
{
741
    settings.crazyMoveState ++;
742
    const signed char emo = mMoveProgram[settings.crazyMoveState];
743
    unsigned char emoteId = 0;
744
    if (emo == '?')
745
    {
746
        srand(tick_time);
747
        emoteId = CAST_U8(
748
            1 + (rand() % EmoteDB::size()));
749
    }
750
    else
751
    {
752
        if (emo >= '0' && emo <= '9')
753
            emoteId = CAST_U8(emo - '0' + 1);
754
        else if (emo >= 'a' && emo <= 'z')
755
            emoteId = CAST_U8(emo - 'a' + 11);
756
        else if (emo >= 'A' && emo <= 'Z')
757
            emoteId = CAST_U8(emo - 'A' + 37);
758
    }
759
    if (mMoveProgram[settings.crazyMoveState - 1] == 'e')
760
        LocalPlayer::emote(emoteId);
761
    else if (PacketLimiter::limitPackets(PacketType::PACKET_CHAT))
762
        petHandler->emote(emoteId);
763
764
    settings.crazyMoveState ++;
765
}
766
767
void CrazyMoves::crazyMoveA()
768
{
769
    mMoveProgram = config.getStringValue("crazyMoveProgram");
770
771
    if (localPlayer->getCurrentAction() == BeingAction::MOVE)
772
        return;
773
774
    if (mMoveProgram.empty())
775
        return;
776
777
    if (settings.crazyMoveState >= mMoveProgram.length())
778
        settings.crazyMoveState = 0;
779
780
    // move command
781
    if (mMoveProgram[settings.crazyMoveState] == 'm')
782
    {
783
        crazyMoveAm();
784
    }
785
    // direction command
786
    else if (mMoveProgram[settings.crazyMoveState] == 'd')
787
    {
788
        crazyMoveAd();
789
    }
790
    // sit command
791
    else if (mMoveProgram[settings.crazyMoveState] == 's')
792
    {
793
        crazyMoveAs();
794
    }
795
    // wear outfits
796
    else if (mMoveProgram[settings.crazyMoveState] == 'o')
797
    {
798
        crazyMoveAo();
799
    }
800
    // pause
801
    else if (mMoveProgram[settings.crazyMoveState] == 'w')
802
    {
803
        settings.crazyMoveState ++;
804
    }
805
    // pick up
806
    else if (mMoveProgram[settings.crazyMoveState] == 'p')
807
    {
808
        settings.crazyMoveState ++;
809
        localPlayer->pickUpItems();
810
    }
811
    // emote
812
    else if (mMoveProgram[settings.crazyMoveState] == 'e'
813
             || mMoveProgram[settings.crazyMoveState] == 'E')
814
    {
815
        crazyMoveAe();
816
    }
817
    else
818
    {
819
        settings.crazyMoveState ++;
820
    }
821
822
    if (settings.crazyMoveState >= mMoveProgram.length())
823
        settings.crazyMoveState = 0;
824
4
}