Files
SlaveMatrix-SDL/SlaveMatrix/SlaveMatrix/BodyPartClasses/調鞭処理.cs
2026-06-14 00:30:16 +02:00

251 lines
6.5 KiB
C#

using System.Drawing;
using System.Linq;
using _2DGAMELIB;
namespace SlaveMatrix
{
public class 調 : B
{
public ;
public Motion ;
private Motion ;
private Vector2D v;
private Vector2D o;
private int x;
private MouseButtons mb;
private double _ => 0.35 + base. * 0.65;
public void ()
{
調UI..Enqueue(delegate(RenderArea a)
{
調UI..Sound(a, .Element..GetAreaPoint(0.05), Sta..GetVal(_, 1.0), new Font("MS Gothic", 1f), Col.White, 0.2 + 0.2 * _, b: true);
});
}
public void (Vector2D p)
{
調UI..Enqueue(delegate(RenderArea a)
{
調UI..Sound(a, Sta.GetAreaPoint(ref p, 0.01), Sta..GetVal(_, RNG.XS.NextDouble()), new Font("MS Gothic", 1f), Color.Red.S(_.Clamp(0.5, 1.0)), 0.2 + 0.1 * _, b: true);
});
}
private void ()
{
if (Sta.GameData.)
{
ip.SubInfoIm = "LCl:" + GameText. + "\r\nRCl:" + GameText. + "\r\nWh:" + GameText.L + + "\r\nMCl:" + GameText.;
}
}
public void Move(ref MouseButtons mb, ref Vector2D cp, ref Color hc, ref ContactD cd)
{
if (調UI.Focus == )
{
調UI.();
v = cp;
x = (o.X - v.X).Sign();
o = v;
.Element.C = 0.0;
.Element.Xi = 0;
.Element.Yi = (.Element.Yi + x).Limit(0, .Element.Body.CountY);
.Element.Body.JoinPA();
();
}
}
public void Down(ref MouseButtons mb, ref Vector2D cp, ref Color hc, ref ContactD cd)
{
if (調UI.Focus == )
{
if (!)
{
= true;
}
else if (mb == MouseButtons.Left || mb == MouseButtons.Right)
{
調UI.(ref cd);
this.mb = mb;
.Start();
();
}
else if (mb == MouseButtons.Middle)
{
.End();
.End();
調UI.();
}
}
}
public void Up(ref MouseButtons mb, ref Vector2D cp, ref Color hc)
{
}
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)
{
if (調UI.Focus == )
{
= ( + dt.Sign()).Clamp(1, 3);
.BaseSpeed = 10.0 * _;
if (!Sta.GameData.)
{
ip.SubInfoIm = "Wh:" + GameText.L + ;
}
else
{
();
}
}
}
public 調(TrainingUI 調UI, CharacterElement 調)
: base(調UI, 調)
{
調 調2 = this;
調 = 調UI.調;
bool l = false;
ShapePart p;
Vector2D cp;
Color hc;
= new Motion(0.0, 1.0)
{
BaseSpeed = 10.0 * _,
OnStart = delegate
{
l = 調2.mb == MouseButtons.Left;
.Xi = 1;
if (l)
{
.Yi = 0;
}
else
{
.Yi = 4;
}
.1_ = true;
.2_ = true;
.1CD. = 調2.;
.2CD. = 調2.;
調2.();
},
OnUpdate = delegate(Motion m)
{
if (l)
{
.C = 100.0 * m.Value;
}
else
{
.C = -100.0 * m.Value;
}
p = .Body.Current.EnumAllPar().First((ShapePart e) => e.Tag.Contains("先"));
cp = p.ToGlobal(p.JP[0].Joint);
hc = 調2.Med.GetHitColor(調2.Med.FromBasePosition(cp));
if (調UI.Bod.IsHit(hc))
{
調2..B = cp;
調2..Start();
if (調2. > 0.5)
{
調2.Bod.Add鞭痕(cp, hc);
}
調UI.Action(調2.Cha.GetContact(ref hc).c, ActionType.Whipping, CurrentState.Start, ToolType.調, 0, 調2., : false, : false);
if (0.5.Lot())
{
Player.();
}
調2.(cp);
}
},
OnReach = delegate(Motion m)
{
.1_ = false;
.2_ = false;
if (l)
{
.Yi = 4;
}
else
{
.Yi = 0;
}
.Body.JoinPA();
m.End();
},
OnLoop = delegate
{
},
OnEnd = delegate(Motion m)
{
m.ResetValue();
}
};
調UI.Mots.Add(.GetHashCode().ToString(), );
= new (Are.DisplayUnitScale, .N0, null, Med, new D
{
= false
});
.B = 1.2;
= new Motion(0.0, 1.0)
{
BaseSpeed = 5.0,
OnStart = delegate
{
調2.. = true;
調2..C = 360.0 * RNG.XS.NextDouble();
調2..C = 0.0;
//TODO fix?
//Sounds.鞭撃.Play();
},
OnUpdate = delegate(Motion m)
{
調2..C = m.Value * 調2._;
},
OnReach = delegate(Motion m)
{
m.End();
},
OnLoop = delegate
{
},
OnEnd = delegate(Motion m)
{
調2.. = false;
m.ResetValue();
}
};
調UI.Mots.Add(.GetHashCode().ToString(), );
}
public void SetCha(Character Cha)
{
base.Cha = Cha;
Bod = Cha.Body;
}
public new void Reset()
{
base.Reset();
?.End();
?.End();
v = default(Vector2D);
o = default(Vector2D);
x = 0;
mb = MouseButtons.None;
}
}
}