Beispiel #1
0
        /// <summary>
        /// Activates weaken conditions for creature.
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="levels">Amount of levels to lower the power level.</param>
        /// <param name="duration">Duration of the state.</param>
        protected void Weaken(Creature creature, int levels, int duration)
        {
            levels = Math2.Clamp(1, 255, levels);

            var extra = new MabiDictionary();

            extra.SetByte("WKN_LV", (byte)levels);

            // min -> ms
            duration = duration * 60 * 1000;

            Send.Notice(creature, Localization.Get("The enemies seem to be much more powerful now."));
            creature.Conditions.Activate(ConditionsA.Weaken, extra, duration);
        }
Beispiel #2
0
		public void Serialize()
		{
			var test = new MabiDictionary();
			test.SetBool("a bool", true);
			test.SetByte("a byte", 1);
			test.SetShort("a short", 2);
			test.SetInt("an int", 3);
			test.SetFloat("a float", 4);
			test.SetString("a string", "five, special chars :;");

			var test2 = test.ToString();

			Assert.Equal("a bool:b:1;a byte:1:1;a short:2:2;an int:4:3;a float:f:4;a string:s:five, special chars %C%S;", test2);
		}
Beispiel #3
0
        public void Serialize()
        {
            var test = new MabiDictionary();

            test.SetBool("a bool", true);
            test.SetByte("a byte", 1);
            test.SetShort("a short", 2);
            test.SetInt("an int", 3);
            test.SetFloat("a float", 4);
            test.SetString("a string", "five, special chars :;");

            var test2 = test.ToString();

            Assert.Equal("a bool:b:1;a byte:1:1;a short:2:2;an int:4:3;a float:f:4;a string:s:five, special chars %C%S;", test2);
        }
Beispiel #4
0
		/// <summary>
		/// Activates weaken conditions for creature.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="levels">Amount of levels to lower the power level.</param>
		/// <param name="duration">Duration of the state.</param>
		protected void Weaken(Creature creature, int levels, int duration)
		{
			levels = Math2.Clamp(1, 255, levels);

			var extra = new MabiDictionary();
			extra.SetByte("WKN_LV", (byte)levels);

			// min -> ms
			duration = duration * 60 * 1000;

			Send.Notice(creature, Localization.Get("The enemies seem to be much more powerful now."));
			creature.Conditions.Activate(ConditionsA.Weaken, extra, duration);
		}