private void InitSpells() { //testing function Action <List <Sprite> > spell = (sprites) => { var fireballAnimation = new Dictionary <string, Animation>() { { "fireball", new Animation(State.Content.Load <Texture2D>("Projectiles/fireball"), 1, 6) { FrameSpeed = 0.05f } } }; var animation = new AnimationSprite(fireballAnimation, GlobalOrigin); animation.Position -= animation.Origin * animation.Scale; sprites.Add(animation); }; Func <bool> canExecute = () => { return(true); }; Spellbar.Add(SpellDepository.TrippleFireball(this)); Spellbar.Add(new Spell(spell, 15, State.Content.Load <Texture2D>("Projectiles/projectile"), 1)); Spellbar.Add(new Spell(spell, 20, State.Content.Load <Texture2D>("Projectiles/fireball_icon"), 1)); Spellbar.Add(new Spell(spell, 25, State.Content.Load <Texture2D>("Projectiles/projectile"), 1)); }
public Enemy(Dictionary <string, Animation> animations, Vector2 position, EnemyType type) : base(animations, position) { autoAttack = SpellDepository.RangeAutoAttack(this); Spells = new List <Spell>(); InitSpells(); Scale = 1f; baseSpeed = 1.5f; Faction = Faction.ENEMY; XPDrop = 20; movementAI = new MovementAI(CollisionPolygon, this); EnemyType = type; currentState = new WanderState(this); SightRange = 600; autoAttackRange = 350; baseAttackSpeed = 2f; Debug.Assert(SightRange > autoAttackRange, "Cant shoot target, when u dont see it."); }
private void InitAutoattack() { autoAttack = SpellDepository.RangeAutoAttack(this); }