Default unit type 0
Inheritance: IUnitDescriptor
Exemplo n.º 1
0
		public UnitInfo(Stream file,VarCollection v):this() 
		{
			StreamReader sr = new StreamReader(file);
			VarCollection vars = new VarCollection(sr,v);
			KeyVal line=vars.ReadLine();

			if(line==null)
				return;

			groundImages = line.Rest;

			while((line=vars.ReadLine())!=null)
			{				
				if(line.Keyword=="unit")
				{
					string name = line.Rest;
					line = vars.ReadLine();

					if(line.Keyword=="type")
					{
						int type = int.Parse(line.Rest);
						switch(type)
						{
							case 0:
								units[name] = new Type0Descriptor(name,sr,vars);
								break;
							case 1: 
								units[name] = new Type1Descriptor(name,sr,vars);
								break;
							case 2:
								units[name] = new Type2Descriptor(name,sr,vars);
								break;
							case 3:
								units[name] = new Type3Descriptor(name,sr,vars);
								break;
							case 4:
								units[name] = new Type4Descriptor(name,sr,vars);
								break;
							case 5:
								units[name] = new Type5Descriptor(name,sr,vars);
								break;
							case 6:
								units[name] = new Type6Descriptor(name,sr,vars);
								break;
							case 7:
								units[name] = new Type7Descriptor(name,sr,vars);
								break;
						}
					}
				}
				else
				{
					xConsole.AddLine("Unknown keyword parsing unit file(1): "+line.Keyword+"->"+line.Rest);
				}
			}
			sr.Close();
		}
Exemplo n.º 2
0
        public Type4File(Type4Descriptor desc, bool useZombie, bool useFlyable) : base(desc)
        {
            if (desc != null)
            {
                zombie  = desc.ZombieAllowed;
                flyable = desc.FlyAllowed;
            }
            else
            {
                zombie  = useZombie;
                flyable = useFlyable;
            }

            torso = new BodyPart(new int[] { 32, 33, 34, 35, 36, 37, 38, 39 });

            int i = 16;

            legs = new BodyPart(new int[] { i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7 },
                                new int[, ] {
                { i + 40, i + 41, i + 42, i + 43, i + 44, i + 45, i + 46, i + 47 },
                { i + 64, i + 65, i + 66, i + 67, i + 68, i + 69, i + 70, i + 71 },
                { i + 88, i + 89, i + 90, i + 91, i + 92, i + 93, i + 94, i + 95 },
                { i + 112, i + 113, i + 114, i + 115, i + 116, i + 117, i + 118, i + 119 },
                { i + 136, i + 137, i + 138, i + 139, i + 140, i + 141, i + 142, i + 143 },
                { i + 160, i + 161, i + 162, i + 163, i + 164, i + 165, i + 166, i + 167 },
                { i + 184, i + 185, i + 186, i + 187, i + 188, i + 189, i + 190, i + 191 },
                { i + 208, i + 209, i + 210, i + 211, i + 212, i + 213, i + 214, i + 215 }
            });

            i       = 0;
            leftArm = new BodyPart(new int[] { i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7 },
                                   new int[, ] {
                { i + 40, i + 41, i + 42, i + 43, i + 44, i + 45, i + 46, i + 47 },
                { i + 64, i + 65, i + 66, i + 67, i + 68, i + 69, i + 70, i + 71 },
                { i + 88, i + 89, i + 90, i + 91, i + 92, i + 93, i + 94, i + 95 },
                { i + 112, i + 113, i + 114, i + 115, i + 116, i + 117, i + 118, i + 119 },
                { i + 136, i + 137, i + 138, i + 139, i + 140, i + 141, i + 142, i + 143 },
                { i + 160, i + 161, i + 162, i + 163, i + 164, i + 165, i + 166, i + 167 },
                { i + 184, i + 185, i + 186, i + 187, i + 188, i + 189, i + 190, i + 191 },
                { i + 208, i + 209, i + 210, i + 211, i + 212, i + 213, i + 214, i + 215 }
            });

            i        = 8;
            rightArm = new BodyPart(new int[] { i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7 },
                                    new int[, ] {
                { i + 40, i + 41, i + 42, i + 43, i + 44, i + 45, i + 46, i + 47 },
                { i + 64, i + 65, i + 66, i + 67, i + 68, i + 69, i + 70, i + 71 },
                { i + 88, i + 89, i + 90, i + 91, i + 92, i + 93, i + 94, i + 95 },
                { i + 112, i + 113, i + 114, i + 115, i + 116, i + 117, i + 118, i + 119 },
                { i + 136, i + 137, i + 138, i + 139, i + 140, i + 141, i + 142, i + 143 },
                { i + 160, i + 161, i + 162, i + 163, i + 164, i + 165, i + 166, i + 167 },
                { i + 184, i + 185, i + 186, i + 187, i + 188, i + 189, i + 190, i + 191 },
                { i + 208, i + 209, i + 210, i + 211, i + 212, i + 213, i + 214, i + 215 }
            });

            rightArmed1 = new BodyPart(new int[] { 248, 249, 250, 251, 252, 253, 254, 255 });
            rightArmed2 = new BodyPart(new int[] { 240, 241, 242, 243, 244, 245, 246, 247 });
            leftArmed2  = new BodyPart(new int[] { 232, 233, 234, 235, 236, 237, 238, 239 });
            crouchLegs  = new BodyPart(new int[] { 24, 25, 26, 27, 28, 29, 30, 31 });
            femHead     = new BodyPart(new int[] { 262, 263, 264, 265, 266, 267, 268, 269 });
            maleHead    = new BodyPart(new int[] { 270, 271, 272, 273, 274, 275, 276, 277 });

            if (zombie)
            {
                zombieHead = new BodyPart(new int[] { 278, 279, 280, 281, 282, 283, 284, 285 });
            }

            if (flyable)
            {
                //Console.WriteLine("Init flying");
                flyHead = new BodyPart(new int[] { 286, 287, 288, 289, 290, 291, 292, 293 });
                flyLegs = new BodyPart(new int[] { 294, 295, 296, 297, 298, 299, 300, 301 });
            }


            underwaterDeath = new int[] { 259, 260, 261 };
            deathImages     = new int[] { 256, 257, 258 };
        }
