mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
点击说话也带有效果
This commit is contained in:
parent
6228c04119
commit
8fa8371cdd
@ -13,7 +13,7 @@ namespace VPet_Simulator.Windows.Interface
|
||||
/// <summary>
|
||||
/// 点击桌宠时触发的乱说话
|
||||
/// </summary>
|
||||
public class ClickText : ICheckText
|
||||
public class ClickText : ICheckText, IFood
|
||||
{
|
||||
public ClickText()
|
||||
{
|
||||
@ -84,5 +84,22 @@ namespace VPet_Simulator.Windows.Interface
|
||||
}
|
||||
return true;
|
||||
}
|
||||
[Line(ignoreCase: true)]
|
||||
public double Money { get; set; }
|
||||
|
||||
[Line(ignoreCase: true)]
|
||||
public int Exp { get; set; }
|
||||
[Line(ignoreCase: true)]
|
||||
public double Strength { get; set; }
|
||||
[Line(ignoreCase: true)]
|
||||
public double StrengthFood { get; set; }
|
||||
[Line(ignoreCase: true)]
|
||||
public double StrengthDrink { get; set; }
|
||||
[Line(ignoreCase: true)]
|
||||
public double Feeling { get; set; }
|
||||
[Line(ignoreCase: true)]
|
||||
public double Health { get; set; }
|
||||
[Line(ignoreCase: true)]
|
||||
public double Likability { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -467,6 +467,25 @@ namespace VPet_Simulator.Windows
|
||||
//{
|
||||
// MessageBox.Show(food.RealPrice.ToString());
|
||||
//}
|
||||
foreach (var selet in ClickTexts)
|
||||
{
|
||||
selet.Exp = Math.Max(Math.Min(selet.Exp, 1000), -1000);
|
||||
//food.Exp += selet.Exp;
|
||||
selet.Feeling = Math.Max(Math.Min(selet.Feeling, 1000), -1000);
|
||||
//food.Feeling += selet.Feeling;
|
||||
selet.Health = Math.Max(Math.Min(selet.Feeling, 100), -100);
|
||||
//food.Health += selet.Health;
|
||||
selet.Likability = Math.Max(Math.Min(selet.Likability, 50), -50);
|
||||
//food.Likability += selet.Likability;
|
||||
selet.Money = Math.Max(Math.Min(selet.Money, 1000), -1000);
|
||||
//food.Price -= selet.Money;
|
||||
selet.Strength = Math.Max(Math.Min(selet.Strength, 1000), -1000);
|
||||
//food.Strength += selet.Strength;
|
||||
selet.StrengthDrink = Math.Max(Math.Min(selet.StrengthDrink, 1000), -1000);
|
||||
//food.StrengthDrink += selet.StrengthDrink;
|
||||
selet.StrengthFood = Math.Max(Math.Min(selet.StrengthFood, 1000), -1000);
|
||||
//food.StrengthFood += selet.StrengthFood;
|
||||
}
|
||||
}
|
||||
|
||||
AutoSaveTimer.Elapsed += AutoSaveTimer_Elapsed;
|
||||
@ -636,7 +655,35 @@ namespace VPet_Simulator.Windows
|
||||
lastclicktime = DateTime.Now.Ticks;
|
||||
var rt = GetClickText();
|
||||
if (rt != null)
|
||||
{
|
||||
//聊天效果
|
||||
if (rt.Exp != 0)
|
||||
{
|
||||
if (rt.Exp > 0)
|
||||
{
|
||||
GameSavesData.Statistics[(gint)"stat_rt_exp_p"]++;
|
||||
}
|
||||
else
|
||||
GameSavesData.Statistics[(gint)"stat_rt_exp_d"]++;
|
||||
}
|
||||
if (rt.Likability != 0)
|
||||
{
|
||||
if (rt.Likability > 0)
|
||||
GameSavesData.Statistics[(gint)"stat_rt_like_p"]++;
|
||||
else
|
||||
GameSavesData.Statistics[(gint)"stat_rt_like_d"]++;
|
||||
}
|
||||
if (rt.Money != 0)
|
||||
{
|
||||
if (rt.Money > 0)
|
||||
GameSavesData.Statistics[(gint)"stat_rt_money_p"]++;
|
||||
else
|
||||
GameSavesData.Statistics[(gint)"stat_rt_money_d"]++;
|
||||
}
|
||||
Main.Core.Save.EatFood(rt);
|
||||
Main.Core.Save.Money += rt.Money;
|
||||
Main.SayRnd(rt.TranslateText);
|
||||
}
|
||||
}
|
||||
};
|
||||
Main.PlayVoiceVolume = Set.VoiceVolume;
|
||||
|
Loading…
Reference in New Issue
Block a user