Example #1
0
        public TalkEventItemGame(int evtId, int level, Rectangle r, SceneQuestEvent e)
            : base(evtId, level, r, e)
        {
            int gameId = config.MiniGameId;

            PanelManager.ShowGameWindow(gameId, OnResult);
        }
Example #2
0
        public TalkEventItemAction(int evtId, int level, Rectangle r, SceneQuestEvent e)
            : base(evtId, level, r, e)
        {
            switch (e.Type)
            {
            case "reset": Scene.Instance.ResetScene(); break;

            case "teleport": Scene.Instance.EnableTeleport(); break;

            case "portal": Scene.Instance.RandomPortal(); break;

            case "move": Scene.Instance.MoveTo(config.Position); break;

            case "hiddenway": Scene.Instance.HiddenWay(); break;

            case "next": Scene.Instance.QuestNext(evt.ParamList[0]); break;

            case "changemap":
                Scene.Instance.ChangeMap(config.SceneId, true);
                UserProfile.InfoBasic.Position = Scene.Instance.GetStartPos();     //如果没配置了出生点,就随机一个点
                break;

            case "detect": Scene.Instance.DetectNear(int.Parse(evt.ParamList[0])); break;

            case "detectrd": Scene.Instance.DetectRandom(int.Parse(evt.ParamList[0])); break;
            }
        }
        public TalkEventItemReward(int evtId, int level, Control c, Rectangle r, SceneQuestEvent e)
            : base(evtId, level, r, e)
        {
            parent  = c;
            vRegion = new VirtualRegion(parent);
            vRegion.RegionEntered += virtualRegion_RegionEntered;
            vRegion.RegionLeft    += virtualRegion_RegionLeft;

            int index = 1;

            DoReward(ref index, "gold", GetMulti() + BlessManager.RewardGoldMulti, RewardGold);
            DoReward(ref index, "food", GetMulti() + BlessManager.RewardFoodMulti, RewardFood);
            DoReward(ref index, "health", GetMulti() + BlessManager.RewardHealthMulti, RewardHealth);
            DoReward(ref index, "mental", GetMulti() + BlessManager.RewardMentalMulti, RewardMental);
            DoReward(ref index, "exp", GetMulti() + BlessManager.RewardExpMulti, RewardExp);
            DoReward(ref index, "rival", 1, RewardRival);
            DoReward(ref index, "flag", 1, RewardFlag);
            DoReward(ref index, "bless", 1, RewardBless);
            DoReward(ref index, "item", 1, RewardItem);

            if (evt.Children.Count > 0)
            {
                result = evt.Children[0];//应该是一个say
            }
        }
Example #4
0
 public TalkEventItemNpc(int evtId, int level, Rectangle r, SceneQuestEvent e)
     : base(evtId, level, r, e)
 {
     if (e.ParamList[0] == "buypiece")
     {
         PanelManager.DealPanel(new BuyPieceForm());
     }
     else if (e.ParamList[0] == "changecard")
     {
         PanelManager.DealPanel(new ChangeCardForm());
     }
     else if (e.ParamList[0] == "selectjob")
     {
         PanelManager.DealPanel(new SelectJobForm());
     }
     else if (e.ParamList[0] == "merge")
     {
         PanelManager.DealPanel(new MergeWeaponForm());
     }
     else if (e.ParamList[0] == "farm")
     {
         PanelManager.DealPanel(new FarmForm());
     }
     else if (e.ParamList[0] == "bless")
     {
         PanelManager.DealPanel(new BlessForm());
     }
 }
Example #5
0
 public TalkEventItemPunish(int evtId, int level, Control c, Rectangle r, SceneQuestEvent e)
     : base(evtId, level, r, e)
 {
     parent  = c;
     vRegion = new VirtualRegion(parent);
     vRegion.RegionEntered += virtualRegion_RegionEntered;
     vRegion.RegionLeft    += virtualRegion_RegionLeft;
 }
Example #6
0
 public TalkEventItem(int evtId, int l, Rectangle r, SceneQuestEvent e)
 {
     level        = l;
     pos          = r;
     evt          = e;
     config       = ConfigData.GetSceneQuestConfig(evtId);
     RunningState = TalkEventState.Running;
 }
Example #7
0
 public TalkEventItem(int evtId, int l, Rectangle r, SceneQuestEvent e)
 {
     level  = l;
     pos    = r;
     evt    = e;
     config = ConfigData.GetSceneQuestConfig(evtId);
     if (config.TriggerDNAHard != null && config.TriggerDNAHard.Length > 0)
     {
         for (int i = 0; i < config.TriggerDNAHard.Length; i++)
         {
             if (UserProfile.InfoBasic.HasDna(DnaBook.GetDnaId(config.TriggerDNAHard[i])))
             {
                 hardness += DnaBook.GetDnaEffect(config.TriggerDNAHard[i]);
             }
         }
     }
     RunningState = TalkEventState.Running;
 }
