private void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e) { if (e.Key == Key.Escape) { this.CleanUp(); this.Exit(); } if (e.Key == Key.Space) { Leo.SetStereo(!Leo.IsStereoSwitchedOn()); } if (e.Key == Key.F11) { if (this.WindowState == WindowState.Fullscreen) { this.WindowState = WindowState.Normal; } else { this.WindowState = WindowState.Fullscreen; } } }
private void CleanUp() { Leo.SetStereo(false); LGL.DeleteContext(context); OpenTK.Graphics.Glu.DeleteQuadric(sphere); OpenTK.Graphics.Glu.DeleteQuadric(cylinder); }
private void UpdateLeoInfo() { // Get info from LeoAPI Leo.GetBirdPosition(out birdpos.X, out birdpos.Y, out birdpos.Z, out birdrot.X, out birdrot.Y, out birdrot.Z); small_button_pressed = Leo.GetSmallButtonState(); big_button_pression = Leo.GetBigButtonState(); GL.ClearColor((float)big_button_pression, 0.0f, 0.0f, 1.0f); Leo.SetBirdVibration(big_button_pression); }
// 当发现新内容时,更新界面 private void AddTreeNodeTipGridLine(object sender, Leo.DB.Contents.ContentEventArgs e) { if (e.parent_id <= 0) return; Nodes parent = Nodes.Select("id = " + e.parent_id)[0]; if (parent == null) return; // 先为树增加未读的提示 foreach (TreeNode nodes in treeView1.Nodes) { foreach (TreeNode node in nodes.Nodes) { if (node.Name.ToString() == e.parent_id.ToString()) { // 未读数量 int unread = 0; if (!string.IsNullOrEmpty(node.Tag.ToString())) unread = int.Parse(node.Tag.ToString()) + 1; node.Tag = unread; // Tag 记录 未读数 if (unread > 0) { node.Text = string.Format("{0}({1})", parent.Name, node.Tag); node.NodeFont = new Font("宋体", 9, FontStyle.Bold); } else { node.Text = parent.Name; node.NodeFont = new Font("宋体", 9, FontStyle.Regular); } } } } treeView1.Refresh(); // 列表增加 if (e.parent_id.ToString() == m_Current_Select_ID) { dataGridView1.RowCount += 1; dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[0].Value = e.id; // 这时还不知道ID,所以用0代替 dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[1].Value = e.title; dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[2].Value = e.date; dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[3].Value = "N"; dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[4].Value = e.parent_id; dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[5].Value = e.url; dataGridView1.Rows[dataGridView1.RowCount - 1].DefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold); dataGridView1.Refresh(); } }
private bool InitializeLeoSystem() { // Initialize and connect the application to Leonar3Do System Software if (!Leo.Initialize()) { return(false); } // Initialize LGL LGL.Initialize(); // Create an LGL context (with the currently active OpenGL rendering context and its device) this.context = LGL.CreateContext(); if (LGL.GetLastLGLError() != LGLErrors.NoError) { return(false); } return(true); }
private void Awake() { CreateSignNumber(); mon = new MonsterStat(); aqua = new Aquarius(); arie = new Aries(); can = new Cancer(); cap = new Capricorn(); gem = new Gemini(); leo = new Leo(); lib = new Libra(); pisc = new Pisces(); sagi = new Sagittarius(); scrop = new Scorpio(); serp = new Serpentarius(); taur = new Taurus(); virg = new Virgo(); if (SignNumber == 1) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + aqua.Force + MBForce; myStats.Vitality = mon.Vitality + aqua.Vitality + MBVitality; myStats.Agility = mon.Agility + aqua.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + aqua.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + aqua.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + aqua.Rational + MBRational; myStats.Charisma = mon.Charisma + aqua.Charisma + MBCharima; } if (SignNumber == 2) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + arie.Force + MBForce; myStats.Vitality = mon.Vitality + arie.Vitality + MBVitality; myStats.Agility = mon.Agility + arie.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + arie.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + arie.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + arie.Rational + MBRational; myStats.Charisma = mon.Charisma + arie.Charisma + MBCharima; } if (SignNumber == 3) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + can.Force + MBForce; myStats.Vitality = mon.Vitality + can.Vitality + MBVitality; myStats.Agility = mon.Agility + can.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + can.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + can.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + can.Rational + MBRational; myStats.Charisma = mon.Charisma + can.Charisma + MBCharima; } if (SignNumber == 4) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + cap.Force + MBForce; myStats.Vitality = mon.Vitality + cap.Vitality + MBVitality; myStats.Agility = mon.Agility + cap.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + cap.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + cap.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + cap.Rational + MBRational; myStats.Charisma = mon.Charisma + cap.Charisma + MBCharima; } if (SignNumber == 5) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + gem.Force + MBForce; myStats.Vitality = mon.Vitality + gem.Vitality + MBVitality; myStats.Agility = mon.Agility + gem.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + gem.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + gem.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + gem.Rational + MBRational; myStats.Charisma = mon.Charisma + gem.Charisma + MBCharima; } if (SignNumber == 6) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + leo.Force + MBForce; myStats.Vitality = mon.Vitality + leo.Vitality + MBVitality; myStats.Agility = mon.Agility + leo.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + leo.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + leo.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + leo.Rational + MBRational; myStats.Charisma = mon.Charisma + leo.Charisma + MBCharima; } if (SignNumber == 7) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + lib.Force + MBForce; myStats.Vitality = mon.Vitality + lib.Vitality + MBVitality; myStats.Agility = mon.Agility + lib.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + lib.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + lib.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + lib.Rational + MBRational; myStats.Charisma = mon.Charisma + lib.Charisma + MBCharima; } if (SignNumber == 8) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + pisc.Force + MBForce; myStats.Vitality = mon.Vitality + pisc.Vitality + MBVitality; myStats.Agility = mon.Agility + pisc.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + pisc.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + pisc.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + pisc.Rational + MBRational; myStats.Charisma = mon.Charisma + pisc.Charisma + MBCharima; } if (SignNumber == 9) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + sagi.Force + MBForce; myStats.Vitality = mon.Vitality + sagi.Vitality + MBVitality; myStats.Agility = mon.Agility + sagi.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + sagi.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + sagi.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + sagi.Rational + MBRational; myStats.Charisma = mon.Charisma + sagi.Charisma + MBCharima; } if (SignNumber == 10) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + scrop.Force + MBForce; myStats.Vitality = mon.Vitality + scrop.Vitality + MBVitality; myStats.Agility = mon.Agility + scrop.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + scrop.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + scrop.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + scrop.Rational + MBRational; myStats.Charisma = mon.Charisma + scrop.Charisma + MBCharima; } if (SignNumber == 11) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + serp.Force + MBForce; myStats.Vitality = mon.Vitality + serp.Vitality + MBVitality; myStats.Agility = mon.Agility + serp.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + serp.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + serp.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + serp.Rational + MBRational; myStats.Charisma = mon.Charisma + serp.Charisma + MBCharima; } if (SignNumber == 12) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + taur.Force + MBForce; myStats.Vitality = mon.Vitality + taur.Vitality + MBVitality; myStats.Agility = mon.Agility + taur.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + taur.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + taur.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + taur.Rational + MBRational; myStats.Charisma = mon.Charisma + taur.Charisma + MBCharima; } if (SignNumber == 13) { myStats.Name = "Fire Cactus"; myStats.Force = mon.Force + virg.Force + MBForce; myStats.Vitality = mon.Vitality + virg.Vitality + MBVitality; myStats.Agility = mon.Agility + virg.Agility + MBAgility; myStats.Fortiude = mon.Fortiude + virg.Fortitude + MBFortitude; myStats.Intellect = mon.Intellect + virg.Intellect + MBIntellect; myStats.Rationale = mon.Rationale + virg.Rationale + MBRational; myStats.Charisma = mon.Charisma + virg.Charisma + MBCharima; } myStats.HealthPoints = (myStats.Vitality + myStats.Fortiude) / 2; myStats.AbilityPoints = (myStats.Force + myStats.Intellect) / 2; myStats.Defence = myStats.Vitality; myStats.AttackDamage = myStats.Force; myStats.AttackSpeed = myStats.Agility; myStats.MagicDefence = myStats.Rationale; myStats. AttackBar = 0 / 100; //HPthing myStats.MaximumHealthPoints = myStats.HealthPoints; myStats.HealthPoints = myStats.MaximumHealthPoints; //clamps it myStats.HealthPoints = Mathf.Clamp(myStats.HealthPoints, 0, myStats.MaximumHealthPoints); // AP bar increasre by timesing agility by time.deltatime // divide delta time * agility by 32 }
// 当发现新内容时,更新界面 private void GridReadLink(object sender, Leo.DB.Contents.ContentEventArgs e) { foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value.ToString() == e.id.ToString()) { row.DefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Regular); dataGridView1.Refresh(); return; } } }
private void TreeReadLink(object sender, Leo.DB.Contents.ContentEventArgs e) { Nodes parent = Nodes.Select("id = " + e.parent_id)[0]; if (parent == null) return; foreach (TreeNode nodes in treeView1.Nodes) { foreach (TreeNode node in nodes.Nodes) { if (node.Name == e.parent_id.ToString()) { int count = int.Parse(node.Tag.ToString())-1; node.Tag = count; // Tag 记录 未读数 if (count > 0) { node.Text = string.Format("{0}({1})", parent.Name, node.Tag); node.NodeFont = new Font("宋体", 9, FontStyle.Bold); } else { node.Text = parent.Name; node.NodeFont = new Font("宋体", 9, FontStyle.Regular); } treeView1.Refresh(); return; } } } }
public NPC() { aqua = new Aquarius(); arie = new Aries(); can = new Cancer(); cap = new Capricorn(); gem = new Gemini(); leo = new Leo(); lib = new Libra(); pisc = new Pisces(); sagi = new Sagittarius(); scrop = new Scorpio(); serp = new Serpentarius(); taur = new Taurus(); virg = new Virgo(); RNG(); if (rng == 1) { Name = ""; Force = rand + aqua.Force; Vitality = rand + aqua.Vitality; Agility = rand + aqua.Agility; Fortitude = rand + aqua.Fortitude; Intellect = rand + aqua.Intellect; Rationale = rand + aqua.Rational; Charisma = rand + aqua.Charisma; } if (rng == 2) { Name = ""; Force = rand + arie.Force; Vitality = rand + arie.Vitality; Agility = rand + arie.Agility; Fortitude = rand + arie.Fortitude; Intellect = rand + arie.Intellect; Rationale = rand + arie.Rational; Charisma = rand + arie.Charisma; } if (rng == 3) { Name = ""; Force = rand + can.Force; Vitality = rand + can.Vitality; Agility = rand + can.Agility; Fortitude = rand + can.Fortitude; Intellect = rand + can.Intellect; Rationale = rand + can.Rational; Charisma = rand + can.Charisma; } if (rng == 4) { Name = ""; Force = rand + cap.Force; Vitality = rand + cap.Vitality; Agility = rand + cap.Agility; Fortitude = rand + cap.Fortitude; Intellect = rand + cap.Intellect; Rationale = rand + cap.Rational; Charisma = rand + cap.Charisma; } if (rng == 5) { Name = ""; Force = rand + gem.Force; Vitality = rand + gem.Vitality; Agility = rand + gem.Agility; Fortitude = rand + gem.Fortitude; Intellect = rand + gem.Intellect; Rationale = rand + gem.Rational; Charisma = rand + gem.Charisma; } if (rng == 6) { Name = ""; Force = rand + leo.Force; Vitality = rand + leo.Vitality; Agility = rand + leo.Agility; Fortitude = rand + leo.Fortitude; Intellect = rand + leo.Intellect; Rationale = rand + leo.Rational; Charisma = rand + leo.Charisma; } if (rng == 7) { Name = ""; Force = rand + lib.Force; Vitality = rand + lib.Vitality; Agility = rand + lib.Agility; Fortitude = rand + lib.Fortitude; Intellect = rand + lib.Intellect; Rationale = rand + lib.Rational; Charisma = rand + lib.Charisma; } if (rng == 8) { Name = ""; Force = rand + pisc.Force; Vitality = rand + pisc.Vitality; Agility = rand + pisc.Agility; Fortitude = rand + pisc.Fortitude; Intellect = rand + pisc.Intellect; Rationale = rand + pisc.Rational; Charisma = rand + pisc.Charisma; } if (rng == 9) { Name = ""; Force = rand + sagi.Force; Vitality = rand + sagi.Vitality; Agility = rand + sagi.Agility; Fortitude = rand + sagi.Fortitude; Intellect = rand + sagi.Intellect; Rationale = rand + sagi.Rational; Charisma = rand + sagi.Charisma; } if (rng == 10) { Name = ""; Force = rand + scrop.Force; Vitality = rand + scrop.Vitality; Agility = rand + scrop.Agility; Fortitude = rand + scrop.Fortitude; Intellect = rand + scrop.Intellect; Rationale = rand + scrop.Rational; Charisma = rand + scrop.Charisma; } if (rng == 11) { Name = ""; Force = rand + serp.Force; Vitality = rand + serp.Vitality; Agility = rand + serp.Agility; Fortitude = rand + serp.Fortitude; Intellect = rand + serp.Intellect; Rationale = rand + serp.Rational; Charisma = rand + serp.Charisma; } if (rng == 12) { Name = ""; Force = rand + taur.Force; Vitality = rand + taur.Vitality; Agility = rand + taur.Agility; Fortitude = rand + taur.Fortitude; Intellect = rand + taur.Intellect; Rationale = rand + taur.Rational; Charisma = rand + taur.Charisma; } if (rng == 13) { Name = ""; Force = rand + virg.Force; Vitality = rand + virg.Vitality; Agility = rand + virg.Agility; Fortitude = rand + virg.Fortitude; Intellect = rand + virg.Intellect; Rationale = rand + virg.Rationale; Charisma = rand + virg.Charisma; } NPCstat(); HealthPoints = (Vitality + Fortitude) / 2; AP = (Force + Intellect) / 2; Deffence = Vitality; AD = Force; AS = Agility; MD = Rationale; ATBar = 0 / 100; //HPthing MaxHp = HealthPoints; CurrentHp = MaxHp; //clamps it CurrentHp = Mathf.Clamp(CurrentHp, 0, MaxHp); // AP bar increasre by timesing agility by time.deltatime // divide delta time * agility by 32 }
private static void DebugOut(object sender, Leo.Reg.Sasac.LinkEventArgs e) { Console.WriteLine(e.title); }