Example #1
0
        public bool Xunyuan(MsgInformationEx MsgDTO, object[] param)
        {
            var aimQQ = (long)param[0];

            if (aimQQ == MsgDTO.FromQQ)
            {
                MsgSender.PushMsg(MsgDTO, "你无法和自己寻缘!");
                return(false);
            }

            if (!XunYuanMgr.CheckGroup(MsgDTO.FromGroup))
            {
                MsgSender.PushMsg(MsgDTO, "此群正在进行一场寻缘,请稍候再试!");
                return(false);
            }

            if (!XunYuanMgr.CheckQQNum(MsgDTO.FromQQ))
            {
                MsgSender.PushMsg(MsgDTO, "你正在进行一场寻缘,请稍候再试!");
                return(false);
            }

            if (!XunYuanMgr.CheckQQNum(aimQQ))
            {
                MsgSender.PushMsg(MsgDTO, "对方正在进行一场寻缘,请稍候再试!");
                return(false);
            }

            var msg = $"{CodeApi.Code_At(aimQQ)} 你正被邀请参加一次寻缘,是否同意?";

            if (!WaiterSvc.WaitForConfirm(MsgDTO.FromGroup, aimQQ, msg, MsgDTO.BindAi))
            {
                MsgSender.PushMsg(MsgDTO, "操作取消!");
                return(false);
            }

            var Gamers = new[] { MsgDTO.FromQQ, aimQQ }.Select(p =>
            {
                var armerRecord = PersonArmerRecord.Get(p);
                var osPerson    = OSPerson_Doremi.GetPerson(p);
                var levelModel  = LevelSvc.GetByLevel(osPerson.Level);

                var battleArmers = Rander.RandSort(armerRecord.Armers.ToArray()).Take(10).ToDictionary(a => a.Key, a => a.Value);
                return(new XunYuanGamingModel()
                {
                    QQNum = p,
                    Armers = battleArmers,
                    EscapeArmers = armerRecord.EscapeArmers,
                    BasicHP = levelModel.HP,
                    HP = levelModel.HP + ArmerSvc.CountHP(battleArmers),
                    BasicAttack = levelModel.Atk,
                    Attack = levelModel.Atk + ArmerSvc.CountAtk(battleArmers)
                });
            }).ToArray();

            XunYuanMgr.StartGame(Gamers, MsgDTO.FromGroup, MsgDTO.BindAi);
            return(true);
        }
Example #2
0
        public bool MyStatus(MsgInformationEx MsgDTO, object[] param)
        {
            var osPerson    = OSPerson_Doremi.GetPerson(MsgDTO.FromQQ);
            var level       = LevelSvc.GetByLevel(osPerson.Level);
            var exp         = MsgCounterSvc.Get(MsgDTO.FromQQ);
            var armerRecord = PersonArmerRecord.Get(MsgDTO.FromQQ);

            var session = new MsgSession(MsgDTO);

            session.Add($"等级:{level.Name}{(level.Level == LevelSvc.TopLevel ? "(满级)" : "")}");
            session.Add($"经验值:{exp}/{level.Exp}{(exp   >= level.Exp ? "(可渡劫)" : "")}");
            session.Add($"{Emoji.心}:{level.HP}(+{ArmerSvc.CountHP(armerRecord.Armers)})");
            session.Add($"{Emoji.剑}:{level.Atk}(+{ArmerSvc.CountAtk(armerRecord.Armers)})");
            session.Add($"金币:{osPerson.Golds}");

            session.Send();
            return(true);
        }