コード例 #1
0
ファイル: ArchaeologyAI.cs プロジェクト: Dolany/DolanyAI
        public bool Reborn(MsgInformationEx MsgDTO, object[] param)
        {
            var archaeologist = Archaeologist.Get(MsgDTO.FromQQ);

            if (!archaeologist.IsDead)
            {
                MsgSender.PushMsg(MsgDTO, "活着的人,是不需要复活的!");
                return(false);
            }

            var asset = ArchAsset.Get(MsgDTO.FromQQ);

            if (asset.RedStarStone < 1)
            {
                MsgSender.PushMsg(MsgDTO, $"你没有足够的赤星石来复活!({asset.RedStarStone}/1)");
                return(false);
            }

            var msg = $"此操作将会花费赤星石*1,你当前剩余赤星石({asset.RedStarStone})颗,是否确认?";

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

            asset.RedStarStone--;
            archaeologist.RebornTime = DateTime.Now;

            asset.Update();
            archaeologist.Update();

            MsgSender.PushMsg(MsgDTO, "祈愿成功!");
            return(true);
        }
コード例 #2
0
ファイル: ArchaeologyAI.cs プロジェクト: Dolany/DolanyAI
        public bool MyStatus(MsgInformationEx MsgDTO, object[] param)
        {
            var archaeologist = Archaeologist.Get(MsgDTO.FromQQ);
            var collection    = ArchCollection.Get(MsgDTO.FromQQ);
            var msgList       = new List <string>()
            {
                $"SAN:{archaeologist.CurSAN}/{archaeologist.SAN}",
                $"{Emoji.雪花}:{archaeologist.Ice}",
                $"{Emoji.火焰}:{archaeologist.Flame}",
                $"{Emoji.闪电}:{archaeologist.Lightning}",
                $"收藏品碎片:{collection.ItemColles.Sum(p => p.Segments.Sum(s => s.Value))}",
                $"收藏品:{collection.Collectables.Sum(p => p.Value)}",
                $"特殊收藏品:{collection.SpecialColles.Count}",
                $"地图碎片:{collection.MapSegments}"
            };

            if (archaeologist.IsDead)
            {
                msgList.Add($"复活时间:{archaeologist.RebornTime:yyyy-MM-dd HH:mm:ss}");
            }

            var msg = string.Join("\r\n", msgList);

            MsgSender.PushMsg(MsgDTO, msg);
            return(true);
        }
コード例 #3
0
ファイル: ArchaeologyAI.cs プロジェクト: Dolany/DolanyAI
        public bool StartAdv(MsgInformationEx MsgDTO, object[] param)
        {
            var archaeologist = Archaeologist.Get(MsgDTO.FromQQ);

            if (archaeologist.IsDead)
            {
                MsgSender.PushMsg(MsgDTO, $"你当前处在死亡惩罚时间中,无法进行该操作!复活时间:{archaeologist.RebornTime:yyyy-MM-dd HH:mm:ss}");
                return(false);
            }

            var asset = ArchAsset.Get(MsgDTO.FromQQ);

            if (asset.GreenAmbur == 0 && asset.BlueAmbur == 0)
            {
                MsgSender.PushMsg(MsgDTO, "很抱歉,你没有任何琥珀,无法开启副本!");
                return(false);
            }

            if (asset.GreenAmbur > 0)
            {
                asset.GreenAmbur -= 1;
            }
            else
            {
                if (!WaiterSvc.WaitForConfirm(MsgDTO, $"此操作将消耗 碧蓝琥珀*1 (你当前剩余 {asset.BlueAmbur}),是否继续?"))
                {
                    MsgSender.PushMsg(MsgDTO, "操作取消!");
                    return(false);
                }

                asset.BlueAmbur -= 1;
            }

            asset.Update();

            var engine = new ArchAdvEngine(MsgDTO);

            engine.StartAdv();

            return(true);
        }
コード例 #4
0
ファイル: ArchaeologyAI.cs プロジェクト: Dolany/DolanyAI
        public bool UpdateElement(MsgInformationEx MsgDTO, object[] param)
        {
            var archaeologist = Archaeologist.Get(MsgDTO.FromQQ);

            if (archaeologist.IsDead)
            {
                MsgSender.PushMsg(MsgDTO, $"你当前处在死亡惩罚时间中,无法进行该操作!复活时间:{archaeologist.RebornTime:yyyy-MM-dd HH:mm:ss}");
                return(false);
            }

            var asset = ArchAsset.Get(MsgDTO.FromQQ);

            var flameEles     = asset.FlameEssence;
            var iceEles       = asset.IceEssence;
            var lightningEles = asset.LightningEssence;

            var flameNeed    = archaeologist.Flame * 10;
            var iceNeed      = archaeologist.Ice * 10;
            var lighningNeed = archaeologist.Lightning * 10;

            var options = new[]
            {
                $"{Emoji.火焰}:({flameEles}/{flameNeed})",
                $"{Emoji.雪花}:({iceEles}/{iceNeed})",
                $"{Emoji.闪电}:({lightningEles}/{lighningNeed})",
                "取消"
            };
            var option = WaiterSvc.WaitForOptions(MsgDTO.FromGroup, MsgDTO.FromQQ, "请选择你要晋升的元素之力!", options, MsgDTO.BindAi);

            if (option < 0 || option == 3)
            {
                MsgSender.PushMsg(MsgDTO, "操作取消!");
                return(false);
            }

            switch (option)
            {
            case 0 when flameEles < flameNeed:
                MsgSender.PushMsg(MsgDTO, "火焰精魄不足,无法晋升!");
                return(false);

            case 0:
                asset.FlameEssence -= flameNeed;
                archaeologist.Flame++;
                break;

            case 1 when iceEles < iceNeed:
                MsgSender.PushMsg(MsgDTO, "寒冰精魄不足,无法晋升!");
                return(false);

            case 1:
                asset.IceEssence -= iceNeed;
                archaeologist.Ice++;
                break;

            case 2 when lightningEles < lighningNeed:
                MsgSender.PushMsg(MsgDTO, "雷电精魄不足,无法晋升!");
                return(false);

            case 2:
                asset.LightningEssence -= lighningNeed;
                archaeologist.Lightning++;
                break;
            }

            asset.Update();
            archaeologist.Update();

            MsgSender.PushMsg(MsgDTO, "晋升成功!");
            return(true);
        }