Examples of Weapon


Examples of gwlpr.database.entities.Weapon

        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Weaponset persistentWeaponset = em.find(Weaponset.class, weaponset.getWeaponsetPK());
            Weapon weaponsOld = persistentWeaponset.getWeapons();
            Weapon weaponsNew = weaponset.getWeapons();
            Character characterOld = persistentWeaponset.getCharacter();
            Character characterNew = weaponset.getCharacter();
            if (weaponsNew != null) {
                weaponsNew = em.getReference(weaponsNew.getClass(), weaponsNew.getId());
                weaponset.setWeapons(weaponsNew);
            }
            if (characterNew != null) {
                characterNew = em.getReference(characterNew.getClass(), characterNew.getId());
                weaponset.setCharacter(characterNew);
            }
            weaponset = em.merge(weaponset);
            if (weaponsOld != null && !weaponsOld.equals(weaponsNew)) {
                weaponsOld.getWeaponsetCollection().remove(weaponset);
                weaponsOld = em.merge(weaponsOld);
            }
            if (weaponsNew != null && !weaponsNew.equals(weaponsOld)) {
                weaponsNew.getWeaponsetCollection().add(weaponset);
                weaponsNew = em.merge(weaponsNew);
            }
            if (characterOld != null && !characterOld.equals(characterNew)) {
                characterOld.getWeaponsetCollection().remove(weaponset);
                characterOld = em.merge(characterOld);
View Full Code Here

Examples of gwlpr.database.entities.Weapon

                weaponset = em.getReference(Weaponset.class, id);
                weaponset.getWeaponsetPK();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The weaponset with id " + id + " no longer exists.", enfe);
            }
            Weapon weapons = weaponset.getWeapons();
            if (weapons != null) {
                weapons.getWeaponsetCollection().remove(weaponset);
                weapons = em.merge(weapons);
            }
            Character character = weaponset.getCharacter();
            if (character != null) {
                character.getWeaponsetCollection().remove(weaponset);
View Full Code Here

Examples of javaEffect.weapon.Weapon

    int number = 0;
    int weaponsMax = (int) (Math.random() * 12);
    do {

      double rand = Math.random();
      Weapon weapon = null;

      if (0.0 <= rand && rand < 0.3)// 30%
      {
        weapon = new Weapon("M1", 60, 2000);
      } else if (0.3 <= rand && rand < 0.6)// 30%
      {
        weapon = new Weapon("M2", 80, 3000);
      } else if (0.6 <= rand && rand < 0.8)// 20%
      {
        weapon = new Weapon("M3", 90, 4000);
      } else if (0.8 <= rand && rand < 0.9)// 10%
      {
        weapon = new Weapon("M4", 110, 5000);
      } else if (0.90 <= rand && rand < 0.95)// 5%
      {
        weapon = new Weapon("M5", 150, 6000);
      } else if (0.95 <= rand && rand < 1.0)// 5%
      {
        weapon = new Weapon("M6", 200, 7000);
      }

      weaponList.add(weapon);
      number++;

View Full Code Here

Examples of megamek.common.weapons.Weapon

            EntityAction ea = i.nextElement();
            if (ea instanceof WeaponAttackAction) {
                WeaponAttackAction waa = (WeaponAttackAction) ea;
                Entity ae = game.getEntity(waa.getEntityId());
                Mounted m = ae.getEquipment(waa.getWeaponId());
                Weapon w = (Weapon) m.getType();
                AttackHandler ah = w.fire(waa, game, this);
                if (ah != null) {
                    game.addAttack(ah);
                }
            }
        }
View Full Code Here

Examples of tyrelion.itemsystem.Weapon

      String imageInv = e.getChildTextNormalize("imageInv");
     
      if ("food".equals(type)) {
        item = new Food(id, name, new Image(imageWorld), new Image(imageInv), stackable);
      } else if ("weapon".equals(type)) {
        item = new Weapon(id, name, new Image(imageWorld), new Image(imageInv), stackable);
      }
      items[i] = item;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.