Examples of Bomb


Examples of bomb.Bomb

        if(plane.getState()==PlaneState.DEAD){
            return;
        }
        long delta= System.currentTimeMillis()-startTime;
        if(delta/10000>bombList.size()){
            Bomb newBomb= new Bomb(this);
            bombList.add(newBomb)
            getChildren().add(newBomb);
        }
        clouds.stepSimulation();
        for(Bomb bomb : bombList){ 
View Full Code Here

Examples of com.tommytony.war.structure.Bomb

      if (!quiet) {
        this.broadcast("drop.cake.broadcast", player.getName(), ChatColor.GREEN + cake.getName() + ChatColor.WHITE);
      }
    } else if (this.isBombThief(player.getName())) {
      Bomb bomb = this.getBombForThief(player.getName());

      this.removeBombThief(player.getName());

      // Bring back bomb
      bomb.getVolume().resetBlocks();
      bomb.addBombBlocks();

      if (!quiet) {
        this.broadcast("drop.bomb.broadcast", player.getName(), ChatColor.GREEN + bomb.getName() + ChatColor.WHITE);
      }
    }
  }
View Full Code Here

Examples of com.tommytony.war.structure.Bomb

      return false;
    } else if (!this.isSenderAuthorOfZone(zone)) {
      return true;
    }

    Bomb bomb = zone.getBomb(this.args[0]);
    if (bomb != null) {
      bomb.getVolume().resetBlocks();
      zone.getBombs().remove(bomb);
      WarzoneYmlMapper.save(zone);
      this.msg("Bomb " + bomb.getName() + " removed.");
      War.war.log(this.getSender().getName() + " deleted bomb " + bomb.getName() + " in warzone " + zone.getName(), Level.INFO);
    } else {
      this.badMsg("No such bomb.");
    }

    return true;
View Full Code Here

Examples of com.tommytony.war.structure.Bomb

      return false;
    }

    if (zone.hasBomb(this.args[0])) {
      // move the existing bomb
      Bomb bomb = zone.getBomb(this.args[0]);
      bomb.getVolume().resetBlocks();
      bomb.setLocation(player.getLocation());
      this.msg("Bomb " + bomb.getName() + " was moved.");
      War.war.log(this.getSender().getName() + " moved bomb " + bomb.getName() + " in warzone " + zone.getName(), Level.INFO);
    } else {
      // create a new bomb
      Bomb bomb = new Bomb(this.args[0], zone, player.getLocation());
      zone.getBombs().add(bomb);
      this.msg("Bomb " + bomb.getName() + " created.");
      War.war.log(this.getSender().getName() + " created bomb " + bomb.getName() + " in warzone " + zone.getName(), Level.INFO);
    }

    WarzoneYmlMapper.save(zone);

    return true;
View Full Code Here

