public int[] WH; //没有什么效果 protected override void Update() { int max = 0; for (int i = 0; i < Pms.Length; ++i) { PokemonOutward p = GetPokemon(Pms[i]); p.Hurt(Damages[i]); AppendGameLog(Ls.Hurt, LogStyle.Detail | LogStyle.NoBr, Pms[i]); AppendGameLog(Ls.nhp, LogStyle.Detail | LogStyle.NoBr | LogStyle.HiddenInBattle, -Damages[i]); AppendGameLog(Ls.br, LogStyle.Detail); if (Damages[i] > max) { max = Damages[i]; } } Sleep = 11 * max; if (SH != null) { AppendGameLog("SuperHurt" + SH.Length, SH.ValueOrDefault(0), SH.ValueOrDefault(1), SH.ValueOrDefault(2)); } if (WH != null) { AppendGameLog("WeakHurt" + WH.Length, WH.ValueOrDefault(0), WH.ValueOrDefault(1), WH.ValueOrDefault(2)); } if (CT != null) { AppendGameLog("CT" + CT.Length, CT.ValueOrDefault(0), CT.ValueOrDefault(1), CT.ValueOrDefault(2)); } }
public Pokemon2D() { IsHitTestVisible = false; UseLayoutRounding = true; Image = new Image() { Stretch = Stretch.UniformToFill }; Image.SnapsToDevicePixels = true; Image.Effect = ImageEffect = new BlurEffect() { Radius = 0, KernelType = KernelType.Box }; Children.Add(Image); FaintAnimation = new DoubleAnimation(0, 0, Duration.Automatic); FaintAnimation.Completed += (sender, e) => { Image.Source = null; Pokemon.RemoveListener(this); Pokemon = null; Image.BeginAnimation(Image.HeightProperty, null); }; BeginChangeImageAnimation = new DoubleAnimation(0, 15, new Duration(TimeSpan.FromSeconds(0.5))); EndChangeImageAnimation = new DoubleAnimation(0, new Duration(TimeSpan.FromSeconds(0.5))); BeginChangeImageAnimation.Completed += (sender, e) => { RefreshImage(); ImageEffect.BeginAnimation(BlurEffect.RadiusProperty, EndChangeImageAnimation); }; }
void IPokemonOutwardEvents.Withdrawn() { Image.Source = null; if (Pokemon != null) { Pokemon.RemoveListener(this); Pokemon = null; } }
public void SendOut(PokemonOutward pm) { Pokemon = pm; if (Pokemon != null) { Image.Visibility = System.Windows.Visibility.Visible; Pokemon.AddListener(this); RefreshImage(); } }
public void SetPokemon(PokemonOutward pokemon) { if (Pokemon != pokemon) { if (Pokemon != null) { Pokemon.RemoveListener(this); } Pokemon = pokemon; if (Pokemon == null) { Image.Source = null; } else { Image.Visibility = Pokemon.Position.Y == CoordY.Plate ? Visibility.Visible : Visibility.Collapsed; Pokemon.AddListener(this); RefreshImage(); } } }
/// <summary> /// 同一精灵的Outward在一段战报中可能出现多次,每次应是不同的Outward /// </summary> /// <returns></returns> internal PokemonOutward GetOutward() { Pokemon o = OnboardPokemon.GetCondition <Pokemon>(Cs.Illusion); var form = o == null ? OnboardPokemon.Form : o.Form; if (o == null) { o = Pokemon; } var name = o.Name; var gender = o.Gender;//即使对战画面中不显示性别,实际性别也与变身对象一致,可以被着迷。 var lv = Pokemon.Lv; var shiny = o.Shiny; var position = new Position(Pokemon.TeamId, OnboardPokemon.X, OnboardPokemon.CoordY); var substitute = OnboardPokemon.HasCondition(Cs.Substitute); var hp = Pokemon.Hp; var state = State; var outward = new PokemonOutward(Id, Pokemon.TeamId, Pokemon.MaxHp); outward.SetAll(name, form, gender, lv, position, substitute, hp, state, shiny); return(outward); }