Exemplo n.º 3
0
//		public const int StandingOffset=0;
//		public const int Armed2HandOffset=8;
//		public const int Armed1HandOffset=16;
//		public const int WalkingUnarmedOffset=24;
//		public const int WalkingArmed2HandOffset=88;
//		public const int WalkingArmed1HandOffset=152;
//		public const int CrouchingOffset=216;
//		public const int CrouchingArmed2HandOffset=224;
//		public const int CrouchingArmed1HandOffset=232;
//
//		public const int AboveWaterDeathOffset=0;
//		public const int UnderwaterDeathOffset=3;
//
//		public const int FemaleHead = 8;
//		public const int MaleHead = 16;
//		public const int ZombieHead = 24;
//
//		public const int CrouchOffset=5;
        #endregion

        public Type4File(Type4Descriptor desc) : this(desc, true, true)
        {
        }
Exemplo n.º 4
0
        public UnitInfo(Stream file, VarCollection v) : this()
        {
            StreamReader  sr   = new StreamReader(file);
            VarCollection vars = new VarCollection(sr, v);
            KeyVal        line = vars.ReadLine();

            if (line == null)
            {
                return;
            }

            groundImages = line.Rest;

            while ((line = vars.ReadLine()) != null)
            {
                if (line.Keyword == "unit")
                {
                    string name = line.Rest;
                    line = vars.ReadLine();

                    if (line.Keyword == "type")
                    {
                        int type = int.Parse(line.Rest);
                        switch (type)
                        {
                        case 0:
                            units[name] = new Type0Descriptor(name, sr, vars);
                            break;

                        case 1:
                            units[name] = new Type1Descriptor(name, sr, vars);
                            break;

                        case 2:
                            units[name] = new Type2Descriptor(name, sr, vars);
                            break;

                        case 3:
                            units[name] = new Type3Descriptor(name, sr, vars);
                            break;

                        case 4:
                            units[name] = new Type4Descriptor(name, sr, vars);
                            break;

                        case 5:
                            units[name] = new Type5Descriptor(name, sr, vars);
                            break;

                        case 6:
                            units[name] = new Type6Descriptor(name, sr, vars);
                            break;

                        case 7:
                            units[name] = new Type7Descriptor(name, sr, vars);
                            break;
                        }
                    }
                }
                else
                {
                    xConsole.AddLine("Unknown keyword parsing unit file(1): " + line.Keyword + "->" + line.Rest);
                }
            }
            sr.Close();
        }
