summaryrefslogtreecommitdiff
path: root/npc/test/test1.txt
blob: 52f788bbc327e616c2731f69696e226a7eb0bd1b (plain) (blame)
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
// Evol scripts.
// Author:
//    4144
// Description:
//    script tests 

function	script	test1function	{
    .var = .walkmask;
    if (.var != 3)
        mes "Error: testing test1 npc variables from function.";
    .var = getvariableofnpc(.walkmask, "test1");
    if (.var != 3)
        mes "Error: testing test1 npc variables from function.";
    .var = getvariableofnpc(.walkmask, "test2");
    if (.var != 4)
        mes "Error: testing test2 npc variables from function.";

    return;
}

test,10,5,0	script	test1	NPC_HAT_BOX,{
    mes "Npc vars testing...";
    .var = .walkmask;
    if (.var != 3)
        mes "Error: testing test1 npc variables.";
    .var = getvariableofnpc(.walkmask, "test1");
    if (.var != 3)
        mes "Error: testing test1 npc variables from function.";
    .var = getvariableofnpc(.walkmask, "test2");
    if (.var != 4)
        mes "Error: testing test2 npc variables.";
    test1function;
    mes "Formatting testing for sex: " + str(Sex);
    if (l("test @@", "") != "test ")
        mes "Error: format string 'l(\"test @@\", \"\")': " + l("test @@", "");
    if (l("test @@", "1") != "test 1")
        mes "Error: format string 'l(\"test @@\", \"1\")': " + l("test @@", "1");
    if (l("@@", "") != "")
        mes "Error: format string 'l(\"@@\", \"\")': " + l("@@", "");
    if (l("@@") != "@@")
        mes "Error: format string 'l(\"@@\")': " + l("@@");
    if (l("@@ @@ @@", "this", "is", "test") != "this is test")
        mes "Error: format string 'l(\"@@ @@ @@\", \"this\", \"is\", \"test\") != \"this is test\"': " + l("@@ @@ @@", "this", "is", "test");
    if (l("data @@ @@ @@ data", "this", "is", "test") != "data this is test data")
        mes "Error: format string 'l(\"data @@ @@ @@ data\", \"this\", \"is\", \"test\")': " + l("data @@ @@ @@ data", "this", "is", "test");
    if (l("test") != "test")
        mes "Error: l(\"test\"): " + l("test");
    if (Sex == 1)
    {
        if (lg("test") != "test#1")
            mes "Error: lg(\"test\"): " + lg("test");
        if (lg("test1", "test2") != "test2#1")
            mes "Error: lg(\"test1\", \"test2\"): " + lg("test1", "test2");
        if (lg("test1 @@", "test2 @@", "line") != "test2 line#1")
            mes "Error: lg(\"test1 @@\", \"test2 @@\", \"line\"): " + lg("test1 @@", "test2 @@", "line");
    }
    else if (Sex == 0)
    {
        if (lg("test") != "test#0")
            mes "Error: lg(\"test\"): " + lg("test");
        if (lg("test1", "test2") != "test1#0")
            mes "Error: lg(\"test1\", \"test2\"): " + lg("test1", "test2");
        if (lg("test1 @@", "test2 @@", "line") != "test1 line#0")
            mes "Error: lg(\"test1 @@\", \"test2 @@\", \"line\"): " + lg("test1 @@", "test2 @@", "line");
    }
    mes "Quest vars testing...";
    .@time = 1000;
    setq Test_testing1, 1, 2, 3, .@time;
    if (getq(Test_testing1) != 1)
        mes "Error: quest variable 1 error. Must be 1, but get " + str(getq(Test_testing1));
    if (getq2(Test_testing1) != 2)
        mes "Error: quest variable 2 error. Must be 2, but get " + str(getq(Test_testing1));
    if (getq3(Test_testing1) != 3)
        mes "Error: quest variable 3 error. Must be 3, but get " + str(getq(Test_testing1));
    if (getqtime(Test_testing1) != .@time)
        mes "Error: quest variable 3 error. Must be 3, but get " + str(getqtime(Test_testing1));
    next;
    .@time = 2000;
    setq Test_testing1, 2, 3, 4, .@time;
    if (getq(Test_testing1) != 2)
        mes "Error: quest variable 1 error. Must be 2, but get " + str(getq(Test_testing1));
    if (getq2(Test_testing1) != 3)
        mes "Error: quest variable 2 error. Must be 3, but get " + str(getq(Test_testing1));
    if (getq3(Test_testing1) != 4)
        mes "Error: quest variable 3 error. Must be 4, but get " + str(getq(Test_testing1));
    if (getqtime(Test_testing1) != .@time)
        mes "Error: quest variable 3 error. Must be 3, but get " + str(getqtime(Test_testing1));
    next;
    setq Test_testing1, 0;
    mes "Tests complete.";
    close;

OnInit:
    .walkmask = 3;
    end;
}