Esempio n. 1
0
        public static new Microb FromMetadata(RangeEnemyMetadata metadata, ContentManager contentManager)
        {
            var microb = new Microb();
            FillWithMetadata(microb, metadata, contentManager);

            microb.Content.AddAnimationRule("Default", () => microb.IsAlive);
            microb.Content.AddAnimationRule("Blow", () => !microb.IsAlive);

            return microb;
        }
Esempio n. 2
0
        public static void FillWithMetadata(RangeEnemy enemy, RangeEnemyMetadata metadata, ContentManager contentManager)
        {
            ObstacleGameObject.FillWithMetadata(enemy, metadata, contentManager);

            enemy.AttackDamage = metadata.AttackDamage;
            enemy.AttackInterval = metadata.AttackInterval;
            enemy.AttackRange = metadata.AttackRange;
            enemy.BulletSpeed = metadata.BulletSpeed;
            enemy.BulletAssetName = metadata.BulletAssetName;

            if(!String.IsNullOrEmpty(metadata.CircleScriptAssetName))
            {
                CircleMovementScript circleScript = CircleMovementScript.FromMetadata(contentManager.Load<CircleScriptMetadata>(metadata.CircleScriptAssetName));
                circleScript.Target = enemy;
                enemy.AddScript(circleScript);
            }

            enemy.AddScript(new RangeEnemyAttackScript(300) { Combatant = enemy });
        }
Esempio n. 3
0
 public static RangeEnemy FromMetadata(RangeEnemyMetadata metadata, ContentManager contentManager)
 {
     var enemy = new RangeEnemy();
     FillWithMetadata(enemy, metadata, contentManager);
     return enemy;
 }