Exemplo n.º 1
0
 public void SetUp(CannonBase cannonBase, Barrel barrel, TextMeshProUGUI name, TextMeshProUGUI text, ItemPicturesResolver resolver)
 {
     _cannonBase   = cannonBase;
     _barrel       = barrel;
     inventoryName = name;
     inventoryText = text;
     _resolver     = resolver;
 }
Exemplo n.º 2
0
        public void Start()
        {
            gameObject.tag  = GameEntityType.Vehicle.ToString();
            _turret         = GetComponentInChildren <Turret>();
            _turret.enabled = false;

            _cannonBase         = GetComponentInChildren <CannonBase>();
            _cannonBase.enabled = false;
        }
Exemplo n.º 3
0
        public static Cannon Get()
        {
            var cannonBase = new CannonBase();
            var cannon     = new Cannon();

            cannon.Base   = cannonBase;
            cannon.Barrel = new Barrel();

            return(cannon);
        }
Exemplo n.º 4
0
    public String GetCannonBaseInfo(CannonBase _cannonBase)
    {
        String type           = "Regular Gun";
        String projectileType = _cannonBase.ProjectileType.ToString();
        String damage         = _cannonBase.Damage.ToString();
        String attack         = _cannonBase.AttackSpeed.ToString();

        return("Type: " + type + "\n"
               + "Projectile Type: " + projectileType + "\n"
               + "Damage: " + damage + "\n" +
               "Attack Speed: " + attack);
    }
Exemplo n.º 5
0
        public List <CannonBase> getAllBaseFromSaveFile(PlayerDataForSafe data)
        {
            var result = new List <CannonBase>();

            for (var i = 0; i < data.Damages.Length; i++)
            {
                var cannonBase = new CannonBase(data.Rangs[i], data.Damages[i], data.AttackSpeeds[i],
                                                data.ProjectileTypes[i], data.ProjectsSpeed[i], data.CannonBaseTypes[i]);
                result.Add(cannonBase);
            }

            return(result);
        }
Exemplo n.º 6
0
        public CannonTurret(Mobile m)
        {
            Owner = m;

            ShotsRemaining = 20;

            Base = new CannonBase(this);
            Base.MoveToWorld(this.Location, this.Map);

            AddonComponent c = new LocalizedAddonComponent(16918, 1155505);

            AddComponent(c, 0, 0, 3);
            Turret = c;

            _NextShot = DateTime.UtcNow;
        }
Exemplo n.º 7
0
        public void GetPart()
        {
            if (_playerData.Money >= 250)
            {
                _playerData.Money -= 250;

                CannonPart part = _cannonPartFactory.GetCommonBoxPart();

                if (part is CannonBase)
                {
                    CannonBase cannonBase = part as CannonBase;
                    Debug.Log("CannonBase: Name = [" + cannonBase.Name + "], Dmg = [" + cannonBase.Damage +
                              "], AS = [" + cannonBase.AttackSpeed + "], PS = [" + cannonBase.ProjectileSpeed +
                              "], Rang = [" + cannonBase.Rang + "]");
                }
                else if (part is Barrel)
                {
                    Barrel barrel = part as Barrel;
                    Debug.Log("Barrel: Name = [" + barrel.Name + "], DmgMult = [" + barrel.DamageMultiplier +
                              "], ASMult = [" + barrel.AttackSpeedMultiplier + "], Addit = [" +
                              barrel.AdditionalShotsAmount +
                              "], Rang = [" + barrel.Rang + "]");
                }

                if (part is CannonBase)
                {
                    _playerData.BaseCannonFragments.Add(part as CannonBase);
                }
                else if (part is Barrel)
                {
                    _playerData.Barrels.Add(part as Barrel);
                }

                money.text = _playerData.Money.ToString();
            }
        }