Examples of com.tommytony.war.structure.Bomb

            }
            int bombX = warzoneRootSection.getInt(bombPrefix + "x");
            int bombY = warzoneRootSection.getInt(bombPrefix + "y");
            int bombZ = warzoneRootSection.getInt(bombPrefix + "z");
            int bombYaw = warzoneRootSection.getInt(bombPrefix + "yaw");
            Bomb bomb = new Bomb(bombName, warzone, new Location(world, bombX, bombY, bombZ, bombYaw, 0));
            warzone.getBombs().add(bomb);
          }
        }
      }
     
      // cakes
      if (warzoneRootSection.contains(zoneInfoPrefix + "cake")) {
        List<String> cakeNames = warzoneRootSection.getStringList(zoneInfoPrefix + "cake.names");
        for (String cakeName : cakeNames) {
          if (cakeName != null && !cakeName.equals("")) {
            String cakePrefix = zoneInfoPrefix + "cake." + cakeName + ".";
            if (!warzoneRootSection.contains(cakePrefix + "x")) {
              // try lowercase instead
              cakePrefix = zoneInfoPrefix + "cake." + cakeName + ".";
            }
            int cakeX = warzoneRootSection.getInt(cakePrefix + "x");
            int cakeY = warzoneRootSection.getInt(cakePrefix + "y");
            int cakeZ = warzoneRootSection.getInt(cakePrefix + "z");
            int cakeYaw = warzoneRootSection.getInt(cakePrefix + "yaw");
            Cake cake = new Cake(cakeName, warzone, new Location(world, cakeX, cakeY, cakeZ, cakeYaw, 0));
            warzone.getCakes().add(cake);
          }
        }
      }
     
      // teams (maybe no teams)
      if (warzoneRootSection.contains("team.names")) {
        List<String> teamsNames = warzoneRootSection.getStringList("team.names");
        for (String teamName : teamsNames) {
          // team info
          String teamInfoPrefix = "team." + teamName + ".info.";
          if (!warzoneRootSection.contains(teamInfoPrefix + "spawn.x")) {
            // try lowercase instead - supports custom team names
            teamInfoPrefix = "team." + teamName.toLowerCase() + ".info.";
          }
          List<Location> teamSpawns = new ArrayList<Location>();
          if (warzoneRootSection.contains(teamInfoPrefix + "spawn")) {
            int teamX = warzoneRootSection.getInt(teamInfoPrefix + "spawn.x");
            int teamY = warzoneRootSection.getInt(teamInfoPrefix + "spawn.y");
            int teamZ = warzoneRootSection.getInt(teamInfoPrefix + "spawn.z");
            int teamYaw = warzoneRootSection.getInt(teamInfoPrefix + "spawn.yaw");
            Location teamLocation = new Location(world, teamX, teamY, teamZ, teamYaw, 0);
            teamSpawns.add(teamLocation);
            File original = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + ".dat");
            File modified = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + teamSpawns.indexOf(teamLocation) + ".dat");
            File originalSql = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + ".sl3");
            File modifiedSql = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + teamSpawns.indexOf(teamLocation) + ".sl3");
            try {
              original.renameTo(modified);
            } catch (Exception ignored) {
            }
            try {
              originalSql.renameTo(modifiedSql);
            } catch (Exception ignored) {
            }
          }
          if (warzoneRootSection.contains(teamInfoPrefix + "spawns")) {
            for (Map<?, ?> map : warzoneRootSection.getMapList(teamInfoPrefix + "spawns")) {
              int teamX = (Integer) map.get("x");
              int teamY = (Integer) map.get("y");
              int teamZ = (Integer) map.get("z");
              int teamYaw = (Integer) map.get("yaw");
              Location teamLocation = new Location(world, teamX, teamY, teamZ, teamYaw, 0);
              teamSpawns.add(teamLocation);
            }
          }
 
          Team team = new Team(teamName, TeamKind.teamKindFromString(teamName), teamSpawns, warzone);
          warzone.getTeams().add(team);
         
          if (warzoneRootSection.contains(teamInfoPrefix + "flag")) {
            int flagX = warzoneRootSection.getInt(teamInfoPrefix + "flag.x");
            int flagY = warzoneRootSection.getInt(teamInfoPrefix + "flag.y");
            int flagZ = warzoneRootSection.getInt(teamInfoPrefix + "flag.z");
            int flagYaw = warzoneRootSection.getInt(teamInfoPrefix + "flag.yaw");
            Location flagLocation = new Location(world, flagX, flagY, flagZ, flagYaw, 0);
            team.setTeamFlag(flagLocation);
          }
         
          String teamConfigPrefix = "team." + teamName + ".config";
          if (warzoneRootSection.contains(teamConfigPrefix)) {
            // team specific config
            ConfigurationSection teamConfigSection = warzoneRootSection.getConfigurationSection(teamConfigPrefix);
            team.getTeamConfig().loadFrom(teamConfigSection);
          } else if (warzoneRootSection.contains(teamConfigPrefix.toLowerCase())) {
            // try lowercase instead
            ConfigurationSection teamConfigSection = warzoneRootSection.getConfigurationSection(teamConfigPrefix.toLowerCase());
            team.getTeamConfig().loadFrom(teamConfigSection);
          }
         
          // LIFEPOOL INITIALIZATION HERE
          team.setRemainingLives(team.getTeamConfig().resolveInt(TeamConfig.LIFEPOOL));
         
          String teamLoadoutPrefix = "team." + teamName + ".loadout";
          if (warzoneRootSection.contains(teamLoadoutPrefix)) {
            // team specific loadouts
            ConfigurationSection loadoutsSection = warzoneRootSection.getConfigurationSection(teamLoadoutPrefix);
            team.getInventories().setLoadouts(LoadoutYmlMapper.fromConfigToLoadouts(loadoutsSection, new HashMap<String, HashMap<Integer, ItemStack>>()));
          } else if (warzoneRootSection.contains(teamLoadoutPrefix.toLowerCase())) {
            // try lowercase instead
            ConfigurationSection loadoutsSection = warzoneRootSection.getConfigurationSection(teamLoadoutPrefix.toLowerCase());
            team.getInventories().setLoadouts(LoadoutYmlMapper.fromConfigToLoadouts(loadoutsSection, new HashMap<String, HashMap<Integer, ItemStack>>()));
          }
         
          String teamRewardPrefix = "team." + teamName + ".reward";
          if (warzoneRootSection.contains(teamRewardPrefix)) {
            // team specific reward
            ConfigurationSection rewardsSection = warzoneRootSection.getConfigurationSection(teamRewardPrefix);
            HashMap<Integer, ItemStack> reward = new HashMap<Integer, ItemStack>();
            LoadoutYmlMapper.fromConfigToLoadout(rewardsSection, reward, "default");
            warzone.getDefaultInventories().setReward(reward);
          } else if (warzoneRootSection.contains(teamRewardPrefix.toLowerCase())) {
            // try lowercase instead
            ConfigurationSection rewardsSection = warzoneRootSection.getConfigurationSection(teamRewardPrefix.toLowerCase());
            HashMap<Integer, ItemStack> reward = new HashMap<Integer, ItemStack>();
            LoadoutYmlMapper.fromConfigToLoadout(rewardsSection, reward, "default");
            warzone.getDefaultInventories().setReward(reward);
          }
        }
      }
      Connection connection = null;
      try {
        connection = ZoneVolumeMapper.getZoneConnection(warzone.getVolume(), warzone.getName(), warzone.getWorld());
      } catch (SQLException e) {
        War.war.getLogger().log(Level.WARNING, "Failed to load warzone structures volume", e);
      }
      // monument blocks
      for (Monument monument : warzone.getMonuments()) {
        try {
          monument.setVolume(warzone.loadStructure(monument.getName(), connection));
        } catch (SQLException e) {
          War.war.getLogger().log(Level.WARNING, "Failed to load warzone structures volume", e);
        }
      }
     
      // bomb blocks
      for (Bomb bomb : warzone.getBombs()) {
        try {
          bomb.setVolume(warzone.loadStructure("bomb-" + bomb.getName(), connection));
        } catch (SQLException e) {
          War.war.getLogger().log(Level.WARNING, "Failed to load warzone structures volume", e);
        }
      }
     
