示例#1
0
        private static ActivityBase BuildShowCreatureInfoActivity(CreatureShowInfoPack pack)
        {
            if (pack == null)
            {
                throw new ArgumentNullException("pack");
            }

            FDCreature creature = pack.Creature;

            CreatureDialog.ShowType showType = CreatureDialog.ShowType.SelectAllItem;
            switch (pack.InfoType)
            {
            case CreatureInfoType.SelectAllItem:
                showType = CreatureDialog.ShowType.SelectAllItem;
                break;

            case CreatureInfoType.SelectEquipItem:
                showType = CreatureDialog.ShowType.SelectEquipItem;
                break;

            case CreatureInfoType.SelectUseItem:
                showType = CreatureDialog.ShowType.SelectUseItem;
                break;

            case CreatureInfoType.SelectMagic:
                showType = CreatureDialog.ShowType.SelectMagic;
                break;

            case CreatureInfoType.View:
                showType = CreatureDialog.ShowType.ViewItem;
                break;

            default:
                showType = CreatureDialog.ShowType.SelectAllItem;
                break;
            }

            CallbackActivity activity = new CallbackActivity(
                (gameInterface) => { gameInterface.ShowCreatureDialog(pack.Creature, showType); });

            if (pack.InfoType == CreatureInfoType.View && creature.Data.HasMagic())
            {
                SequenceActivity sequenceActivity = new SequenceActivity();
                sequenceActivity.Add(activity);

                CallbackActivity activity2 = new CallbackActivity(
                    (gameInterface) => { gameInterface.ShowCreatureDialog(pack.Creature, CreatureDialog.ShowType.ViewMagic); });

                sequenceActivity.Add(activity2);
                return(sequenceActivity);
            }

            return(activity);
        }
示例#2
0
        private static ActivityBase BuildComposeCreatureActivity(CreatureComposePack pack)
        {
            if (pack == null)
            {
                throw new ArgumentNullException("CreatureMovePack");
            }

            CallbackActivity act = new CallbackActivity(
                (callback) => { callback.PlaceCreature(pack.CreatureId, pack.AnimationId, pack.Position); });

            return(act);
        }
示例#3
0
        private static ActivityBase BuildShowRangeActivity(ShowRangePack pack)
        {
            if (pack == null)
            {
                throw new ArgumentNullException("pack");
            }

            CallbackActivity activity = new CallbackActivity(
                (gameInterface) => { gameInterface.PlaceIndicators(pack.Range); });

            return(activity);
        }
示例#4
0
        private static ActivityBase BuildRefreshAllCreaturesActivity(CreatureRefreshAllPack pack)
        {
            if (pack == null)
            {
                throw new ArgumentNullException("RefreshCreaturePack");
            }

            CallbackActivity activity = new CallbackActivity(
                (gameInterface) => { gameInterface.RefreshAllCreatures(); });

            return(activity);
        }
示例#5
0
        private static ActivityBase BuildCreatureDisposeActivity(CreatureDisposePack pack)
        {
            if (pack == null)
            {
                throw new ArgumentNullException("CreatureDeadPack");
            }

            CallbackActivity activity = new CallbackActivity(
                (gameInterface) => { gameInterface.DisposeCreature(pack.CreatureId); });

            return(activity);
        }
示例#6
0
        private static ActivityBase BuildPromptActivity(PromptPack pack)
        {
            if (pack == null)
            {
                throw new ArgumentNullException("pack");
            }

            CallbackActivity activity = new CallbackActivity((gameInterface) =>
            {
                /// gameInterface.ShowPromptDialog(pack.AnimationId, pack.Content);
            });

            return(activity);
        }
示例#7
0
        private static CallbackActivity BuildBattleFightActivity(BattleFightPack fightPack)
        {
            if (fightPack == null)
            {
                throw new ArgumentNullException("fightPack");
            }

            FDCreature       subject   = fightPack.Subject;
            FDCreature       target    = fightPack.Target;
            FightInformation fightInfo = fightPack.FightInformation;

            CallbackActivity activity = new CallbackActivity(
                (gameInterface) => { gameInterface.BattleFight(subject, target, fightInfo); });

            return(activity);
        }