예제 #1
0
    public static OtherBase GetItem(long objNo)
    {
        TableOtherData data = Array.Find(Table, i => i.ObjNo == objNo);
        OtherBase      item = new OtherBase();

        item.Initialize();
        item.ObjNo          = data.ObjNo;
        item.DisplayName    = data.DisplayName;
        item.ThrowDexterity = data.ThrowDexterity;
        item.Description    = data.Description;
        return(item);
    }
예제 #2
0
 /// <summary>
 /// 方法说明:根据触角SDK聊天信息转换为平台SDK聊天信息进行发送
 /// </summary>
 /// <param name="antsdksend"></param>
 /// <returns></returns>
 internal static MsSdkOther.SdkOtherBase GetSdkSend(OtherBase antsdksend)
 {
     if (antsdksend == null)
     {
         return(null);
     }
     try
     {
         //预留符合标准聊天消息结构的其他消息发送,走此路径
         //没有找到返回空
         return(antsdksend.GetSdkSendBase <MsSdkOther.SdkOtherBase>());
     }
     catch (Exception ex)
     {
         LogHelper.WriteError(
             $"[AntSdkOtherMsg.GetSdkSend]:{Environment.NewLine}{ex.Message}{ex.StackTrace}");
         return(null);
     }
 }
    /// <summary>
    /// 対象のアイテムを持ち物に追加する
    /// </summary>
    /// <param name="item"></param>
    public void AddItem(BaseItem item, long sort)
    {
        if (item.IType == ItemType.Other &&
            ((OtherBase)item).OType == OtherType.Dollar &&
            item.IsDrive == false)
        {
            OtherBase o = (OtherBase)item;
            HaveDollar += o.SellingPrice;
        }
        else
        {
            item.SortNo = sort;


            ScoreInformation.Info.AddScore(1);

            if (ItemList.Contains(item) == true)
            {
                ErrorInformation.Info.Initialize();
                ErrorInformation.Info.SendLogCorutine(new Exception(),
                                                      CommonFunction.CammaString(item.ObjNo, item.IsDrive, HasItemPlayer(item)));
            }
            else
            {
                ItemList.Add(item);
            }

            //ドライブだったら中身も追加する
            if (item.IType == ItemType.Bag)
            {
                foreach (BaseItem i in ((BagBase)item).BagItems)
                {
                    i.SortNo = sort;
                    ItemList.Add(i);
                }
            }
        }
    }
예제 #4
0
    /// <summary>
    /// アイテムを入れる
    /// </summary>
    public BaseItem PutinItem(int itype, BaseItem target, PlayerCharacter player)
    {
        //サウンドを鳴らす
        SoundInformation.Sound.Play(SoundInformation.SoundType.Putin);

        DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.PutinAction, target.DisplayNameInMessage, this.DisplayNameInMessage));

        switch (BgType)
        {
        //保存
        case BagType.Save:

            BagItems.Add(target);
            target.InDrive = this;
            return(target);

            break;

        //Recycle
        case BagType.Recycle:

            //ターゲットが別のバッグに入っていたら取り出しておく
            if (target.IsDrive == true)
            {
                BagBase bag = target.InDrive;
                bag.PutoutItem(target);
            }

            OtherBase d = TableOther.GetItem(CommonConst.ObjNo.Dollar);
            d.Initialize();
            d.SellingPrice = target.SellingPrice;

            player.RecoverHp(999);
            EffectDamage dm = EffectDamage.CreateObject(player);
            dm.SetText("999", AttackState.Heal);
            dm.Play();
            SoundInformation.Sound.Play(SoundInformation.SoundType.Recover);

            BagItems.Add(d);
            d.InDrive = this;

            return(d);

            break;

        //変化
        case BagType.Change:
            //ターゲットが別のバッグに入っていたら取り出しておく
            if (target.IsDrive == true)
            {
                BagBase bag = target.InDrive;
                bag.PutoutItem(target);
            }
            //uintの乱数を取得
            uint     rand = CommonFunction.GetRandomUInt32();
            BaseItem ch   = TableItemIncidence.GetItem(itype, rand, true);
            if (CommonFunction.IsNull(ch) == true)
            {
                return(null);
            }
            int stopper = 0;
            while (ch.IType == ItemType.Bag || ch.IType == ItemType.Material)
            {
                if (stopper > 30)
                {
                    return(null);
                }
                stopper++;
                rand = CommonFunction.GetRandomUInt32();
                ch   = TableItemIncidence.GetItem(itype, rand, true);
            }

            ch.IsAnalyse = DungeonInformation.Info.IsAnalyze == false;
            BagItems.Add(ch);
            ch.InDrive = this;

            //PlayerCharacter.RemoveItem(target);
            //player.AddItem(ch, DateTime.Now.Ticks);

            return(ch);

            break;

        //コロッケ
        case BagType.Food:
            //ターゲットが別のバッグに入っていたら取り出しておく
            if (target.IsDrive == true)
            {
                BagBase bag = target.InDrive;
                bag.PutoutItem(target);
            }
            BaseItem tar = TableItemIncidence.GetTypeItemRandom(itype, ItemType.Food, true);
            if (CommonFunction.IsNull(tar) == true)
            {
                return(null);
            }
            BagItems.Add(tar);
            tar.InDrive = this;

            //PlayerCharacter.RemoveItem(target);
            //player.AddItem(tar, DateTime.Now.Ticks);

            return(tar);

            break;

        //普通
        case BagType.Normal:

            BagItems.Add(target);
            target.InDrive = this;
            return(target);

            break;
        }

        return(target);
    }