using System;
using MaidStatus;
using MaidStatus.Old;

public static class YotogiOldPlay
{
	public static YotogiOld.ExcitementStatus GetExcitementStatus(int excite)
	{
		if (excite < 0)
		{
			return YotogiOld.ExcitementStatus.Minus;
		}
		if (excite < 100)
		{
			return YotogiOld.ExcitementStatus.Small;
		}
		if (excite < 200)
		{
			return YotogiOld.ExcitementStatus.Medium;
		}
		return YotogiOld.ExcitementStatus.Large;
	}

	public static YotogiOld.RCType GetRCType(int before_excite, int current_excite)
	{
		if (0 <= before_excite && current_excite <= -1)
		{
			return YotogiOld.RCType.RC_1;
		}
		if (before_excite <= 199 && 200 <= current_excite)
		{
			return YotogiOld.RCType.RC2;
		}
		if (before_excite <= 99 && 100 <= current_excite)
		{
			return YotogiOld.RCType.RC1;
		}
		if (before_excite <= -1 && 0 <= current_excite)
		{
			return YotogiOld.RCType.RC0;
		}
		return YotogiOld.RCType.RCNull;
	}

	public static YotogiOld.RRCType GetRRCType(int before_excite, int current_excite)
	{
		if (before_excite == current_excite)
		{
			if (current_excite == -100)
			{
				return YotogiOld.RRCType.RRC_4;
			}
			if (current_excite == 300)
			{
				return YotogiOld.RRCType.RRC10;
			}
		}
		int num = (before_excite >= current_excite) ? -100 : 300;
		int num2 = (before_excite >= current_excite) ? 25 : -25;
		YotogiOld.RRCType rrctype = (num != 300) ? YotogiOld.RRCType.RRC_4 : YotogiOld.RRCType.RRC10;
		for (int i = 0; i < 16; i++)
		{
			if (num == 0 || num == 100 || num == 200)
			{
				num += num2;
			}
			if (0 < num)
			{
				if (before_excite < num && num <= current_excite)
				{
					return rrctype;
				}
			}
			else
			{
				if (before_excite <= num && num < current_excite)
				{
					return rrctype;
				}
				if (current_excite <= num && num < before_excite)
				{
					return rrctype;
				}
			}
			num += num2;
			rrctype += num2 / Math.Abs(num2);
		}
		return YotogiOld.RRCType.RRCNull;
	}

	public static YotogiOld.RRType GetRRType(int current_excite)
	{
		int num = Math.Abs(current_excite) / 50;
		if (current_excite < 0)
		{
			num++;
			if (2 < num)
			{
				num = 2;
			}
			num *= -1;
		}
		else if (5 < num)
		{
			num = 5;
		}
		return YotogiOld.RRType.RR1 + num;
	}

	public enum PlayerState
	{
		Normal,
		Insert
	}

	public struct Param
	{
		public static YotogiOldPlay.Param Create(Maid maid)
		{
			MaidStatus.Status status = maid.status;
			return new YotogiOldPlay.Param
			{
				cur_excite = status.currentExcite,
				cur_mind = status.currentMind,
				cur_reason = status.currentReason,
				inyoku = status.inyoku,
				m_value = status.mvalue,
				hentai = status.hentai,
				housi = status.housi,
				frustration = status.OldStatus.frustration,
				lovely = status.lovely,
				elegance = status.elegance,
				charm = status.charm,
				reception = status.reception,
				teach_rate = status.teachRate,
				yotogi_type_level = status.selectedYotogiClass.level,
				yotogi_type_total_exp = status.selectedYotogiClass.expSystem.GetTotalExp(),
				sexual = new Sexual(status.OldStatus.sexual)
			};
		}

		public static YotogiOldPlay.Param operator +(YotogiOldPlay.Param a, YotogiOldPlay.Param b)
		{
			return new YotogiOldPlay.Param
			{
				cur_excite = a.cur_excite + b.cur_excite,
				cur_mind = a.cur_mind + b.cur_mind,
				cur_reason = a.cur_reason + b.cur_reason,
				inyoku = a.inyoku + b.inyoku,
				m_value = a.m_value + b.m_value,
				hentai = a.hentai + b.hentai,
				housi = a.housi + b.housi,
				frustration = a.frustration + b.frustration,
				lovely = a.lovely + b.lovely,
				elegance = a.elegance + b.elegance,
				charm = a.charm + b.charm,
				reception = a.reception + b.reception,
				teach_rate = a.teach_rate + b.teach_rate,
				yotogi_type_level = a.yotogi_type_level + b.yotogi_type_level,
				yotogi_type_total_exp = a.yotogi_type_total_exp + b.yotogi_type_total_exp,
				sexual = a.sexual + b.sexual
			};
		}

		public static YotogiOldPlay.Param operator -(YotogiOldPlay.Param a, YotogiOldPlay.Param b)
		{
			return new YotogiOldPlay.Param
			{
				cur_excite = a.cur_excite - b.cur_excite,
				cur_mind = a.cur_mind - b.cur_mind,
				cur_reason = a.cur_reason - b.cur_reason,
				inyoku = a.inyoku - b.inyoku,
				m_value = a.m_value - b.m_value,
				hentai = a.hentai - b.hentai,
				housi = a.housi - b.housi,
				frustration = a.frustration - b.frustration,
				lovely = a.lovely - b.lovely,
				elegance = a.elegance - b.elegance,
				charm = a.charm - b.charm,
				reception = a.reception - b.reception,
				teach_rate = a.teach_rate - b.teach_rate,
				yotogi_type_level = a.yotogi_type_level - b.yotogi_type_level,
				yotogi_type_total_exp = a.yotogi_type_total_exp - b.yotogi_type_total_exp,
				sexual = a.sexual - b.sexual
			};
		}

		public int cur_excite;

		public int cur_mind;

		public int cur_reason;

		public int inyoku;

		public int m_value;

		public int hentai;

		public int housi;

		public int frustration;

		public int lovely;

		public int elegance;

		public int charm;

		public int reception;

		public int teach_rate;

		public int yotogi_type_level;

		public int yotogi_type_total_exp;

		public Sexual sexual;
	}
}
