public static SimpleASprite Create(eAnimation animationType, out Rectangle relativeAABB)
        {
            SimpleASprite sprite;
            Texture2D     icon;

            return(Create(animationType, out sprite, out sprite, out sprite, out relativeAABB, out icon));
        }
Example #2
0
        public TowerStruct(int id)
        {
            ID   = id;
            Name = "<NAME NOT SET>";
            Desc = "<DESC NOT SET>";

            BuildTimeInMS = 0;
            UpgTimeInMS   = 0;
            BuildSize     = new Point(2, 2);
            Cost          = 0;
            SupplyCost    = 1;

            Spawns                 = false;
            SpawnRange             = 0;
            Defenders              = new List <DefenderSpawnStruct>();
            Upgrades               = new List <TowerUpgrade>();
            MaxRallyPointRange     = 0;
            RallyPointPersuitRange = 0;
            Icon = null;

            IncomePerWave       = 0;
            IncomePerTick       = 0;
            IncomeTickDelayInMS = 0;

            AnimationType = eAnimation.None;
            DrawColor     = Color.White;

            Weapons      = new List <WeaponStruct>();
            Categories   = new List <int>();
            Info         = new List <StringBuilder>();
            Requirements = new List <List <int> >();
        }
Example #3
0
 public Environment(eAnimation animation, Vector2 location)
 {
     EntityID           = Engine.RetrieveNextEntityID();
     Animation          = AnimationFactory.Create(animation, out m_AABB);
     Animation.Location = location;
     Animation.RandomizeStartFrame();
     FeetLoc = location + new Vector2(AABB.X + AABB.Width / 2, AABB.Bottom);
 }
Example #4
0
        public DefenderStruct(int id)
        {
            ID              = id;
            Name            = "<NAME NOT SET>";
            Desc            = "<DESC NOT SET>";
            HP              = 0;
            IsMelee         = true;
            MeleeSightRange = 48;
            SpawnDelay      = 1500;
            ArmorType       = eArmorType.Medium;
            Velocity        = 1.5f;
            HPRegen         = 0;
            IsGround        = true;

            Weapons = new List <WeaponStruct>();

            AnimationType = eAnimation.None;
            DrawColor     = Color.White;
        }
Example #5
0
        public RunnerStruct(int id)
        {
            ID = id;

            Name         = "<NAME NOT SET>";
            HP           = 0;
            HPRegen      = 0;
            Velocity     = 0f;
            IsMelee      = true;
            IsGround     = true;
            Bounty       = 0;
            Recycles     = false;
            FinishDamage = 1;
            Armor        = eArmorType.Medium;

            ImmuneStun = ImmuneSlow = ImmuneRooted = ImmuneArmorReduction = false;
            Weapons    = new List <WeaponStruct>();

            AnimationType = eAnimation.None;
            DrawColor     = Color.White;
        }