Exemplo n.º 5
0
		public Type4File(Type4Descriptor desc,bool useZombie,bool useFlyable):base(desc)
		{
			if(desc!=null)
			{
				zombie=desc.ZombieAllowed;
				flyable=desc.FlyAllowed;
			}
			else
			{
				zombie=useZombie;
				flyable=useFlyable;
			}
			
			torso = new BodyPart(new int[]{32,33,34,35,36,37,38,39});

			int i=16;
			legs = new BodyPart(new int[]{i,i+1,i+2,i+3,i+4,i+5,i+6,i+7},
				new int[,]{{i+40,i+41,i+42,i+43,i+44,i+45,i+46,i+47},
								{i+64,i+65,i+66,i+67,i+68,i+69,i+70,i+71},
								{i+88,i+89,i+90,i+91,i+92,i+93,i+94,i+95},
								{i+112,i+113,i+114,i+115,i+116,i+117,i+118,i+119},
								{i+136,i+137,i+138,i+139,i+140,i+141,i+142,i+143},
								{i+160,i+161,i+162,i+163,i+164,i+165,i+166,i+167},
								{i+184,i+185,i+186,i+187,i+188,i+189,i+190,i+191},
								{i+208,i+209,i+210,i+211,i+212,i+213,i+214,i+215}});

			i=0;
			leftArm = new BodyPart(new int[]{i,i+1,i+2,i+3,i+4,i+5,i+6,i+7},
				new int[,]{{i+40,i+41,i+42,i+43,i+44,i+45,i+46,i+47},
								{i+64,i+65,i+66,i+67,i+68,i+69,i+70,i+71},
								{i+88,i+89,i+90,i+91,i+92,i+93,i+94,i+95},
								{i+112,i+113,i+114,i+115,i+116,i+117,i+118,i+119},
								{i+136,i+137,i+138,i+139,i+140,i+141,i+142,i+143},
								{i+160,i+161,i+162,i+163,i+164,i+165,i+166,i+167},
								{i+184,i+185,i+186,i+187,i+188,i+189,i+190,i+191},
								{i+208,i+209,i+210,i+211,i+212,i+213,i+214,i+215}});

			i=8;
			rightArm = new BodyPart(new int[]{i,i+1,i+2,i+3,i+4,i+5,i+6,i+7},
				new int[,]{{i+40,i+41,i+42,i+43,i+44,i+45,i+46,i+47},
								{i+64,i+65,i+66,i+67,i+68,i+69,i+70,i+71},
								{i+88,i+89,i+90,i+91,i+92,i+93,i+94,i+95},
								{i+112,i+113,i+114,i+115,i+116,i+117,i+118,i+119},
								{i+136,i+137,i+138,i+139,i+140,i+141,i+142,i+143},
								{i+160,i+161,i+162,i+163,i+164,i+165,i+166,i+167},
								{i+184,i+185,i+186,i+187,i+188,i+189,i+190,i+191},
								{i+208,i+209,i+210,i+211,i+212,i+213,i+214,i+215}});

			rightArmed1 = new BodyPart(new int[]{248,249,250,251,252,253,254,255});
			rightArmed2 = new BodyPart(new int[]{240,241,242,243,244,245,246,247});
			leftArmed2 = new BodyPart(new int[]{232,233,234,235,236,237,238,239});
			crouchLegs= new BodyPart(new int[]{24,25,26,27,28,29,30,31});
			femHead= new BodyPart(new int[]{262,263,264,265,266,267,268,269});
			maleHead= new BodyPart(new int[]{270,271,272,273,274,275,276,277});
			
			if(zombie)
				zombieHead= new BodyPart(new int[]{278,279,280,281,282,283,284,285});

			if(flyable)
			{
				//Console.WriteLine("Init flying");
				flyHead = new BodyPart(new int[]{286,287,288,289,290,291,292,293});
				flyLegs = new BodyPart(new int[]{294,295,296,297,298,299,300,301});
			}


			underwaterDeath = new int[]{259,260,261};
			deathImages = new int[]{256,257,258};
		}
Exemplo n.º 6
0
//		public const int StandingOffset=0;
//		public const int Armed2HandOffset=8;
//		public const int Armed1HandOffset=16;
//		public const int WalkingUnarmedOffset=24;
//		public const int WalkingArmed2HandOffset=88;
//		public const int WalkingArmed1HandOffset=152;
//		public const int CrouchingOffset=216;
//		public const int CrouchingArmed2HandOffset=224;
//		public const int CrouchingArmed1HandOffset=232;
//
//		public const int AboveWaterDeathOffset=0;
//		public const int UnderwaterDeathOffset=3;
//
//		public const int FemaleHead = 8;
//		public const int MaleHead = 16;
//		public const int ZombieHead = 24;
//
//		public const int CrouchOffset=5;
		#endregion

		public Type4File(Type4Descriptor desc):this(desc,true,true){}