Files
SlaveMatrix-SDL/SlaveMatrix/SlaveMatrix/BodyPartClasses/キャップ処理.cs
2026-06-13 22:38:57 -05:00

743 lines
24 KiB
C#

using System.Collections.Generic;
using System.Drawing;
using _2DGAMELIB;
using SlaveMatrix.GameClasses;
namespace SlaveMatrix
{
public class : B
{
public ConstProp CP中 = new ConstProp();
public ConstProp CP左 = new ConstProp();
public ConstProp CP右 = new ConstProp();
public CharacterElement 1;
public CharacterElement 2;
public CharacterElement 3;
private Dictionary<Element, CharacterElement> = new Dictionary<Element, CharacterElement>();
private ;
private ;
public bool ;
public bool ;
public bool ;
private bool f;
private Motion ;
private bool _;
private bool _;
private bool _;
public bool Is仮着
{
get
{
if (( || !Isキャップ1着()) && ( || !Isキャップ2左着()))
{
if (!)
{
return Isキャップ2右着();
}
return false;
}
return true;
}
}
public bool
{
get
{
return _;
}
set
{
_ = value;
if (!_)
{
Bod.1.C = DataConsts.Vec2DZero;
}
if (_ || _ || _)
{
.Start();
}
else
{
.End();
}
}
}
public bool
{
get
{
return _;
}
set
{
_ = value;
if (!_)
{
Bod.1.C = DataConsts.Vec2DZero;
}
if (_ || _ || _)
{
.Start();
}
else
{
.End();
}
}
}
public bool
{
get
{
return _;
}
set
{
_ = value;
if (!_)
{
Bod.1.C = DataConsts.Vec2DZero;
}
if (_ || _ || _)
{
.Start();
}
else
{
.End();
}
}
}
public void (Element )
{
調UI..Enqueue(delegate(RenderArea a)
{
調UI..Sound(a, ..GetAreaPoint(0.01), GlobalState..GetVal(1.0, 1.0), new Font("MS Gothic", 1f), ColorHelper.Black, 0.2, b: true);
});
}
public void (Element )
{
調UI..Enqueue(delegate(RenderArea a)
{
調UI..Sound(a, ..GetAreaPoint(0.01), GlobalState..GetVal(1.0, 1.0), new Font("MS Gothic", 1f), ColorHelper.Black, 0.2, b: true);
});
}
public void (Element )
{
if (( is 1 && CP中.GetFlag(0.2)) || ( is 2 && !. && CP左.GetFlag(0.2)) || ( is 2 && . && CP右.GetFlag(0.2)))
{
調UI..Enqueue(delegate(RenderArea a)
{
調UI..Sound(a, ..GetAreaPoint(0.02), GlobalState..GetVal(1.0, 1.0), new Font("MS Gothic", 1f), ColorHelper.Black, 0.15, b: true);
});
}
}
public bool Isキャップ1着()
{
return Bod.Setキャップ1.Equals();
}
public bool Isキャップ2左着()
{
return Bod.Setキャップ2左.Equals();
}
public bool Isキャップ2右着()
{
return Bod.Setキャップ2右.Equals();
}
private void (bool )
{
if (GlobalState.GameData.)
{
ip.SubInfoIm = "MCl:" + ( ? GameText. : GameText.) + "\r\nLCl:" + GameText.;
}
}
private void ()
{
if (GlobalState.GameData.)
{
ip.SubInfoIm = "LCl:" + GameText.;
}
}
private void ()
{
if (GlobalState.GameData.)
{
if (f)
{
ip.SubInfoIm = "";
}
else
{
ip.SubInfoIm = "RCl:" + GameText.;
}
}
}
private void SetFocus(Vector2D p)
{
if (調UI.Focus == 1)
{
if (2.Show)
{
調UI.Focus = 2;
}
else if (3.Show)
{
調UI.Focus = 3;
}
else
{
f = true;
}
1.Show = false;
1.使 = UsageStatus.Attach;
}
else if (調UI.Focus == 2)
{
if (1.Show)
{
調UI.Focus = 1;
}
else if (3.Show)
{
調UI.Focus = 3;
}
else
{
f = true;
}
2.Show = false;
2.使 = UsageStatus.Attach;
}
else if (調UI.Focus == 3)
{
if (1.Show)
{
調UI.Focus = 1;
}
else if (2.Show)
{
調UI.Focus = 2;
}
else
{
f = true;
}
3.Show = false;
3.使 = UsageStatus.Attach;
}
調UI.Focus.Element.B = p;
if (!f)
{
調UI.Set持ち手();
}
}
public void ()
{
if ()
{
= false;
Bod.Setキャップ1 = ;
if (.ContainsKey(Bod.1))
{
[Bod.1].Show = true;
[Bod.1].DraShow = true;
[Bod.1].StaShow = true;
[Bod.1].Show = true;
[Bod.1].Element.Intensity = 0.5;
[Bod.1].使 = UsageStatus.Standby;
.Remove(Bod.1);
}
= false;
}
}
public void Move(ref MouseButtons mb, ref Vector2D cp, ref Vector2D op, ref Color hc, ref ContactD cd)
{
if (調UI.Focus == 調UI.CM)
{
if (!調UI..Isモード)
{
if ( && (cd.e is 1 || cd.c == ContactType.Nucleus))
{
調UI..Body.SetIndexX(5);
調UI.Set_キャップ中(調UI.);
();
}
else if ( && (cd.e is 2 || cd.c == ContactType.Milk) && !cd.e.)
{
調UI.CM.Show = false;
調UI. = true;
調UI..B = cp;
調UI..Body.SetIndexX(5);
調UI.Set_キャップ左(調UI.);
();
}
else if ( && (cd.e is 2 || cd.c == ContactType.Milk) && cd.e.)
{
調UI..Body.SetIndexX(5);
調UI.Set_キャップ右(調UI.);
();
}
else if (cd.c != ContactType.Milk && ( || || ) && (調UI..Body.GetIndexX() == 5 || 調UI..Body.GetIndexX() == 5))
{
調UI. = false;
調UI.CM.Show = true;
調UI..Body.SetIndexX(0);
調UI..Body.SetIndexX(0);
}
}
}
else if (調UI.Focus == 1 || 調UI.Focus == 2 || 調UI.Focus == 3)
{
if (! && (cd.e is 1 || cd.c == ContactType.Nucleus) && (Cha.CharacterData. || (!Cha.Body.Is蠍 && (!Cha.Body.Is蛇 || !Cha.Body..))))
{
調UI.(ref cd);
調UI.Focus.DraShow = false;
Bod.Setキャップ1 = ;
調UI.Set_キャップ中(調UI.);
();
}
else if (! && (cd.e is 2 || cd.c == ContactType.Milk) && !cd.e.)
{
調UI.(ref cd);
調UI.Focus.DraShow = false;
Bod.Setキャップ2左 = ;
調UI.Set_キャップ左(調UI.);
();
}
else if (! && (cd.e is 2 || cd.c == ContactType.Milk) && cd.e.)
{
調UI.(ref cd);
調UI.Focus.DraShow = false;
Bod.Setキャップ2右 = ;
調UI.Set_キャップ右(調UI.);
();
}
else
{
if (! && Isキャップ1着())
{
Bod.Setキャップ1 = ;
調UI.Focus.DraShow = true;
調UI.();
}
else if (! && Isキャップ2左着())
{
Bod.Setキャップ2左 = ;
調UI.Focus.DraShow = true;
調UI.();
}
else if (! && Isキャップ2右着())
{
Bod.Setキャップ2右 = ;
調UI.Focus.DraShow = true;
調UI.();
}
();
}
}
if (f)
{
調UI.Focus = 調UI.CM;
調UI.Set持ち手();
f = false;
}
}
public void Down(ref MouseButtons mb, ref Vector2D cp, ref Vector2D op, ref Color hc, ref ContactD cd)
{
if (調UI.Focus.Element.Intensity == 1.0)
{
if (f)
{
調UI.Focus = 調UI.CM;
f = false;
}
if (調UI.Focus == 調UI.CM)
{
if ( && (cd.e is 1 || cd.c == ContactType.Nucleus))
{
調UI.(ref cd);
if (mb == MouseButtons.Middle)
{
調UI.Set_キャップ中(調UI.);
= !;
();
if ()
{
調UI.Action(ContactType.Nucleus, ActionType., CurrentState.Start, ToolType., 0, 1, : false, : false);
Player.();
Player.();
}
else
{
調UI.Action(ContactType.Nucleus, ActionType., CurrentState.End, ToolType., 0, 1, : false, : false);
Player.();
Player.();
}
}
else if (!調UI..Is乳繰り && mb == MouseButtons.Left)
{
調UI.Action(ContactType.Nucleus, ActionType., CurrentState.End, ToolType., 0, 1, : false, : false);
Player.();
Player.();
(Bod.1);
();
= false;
Bod.Setキャップ1 = ;
[Bod.1].Show = true;
[Bod.1].DraShow = true;
[Bod.1].StaShow = true;
[Bod.1].Show = true;
[Bod.1].Element.Intensity = 0.5;
[Bod.1].使 = UsageStatus.Standby;
.Remove(Bod.1);
= false;
}
}
else if ( && (cd.e is 2 || cd.c == ContactType.Milk) && !cd.e.)
{
調UI.(ref cd);
if (mb == MouseButtons.Middle)
{
調UI.Set_キャップ左(調UI.);
= !;
();
if ()
{
調UI.Action(ContactType.Milk, ActionType.Milk, CurrentState.Start, ToolType., 0, 1, : false, : false);
Player.();
Player.();
}
else
{
調UI.Action(ContactType.Milk, ActionType.Milk, CurrentState.End, ToolType., 0, 1, : false, : false);
Player.();
Player.();
}
}
else if (!調UI..Is乳繰り && mb == MouseButtons.Left)
{
調UI.Action(ContactType.Milk, ActionType., CurrentState.End, ToolType., 0, 1, : false, : false);
Player.();
Player.();
(Bod.2);
();
= false;
Bod.Setキャップ2左 = ;
[Bod.2].Show = true;
[Bod.2].DraShow = true;
[Bod.2].StaShow = true;
[Bod.2].Show = true;
[Bod.2].Element.Intensity = 0.5;
[Bod.2].使 = UsageStatus.Standby;
.Remove(Bod.2);
= false;
}
}
else
{
if (! || (!(cd.e is 2) && cd.c != ContactType.Milk) || !cd.e.)
{
return;
}
調UI.(ref cd);
if (mb == MouseButtons.Middle)
{
調UI.Set_キャップ右(調UI.);
= !;
();
if ()
{
調UI.Action(ContactType.Milk, ActionType.Milk, CurrentState.Start, ToolType., 0, 1, : false, : false);
Player.();
Player.();
}
else
{
調UI.Action(ContactType.Milk, ActionType.Milk, CurrentState.End, ToolType., 0, 1, : false, : false);
Player.();
Player.();
}
}
else if (!調UI..Is乳繰り && mb == MouseButtons.Left)
{
調UI.Action(ContactType.Milk, ActionType., CurrentState.End, ToolType., 0, 1, : false, : false);
Player.();
Player.();
(Bod.2);
();
= false;
Bod.Setキャップ2右 = ;
[Bod.2].Show = true;
[Bod.2].DraShow = true;
[Bod.2].StaShow = true;
[Bod.2].Show = true;
[Bod.2].Element.Intensity = 0.5;
[Bod.2].使 = UsageStatus.Standby;
.Remove(Bod.2);
= false;
}
}
}
else
{
if (調UI.Focus != 1 && 調UI.Focus != 2 && 調UI.Focus != 3)
{
return;
}
if (mb == MouseButtons.Left)
{
if (! && (cd.c == ContactType.Nucleus || cd.e == Bod.1) && (Cha.CharacterData. || (!Cha.Body.Is蠍 && (!Cha.Body.Is蛇 || !Cha.Body..))))
{
Bod.Setキャップ1 = ;
.Add(Bod.1, 調UI.Focus);
= true;
SetFocus(Bod.1.);
調UI.Action(ContactType.Nucleus, ActionType., CurrentState.Start, ToolType., 0, 1, : false, : false);
Player.();
Player.();
(Bod.1);
}
else if (! && (cd.c == ContactType.Milk || cd.e == Bod.2) && !cd.e.)
{
Bod.Setキャップ2左 = ;
.Add(Bod.2, 調UI.Focus);
= true;
SetFocus(Bod.2.);
調UI.Action(ContactType.Milk, ActionType., CurrentState.Start, ToolType., 0, 1, : false, : false);
Player.();
Player.();
(Bod.2);
}
else if (! && (cd.c == ContactType.Milk || cd.e == Bod.2) && cd.e.)
{
Bod.Setキャップ2右 = ;
.Add(Bod.2, 調UI.Focus);
= true;
SetFocus(Bod.2.);
調UI.Action(ContactType.Milk, ActionType., CurrentState.Start, ToolType., 0, 1, : false, : false);
Player.();
Player.();
(Bod.2);
}
}
else if (mb == MouseButtons.Right && !Is仮着)
{
調UI.();
}
();
}
}
else if ((調UI.Focus == 1 || 調UI.Focus == 2 || 調UI.Focus == 3) && mb == MouseButtons.Right)
{
調UI.();
}
}
public void Up(ref MouseButtons mb, ref Vector2D cp, ref Color hc)
{
if (調UI.Focus == 調UI.CM)
{
調UI.();
}
}
public void Leave(ref MouseButtons mb, ref Vector2D cp, ref Color hc)
{
}
public void Wheel(ref MouseButtons mb, ref Vector2D cp, ref int dt, ref Color hc)
{
}
public (TrainingUI 調UI)
: base(調UI)
{
2 = this;
double disUnit = 調UI.Are.DisplayUnitScale;
.SetDefault();
1D e = new 1D();
e.SetValuesD("表示", true);
1 = new CharacterElement(Med, 調UI, 調UI.1 = new 1(disUnit, .N0, null, Med, e));
2 = new CharacterElement(Med, 調UI, 調UI.2 = new 1(disUnit, .N0, null, Med, e));
3 = new CharacterElement(Med, 調UI, 調UI.3 = new 1(disUnit, .N0, null, Med, e));
= default();
.SetDefault();
調UI.1.();
調UI.2.();
調UI.3.();
調UI.1.Intensity = 0.5;
調UI.2.Intensity = 0.5;
調UI.3.Intensity = 0.5;
調UI.1CharacterElement = 1;
調UI.2CharacterElement = 2;
調UI.3CharacterElement = 3;
double d = 0.0005;
Vector2D p = DataConsts.Vec2DZero;
= new Motion(-1.0, 1.0)
{
BaseSpeed = double.MaxValue,
OnStart = delegate
{
},
OnUpdate = delegate(Motion m)
{
if (2._)
{
p.X = m.Value * d;
p.Y = 0.0 - p.X;
2.Bod.2.C = p;
調UI.Action(ContactType.Milk, ActionType.Milk, CurrentState.Continue, ToolType., 0, 1, : true, : false);
Player.();
2.(2.Bod.2);
}
if (2._)
{
p.X = (0.0 - m.Value) * d;
p.Y = p.X;
2.Bod.2.C = p;
調UI.Action(ContactType.Milk, ActionType.Milk, CurrentState.Continue, ToolType., 0, 1, : true, : false);
Player.();
2.(2.Bod.2);
}
if (2._)
{
p.X = m.Value * d * 1.44;
p.Y = 0.0;
2.Bod.1.C = p;
調UI.Action(ContactType.Nucleus, ActionType., CurrentState.Continue, ToolType., 0, 1, : true, : false);
Player.();
2.(2.Bod.1);
}
},
OnReach = delegate
{
},
OnLoop = delegate
{
},
OnEnd = delegate(Motion m)
{
m.ResetValue();
2.Bod.2.C = DataConsts.Vec2DZero;
2.Bod.2.C = DataConsts.Vec2DZero;
2.Bod.1.C = DataConsts.Vec2DZero;
}
};
調UI.Mots.Add(.GetHashCode().ToString(), );
}
public void SetCha(Character Cha)
{
base.Cha = Cha;
Bod = Cha.Body;
}
public new void Reset()
{
if ()
{
= false;
Bod.Setキャップ1 = ;
if (.ContainsKey(Bod.1))
{
.Remove(Bod.1);
}
= false;
}
if ()
{
= false;
Bod.Setキャップ2左 = ;
if (.ContainsKey(Bod.2))
{
.Remove(Bod.2);
}
= false;
}
if ()
{
= false;
Bod.Setキャップ2右 = ;
if (.ContainsKey(Bod.2))
{
.Remove(Bod.2);
}
= false;
}
1.Show = true;
1.DraShow = true;
1.StaShow = true;
1.Show = true;
1.Element.Intensity = 0.5;
1.使 = UsageStatus.Standby;
2.Show = true;
2.DraShow = true;
2.StaShow = true;
2.Show = true;
2.Element.Intensity = 0.5;
2.使 = UsageStatus.Standby;
3.Show = true;
3.DraShow = true;
3.StaShow = true;
3.Show = true;
3.Element.Intensity = 0.5;
3.使 = UsageStatus.Standby;
base.Reset();
CP中.Reset();
CP左.Reset();
CP右.Reset();
.Clear();
= default();
= default();
= false;
= false;
= false;
f = false;
?.End();
_ = false;
_ = false;
_ = false;
= false;
= false;
= false;
.SetDefault();
調UI.1.Intensity = 0.5;
調UI.2.Intensity = 0.5;
調UI.3.Intensity = 0.5;
}
}
}