Example #6
0
#pragma warning restore 1591


		/// <summary>
		/// Converts the Animation option into a string.
		/// </summary>
		/// <param name="animation">Animation option to convert</param>
		/// <returns>Converted string</returns>
		public static string AnimationToString(eAnimation animation) {
			switch (animation) {
				case eAnimation.None: return "";
				case eAnimation.Blind: return "blind";
				case eAnimation.Bounce: return "bounce";
				case eAnimation.Clip: return "clip";
				case eAnimation.Drop: return "drop";
				case eAnimation.Explode: return "explode";
				case eAnimation.Fade: return "fade";
				case eAnimation.Fold: return "fold";
				case eAnimation.Highlight: return "highlight";
				case eAnimation.Puff: return "puff";
				case eAnimation.Pulsate: return "pulsate";
				case eAnimation.Scale: return "scale";
				case eAnimation.Shake: return "shake";
				case eAnimation.Size: return "size";
				case eAnimation.Slide: return "slide";
				case eAnimation.Transfer: return "transfer";
			}

			throw new ArgumentException(string.Format("Animation has an invalid value ({0}).", animation.ToString()));
		}
        public static SimpleASprite Create(eAnimation animationType, out SimpleASprite run, out SimpleASprite attack, out SimpleASprite die, out Rectangle relativeAABB, out Texture2D icon)
        {
            run = attack = die = null;
            SimpleASprite result = null;

            icon = null;
            switch (animationType)
            {
            case eAnimation.Smoke1:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "smoke1_96x48_12", 96, 48, 12, 1, 32);
                relativeAABB = new Rectangle(0, 0, 96, 48);
                break;

            case eAnimation.Tree1:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "tree1_128px_8", 128, 128, 8, 1, int.MaxValue);
                relativeAABB = new Rectangle(0, 0, 128, 128);
                break;

            case eAnimation.Tree2:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "tree2_128px_8", 128, 128, 8, 1, int.MaxValue);
                relativeAABB = new Rectangle(0, 0, 128, 128);
                break;

            case eAnimation.Tree3:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "tree3_128px_8", 128, 128, 8, 1, int.MaxValue);
                relativeAABB = new Rectangle(0, 0, 128, 128);
                break;

            case eAnimation.Castle1:
                string tex = "castle1a_192x256";
                if (Maths.Chance(50))
                {
                    tex = "castle1b_192x256";
                }
                result = new SimpleASprite(Common.InvalidVector2, SpritePath + tex, 192, 256, 1, 1, int.MaxValue);
                result.ExtraDrawOffset = new Vector2(0, -96);
                relativeAABB           = new Rectangle(0, 96, 192, 192);
                break;

            case eAnimation.WindMill1:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "windmill128px", 128, 128, 1, 1, int.MaxValue);
                relativeAABB = new Rectangle(0, 0, 128, 128);
                break;

            case eAnimation.WindMill2:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "windmill192px", 192, 192, 1, 1, int.MaxValue);
                relativeAABB = new Rectangle(0, 0, 192, 192);
                break;

            case eAnimation.PileOfGold:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "pileOfGold", 64, 64, 1, 1, int.MaxValue);
                relativeAABB = new Rectangle(0, 0, 64, 64);
                break;

            case eAnimation.Crocy:
                run    = new SimpleASprite(Common.InvalidVector2, SpritePath + "CrocyRun128px_8", 128, 128, 8, 1, 128);
                attack = new SimpleASprite(Common.InvalidVector2, SpritePath + "CrocyAttack128px_11", 128, 128, 11, 1, 128);
                die    = new SimpleASprite(Common.InvalidVector2, SpritePath + "CrocyDie128px_11", 128, 128, 11, 1, 128)
                {
                    LoopOnce = true
                };
                relativeAABB = new Rectangle(32, 32, 64, 64);
                break;

            case eAnimation.Soldier01:
                run    = new SimpleASprite(Common.InvalidVector2, SpritePath + "soldier01Run128px_8", 128, 128, 8, 1, 128);
                attack = new SimpleASprite(Common.InvalidVector2, SpritePath + "soldier01Attack128px_13", 128, 128, 13, 1, 128);
                die    = new SimpleASprite(Common.InvalidVector2, SpritePath + "soldier01Die128px_8", 128, 128, 8, 1, 128)
                {
                    LoopOnce = true
                };
                relativeAABB = new Rectangle(32, 32, 64, 64);
                icon         = Common.str2Tex("Icons/soldier1");
                break;

            case eAnimation.Test1:
                result       = new SimpleASprite(Common.InvalidVector2, SpritePath + "luziaWalk64xpx_8", 64, 64, 8, 1, 96);
                relativeAABB = new Rectangle(0, 8, 64, 48);
                break;

            case eAnimation.Tower1:
                result = new SimpleASprite(Common.InvalidVector2, SpritePath + "tower", 63, 128, 1, 1, int.MaxValue);
                result.ExtraDrawOffset = new Vector2(0, -64);
                relativeAABB           = new Rectangle(0, 0, 64, 128);
                break;

            default:
                throw new CaseStatementMissingException();
            }

            return(result);
        }