Пример #1
0
		// Range: -1 Access: 0 Flags: ( 0, 4, 255 )
		public static Mob_Living wabbajack( dynamic M = null ) {
			dynamic Robot = null;
			Ent_Item W = null;
			Mob_Living new_mob = null;
			dynamic randomize = null;
			dynamic robot = null;
			Mob_Living D = null;
			Mob_Living Robot2 = null;
			Mob_Living Slime = null;
			dynamic beast = null;
			dynamic animal = null;
			Preferences A = null;
			Mob_Living H = null;
			ByTable all_species = null;
			dynamic speciestype = null;
			dynamic S = null;
			if ( M is Mob_Living ) {
				if ( M is Mob_Living && Lang13.Int( M.stat ) != 2 ) {
					if ( Lang13.Bool( M.notransform ) ) {
						return null;
					}
					M.notransform = 1;
					M.canmove = 0;
					M.icon = null;
					((dynamic)M.overlays).Cut();
					M.invisibility = 101;
					if ( M is Mob_Living_Silicon_Robot ) {
						Robot = M;
						if ( Lang13.Bool( Robot.mmi ) ) {
							GlobalFuncs.qdel( Robot.mmi );
						}
						((dynamic)Robot).notify_ai( 1 );
					} else {
						W = null;
						foreach (dynamic _a in M ) {
							if ( !( _a is Ent_Item ) ) {
								continue;
							}
							W = _a;
							if ( W is Ent_Item_Weapon_Implant ) {
								GlobalFuncs.qdel( W );
								continue;
							}
							((dynamic)W).layer = Temp13.initial( ((dynamic)W).layer );
							((dynamic)W).loc = M.loc;
							W.dropped( M );
						};
					}
					new_mob = null;
					randomize = Rand13.pick(new object [] { "monkey", "robot", "slime", "xeno", "humanoid", "animal" });
					dynamic _f = randomize; // Was a switch-case, sorry for the mess.
					if ( _f=="monkey" ) {
						new_mob = new Mob_Living_Carbon_Monkey( M.loc );
						new_mob.languages |= 1;
					} else if ( _f=="robot" ) {
						robot = Rand13.pick(new object [] { "cyborg", "syndiborg", "drone" });
						dynamic _b = robot; // Was a switch-case, sorry for the mess.
						if ( _b=="cyborg" ) {
							new_mob = new Mob_Living_Silicon_Robot( M.loc );
						} else if ( _b=="syndiborg" ) {
							new_mob = new Mob_Living_Silicon_Robot_Syndicate( M.loc );
						} else if ( _b=="drone" ) {
							new_mob = new Mob_Living_SimpleAnimal_Drone( M.loc );
							D = new_mob;
							((dynamic)D).update_drone_hack();
						};
						if ( new_mob is Mob_Living_Silicon ) {
							((dynamic)new_mob).gender = M.gender;
							new_mob.invisibility = 0;
							new_mob.job = "Cyborg";
							Robot2 = new_mob;
							((dynamic)Robot2).mmi = new Ent_Item_Device_Mmi( new_mob );
							((dynamic)((dynamic)Robot2).mmi).transfer_identity( M );
						} else {
							new_mob.languages |= 1;
						}
					} else if ( _f=="slime" ) {
						new_mob = new Mob_Living_SimpleAnimal_Slime( M.loc );
						if ( Rand13.percentChance( 50 ) ) {
							Slime = new_mob;
							((dynamic)Slime).is_adult = 1;
						}
						new_mob.languages |= 1;
					} else if ( _f=="xeno" ) {
						if ( Rand13.percentChance( 50 ) ) {
							new_mob = new Mob_Living_Carbon_Alien_Humanoid_Hunter( M.loc );
						} else {
							new_mob = new Mob_Living_Carbon_Alien_Humanoid_Sentinel( M.loc );
						}
						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;
		}