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


C# Preferences.GetType方法代码示例

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


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

示例1: wabbajack


//.........这里部分代码省略.........
						new_mob.languages |= 1;
					} else if ( _f=="animal" ) {
						if ( Rand13.percentChance( 50 ) ) {
							beast = Rand13.pick(new object [] { "carp", "bear", "mushroom", "statue", "bat", "goat", "killertomato", "spiderbase", "spiderhunter", "blobbernaut", "magicarp", "chaosmagicarp" });
							dynamic _c = beast; // Was a switch-case, sorry for the mess.
							if ( _c=="carp" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Carp( M.loc );
							} else if ( _c=="bear" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Bear( M.loc );
							} else if ( _c=="mushroom" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Mushroom( M.loc );
							} else if ( _c=="statue" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Statue( M.loc );
							} else if ( _c=="bat" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Retaliate_Bat( M.loc );
							} else if ( _c=="goat" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Retaliate_Goat( M.loc );
							} else if ( _c=="killertomato" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Killertomato( M.loc );
							} else if ( _c=="spiderbase" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Poison_GiantSpider( M.loc );
							} else if ( _c=="spiderhunter" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Poison_GiantSpider_Hunter( M.loc );
							} else if ( _c=="blobbernaut" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Blob_Blobbernaut( M.loc );
							} else if ( _c=="magicarp" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Carp_Ranged( M.loc );
							} else if ( _c=="chaosmagicarp" ) {
								new_mob = new Mob_Living_SimpleAnimal_Hostile_Carp_Ranged_Chaos( M.loc );
							};
						} else {
							animal = Rand13.pick(new object [] { "parrot", "corgi", "crab", "pug", "cat", "mouse", "chicken", "cow", "lizard", "chick", "fox", "butterfly" });
							dynamic _d = animal; // Was a switch-case, sorry for the mess.
							if ( _d=="parrot" ) {
								new_mob = new Mob_Living_SimpleAnimal_Parrot( M.loc );
							} else if ( _d=="corgi" ) {
								new_mob = new Mob_Living_SimpleAnimal_Pet_Dog_Corgi( M.loc );
							} else if ( _d=="crab" ) {
								new_mob = new Mob_Living_SimpleAnimal_Crab( M.loc );
							} else if ( _d=="pug" ) {
								new_mob = new Mob_Living_SimpleAnimal_Pet_Dog_Pug( M.loc );
							} else if ( _d=="cat" ) {
								new_mob = new Mob_Living_SimpleAnimal_Pet_Cat( M.loc );
							} else if ( _d=="mouse" ) {
								new_mob = new Mob_Living_SimpleAnimal_Mouse( M.loc );
							} else if ( _d=="chicken" ) {
								new_mob = new Mob_Living_SimpleAnimal_Chicken( M.loc );
							} else if ( _d=="cow" ) {
								new_mob = new Mob_Living_SimpleAnimal_Cow( M.loc );
							} else if ( _d=="lizard" ) {
								new_mob = new Mob_Living_SimpleAnimal_Lizard( M.loc );
							} else if ( _d=="fox" ) {
								new_mob = new Mob_Living_SimpleAnimal_Pet_Fox( M.loc );
							} else if ( _d=="butterfly" ) {
								new_mob = new Mob_Living_SimpleAnimal_Butterfly( M.loc );
							} else {
								new_mob = new Mob_Living_SimpleAnimal_Chick( M.loc );
							};
						}
						new_mob.languages |= 1;
					} else if ( _f=="humanoid" ) {
						new_mob = new Mob_Living_Carbon_Human( M.loc );
						A = new Preferences();
						new ByTable().set( 1, new_mob ).set( "icon_updates", 0 ).apply( A.GetType().GetMethod( "copy_to" ) );
						H = new_mob;
						if ( Rand13.percentChance( 50 ) ) {
							all_species = new ByTable();
							speciestype = null;
							foreach (dynamic _e in Lang13.get_all_types( typeof(Species) ) - typeof(Species) ) {
								speciestype = _e;
								S = Lang13.call( speciestype );
								if ( !Lang13.Bool( S.dangerous_existence ) ) {
									all_species += speciestype;
								}
							};
							new ByTable().set( 1, Rand13.pick( all_species ) ).set( "icon_update", 0 ).apply( H.GetType().GetMethod( "set_species" ) );
							H.real_name = ((dynamic)((dynamic)H).dna.species).random_name( ((dynamic)H).gender, 1 );
						}
						((dynamic)H).update_body();
						H.update_hair();
						((dynamic)H).update_mutcolor();
						((dynamic)((dynamic)H).dna).update_dna_identity();
					} else {
						return null;
					};
					new_mob.attack_log = M.attack_log;
					M.attack_log += "[" + GlobalFuncs.time_stamp() + "] <font color='orange'>" + M.real_name + " (" + M.ckey + ") became " + new_mob.real_name + ".</font>";
					new_mob.a_intent = "harm";
					if ( Lang13.Bool( M.mind ) ) {
						((dynamic)M.mind).transfer_to( new_mob );
					} else {
						((dynamic)new_mob).key = M.key;
					}
					((dynamic)new_mob).write( "<B>Your form morphs into that of a " + randomize + ".</B>" );
					GlobalFuncs.qdel( M );
					return new_mob;
				}
			}
			return null;
		}
开发者ID:bloxgate,项目名称:som--tg-station,代码行数:101,代码来源:GlobalFuncs.cs


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