public BasicAttackAction(LivingObject caster, Attack id, int dir, AttackManager am) { Caster = caster; ID = id; Dir = dir; AM = am; switch (Dir) { case 0: X = Caster.X - 1; Y = Caster.Y; break; case 1: X = Caster.X; Y = Caster.Y - 1; break; case 2: X = Caster.X + 1; Y = Caster.Y; break; case 3: X = Caster.X; Y = Caster.Y + 1; break; } Animation = new SpawnAttackAnimation(ID.Animation, X, Y, Dir, false, this); Attacked = false; }
public ShieldAction(LivingObject caster, Attack id, int dir, AttackManager am) { Caster = caster; ID = id; Dir = dir; AM = am; X = Caster.X; Y = Caster.Y; Animation = new SpawnAttackAnimation(ID.Animation, X, Y, Dir, false, this); Attacked = false; Caster.CurrentDefenseAction = this; }
public MainMap() { _minX = -1; _minY = -1; _maxX = -1; _maxY = -1; _y = new List<RowTile>(); _spawnedTerrain = new List<Terrain>(); _spawnedSpawnable = new List<SpawnSpawnable>(); _spawnedSpawnableLocation = new List<List<int>>(); _spawnedLivingObjects = new List<List<List<int>>>(); _drop = new List<List<List<SpawnItems>>>(); AtkM = new AttackManager(this); AnimM = new AnimationManager(); NullList = new List<int>(); LivingThing = new List<LivingObject>(); MiniText = new List<MiniText>(); }
public static AttackAction CreateAttackActionFromAttack(Attack atk, LivingObject caster, AttackManager am) { AttackAction a = null; if (atk is BasicAttack) a = new BasicAttackAction(caster, atk, caster.Dir, am); else if (atk is ShieldAttack) a = new ShieldAction(caster, atk, caster.Dir, am); return a; }