当前位置: 首页>>代码示例>>C#>>正文


C# BaseCreature.DescribeGene方法代码示例

本文整理汇总了C#中Server.Mobiles.BaseCreature.DescribeGene方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.DescribeGene方法的具体用法?C# BaseCreature.DescribeGene怎么用?C# BaseCreature.DescribeGene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.BaseCreature的用法示例。


在下文中一共展示了BaseCreature.DescribeGene方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AnimalLoreGump


//.........这里部分代码省略.........

					if ((c.PackInstinct & PackInstinct.Canine) != 0)
						packInstinct = 1049570; // Canine
					else if ((c.PackInstinct & PackInstinct.Ostard) != 0)
						packInstinct = 1049571; // Ostard
					else if ((c.PackInstinct & PackInstinct.Feline) != 0)
						packInstinct = 1049572; // Feline
					else if ((c.PackInstinct & PackInstinct.Arachnid) != 0)
						packInstinct = 1049573; // Arachnid
					else if ((c.PackInstinct & PackInstinct.Daemon) != 0)
						packInstinct = 1049574; // Daemon
					else if ((c.PackInstinct & PackInstinct.Bear) != 0)
						packInstinct = 1049575; // Bear
					else if ((c.PackInstinct & PackInstinct.Equine) != 0)
						packInstinct = 1049576; // Equine
					else if ((c.PackInstinct & PackInstinct.Bull) != 0)
						packInstinct = 1049577; // Bull

					AddHtmlLocalized(153, 204, 160, 18, packInstinct, LabelColor, false, false);

					AddImage(128, 224, 2086);
					AddHtmlLocalized(147, 222, 160, 18, 1049594, 200, false, false); // Loyalty Rating

					// loyalty redo
					int loyaltyval = (int)c.Loyalty / 10;
					if (loyaltyval < 0)
						loyaltyval = 0;
					if (loyaltyval > 11)
						loyaltyval = 11;
					AddHtmlLocalized(153, 240, 160, 18, (!c.Controlled || c.Loyalty == PetLoyalty.None) ? 1061643 : 1049594 + loyaltyval, LabelColor, false, false);

					break;
					#endregion
				}
				default: // rest of the pages are filled with genes - be sure to adjust "pg" calc in here when adding pages
				{
                    int nextpage = 3;

                    // idea for later - flesh out custom pages more, a string[] is hackish

                    //List<string[]> custompages = c.GetAnimalLorePages();
                    //if (custompages != null && page >= nextpage && page < (nextpage + custompages.Count))
                    //{
                    //    foreach (string[] s in custompages)
                    //    {
                    //        for (int i = 0; i < s.Length; i++)
                    //        {
                    //            AddHtml(153, 168 + 18 * i, 150, 18, s[i], false, false);
                    //        }
                    //    }

                    //    nextpage += custompages.Count;
                    //}

					#region Genetics
                    if (page >= nextpage)
                    {
                        List<PropertyInfo> genes = new List<PropertyInfo>();

                        foreach (PropertyInfo pi in c.GetType().GetProperties())
                        {
                            GeneAttribute attr = (GeneAttribute)Attribute.GetCustomAttribute(pi, typeof(GeneAttribute), true);
                            if (attr == null)
                                continue;
                            if (m_User.AccessLevel < AccessLevel.Counselor && !Server.Misc.TestCenter.Enabled)
                            {
                                if (attr.Visibility == GeneVisibility.Invisible)
                                    continue;
                                if (attr.Visibility == GeneVisibility.Tame && m_User != c.ControlMaster)
                                    continue;
                            }

                            genes.Add(pi);
                        }

                        int pg = m_Page - nextpage;

                        AddImage(128, 152, 2086);
                        AddHtml(147, 150, 160, 18, "Genetics", false, false);

                        for (int i = 0; i < 9; i++)
                        {
                            if (pg * 9 + i >= genes.Count)
                                break;

                            GeneAttribute attr = (GeneAttribute)Attribute.GetCustomAttribute(genes[pg * 9 + i], typeof(GeneAttribute), true);
                            AddHtml(153, 168 + 18 * i, 120, 18, attr.Name, false, false);
                            AddHtml(240, 168 + 18 * i, 115, 18, String.Format("<div align=right>{0:G3}</div>", c.DescribeGene(genes[pg * 9 + i], attr)), false, false);
                        }
                    }
					break;
					#endregion
				}
			}

			if (m_Page < NumTotalPages - 1)
				AddButton(340, 358, 5601, 5605, (int)ButtonID.NextPage, GumpButtonType.Reply, 0);
			if (m_Page > 0)
				AddButton(317, 358, 5603, 5607, (int)ButtonID.PrevPage, GumpButtonType.Reply, 0);
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:AnimalLore.cs


注:本文中的Server.Mobiles.BaseCreature.DescribeGene方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。