public bool ViewRelationship(MsgInformationEx MsgDTO, object[] param) { var aimQQ = (long)param[0]; if (aimQQ == MsgDTO.FromQQ) { MsgSender.PushMsg(MsgDTO, "和自己的羁绊,永远是0!", true); return(false); } var relationship = IntimateRelationshipRecord.GetSumIntimate(MsgDTO.FromGroup, MsgDTO.FromQQ, aimQQ); MsgSender.PushMsg(MsgDTO, $"你们之间的羁绊值是:{relationship} !"); return(true); }
public bool PresentGift(MsgInformationEx MsgDTO, object[] param) { var aimQQ = (long)param[0]; var name = param[1] as string; if (aimQQ == MsgDTO.FromQQ) { MsgSender.PushMsg(MsgDTO, "你居然给自己送礼物!", true); return(false); } var osPerson = OSPerson.GetPerson(MsgDTO.FromQQ); if (osPerson.GiftDic == null || !osPerson.GiftDic.ContainsKey(name)) { MsgSender.PushMsg(MsgDTO, "你没有这个礼物!", true); return(false); } var gift = GiftSvc[name]; osPerson.GiftDic[name]--; osPerson.Update(); var glamourRecord = GlamourRecord.Get(MsgDTO.FromGroup, aimQQ); glamourRecord.Glamour += gift.Glamour; glamourRecord.Update(); var relationship = new IntimateRelationshipRecord() { GroupNum = MsgDTO.FromGroup, QQPair = new [] { MsgDTO.FromQQ, aimQQ }, Value = gift.Intimate, Name = gift.Name }; relationship.Insert(); var msg = $"赠送成功!对方增加了 {gift.Glamour} 点魅力值,你们之间的羁绊值增加了 {gift.Intimate} 点!"; MsgSender.PushMsg(MsgDTO, msg, true); return(true); }