EnemySniper.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:What-Happened-to-Station-7 作者:
/**
 * Picks a player to attack
 */
public void attack()
{
    Player weakest = null;

    for (Entity e : getLevel().getEntities())
        if (e.isActive() && e instanceof Player)
            if (!getLevel().isThroughWall(getLocation(), e.getLocation()))
            {
                Player p = (Player) e;
                if (weakest == null || p.getHealth() < weakest.getHealth())
                    weakest = p;
            }

    weakest.takeDamage(75);

    try
    {
        SoundStuff cam = new SoundStuff();
        cam.AWP();
    }
    catch (UnsupportedAudioFileException | IOException | LineUnavailableException e1)
    {
        e1.printStackTrace();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号