一种编译成zandronum兼容修饰语法的语言。

ZDCode的Python项目详细描述


zdcode 2.0

编成古装的语言!

举个例子:

    class RunZombie inherits ZombieMan replaces ZombieMan #2055
    {
        set Gravity to 0.4; // high up...
        set Speed to 0;
        is NOBLOCKMONST;
        set Speed to 0;

        label See
        {
            call SeeCheck;
            POSS AB 5 A_Recoil(-0.7);
            call SeeCheck;
            POSS AB 4 A_Recoil(-0.7);
            call SeeCheck;
            POSS ABCD 3 A_Recoil(-0.7);
            call SeeCheck;
            goto RunLoop;
        };

        function SeeCheck
        {
            TNT1 A 0 A_Chase;
            POSS A 0 A_FaceTarget();
        };

        function ZombieJump
        {
            if ( health > 5 )
                return;

            while ( z == floorz )
            {
                POSS A 5 [Bright];
                POSS A 11 ThrustThingZ(0, 30, 0, 1);
            };

            POSS AB 2 A_Chase;
        };

        label RunLoop
        {
            x 2
            {
                POSS ABCD 2 A_Recoil(-0.7);
                call SeeCheck;
            };

            call ZombieJump;
            loop;
        };
    }

当这种美通过zdcode 2.0时,就会发生这种情况

    Actor _Call0 : Inventory {Inventory.MaxAmount 1}
    Actor _Call1 : Inventory {Inventory.MaxAmount 1}
    Actor _Call2 : Inventory {Inventory.MaxAmount 1}
    Actor _Call3 : Inventory {Inventory.MaxAmount 1}
    Actor _Call4 : Inventory {Inventory.MaxAmount 1}
    Actor _Call5 : Inventory {Inventory.MaxAmount 1}


    Actor RunZombie : ZombieMan replaces ZombieMan 2055
    {
        Gravity 0.4
        Speed 0

        +NOBLOCKMONST

        States {
            F_SeeCheck:
                TNT1 A 0 A_Chase
                POSS A 0 A_FaceTarget
                TNT1 A 0 A_JumpIfInventory("_Call0", 1, "_CLabel0")
                TNT1 A 0 A_JumpIfInventory("_Call1", 1, "_CLabel1")
                TNT1 A 0 A_JumpIfInventory("_Call2", 1, "_CLabel2")
                TNT1 A 0 A_JumpIfInventory("_Call3", 1, "_CLabel3")
                TNT1 A 0 A_JumpIfInventory("_Call4", 1, "_CLabel4")
                Stop

                F_ZombieJump:
                TNT1 A 0 A_JumpIf(!(health > 5), 2)
                TNT1 A 0 A_JumpIfInventory("_Call5", 1, "_CLabel5")
                Stop
                TNT1 A 0
            _WhileBlock0:
                TNT1 A 0 A_JumpIf(!(z == floorz), 4)
                POSS A 5  Bright
                POSS A 11 ThrustThingZ(0, 30, 0, 1)
                TNT1 A 0 A_Jump(255, "_WhileBlock0")
                TNT1 A 0
                POSS A 2 A_Chase
                POSS B 2 A_Chase
                TNT1 A 0 A_JumpIfInventory("_Call5", 1, "_CLabel5")
                Stop

            See:
                TNT1 A 0 A_GiveInventory("_Call0")
                Goto F_SeeCheck
            _CLabel0:
                TNT1 A 0 A_TakeInventory("_Call0")
                POSS A 5 A_Recoil(-0.7)
                POSS B 5 A_Recoil(-0.7)
                TNT1 A 0 A_GiveInventory("_Call1")
                Goto F_SeeCheck
            _CLabel1:
                TNT1 A 0 A_TakeInventory("_Call1")
                POSS A 4 A_Recoil(-0.7)
                POSS B 4 A_Recoil(-0.7)
                TNT1 A 0 A_GiveInventory("_Call2")
                Goto F_SeeCheck
            _CLabel2:
                TNT1 A 0 A_TakeInventory("_Call2")
                POSS A 3 A_Recoil(-0.7)
                POSS B 3 A_Recoil(-0.7)
                POSS C 3 A_Recoil(-0.7)
                POSS D 3 A_Recoil(-0.7)
                TNT1 A 0 A_GiveInventory("_Call3")
                Goto F_SeeCheck
            _CLabel3:
                TNT1 A 0 A_TakeInventory("_Call3")
                goto RunLoop

            RunLoop:
                POSS A 2 A_Recoil(-0.7)
                POSS B 2 A_Recoil(-0.7)
                POSS C 2 A_Recoil(-0.7)
                POSS D 2 A_Recoil(-0.7)
                    TNT1 A 0 A_GiveInventory("_Call4")
                    Goto F_SeeCheck
                _CLabel4:
                    TNT1 A 0 A_TakeInventory("_Call4")
                POSS A 2 A_Recoil(-0.7)
                POSS B 2 A_Recoil(-0.7)
                POSS C 2 A_Recoil(-0.7)
                POSS D 2 A_Recoil(-0.7)
                    TNT1 A 0 A_GiveInventory("_Call4")
                    Goto F_SeeCheck
                _CLabel4:
                    TNT1 A 0 A_TakeInventory("_Call4")
                TNT1 A 0 A_GiveInventory("_Call5")
                Goto F_ZombieJump
            _CLabel5:
                TNT1 A 0 A_TakeInventory("_Call5")
                loop
        }
    }

是的,我知道;输出代码很神秘,但你不应该碰它!

把输出放进你的纸里…look at what happens!

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android测试运行失败:没有测试结果   java设置JMenuItems与Nimbus LaF的边界   java是使用springboot、Crudepository和MySQL检查重复值的好方法吗   谷歌电子表格的Java时代日期   java向xml文件添加EditText不起作用   java ORA00933:SQL命令未正确结束WHERE子句   如何在java中防止JTextField上使用CTRL+C?   java绑定到TypeLiteral在google guice中是好的还是坏的做法   java找到了原始类型,缺少泛型类的返回参数   Kafka Streams API中ArrayList Serde的java问题   java在hibernate中,哪种持久化上下文的性能更好?   java通过本机查询获取数据库url、名称和模式版本   如何为Java枚举编写通用for循环?   在Java应用程序中播放MP3   如何使用VisualVM度量短时间运行的Java应用程序的性能?   java从当前日期获取datetime(秒)   简单JMH基准中的javagrpcoome和NPE   java如何加载Maven项目库中Spring jar的应用程序上下文   JavaCC XPath解析器   用于Scala和Java的类型安全生成器库