View Full Code Here

Examples of com.tommytony.war.structure.Bomb

          // detect audacious thieves
          War.war.badMsg(player, "zone.stealextra.bomb");
        } else if (warzone.isFlagThief(player.getName()) || warzone.isCakeThief(player.getName())) {
          War.war.badMsg(player, "zone.stealextra.other");
        } else {
          Bomb bomb = warzone.getBombForBlock(block);
          // player just broke the bomb block: cancel to avoid drop, give player the block, set block to air
          ItemStack tntBlock = new ItemStack(Material.TNT);
          tntBlock.setDurability((short)8);
          player.getInventory().clear();
          player.getInventory().addItem(tntBlock);
          warzone.addBombThief(bomb, player.getName());
          block.setType(Material.AIR);
          for (Team t : warzone.getTeams()) {
            t.teamcast("zone.steal.bomb.broadcast", team.getKind().getColor() + player.getName() + ChatColor.WHITE, ChatColor.GREEN + bomb.getName() + ChatColor.WHITE);
            if (War.war.isSpoutServer()) {
              for (Player p : t.getPlayers()) {
                SpoutPlayer sp = SpoutManager.getPlayer(p);
                if (sp.isSpoutCraftEnabled()) {
                          sp.sendNotification(
                              SpoutDisplayer.cleanForNotification(team.getKind().getColor() + player.getName() + ChatColor.YELLOW + " has "),
                              SpoutDisplayer.cleanForNotification(ChatColor.YELLOW + "bomb " + ChatColor.GREEN + bomb.getName() + ChatColor.YELLOW + "!"),
                              Material.TNT,
                              (short)0,
                              5000);
                }
              }
            }
            t.teamcast("zone.steal.bomb.prevent", team.getKind().getColor() + player.getName() + ChatColor.WHITE);
          }
          War.war.msg(player, "zone.steal.bomb.notice", bomb.getName());
        }
        event.setCancelled(true);
        return;
      } else if (team != null && warzone.isCakeBlock(block)) {
        if (warzone.isCakeThief(player.getName())) {
View Full Code Here

Examples of com.tommytony.war.structure.Bomb

        }
       
        if (inEnemySpawn && playerTeam.getPlayers().contains(player)) {
          // Made sure player is still part of team, game may have ended while waiting.
          // Ignored the scorers that happened immediately after the game end.
          Bomb bomb = playerWarzone.getBombForThief(player.getName());
         
          // Boom!
          if (!playerWarzone.getWarzoneConfig().getBoolean(WarzoneConfig.UNBREAKABLE)) {
            // Don't blow up if warzone is unbreakable
            playerWarzone.getWorld().createExplosion(player.getLocation(), 2F);
          }
         
          if (playerWarzone.isReinitializing()) {
            // Battle already ended or interrupted
            playerWarzone.respawnPlayer(event, playerTeam, player);
          } else {
            // All good - proceed with scoring
            playerTeam.addPoint();
           
            // Notify everyone
            for (Team t : playerWarzone.getTeams()) {
              if (War.war.isSpoutServer()) {
                for (Player p : t.getPlayers()) {
                  SpoutPlayer sp = SpoutManager.getPlayer(p);
                  if (sp.isSpoutCraftEnabled()) {
                            sp.sendNotification(
                                SpoutDisplayer.cleanForNotification(playerTeam.getKind().getColor() + player.getName() + ChatColor.YELLOW + " blew up "),
                                SpoutDisplayer.cleanForNotification(victim.getKind().getColor() + victim.getName() + ChatColor.YELLOW + "'s spawn!"),
                                victim.getKind().getMaterial(),
                                victim.getKind().getData(),
                                10000);
                  }
                }
              }
              t.teamcast("zone.bomb.broadcast", playerTeam.getKind().getColor() + player.getName() + ChatColor.WHITE,
                  victim.getName(), playerTeam.getName());
            }
           
            // Detect win conditions
            if (playerTeam.getPoints() >= playerTeam.getTeamConfig().resolveInt(TeamConfig.MAXSCORE)) {
              if (playerWarzone.hasPlayerState(player.getName())) {
                playerWarzone.restorePlayerState(player);
              }
              playerWarzone.handleScoreCapReached(playerTeam.getName());
              event.setTo(playerWarzone.getTeleport());
            } else {
              // just added a point
             
              // restore bombed team's spawn
              for (Volume spawnVolume : victim.getSpawnVolumes().values()) {
                spawnVolume.resetBlocks();
              }
              victim.initializeTeamSpawns();
             
              // bring back tnt
              bomb.getVolume().resetBlocks();
              bomb.addBombBlocks();
             
              playerWarzone.respawnPlayer(event, playerTeam, player);
              playerTeam.resetSign();
              playerWarzone.getLobby().resetTeamGateSign(playerTeam);
            }         
View Full Code Here

Examples of com.tommytony.war.structure.Bomb

          } else {
            defenderWarzone.handleKill(a, d, event.getDamager());
          }
        } else if (defenderWarzone.isBombThief(d.getName()) && d.getLocation().distance(a.getLocation()) < 2) {
          // Close combat, close enough to detonate         
          Bomb bomb = defenderWarzone.getBombForThief(d.getName());
                   
          // Kill the bomber
          WarPlayerDeathEvent event1 = new WarPlayerDeathEvent(defenderWarzone, d, null, event.getCause());
          War.war.getServer().getPluginManager().callEvent(event1);
          defenderWarzone.handleDeath(d);
         
          if (defenderWarzone.getWarzoneConfig().getBoolean(WarzoneConfig.REALDEATHS)) {
            // and respawn him and remove from deadmen (cause realdeath + handleDeath means no respawn and getting queued up for onPlayerRespawn)
            defenderWarzone.getReallyDeadFighters().remove(d.getName());
            defenderWarzone.respawnPlayer(defenderTeam, d);
          }
         
          // Blow up bomb
          if (!defenderWarzone.getWarzoneConfig().getBoolean(WarzoneConfig.UNBREAKABLE)) {
            defenderWarzone.getWorld().createExplosion(a.getLocation(), 2F);
          }

          // bring back tnt
          bomb.getVolume().resetBlocks();
          bomb.addBombBlocks();
         
          // Notify everyone
          for (Team t : defenderWarzone.getTeams()) {
            t.sendAchievement(attackerTeam.getKind().getColor() + a.getName() + ChatColor.YELLOW + " made ",
                defenderTeam.getKind().getColor() + d.getName() + ChatColor.YELLOW + " blow up!", new ItemStack(Material.TNT), 10000);
View Full Code Here

Examples of org.sfsoft.jfighter2dx.powerups.Bomb

   
    Powerup powerup = null;
   
    switch (type) {
      case BOMB:
        powerup = new Bomb(1000, new Random().nextInt(SCREEN_HEIGHT - ITEM_HEIGHT), -100f);
        break;
      case SHIELD:
        powerup = new Shield(1000, new Random().nextInt(SCREEN_HEIGHT - ITEM_HEIGHT), -100f);
        break;
    }
View Full Code Here

Examples of pl.edu.pw.elka.mmarkiew.model.entities.enemies.Bomb

   * @return Appropriate Bomb object
   */
  public static Bomb createBombEntity(final float x, final float y,
                              final long plantTime, final long timer, final int area)
  {
    return new Bomb(GameEntities.BOMB.getAnim().clone(),
              GameEntities.BOMB.getWidth(), GameEntities.BOMB.getHeight(), x, y, plantTime, timer, area);
  }
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.