Example #8
0
        public static SceneQuestBlock GetQuestData(Control c, int eventId, int level, string name)
        {
            Dictionary <int, SceneQuestBlock> levelCachDict = new Dictionary <int, SceneQuestBlock>();//存下每一深度的最后节点
            SceneQuestBlock root = null;
            StreamReader    sr   = new StreamReader(DataLoader.Read("SceneQuest", String.Format("{0}.txt", name)));
            string          line;
            int             lineCount = 0;

            while ((line = sr.ReadLine()) != null)
            {
                lineCount++;
                int             lineDepth = GetStringDepth(ref line);
                char            type      = line[0];
                string          script    = line.Substring(1);
                SceneQuestBlock data;
                switch (type)
                {
                case 's': data = new SceneQuestSay(c, eventId, level, script, lineDepth, lineCount); break;

                case 'a': data = new SceneQuestAnswer(c, eventId, level, script, lineDepth, lineCount); break;

                case 'e': data = new SceneQuestEvent(c, eventId, level, script, lineDepth, lineCount); break;

                case 'r': data = new SceneQuestRollItem(c, eventId, level, script, lineDepth, lineCount); break;

                default: throw new Exception(string.Format("GetQuestData unknown type {0} {1}", name, lineCount));
                }

                levelCachDict[data.Depth] = data;
                if (root == null)
                {
                    root = data;
                }
                else
                {
                    levelCachDict[data.Depth - 1].Children.Add(data);
                }
            }
            sr.Close();

            return(root);
        }
        public TalkEventItemPunish(int evtId, int level, Control c, Rectangle r, SceneQuestEvent e)
            : base(evtId, level, r, e)
        {
            parent  = c;
            vRegion = new VirtualRegion(parent);
            vRegion.RegionEntered += virtualRegion_RegionEntered;
            vRegion.RegionLeft    += virtualRegion_RegionLeft;

            int index = 1;

            DoPunish(ref index, "gold", GetMulti() + BlessManager.PunishGoldMulti, PunishGold);
            DoPunish(ref index, "food", GetMulti() + BlessManager.PunishFoodMulti, PunishFood);
            DoPunish(ref index, "health", GetMulti() + BlessManager.PunishHealthMulti, PunishHealth);
            DoPunish(ref index, "mental", GetMulti() + BlessManager.PunishMentalMulti, PunishMental);
            DoPunish(ref index, "bless", 1, PunishBless);

            if (evt.Children.Count > 0)
            {
                result = evt.Children[0];//应该是一个say
            }
        }
Example #10
0
        public TalkEventItemFight(int evtId, int level, Rectangle r, SceneQuestEvent e)
            : base(evtId, level, r, e)
        {
            int enemyId = config.EnemyId;
            HsActionCallback winCallback  = OnWin;
            HsActionCallback failCallback = OnFail;
            var parm = new PeopleFightParm();

            parm.Reason = PeopleFightReason.SceneQuest;
            if (evt.ParamList.Count > 1)
            {
                parm.RuleAddon = (PeopleFightRuleAddon)Enum.Parse(typeof(PeopleFightRuleAddon), evt.ParamList[0]);
                parm.RuleLevel = int.Parse(evt.ParamList[1]);
            }
            if (enemyId == 1)//特殊处理标记
            {
                enemyId = UserProfile.InfoRecord.GetRecordById((int)MemPlayerRecordTypes.SceneQuestRandPeopleId);
            }
            int fightLevel = Math.Max(1, level + BlessManager.FightLevelChange);

            PeopleBook.Fight(enemyId, config.BattleMap, fightLevel, parm, winCallback, failCallback, failCallback);
        }
Example #11
0
        private const int FrameOff = 10; //第一个柱子相叫最左边的偏移

        public TalkEventItemTest(int evtId, int level, Rectangle r, SceneQuestEvent e)
            : base(evtId, level, r, e)
        {
            var  type       = int.Parse(evt.ParamList[0]);
            bool canConvert = type == 1; //是否允许转换成幸运检测
            var  testType   = type == 1 ? config.TestType1 : config.TestType2;
            var  biasData   = (type == 1 ? config.TestBias1 : config.TestBias2) + hardness;

            if (UserProfile.InfoDungeon.DungeonId > 0)
            {
                attrVal  = Math.Max(1, UserProfile.InfoDungeon.GetAttrByStr(testType));
                markNeed = UserProfile.InfoDungeon.GetRequireAttrByStr(testType, biasData);
            }
            else
            {
                attrVal  = 3;
                markNeed = 3 + biasData;
            }
            if (markNeed < 1)
            {
                markNeed = 1;
            }
        }
Example #12
0
 public TalkEventItemFight(int evtId, int level, Rectangle r, SceneQuestEvent e)
     : base(evtId, level, r, e)
 {
 }
Example #13
0
        private const int FrameOff = 10; //第一个柱子相叫最左边的偏移

        public TalkEventItemRoll(int evtId, int level, Rectangle r, SceneQuestEvent e)
            : base(evtId, level, r, e)
        {
            rollItemX      = MathTool.GetRandom(0, pos.Width);
            rollItemSpeedX = MathTool.GetRandom(20, 40);
        }
Example #14
0
        public static TalkEventItem CreateEventItem(int eventId, int level, Control c, Rectangle r, SceneQuestEvent e)
        {
            switch (e.Type)
            {
            case "roll": return(new TalkEventItemRoll(eventId, level, r, e));

            case "fight": return(new TalkEventItemFight(eventId, level, r, e));

            case "game": return(new TalkEventItemGame(eventId, level, r, e));

            case "reward": return(new TalkEventItemReward(eventId, level, c, r, e));

            case "trade": return(new TalkEventItemTrade(eventId, level, c, r, e));

            case "punish": return(new TalkEventItemPunish(eventId, level, c, r, e));

            case "npc": return(new TalkEventItemNpc(eventId, level, r, e));

            case "nd": return(new TalkEventItemEnd(eventId, level, r, e));

            default: return(new TalkEventItemAction(eventId, level, r, e));
            }
        }
Example #15
0
 public TalkEventItemAction(int cellId, int evtId, int level, Rectangle r, SceneQuestEvent e)
     : base(evtId, level, r, e)
 {
     this.cellId = cellId;
 }
Example #16
0
 public TalkEventItemNpc(int evtId, int level, Rectangle r, SceneQuestEvent e)
     : base(evtId, level, r, e)
 {
     autoClose = true;
 }