1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System.Collections.Generic;
- using FL.Network;
- using XGame.Framework.Data;
- using XGame.Framework.Network;
- namespace FL.Data
- {
- public class SummonService : DataSingleton<SummonService>
- {
- /// <summary>
- /// 百分比
- /// </summary>
- /// <param name="val"></param>
- /// <returns></returns>
- public string GetProbability(float val)
- {
- return $"{(val * 100).ToString("F3")}%";
- }
- public void RequestSummonInto()
- {
- NetModule.Request(new CallIntoRequest());
- }
- public void RequestSummonSbOneDraw()
- {
- RequestSummonDraw(1, SummonData.Instance.SbInfo.OneDrawNum);
- }
- public void RequestSummonMwOneDraw()
- {
- RequestSummonDraw(2, SummonData.Instance.MwInfo.OneDrawNum);
- }
- public void RequestSummonSbTenDraw()
- {
- RequestSummonDraw(1, SummonData.Instance.SbInfo.TenDrawNum);
- }
- public void RequestSummonMwTenDraw()
- {
- RequestSummonDraw(2, SummonData.Instance.MwInfo.TenDrawNum);
- }
- private void RequestSummonDraw(int type, int count)
- {
- var param = new CallChoujiangRequest() { type = type, count = count };
- (param as IMessage).Context = type;
- NetModule.Request(param);
- }
- public void RequestSummonSbAd()
- {
- var p = new List<string>() { "act_call","1" };
- var request = new Kind11XiadanRequest() { param = p };
- NetModule.Request(request);
- }
- public void RequestSummonMwAd()
- {
- var p = new List<string>() { "act_call", "2" };
- var request = new Kind11XiadanRequest() { param = p };
- NetModule.Request(request);
- }
- public void RequestSummonSbShare()
- {
- RequestSummonShare(1);
- }
- public void RequestSummonMwShare()
- {
- RequestSummonShare(2);
- }
- private void RequestSummonShare(int type)
- {
- var param = new CallShareRwdRequest() { type = type };
- (param as IMessage).Context = type;
- NetModule.Request(param);
- }
- }
- }
|