コード例 #1
0
 public static void GenerateStartMotionFunction(SegmentStartEventRecorder r, CodeGenerator output)
 {
     output.WriteStatement(new FunctionBlock("SegmentStartEventHandler", new string[0],
                                             new ILineObject[] {
         r.Generate(),
         new SimpleLineObject("if (!(\"lastKeyTake\" in this.u)) this.u.lastKeyTake <- -1;"),
         new SimpleLineObject("this.u.lastKeyTake = this.keyTake;"),
     }).Statement());
 }
コード例 #2
0
        public override void Export(Pat.Project proj)
        {
            _Project = proj;
            _GeneratedActionID.Clear();
            _SSERecorder = new SegmentStartEventRecorder();

            _NextFreeActionID = 20;

            //init script
            var actorCommon = base.AddCodeFile("actorCommon.add.cv4");

            PlayerInitFunctionGenerator.Generate(this, proj, actorCommon);

            //actions
            ExportAction(Animations.Stand, 0);
            ExportAction(Animations.Walk, 1);
            ExportAction(Animations.JumpUp, 3);
            ExportAction(Animations.JumpFront, 4);
            ExportAction(Animations.Fall, 8);
            ExportAction(Animations.Damage, 10);
            ExportReviveLightAction(17);
            ExportAction(Animations.Dead, 18);
            ExportAction(Animations.Lost, 19);

            var playerScript = base.AddCodeFile(ScriptFileName + ".cv4");

            SystemActionFunctionGenerator.Generate(this, proj, playerScript);

            this.GenEnv = SkillGenerator.CreateEnv(this, playerScript);
            SkillGenerator.GenerateSkills(this, playerScript);
            this.GenEnv = null;

            SkillGenerator.GenerateStartMotionFunction(_SSERecorder, playerScript);

            ExportAction(Animations.Stand, 100);
            ExportAction(Animations.Stand, 101);
            ExportAction(Animations.Stand, 102);
            ExportAction(Animations.Stand, 103);
        }