Пример #1
0
 private void SetNPC(NPC npc)
 {
     STRResistLabel.Tag = npc.StrengthResistMod;
       DEXResistLabel.Tag = npc.DexterityResistMod;
       INTResistLabel.Tag = npc.IntelligenceResistMod;
       WILResistLabel.Tag = npc.WillResistMod;
       ActionsLabel.Tag = npc.ExtraActions;
       LockedButton.Visible = npc.Locked;
       SetResistModLabelToolTip(STRResistLabel);
       SetResistModLabelToolTip(DEXResistLabel);
       SetResistModLabelToolTip(INTResistLabel);
       SetResistModLabelToolTip(WILResistLabel);
       ActionCheckAdjustmentBox.Text = npc.ActionCheckAdjustment.ToString();
       ActionCheckBox.Text = npc.ActionCheck.ToString();
       ActionsBox.Text = npc.Actions.ToString();
       ArmorBox.Text = npc.Armor;
       CONBox.Text = npc.Constitution.ToString();
       DEXBox.Text = npc.Dexterity.ToString();
       FatigueBox.Text = npc.FatigueMax.ToString();
       SetTaken(FatiguePanel, npc.FatigueTaken);
       INTBox.Text = npc.Intelligence.ToString();
       MortalBox.Text = npc.MortalMax.ToString();
       SetTaken(MortalPanel, npc.MortalTaken);
       NPCNameBox.Text = npc.Name;
       SkillsBox.Text = npc.Weapons;
       OtherBox.Text = npc.Other;
       PERBox.Text = npc.Personality.ToString();
       STRBox.Text = npc.Strength.ToString();
       StunBox.Text = npc.StunMax.ToString();
       SetTaken(StunPanel, npc.StunTaken);
       WILBox.Text = npc.Will.ToString();
       WoundBox.Text = npc.WoundMax.ToString();
       SetTaken(WoundPanel, npc.WoundTaken);
       LastResortBox.Text = npc.LastResorts.ToString();
       this.Tool.Title = npc.ToolTitle;
       this.Tool.Path = npc.ToolPath;
       this.Tool.Args = npc.ToolArgs;
       this.Movement.EasySwim = npc.EasySwim;
       this.Movement.Fly = npc.Fly;
       this.Movement.Glide = npc.Glide;
       this.Movement.Run = npc.Run;
       this.Movement.Sprint = npc.Sprint;
       this.Movement.Swim = npc.Swim;
       this.Movement.Walk = npc.Walk;
       SetMovementTooltip();
       SetToolLinkToolTip();
       Dirty = false;
 }
Пример #2
0
 private void FixDeserializedNPC(NPC npc)
 {
     npc.Other = npc.Other.Replace("\n", "\r\n");
       npc.Weapons = npc.Weapons.Replace("\n", "\r\n");
 }
Пример #3
0
 public MainForm(NPC npc)
     : this()
 {
     SetNPC(npc);
 }
Пример #4
0
 public NPC YankNPCObject()
 {
     NPC npc = new NPC();
       try {
     npc.Locked = LockedButton.Visible;
     npc.ActionCheck = int.Parse(ActionCheckBox.Text);
     npc.Actions = int.Parse(ActionsBox.Text);
     npc.Armor = ArmorBox.Text;
     npc.Constitution = int.Parse(CONBox.Text);
     npc.Dexterity = int.Parse(DEXBox.Text);
     npc.FatigueMax = int.Parse(FatigueBox.Text);
     npc.FatigueTaken = CountChecked(FatiguePanel);
     npc.Intelligence = int.Parse(INTBox.Text);
     npc.MortalMax = int.Parse(MortalBox.Text);
     npc.MortalTaken = CountChecked(MortalPanel);
     npc.Name = this.NPCNameBox.Text;
     npc.Other = this.OtherBox.Text;
     npc.Weapons = this.SkillsBox.Text;
     npc.Personality = int.Parse(PERBox.Text);
     npc.Strength = int.Parse(STRBox.Text);
     npc.StunMax = int.Parse(StunBox.Text);
     npc.StunTaken = CountChecked(StunPanel);
     npc.Will = int.Parse(WILBox.Text);
     npc.WoundMax = int.Parse(WoundBox.Text);
     npc.WoundTaken = CountChecked(WoundPanel);
     npc.StrengthResistMod = (int)STRResistLabel.Tag;
     npc.DexterityResistMod = (int)DEXResistLabel.Tag;
     npc.IntelligenceResistMod = (int)INTResistLabel.Tag;
     npc.WillResistMod = (int)WILResistLabel.Tag;
     npc.ActionCheckAdjustment = int.Parse(this.ActionCheckAdjustmentBox.Text);
     npc.ExtraActions = (int)ActionsLabel.Tag;
     npc.ToolTitle = this.Tool.Title;
     npc.ToolPath = this.Tool.Path;
     npc.ToolArgs = this.Tool.Args;
     npc.Sprint = this.Movement.Sprint;
     npc.Run = this.Movement.Run;
     npc.Walk = this.Movement.Walk;
     npc.EasySwim = this.Movement.EasySwim;
     npc.Swim = this.Movement.Swim;
     npc.Glide = this.Movement.Glide;
     npc.Fly = this.Movement.Fly;
     npc.LastResorts = int.Parse(LastResortBox.Text);
       } catch (Exception ex) {
     MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
       }
       return npc;
 }