protected virtual BattleHitStatus getHitStatus(int hitProb, int avoProb, Mem_ship attackShip, Mem_ship targetShip, double cliticalKeisu) { double num = (double)(hitProb - avoProb); FatigueState fatigueState = targetShip.Get_FatigueState(); if (num <= 10.0) { num = 10.0; } double num2 = 1.0; if (fatigueState == FatigueState.Exaltation) { num2 = 0.7; } else if (fatigueState == FatigueState.Normal) { num2 = 1.0; } else if (fatigueState == FatigueState.Light) { num2 = 1.2; } else if (fatigueState == FatigueState.Distress) { num2 = 1.4; } num *= num2; if (num >= 96.0) { num = 96.0; } double num3 = 0.0; double num4 = 1.0; int num5 = r.Next(100); double num6 = Math.Sqrt(num) * cliticalKeisu; calHitRate = num; calCriticalRate = num6; if ((double)num5 <= num6) { return(BattleHitStatus.Critical); } if ((double)num5 > num) { return(BattleHitStatus.Miss); } return(BattleHitStatus.Normal); }
protected virtual int getHougHitProb(Mem_ship atk_ship, List <Mst_slotitem> atk_slot, List <int> slotLevel) { double num = 0.0; List <int> list = slotLevel; double num2 = 0.0; int num3 = 0; using (var enumerator = Enumerable.Select(atk_slot, (Mst_slotitem obj, int idx) => new { obj, idx }).GetEnumerator()) { while (enumerator.MoveNext()) { var current = enumerator.Current; num3 += current.obj.Houm; num2 += this.getHougSlotPlus_Hit(current.obj, list[current.idx]); } } double num4 = Math.Sqrt((double)atk_ship.Luck * 1.5) + Math.Sqrt((double)atk_ship.Level) * 2.0 + (double)num3; double num5 = this.valance2 + num4 + num2; FatigueState fatigueState = atk_ship.Get_FatigueState(); double num6 = 1.0; if (fatigueState == FatigueState.Exaltation) { num6 = 1.2; } else if (fatigueState == FatigueState.Light) { num6 = 0.8; } else if (fatigueState == FatigueState.Distress) { num6 = 0.5; } num5 *= num6; num5 = this.getHougHitProbUpValue(num5, atk_ship, atk_slot); double num7 = num5 * num; num5 += num7; return((int)num5); }