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 WeaponItem(string name, int sprite, int type, int dropsprite, bool stackable, Attack atk, int atkspd, int weapontype)
 {
     Name = name;
     Sprite = sprite;
     Type = type;
     DropSprite = dropsprite;
     Stackable = stackable;
     ItemRequired = new Dictionary<int, int>();
     Classification = new List<int>();
     Attack = atk;
     AttackSpeed = atkspd;
 }
示例#3
0
 public ToolItem(string name, int type, int sprite, int dropsprite, bool stackable, Dictionary<int, int> required, int subtype, List<int> cla, Attack atk, int atkspd, int weapontype)
 {
     Name = name;
     ToolType = type;
     Sprite = sprite;
     DropSprite = dropsprite;
     Stackable = stackable;
     ItemRequired = required;
     Classification = cla;
     Attack = atk;
     AttackSpeed = atkspd;
     WeaponType = weapontype;
 }
        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;
        }
示例#5
0
 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;
 }