private int rrdSort(RewardRechargeData a, RewardRechargeData b) { if (a.money == b.money) { return(0); } if (a.money > b.money) { return(1); } return(-1); }
private Dictionary <int, int> GetChargeReward(RewardRechargeData rrd) { switch (m_self.vocation) { case Vocation.Warrior: return(rrd.items1); case Vocation.Assassin: return(rrd.items2); case Vocation.Archer: return(rrd.items3); case Vocation.Mage: return(rrd.items4); default: return(null); } }
private int CalChargePrg(int step, RewardRechargeData data) { int rst = 0; int head = 48; //头长度48 //int end = 54; //尾长度1/2中间长度 int mid = 108; //中间长度108 int currSum = step + 1; int moneymore = (int)(m_self.chargeSum - (uint)rrds[step].money); int fragmoney = 0; float pct = 0; if (currSum < rrds.Count) { fragmoney = rrds[currSum].money - rrds[step].money; pct = (float)moneymore / (float)fragmoney; } else { pct = 0; } if (step == 0 && m_self.chargeSum <= rrds[step].money) { if (m_self.chargeSum == rrds[step].money) { rst = head; } else { rst = (int)((float)head * pct); } } else { rst = head + step * mid + (int)((float)mid * pct); } return(rst); }
private Dictionary<int, int> GetChargeReward(RewardRechargeData rrd) { switch (m_self.vocation) { case Vocation.Warrior: return rrd.items1; case Vocation.Assassin: return rrd.items2; case Vocation.Archer: return rrd.items3; case Vocation.Mage: return rrd.items4; default: return null; } }
private int rrdSort(RewardRechargeData a, RewardRechargeData b) { if (a.money == b.money) { return 0; } if (a.money > b.money) { return 1; } return -1; }
private int CalChargePrg(int step, RewardRechargeData data) { int rst = 0; int head = 48; //头长度48 //int end = 54; //尾长度1/2中间长度 int mid = 108; //中间长度108 int currSum = step + 1; int moneymore = (int)(m_self.chargeSum - (uint)rrds[step].money); int fragmoney = 0; float pct = 0; if (currSum < rrds.Count) { fragmoney = rrds[currSum].money - rrds[step].money; pct = (float)moneymore / (float)fragmoney; } else { pct = 0; } if (step == 0 && m_self.chargeSum <= rrds[step].money) { if (m_self.chargeSum == rrds[step].money) { rst = head; } else { rst = (int)((float)head * pct); } } else { rst = head + step * mid + (int)((float)mid * pct); } return rst; }